Accounts
Helper utilities for deriving account data from addresses or transactions.
Account = {
shard: bigint
realm: bigint
num: bigint
}
AccountLike = Account | string
Returns a hex representation of the provided account id.
hethers.utils.getAddressFromAccount('0.0.1')
// 0x0000000000000000000000000000000000000001
hethers.utils.getAccountFromAddress('0x0000000000000000000000000000000000000001')
// { shard: 0n, realm: 0n, num: 1n }
hethers.utils.parseAccount('0x0000000000000000000000000000000000000001')
// { shard: 0n, realm: 0n, num: 1n }
hethers.utils.parseAccount('0.0.1')
// { shard: 0n, realm: 0n, num: 1n }
hethers.utils.asAccountString('0x0000000000000000000000000000000000000001')
// '0.0.1'
Accepts a valid TransactionId and extracts the accountId of the transation sender. Throws an
INVALID_ARGUMENT
error If an invalid transactionId is provided.hethers.utils.getAccountFromTransactionId("[email protected]")
// 0.0.99999999
Last modified 1yr ago