@zondax/ledger-stacks
Version:
Node API for Stacks App (Ledger Nano S+, X, Stax, Flex and Apex)
81 lines (80 loc) • 2.1 kB
TypeScript
import Transport from '@ledgerhq/hw-transport';
export declare const CLA = 9;
export declare const CHUNK_SIZE = 250;
export declare const APP_KEY = "STX";
export declare const INS: {
GET_VERSION: number;
GET_ADDR_SECP256K1: number;
SIGN_SECP256K1: number;
GET_AUTH_PUBKEY: number;
SIGN_JWT_SECP256K1: number;
SIGN_STRUCTURED_MSG: number;
GET_MASTER_FINGERPRINT: number;
GET_ADDR_MULTISIG: number;
};
export declare const MULTISIG_HASH_MODE: {
P2SH: number;
P2SH_NONSEQUENTIAL: number;
};
export declare const MULTISIG_MAX_PUBKEYS = 15;
export declare const PAYLOAD_TYPE: {
INIT: number;
ADD: number;
LAST: number;
};
export declare const P1_VALUES: {
ONLY_RETRIEVE: number;
SHOW_ADDRESS_IN_DEVICE: number;
};
export declare const PKLEN = 33;
export declare enum LedgerError {
U2FUnknown = 1,
U2FBadRequest = 2,
U2FConfigurationUnsupported = 3,
U2FDeviceIneligible = 4,
U2FTimeout = 5,
Timeout = 14,
NoErrors = 36864,
DeviceIsBusy = 36865,
ErrorDerivingKeys = 26626,
ExecutionError = 25600,
WrongLength = 26368,
EmptyBuffer = 27010,
OutputBufferTooSmall = 27011,
DataIsInvalid = 27012,
ConditionsNotSatisfied = 27013,
TransactionRejected = 27014,
BadKeyHandle = 27264,
InvalidP1P2 = 27392,
InstructionNotSupported = 27904,
AppDoesNotSeemToBeOpen = 28161,
UnknownError = 28416,
SignVerifyError = 28417
}
export declare const ERROR_DESCRIPTION: {
1: string;
2: string;
3: string;
4: string;
5: string;
14: string;
36864: string;
36865: string;
26626: string;
25600: string;
26368: string;
27010: string;
27011: string;
27012: string;
27013: string;
27014: string;
27264: string;
27392: string;
27904: string;
28161: string;
28416: string;
28417: string;
};
export declare function errorCodeToString(statusCode: LedgerError): string;
export declare function processErrorResponse(response?: any): any;
export declare function getVersion(transport: Transport): Promise<any>;