@ledgerhq/coin-ton
Version:
20 lines • 797 B
JavaScript
import { getLedgerTonPath } from "./utils";
const resolver = (signerContext) => {
return async (deviceId, { path, verify }) => {
const ledgerPath = 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,
};
};
};
export default resolver;
//# sourceMappingURL=hw-getAddress.js.map