@brc-chain/sdk
v0.1.12
Published
SDK for brcchain.
Downloads
21
Readme
@brc-chain/sdk
Docs Link
Installation
yarn add @brc-chain/sdk
// or
npm i @brc-chain/sdk --save
Usage
Api Host
- Mainnet Version https://api.brcchain.io/rest
- Testnet Version https://api.testnet.brcchain.io/rest
- Devnet Version https://api.devnet.brcchain.io/rest
Use
import brcchain from '@brc-chain/sdk';
import { useWeb3React } from '@web3-react/core';
const { account, library } = useWeb3React();
brcchain.initConfig({
cluster: 'mainnet',
provider: library.provider,
currentAccount: account,
});
await brcchain.rpc({
// params
});
await brcchain.private.xxx({
// params
});
await brcchain.public.xxx({
// params
});
// signature for websocket
brcchain.utils.signHmac(
timestamp,
'',
IRequestPath.wsAccounts,
'',
apiKey.secret
);