@secux/app-sol
Version:
SecuX Hardware Wallet SOL API
75 lines (71 loc) • 2.81 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 * as BufferLayout from "@solana/buffer-layout";
export type InstructionData = {
programIdIndex: number;
keyIndicesCount: Buffer;
keyIndices: Buffer;
dataLength: Buffer;
data: Buffer;
};
export declare const instructionLayout: (instruction: InstructionData) => BufferLayout.Structure<any>;
export type setComputeUnitLimitData = {
units: number;
};
export declare const setComputeUnitLimitLayout: BufferLayout.Structure<any>;
export type setComputeUnitPriceData = {
microLamports: number | bigint;
};
export declare const setComputeUnitPriceLayout: BufferLayout.Structure<any>;
export type signData = {
numRequiredSignatures: Buffer;
numReadonlySignedAccounts: Buffer;
numReadonlyUnsignedAccounts: Buffer;
keyCount: Buffer;
keys: Array<Buffer>;
recentBlockhash: Buffer;
};
export declare const signDataLayout: (data: signData) => BufferLayout.Structure<any>;
export type MessageHeader = {
numRequiredSignatures: number;
numReadonlySignedAccounts: number;
numReadonlyUnsignedAccounts: number;
};
export type MessageData = {
prefix: number;
header: MessageHeader;
staticAccountKeysLength: Uint8Array;
staticAccountKeys: Array<Uint8Array>;
recentBlockhash: Uint8Array;
instructionsLength: Uint8Array;
serializedInstructions: Uint8Array;
addressTableLookupsLength: Uint8Array;
serializedAddressTableLookups: Uint8Array;
};
export declare const messageLayout: (data: MessageData) => BufferLayout.Structure<any>;
export type AddressTableLookupData = {
accountKey: Uint8Array;
encodedWritableIndexesLength: Uint8Array;
writableIndexes: number[];
encodedReadonlyIndexesLength: Uint8Array;
readonlyIndexes: number[];
};
export declare const addressTableLookupLayout: (data: AddressTableLookupData) => BufferLayout.Structure<any>;
export declare const createLayout: BufferLayout.Structure<any>;
export declare const transferLayout: BufferLayout.Structure<any>;
export declare const createWithSeedLayout: BufferLayout.Structure<any>;
export declare function getAlloc(layout: BufferLayout.Structure<any>, fields: any): number;