Skip to content

Commit

Permalink
Merge pull request #396 from InjectiveLabs/fix/get-ibc-tokens
Browse files Browse the repository at this point in the history
fix: ibc metadata fetch error handling
  • Loading branch information
shane-moore authored Feb 14, 2024
2 parents a8da0c3 + e22f807 commit d9b1913
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 'Commit ibcTokenMetadata.json if changed'
run: |
git diff --exit-code -- packages/sdk-ui-ts/src/services/ibc/ibcTokenMetadata.json || (git add packages/sdk-ui-ts/src/services/ibc/ibcTokenMetadata.json && git commit -m "Automatically update ibcTokenMetadata.json")
- name: Version and publish
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Get IBC Tokens
run: yarn --cwd packages/sdk-ui-ts get-ibc-tokens || true

- name: 'Commit ibcTokenMetadata.json if changed'
run: |
git diff --exit-code -- packages/sdk-ui-ts/src/services/ibc/ibcTokenMetadata.json || (git add packages/sdk-ui-ts/src/services/ibc/ibcTokenMetadata.json && git commit -m "Automatically update ibcTokenMetadata.json")
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 'Commit ibcTokenMetadata.json if changed'
run: |
git diff --exit-code -- packages/sdk-ui-ts/src/services/ibc/ibcTokenMetadata.json || (git add packages/sdk-ui-ts/src/services/ibc/ibcTokenMetadata.json && git commit -m "Automatically update ibcTokenMetadata.json")
- name: Version and publish
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
4 changes: 3 additions & 1 deletion packages/sdk-ui-ts/src/services/ibc/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ type IbcTokenMetadata = {
isTrading: boolean
}

const ibcTokenMetadataApi = new HttpRestClient('https://api.tfm.com/api/v1/')
const ibcTokenMetadataApi = new HttpRestClient('https://api.tfm.com/api/v1/', {
timeout: 2000,
})

const TOKEN_METADATA_PATH = 'ibc/chain/injective-1/tokens'

Expand Down

0 comments on commit d9b1913

Please sign in to comment.