Skip to content

Commit

Permalink
feat: eth protos (#366)
Browse files Browse the repository at this point in the history
* fix: eth protos

* fix: client

* fix: fixes

* fix: try older nibiru

* fix: index

* fix: mainnet

* fix: import

* revert: build change

* chore: tests (#367)

* fix: all query tests

* chore: final tests

* fix: buf

* fix: fix
  • Loading branch information
cgilbe27 authored Aug 6, 2024
1 parent d23c144 commit 9d496c7
Show file tree
Hide file tree
Showing 68 changed files with 1,791 additions and 1,626 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
env:
BUF_TOKEN: ${{ secrets.BUF_TOKEN }}
permissions:
contents: write
issues: write
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-ts-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
env:
VALIDATOR_MNEMONIC: ${{ secrets.VALIDATOR_MNEMONIC }}
VALIDATOR_ADDRESS: ${{ secrets.VALIDATOR_ADDRESS }}
BUF_TOKEN: ${{ secrets.BUF_TOKEN }}
LCD_ENDPOINT: "http://127.0.0.1:1317"
GRPC_ENDPOINT: "127.0.0.1:9090"
TENDERMINT_RPC_ENDPOINT: "http://127.0.0.1:26657"
Expand Down
93 changes: 0 additions & 93 deletions QUERIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,99 +135,6 @@ liquidations(
limit: Int): [Liquidations]
```

## markPriceCandles

TODO docs

```graphql
markPriceCandles(
where: MarkPriceCandlesFilter
order: MarkPriceCandlesOrder
orderDesc: Boolean
limit: Int): [MarkPriceCandles]
```

#### In English

- The above code block means that there is a query function called `markPriceCandles` with four arguments, `where`, `order`, `orderDesc`, and `limit`, that returns `[MarkPriceCandles]`.
- The `[MarkPriceCandles]` type means that "list of `MarkPriceCandles` objects".

#### `MarkPriceCandles`

```graphql
type MarkPriceCandles {
pair: String
open: Int
close: Int
low: Int
high: Int
period: Float
periodStartTs: DateTime
}
```

ANKI `Boolean` in GraphQL means `true` or `false`.

The `where` parameter has options for filtering based on conditions for each field. The filter condition must match the type of the corresponding field. Examples include:

```graphql
where: { pairEq: "ubtc:unusd" }
where: { lowGt: 100 }
where: { periodStartTsLt: "2023-02-22" }
```

Every field, e.g. `pair`, `open`, `close`, `period`, has filter options. In the case of `MarkPriceCandles`, every field has methods for:

- `=` : `Eq` : equals
- `>` : `Gt` : greater than
- `<` : `Lt` : less than
- `>=` : `Gte` : greater than or equal
- `<=` : `Lte` : less than or equal

Except, `pair`, which only has the `pairEq` method.

### `order: MarkPriceCandlesOrder`

```graphql
markPriceCandles(
where: MarkPriceCandlesFilter
order: MarkPriceCandlesOrder
orderDesc: Boolean
limit: Int): [MarkPriceCandles]
```

```graphql
type MarkPriceCandlesOrder {
pair
open
close
low
high
period
period_start_ts
}
```

This means we can use one of these values with the `order` argument in the query like follows:

```graphql
order: pair
order: close
order: period_start_ts
```

## markPrices

TODO docs

```graphql
markPrices(
where: MarkPricesFilter
order: MarkPricesOrder
orderDesc: Boolean
limit: Int): [MarkPrices]
```

## oraclePrices

TODO docs
Expand Down
2 changes: 1 addition & 1 deletion nibiru
Submodule nibiru updated 181 files
Loading

0 comments on commit 9d496c7

Please sign in to comment.