open-index/open-npm huggingface dataset:
npm package: @spidex/sdk
Description: SDK for spidex.
Author: Danny
Latest version: 0.5.53

# [@spidex/sdk](https://npmjs.com/package/@spidex/sdk)

<div align="center">
  <a href="https://www.npmjs.com/package/@spidex/sdk">
    <img src="https://img.shields.io/npm/v/@spidex/sdk.svg?style=flat-square">
  </a>
</div>

## [Docs Link](https://spidex-sdk.vercel.app/)

## 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

```ts
import spidex from '@spidex/sdk';
import { useWeb3React } from '@web3-react/core';

const { account, library } = useWeb3React();
```

```ts
spidex.initConfig({
  cluster: 'mainnet',
  provider: library.provider,
  currentAccount: account,
});
```


```ts
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
);
```