Skip to content

TransactionHashDeployAccountV3

Calculates the transaction hash for a Deploy Account V3 transaction with resource bounds using the Poseidon hash algorithm.

Function Signature

func TransactionHashDeployAccountV3(
    txn *rpc.DeployAccountTxnV3,
    contractAddress *felt.Felt,
    chainID *felt.Felt,
) (*felt.Felt, error)

Parameters

  • txn - The Deploy Account V3 transaction containing:
    • Version - Transaction version string
    • ClassHash - Hash of the account contract class
    • ContractAddressSalt - Salt used in address calculation
    • ConstructorCalldata - Constructor parameters
    • Nonce - Account nonce (usually 0 for deployment)
    • ResourceBounds - Resource bounds for L1 gas, L2 gas, and L1 data gas
    • Tip - Additional fee tip
    • PayMasterData - Optional paymaster data
    • FeeMode - Fee data availability mode
    • NonceDataMode - Nonce data availability mode
  • contractAddress - The precomputed contract address
  • chainID - The Starknet chain ID

Returns

  • *felt.Felt - The calculated transaction hash
  • error - Error if required parameters are missing

Description

This function calculates the transaction hash for Deploy Account V3 transactions using the Poseidon hash algorithm. V3 introduces resource bounds, data availability modes, and paymaster support.

Internally uses:

Specification

Follows the V3 Deploy Account hash calculation specification.

Related Functions