Created
March 12, 2020 21:15
-
-
Save vlzhr/1691cf0f6920c3c7304e6c7a2739b262 to your computer and use it in GitHub Desktop.
Smart Contracts usage tutorial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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