Skip to main content
Version: Next

Namespace: v2hash

References​

calculateL2MessageTxHash​

Re-exports calculateL2MessageTxHash

Functions​

computeHashOnElements​

â–¸ computeHashOnElements(data): string

Compute pedersen hash from data

Parameters​

NameType
dataBigNumberish[]

Returns​

string

format: hex-string - pedersen hash

Defined in​

src/utils/hash/transactionHash/v2.ts:17


calculateTransactionHashCommon​

â–¸ calculateTransactionHashCommon(txHashPrefix, version, contractAddress, entryPointSelector, calldata, maxFee, chainId, additionalData?): string

Calculate transaction pedersen hash for common properties

Following implementation is based on this python implementation #

Parameters​

NameTypeDefault value
txHashPrefixTransactionHashPrefixundefined
versionBigNumberishundefined
contractAddressBigNumberishundefined
entryPointSelectorBigNumberishundefined
calldataRawCalldataundefined
maxFeeBigNumberishundefined
chainIdStarknetChainIdundefined
additionalDataBigNumberish[][]

Returns​

string

format: hex-string

Defined in​

src/utils/hash/transactionHash/v2.ts:29


calculateDeclareTransactionHash​

â–¸ calculateDeclareTransactionHash(classHash, senderAddress, version, maxFee, chainId, nonce, compiledClassHash?): string

Calculate declare transaction hash

Parameters​

NameTypeDescription
classHashstringhex-string
senderAddressBigNumberish-
versionBigNumberish-
maxFeeBigNumberish-
chainIdStarknetChainId-
nonceBigNumberish-
compiledClassHash?stringhex-string

Returns​

string

format: hex-string

Defined in​

src/utils/hash/transactionHash/v2.ts:59


calculateDeployAccountTransactionHash​

â–¸ calculateDeployAccountTransactionHash(contractAddress, classHash, constructorCalldata, salt, version, maxFee, chainId, nonce): string

Calculate deploy_account transaction hash

Parameters​

NameType
contractAddressBigNumberish
classHashBigNumberish
constructorCalldataRawCalldata
saltBigNumberish
versionBigNumberish
maxFeeBigNumberish
chainIdStarknetChainId
nonceBigNumberish

Returns​

string

format: hex-string

Defined in​

src/utils/hash/transactionHash/v2.ts:84


calculateTransactionHash​

â–¸ calculateTransactionHash(contractAddress, version, calldata, maxFee, chainId, nonce): string

Calculate invoke transaction hash

Parameters​

NameType
contractAddressBigNumberish
versionBigNumberish
calldataRawCalldata
maxFeeBigNumberish
chainIdStarknetChainId
nonceBigNumberish

Returns​

string

format: hex-string

Defined in​

src/utils/hash/transactionHash/v2.ts:112