@ledgerhq/hw-app-canton
Version:
Ledger Hardware Wallet Canton Application API
48 lines • 1.5 kB
TypeScript
import type Transport from "@ledgerhq/hw-transport";
import { CantonAddress, CantonSignature } from "@ledgerhq/coin-canton";
import { MockCantonDevice, AppConfig } from "./MockDevice";
/**
* Canton BOLOS API
*/
export default class Canton {
transport: Transport;
transportMock: MockCantonDevice;
constructor(transport: Transport, scrambleKey?: string);
/**
* Get a Canton address for a given BIP-32 path.
*
* @param path a path in BIP-32 format
* @param display whether to display the address on the device
* @return the address and public key
*/
getAddress(path: string, display?: boolean): Promise<CantonAddress>;
/**
* Sign a Canton transaction.
*
* @param path a path in BIP-32 format
* @param rawTx the raw transaction to sign
* @return the signature
*/
signTransaction(path: string, rawTx: string): Promise<CantonSignature>;
/**
* Get the app configuration.
* @return the app configuration including version
*/
getAppConfiguration(): Promise<AppConfig>;
/**
* Helper method to handle transport response and check for errors
* @private
*/
private handleTransportResponse;
/**
* Serialize a BIP path to a data buffer for Canton BOLOS
* @private
*/
private serializePath;
/**
* Simple deterministic hash function for generating mock addresses
* @private
*/
private hashString;
}
//# sourceMappingURL=Canton.d.ts.map