@ledgerhq/coin-ton
Version:
20 lines • 688 B
JavaScript
import { getLedgerTonPath } from "./utils";
export const signMessage = (signerContext) => async (deviceId, account, { message }) => {
if (typeof message !== "string")
throw new Error("Invalid message value");
const parsedMessage = JSON.parse(message);
const ledgerPath = getLedgerTonPath(account.freshAddressPath);
const sig = await signerContext(deviceId, signer => signer.signTransaction(ledgerPath, parsedMessage));
if (!sig) {
throw new Error("No signature");
}
return {
rsv: {
r: "",
s: "",
v: 0,
},
signature: sig.toString(),
};
};
//# sourceMappingURL=hw-signMessage.js.map