@ape.swap/bonds-sdk 1.0.78-2.test.28 → 1.0.78-2.test.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/TokenSelectorModal/TokenRow.d.ts +8 -0
- package/dist/components/TokenSelectorModal/TokenRow.js +18 -0
- package/dist/components/TokenSelectorModal/index.d.ts +11 -0
- package/dist/components/TokenSelectorModal/index.js +56 -0
- package/dist/components/TokenSelectorPanel/index.d.ts +16 -0
- package/dist/components/TokenSelectorPanel/index.js +36 -0
- package/dist/components/uikit-sdk/TokenImage/index.d.ts +3 -2
- package/dist/components/uikit-sdk/TokenImage/index.js +27 -4
- package/dist/config/abi/price-getter-linea.json +1448 -0
- package/dist/config/abi/price-getter.json +1309 -0
- package/dist/config/constants/queryKeys.d.ts +4 -1
- package/dist/config/constants/queryKeys.js +24 -1
- package/dist/config/constants/tokens.d.ts +3 -6
- package/dist/config/constants/tokens.js +64 -452
- package/dist/config/constants/zapInputTokens.d.ts +2 -0
- package/dist/config/constants/zapInputTokens.js +356 -0
- package/dist/hooks/useTokenFromZapList.d.ts +3 -0
- package/dist/hooks/useTokenFromZapList.js +10 -0
- package/dist/providers/index.d.ts +0 -3
- package/dist/providers/index.js +6 -0
- package/dist/scss/BondModal.scss +215 -195
- package/dist/state/allowance/useAllowance.d.ts +11 -0
- package/dist/state/allowance/useAllowance.js +152 -0
- package/dist/state/balance/useCurrencyBalance.d.ts +4 -0
- package/dist/state/balance/useCurrencyBalance.js +82 -0
- package/dist/state/price/useCurrencyPrice.d.ts +19 -0
- package/dist/state/price/useCurrencyPrice.js +397 -0
- package/dist/state/zap/getChainParam.d.ts +12 -0
- package/dist/state/zap/getChainParam.js +34 -0
- package/dist/state/zap/useSoulZapBondQuote.d.ts +4 -0
- package/dist/state/zap/useSoulZapBondQuote.js +178 -0
- package/dist/state/zap/useSoulZapTokenQuote.d.ts +3 -0
- package/dist/state/zap/useSoulZapTokenQuote.js +168 -0
- package/dist/utils/getNativeTicker.d.ts +3 -0
- package/dist/utils/getNativeTicker.js +8 -0
- package/dist/views/BondModal/BondModal.js +2 -2
- package/dist/views/Bonds/Bonds.d.ts +1 -1
- package/dist/views/Bonds/index.d.ts +4 -0
- package/dist/views/Bonds/index.js +18 -0
- package/dist/views/ZapModal/index.d.ts +14 -0
- package/dist/views/ZapModal/index.js +150 -0
- package/dist/views/ZapModal/styles.d.ts +2 -0
- package/dist/views/ZapModal/styles.js +35 -0
- package/package.json +2 -1
|
@@ -12,7 +12,6 @@ export declare const QUERY_KEYS: {
|
|
|
12
12
|
BONDS_LANDING: string;
|
|
13
13
|
BOND_POST_REFERENCE: string;
|
|
14
14
|
BOND_RECOMMENDATIONS: string;
|
|
15
|
-
TOKEN_PRICES: string;
|
|
16
15
|
TIERS: string;
|
|
17
16
|
BOND_STATS: string;
|
|
18
17
|
USER_STATS: string;
|
|
@@ -21,4 +20,8 @@ export declare const QUERY_KEYS: {
|
|
|
21
20
|
AB_TEST_VALUE: string;
|
|
22
21
|
USE_CURRENCY_NEW: string;
|
|
23
22
|
CURRENCY_BALANCE: string;
|
|
23
|
+
CURRENCY_PRICE: string;
|
|
24
|
+
ALLOWANCE: string;
|
|
25
|
+
ZAP_TOKEN_QUOTE: string;
|
|
26
|
+
ZAP_BOND_QUOTE: string;
|
|
24
27
|
};
|
|
@@ -12,7 +12,6 @@ export var QUERY_KEYS = {
|
|
|
12
12
|
BONDS_LANDING: 'bondsLanding',
|
|
13
13
|
BOND_POST_REFERENCE: 'bondPostReference',
|
|
14
14
|
BOND_RECOMMENDATIONS: 'bondRecommendations',
|
|
15
|
-
TOKEN_PRICES: 'tokenPrices',
|
|
16
15
|
TIERS: 'tiers',
|
|
17
16
|
BOND_STATS: 'bondStats',
|
|
18
17
|
USER_STATS: 'userStats',
|
|
@@ -20,5 +19,29 @@ export var QUERY_KEYS = {
|
|
|
20
19
|
CHAIN_FILTER_OPTION: 'chainFilterOption',
|
|
21
20
|
AB_TEST_VALUE: 'ABTestValue',
|
|
22
21
|
USE_CURRENCY_NEW: 'useCurrencyNew',
|
|
22
|
+
// used values on SDK
|
|
23
23
|
CURRENCY_BALANCE: 'currencyBalance',
|
|
24
|
+
CURRENCY_PRICE: 'currencyPrice',
|
|
25
|
+
ALLOWANCE: 'allowance',
|
|
26
|
+
ZAP_TOKEN_QUOTE: 'zapTokenQuote',
|
|
27
|
+
ZAP_BOND_QUOTE: 'zapBondQuote',
|
|
28
|
+
};
|
|
29
|
+
var asd = {
|
|
30
|
+
'0': {
|
|
31
|
+
chain: 'bnb',
|
|
32
|
+
recipient: '0x54e7b27A434249177d939b43Abf68EBAE8b0e519',
|
|
33
|
+
user: '0x54e7b27A434249177d939b43Abf68EBAE8b0e519',
|
|
34
|
+
lpData: {
|
|
35
|
+
lpType: 'ichi',
|
|
36
|
+
fromToken: '0x0000000000000000000000000000000000000000',
|
|
37
|
+
fromAmount: '1000000000000000',
|
|
38
|
+
vault: '0x55d398326f99059fF775485246999027B3197955',
|
|
39
|
+
slippage: 0.5,
|
|
40
|
+
},
|
|
41
|
+
protocolData: {
|
|
42
|
+
protocol: 'ApeBond',
|
|
43
|
+
bond: '0xdd0ba1445a24c83c3bdbc5efada3359e98ac706e',
|
|
44
|
+
depositer: '0x54e7b27A434249177d939b43Abf68EBAE8b0e519',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
24
47
|
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
[chainId: number]: Token | undefined;
|
|
5
|
-
};
|
|
6
|
-
export declare function nativeOnChain(chainId: number): NativeCurrency | Token;
|
|
1
|
+
import { Token } from "@ape.swap/apeswap-lists";
|
|
2
|
+
import { ChainId } from "@ape.swap/apeswap-lists";
|
|
3
|
+
export declare const WNATIVE: Partial<Record<ChainId, Token>>;
|
|
@@ -1,452 +1,64 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
function isLinea(chainId) {
|
|
67
|
-
return chainId === ChainId.LINEA;
|
|
68
|
-
}
|
|
69
|
-
function isIota(chainId) {
|
|
70
|
-
return chainId === ChainId.IOTA;
|
|
71
|
-
}
|
|
72
|
-
function isBase(chainId) {
|
|
73
|
-
return chainId === ChainId.BASE;
|
|
74
|
-
}
|
|
75
|
-
var GnosisNativeCurrency = /** @class */ (function (_super) {
|
|
76
|
-
__extends(GnosisNativeCurrency, _super);
|
|
77
|
-
function GnosisNativeCurrency(chainId) {
|
|
78
|
-
if (!isGnosis(chainId))
|
|
79
|
-
throw new Error('Not Gnosis');
|
|
80
|
-
return _super.call(this, chainId, 18, 'xDAI', 'xDai') || this;
|
|
81
|
-
}
|
|
82
|
-
GnosisNativeCurrency.prototype.equals = function (other) {
|
|
83
|
-
return other.isNative && other.chainId === this.chainId;
|
|
84
|
-
};
|
|
85
|
-
Object.defineProperty(GnosisNativeCurrency.prototype, "wrapped", {
|
|
86
|
-
get: function () {
|
|
87
|
-
if (!isGnosis(this.chainId))
|
|
88
|
-
throw new Error('Not Gnosis');
|
|
89
|
-
var wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId];
|
|
90
|
-
invariant(wrapped instanceof Token);
|
|
91
|
-
return wrapped;
|
|
92
|
-
},
|
|
93
|
-
enumerable: false,
|
|
94
|
-
configurable: true
|
|
95
|
-
});
|
|
96
|
-
return GnosisNativeCurrency;
|
|
97
|
-
}(NativeCurrency));
|
|
98
|
-
var CronosNativeCurrency = /** @class */ (function (_super) {
|
|
99
|
-
__extends(CronosNativeCurrency, _super);
|
|
100
|
-
function CronosNativeCurrency(chainId) {
|
|
101
|
-
if (!isCronos(chainId))
|
|
102
|
-
throw new Error('Not Cronos');
|
|
103
|
-
return _super.call(this, chainId, 18, 'CRO', 'CRO') || this;
|
|
104
|
-
}
|
|
105
|
-
CronosNativeCurrency.prototype.equals = function (other) {
|
|
106
|
-
return other.isNative && other.chainId === this.chainId;
|
|
107
|
-
};
|
|
108
|
-
Object.defineProperty(CronosNativeCurrency.prototype, "wrapped", {
|
|
109
|
-
get: function () {
|
|
110
|
-
if (!isCronos(this.chainId))
|
|
111
|
-
throw new Error('Not Cronos');
|
|
112
|
-
var wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId];
|
|
113
|
-
invariant(wrapped instanceof Token);
|
|
114
|
-
return wrapped;
|
|
115
|
-
},
|
|
116
|
-
enumerable: false,
|
|
117
|
-
configurable: true
|
|
118
|
-
});
|
|
119
|
-
return CronosNativeCurrency;
|
|
120
|
-
}(NativeCurrency));
|
|
121
|
-
var FantomNativeCurrency = /** @class */ (function (_super) {
|
|
122
|
-
__extends(FantomNativeCurrency, _super);
|
|
123
|
-
function FantomNativeCurrency(chainId) {
|
|
124
|
-
if (!isFantom(chainId))
|
|
125
|
-
throw new Error('Not Fantom');
|
|
126
|
-
return _super.call(this, chainId, 18, 'FTM', 'FTM') || this;
|
|
127
|
-
}
|
|
128
|
-
FantomNativeCurrency.prototype.equals = function (other) {
|
|
129
|
-
return other.isNative && other.chainId === this.chainId;
|
|
130
|
-
};
|
|
131
|
-
Object.defineProperty(FantomNativeCurrency.prototype, "wrapped", {
|
|
132
|
-
get: function () {
|
|
133
|
-
if (!isFantom(this.chainId))
|
|
134
|
-
throw new Error('Not Fantom');
|
|
135
|
-
var wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId];
|
|
136
|
-
invariant(wrapped instanceof Token);
|
|
137
|
-
return wrapped;
|
|
138
|
-
},
|
|
139
|
-
enumerable: false,
|
|
140
|
-
configurable: true
|
|
141
|
-
});
|
|
142
|
-
return FantomNativeCurrency;
|
|
143
|
-
}(NativeCurrency));
|
|
144
|
-
var AvaxNativeCurrency = /** @class */ (function (_super) {
|
|
145
|
-
__extends(AvaxNativeCurrency, _super);
|
|
146
|
-
function AvaxNativeCurrency(chainId) {
|
|
147
|
-
if (!isAvax(chainId))
|
|
148
|
-
throw new Error('Not Avax');
|
|
149
|
-
return _super.call(this, chainId, 18, 'AVAX', 'Avax') || this;
|
|
150
|
-
}
|
|
151
|
-
AvaxNativeCurrency.prototype.equals = function (other) {
|
|
152
|
-
return other.isNative && other.chainId === this.chainId;
|
|
153
|
-
};
|
|
154
|
-
Object.defineProperty(AvaxNativeCurrency.prototype, "wrapped", {
|
|
155
|
-
get: function () {
|
|
156
|
-
if (!isAvax(this.chainId))
|
|
157
|
-
throw new Error('Not Avax');
|
|
158
|
-
var wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId];
|
|
159
|
-
invariant(wrapped instanceof Token);
|
|
160
|
-
return wrapped;
|
|
161
|
-
},
|
|
162
|
-
enumerable: false,
|
|
163
|
-
configurable: true
|
|
164
|
-
});
|
|
165
|
-
return AvaxNativeCurrency;
|
|
166
|
-
}(NativeCurrency));
|
|
167
|
-
var MaticNativeCurrency = /** @class */ (function (_super) {
|
|
168
|
-
__extends(MaticNativeCurrency, _super);
|
|
169
|
-
function MaticNativeCurrency(chainId) {
|
|
170
|
-
if (!isMatic(chainId))
|
|
171
|
-
throw new Error('Not matic');
|
|
172
|
-
return _super.call(this, chainId, 18, 'MATIC', 'MATIC Matic') || this;
|
|
173
|
-
}
|
|
174
|
-
MaticNativeCurrency.prototype.equals = function (other) {
|
|
175
|
-
return other.isNative && other.chainId === this.chainId;
|
|
176
|
-
};
|
|
177
|
-
Object.defineProperty(MaticNativeCurrency.prototype, "wrapped", {
|
|
178
|
-
get: function () {
|
|
179
|
-
if (!isMatic(this.chainId))
|
|
180
|
-
throw new Error('Not matic');
|
|
181
|
-
var wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId];
|
|
182
|
-
invariant(wrapped instanceof Token);
|
|
183
|
-
return wrapped;
|
|
184
|
-
},
|
|
185
|
-
enumerable: false,
|
|
186
|
-
configurable: true
|
|
187
|
-
});
|
|
188
|
-
return MaticNativeCurrency;
|
|
189
|
-
}(NativeCurrency));
|
|
190
|
-
var BNBNativeCurrency = /** @class */ (function (_super) {
|
|
191
|
-
__extends(BNBNativeCurrency, _super);
|
|
192
|
-
function BNBNativeCurrency(chainId) {
|
|
193
|
-
if (!isBNB(chainId))
|
|
194
|
-
throw new Error('Not bnb');
|
|
195
|
-
return _super.call(this, chainId, 18, 'BNB', '') || this;
|
|
196
|
-
}
|
|
197
|
-
BNBNativeCurrency.prototype.equals = function (other) {
|
|
198
|
-
return other.isNative && other.chainId === this.chainId;
|
|
199
|
-
};
|
|
200
|
-
Object.defineProperty(BNBNativeCurrency.prototype, "wrapped", {
|
|
201
|
-
get: function () {
|
|
202
|
-
if (!isBNB(this.chainId))
|
|
203
|
-
throw new Error('Not bnb');
|
|
204
|
-
var wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId];
|
|
205
|
-
invariant(wrapped instanceof Token);
|
|
206
|
-
return wrapped;
|
|
207
|
-
},
|
|
208
|
-
enumerable: false,
|
|
209
|
-
configurable: true
|
|
210
|
-
});
|
|
211
|
-
return BNBNativeCurrency;
|
|
212
|
-
}(NativeCurrency));
|
|
213
|
-
var tBNBNativeCurrency = /** @class */ (function (_super) {
|
|
214
|
-
__extends(tBNBNativeCurrency, _super);
|
|
215
|
-
function tBNBNativeCurrency(chainId) {
|
|
216
|
-
if (!isBNB_Testnet(chainId))
|
|
217
|
-
throw new Error('Not bnb testnet');
|
|
218
|
-
return _super.call(this, chainId, 18, 'tBNB', '') || this;
|
|
219
|
-
}
|
|
220
|
-
tBNBNativeCurrency.prototype.equals = function (other) {
|
|
221
|
-
return other.isNative && other.chainId === this.chainId;
|
|
222
|
-
};
|
|
223
|
-
Object.defineProperty(tBNBNativeCurrency.prototype, "wrapped", {
|
|
224
|
-
get: function () {
|
|
225
|
-
if (!isBNB_Testnet(this.chainId))
|
|
226
|
-
throw new Error('Not bnb testnet');
|
|
227
|
-
var wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId];
|
|
228
|
-
invariant(wrapped instanceof Token);
|
|
229
|
-
return wrapped;
|
|
230
|
-
},
|
|
231
|
-
enumerable: false,
|
|
232
|
-
configurable: true
|
|
233
|
-
});
|
|
234
|
-
return tBNBNativeCurrency;
|
|
235
|
-
}(NativeCurrency));
|
|
236
|
-
var ExtendedEther = /** @class */ (function (_super) {
|
|
237
|
-
__extends(ExtendedEther, _super);
|
|
238
|
-
function ExtendedEther() {
|
|
239
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
240
|
-
}
|
|
241
|
-
Object.defineProperty(ExtendedEther.prototype, "wrapped", {
|
|
242
|
-
get: function () {
|
|
243
|
-
var wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId];
|
|
244
|
-
if (wrapped)
|
|
245
|
-
return wrapped;
|
|
246
|
-
throw new Error('Unsupported chain ID');
|
|
247
|
-
},
|
|
248
|
-
enumerable: false,
|
|
249
|
-
configurable: true
|
|
250
|
-
});
|
|
251
|
-
ExtendedEther.onChain = function (chainId) {
|
|
252
|
-
var _a;
|
|
253
|
-
return (_a = this._cachedExtendedEther[chainId]) !== null && _a !== void 0 ? _a : (this._cachedExtendedEther[chainId] = new ExtendedEther(chainId));
|
|
254
|
-
};
|
|
255
|
-
ExtendedEther._cachedExtendedEther = {};
|
|
256
|
-
return ExtendedEther;
|
|
257
|
-
}(Ether));
|
|
258
|
-
var INJ_EVM_TESTNET_NativeCurrency = /** @class */ (function (_super) {
|
|
259
|
-
__extends(INJ_EVM_TESTNET_NativeCurrency, _super);
|
|
260
|
-
function INJ_EVM_TESTNET_NativeCurrency(chainId) {
|
|
261
|
-
if (!isINJ_EVM_TESTNET(chainId))
|
|
262
|
-
throw new Error('Not INJ test');
|
|
263
|
-
return _super.call(this, chainId, 18, 'INJ', '') || this;
|
|
264
|
-
}
|
|
265
|
-
INJ_EVM_TESTNET_NativeCurrency.prototype.equals = function (other) {
|
|
266
|
-
return other.isNative && other.chainId === this.chainId;
|
|
267
|
-
};
|
|
268
|
-
Object.defineProperty(INJ_EVM_TESTNET_NativeCurrency.prototype, "wrapped", {
|
|
269
|
-
get: function () {
|
|
270
|
-
if (!isINJ_EVM_TESTNET(this.chainId))
|
|
271
|
-
throw new Error('Not INJ test');
|
|
272
|
-
var wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId];
|
|
273
|
-
invariant(wrapped instanceof Token);
|
|
274
|
-
return wrapped;
|
|
275
|
-
},
|
|
276
|
-
enumerable: false,
|
|
277
|
-
configurable: true
|
|
278
|
-
});
|
|
279
|
-
return INJ_EVM_TESTNET_NativeCurrency;
|
|
280
|
-
}(NativeCurrency));
|
|
281
|
-
var INEVM_NativeCurrency = /** @class */ (function (_super) {
|
|
282
|
-
__extends(INEVM_NativeCurrency, _super);
|
|
283
|
-
function INEVM_NativeCurrency(chainId) {
|
|
284
|
-
if (!isINEVM(chainId))
|
|
285
|
-
throw new Error('Not INEVM');
|
|
286
|
-
return _super.call(this, chainId, 18, 'INJ', '') || this;
|
|
287
|
-
}
|
|
288
|
-
INEVM_NativeCurrency.prototype.equals = function (other) {
|
|
289
|
-
return other.isNative && other.chainId === this.chainId;
|
|
290
|
-
};
|
|
291
|
-
Object.defineProperty(INEVM_NativeCurrency.prototype, "wrapped", {
|
|
292
|
-
get: function () {
|
|
293
|
-
if (!isINEVM(this.chainId))
|
|
294
|
-
throw new Error('Not INEVM');
|
|
295
|
-
var wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId];
|
|
296
|
-
invariant(wrapped instanceof Token);
|
|
297
|
-
return wrapped;
|
|
298
|
-
},
|
|
299
|
-
enumerable: false,
|
|
300
|
-
configurable: true
|
|
301
|
-
});
|
|
302
|
-
return INEVM_NativeCurrency;
|
|
303
|
-
}(NativeCurrency));
|
|
304
|
-
var Sepolia_NativeCurrency = /** @class */ (function (_super) {
|
|
305
|
-
__extends(Sepolia_NativeCurrency, _super);
|
|
306
|
-
function Sepolia_NativeCurrency(chainId) {
|
|
307
|
-
if (!isSepolia(chainId))
|
|
308
|
-
throw new Error('Not Sepolia');
|
|
309
|
-
return _super.call(this, chainId, 18, 'ETH', '') || this;
|
|
310
|
-
}
|
|
311
|
-
Sepolia_NativeCurrency.prototype.equals = function (other) {
|
|
312
|
-
return other.isNative && other.chainId === this.chainId;
|
|
313
|
-
};
|
|
314
|
-
Object.defineProperty(Sepolia_NativeCurrency.prototype, "wrapped", {
|
|
315
|
-
get: function () {
|
|
316
|
-
if (!isSepolia(this.chainId))
|
|
317
|
-
throw new Error('Not Sepolia');
|
|
318
|
-
var wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId];
|
|
319
|
-
invariant(wrapped instanceof Token);
|
|
320
|
-
return wrapped;
|
|
321
|
-
},
|
|
322
|
-
enumerable: false,
|
|
323
|
-
configurable: true
|
|
324
|
-
});
|
|
325
|
-
return Sepolia_NativeCurrency;
|
|
326
|
-
}(NativeCurrency));
|
|
327
|
-
var LineaNativeCurrency = /** @class */ (function (_super) {
|
|
328
|
-
__extends(LineaNativeCurrency, _super);
|
|
329
|
-
function LineaNativeCurrency(chainId) {
|
|
330
|
-
if (!isLinea(chainId))
|
|
331
|
-
throw new Error('Not linea');
|
|
332
|
-
return _super.call(this, chainId, 18, 'ETH', '') || this;
|
|
333
|
-
}
|
|
334
|
-
LineaNativeCurrency.prototype.equals = function (other) {
|
|
335
|
-
return other.isNative && other.chainId === this.chainId;
|
|
336
|
-
};
|
|
337
|
-
Object.defineProperty(LineaNativeCurrency.prototype, "wrapped", {
|
|
338
|
-
get: function () {
|
|
339
|
-
if (!isLinea(this.chainId))
|
|
340
|
-
throw new Error('Not linea');
|
|
341
|
-
var wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId];
|
|
342
|
-
invariant(wrapped instanceof Token);
|
|
343
|
-
return wrapped;
|
|
344
|
-
},
|
|
345
|
-
enumerable: false,
|
|
346
|
-
configurable: true
|
|
347
|
-
});
|
|
348
|
-
return LineaNativeCurrency;
|
|
349
|
-
}(NativeCurrency));
|
|
350
|
-
var IotaNativeCurrency = /** @class */ (function (_super) {
|
|
351
|
-
__extends(IotaNativeCurrency, _super);
|
|
352
|
-
function IotaNativeCurrency(chainId) {
|
|
353
|
-
if (!isIota(chainId))
|
|
354
|
-
throw new Error('Not iota');
|
|
355
|
-
return _super.call(this, chainId, 18, 'IOTA', '') || this;
|
|
356
|
-
}
|
|
357
|
-
IotaNativeCurrency.prototype.equals = function (other) {
|
|
358
|
-
return other.isNative && other.chainId === this.chainId;
|
|
359
|
-
};
|
|
360
|
-
Object.defineProperty(IotaNativeCurrency.prototype, "wrapped", {
|
|
361
|
-
get: function () {
|
|
362
|
-
if (!isIota(this.chainId))
|
|
363
|
-
throw new Error('Not iota');
|
|
364
|
-
var wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId];
|
|
365
|
-
invariant(wrapped instanceof Token);
|
|
366
|
-
return wrapped;
|
|
367
|
-
},
|
|
368
|
-
enumerable: false,
|
|
369
|
-
configurable: true
|
|
370
|
-
});
|
|
371
|
-
return IotaNativeCurrency;
|
|
372
|
-
}(NativeCurrency));
|
|
373
|
-
var BaseNativeCurrency = /** @class */ (function (_super) {
|
|
374
|
-
__extends(BaseNativeCurrency, _super);
|
|
375
|
-
function BaseNativeCurrency(chainId) {
|
|
376
|
-
if (!isBase(chainId))
|
|
377
|
-
throw new Error('Not Base');
|
|
378
|
-
return _super.call(this, chainId, 18, 'ETH', '') || this;
|
|
379
|
-
}
|
|
380
|
-
BaseNativeCurrency.prototype.equals = function (other) {
|
|
381
|
-
return other.isNative && other.chainId === this.chainId;
|
|
382
|
-
};
|
|
383
|
-
Object.defineProperty(BaseNativeCurrency.prototype, "wrapped", {
|
|
384
|
-
get: function () {
|
|
385
|
-
if (!isBase(this.chainId))
|
|
386
|
-
throw new Error('Not Base');
|
|
387
|
-
var wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId];
|
|
388
|
-
invariant(wrapped instanceof Token);
|
|
389
|
-
return wrapped;
|
|
390
|
-
},
|
|
391
|
-
enumerable: false,
|
|
392
|
-
configurable: true
|
|
393
|
-
});
|
|
394
|
-
return BaseNativeCurrency;
|
|
395
|
-
}(NativeCurrency));
|
|
396
|
-
var cachedNativeCurrency = {};
|
|
397
|
-
export function nativeOnChain(chainId) {
|
|
398
|
-
if (cachedNativeCurrency[chainId])
|
|
399
|
-
return cachedNativeCurrency[chainId];
|
|
400
|
-
var nativeCurrency;
|
|
401
|
-
//TODO: find a more elegant solution
|
|
402
|
-
var selectedChain;
|
|
403
|
-
if (typeof chainId === 'string') {
|
|
404
|
-
selectedChain = parseInt(chainId);
|
|
405
|
-
}
|
|
406
|
-
else {
|
|
407
|
-
selectedChain = chainId;
|
|
408
|
-
}
|
|
409
|
-
if (isMatic(selectedChain)) {
|
|
410
|
-
nativeCurrency = new MaticNativeCurrency(selectedChain);
|
|
411
|
-
}
|
|
412
|
-
else if (isBNB(selectedChain)) {
|
|
413
|
-
nativeCurrency = new BNBNativeCurrency(selectedChain);
|
|
414
|
-
}
|
|
415
|
-
else if (isBNB_Testnet(selectedChain)) {
|
|
416
|
-
nativeCurrency = new tBNBNativeCurrency(selectedChain);
|
|
417
|
-
}
|
|
418
|
-
else if (isAvax(selectedChain)) {
|
|
419
|
-
nativeCurrency = new AvaxNativeCurrency(selectedChain);
|
|
420
|
-
}
|
|
421
|
-
else if (isFantom(selectedChain)) {
|
|
422
|
-
nativeCurrency = new FantomNativeCurrency(selectedChain);
|
|
423
|
-
}
|
|
424
|
-
else if (isCronos(selectedChain)) {
|
|
425
|
-
nativeCurrency = new CronosNativeCurrency(selectedChain);
|
|
426
|
-
}
|
|
427
|
-
else if (isGnosis(selectedChain)) {
|
|
428
|
-
nativeCurrency = new GnosisNativeCurrency(selectedChain);
|
|
429
|
-
}
|
|
430
|
-
else if (isINJ_EVM_TESTNET(selectedChain)) {
|
|
431
|
-
nativeCurrency = new INJ_EVM_TESTNET_NativeCurrency(selectedChain);
|
|
432
|
-
}
|
|
433
|
-
else if (isINEVM(selectedChain)) {
|
|
434
|
-
nativeCurrency = new INEVM_NativeCurrency(selectedChain);
|
|
435
|
-
}
|
|
436
|
-
else if (isSepolia(selectedChain)) {
|
|
437
|
-
nativeCurrency = new Sepolia_NativeCurrency(selectedChain);
|
|
438
|
-
}
|
|
439
|
-
else if (isLinea(selectedChain)) {
|
|
440
|
-
nativeCurrency = new LineaNativeCurrency(selectedChain);
|
|
441
|
-
}
|
|
442
|
-
else if (isIota(selectedChain)) {
|
|
443
|
-
nativeCurrency = new IotaNativeCurrency(selectedChain);
|
|
444
|
-
}
|
|
445
|
-
else if (isBase(selectedChain)) {
|
|
446
|
-
nativeCurrency = new BaseNativeCurrency(selectedChain);
|
|
447
|
-
}
|
|
448
|
-
else {
|
|
449
|
-
nativeCurrency = ExtendedEther.onChain(selectedChain);
|
|
450
|
-
}
|
|
451
|
-
return (cachedNativeCurrency[selectedChain] = nativeCurrency);
|
|
452
|
-
}
|
|
1
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
2
|
+
import { ChainId } from "@ape.swap/apeswap-lists";
|
|
3
|
+
export var WNATIVE = (_a = {},
|
|
4
|
+
_a[ChainId.MAINNET] = {
|
|
5
|
+
symbol: 'wETH',
|
|
6
|
+
address: (_b = {},
|
|
7
|
+
_b[ChainId.MAINNET] = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
8
|
+
_b),
|
|
9
|
+
decimals: (_c = {},
|
|
10
|
+
_c[ChainId.MAINNET] = 18,
|
|
11
|
+
_c),
|
|
12
|
+
active: true,
|
|
13
|
+
},
|
|
14
|
+
_a[ChainId.BSC] = {
|
|
15
|
+
symbol: 'wBNB',
|
|
16
|
+
address: (_d = {},
|
|
17
|
+
_d[ChainId.BSC] = '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',
|
|
18
|
+
_d),
|
|
19
|
+
decimals: (_e = {},
|
|
20
|
+
_e[ChainId.BSC] = 18,
|
|
21
|
+
_e),
|
|
22
|
+
active: true,
|
|
23
|
+
},
|
|
24
|
+
_a[ChainId.MATIC] = {
|
|
25
|
+
symbol: 'wPOL',
|
|
26
|
+
address: (_f = {},
|
|
27
|
+
_f[ChainId.MATIC] = '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270',
|
|
28
|
+
_f),
|
|
29
|
+
decimals: (_g = {},
|
|
30
|
+
_g[ChainId.MATIC] = 18,
|
|
31
|
+
_g),
|
|
32
|
+
active: true,
|
|
33
|
+
},
|
|
34
|
+
_a[ChainId.ARBITRUM] = {
|
|
35
|
+
symbol: 'wETH',
|
|
36
|
+
address: (_h = {},
|
|
37
|
+
_h[ChainId.ARBITRUM] = '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',
|
|
38
|
+
_h),
|
|
39
|
+
decimals: (_j = {},
|
|
40
|
+
_j[ChainId.ARBITRUM] = 18,
|
|
41
|
+
_j),
|
|
42
|
+
active: true,
|
|
43
|
+
},
|
|
44
|
+
_a[ChainId.LINEA] = {
|
|
45
|
+
symbol: 'wETH',
|
|
46
|
+
address: (_k = {},
|
|
47
|
+
_k[ChainId.LINEA] = '0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f',
|
|
48
|
+
_k),
|
|
49
|
+
decimals: (_l = {},
|
|
50
|
+
_l[ChainId.LINEA] = 18,
|
|
51
|
+
_l),
|
|
52
|
+
active: true,
|
|
53
|
+
},
|
|
54
|
+
_a[ChainId.BASE] = {
|
|
55
|
+
symbol: 'wETH',
|
|
56
|
+
address: (_m = {},
|
|
57
|
+
_m[ChainId.BASE] = '0x4200000000000000000000000000000000000006',
|
|
58
|
+
_m),
|
|
59
|
+
decimals: (_o = {},
|
|
60
|
+
_o[ChainId.BASE] = 18,
|
|
61
|
+
_o),
|
|
62
|
+
active: true,
|
|
63
|
+
},
|
|
64
|
+
_a);
|