Skip to content

Commit

Permalink
fix(polyfill): fetch (#169)
Browse files Browse the repository at this point in the history
* fix(polyfill): fetch

* fix(build): build

* fix(build): build
  • Loading branch information
cgilbe27 authored Jun 23, 2023
1 parent 48172ea commit 933b81b
Show file tree
Hide file tree
Showing 37 changed files with 229 additions and 175 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.20

- Update fetch polyfill

## v0.19.19

- Update nibijs
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.19",
"version": "0.19.20",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
12 changes: 10 additions & 2 deletions packages/indexer-nibi/src/gql.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import fetch from "cross-fetch"
import * as cf from "cross-fetch"

declare global {
interface Window {
fetch: typeof cf.fetch
}
}

window.fetch = cf.fetch

/**
* The workhorse function that fetches data from the GraphQL endpoint.
Expand All @@ -11,7 +19,7 @@ import fetch from "cross-fetch"
export async function doGqlQuery(gqlQuery: string, gqlEndpt: string): Promise<any> {
const encodedGqlQuery = encodeURI(gqlQuery)
const fetchString = `${gqlEndpt}?query=${encodedGqlQuery}`
const rawResp = await fetch(fetchString)
const rawResp = await window.fetch(fetchString)
return cleanResponse(rawResp)
}

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.20

- Update fetch polyfill

## v0.19.19

- Update Keplr version
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.19](../intro.md) / [Exports](../modules.md) / CustomChain
[NibiJS Documentation - v0.19.20](../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/f06ff7b1/packages/nibijs/src/chain/chain.ts#L67)
[chain/chain.ts:75](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/packages/nibijs/src/chain/chain.ts#L75)

## 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/f06ff7b1/packages/nibijs/src/chain/chain.ts#L58)
[chain/chain.ts:66](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/packages/nibijs/src/chain/chain.ts#L66)

___

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

#### Defined in

[chain/chain.ts:65](https://github.com/NibiruChain/ts-sdk/blob/f06ff7b1/packages/nibijs/src/chain/chain.ts#L65)
[chain/chain.ts:73](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/packages/nibijs/src/chain/chain.ts#L73)

___

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/f06ff7b1/packages/nibijs/src/chain/chain.ts#L59)
[chain/chain.ts:67](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/packages/nibijs/src/chain/chain.ts#L67)

___

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/f06ff7b1/packages/nibijs/src/chain/chain.ts#L62)
[chain/chain.ts:70](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/packages/nibijs/src/chain/chain.ts#L70)

___

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/f06ff7b1/packages/nibijs/src/chain/chain.ts#L61)
[chain/chain.ts:69](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/packages/nibijs/src/chain/chain.ts#L69)

___

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/f06ff7b1/packages/nibijs/src/chain/chain.ts#L60)
[chain/chain.ts:68](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/packages/nibijs/src/chain/chain.ts#L68)

___

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/f06ff7b1/packages/nibijs/src/chain/chain.ts#L63)
[chain/chain.ts:71](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/packages/nibijs/src/chain/chain.ts#L71)

## 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/f06ff7b1/packages/nibijs/src/chain/chain.ts#L77)
[chain/chain.ts:85](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/packages/nibijs/src/chain/chain.ts#L85)

___

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

#### Defined in

[chain/chain.ts:92](https://github.com/NibiruChain/ts-sdk/blob/f06ff7b1/packages/nibijs/src/chain/chain.ts#L92)
[chain/chain.ts:100](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/packages/nibijs/src/chain/chain.ts#L100)

___

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

#### Defined in

[chain/chain.ts:87](https://github.com/NibiruChain/ts-sdk/blob/f06ff7b1/packages/nibijs/src/chain/chain.ts#L87)
[chain/chain.ts:95](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/packages/nibijs/src/chain/chain.ts#L95)

___

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

#### Defined in

[chain/chain.ts:82](https://github.com/NibiruChain/ts-sdk/blob/f06ff7b1/packages/nibijs/src/chain/chain.ts#L82)
[chain/chain.ts:90](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/packages/nibijs/src/chain/chain.ts#L90)
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.19](../intro.md) / [Exports](../modules.md) / MsgFactory
[NibiJS Documentation - v0.19.20](../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/f06ff7b1/packages/nibijs/src/msg/index.ts#L7)
[msg/index.ts:7](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/msg/index.ts#L5)
[msg/index.ts:5](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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.19](../intro.md) / [Exports](../modules.md) / NibiruQueryClient
[NibiJS Documentation - v0.19.20](../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/f06ff7b1/packages/nibijs/src/query/query.ts#L56)
[query/query.ts:56](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/query/query.ts#L44)
[query/query.ts:44](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/query/query.ts#L45)
[query/query.ts:45](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/query/query.ts#L80)
[query/query.ts:80](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/query/query.ts#L88)
[query/query.ts:88](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/query/query.ts#L47)
[query/query.ts:47](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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.19](../intro.md) / [Exports](../modules.md) / NibiruSigningClient
[NibiJS Documentation - v0.19.20](../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/f06ff7b1/packages/nibijs/src/tx/signingClient.ts#L64)
[tx/signingClient.ts:64](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/tx/signingClient.ts#L37)
[tx/signingClient.ts:37](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/tx/signingClient.ts#L38)
[tx/signingClient.ts:38](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/tx/signingClient.ts#L89)
[tx/signingClient.ts:89](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/tx/signingClient.ts#L97)
[tx/signingClient.ts:97](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/tx/signingClient.ts#L40)
[tx/signingClient.ts:40](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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.19](../intro.md) / [Exports](../modules.md) / PerpMsgFactory
[NibiJS Documentation - v0.19.20](../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/f06ff7b1/packages/nibijs/src/msg/perp.ts#L134)
[msg/perp.ts:134](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/msg/perp.ts#L171)
[msg/perp.ts:171](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/msg/perp.ts#L178)
[msg/perp.ts:178](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/msg/perp.ts#L141)
[msg/perp.ts:141](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/msg/perp.ts#L148)
[msg/perp.ts:148](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/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/f06ff7b1/packages/nibijs/src/msg/perp.ts#L120)
[msg/perp.ts:120](https://github.com/NibiruChain/ts-sdk/blob/6819e4e/packages/nibijs/src/msg/perp.ts#L120)
Loading

0 comments on commit 933b81b

Please sign in to comment.