From 39e9519ce70f31d9c1376b9a90f983a4988da95f Mon Sep 17 00:00:00 2001 From: Adam A Date: Thu, 4 Jul 2024 13:50:06 +0300 Subject: [PATCH] fix(chain): add Block#id and Transaction#id getters --- src/Chain.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Chain.ts b/src/Chain.ts index 33b983ee72..ffb69e6c7e 100644 --- a/src/Chain.ts +++ b/src/Chain.ts @@ -272,6 +272,8 @@ export abstract class Block { get chainId () { return this.chain?.id } /** Unique ID of block. */ readonly hash?: string + /** Unique ID of block. */ + get id () { return this.hash } /** Unique identifying hash of block. */ readonly height?: bigint /** Contents of block header. */ @@ -300,6 +302,8 @@ export class Transaction { get chainId () { return this.block?.chain?.id } /** Unique identifying hash of transaction. */ readonly hash?: string + /** Unique ID of block. */ + get id () { return this.hash } /** Any custom data attached to the transaction. */ readonly data?: unknown }