@ledgerhq/hw-app-cosmos
Version:
Ledger Hardware Wallet Cosmos Application API
55 lines • 2.08 kB
TypeScript
/********************************************************************************
* Ledger Node JS API
* (c) 2017-2018 Ledger
*
* 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.
********************************************************************************/
import type Transport from "@ledgerhq/hw-transport";
/**
* Cosmos API
*
* @example
* import Cosmos from "@ledgerhq/hw-app-cosmos";
* const cosmos = new Cosmos(transport)
*/
export default class Cosmos {
transport: Transport;
constructor(transport: Transport, scrambleKey?: string);
getAppConfiguration(): Promise<{
test_mode: boolean;
version: string;
device_locked: boolean;
major: number;
}>;
serializePath(path: Buffer): Buffer;
serializeHRP(hrp: string): Buffer;
/**
* get Cosmos address for a given BIP 32 path.
* @param path a path in BIP 32 format
* @param hrp usually cosmos
* @option boolDisplay optionally enable or not the display
* @return an object with a publicKey, address and (optionally) chainCode
* @example
* cosmos.getAddress("44'/60'/0'/0/0", "cosmos").then(o => o.address)
*/
getAddress(path: string, hrp: string, boolDisplay?: boolean): Promise<{
publicKey: string;
address: string;
}>;
foreach<T, A>(arr: T[], callback: (arg0: T, arg1: number) => Promise<A>): Promise<A[]>;
sign(path: string, message: string): Promise<{
signature: null | Buffer;
return_code: number | string;
}>;
}
//# sourceMappingURL=Cosmos.d.ts.map