Skip to content

TransactionHashBroadcastDeclareV3

Calculates the transaction hash for a Broadcast Declare V3 transaction using the Poseidon hash algorithm.

Function Signature

func TransactionHashBroadcastDeclareV3(
    txn *rpc.BroadcastDeclareTxnV3,
    chainID *felt.Felt,
) (*felt.Felt, error)

Parameters

  • txn - The Broadcast Declare V3 transaction containing:
    • Version - Transaction version string
    • SenderAddress - Address of the account declaring the class
    • ContractClass - The Sierra contract class being declared
    • CompiledClassHash - Hash of the compiled (CASM) class
    • Nonce - Account nonce
    • ResourceBounds - Resource bounds for L1 gas, L2 gas, and L1 data gas
    • Tip - Additional fee tip
    • PayMasterData - Optional paymaster data
    • AccountDeploymentData - Optional account deployment data
    • FeeMode - Fee data availability mode
    • NonceDataMode - Nonce data availability mode
  • 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 Broadcast Declare V3 transactions. It's similar to TransactionHashDeclareV3 but works with BroadcastDeclareTxnV3 which includes the full contract class instead of just the class hash.

Used by: account.TransactionHashDeclare() method

Specification

Follows the V3 Declare hash calculation specification and SNIP-8.

Related Functions