Skip to content

Commit

Permalink
fix(chain): add Block#id and Transaction#id getters
Browse files Browse the repository at this point in the history
  • Loading branch information
egasimus committed Jul 4, 2024
1 parent 2b08819 commit 39e9519
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 39e9519

Please sign in to comment.