Skip to main content
Version: Next

Namespace: v2hash

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:16


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:28


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:58


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:83


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:111