Namespace: hash
Namespaces​
Variables​
transactionVersion​
• Const
transactionVersion: 1n
Defined in​
transactionVersion_2​
• Const
transactionVersion_2: 2n
Defined in​
feeTransactionVersion​
• Const
feeTransactionVersion: bigint
Defined in​
feeTransactionVersion_2​
• Const
feeTransactionVersion_2: bigint
Defined in​
Functions​
getVersionsByType​
â–¸ getVersionsByType(versionType?
): Object
Return versions based on version type, default transaction versions
Parameters​
Name | Type | Description |
---|---|---|
versionType? | "fee" | "transaction" | 'fee' | 'transaction' |
Returns​
Object
versions { v1: bigint; v2: bigint; }
Name | Type |
---|---|
v1 | bigint |
v2 | bigint |
Defined in​
computeHashOnElements​
â–¸ computeHashOnElements(data
): string
Parameters​
Name | Type |
---|---|
data | BigNumberish [] |
Returns​
string
Defined in​
calculateTransactionHashCommon​
â–¸ calculateTransactionHashCommon(txHashPrefix
, version
, contractAddress
, entryPointSelector
, calldata
, maxFee
, chainId
, additionalData?
): string
Parameters​
Name | Type | Default value |
---|---|---|
txHashPrefix | TransactionHashPrefix | undefined |
version | BigNumberish | undefined |
contractAddress | BigNumberish | undefined |
entryPointSelector | BigNumberish | undefined |
calldata | RawCalldata | undefined |
maxFee | BigNumberish | undefined |
chainId | StarknetChainId | undefined |
additionalData | BigNumberish [] | [] |
Returns​
string
Defined in​
calculateDeployTransactionHash​
â–¸ calculateDeployTransactionHash(contractAddress
, constructorCalldata
, version
, chainId
, constructorName?
): string
Parameters​
Name | Type | Default value |
---|---|---|
contractAddress | BigNumberish | undefined |
constructorCalldata | RawCalldata | undefined |
version | BigNumberish | undefined |
chainId | StarknetChainId | undefined |
constructorName | string | 'constructor' |
Returns​
string
Defined in​
calculateDeclareTransactionHash​
â–¸ calculateDeclareTransactionHash(classHash
, senderAddress
, version
, maxFee
, chainId
, nonce
, compiledClassHash?
): string
Parameters​
Name | Type |
---|---|
classHash | string |
senderAddress | BigNumberish |
version | BigNumberish |
maxFee | BigNumberish |
chainId | StarknetChainId |
nonce | BigNumberish |
compiledClassHash? | string |
Returns​
string
Defined in​
calculateDeployAccountTransactionHash​
â–¸ calculateDeployAccountTransactionHash(contractAddress
, classHash
, constructorCalldata
, salt
, version
, maxFee
, chainId
, nonce
): string
Parameters​
Name | Type |
---|---|
contractAddress | BigNumberish |
classHash | BigNumberish |
constructorCalldata | RawCalldata |
salt | BigNumberish |
version | BigNumberish |
maxFee | BigNumberish |
chainId | StarknetChainId |
nonce | BigNumberish |
Returns​
string
Defined in​
calculateTransactionHash​
â–¸ calculateTransactionHash(contractAddress
, version
, calldata
, maxFee
, chainId
, nonce
): string
Parameters​
Name | Type |
---|---|
contractAddress | BigNumberish |
version | BigNumberish |
calldata | RawCalldata |
maxFee | BigNumberish |
chainId | StarknetChainId |
nonce | BigNumberish |
Returns​
string
Defined in​
calculateContractAddressFromHash​
â–¸ calculateContractAddressFromHash(salt
, classHash
, constructorCalldata
, deployerAddress
): string
Parameters​
Name | Type |
---|---|
salt | BigNumberish |
classHash | BigNumberish |
constructorCalldata | RawArgs |
deployerAddress | BigNumberish |
Returns​
string
Defined in​
formatSpaces​
â–¸ formatSpaces(json
): string
Parameters​
Name | Type |
---|---|
json | string |
Returns​
string
Defined in​
default​
â–¸ default(compiledContract
): string
Parameters​
Name | Type |
---|---|
compiledContract | LegacyCompiledContract |
Returns​
string
Defined in​
computeLegacyContractClassHash​
â–¸ computeLegacyContractClassHash(contract
): string
Parameters​
Name | Type |
---|---|
contract | string | LegacyCompiledContract |
Returns​
string
Defined in​
computeCompiledClassHash​
â–¸ computeCompiledClassHash(casm
): string
Parameters​
Name | Type |
---|---|
casm | CairoAssembly |
Returns​
string
Defined in​
computeSierraContractClassHash​
â–¸ computeSierraContractClassHash(sierra
): string
Parameters​
Name | Type |
---|---|
sierra | CompiledSierra |
Returns​
string
Defined in​
computeContractClassHash​
â–¸ computeContractClassHash(contract
): string
Compute ClassHash (sierra or legacy) based on provided contract
Parameters​
Name | Type | Description |
---|---|---|
contract | string | CompiledContract | CompiledContract | CompiledSierra | string |
Returns​
string
HexString ClassHash
Defined in​
keccakBn​
â–¸ keccakBn(value
): string
Keccak hash BigNumberish value
Parameters​
Name | Type | Description |
---|---|---|
value | BigNumberish | BigNumberish |
Returns​
string
string - hexadecimal string
Defined in​
starknetKeccak​
â–¸ starknetKeccak(value
): bigint
Function to get the starknet keccak hash from a string
Parameters​
Name | Type | Description |
---|---|---|
value | string | string you want to get the starknetKeccak hash from |
Returns​
bigint
starknet keccak hash as BigNumber
Defined in​
getSelectorFromName​
â–¸ getSelectorFromName(funcName
): string
Function to get the hex selector from a given function name
Parameters​
Name | Type | Description |
---|---|---|
funcName | string | selectors abi function name |
Returns​
string
hex selector of given abi function name
Defined in​
getSelector​
â–¸ getSelector(value
): string
Function to get hex selector from function name, decimal string or hex string
Parameters​
Name | Type | Description |
---|---|---|
value | string | hex string | decimal string | string |
Returns​
string
Hex selector