Skip to content

Commit

Permalink
refactor price into a base transport
Browse files Browse the repository at this point in the history
add separate timeout for GLV info APIs

tighten up vars + code

fixing up tests
  • Loading branch information
akuzni2 committed Feb 4, 2025
1 parent 29cf6c0 commit 2799f5d
Show file tree
Hide file tree
Showing 6 changed files with 414 additions and 355 deletions.
5 changes: 5 additions & 0 deletions .changeset/sour-glasses-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chainlink/glv-token-adapter': minor
---

Refactor price into a base transport
7 changes: 7 additions & 0 deletions packages/composites/glv-token/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ export const config = new AdapterConfig(
required: true,
default: 'https://arbitrum-api.gmxinfra.io/tokens',
},
GLV_INFO_API_TIMEOUT_MS: {
description:
'The amount of time the request to the GLV info APIs should wait before timing out. ' +
'Distinct from timeout used to make requests to the EAs which can be set with API_TIMEOUT',
type: 'number',
default: 10_000,
},
METADATA_REFRESH_INTERVAL_MS: {
description: 'The amount of time the metadata should be refreshed',
type: 'number',
Expand Down
1 change: 1 addition & 0 deletions packages/composites/glv-token/src/endpoint/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { endpoint as price } from './price'
export { endpoint as lwba } from './lwba'

Check failure on line 2 in packages/composites/glv-token/src/endpoint/index.ts

View workflow job for this annotation

GitHub Actions / Run Soak Tests Against Changed Adapters

Cannot find module './lwba' or its corresponding type declarations.

Check failure on line 2 in packages/composites/glv-token/src/endpoint/index.ts

View workflow job for this annotation

GitHub Actions / Install and verify dependencies

Cannot find module './lwba' or its corresponding type declarations.
4 changes: 2 additions & 2 deletions packages/composites/glv-token/src/endpoint/price.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AdapterEndpoint } from '@chainlink/external-adapter-framework/adapter'
import { InputParameters } from '@chainlink/external-adapter-framework/validation'
import { SingleNumberResultResponse } from '@chainlink/external-adapter-framework/util'
import { config } from '../config'
import { glvTokenTransport } from '../transport/price'
import { glvPriceTransport } from '../transport/price'

export const inputParameters = new InputParameters(
{
Expand Down Expand Up @@ -31,6 +31,6 @@ export type BaseEndpointTypes = {

export const endpoint = new AdapterEndpoint({
name: 'price',
transport: glvTokenTransport,
transport: glvPriceTransport,
inputParameters,
})
Loading

0 comments on commit 2799f5d

Please sign in to comment.