UNPKG

@ledgerhq/coin-ton

Version:
22 lines 882 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const utils_1 = require("./utils"); const resolver = (signerContext) => { return async (deviceId, { path, verify }) => { const ledgerPath = (0, utils_1.getLedgerTonPath)(path); const sig = await signerContext(deviceId, async (signer) => { return verify ? await signer.validateAddress(ledgerPath, { bounceable: false }) : await signer.getAddress(ledgerPath, { bounceable: false }); }); if (!sig.address || !sig.publicKey.length) throw Error(`[ton] Response is empty ${sig.address} ${sig.publicKey}`); return { address: sig.address, publicKey: sig.publicKey.toString("hex"), path, }; }; }; exports.default = resolver; //# sourceMappingURL=hw-getAddress.js.map