Skip to content

Exchange

Tuan Pham Anh edited this page Nov 8, 2018 · 1 revision

Outline:

  • setup fullnode for exchange
  • checking balance
  • monitoring deposit
  • transfering token

setup fullnode for exchange

...

checking balance

using get_accounts api

curl https://rpc.smoke.io --data '{"jsonrpc":"2.0", "id":0, "method":"call", "params":["database_api", "get_accounts", [["test"]]]}'

monitoring deposit

see https://steemit.com/steem/@dantheman/how-to-monitor-an-account-for-deposits

(put sample source code here)

transfering token

  let operations = [];
  operations.push([
    "transfer",
    {
      "from": "exchange_acc",
      "to": "user_account",
      "amount": amount,
      "memo": ""
    }
  ]);

const tx_smoke = await smokejs.broadcast.sendAsync({operations, extensions: []}, {"active": "active_key_here"});
Clone this wiki locally