import { Kwil } from '../client/kwil'; import { SignerSupplier } from '../core/builders'; import { BytesEncodingStatus, EnvironmentType, PayloadType } from '../core/enums'; import { Message } from '../core/message'; import { AllPayloads } from '../core/payload'; import { AnySignatureType, Signature } from '../core/signature'; import { Transaction } from '../core/tx'; export interface PayloadOptions { payloadType?: PayloadType; payload?: (() => AllPayloads) | AllPayloads; signer?: SignerSupplier; identifier?: Uint8Array; signatureType?: AnySignatureType; chainId?: string; description?: string; nonce?: number; challenge?: string; signature?: Signature; } export declare class Payload { private kwil; private payloadType?; private payload?; private signer?; private identifier?; private signatureType?; private chainId?; private description?; private nonce?; private challenge?; private signature?; /** * 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: PayloadOptions); /** * Static factory method to create a new Payload instance. * * @param kwil - The Kwil client. * @param options - The options to configure the Payload instance. */ static create(kwil: Kwil, options: PayloadOptions): Payload; /** * 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; /** * Build the payload structure for a message. */ buildMsg(): Promise; /** * Adds the caller's sender address to the message. * * @param {Message} msg - The message to sign. See {@link Message} for more information. * @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 Message - A promise that resolves to the signed message. * @throws {Error} - If the the signer is not an Ethers Signer or a function that accepts and returns a Uint8Array. */ private static authMsg; /** * Method to resolve the payload from either direct value or a function. */ private resolvePayload; }