/** * Borsh serialization schemas for NEAR transactions using Zorsh * Based on NEAR Protocol specification and near-api-js implementation * * This module handles the low-level binary serialization details and keeps * all Zorsh-specific types internal. External code should only use the * serializeTransaction and serializeSignedTransaction functions. */ import { b } from "@zorsh/zorsh"; import type { DelegateAction } from "./actions.js"; import type { Ed25519PublicKey, Ed25519Signature, MlDsa65PublicKey, MlDsa65Signature, PublicKey, Secp256k1PublicKey, Secp256k1Signature, Signature, SignedTransaction, Transaction } from "./types.js"; /** * Prefix for delegate actions (NEP-366 meta transactions) * Value: 2^30 + 366 = 1073742190 * * This prefix is prepended to DelegateAction when serializing for signing, * ensuring delegate action signatures are always distinguishable from * transaction signatures. */ export declare const DELEGATE_ACTION_PREFIX = 1073742190; /** * Prefix for V2 delegate actions (gas-key meta transactions, NEP-611). * Value: 2^30 + 611 = 1073742435 * * This is the NEP-461 domain tag for `DelegateActionV2`. It is DISTINCT from * {@link DELEGATE_ACTION_PREFIX}, so a V1 delegate signature is never valid for * a V2 delegate action and vice versa. */ export declare const DELEGATE_ACTION_V2_PREFIX = 1073742435; /** * PublicKey enum (0 = Ed25519, 1 = Secp256k1, 2 = ML-DSA-65) */ export declare const PublicKeySchema: import("@zorsh/zorsh").Schema<{ ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }, string>; /** * Signature enum (0 = Ed25519, 1 = Secp256k1, 2 = ML-DSA-65) */ export declare const SignatureSchema: import("@zorsh/zorsh").Schema<{ ed25519Signature: { data: number[]; }; } | { secp256k1Signature: { data: number[]; }; } | { mlDsa65Signature: { data: number[]; }; }, string>; /** * Function call permission with optional allowance */ declare const FunctionCallPermissionSchema: import("@zorsh/zorsh").Schema<{ allowance: bigint | null; receiverId: string; methodNames: string[]; }, string>; /** * FunctionCallPermission type inferred from the Borsh schema. */ export type FunctionCallPermissionBorsh = b.infer; /** * Gas key information (protocol v85 / NEAR 2.13). * * Gas keys are access keys with a prepaid balance used to pay for gas. A single * gas key allocates `numNonces` independent nonce slots so it can sign multiple * transactions in parallel. * * Field order matches nearcore `GasKeyInfo { balance: u128, num_nonces: u16 }`. */ declare const GasKeyInfoSchema: import("@zorsh/zorsh").Schema<{ balance: bigint; numNonces: number; }, string>; /** * AccessKeyPermission enum. * * Variant order is the Borsh discriminant and MUST match nearcore: * 0 = FunctionCall, 1 = FullAccess, 2 = GasKeyFunctionCall, 3 = GasKeyFullAccess. */ export declare const AccessKeyPermissionSchema: import("@zorsh/zorsh").Schema<{ functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }, string>; /** * GasKeyInfo type inferred from the Borsh schema. */ export type GasKeyInfoBorsh = b.infer; /** * AccessKeyPermission type inferred from schema */ export type AccessKeyPermissionBorsh = b.infer; /** * CreateAccount action (empty struct) */ declare const CreateAccountSchema: import("@zorsh/zorsh").Schema<{}, string>; /** * DeployContract action with WASM code */ declare const DeployContractSchema: import("@zorsh/zorsh").Schema<{ code: Uint8Array; }, string>; /** * FunctionCall action * Field order: methodName, args, gas, deposit */ declare const FunctionCallSchema: import("@zorsh/zorsh").Schema<{ methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }, string>; /** * Transfer action with deposit amount */ declare const TransferSchema: import("@zorsh/zorsh").Schema<{ deposit: bigint; }, string>; /** * Stake action with amount and validator public key */ declare const StakeSchema: import("@zorsh/zorsh").Schema<{ stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }, string>; /** * AddKey action to add a new access key */ declare const AddKeySchema: import("@zorsh/zorsh").Schema<{ publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }, string>; /** * DeleteKey action to remove an access key */ declare const DeleteKeySchema: import("@zorsh/zorsh").Schema<{ publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }, string>; /** * DeleteAccount action with beneficiary */ declare const DeleteAccountSchema: import("@zorsh/zorsh").Schema<{ beneficiaryId: string; }, string>; /** * TransferToGasKey action (protocol v85 / NEAR 2.13). * * Funds a gas key's prepaid balance. Mirrors nearcore * `TransferToGasKeyAction { public_key: PublicKey, deposit: u128 }`. */ declare const TransferToGasKeySchema: import("@zorsh/zorsh").Schema<{ publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }, string>; /** * WithdrawFromGasKey action (protocol v85 / NEAR 2.13). * * Withdraws NEAR from a gas key's balance back to the account. Mirrors nearcore * `WithdrawFromGasKeyAction { public_key: PublicKey, amount: u128 }`. Note the * second field is `amount`, not `deposit`. */ declare const WithdrawFromGasKeySchema: import("@zorsh/zorsh").Schema<{ publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }, string>; /** * DeployGlobalContract action */ declare const DeployGlobalContractSchema: import("@zorsh/zorsh").Schema<{ code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }, string>; /** * UseGlobalContract action */ declare const UseGlobalContractSchema: import("@zorsh/zorsh").Schema<{ contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }, string>; /** * DeterministicAccountStateInitV1 struct * Contains the initialization state for a deterministic account */ declare const DeterministicAccountStateInitV1Schema: import("@zorsh/zorsh").Schema<{ code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }, string>; /** * DeterministicAccountStateInit enum (versioned) * V1 is the first version */ declare const DeterministicAccountStateInitSchema: import("@zorsh/zorsh").Schema<{ V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }, string>; /** * DeterministicStateInit action (NEP-616) * Used to deploy a contract with a deterministically derived account ID */ declare const DeterministicStateInitSchema: import("@zorsh/zorsh").Schema<{ stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }, string>; /** * TransactionNonce enum (NEAR 2.13). * * Variant order is the Borsh discriminant and MUST match nearcore: * 0 = `Nonce { nonce: u64 }` (ordinary access keys), * 1 = `GasKeyNonce { nonce: u64, nonce_index: u16 }` (gas keys). */ export declare const TransactionNonceSchema: import("@zorsh/zorsh").Schema<{ nonce: { nonce: bigint; }; } | { gasKeyNonce: { nonce: bigint; nonceIndex: number; }; }, string>; /** * NonceMode enum (NEAR 2.13). * * Variant order is the Borsh discriminant and MUST match nearcore: * 0 = `Monotonic` (default; any nonce strictly greater than the access key * nonce), 1 = `Strict` (nonce must be exactly `ak_nonce + 1`). */ export declare const NonceModeSchema: import("@zorsh/zorsh").Schema<{ monotonic: {}; } | { strict: {}; }, string>; /** * ClassicActions enum - the actions allowed inside a DelegateAction (NEP-366), * mirroring nearcore's `NonDelegateAction` which wraps the full `Action` enum. * * The Borsh discriminants MUST match `Action` exactly. A zorsh enum assigns * discriminants positionally, so slot 8 (`Action::Delegate`) is kept as a * placeholder to keep slots 9..=13 aligned with the protocol; it is never * emitted because delegate actions cannot be nested. The gas-key actions * therefore land at their true discriminants 12 and 13. */ declare const ClassicActionsSchema: import("@zorsh/zorsh").Schema<{ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { delegatePlaceholder: {}; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; }, string>; /** * ClassicAction type - actions that can be used within a DelegateAction. * * Excludes the `delegatePlaceholder` (discriminant-alignment-only) variant so * callers cannot construct a nested delegate action, which the protocol forbids. */ export type ClassicAction = Exclude, { delegatePlaceholder: unknown; }>; /** * SignedDelegate - a delegate action with signature */ declare const SignedDelegateSchema: import("@zorsh/zorsh").Schema<{ delegateAction: { senderId: string; receiverId: string; actions: ({ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { delegatePlaceholder: {}; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; })[]; nonce: bigint; maxBlockHeight: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; signature: { ed25519Signature: { data: number[]; }; } | { secp256k1Signature: { data: number[]; }; } | { mlDsa65Signature: { data: number[]; }; }; }, string>; /** * Actions allowed inside a DelegateActionV2, mirroring nearcore's * `NonDelegateAction` (which wraps the full `Action` enum and rejects nested * delegates at runtime). * * The Borsh discriminants MUST match the corresponding `Action` variants. A * zorsh enum assigns discriminants positionally, so slot 8 (`Action::Delegate`) * is kept as a placeholder to keep slots 9..=13 aligned with the protocol; it is * never emitted because delegate actions cannot be nested. Both delegate * variants are intentionally absent: slot 8 (`Delegate`) is a placeholder and * slot 14 (`DelegateV2`) is simply not listed, since a delegate action cannot * contain another delegate action. */ declare const NonDelegateActionSchema: import("@zorsh/zorsh").Schema<{ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { delegatePlaceholder: {}; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; }, string>; /** * DelegateActionV2 struct (NEAR 2.13). * * Field order matches nearcore `DelegateActionV2`: sender_id, receiver_id, * actions, nonce (a {@link TransactionNonceSchema}), max_block_height, public_key. */ declare const DelegateActionV2Schema: import("@zorsh/zorsh").Schema<{ senderId: string; receiverId: string; actions: ({ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { delegatePlaceholder: {}; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; })[]; nonce: { nonce: { nonce: bigint; }; } | { gasKeyNonce: { nonce: bigint; nonceIndex: number; }; }; maxBlockHeight: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }, string>; /** * VersionedSignedDelegateAction struct (NEAR 2.13). * * The payload carried by `Action::DelegateV2`: a versioned delegate-action * payload plus its signature. */ declare const VersionedSignedDelegateActionSchema: import("@zorsh/zorsh").Schema<{ delegateAction: { v2: { senderId: string; receiverId: string; actions: ({ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { delegatePlaceholder: {}; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; })[]; nonce: { nonce: { nonce: bigint; }; } | { gasKeyNonce: { nonce: bigint; nonceIndex: number; }; }; maxBlockHeight: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; }; signature: { ed25519Signature: { data: number[]; }; } | { secp256k1Signature: { data: number[]; }; } | { mlDsa65Signature: { data: number[]; }; }; }, string>; /** * Actions allowed inside a DelegateActionV2. Excludes the * `delegatePlaceholder` (discriminant-alignment-only) variant so callers cannot * construct a nested delegate action. */ export type NonDelegateActionBorsh = Exclude, { delegatePlaceholder: unknown; }>; export type DelegateActionV2Borsh = b.infer; export type VersionedSignedDelegateActionBorsh = b.infer; /** * Action enum matching NEAR protocol action discriminants * Order matters! Each position corresponds to the action type index: * 0 = CreateAccount * 1 = DeployContract * 2 = FunctionCall * 3 = Transfer * 4 = Stake * 5 = AddKey * 6 = DeleteKey * 7 = DeleteAccount * 8 = SignedDelegate * 9 = DeployGlobalContract * 10 = UseGlobalContract * 11 = DeterministicStateInit (NEP-616) * 12 = TransferToGasKey (protocol v85 / NEAR 2.13) * 13 = WithdrawFromGasKey (protocol v85 / NEAR 2.13) * 14 = DelegateV2 (protocol v85 / NEAR 2.13) */ export declare const ActionSchema: import("@zorsh/zorsh").Schema<{ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; } | { signedDelegate: { delegateAction: { senderId: string; receiverId: string; actions: ({ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { delegatePlaceholder: {}; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; })[]; nonce: bigint; maxBlockHeight: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; signature: { ed25519Signature: { data: number[]; }; } | { secp256k1Signature: { data: number[]; }; } | { mlDsa65Signature: { data: number[]; }; }; }; } | { delegateV2: { delegateAction: { v2: { senderId: string; receiverId: string; actions: ({ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { delegatePlaceholder: {}; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; })[]; nonce: { nonce: { nonce: bigint; }; } | { gasKeyNonce: { nonce: bigint; nonceIndex: number; }; }; maxBlockHeight: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; }; signature: { ed25519Signature: { data: number[]; }; } | { secp256k1Signature: { data: number[]; }; } | { mlDsa65Signature: { data: number[]; }; }; }; }, string>; /** * Action type inferred from the Borsh schema * This is the single source of truth for action types */ export type Action = b.infer; export type TransferAction = { transfer: b.infer; }; export type FunctionCallAction = { functionCall: b.infer; }; export type CreateAccountAction = { createAccount: b.infer; }; export type DeleteAccountAction = { deleteAccount: b.infer; }; export type DeployContractAction = { deployContract: b.infer; }; export type StakeAction = { stake: b.infer; }; export type AddKeyAction = { addKey: b.infer; }; export type DeleteKeyAction = { deleteKey: b.infer; }; export type DeployGlobalContractAction = { deployGlobalContract: b.infer; }; export type UseGlobalContractAction = { useGlobalContract: b.infer; }; export type SignedDelegateAction = { signedDelegate: b.infer; }; export type DeterministicStateInitAction = { deterministicStateInit: b.infer; }; export type TransferToGasKeyAction = { transferToGasKey: b.infer; }; export type WithdrawFromGasKeyAction = { withdrawFromGasKey: b.infer; }; export type DelegateV2Action = { delegateV2: b.infer; }; export type StateInit = b.infer; export type StateInitV1 = b.infer; export { DeterministicAccountStateInitSchema, DeterministicAccountStateInitV1Schema, }; /** * Transaction schema * Field order: signerId, publicKey, nonce, receiverId, blockHash, actions */ export declare const TransactionSchema: import("@zorsh/zorsh").Schema<{ signerId: string; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; nonce: bigint; receiverId: string; blockHash: number[]; actions: ({ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; } | { signedDelegate: { delegateAction: { senderId: string; receiverId: string; actions: ({ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { delegatePlaceholder: {}; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; })[]; nonce: bigint; maxBlockHeight: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; signature: { ed25519Signature: { data: number[]; }; } | { secp256k1Signature: { data: number[]; }; } | { mlDsa65Signature: { data: number[]; }; }; }; } | { delegateV2: { delegateAction: { v2: { senderId: string; receiverId: string; actions: ({ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { delegatePlaceholder: {}; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; })[]; nonce: { nonce: { nonce: bigint; }; } | { gasKeyNonce: { nonce: bigint; nonceIndex: number; }; }; maxBlockHeight: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; }; signature: { ed25519Signature: { data: number[]; }; } | { secp256k1Signature: { data: number[]; }; } | { mlDsa65Signature: { data: number[]; }; }; }; })[]; }, string>; /** * SignedTransaction schema */ export declare const SignedTransactionSchema: import("@zorsh/zorsh").Schema<{ transaction: { signerId: string; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; nonce: bigint; receiverId: string; blockHash: number[]; actions: ({ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; } | { signedDelegate: { delegateAction: { senderId: string; receiverId: string; actions: ({ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { delegatePlaceholder: {}; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; })[]; nonce: bigint; maxBlockHeight: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; signature: { ed25519Signature: { data: number[]; }; } | { secp256k1Signature: { data: number[]; }; } | { mlDsa65Signature: { data: number[]; }; }; }; } | { delegateV2: { delegateAction: { v2: { senderId: string; receiverId: string; actions: ({ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { delegatePlaceholder: {}; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; })[]; nonce: { nonce: { nonce: bigint; }; } | { gasKeyNonce: { nonce: bigint; nonceIndex: number; }; }; maxBlockHeight: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; }; signature: { ed25519Signature: { data: number[]; }; } | { secp256k1Signature: { data: number[]; }; } | { mlDsa65Signature: { data: number[]; }; }; }; })[]; }; signature: { ed25519Signature: { data: number[]; }; } | { secp256k1Signature: { data: number[]; }; } | { mlDsa65Signature: { data: number[]; }; }; }, string>; /** * TransactionV1 schema (NEAR 2.13). * * Same shape as V0 but the `nonce` is a {@link TransactionNonceSchema} and a * trailing `nonceMode` is appended. Field order matches nearcore `TransactionV1`: * signer_id, public_key, nonce, receiver_id, block_hash, actions, nonce_mode. * * This serializes the struct ALONE (no version tag); use * {@link serializeTransactionV1} to get the tagged wire bytes. */ export declare const TransactionV1Schema: import("@zorsh/zorsh").Schema<{ signerId: string; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; nonce: { nonce: { nonce: bigint; }; } | { gasKeyNonce: { nonce: bigint; nonceIndex: number; }; }; receiverId: string; blockHash: number[]; actions: ({ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; } | { signedDelegate: { delegateAction: { senderId: string; receiverId: string; actions: ({ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { delegatePlaceholder: {}; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; })[]; nonce: bigint; maxBlockHeight: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; signature: { ed25519Signature: { data: number[]; }; } | { secp256k1Signature: { data: number[]; }; } | { mlDsa65Signature: { data: number[]; }; }; }; } | { delegateV2: { delegateAction: { v2: { senderId: string; receiverId: string; actions: ({ stake: { stake: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { createAccount: {}; } | { deployContract: { code: Uint8Array; }; } | { functionCall: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }; } | { transfer: { deposit: bigint; }; } | { addKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; accessKey: { nonce: bigint; permission: { functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; } | { fullAccess: {}; } | { gasKeyFunctionCall: { gasKeyInfo: { balance: bigint; numNonces: number; }; functionCall: { allowance: bigint | null; receiverId: string; methodNames: string[]; }; }; } | { gasKeyFullAccess: { gasKeyInfo: { balance: bigint; numNonces: number; }; }; }; }; }; } | { deleteKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; } | { deleteAccount: { beneficiaryId: string; }; } | { delegatePlaceholder: {}; } | { deployGlobalContract: { code: Uint8Array; deployMode: { AccountId: {}; } | { CodeHash: {}; }; }; } | { useGlobalContract: { contractIdentifier: { AccountId: string; } | { CodeHash: number[]; }; }; } | { deterministicStateInit: { stateInit: { V1: { code: { AccountId: string; } | { CodeHash: number[]; }; data: Map, Uint8Array>; }; }; deposit: bigint; }; } | { transferToGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; deposit: bigint; }; } | { withdrawFromGasKey: { publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; amount: bigint; }; })[]; nonce: { nonce: { nonce: bigint; }; } | { gasKeyNonce: { nonce: bigint; nonceIndex: number; }; }; maxBlockHeight: bigint; publicKey: { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; }; }; signature: { ed25519Signature: { data: number[]; }; } | { secp256k1Signature: { data: number[]; }; } | { mlDsa65Signature: { data: number[]; }; }; }; })[]; nonceMode: { monotonic: {}; } | { strict: {}; }; }, string>; export type TransactionNonceBorsh = b.infer; export type NonceModeBorsh = b.infer; /** * Convert our PublicKey type to zorsh-compatible format. * * @internal Exported for use in action helpers only. */ export declare function publicKeyToZorsh(pk: Ed25519PublicKey): { ed25519Key: { data: number[]; }; }; export declare function publicKeyToZorsh(pk: Secp256k1PublicKey): { secp256k1Key: { data: number[]; }; }; export declare function publicKeyToZorsh(pk: MlDsa65PublicKey): { mlDsa65Key: { data: number[]; }; }; export declare function publicKeyToZorsh(pk: PublicKey): { ed25519Key: { data: number[]; }; } | { secp256k1Key: { data: number[]; }; } | { mlDsa65Key: { data: number[]; }; }; /** * Convert our Signature type to zorsh-compatible format. * * @internal Exported for use in action helpers only. */ export declare function signatureToZorsh(sig: Ed25519Signature): { ed25519Signature: { data: number[]; }; }; export declare function signatureToZorsh(sig: Secp256k1Signature): { secp256k1Signature: { data: number[]; }; }; export declare function signatureToZorsh(sig: MlDsa65Signature): { mlDsa65Signature: { data: number[]; }; }; export declare function signatureToZorsh(sig: Signature): { ed25519Signature: { data: number[]; }; } | { secp256k1Signature: { data: number[]; }; } | { mlDsa65Signature: { data: number[]; }; }; /** * Serialize a transaction to bytes */ export declare function serializeTransaction(tx: Transaction): Uint8Array; /** * Serialize a signed transaction to bytes */ export declare function serializeSignedTransaction(signedTx: SignedTransaction): Uint8Array; /** * The V1 fields of a transaction, mirroring nearcore `TransactionV1`. * * `nonce` is a {@link TransactionNonceBorsh} (carries a nonce index for gas * keys) and `nonceMode` controls validation. The remaining fields match the * ordinary {@link Transaction}. */ export interface TransactionV1 { signerId: string; publicKey: PublicKey; nonce: TransactionNonceBorsh; receiverId: string; blockHash: Uint8Array; actions: Action[]; nonceMode: NonceModeBorsh; } /** * Serialize a V1 transaction to wire bytes (`[0x01] ++ borsh(TransactionV1)`). * * Use this for the signing payload of a gas-key or strict-nonce transaction. A * V0 transaction stays tag-less via {@link serializeTransaction}; never write a * `0x00` tag for V0 (that would break backward compatibility). */ export declare function serializeTransactionV1(tx: TransactionV1): Uint8Array; /** * Serialize a signed V1 transaction to wire bytes. * * The encoding is `[0x01] ++ borsh(TransactionV1) ++ borsh(Signature)`: the * version tag belongs to the inner `Transaction`, and the signature follows the * (tagged) transaction, matching nearcore's `SignedTransaction` borsh. */ export declare function serializeSignedTransactionV1(tx: TransactionV1, signature: Signature): Uint8Array; /** * Serialize a delegate action for signing * * Per NEP-461, this prepends a u32 prefix (2^30 + 366) before the delegate action, * ensuring signed delegate actions are never identical to signed transactions. * * Use this to serialize a DelegateAction before signing. The resulting bytes are hashed * and signed to create the signature, which is then combined with the DelegateAction * using the `signedDelegate()` helper to create a SignedDelegateAction. * * @param delegateAction - The delegate action to serialize * @returns Uint8Array - The prefixed and serialized delegate action * * @example * ```typescript * const encoded = serializeDelegateAction(delegateAction) * const hash = await crypto.subtle.digest("SHA-256", encoded) * const signature = await signer.sign(new Uint8Array(hash)) * ``` */ export declare function serializeDelegateAction(delegateAction: DelegateAction): Uint8Array; /** * Serialize a V2 delegate action for signing (NEP-611 / NEAR 2.13). * * Prepends the DISTINCT V2 domain tag ({@link DELEGATE_ACTION_V2_PREFIX}) and * wraps the action in the versioned payload enum (`V2` => `[0x00]`), exactly as * nearcore's `VersionedDelegateActionPayload::get_nep461_hash` does. The result * is hashed (SHA-256) and signed. * * @param delegateAction - The V2 delegate action in Borsh-ready form (its * `publicKey` already converted via {@link publicKeyToZorsh}). */ export declare function serializeDelegateActionV2(delegateAction: DelegateActionV2Borsh): Uint8Array; export type DelegateActionPayloadFormat = "base64" | "bytes"; type DelegatePayloadReturn = F extends "bytes" ? Uint8Array : string; /** * Encode a SignedDelegateAction for transport. * * - Default output is a base64 string that can be sent via JSON/HTTP. * - Pass `"bytes"` to receive a raw Uint8Array (useful for binary transports). */ export declare function encodeSignedDelegateAction(signedDelegate: SignedDelegateAction): string; export declare function encodeSignedDelegateAction(signedDelegate: SignedDelegateAction, format: F): DelegatePayloadReturn; /** * Decode an encoded payload (base64 string or bytes) back into the * SignedDelegateAction that `.delegate()` returns. */ export declare function decodeSignedDelegateAction(payload: string | Uint8Array): SignedDelegateAction; /** * Encode a V2 signed delegate action ({@link DelegateV2Action}) for transport. * * - Default output is a base64 string that can be sent via JSON/HTTP. * - Pass `"bytes"` to receive a raw Uint8Array. */ export declare function encodeSignedDelegateActionV2(signedDelegate: DelegateV2Action): string; export declare function encodeSignedDelegateActionV2(signedDelegate: DelegateV2Action, format: F): DelegatePayloadReturn; /** * Decode an encoded V2 payload (base64 string or bytes) back into a * {@link DelegateV2Action}. */ export declare function decodeSignedDelegateActionV2(payload: string | Uint8Array): DelegateV2Action; //# sourceMappingURL=schema.d.ts.map