-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
066e89c
commit fbfb7f8
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
``` |