Skip to content

Commit

Permalink
fix(leaderboard): query (#164)
Browse files Browse the repository at this point in the history
* fix(leaderboard): query

* fix(test): test
  • Loading branch information
cgilbe27 authored Jun 20, 2023
1 parent bd45b49 commit 9367a40
Show file tree
Hide file tree
Showing 35 changed files with 162 additions and 160 deletions.
4 changes: 4 additions & 0 deletions packages/indexer-nibi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

- .

## v0.19.16

- Update leaderboard

## v0.19.15

- Match version and fix publish script
Expand Down
2 changes: 1 addition & 1 deletion packages/indexer-nibi/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@nibiruchain/indexer-nibi",
"description": "GraphQL API client for the Nibiru Chain indexer (heart-monitor)",
"version": "0.19.15",
"version": "0.19.16",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
9 changes: 1 addition & 8 deletions packages/indexer-nibi/src/heart-monitor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,14 +527,7 @@ test("perpLeaderboard", async () => {

if (resp.perpLeaderboard.length > 0) {
const [config] = resp.perpLeaderboard
const fields = [
"traderAddress",
"percentagePnl",
"rawPnl",
"inputMargin",
"lastUpdatedBlock",
"lastUpdatedBlockTs",
]
const fields = ["traderAddress", "percentagePnl", "rawPnl", "inputMargin"]
fields.forEach((field: string) => {
expect(config).toHaveProperty(field)
})
Expand Down
9 changes: 5 additions & 4 deletions packages/indexer-nibi/src/query/perpLeaderboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ export interface GqlOutPerpLeaderboard {
perpLeaderboard: PerpLeaderboard[]
}

export const perpLeaderboard = async (endpt: string): Promise<GqlOutPerpLeaderboard> =>
export const perpLeaderboard = async (
endpt: string,
traderAddress?: string,
): Promise<GqlOutPerpLeaderboard> =>
doGqlQuery(
`{
perpLeaderboard {
perpLeaderboard ${traderAddress ? `(traderAddress: ${traderAddress})` : ""} {
traderAddress
percentagePnl
rawPnl
inputMargin
lastUpdatedBlock
lastUpdatedBlockTs
}
}`,
endpt,
Expand Down
4 changes: 4 additions & 0 deletions packages/nibijs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

- .

## v0.19.16

- Update indexer-nibi

## v0.19.15

- Match version and fix publish script
Expand Down
26 changes: 13 additions & 13 deletions packages/nibijs/docs/classes/CustomChain.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[NibiJS Documentation - v0.19.15](../intro.md) / [Exports](../modules.md) / CustomChain
[NibiJS Documentation - v0.19.16](../intro.md) / [Exports](../modules.md) / CustomChain

# Class: CustomChain

Expand Down Expand Up @@ -56,7 +56,7 @@ export const TEST_CHAIN = new CustomChain({

#### Defined in

[chain/chain.ts:67](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/chain/chain.ts#L67)
[chain/chain.ts:67](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/chain/chain.ts#L67)

## Properties

Expand All @@ -72,7 +72,7 @@ chainId: identifier for the chain

#### Defined in

[chain/chain.ts:58](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/chain/chain.ts#L58)
[chain/chain.ts:58](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/chain/chain.ts#L58)

___

Expand All @@ -82,7 +82,7 @@ ___

#### Defined in

[chain/chain.ts:65](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/chain/chain.ts#L65)
[chain/chain.ts:65](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/chain/chain.ts#L65)

___

Expand All @@ -98,7 +98,7 @@ chainName: the name of the chain to display to the user

#### Defined in

[chain/chain.ts:59](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/chain/chain.ts#L59)
[chain/chain.ts:59](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/chain/chain.ts#L59)

___

Expand All @@ -114,7 +114,7 @@ endptGrpc: endpoint for the gRPC gateway. Usually on port 9090.

#### Defined in

[chain/chain.ts:62](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/chain/chain.ts#L62)
[chain/chain.ts:62](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/chain/chain.ts#L62)

___

Expand All @@ -130,7 +130,7 @@ endptRest: endpoint for the REST server. Also, the LCD endpoint.

#### Defined in

[chain/chain.ts:61](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/chain/chain.ts#L61)
[chain/chain.ts:61](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/chain/chain.ts#L61)

___

Expand All @@ -146,7 +146,7 @@ endptTm: endpoint for the Tendermint RPC server. Usually on port 26657.

#### Defined in

[chain/chain.ts:60](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/chain/chain.ts#L60)
[chain/chain.ts:60](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/chain/chain.ts#L60)

___

Expand All @@ -162,7 +162,7 @@ feeDenom: the denomination of the fee to be paid for transactions.

#### Defined in

[chain/chain.ts:63](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/chain/chain.ts#L63)
[chain/chain.ts:63](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/chain/chain.ts#L63)

## Methods

Expand All @@ -176,7 +176,7 @@ feeDenom: the denomination of the fee to be paid for transactions.

#### Defined in

[chain/chain.ts:77](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/chain/chain.ts#L77)
[chain/chain.ts:77](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/chain/chain.ts#L77)

___

Expand All @@ -190,7 +190,7 @@ ___

#### Defined in

[chain/chain.ts:92](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/chain/chain.ts#L92)
[chain/chain.ts:92](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/chain/chain.ts#L92)

___

Expand All @@ -204,7 +204,7 @@ ___

#### Defined in

[chain/chain.ts:87](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/chain/chain.ts#L87)
[chain/chain.ts:87](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/chain/chain.ts#L87)

___

Expand All @@ -218,4 +218,4 @@ ___

#### Defined in

[chain/chain.ts:82](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/chain/chain.ts#L82)
[chain/chain.ts:82](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/chain/chain.ts#L82)
6 changes: 3 additions & 3 deletions packages/nibijs/docs/classes/MsgFactory.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[NibiJS Documentation - v0.19.15](../intro.md) / [Exports](../modules.md) / MsgFactory
[NibiJS Documentation - v0.19.16](../intro.md) / [Exports](../modules.md) / MsgFactory

# Class: MsgFactory

Expand Down Expand Up @@ -27,7 +27,7 @@

#### Defined in

[msg/index.ts:7](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/msg/index.ts#L7)
[msg/index.ts:7](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/msg/index.ts#L7)

___

Expand All @@ -37,4 +37,4 @@ ___

#### Defined in

[msg/index.ts:5](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/msg/index.ts#L5)
[msg/index.ts:5](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/msg/index.ts#L5)
14 changes: 7 additions & 7 deletions packages/nibijs/docs/classes/NibiruQueryClient.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[NibiJS Documentation - v0.19.15](../intro.md) / [Exports](../modules.md) / NibiruQueryClient
[NibiJS Documentation - v0.19.16](../intro.md) / [Exports](../modules.md) / NibiruQueryClient

# Class: NibiruQueryClient

Expand Down Expand Up @@ -45,7 +45,7 @@ StargateClient.constructor

#### Defined in

[query/query.ts:56](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/query/query.ts#L56)
[query/query.ts:56](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/query/query.ts#L56)

## Properties

Expand All @@ -55,7 +55,7 @@ StargateClient.constructor

#### Defined in

[query/query.ts:44](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/query/query.ts#L44)
[query/query.ts:44](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/query/query.ts#L44)

___

Expand All @@ -65,7 +65,7 @@ ___

#### Defined in

[query/query.ts:45](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/query/query.ts#L45)
[query/query.ts:45](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/query/query.ts#L45)

## Methods

Expand All @@ -85,7 +85,7 @@ ___

#### Defined in

[query/query.ts:80](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/query/query.ts#L80)
[query/query.ts:80](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/query/query.ts#L80)

___

Expand All @@ -99,7 +99,7 @@ ___

#### Defined in

[query/query.ts:88](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/query/query.ts#L88)
[query/query.ts:88](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/query/query.ts#L88)

___

Expand All @@ -124,4 +124,4 @@ StargateClient.connect

#### Defined in

[query/query.ts:47](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/query/query.ts#L47)
[query/query.ts:47](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/query/query.ts#L47)
14 changes: 7 additions & 7 deletions packages/nibijs/docs/classes/NibiruSigningClient.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[NibiJS Documentation - v0.19.15](../intro.md) / [Exports](../modules.md) / NibiruSigningClient
[NibiJS Documentation - v0.19.16](../intro.md) / [Exports](../modules.md) / NibiruSigningClient

# Class: NibiruSigningClient

Expand Down Expand Up @@ -46,7 +46,7 @@ SigningStargateClient.constructor

#### Defined in

[tx/signingClient.ts:64](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/tx/signingClient.ts#L64)
[tx/signingClient.ts:64](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/tx/signingClient.ts#L64)

## Properties

Expand All @@ -56,7 +56,7 @@ SigningStargateClient.constructor

#### Defined in

[tx/signingClient.ts:37](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/tx/signingClient.ts#L37)
[tx/signingClient.ts:37](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/tx/signingClient.ts#L37)

___

Expand All @@ -66,7 +66,7 @@ ___

#### Defined in

[tx/signingClient.ts:38](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/tx/signingClient.ts#L38)
[tx/signingClient.ts:38](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/tx/signingClient.ts#L38)

## Methods

Expand All @@ -86,7 +86,7 @@ ___

#### Defined in

[tx/signingClient.ts:89](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/tx/signingClient.ts#L89)
[tx/signingClient.ts:89](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/tx/signingClient.ts#L89)

___

Expand All @@ -100,7 +100,7 @@ ___

#### Defined in

[tx/signingClient.ts:97](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/tx/signingClient.ts#L97)
[tx/signingClient.ts:97](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/tx/signingClient.ts#L97)

___

Expand All @@ -127,4 +127,4 @@ SigningStargateClient.connectWithSigner

#### Defined in

[tx/signingClient.ts:40](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/tx/signingClient.ts#L40)
[tx/signingClient.ts:40](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/tx/signingClient.ts#L40)
14 changes: 7 additions & 7 deletions packages/nibijs/docs/classes/PerpMsgFactory.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[NibiJS Documentation - v0.19.15](../intro.md) / [Exports](../modules.md) / PerpMsgFactory
[NibiJS Documentation - v0.19.16](../intro.md) / [Exports](../modules.md) / PerpMsgFactory

# Class: PerpMsgFactory

Expand Down Expand Up @@ -47,7 +47,7 @@ Returns a 'TxMessage' for adding margin to a position

#### Defined in

[msg/perp.ts:134](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/msg/perp.ts#L134)
[msg/perp.ts:134](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/msg/perp.ts#L134)

___

Expand All @@ -67,7 +67,7 @@ ___

#### Defined in

[msg/perp.ts:171](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/msg/perp.ts#L171)
[msg/perp.ts:171](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/msg/perp.ts#L171)

___

Expand All @@ -87,7 +87,7 @@ ___

#### Defined in

[msg/perp.ts:178](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/msg/perp.ts#L178)
[msg/perp.ts:178](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/msg/perp.ts#L178)

___

Expand All @@ -107,7 +107,7 @@ ___

#### Defined in

[msg/perp.ts:141](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/msg/perp.ts#L141)
[msg/perp.ts:141](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/msg/perp.ts#L141)

___

Expand All @@ -133,7 +133,7 @@ ___

#### Defined in

[msg/perp.ts:148](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/msg/perp.ts#L148)
[msg/perp.ts:148](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/msg/perp.ts#L148)

___

Expand All @@ -153,4 +153,4 @@ ___

#### Defined in

[msg/perp.ts:120](https://github.com/NibiruChain/ts-sdk/blob/b0f9b4b/packages/nibijs/src/msg/perp.ts#L120)
[msg/perp.ts:120](https://github.com/NibiruChain/ts-sdk/blob/bd45b49/packages/nibijs/src/msg/perp.ts#L120)
Loading

0 comments on commit 9367a40

Please sign in to comment.