Namespace: v2hash
References
calculateL2MessageTxHash
Re-exports calculateL2MessageTxHash
Functions
computeHashOnElements
▸ computeHashOnElements(data
): string
Compute pedersen hash from data
Parameters
Name | Type |
---|---|
data | BigNumberish [] |
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
Name | Type | Default value |
---|---|---|
txHashPrefix | "0x6465636c617265" | "0x6465706c6f79" | "0x6465706c6f795f6163636f756e74" | "0x696e766f6b65" | "0x6c315f68616e646c6572" | undefined |
version | BigNumberish | undefined |
contractAddress | BigNumberish | undefined |
entryPointSelector | BigNumberish | undefined |
calldata | RawCalldata | undefined |
maxFee | BigNumberish | undefined |
chainId | "0x534e5f4d41494e" | "0x534e5f5345504f4c4941" | undefined |
additionalData | BigNumberish [] | [] |
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
Name | Type | Description |
---|---|---|
classHash | string | hex-string |
senderAddress | BigNumberish | - |
version | BigNumberish | - |
maxFee | BigNumberish | - |
chainId | "0x534e5f4d41494e" | "0x534e5f5345504f4c4941" | - |
nonce | BigNumberish | - |
compiledClassHash? | string | hex-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
Name | Type |
---|---|
contractAddress | BigNumberish |
classHash | BigNumberish |
constructorCalldata | RawCalldata |
salt | BigNumberish |
version | BigNumberish |
maxFee | BigNumberish |
chainId | "0x534e5f4d41494e" | "0x534e5f5345504f4c4941" |
nonce | BigNumberish |
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
Name | Type |
---|---|
contractAddress | BigNumberish |
version | BigNumberish |
calldata | RawCalldata |
maxFee | BigNumberish |
chainId | "0x534e5f4d41494e" | "0x534e5f5345504f4c4941" |
nonce | BigNumberish |
Returns
string
format: hex-string