@arcblock/token-swap-client

graphql client to read/write data on token swap service

Usage no npm install needed!

<script type="module">
  import arcblockTokenSwapClient from 'https://cdn.skypack.dev/@arcblock/token-swap-client';
</script>

README

token-swap-client

styled with prettier docs Gitter

Client library to connect token-swap webapps with token-swap-service

Table of Contents

Install

npm i @arcblock/token-swap-client -S
# OR
yarn add @arcblock/token-swap-client

Usage

const TokenSwapClient = require('@arcblock/token-swap-client');

const client = new TokenSwapClient('http://localhost:8210/api');
console.log({
  queries: client.getQueries(),
  subscriptions: client.getSubscriptions(),
  mutations: client.getMutations(),
});

client.listDeposits().then(console.log);

Debugging

  • If you are in Node.js: DEBUG=@arcblock/token-swap-client node script.js
  • If you are in Browser: localStorage.setItem('DEBUG', '@arcblock/token-swap-client')

Documentation

Query arguments and response structure can be found: QUERIES.md