import { PublicKey } from '@meer-js/crypto'; import { Action, SignedDelegate } from './actions.js'; import { IDelegateAction } from './types.js'; import { ISignatureTx } from './ISignatureTx'; /** * Borsh-encode a delegate action for inclusion as an action within a meta transaction * @param delegateAction Delegate action to be signed by the meta transaction sender */ export declare function encodeDelegateAction(delegateAction: IDelegateAction): Uint8Array; /** * Borsh-encode a signed delegate for validation and execution by a relayer * @param signedDelegate Signed delegate to be executed in a meta transaction */ export declare function encodeSignedDelegate(signedDelegate: SignedDelegate): Uint8Array; /** * Borsh-encode a transaction or signed transaction into a serialized form. * @param transaction The transaction or signed transaction object to be encoded. * @returns A serialized representation of the input transaction. */ export declare function encodeTransaction(transaction: Transaction): Uint8Array; /** * Borsh-decode a Transaction instance from a buffer * @param bytes Uint8Array data to be decoded */ export declare function decodeTransaction(bytes: Uint8Array): ITransaction; /** * Borsh-decode a SignedTransaction instance from a buffer * @param bytes Uint8Array data to be decoded */ export declare function decodeSignedTransaction(bytes: Uint8Array): ISignedTransaction; export interface ITransaction { signerId: string; publicKey: PublicKey; nonce: bigint; receiverId: string; actions: Action[]; blockHash: Uint8Array; encode(): Uint8Array; decode(bytes: Uint8Array): ITransaction; } export declare class Transaction { signerId: string; publicKey: PublicKey; nonce: bigint; receiverId: string; actions: Action[]; blockHash: Uint8Array; constructor({ signerId, publicKey, nonce, receiverId, actions, blockHash }: { signerId: string; publicKey: PublicKey; nonce: bigint; receiverId: string; actions: Action[]; blockHash: Uint8Array; }); encode(): Uint8Array; static decode(bytes: Uint8Array): ITransaction; } export interface ISignedTransaction { transaction: ITransaction; signature: ISignatureTx; encode(): Uint8Array; } export declare class SignedTransaction { transaction: Transaction; signature: ISignatureTx; constructor({ transaction, signature }: { transaction: Transaction; signature: ISignatureTx; }); encode(): Uint8Array; static decode(bytes: Uint8Array): ISignedTransaction; } export declare const SCHEMA: { Ed25519Signature: { struct: { data: { array: { type: string; len: number; }; }; }; }; Secp256k1Signature: { struct: { data: { array: { type: string; len: number; }; }; }; }; Signature: { enum: ({ struct: { ed25519Signature: string; secp256k1Signature?: undefined; }; } | { struct: { secp256k1Signature: string; ed25519Signature?: undefined; }; })[]; }; Ed25519Data: { struct: { data: { array: { type: string; len: number; }; }; }; }; Secp256k1Data: { struct: { data: { array: { type: string; len: number; }; }; }; }; PublicKey: { enum: ({ struct: { ed25519Key: string; secp256k1Key?: undefined; }; } | { struct: { secp256k1Key: string; ed25519Key?: undefined; }; })[]; }; FunctionCallPermission: { struct: { allowance: { option: string; }; receiverId: string; methodNames: { array: { type: string; }; }; }; }; FullAccessPermission: { struct: {}; }; AccessKeyPermission: { enum: ({ struct: { functionCall: string; fullAccess?: undefined; }; } | { struct: { fullAccess: string; functionCall?: undefined; }; })[]; }; AccessKey: { struct: { nonce: string; permission: string; }; }; CreateAccount: { struct: {}; }; DeployContract: { struct: { code: { array: { type: string; }; }; }; }; FunctionCall: { struct: { methodName: string; args: { array: { type: string; }; }; gas: string; deposit: string; }; }; Transfer: { struct: { deposit: string; }; }; Stake: { struct: { stake: string; publicKey: string; }; }; AddKey: { struct: { publicKey: string; accessKey: string; }; }; DeleteKey: { struct: { publicKey: string; }; }; DeleteAccount: { struct: { beneficiaryId: string; }; }; DelegateActionPrefix: { struct: { prefix: string; }; }; ClassicActions: { enum: ({ struct: { createAccount: string; deployContract?: undefined; functionCall?: undefined; transfer?: undefined; stake?: undefined; addKey?: undefined; deleteKey?: undefined; deleteAccount?: undefined; }; } | { struct: { deployContract: string; createAccount?: undefined; functionCall?: undefined; transfer?: undefined; stake?: undefined; addKey?: undefined; deleteKey?: undefined; deleteAccount?: undefined; }; } | { struct: { functionCall: string; createAccount?: undefined; deployContract?: undefined; transfer?: undefined; stake?: undefined; addKey?: undefined; deleteKey?: undefined; deleteAccount?: undefined; }; } | { struct: { transfer: string; createAccount?: undefined; deployContract?: undefined; functionCall?: undefined; stake?: undefined; addKey?: undefined; deleteKey?: undefined; deleteAccount?: undefined; }; } | { struct: { stake: string; createAccount?: undefined; deployContract?: undefined; functionCall?: undefined; transfer?: undefined; addKey?: undefined; deleteKey?: undefined; deleteAccount?: undefined; }; } | { struct: { addKey: string; createAccount?: undefined; deployContract?: undefined; functionCall?: undefined; transfer?: undefined; stake?: undefined; deleteKey?: undefined; deleteAccount?: undefined; }; } | { struct: { deleteKey: string; createAccount?: undefined; deployContract?: undefined; functionCall?: undefined; transfer?: undefined; stake?: undefined; addKey?: undefined; deleteAccount?: undefined; }; } | { struct: { deleteAccount: string; createAccount?: undefined; deployContract?: undefined; functionCall?: undefined; transfer?: undefined; stake?: undefined; addKey?: undefined; deleteKey?: undefined; }; })[]; }; DelegateAction: { struct: { senderId: string; receiverId: string; actions: { array: { type: string; }; }; nonce: string; maxBlockHeight: string; publicKey: string; }; }; SignedDelegate: { struct: { delegateAction: string; signature: string; }; }; Action: { enum: ({ struct: { createAccount: string; deployContract?: undefined; functionCall?: undefined; transfer?: undefined; stake?: undefined; addKey?: undefined; deleteKey?: undefined; deleteAccount?: undefined; signedDelegate?: undefined; }; } | { struct: { deployContract: string; createAccount?: undefined; functionCall?: undefined; transfer?: undefined; stake?: undefined; addKey?: undefined; deleteKey?: undefined; deleteAccount?: undefined; signedDelegate?: undefined; }; } | { struct: { functionCall: string; createAccount?: undefined; deployContract?: undefined; transfer?: undefined; stake?: undefined; addKey?: undefined; deleteKey?: undefined; deleteAccount?: undefined; signedDelegate?: undefined; }; } | { struct: { transfer: string; createAccount?: undefined; deployContract?: undefined; functionCall?: undefined; stake?: undefined; addKey?: undefined; deleteKey?: undefined; deleteAccount?: undefined; signedDelegate?: undefined; }; } | { struct: { stake: string; createAccount?: undefined; deployContract?: undefined; functionCall?: undefined; transfer?: undefined; addKey?: undefined; deleteKey?: undefined; deleteAccount?: undefined; signedDelegate?: undefined; }; } | { struct: { addKey: string; createAccount?: undefined; deployContract?: undefined; functionCall?: undefined; transfer?: undefined; stake?: undefined; deleteKey?: undefined; deleteAccount?: undefined; signedDelegate?: undefined; }; } | { struct: { deleteKey: string; createAccount?: undefined; deployContract?: undefined; functionCall?: undefined; transfer?: undefined; stake?: undefined; addKey?: undefined; deleteAccount?: undefined; signedDelegate?: undefined; }; } | { struct: { deleteAccount: string; createAccount?: undefined; deployContract?: undefined; functionCall?: undefined; transfer?: undefined; stake?: undefined; addKey?: undefined; deleteKey?: undefined; signedDelegate?: undefined; }; } | { struct: { signedDelegate: string; createAccount?: undefined; deployContract?: undefined; functionCall?: undefined; transfer?: undefined; stake?: undefined; addKey?: undefined; deleteKey?: undefined; deleteAccount?: undefined; }; })[]; }; Transaction: { struct: { signerId: string; publicKey: string; nonce: string; receiverId: string; blockHash: { array: { type: string; len: number; }; }; actions: { array: { type: string; }; }; }; }; SignedTransaction: { struct: { transaction: string; signature: string; }; }; }; //# sourceMappingURL=schema.d.ts.map