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
{{ message }}
This repository was archived by the owner on Jan 16, 2025. It is now read-only.
weegee edited this page Nov 20, 2023
·
2 revisions
To create a transfer transaction currently, you don't need a Crossover or call data, so its the easier and the most basic transaction.
We just need one output note which contains the value we are transferring and the address we want to transfer the amount to
NOTE: Make sure you convert the lux value to dusk before sending with the output note
exportfunctiontransfer(wasm,seed,sender,receiver,amount){// convert the amount from lux to dusk, this is importantamount=luxToDusk(wasm,amount);constoutput={receiver: receiver,// if you want to hide the value of the transactionnote_type: "Obfuscated",// ref id of the transactionref_id: 1,value: amount,};// random bytesconstrng_seed=newUint8Array(32);crypto.getRandomValues(rng_seed);execute(wasm,seed,rng_seed,sender,output,// no crossover neededundefined,// no fees neededundefined,// no call data neededundefined,// gas limit500000000,// gas price1);}