Skip to content

TransactionHashDeployAccountV1

Calculates the transaction hash for a Deploy Account V1 transaction using the deprecated Pedersen-based hash calculation.

Function Signature

func TransactionHashDeployAccountV1(
    txn *rpc.DeployAccountTxnV1,
    contractAddress *felt.Felt,
    chainID *felt.Felt,
) (*felt.Felt, error)

Parameters

  • txn - The Deploy Account V1 transaction containing:
    • Version - Transaction version string
    • ClassHash - Hash of the account contract class
    • ContractAddressSalt - Salt used in address calculation
    • ConstructorCalldata - Constructor parameters
    • MaxFee - Maximum fee willing to pay
    • Nonce - Account nonce (usually 0 for deployment)
  • 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 deprecated Deploy Account V1 transactions. It uses the Pedersen hash algorithm and is maintained for compatibility with historical transactions. Internally calls CalculateDeprecatedTransactionHashCommon.

Specification

Follows the V1 Deploy Account hash calculation specification.

Related Functions