Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.5.0 #57

Merged
merged 28 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7fc85df
add feed-module proto files
xxibcill Aug 6, 2024
2a690eb
add MsgSubmitSignals
xxibcill Aug 6, 2024
97c12ee
fix dev
xxibcill Aug 6, 2024
312af6d
add client dev
xxibcill Aug 6, 2024
2bce581
rm dev folder
xxibcill Aug 7, 2024
8aac4a9
patch feed msg
xxibcill Aug 7, 2024
a341a3a
add feeder-module test
xxibcill Aug 8, 2024
cb5b920
init v2.5.0-alpha
xxibcill Aug 9, 2024
ba0c63e
bring dev back
xxibcill Aug 9, 2024
f38357d
latest version in example folder
xxibcill Aug 9, 2024
e3929d1
upgrade @ledgerhq/hw-transport-node-hid
xxibcill Aug 26, 2024
dbc8401
fix signalId in test, fix export Feed
xxibcill Aug 26, 2024
70f4215
Merge pull request #54 from bandprotocol/feat/feed-modules-messages
xxibcill Sep 18, 2024
3ea7d7f
add protobuf patch-cosmos-sdk-0.50 Beta
xxibcill Oct 18, 2024
1799d94
fix test
xxibcill Oct 18, 2024
3dca55e
Merge pull request #55 from bandprotocol/patch-cosmos-sdk-0.50-Beta
xxibcill Oct 29, 2024
c7711f1
add proto
babybunn Nov 21, 2024
b5f4e96
add proto codegen
babybunn Nov 21, 2024
d2be27e
update codegen
babybunn Nov 22, 2024
b486350
remove council module, change MsgSubmitSignals to MsgVoteSignal
babybunn Nov 22, 2024
19dc046
link proto submodule
babybunn Nov 22, 2024
d6ae3a0
update unit test
babybunn Nov 22, 2024
b89d4c2
update proto
babybunn Nov 27, 2024
b99c966
update bandchain codegen
babybunn Nov 27, 2024
90051dd
fix amino
babybunn Nov 28, 2024
3c5fd38
update proto
babybunn Dec 3, 2024
b5a010d
Merge pull request #56 from bandprotocol/feat/add-band-v3-modules
babybunn Dec 3, 2024
5beaab0
update readme
babybunn Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[submodule "proto/cosmos-proto"]
path = proto/cosmos-proto
url = https://github.com/cosmos/cosmos-proto.git
branch = main
[submodule "proto/chain"]
path = proto/chain
url = https://github.com/bandprotocol/chain.git
branch = master
33 changes: 2 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BandChain.js is a library for interacting with BandChain in browser and Node.js

## 📦 Installation

BandChain.js is currently supported on NodeJS 16.x, and 18.x.
BandChain.js is currently supported on Node.js 16.x, and 18.x.

### NPM

Expand All @@ -26,33 +26,4 @@ yarn add @bandprotocol/bandchain.js

## Compatibility

Band 2.2.0, Cosmos SDK 0.44.0, IBC-go 1.1.0

## Usage

#### Retrieving Price Data

```js
const { Client } = require('@bandprotocol/bandchain.js')

// BandChain's Proof-of-Authority REST endpoint
const endpoint = 'https://laozi-testnet6.bandchain.org/grpc-web'
const client = new Client(endpoint)

// This example demonstrates how to query price data from
// Band's standard dataset
async function exampleGetReferenceData() {
const rate = await client.getReferenceData(
['BTC/USD', 'BTC/ETH', 'EUR/USD', 'EUR/ETH'],
3,
4,
)
return rate
}

;(async () => {
console.log(await exampleGetReferenceData())
})()
```

For more examples, please see [`example`](example/) folder.
BandChain v3.0.0, Cosmos SDK v0.50.0, IBC-go v8.5.2
61 changes: 29 additions & 32 deletions __tests__/client/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
QueryClient,
ServiceError,
UnaryResponse,
} from '../../proto/oracle/v1/query_pb_service'
} from '../../codegen/band/oracle/v1/query_pb_service'

import {
QueryDataSourceRequest,
Expand All @@ -19,7 +19,7 @@ import {
QueryRequestSearchRequest,
QueryRequestSearchResponse,
QueryRequestResponse,
} from '../../proto/oracle/v1/query_pb'
} from '../../codegen/band/oracle/v1/query_pb'
import {
DataSource,
OracleScript,
Expand All @@ -29,53 +29,53 @@ import {
Report,
RawReport,
Result,
} from '../../proto/oracle/v1/oracle_pb'
import { ServiceClient } from '../../proto/cosmos/base/tendermint/v1beta1/query_pb_service'
} from '../../codegen/band/oracle/v1/oracle_pb'
import { ServiceClient } from '../../codegen/cosmos/base/tendermint/v1beta1/query_pb_service'

import {
GetLatestBlockRequest,
GetLatestBlockResponse,
} from '../../proto/cosmos/base/tendermint/v1beta1/query_pb'
import { BlockID, Header } from '../../proto/tendermint/types/types_pb'
import { Block } from '../../proto/tendermint/types/block_pb'
} from '../../codegen/cosmos/base/tendermint/v1beta1/query_pb'
import { BlockID, Header } from '../../codegen/tendermint/types/types_pb'
import { Block } from '../../codegen/tendermint/types/block_pb'

import { QueryClient as AuthQueryClient } from '../../proto/cosmos/auth/v1beta1/query_pb_service'
import { QueryClient as QueryAllBalances } from '../../proto/cosmos/bank/v1beta1/query_pb_service'
import { QueryClient as AuthQueryClient } from '../../codegen/cosmos/auth/v1beta1/query_pb_service'
import { QueryClient as QueryAllBalances } from '../../codegen/cosmos/bank/v1beta1/query_pb_service'

import {
QueryAllBalancesRequest,
QueryAllBalancesResponse,
} from '../../proto/cosmos/bank/v1beta1/query_pb'
} from '../../codegen/cosmos/bank/v1beta1/query_pb'

import {
QueryAccountRequest,
QueryAccountResponse,
} from '../../proto/cosmos/auth/v1beta1/query_pb'
} from '../../codegen/cosmos/auth/v1beta1/query_pb'

import { ServiceClient as TxServiceClient } from '../../proto/cosmos/tx/v1beta1/service_pb_service'
import { ServiceClient as TxServiceClient } from '../../codegen/cosmos/tx/v1beta1/service_pb_service'
import {
GetTxRequest,
GetTxResponse,
} from '../../proto/cosmos/tx/v1beta1/service_pb'
} from '../../codegen/cosmos/tx/v1beta1/service_pb'
import {
Tx,
TxBody,
AuthInfo,
SignerInfo,
} from '../../proto/cosmos/tx/v1beta1/tx_pb'
} from '../../codegen/cosmos/tx/v1beta1/tx_pb'
import { Any } from 'google-protobuf/google/protobuf/any_pb'
import { ABCIMessageLog } from '../../proto/cosmos/base/abci/v1beta1/abci_pb'
import { TxResponse } from '../../proto/cosmos/base/abci/v1beta1/abci_pb'
import { StringEvent } from '../../proto/cosmos/base/abci/v1beta1/abci_pb'
import { Attribute } from '../../proto/cosmos/base/abci/v1beta1/abci_pb'
import { SignMode } from '../../proto/cosmos/tx/signing/v1beta1/signing_pb'
import { ModeInfo, Fee } from '../../proto/cosmos/tx/v1beta1/tx_pb'

jest.mock('../../proto/oracle/v1/query_pb_service')
jest.mock('../../proto/cosmos/base/tendermint/v1beta1/query_pb_service')
jest.mock('../../proto/cosmos/auth/v1beta1/query_pb_service')
jest.mock('../../proto/cosmos/tx/v1beta1/service_pb_service')
jest.mock('../../proto/cosmos/bank/v1beta1/query_pb_service')
import { ABCIMessageLog } from '../../codegen/cosmos/base/abci/v1beta1/abci_pb'
import { TxResponse } from '../../codegen/cosmos/base/abci/v1beta1/abci_pb'
import { StringEvent } from '../../codegen/cosmos/base/abci/v1beta1/abci_pb'
import { Attribute } from '../../codegen/cosmos/base/abci/v1beta1/abci_pb'
import { SignMode } from '../../codegen/cosmos/tx/signing/v1beta1/signing_pb'
import { ModeInfo, Fee } from '../../codegen/cosmos/tx/v1beta1/tx_pb'

jest.mock('../../codegen/band/oracle/v1/query_pb_service')
jest.mock('../../codegen/cosmos/base/tendermint/v1beta1/query_pb_service')
jest.mock('../../codegen/cosmos/auth/v1beta1/query_pb_service')
jest.mock('../../codegen/cosmos/tx/v1beta1/service_pb_service')
jest.mock('../../codegen/cosmos/bank/v1beta1/query_pb_service')

const STATIC_DATE = 1625578450000
Date.now = jest.fn(() => STATIC_DATE)
Expand Down Expand Up @@ -849,9 +849,6 @@ describe('get latest request', () => {
'bandvaloper1e9sa38742tzhmandc4gkqve9zy8zc0yremaa3j',
'bandvaloper1l2hchtyawk9tk43zzjrzr2lcd0zyxngcjdsshe',
])
request.setTssGroupId(0)
request.setFeeLimitList([])
request.setRequester("")
request.setMinCount(3)
request.setRequestHeight(431790)
request.setRequestTime(1625547173)
Expand Down Expand Up @@ -951,12 +948,11 @@ describe('get latest request', () => {
'aHR0cHM6Ly91cy1ycGMuYmFuZGNoYWluLm9yZy9vcmFjbGUvcmVxdWVzdF9wcmljZXMgQlRDIEVUSA==',
},
],
requester: '',
executeGas: 1000000,
ibcChannel: undefined,
tssGroupId: 0,
requester: "",
feeLimitList: [],
signing: undefined
tssEncoder: 0,
},
reportsList: [
{
Expand Down Expand Up @@ -1005,6 +1001,7 @@ describe('get latest request', () => {
resolveStatus: 1,
result: 'AAAAAgAAH4lLo7MAAAACGsSNTYA==',
},
signing: undefined,
}
const response = await client.getLatestRequest(
43,
Expand Down
12 changes: 6 additions & 6 deletions __tests__/client/sendTx.test.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { Client } from '../../src'
import { grpc } from '@improbable-eng/grpc-web'

import { ServiceClient as TxServiceClient } from '../../proto/cosmos/tx/v1beta1/service_pb_service'
import { ServiceClient as TxServiceClient } from '../../codegen/cosmos/tx/v1beta1/service_pb_service'
import {
ServiceError,
UnaryResponse,
} from '../../proto/oracle/v1/query_pb_service'
} from '../../codegen/band/oracle/v1/query_pb_service'

import {
BroadcastTxRequest,
BroadcastTxResponse,
} from '../../proto/cosmos/tx/v1beta1/service_pb'
import { TxResponse } from '../../proto/cosmos/base/abci/v1beta1/abci_pb'
} from '../../codegen/cosmos/tx/v1beta1/service_pb'
import { TxResponse } from '../../codegen/cosmos/base/abci/v1beta1/abci_pb'
import {
ABCIMessageLog,
StringEvent,
Attribute,
} from '../../proto/cosmos/base/abci/v1beta1/abci_pb'
} from '../../codegen/cosmos/base/abci/v1beta1/abci_pb'

jest.mock('../../proto/cosmos/tx/v1beta1/service_pb_service')
jest.mock('../../codegen/cosmos/tx/v1beta1/service_pb_service')

const MockedTxService = jest.mocked(TxServiceClient)

Expand Down
Loading
Loading