Skip to content

Instantly share code, notes, and snippets.

@vlzhr
Created March 12, 2020 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vlzhr/1691cf0f6920c3c7304e6c7a2739b262 to your computer and use it in GitHub Desktop.
Save vlzhr/1691cf0f6920c3c7304e6c7a2739b262 to your computer and use it in GitHub Desktop.
Smart Contracts usage tutorial
function q(arg) { return document.querySelector(arg); }
function sendData() {
const text = q(".data").value;
let data = text.split("\n")[0];
const tx = {
type: 16, // invoke transaction
data: {
fee: {
"tokens": "0.005",
"assetId": "WAVES"
},
dApp: '3N9uzN2kjrwCnrmHAhw7m3FdKhkJ69SGL6F',
call: {
function: 'request',
args: [{
"type": "string", "value": data
}]
}
}
};
WavesKeeper.signAndPublishTransaction(tx);
return text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment