monero-ts
monero-ts copied to clipboard
Error - Imported outputs omit more outputs that we know of
The view-only wallet by default exports outputs since the last export. But if I create a new offline wallet (createWalletFull
), and then sign a transaction, it will throw an error: offlineWallet.signTx Error: Error - Imported outputs omit more outputs that we know of
.
async function signTx(params){
const offlineWallet = await createWalletFull({
networkType: MoneroNetworkType.MAINNET,
privateSpendKey: privateKey,
primaryAddress: from,
password: "password",
accountLookahead: accountLookahead === undefined ? 1 : accountLookahead,
subaddressLookahead: subaddressLookahead === undefined ? 50000 : subaddressLookahead,
});
await offlineWallet.importOutputs(outputsHex);
let signedTxHex;
try{
signedTxHex = await offlineWallet.signTxs(unsignedHex);
}catch(error: any){
throw Error("offlineWallet.signTx Error: " + (error || error.msg));
}
return signedTxHex;
}
Of course I could export all outputs, but what if there are too many outputs and the output_hex is too large. One http request could only carry so much data. Why can't a offline wallet sign a transaction based on the outputs since the last export and their respective unsignedHex?
This question is better suited for monero-project devs (#monero-dev) since the library is a straight passthrough.
but what if there are too many outputs and the output_hex is too large.
There's an effort to export outputs in chunks to avoid too much data: https://github.com/monero-project/monero/pull/8513