Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 5 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
</p>

<p align="center" width="100%">
<a href="https://github.com/bandprotocol/bandchain.js/actions/workflows/run-tests.yml">
<img height="20" src="https://github.com/bandprotocol/bandchain.js/actions/workflows/run-tests.yml/badge.svg" />
</a>
<a href="https://github.com/bandprotocol/bandchain.js/blob/main/LICENSE"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
</p>

Expand All @@ -26,7 +23,6 @@ npm install @bandprotocol/bandchain.js
- [Usage](#usage)
- [RPC Clients](#rpc-clients)
- [Composing Messages](#composing-messages)
- [CosmWasm Messages](#cosmwasm-messages)
- [IBC Messages](#ibc-messages)
- [Cosmos Messages](#cosmos-messages)
- [Connecting with Wallets and Signing Messages](#connecting-with-wallets-and-signing-messages)
Expand Down Expand Up @@ -59,7 +55,9 @@ const balance = await client.cosmos.bank.v1beta1.allBalances({
});

// you can also query the band modules
const balances = await client.band.exchange.v1beta1.exchangeBalances();
const oracleScript = await client.band.oracle.v1.oracleScript({
oracleScriptId: BigInt(37),
});
```

### Composing Messages
Expand All @@ -69,23 +67,8 @@ Import the `band` object from `@bandprotocol/bandchain.js`.
```js
import { band } from "@bandprotocol/bandchain.js";

const { createSpotLimitOrder, createSpotMarketOrder, deposit } =
band.exchange.v1beta1.MessageComposer.withTypeUrl;
```

#### CosmWasm Messages

```js
import { cosmwasm } from "@bandprotocol/bandchain.js";

const {
clearAdmin,
executeContract,
instantiateContract,
migrateContract,
storeCode,
updateAdmin,
} = cosmwasm.wasm.v1.MessageComposer.withTypeUrl;
const { requestData, reportData, createDataSource } =
band.oracle.v1.MessageComposer.withTypeUrl;
```

#### IBC Messages
Expand Down
9 changes: 5 additions & 4 deletions example/with-next-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
"lint": "next lint"
},
"dependencies": {
"@bandprotocol/bandchain.js": "^3.0.3",
"@bandprotocol/obi-ts": "^1.0.0",
"chain-registry": "^1.69.15",
"cosmjs-utils": "^0.1.0",
"next": "15.0.1",
"react": "19.0.0-rc-69d4b800-20241021",
"react-dom": "19.0.0-rc-69d4b800-20241021",
"@bandprotocol/bandchain.js": "link:../../../../packages/bandchainjs/dist"
"next": "15.4.6",
"react": "19.1.0",
"react-dom": "19.1.0"
},
"devDependencies": {
"@types/node": "^20",
Expand Down
Binary file modified example/with-next-js/src/app/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions example/with-next-js/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const geistMono = localFont({
});

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: "BandChain.js Example",
description: "example for bandchain.js library by Band",
};

export default function RootLayout({
Expand Down
1 change: 0 additions & 1 deletion example/with-next-js/src/components/AllBalanceExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const getAllBalances = async (address: string) => {

const res = await client.cosmos.bank.v1beta1.allBalances({
address,
resolveDenom: false,
});

return JSON.parse(
Expand Down
2 changes: 1 addition & 1 deletion example/with-next-js/src/components/SendTokenExample.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { cosmos } from "@bandprotocol/bandchain.js/dist";
import { cosmos } from "@bandprotocol/bandchain.js";
import { useState } from "react";

import { getSignerClient } from "@/utils";
Expand Down
4 changes: 2 additions & 2 deletions example/with-next-js/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const Sidebar = () => {
return (
<div className="p-3 min-h-screen bg-slate-100 w-[380px] fixed top-0 left-0">
<div>
<h2 className="font-bold mb-2">Cosmos SDK</h2>
<h2 className="font-bold text-black mb-2">Cosmos SDK</h2>
<ul className="font-mono text-sm">
<li className="mb-2 cursor-pointer text-blue-500 hover:text-blue-700">
<Link href="#allBalances">{`client.cosmos.bank.v1beta1.allBalances`}</Link>
Expand All @@ -14,7 +14,7 @@ export const Sidebar = () => {
</li>
</ul>
</div>
<h2 className="font-bold mb-2">BandChain</h2>
<h2 className="font-bold text-black mb-2">BandChain</h2>
<ul className="font-mono text-sm">
<li className="mb-2 cursor-pointer text-blue-500 hover:text-blue-700">
<Link href="#MsgRequestData">{`MsgRequestData`}</Link>
Expand Down
Loading