@secux/app-sol
Version:
SecuX Hardware Wallet SOL API
73 lines (69 loc) • 2.54 kB
TypeScript
/*!
Copyright 2022 SecuX Technology Inc
Copyright Chen Wei-En
Copyright Wu Tsung-Yu
Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an AS IS BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/// <reference types="node" />
/// <reference types="node" />
import { Base58String, HexString } from "./interface";
import { InstructionData } from "./layout";
export type Instruction = {
programId: HexString;
accounts: Array<{
publickey: HexString;
isSigner: boolean;
isWritable: boolean;
}>;
data: Buffer;
};
export declare class Transaction {
#private;
constructor(blockHash: Base58String);
static from(data: Buffer): Transaction;
static fromMessage(data: Buffer): Transaction;
addInstruction(ins: Instruction): void;
dataForSign(feePayer?: HexString): Buffer;
addSignature(publickey: HexString, signature: Buffer): void;
serialize(): Buffer;
get Signers(): string[];
get Version(): number | undefined;
get numRequiredSignatures(): number;
get numReadonlySignedAccounts(): number;
get numReadonlyUnsignedAccounts(): number;
get recentBlockhash(): string;
protected serializeMessage(feePayer?: HexString): Buffer;
protected deserializeMessage(data: Buffer): number[];
protected makeIndexed(feePayer?: HexString): {
accountKeys: string[];
instructions: {
programIdIndex: number;
keyIndicesCount: Buffer;
keyIndices: Buffer;
dataLength: Buffer;
data: Buffer;
}[];
};
protected encodeInstructions(instructions: Array<InstructionData>): Buffer;
}
export type AddressLookup = {
accountKey: HexString | Base58String;
writableIndexes: number[];
readonlyIndexes: number[];
};
export declare class TransactionV0 extends Transaction {
#private;
addAddressLookup(lookup: AddressLookup): void;
protected serializeMessage(feePayer?: HexString): Buffer;
protected deserializeMessage(data: Buffer): number[];
protected encodeAddressTableLookups(table: Array<AddressLookup>): Buffer;
get Version(): number;
}