Skip to content

Commit

Permalink
Added support for env vars for stader-labs (#3565)
Browse files Browse the repository at this point in the history
* add support for env vars

* changeset
  • Loading branch information
karen-stepanyan authored Nov 17, 2024
1 parent 5f0ae26 commit d6a0224
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-ways-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chainlink/stader-labs-adapter': patch
---

Added support for env vars for rate providers
11 changes: 7 additions & 4 deletions packages/sources/stader-labs/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packages/sources/stader-labs/test/integration/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export const mockBNBxSuccess = (): nock.Scope =>
method: 'eth_call',
params: [
{
to: '0x7276241a669489e4bbb76f63d2a43bfe63080f2f',
to: '0x3b961e83400d51e6e1af5c450d3c7d7b80588d28',
data: '0xca0506e80000000000000000000000000000000000000000000000000de0b6b3a7640000',
},
'latest',
Expand Down

0 comments on commit d6a0224

Please sign in to comment.