import { Kwil } from '../client/kwil'; import { ActionOptions, NamedParams, NamedTypes, PositionalParams } from '../core/action'; import { SignerSupplier } from '../core/signature'; import { EnvironmentType } from '../core/enums'; import { Message } from '../core/message'; import { AnySignatureType } from '../core/signature'; import { Transaction } from '../core/tx'; import { Base64String } from '../utils/types'; import { DataInfo } from '../core/database'; /** * `Action` class creates a transaction to execute database actions on the Kwil network. */ export declare class Action { kwil: Kwil; actionName: string; namespace: string; chainId: string; description: string; actionInputs: NamedParams[] | PositionalParams[]; types?: DataInfo[] | NamedTypes; signer?: SignerSupplier; identifier?: Uint8Array; signatureType?: AnySignatureType; nonce?: number; challenge?: string; signature?: Base64String; /** * Initializes a new `Action` instance. * It helps in building transactions to execute database actions on the Kwil network. * * @param {Kwil} kwil - The Kwil client, used to call higher-level methods on the Kwil class. */ constructor(kwil: Kwil, options: ActionOptions); /** * Static factory method to create a new Action instance. * * @param kwil - The Kwil client. * @param options - The options to configure the Action instance. */ static createTx(kwil: Kwil, options: ActionOptions): Action; /** * Build the action structure for a transaction. */ buildTx(privateMode: boolean): Promise; /** * Builds the message structure for view actions. This can be provided to the `kwil.call()` api. */ buildMsg(privateMode: boolean): Promise; /** * Builds the payload for the execute action. * * @param {boolean} privateMode - Whether the action is being executed in private mode. * @param {ActionInput[]} actionInputs - The inputs for the action. * @returns {UnencodedActionPayload} - The payload for the execute action. */ private buildTxPayload; /** * Builds the payload for the call action. * * @param {boolean} privateMode - Whether the action is being executed in private mode. * @param {ActionInput[]} actionInputs - The inputs for the action. * @returns {UnencodedActionPayload} - The payload for the call action. */ private buildMsgPayload; /** * Checks the action definition and validates the action inputs * * @param {ActionInput[]} actionInputs - An array of action inputs to be executed. * @returns {ValidatedAction} - An object containing the database namespace, action name, modifiers, and encoded action inputs. */ private validatedActionRequest; /** * Validates that the action is not missing any inputs. * * @param {NamespaceAction} selectedAction - The schema of the action to be executed. * @param {ActionInput} actionInput - The values of the actions to be executed. * @returns {boolean} - True if the action inputs are valid, false otherwise. */ private validateActionInputs; private assertNotBuilding; }