-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
When attempting to create an identity JWT for the wallet, which could be used for a backend, there is no way to sign the jwt payload. Using signTransaction returns an empty string.
Given a common JWT payload:
const payload = {
"pk": ledgerAccount.publicKey,
"sub": ledgerAccount.address,
"exp": exp,
"iat": d.getTime()
}
and a ledger sign implementation with HID transport...
// secp256k1 is the default curve used by XRP
const signPayload = async (
payload,
accountIndex = 0, // change that to get details of accounts at different indexes
keyIndex = 0,
ledgerTransport) =>
{
let transport = ledgerTransport
if (!transport) {
transport = await getLedgerTransport()
if (!transport) {
return undefined
}
}
const xrp = new AppXrp(transport)
console.log("sign payload", payload);
try {
const bip32Path = `44'/144'/${accountIndex}'/0/${keyIndex}`;
const txe = encode(payload);
const signedPayload = await xrp.signTransaction(bip32Path, txe);
console.log("signTransaction signedPayload", signedPayload);
return { signedPayload, bip32Path }
}
catch (error) {
if (error instanceof Error) {
console.error(error)
return
// handleError(error)
}
return undefined
}
}
an empty result is returned for the signed body.
{
"signedPayload": "",
"bip32Path": "44'/144'/0'/0/0"
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels