1.0.3 • Published 5 years ago

smartcontract_template_js v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

smartcontract_template_js

a library to interact with duel smart contract

install duel sdk: npm i smartcontract_template_js --save

  • alice creates an arena with arena_id skyrim_room_1, stakes 10 COS, skyrim_admin is the referee

    const Gladiator = require('smartcontract_template_js/duel.js').Gladiator;
    const gladiator = new Gladiator("alice", "herPrivKey");
    gladiator.open_arena("skyrim_admin", "skyrim_room_1", "10.000000");
  • bob wants to join an arena that is created by alice,

    const Gladiator = require('smartcontract_template_js/duel.js').Gladiator;
    const gladiator = new Gladiator("bob", "hisPrivKey");
    gladiator.join_arena("alice", "skyrim_admin", "skyrim_room_1", "10.000000");
  • The duel is over, the referee skyrim_admin decides bob is the winner

    const Gladiator = require('smartcontract_template_js/duel.js').Gladiator;
    const gladiator = new Gladiator("skyrim_admin", "hisPrivKey");
    gladiator.close_arena("alice", "bob");
1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago