@pioneer-platform/uniswap-client 0.0.9 → 0.0.11
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/lib/constants/addresses.d.ts +9 -0
- package/lib/constants/addresses.js +41 -0
- package/lib/constants/chainInfo.d.ts +50 -0
- package/lib/constants/chainInfo.js +234 -0
- package/lib/constants/chains.d.ts +57 -0
- package/lib/constants/chains.js +102 -0
- package/lib/constants/chains.test.d.ts +1 -0
- package/lib/constants/chains.test.js +29 -0
- package/lib/constants/eip1193.d.ts +8 -0
- package/lib/constants/eip1193.js +14 -0
- package/lib/constants/index.d.ts +9 -0
- package/lib/constants/index.js +26 -0
- package/lib/constants/jsonRpcEndpoints.d.ts +12 -0
- package/lib/constants/jsonRpcEndpoints.js +101 -0
- package/lib/constants/locales.d.ts +6 -0
- package/lib/constants/locales.js +74 -0
- package/lib/constants/misc.d.ts +22 -0
- package/lib/constants/misc.js +37 -0
- package/lib/constants/routing.d.ts +20 -0
- package/lib/constants/routing.js +87 -0
- package/lib/constants/tokens.d.ts +78 -0
- package/lib/constants/tokens.js +246 -0
- package/lib/constants/utils/constructSameAddressMap.d.ts +4 -0
- package/lib/constants/utils/constructSameAddressMap.js +19 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +53 -32
- package/package.json +6 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.JSON_RPC_FALLBACK_ENDPOINTS = void 0;
|
|
5
|
+
var chains_1 = require("./chains");
|
|
6
|
+
/**
|
|
7
|
+
* Fallback JSON RPC endpoints.
|
|
8
|
+
* These are used if the integrator does not provide an endpoint, or if the endpoint does not work.
|
|
9
|
+
*
|
|
10
|
+
* MetaMask allows switching to any URL, but displays a warning if it is not on the "Safe" list:
|
|
11
|
+
* https://github.com/MetaMask/metamask-mobile/blob/bdb7f37c90e4fc923881a07fca38d4e77c73a579/app/core/RPCMethods/wallet_addEthereumChain.js#L228-L235
|
|
12
|
+
* https://chainid.network/chains.json
|
|
13
|
+
*
|
|
14
|
+
* These "Safe" URLs are listed first, followed by other fallback URLs, which are taken from chainlist.org.
|
|
15
|
+
*/
|
|
16
|
+
exports.JSON_RPC_FALLBACK_ENDPOINTS = (_a = {},
|
|
17
|
+
_a[chains_1.SupportedChainId.MAINNET] = [
|
|
18
|
+
// "Safe" URLs
|
|
19
|
+
'https://cloudflare-eth.com',
|
|
20
|
+
// "Fallback" URLs
|
|
21
|
+
'https://rpc.ankr.com/eth',
|
|
22
|
+
'https://eth-mainnet.public.blastapi.io',
|
|
23
|
+
],
|
|
24
|
+
_a[chains_1.SupportedChainId.ROPSTEN] = [
|
|
25
|
+
// "Fallback" URLs
|
|
26
|
+
'https://rpc.ankr.com/eth_ropsten',
|
|
27
|
+
],
|
|
28
|
+
_a[chains_1.SupportedChainId.RINKEBY] = [
|
|
29
|
+
// "Fallback" URLs
|
|
30
|
+
'https://rinkeby-light.eth.linkpool.io/',
|
|
31
|
+
],
|
|
32
|
+
_a[chains_1.SupportedChainId.GOERLI] = [
|
|
33
|
+
// "Safe" URLs
|
|
34
|
+
'https://rpc.goerli.mudit.blog/',
|
|
35
|
+
// "Fallback" URLs
|
|
36
|
+
'https://rpc.ankr.com/eth_goerli',
|
|
37
|
+
],
|
|
38
|
+
_a[chains_1.SupportedChainId.KOVAN] = [
|
|
39
|
+
// "Fallback" URLs
|
|
40
|
+
'https://eth-kovan.public.blastapi.io',
|
|
41
|
+
],
|
|
42
|
+
_a[chains_1.SupportedChainId.POLYGON] = [
|
|
43
|
+
// "Safe" URLs
|
|
44
|
+
'https://polygon-rpc.com/',
|
|
45
|
+
],
|
|
46
|
+
_a[chains_1.SupportedChainId.POLYGON_MUMBAI] = [
|
|
47
|
+
// "Safe" URLs
|
|
48
|
+
'https://matic-mumbai.chainstacklabs.com',
|
|
49
|
+
'https://rpc-mumbai.maticvigil.com',
|
|
50
|
+
'https://matic-testnet-archive-rpc.bwarelabs.com',
|
|
51
|
+
],
|
|
52
|
+
_a[chains_1.SupportedChainId.ARBITRUM_ONE] = [
|
|
53
|
+
// "Safe" URLs
|
|
54
|
+
'https://arb1.arbitrum.io/rpc',
|
|
55
|
+
// "Fallback" URLs
|
|
56
|
+
'https://arbitrum.public-rpc.com',
|
|
57
|
+
],
|
|
58
|
+
_a[chains_1.SupportedChainId.ARBITRUM_RINKEBY] = [
|
|
59
|
+
// "Safe" URLs
|
|
60
|
+
'https://rinkeby.arbitrum.io/rpc',
|
|
61
|
+
],
|
|
62
|
+
_a[chains_1.SupportedChainId.OPTIMISM] = [
|
|
63
|
+
// "Safe" URLs
|
|
64
|
+
'https://mainnet.optimism.io/',
|
|
65
|
+
// "Fallback" URLs
|
|
66
|
+
'https://rpc.ankr.com/optimism',
|
|
67
|
+
],
|
|
68
|
+
_a[chains_1.SupportedChainId.OPTIMISM_GOERLI] = [
|
|
69
|
+
// "Safe" URLs
|
|
70
|
+
'https://goerli.optimism.io',
|
|
71
|
+
],
|
|
72
|
+
_a[chains_1.SupportedChainId.CELO] = [
|
|
73
|
+
// "Safe" URLs
|
|
74
|
+
'https://forno.celo.org',
|
|
75
|
+
],
|
|
76
|
+
_a[chains_1.SupportedChainId.CELO_ALFAJORES] = [
|
|
77
|
+
// "Safe" URLs
|
|
78
|
+
'https://alfajores-forno.celo-testnet.org',
|
|
79
|
+
],
|
|
80
|
+
_a[chains_1.SupportedChainId.BNB] = [
|
|
81
|
+
// "Safe" URLs
|
|
82
|
+
'https://endpoints.omniatech.io/v1/bsc/mainnet/public',
|
|
83
|
+
'https://bsc-mainnet.gateway.pokt.network/v1/lb/6136201a7bad1500343e248d',
|
|
84
|
+
'https://1rpc.io/bnb',
|
|
85
|
+
'https://bsc-dataseed3.binance.org',
|
|
86
|
+
'https://bsc-dataseed2.defibit.io',
|
|
87
|
+
'https://bsc-dataseed1.ninicoin.io',
|
|
88
|
+
'https://binance.nodereal.io',
|
|
89
|
+
'https://bsc-dataseed4.defibit.io',
|
|
90
|
+
'https://rpc.ankr.com/bsc',
|
|
91
|
+
],
|
|
92
|
+
_a[chains_1.SupportedChainId.BASE] = [
|
|
93
|
+
// "Safe" URLs
|
|
94
|
+
'https://mainnet.base.org',
|
|
95
|
+
'https://base.gateway.tenderly.co',
|
|
96
|
+
'https://base.publicnode.com',
|
|
97
|
+
// "Fallback" URLs
|
|
98
|
+
'https://1rpc.io/base',
|
|
99
|
+
'https://base.meowrpc.com',
|
|
100
|
+
],
|
|
101
|
+
_a);
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LOCALE_LABEL = exports.DEFAULT_LOCALE = exports.SUPPORTED_LOCALES = void 0;
|
|
4
|
+
exports.SUPPORTED_LOCALES = [
|
|
5
|
+
// order as they appear in the language dropdown
|
|
6
|
+
'en-US',
|
|
7
|
+
'af-ZA',
|
|
8
|
+
'ar-SA',
|
|
9
|
+
'ca-ES',
|
|
10
|
+
'cs-CZ',
|
|
11
|
+
'da-DK',
|
|
12
|
+
'de-DE',
|
|
13
|
+
'el-GR',
|
|
14
|
+
'es-ES',
|
|
15
|
+
'fi-FI',
|
|
16
|
+
'fr-FR',
|
|
17
|
+
'he-IL',
|
|
18
|
+
'hu-HU',
|
|
19
|
+
'id-ID',
|
|
20
|
+
'it-IT',
|
|
21
|
+
'ja-JP',
|
|
22
|
+
'ko-KR',
|
|
23
|
+
'nl-NL',
|
|
24
|
+
'no-NO',
|
|
25
|
+
'pl-PL',
|
|
26
|
+
'pt-BR',
|
|
27
|
+
'pt-PT',
|
|
28
|
+
'ro-RO',
|
|
29
|
+
'ru-RU',
|
|
30
|
+
'sr-SP',
|
|
31
|
+
'sv-SE',
|
|
32
|
+
'sw-TZ',
|
|
33
|
+
'tr-TR',
|
|
34
|
+
'uk-UA',
|
|
35
|
+
'vi-VN',
|
|
36
|
+
'zh-CN',
|
|
37
|
+
'zh-TW',
|
|
38
|
+
];
|
|
39
|
+
exports.DEFAULT_LOCALE = 'en-US';
|
|
40
|
+
exports.LOCALE_LABEL = {
|
|
41
|
+
'af-ZA': 'Afrikaans',
|
|
42
|
+
'ar-SA': 'العربية',
|
|
43
|
+
'ca-ES': 'Català',
|
|
44
|
+
'cs-CZ': 'čeština',
|
|
45
|
+
'da-DK': 'dansk',
|
|
46
|
+
'de-DE': 'Deutsch',
|
|
47
|
+
'el-GR': 'ελληνικά',
|
|
48
|
+
'en-US': 'English',
|
|
49
|
+
'es-ES': 'Español',
|
|
50
|
+
'fi-FI': 'suomi',
|
|
51
|
+
'fr-FR': 'français',
|
|
52
|
+
'he-IL': 'עִברִית',
|
|
53
|
+
'hu-HU': 'Magyar',
|
|
54
|
+
'id-ID': 'bahasa Indonesia',
|
|
55
|
+
'it-IT': 'Italiano',
|
|
56
|
+
'ja-JP': '日本語',
|
|
57
|
+
'ko-KR': '한국어',
|
|
58
|
+
'nl-NL': 'Nederlands',
|
|
59
|
+
'no-NO': 'norsk',
|
|
60
|
+
'pl-PL': 'Polskie',
|
|
61
|
+
'pt-BR': 'português',
|
|
62
|
+
'pt-PT': 'português',
|
|
63
|
+
'ro-RO': 'Română',
|
|
64
|
+
'ru-RU': 'русский',
|
|
65
|
+
'sr-SP': 'Српски',
|
|
66
|
+
'sv-SE': 'svenska',
|
|
67
|
+
'sw-TZ': 'Kiswahili',
|
|
68
|
+
'tr-TR': 'Türkçe',
|
|
69
|
+
'uk-UA': 'Український',
|
|
70
|
+
'vi-VN': 'Tiếng Việt',
|
|
71
|
+
'zh-CN': '简体中文',
|
|
72
|
+
'zh-TW': '繁体中文',
|
|
73
|
+
pseudo: 'ƥƨèúδô',
|
|
74
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Percent } from '@uniswap/sdk-core';
|
|
2
|
+
import JSBI from 'jsbi';
|
|
3
|
+
export declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
4
|
+
export declare const NetworkContextName = "NETWORK";
|
|
5
|
+
export declare const MS_IN_SECOND = 1000;
|
|
6
|
+
export declare const DEFAULT_DEADLINE_FROM_NOW: number;
|
|
7
|
+
export declare const L2_DEADLINE_FROM_NOW: number;
|
|
8
|
+
export declare const DEFAULT_TXN_DISMISS_MS = 25000;
|
|
9
|
+
export declare const L2_TXN_DISMISS_MS = 5000;
|
|
10
|
+
export declare const BIG_INT_SECONDS_IN_WEEK: JSBI;
|
|
11
|
+
export declare const BIG_INT_ZERO: JSBI;
|
|
12
|
+
export declare const ONE_BIPS: Percent;
|
|
13
|
+
export declare const ALLOWED_PRICE_IMPACT_LOW: Percent;
|
|
14
|
+
export declare const ALLOWED_PRICE_IMPACT_MEDIUM: Percent;
|
|
15
|
+
export declare const ALLOWED_PRICE_IMPACT_HIGH: Percent;
|
|
16
|
+
export declare const PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN: Percent;
|
|
17
|
+
export declare const BLOCKED_PRICE_IMPACT_NON_EXPERT: Percent;
|
|
18
|
+
export declare const BETTER_TRADE_LESS_HOPS_THRESHOLD: Percent;
|
|
19
|
+
export declare const ZERO_PERCENT: Percent;
|
|
20
|
+
export declare const TWO_PERCENT: Percent;
|
|
21
|
+
export declare const ONE_HUNDRED_PERCENT: Percent;
|
|
22
|
+
export declare const TX_GAS_MARGIN = 0.2;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TX_GAS_MARGIN = exports.ONE_HUNDRED_PERCENT = exports.TWO_PERCENT = exports.ZERO_PERCENT = exports.BETTER_TRADE_LESS_HOPS_THRESHOLD = exports.BLOCKED_PRICE_IMPACT_NON_EXPERT = exports.PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN = exports.ALLOWED_PRICE_IMPACT_HIGH = exports.ALLOWED_PRICE_IMPACT_MEDIUM = exports.ALLOWED_PRICE_IMPACT_LOW = exports.ONE_BIPS = exports.BIG_INT_ZERO = exports.BIG_INT_SECONDS_IN_WEEK = exports.L2_TXN_DISMISS_MS = exports.DEFAULT_TXN_DISMISS_MS = exports.L2_DEADLINE_FROM_NOW = exports.DEFAULT_DEADLINE_FROM_NOW = exports.MS_IN_SECOND = exports.NetworkContextName = exports.ZERO_ADDRESS = void 0;
|
|
7
|
+
var sdk_core_1 = require("@uniswap/sdk-core");
|
|
8
|
+
var jsbi_1 = __importDefault(require("jsbi"));
|
|
9
|
+
exports.ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
10
|
+
exports.NetworkContextName = 'NETWORK';
|
|
11
|
+
exports.MS_IN_SECOND = 1000;
|
|
12
|
+
// 30 minutes, denominated in seconds
|
|
13
|
+
exports.DEFAULT_DEADLINE_FROM_NOW = 60 * 30;
|
|
14
|
+
exports.L2_DEADLINE_FROM_NOW = 60 * 5;
|
|
15
|
+
// transaction popup dismisal amounts
|
|
16
|
+
exports.DEFAULT_TXN_DISMISS_MS = 25000;
|
|
17
|
+
exports.L2_TXN_DISMISS_MS = 5000;
|
|
18
|
+
// used for rewards deadlines
|
|
19
|
+
exports.BIG_INT_SECONDS_IN_WEEK = jsbi_1.default.BigInt(60 * 60 * 24 * 7);
|
|
20
|
+
exports.BIG_INT_ZERO = jsbi_1.default.BigInt(0);
|
|
21
|
+
// one basis JSBI.BigInt
|
|
22
|
+
var BIPS_BASE = jsbi_1.default.BigInt(10000);
|
|
23
|
+
exports.ONE_BIPS = new sdk_core_1.Percent(jsbi_1.default.BigInt(1), BIPS_BASE);
|
|
24
|
+
// used for warning states
|
|
25
|
+
exports.ALLOWED_PRICE_IMPACT_LOW = new sdk_core_1.Percent(jsbi_1.default.BigInt(100), BIPS_BASE); // 1%
|
|
26
|
+
exports.ALLOWED_PRICE_IMPACT_MEDIUM = new sdk_core_1.Percent(jsbi_1.default.BigInt(300), BIPS_BASE); // 3%
|
|
27
|
+
exports.ALLOWED_PRICE_IMPACT_HIGH = new sdk_core_1.Percent(jsbi_1.default.BigInt(500), BIPS_BASE); // 5%
|
|
28
|
+
// if the price slippage exceeds this number, force the user to type 'confirm' to execute
|
|
29
|
+
exports.PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN = new sdk_core_1.Percent(jsbi_1.default.BigInt(1000), BIPS_BASE); // 10%
|
|
30
|
+
// for non expert mode disable swaps above this
|
|
31
|
+
exports.BLOCKED_PRICE_IMPACT_NON_EXPERT = new sdk_core_1.Percent(jsbi_1.default.BigInt(1500), BIPS_BASE); // 15%
|
|
32
|
+
exports.BETTER_TRADE_LESS_HOPS_THRESHOLD = new sdk_core_1.Percent(jsbi_1.default.BigInt(50), BIPS_BASE);
|
|
33
|
+
exports.ZERO_PERCENT = new sdk_core_1.Percent('0');
|
|
34
|
+
exports.TWO_PERCENT = new sdk_core_1.Percent(jsbi_1.default.BigInt(200), BIPS_BASE);
|
|
35
|
+
exports.ONE_HUNDRED_PERCENT = new sdk_core_1.Percent('1');
|
|
36
|
+
// gas margin to ensure successful transactions
|
|
37
|
+
exports.TX_GAS_MARGIN = 0.2;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NativeCurrency, Token } from '@uniswap/sdk-core';
|
|
2
|
+
type ChainTokenList = {
|
|
3
|
+
readonly [chainId: number]: Array<Token | NativeCurrency>;
|
|
4
|
+
};
|
|
5
|
+
export declare const BASES_TO_CHECK_TRADES_AGAINST: ChainTokenList;
|
|
6
|
+
export declare const ADDITIONAL_BASES: {
|
|
7
|
+
[chainId: number]: {
|
|
8
|
+
[tokenAddress: string]: Token[];
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Some tokens can only be swapped via certain pairs, so we override the list of bases that are considered for these
|
|
13
|
+
* tokens.
|
|
14
|
+
*/
|
|
15
|
+
export declare const CUSTOM_BASES: {
|
|
16
|
+
[chainId: number]: {
|
|
17
|
+
[tokenAddress: string]: Token[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
+
if (ar || !(i in from)) {
|
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
+
ar[i] = from[i];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
+
};
|
|
22
|
+
var _a, _b, _c, _d, _e;
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.CUSTOM_BASES = exports.ADDITIONAL_BASES = exports.BASES_TO_CHECK_TRADES_AGAINST = void 0;
|
|
25
|
+
var chains_1 = require("./chains");
|
|
26
|
+
var tokens_1 = require("./tokens");
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
var WRAPPED_NATIVE_CURRENCIES_ONLY = Object.fromEntries(Object.entries(tokens_1.WRAPPED_NATIVE_CURRENCY)
|
|
29
|
+
.map(function (_a) {
|
|
30
|
+
var key = _a[0], value = _a[1];
|
|
31
|
+
return [key, [value]];
|
|
32
|
+
})
|
|
33
|
+
.filter(Boolean));
|
|
34
|
+
// used to construct intermediary pairs for trading
|
|
35
|
+
exports.BASES_TO_CHECK_TRADES_AGAINST = __assign(__assign({}, WRAPPED_NATIVE_CURRENCIES_ONLY), (_a = {}, _a[chains_1.SupportedChainId.MAINNET] = __spreadArray([
|
|
36
|
+
(0, tokens_1.nativeOnChain)(chains_1.SupportedChainId.MAINNET),
|
|
37
|
+
tokens_1.DAI,
|
|
38
|
+
tokens_1.USDC_MAINNET,
|
|
39
|
+
tokens_1.USDT,
|
|
40
|
+
tokens_1.WBTC
|
|
41
|
+
], WRAPPED_NATIVE_CURRENCIES_ONLY[chains_1.SupportedChainId.MAINNET], true), _a[chains_1.SupportedChainId.OPTIMISM] = __spreadArray(__spreadArray([], WRAPPED_NATIVE_CURRENCIES_ONLY[chains_1.SupportedChainId.OPTIMISM], true), [
|
|
42
|
+
tokens_1.DAI_OPTIMISM,
|
|
43
|
+
tokens_1.USDT_OPTIMISM,
|
|
44
|
+
tokens_1.WBTC_OPTIMISM,
|
|
45
|
+
], false), _a[chains_1.SupportedChainId.ARBITRUM_ONE] = __spreadArray(__spreadArray([], WRAPPED_NATIVE_CURRENCIES_ONLY[chains_1.SupportedChainId.ARBITRUM_ONE], true), [
|
|
46
|
+
tokens_1.DAI_ARBITRUM_ONE,
|
|
47
|
+
tokens_1.USDT_ARBITRUM_ONE,
|
|
48
|
+
tokens_1.WBTC_ARBITRUM_ONE,
|
|
49
|
+
], false), _a[chains_1.SupportedChainId.POLYGON] = __spreadArray(__spreadArray([], WRAPPED_NATIVE_CURRENCIES_ONLY[chains_1.SupportedChainId.POLYGON], true), [
|
|
50
|
+
tokens_1.DAI_POLYGON,
|
|
51
|
+
tokens_1.USDC_POLYGON,
|
|
52
|
+
tokens_1.USDT_POLYGON,
|
|
53
|
+
tokens_1.WETH_POLYGON,
|
|
54
|
+
], false), _a[chains_1.SupportedChainId.CELO] = __spreadArray(__spreadArray([], WRAPPED_NATIVE_CURRENCIES_ONLY[chains_1.SupportedChainId.CELO], true), [
|
|
55
|
+
tokens_1.CUSD_CELO,
|
|
56
|
+
tokens_1.CEUR_CELO,
|
|
57
|
+
tokens_1.CMC02_CELO,
|
|
58
|
+
tokens_1.PORTAL_USDC_CELO,
|
|
59
|
+
tokens_1.PORTAL_ETH_CELO,
|
|
60
|
+
], false), _a[chains_1.SupportedChainId.BNB] = __spreadArray([
|
|
61
|
+
(0, tokens_1.nativeOnChain)(chains_1.SupportedChainId.BNB),
|
|
62
|
+
tokens_1.USDC_BNB_CHAIN,
|
|
63
|
+
tokens_1.USDT_BNB_CHAIN
|
|
64
|
+
], WRAPPED_NATIVE_CURRENCIES_ONLY[chains_1.SupportedChainId.BNB], true), _a[chains_1.SupportedChainId.BASE] = __spreadArray(__spreadArray([], WRAPPED_NATIVE_CURRENCIES_ONLY[chains_1.SupportedChainId.BASE], true), [tokens_1.DAI_BASE, tokens_1.USDC_BASE], false), _a));
|
|
65
|
+
exports.ADDITIONAL_BASES = (_b = {},
|
|
66
|
+
_b[chains_1.SupportedChainId.MAINNET] = (_c = {
|
|
67
|
+
'0xF16E4d813f4DcfDe4c5b44f305c908742De84eF0': [tokens_1.ETH2X_FLI]
|
|
68
|
+
},
|
|
69
|
+
_c[tokens_1.rETH2.address] = [tokens_1.sETH2],
|
|
70
|
+
_c[tokens_1.SWISE.address] = [tokens_1.sETH2],
|
|
71
|
+
_c[tokens_1.FEI.address] = [tokens_1.TRIBE],
|
|
72
|
+
_c[tokens_1.TRIBE.address] = [tokens_1.FEI],
|
|
73
|
+
_c[tokens_1.FRAX.address] = [tokens_1.FXS],
|
|
74
|
+
_c[tokens_1.FXS.address] = [tokens_1.FRAX],
|
|
75
|
+
_c[tokens_1.WBTC.address] = [tokens_1.renBTC],
|
|
76
|
+
_c[tokens_1.renBTC.address] = [tokens_1.WBTC],
|
|
77
|
+
_c),
|
|
78
|
+
_b);
|
|
79
|
+
/**
|
|
80
|
+
* Some tokens can only be swapped via certain pairs, so we override the list of bases that are considered for these
|
|
81
|
+
* tokens.
|
|
82
|
+
*/
|
|
83
|
+
exports.CUSTOM_BASES = (_d = {},
|
|
84
|
+
_d[chains_1.SupportedChainId.MAINNET] = (_e = {},
|
|
85
|
+
_e[tokens_1.AMPL.address] = [tokens_1.DAI, tokens_1.WRAPPED_NATIVE_CURRENCY[chains_1.SupportedChainId.MAINNET]],
|
|
86
|
+
_e),
|
|
87
|
+
_d);
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Ether, NativeCurrency, Token } from '@uniswap/sdk-core';
|
|
2
|
+
import { SupportedChainId } from './chains';
|
|
3
|
+
export declare const USDC_MAINNET: Token;
|
|
4
|
+
export declare const USDC_ROPSTEN: Token;
|
|
5
|
+
export declare const USDC_RINKEBY: Token;
|
|
6
|
+
export declare const USDC_GOERLI: Token;
|
|
7
|
+
export declare const USDC_KOVAN: Token;
|
|
8
|
+
export declare const USDC_OPTIMISM: Token;
|
|
9
|
+
export declare const USDC_ARBITRUM: Token;
|
|
10
|
+
export declare const USDC_ARBITRUM_RINKEBY: Token;
|
|
11
|
+
export declare const USDC_POLYGON: Token;
|
|
12
|
+
export declare const USDC_POLYGON_MUMBAI: Token;
|
|
13
|
+
export declare const PORTAL_USDC_CELO: Token;
|
|
14
|
+
export declare const USDC_CELO_ALFAJORES: Token;
|
|
15
|
+
export declare const AMPL: Token;
|
|
16
|
+
export declare const DAI: Token;
|
|
17
|
+
export declare const DAI_ARBITRUM_ONE: Token;
|
|
18
|
+
export declare const DAI_OPTIMISM: Token;
|
|
19
|
+
export declare const USDC_BNB_CHAIN: Token;
|
|
20
|
+
export declare const USDC_BASE: Token;
|
|
21
|
+
export declare const USDC: {
|
|
22
|
+
[chainId in SupportedChainId]: Token;
|
|
23
|
+
};
|
|
24
|
+
export declare const DAI_POLYGON: Token;
|
|
25
|
+
export declare const USDT_POLYGON: Token;
|
|
26
|
+
export declare const WBTC_POLYGON: Token;
|
|
27
|
+
export declare const USDT: Token;
|
|
28
|
+
export declare const USDT_ARBITRUM_ONE: Token;
|
|
29
|
+
export declare const USDT_OPTIMISM: Token;
|
|
30
|
+
export declare const WBTC: Token;
|
|
31
|
+
export declare const WBTC_ARBITRUM_ONE: Token;
|
|
32
|
+
export declare const WBTC_OPTIMISM: Token;
|
|
33
|
+
export declare const FEI: Token;
|
|
34
|
+
export declare const TRIBE: Token;
|
|
35
|
+
export declare const FRAX: Token;
|
|
36
|
+
export declare const FXS: Token;
|
|
37
|
+
export declare const renBTC: Token;
|
|
38
|
+
export declare const ETH2X_FLI: Token;
|
|
39
|
+
export declare const sETH2: Token;
|
|
40
|
+
export declare const rETH2: Token;
|
|
41
|
+
export declare const SWISE: Token;
|
|
42
|
+
export declare const WETH_POLYGON_MUMBAI: Token;
|
|
43
|
+
export declare const WETH_POLYGON: Token;
|
|
44
|
+
export declare const CELO_CELO: Token;
|
|
45
|
+
export declare const CUSD_CELO: Token;
|
|
46
|
+
export declare const CEUR_CELO: Token;
|
|
47
|
+
export declare const PORTAL_ETH_CELO: Token;
|
|
48
|
+
export declare const CMC02_CELO: Token;
|
|
49
|
+
export declare const CELO_CELO_ALFAJORES: Token;
|
|
50
|
+
export declare const CUSD_CELO_ALFAJORES: Token;
|
|
51
|
+
export declare const CEUR_CELO_ALFAJORES: Token;
|
|
52
|
+
export declare const USDT_BNB_CHAIN: Token;
|
|
53
|
+
export declare const ETH_BNB_CHAIN: Token;
|
|
54
|
+
export declare const MATIC_BNB_CHAIN: Token;
|
|
55
|
+
export declare const FRAX_BNB_CHAIN: Token;
|
|
56
|
+
export declare const BTC_BNB_CHAIN: Token;
|
|
57
|
+
export declare const CAKE_BNB_CHAIN: Token;
|
|
58
|
+
export declare const BUSD_BNB_CHAIN: Token;
|
|
59
|
+
export declare const DAI_BNB_CHAIN: Token;
|
|
60
|
+
export declare const DAI_BASE: Token;
|
|
61
|
+
export declare const UNI: {
|
|
62
|
+
[chainId: number]: Token;
|
|
63
|
+
};
|
|
64
|
+
export declare const WRAPPED_NATIVE_CURRENCY: {
|
|
65
|
+
[chainId: number]: Token | undefined;
|
|
66
|
+
};
|
|
67
|
+
export declare function isCelo(chainId: number): chainId is SupportedChainId.CELO | SupportedChainId.CELO_ALFAJORES;
|
|
68
|
+
export declare class ExtendedEther extends Ether {
|
|
69
|
+
get wrapped(): Token;
|
|
70
|
+
private static _cachedExtendedEther;
|
|
71
|
+
static onChain(chainId: number): ExtendedEther;
|
|
72
|
+
}
|
|
73
|
+
export declare function nativeOnChain(chainId: number): NativeCurrency | Token;
|
|
74
|
+
export declare const TOKEN_SHORTHANDS: {
|
|
75
|
+
[shorthand: string]: {
|
|
76
|
+
[chainId in SupportedChainId]?: string;
|
|
77
|
+
};
|
|
78
|
+
};
|