import { type ICPIns, type ResponseAddress, type ResponseVersion, type ResponseAppInfo, type ResponseDeviceInfo, type ResponseSign, type ResponseSignUpdateCall, type ResponseTokenRegistry, type ResponseTokenRegistrySize } from "./types"; import GenericApp, { type LedgerTransport } from "@zondax/ledger-js"; export * from "./types"; export { SIGN_VALUES_P2 } from "./consts"; /** * Generic in the transport so `app.transport` keeps the caller's own type. * * `BaseApp` declares `readonly transport: LedgerTransport`, so without this the widened * constructor would narrow the inherited field as a side effect and `app.transport.close()` * -- fine today -- would stop compiling. Re-declaring it as `T`, inferred from the argument, * keeps every member of whatever was passed in: hw-transport's and a DMK transport's alike. */ export default class InternetComputerApp extends GenericApp { readonly transport: T; readonly INS: ICPIns; constructor(transport: T); /** * Returns the version with `returnCode` / `errorMessage`, as this SDK always has. * * BaseApp 1.x throws a ResponseError on failure and returns a bare version on success. * This SDK's contract -- relied on by its zemu tests and by dfinity's hardware-wallet-cli * -- is that both paths resolve to a value carrying `returnCode`. Restored here. */ getVersion(): Promise; /** * Returns app info with `returnCode` / `errorMessage`, as this SDK always has. * * One special case is preserved from the 0.2.x contract: an unrecognised format ID used * to come back as `returnCode: 0x9001`. BaseApp 1.x throws a ResponseError * (TechnicalProblem) for it instead, so that is mapped back to the historical code. */ appInfo(): Promise; /** * Returns device info with `returnCode` / `errorMessage`, as this SDK always has. * * `0x6e00` means the command was sent while an app was open rather than the dashboard. * The 0.2.x contract returned it as a value with a specific message; BaseApp 1.x throws * it, so it is mapped back here with the same wording. */ deviceInfo(): Promise; getAddressAndPubKey(path: string): Promise; showAddressAndPubKey(path: string): Promise; /** * Sends one chunk of a signing payload. * * Renamed from `signSendChunk` at the `@zondax/ledger-js` 1.x upgrade: BaseApp gained a * `protected signSendChunk(ins, chunkIdx, chunkNum, chunk)` of its own, and this method * takes different arguments and returns a different shape, so the names collided. The * behaviour here is unchanged. */ signSendChunkTx(chunkIdx: number, chunkNum: number, chunk: Buffer, txtype: number, ins: number): Promise; sign(path: string, message: Buffer, txtype: number): Promise; signSendChunkUpdateCall(chunkIdx: number, chunkNum: number, chunk: Buffer, txtype: number): Promise; signUpdateCall(path: string, request: Buffer, checkStatus: Buffer, txtype: number): Promise; sendChunk(chunkIdx: number, chunkNum: number, chunk: Buffer, ins: number): Promise; sendData(path: string, data: string, instruction: number): Promise; sendCertificateAndSig(path: string, data: string): Promise; signBls(path: string, consent_request: string, canister_call: string, certificate: string): Promise; _getTokenRegistrySize(): Promise; tokenRegistry(): Promise; }