Developer Questions
QR API not working: Cannot construct STArray from value given
over 1 year ago by MLD Migration (XRP - AVAX)
Hello, I was getting custom qr-code (code shared below) depending upon the amount and avax_address but now I am getting the following errors:
library version: "xumm-sdk": "^1.8.4"
Internal error code: 603
Error (detail) message Error: Payload encoding error: Cannot construct STArray from value given
Causing error message: Cannot construct STArray from value given
BURN_ADDRESS = 'rhJYDuVMQxabTyiWuHQkQyDxr6uZEdpv5u'
export const getQR = async (avax_address: string, amount: string) => {
try {
const hex_avax_address = Buffer.from(avax_address)
.toString("hex")
.toUpperCase();
const request = {
TransactionType: "Payment",
Destination: BURN_ADDRESS,
Amount: {
currency: 'MLD',
value: amount,
issuer: BURN_ADDRESS,
},
Memos: [
{
Memo: {
MemoData: hex_avax_address,
},
},
],
};
const payload = await Sdk.payload.create(request, true);
return {
link: payload?.next?.always,
qr_code: payload?.refs?.qr_png,
};
} catch (error) {
console.log(error);
return null;
}
};