From d6a022426f1e873f958e23f6829751e5e8c344c5 Mon Sep 17 00:00:00 2001 From: karen-stepanyan <91897037+karen-stepanyan@users.noreply.github.com> Date: Sun, 17 Nov 2024 22:35:16 +0400 Subject: [PATCH] Added support for env vars for stader-labs (#3565) * add support for env vars * changeset --- .changeset/fast-ways-notice.md | 5 +++++ packages/sources/stader-labs/src/config/index.ts | 11 +++++++---- .../sources/stader-labs/test/integration/fixtures.ts | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 .changeset/fast-ways-notice.md diff --git a/.changeset/fast-ways-notice.md b/.changeset/fast-ways-notice.md new file mode 100644 index 0000000000..1b5665417e --- /dev/null +++ b/.changeset/fast-ways-notice.md @@ -0,0 +1,5 @@ +--- +'@chainlink/stader-labs-adapter': patch +--- + +Added support for env vars for rate providers diff --git a/packages/sources/stader-labs/src/config/index.ts b/packages/sources/stader-labs/src/config/index.ts index 91455c4701..d0949c3048 100644 --- a/packages/sources/stader-labs/src/config/index.ts +++ b/packages/sources/stader-labs/src/config/index.ts @@ -17,13 +17,16 @@ export const ENV_BSC_CHAIN_ID = 'BSC_CHAIN_ID' export const DEFAULT_BSC_CHAIN_ID = '56' export const MATIC_AGGREGATOR_PROXY = '0xAB594600376Ec9fD91F8e885dADF0CE036862dE0' -export const MATICX_RATE_PROVIDER = '0xeE652bbF72689AA59F0B8F981c9c90e2A8Af8d8f' +export const MATICX_RATE_PROVIDER = + util.getEnv('MATICX_RATE_PROVIDER') || '0xeE652bbF72689AA59F0B8F981c9c90e2A8Af8d8f' export const FANTOM_AGGREGATOR_PROXY = '0xf4766552d15ae4d256ad41b6cf2933482b0680dc' -export const SFTMX_RATE_PROVIDER = '0xb458bfc855ab504a8a327720fcef98886065529b' +export const SFTMX_RATE_PROVIDER = + util.getEnv('SFTMX_RATE_PROVIDER') || '0xb458bfc855ab504a8a327720fcef98886065529b' export const BSC_AGGREGATOR_PROXY = '0x0567f2323251f0aab15c8dfb1967e4e8a7d42aee' -export const BNBX_RATE_PROVIDER = '0x7276241a669489E4BBB76f63d2A43Bfe63080F2F' +export const BNBX_RATE_PROVIDER = + util.getEnv('BNBX_RATE_PROVIDER') || '0x3b961e83400D51e6E1AF5c450d3C7d7b80588d28' -export const BNBX_RATE_MULTIPLIER = '1000000000000000000' +export const BNBX_RATE_MULTIPLIER = util.getEnv('BNBX_RATE_MULTIPLIER') || '1000000000000000000' export const makeConfig = (prefix?: string): Config => { const config = Requester.getDefaultConfig(prefix) diff --git a/packages/sources/stader-labs/test/integration/fixtures.ts b/packages/sources/stader-labs/test/integration/fixtures.ts index 7f296d7dab..53220e6dca 100644 --- a/packages/sources/stader-labs/test/integration/fixtures.ts +++ b/packages/sources/stader-labs/test/integration/fixtures.ts @@ -153,7 +153,7 @@ export const mockBNBxSuccess = (): nock.Scope => method: 'eth_call', params: [ { - to: '0x7276241a669489e4bbb76f63d2a43bfe63080f2f', + to: '0x3b961e83400d51e6e1af5c450d3c7d7b80588d28', data: '0xca0506e80000000000000000000000000000000000000000000000000de0b6b3a7640000', }, 'latest',