TransactionHashDeclareV1
Calculates the transaction hash for a Declare V1 transaction using the deprecated Pedersen-based hash calculation.
Function Signature
func TransactionHashDeclareV1(
txn *rpc.DeclareTxnV1,
chainID *felt.Felt,
) (*felt.Felt, error)Parameters
txn- The Declare V1 transaction containing:Version- Transaction version stringSenderAddress- Address of the account declaring the classClassHash- Hash of the contract class being declaredMaxFee- Maximum fee willing to payNonce- Account nonce
chainID- The Starknet chain ID
Returns
*felt.Felt- The calculated transaction hasherror- Error if required parameters are missing
Description
This function calculates the transaction hash for deprecated Declare V1 transactions. It uses the Pedersen hash algorithm and is maintained for compatibility with historical transactions. Internally calls CalculateDeprecatedTransactionHashCommon.
Specification
Follows the V1 Declare hash calculation specification.
Related Functions
- TransactionHashDeclareV2 - V2 variant with compiled class hash
- TransactionHashDeclareV3 - Current V3 standard
- ClassHash - Calculate class hashes

