zebec-instant-card-sdk
Version:
An sdk for interacting with zebec instant card program in solana.
41 lines (40 loc) • 2.25 kB
TypeScript
/// <reference types="@coral-xyz/anchor/node_modules/@solana/web3.js" />
import { AddressLookupTableAccount, ConfirmOptions, Connection, PublicKey, Signer, SimulateTransactionConfig, Transaction, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js";
import { PriorityLevel } from "./utils";
/**
* A executable payload that holds transaction
*/
export declare class TransactionPayload {
private readonly _connection;
private readonly _errors;
readonly instructions: TransactionInstruction[];
readonly feePayer: PublicKey;
readonly signers?: Signer[] | undefined;
readonly addressLookupTableAccounts?: AddressLookupTableAccount[] | undefined;
private readonly _signTransaction?;
/**
*
* @param _connection Solana web3 connnection
* @param _errors Program errors map
* @param instructions Transaction instructions
* @param feePayer Transaction fee payer
* @param signers Partial signers required to instruction
* @param addressLookupTableAccounts Address lookup table accounts for transaction
* @param _signTransaction function that signs and return signed transaction. Transaction build from the instructions is passed to this function
*/
constructor(_connection: Connection, _errors: Map<number, string>, instructions: TransactionInstruction[], feePayer: PublicKey, signers?: Signer[] | undefined, addressLookupTableAccounts?: AddressLookupTableAccount[] | undefined, _signTransaction?: (<T extends Transaction | VersionedTransaction>(transaction: T) => Promise<T>) | undefined);
simulate(options?: SimulateTransactionConfig): Promise<import("@solana/web3.js").RpcResponseAndContext<import("@solana/web3.js").SimulatedTransactionResponse>>;
/**
* Signs, send and confim transaction
* * `Note`: requires signTransaction while creating instance of this object.
* @param options solana confirm options
* @returns
*/
execute(options?: ConfirmOptions & {
sendTransactionInterval?: number;
maxSendTransactionRetries?: number;
priorityLevel?: PriorityLevel;
maxPriorityFeeSol?: number;
exactPriorityFeeSol?: number;
}): Promise<TransactionSignature>;
}