import { Kwil } from '../client/kwil'; import { SignerSupplier } from '../core/signature'; import { EnvironmentType, PayloadType } from '../core/enums'; import { AllPayloads } from '../core/payload'; import { AnySignatureType } from '../core/signature'; import { Transaction } from '../core/tx'; export interface PayloadTxOptions { payload: AllPayloads; payloadType: PayloadType; signer: SignerSupplier; identifier: Uint8Array; signatureType: AnySignatureType; chainId: string; description: string; nonce?: number; } /** * `Payload` class creates a transaction and call payloads that can be sent over GRPC. */ export declare class PayloadTx { kwil: Kwil; payload: AllPayloads; payloadType: PayloadType; signer: SignerSupplier; identifier: Uint8Array; signatureType: AnySignatureType; chainId: string; description: string; nonce?: number; /** * Initializes a new `Payload` instance. * * @param {Kwil} kwil - The Kwil client, used to call higher-level methods on the Kwil class. */ constructor(kwil: Kwil, options: PayloadTxOptions); /** * Static factory method to create a new Payload instance. * * @param kwil - The Kwil client. * @param options - The options to configure the Payload instance. */ static createTx(kwil: Kwil, options: PayloadTxOptions): PayloadTx; /** * Build the payload structure for a transaction. */ buildTx(): Promise; /** * Signs the payload of a transaction / request to the broadcast GRPC endpoint. * * @param {BaseTransaction} tx - The transaction to sign. See {@link BaseTransaction} for more information. * @param {SignerSupplier} signer - The signer to be used to sign the transaction. * @param {Uint8Array} identifier - The identifier (e.g. wallet address, public key, etc) for the signature, represented as bytes. * @param {AnySignatureType} signatureType - The signature type being used. See {@link SignatureType} for more information. * @param {string} description - The description to be included in the signature. * @returns {BaseTransaction} - A promise that resolves to the signed transaction. * @throws {Error} - If the the signer is not an Ethers Signer or a function that accepts and returns a Uint8Array. */ private static signTx; private encodePayload; }