You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have been trying to create a tx with arbitrary data in the NONCE field of tx-extra.
So far I tried getEtxra and setExtra functions(to get the already populated extra and append what I need and set it back) on the MoneroTxWallet type. But getEtxra returns undefined on a createTx result. And when just call setExtra then extra only becomes the extra I set, so tx becomes invalid.
Is there a way to do that using this lib? Here is little snippet of what I tried:
// create the txconsttx=awaitthis.wallet.createTx({address: to,amount: BigInt(amount_to_send),accountIndex: 0,relay: false,});// update tx-extraconstNONCE_FIELD=Buffer.from([2]);constnew_extra=Buffer.concat([tx.getExtra(),NONCE_FIELD,data]);tx.setExtra(new_extra);returnthis.wallet.relayTx(tx);
this returns Failed to commit tx error. Because when I print the tx I see there is an "extra" field now(that didn't exist before hence I was getting undefined) that is equal to data I set.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
As far as I can tell, monero-wallet-rpc does not support setting arbitrary extra data when creating transactions, and the libraries mirror the capabilities of monero-wallet-rpc.
I've opened an issue to set arbitrator data in monero-wallet-rpc, then the libraries can inherit that functionality: monero-project/monero#9731
Hi, I have been trying to create a tx with arbitrary data in the
NONCE
field of tx-extra.So far I tried
getEtxra
andsetExtra
functions(to get the already populated extra and append what I need and set it back) on theMoneroTxWallet
type. ButgetEtxra
returnsundefined
on acreateTx
result. And when just callsetExtra
then extra only becomes the extra I set, so tx becomes invalid.Is there a way to do that using this lib? Here is little snippet of what I tried:
this returns
Failed to commit tx
error. Because when I print the tx I see there is an "extra" field now(that didn't exist before hence I was gettingundefined
) that is equal todata
I set.Thanks in advance.
The text was updated successfully, but these errors were encountered: