Skip to content

Commit

Permalink
add readme for core package
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenkhong committed Nov 21, 2024
1 parent 066e89c commit fbfb7f8
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## @demex-sdk/core

Core module for most utility functions and object models required for other @demex-sdk packages.

## Quick Start

Install the package with your favourite package manager.
```shell
yarn add @demex-sdk/core
```

### Example: Query address balances

```typescript
import { Tendermint37Client } from "@cosmjs/tendermint-rpc";
import { DemexQueryClient } from "@demex-sdk/core";


const rpcUrl = "https://tm-api.carbon.network";
const address = "swth1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8cpw26x";

const tmClient = await Tendermint37Client.connect(rpcUrl);
const queryClient = DemexQueryClient.instance({ tmClient });

const result = await queryClient.bank.AllBalances({ address, resolveDenom: false });
result.balances.forEach((bal) => console.log(bal.amount, bal.denom));
```

0 comments on commit fbfb7f8

Please sign in to comment.