binance-subgraph-client

0.0.4 • Public • Published

Binance Client JS

CircleCI GitHub license

The Binance client enables access to Proxima index nodes, and provides the tooling to submit and verify queries to the query nodes

npm install binance-subgraph-client

Usage

const Binance = require('binance-subgraph-client')
const binanceSubgraph = Binance.createBinanceSubgraph(subgraph_uri, binance_chain_api_uri)

Using as a query client

const FEES = gql`
  query fees($prove: Boolean) {
    fees(prove: $prove) {
      fees {
        msg_type
        fee
        fee_for
        multi_transfer_fee
        lower_limit_as_multi
      }
      proof {
        root
        proof
      }
 
    }
  }
`;
 
function Fees() {
  const {loading, error, data} = useQuery(FEES);
  if (loading) return 'Loading...';
  if (error) return `Error!`;
      return (
        <div>
        {data.fees.fees.map(fee => (
          <p>
            msg_type {fee.msg_type}
          </p>
        ))}
        </div>
      );
}
 
<ApolloProvider client={binanceSubgraph.client}>
  <Fees/>
</ApolloProvider>,
);

Proving data

const {loading, error, data} = useQuery(FEES);
if (loading) return 'Loading...';
if (error) return `Error!`;
{value, proof, type} = Binance.
binanceSubgraph.audit(value)

Auditing data

const {loading, error, data} = useQuery(FEES);
if (loading) return 'Loading...';
if (error) return `Error!`;
binanceSubgraph.verify(value, proof)
{value, proof, type} = Binance.
 

Licensing

This project is licensed under MIT licensing guidelines. GitHub license

Readme

Keywords

none

Package Sidebar

Install

npm i binance-subgraph-client

Weekly Downloads

9

Version

0.0.4

License

ISC

Unpacked Size

20.1 kB

Total Files

11

Last publish

Collaborators

  • chasesmith