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
dApp.widget.initWidget("<recipient>", "WAVES"); | |
dApp.widget.initPurchase(TOTALAMOUNT); |
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
let bitcoinId = base58'8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS' | |
let x = match assetInfo(bitcoinId) { | |
case asset:Asset => | |
asset.name # bitcoin | |
case _ => throw("Can't find asset") | |
} |
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
["a","b","c","d"].indexOf("a") | |
# >> 0 | |
["a","b","c","d"].contains("a") | |
# >> true | |
[1, 2, 3, 4].min() | |
# >> 1 | |
[1, 2, 3, 4].max() |
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
{-# STDLIB_VERSION 3 #-} | |
{-# SCRIPT_TYPE ACCOUNT #-} | |
{-# CONTENT_TYPE DAPP #-} | |
@Callable(i) | |
func request (name: String) = { | |
# verify the certificate is not in data state yet | |
let wasRequested = match getInteger(this, name) { | |
case a: Int => true | |
case _ => false |
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", |
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 sendData() { | |
const text = document.querySelector(".data").value; | |
let data = text.split("\n"); | |
data = data.map(function(x) { return {"key": x.split(" ")[0], "value": x, "type": "string"}} ); | |
const tx = { | |
type: 12, // data transaction | |
data: { | |
data: data, | |
fee: { | |
"tokens": "0.001", |
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
WavesKeeper.signAndPublishTransaction({ | |
type: 12, | |
data: { | |
data: [ | |
{ key: "string", value: "testVdfgdgf dfgdfgdfg dfg dfg al", type: "string" }, | |
{ key: "binary", value: "base64:AbCdAbCdAbCdAbCdAbCdAbCdAbCdAbCdAbCdAbCdAbCd", type: "binary" }, | |
{ key: "integer", value: 20, type: "integer" }, | |
{ key: "boolean", value: false, type: "boolean" }, | |
], | |
fee: { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta content="width=device-width, initial-scale=1" name="viewport"> | |
<title>notpaper</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<div class="main"> |
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
document.addEventListener("DOMContentLoaded", function() { | |
document.querySelector(".data").value = location.href.split("?")[1] | |
.replace("%20", " ") | |
.replace("%20", " "); | |
}); |
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 checkData() { | |
const text = document.querySelector(".data").value.split("\n")[0]; | |
const certificateId = text.split(" ")[0]; | |
const xhr = new XMLHttpRequest(); | |
xhr.open("GET", "https://testnodes.wavesnodes.com/addresses/data/3N6EmqqQ1pZderX8sNMrfVuEo85ocPoqs2M/"+certificateId); | |
xhr.onload = function() { | |
const doesExist = JSON.parse(xhr.response).value === text; | |
document.querySelector(".result").innerHTML = doesExist ? "<span style='color: green'><strong>certificado</strong> exists</span>" : "<span style='color: red'><strong>certificado</strong> does not exist</span>"; | |
return doesExist; |