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