File tree 3 files changed +16
-6
lines changed
3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ export function buildConfig(
119
119
] ,
120
120
Devnet : [ 'http://localhost:7071' ] ,
121
121
} [ network ] ,
122
- coinGeckoApiKey : customConfig . coinGeckoApiKey ,
122
+ coingecko : customConfig . coingecko ,
123
123
124
124
// Callbacks
125
125
triggerEvent : wrapEventHandler ( customConfig . eventHandler ) ,
Original file line number Diff line number Diff line change @@ -94,7 +94,10 @@ export interface WormholeConnectConfig {
94
94
95
95
// External resources
96
96
rpcs ?: ChainResourceMap ;
97
- coinGeckoApiKey ?: string ;
97
+ coingecko ?: {
98
+ apiKey ?: string ;
99
+ customUrl ?: string ;
100
+ } ;
98
101
99
102
// White lists
100
103
chains ?: Chain [ ] ;
@@ -137,7 +140,10 @@ export interface InternalConfig<N extends Network> {
137
140
mayanApi : string ;
138
141
wormholeApi : string ;
139
142
wormholeRpcHosts : string [ ] ;
140
- coinGeckoApiKey ?: string ;
143
+ coingecko ?: {
144
+ apiKey ?: string ;
145
+ customUrl ?: string ;
146
+ } ;
141
147
142
148
tokens : TokenCache ;
143
149
tokenWhitelist ?: ( string | TokenTuple ) [ ] ;
Original file line number Diff line number Diff line change @@ -45,12 +45,16 @@ const coingeckoRequest = async (
45
45
) : Promise < Response > => {
46
46
const headers = new Headers ( {
47
47
'Content-Type' : 'application/json' ,
48
- ...( config . coinGeckoApiKey
49
- ? { 'x-cg-pro-api-key' : config . coinGeckoApiKey }
48
+ ...( config . coingecko ?. apiKey
49
+ ? { 'x-cg-pro-api-key' : config . coingecko . apiKey }
50
50
: { } ) ,
51
51
} ) ;
52
52
53
- const hostname = config . coinGeckoApiKey ? COINGECKO_URL_PRO : COINGECKO_URL ;
53
+ const hostname = config . coingecko ?. customUrl
54
+ ? config . coingecko . customUrl
55
+ : config . coingecko ?. apiKey
56
+ ? COINGECKO_URL_PRO
57
+ : COINGECKO_URL ;
54
58
55
59
return fetch ( `${ hostname } ${ path } ` , {
56
60
signal : params ?. abort ?. signal ,
You can’t perform that action at this time.
0 commit comments