Skip to content

TransactionHashInvokeV0

Calculates the transaction hash for an Invoke V0 transaction using the deprecated Pedersen-based hash calculation.

Function Signature

func TransactionHashInvokeV0(
    txn *rpc.InvokeTxnV0,
    chainID *felt.Felt,
) (*felt.Felt, error)

Parameters

  • txn - The Invoke V0 transaction containing:
    • Version - Transaction version string
    • ContractAddress - Address of the contract being invoked
    • EntryPointSelector - Selector of the function to call
    • Calldata - Array of felt values as function parameters
    • MaxFee - Maximum fee willing to pay
  • 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 Invoke V0 transactions. It uses the Pedersen hash algorithm and is maintained for compatibility with historical transactions. Internally calls CalculateDeprecatedTransactionHashCommon.

Related Functions