@coolwallet/sol
Version:
Coolwallet Solana sdk
63 lines (62 loc) • 1.61 kB
TypeScript
import * as types from '../config/types';
import { PublicKey } from './publickey';
import { Message } from '../message';
/**
* List of TransactionInstruction object fields that may be initialized at construction
*/
export type TransactionInstructionCtorFields = {
keys: Array<types.AccountMeta>;
programId: PublicKey;
data?: Buffer;
};
export interface TransactionInstructionJSON {
keys: {
pubkey: string;
isSigner: boolean;
isWritable: boolean;
}[];
programId: string;
data: number[];
}
/**
* Transaction Instruction class
*/
export declare class TransactionInstruction {
/**
* Public keys to include in this transaction
* Boolean represents whether this pubkey needs to sign the transaction
*/
keys: Array<types.AccountMeta>;
/**
* Program Id to execute
*/
programId: PublicKey;
/**
* Program input
*/
data: Buffer;
constructor(opts: TransactionInstructionCtorFields);
/**
* @internal
*/
toJSON(): TransactionInstructionJSON;
}
export declare class Transaction {
feePayer: string;
recentBlockhash: string;
instructions: types.TransactionInstruction[];
signature?: string;
constructor(tx: types.TransactionArgs);
add(instruction: types.TransactionInstruction): void;
/**
* Compile transaction data
*/
compileMessage(): Message;
/**
* Return sendable tx string with given signature.
*
* @param signature signature generated by CoolWallet Pro
* @returns
*/
toTxString(signature: string): string;
}