Skip to content

Instantly share code, notes, and snippets.

View KardanovIR's full-sized avatar
🥸
Focusing

Inal Kardanov KardanovIR

🥸
Focusing
View GitHub Profile
WavesKeeper = {
auth: function (){},
publicState: function (){},
signAndPublishCancelOrder: function (){},
signAndPublishOrder: function (){},
signAndPublishTransaction: function (){},
signCancelOrder: function (){},
signOrder: function (){},
signTransaction: function (){},
signRequest: function (){},
WavesKeeper.auth({name: 'Waves Keeper', data: 'Waves Keeper', icon: 'https://docs.wavesplatform.com/_theme/brand-logo/waves-docs-logo.png'})
.then(function (res) {
// data in variable res is shown below
//{
// "data":"Waves Keeper",
// "prefix":"WavesWalletAuthentication",
// "host":"localhost",
// "name":"Waves Keeper",
// "icon":"https://docs.wavesplatform.com/_theme/brand-logo/waves-docs-logo.png",
// "timestamp":1543175910353,
WavesKeeper.signAndPublishTransaction({
type: 4, // 4 - transfer transaction
data: {
amount: {
assetId: 'WAVES',
tokens: "0.00100000"
},
fee: {
assetId: 'WAVES',
tokens: "0.00100000"
{
"swagger" : "2.0",
"info" : {
"description" : "<script>alert(document.cookie)</script>",
"version" : "1.1.7",
"title" : "Waves Full Node",
"termsOfService" : "License: MIT License",
"license" : {
"name" : "MIT License",
"url" : "https://github.com/wavesplatform/Waves/blob/master/LICENSE"
const { sponsorship } = require('@waves/waves-transactions')
const seed = 'example seed phrase'
const params = {
assetId: '4uK8i4ThRGbehENwa6MxyLtxAjAo1Rj9fduborGExarC',
minSponsoredAssetFee: 100
}
const signedSponsorshipTx = sponsorship(params, seed)
@Callable(invoke)
func callMeBaby() = {
let callerAddress = invoke.caller.bytes.toBase58String()
if (takeRight(invoke.caller.bytes, 4) == base16'ABCD') then
TransferSet([
ScriptTransfer(invoke.caller, 100000000, unit)
])
else
@Callable(invoke)
func callMeBaby(uuid: String) = {
if (isInWhiteList(invoke.caller) && invoke.fee == 500000) then {
let id = extract(invoke.transactionId)
let callerAddress = toBase58String(invoke.caller.bytes)
ScriptResult(
WriteSet([
{-# STDLIB_VERSION 3 #-}
{-# CONTENT_TYPE EXPRESSION #-}
{-# SCRIPT_TYPE ACCOUNT #-}
match (tx) {
case t:TransferTransaction => false
case _ => true # NEVER DO THIS!
}
{-# STDLIB_VERSION 3 #-}
{-# CONTENT_TYPE EXPRESSION #-}
{-# SCRIPT_TYPE ACCOUNT #-}
match (tx) {
case t:TransferTransaction => false
case _ => sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublikey)
}
@Callable(i)
func foo() = {
[StringEntry("foo", "bar")]
}
@Verifier(tx)
func verify = {
match (tx){
case i: InvokeScriptTransaction => true
case _ => false