@bosonprotocol/react-kit 0.34.0 → 0.35.0-base-0
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/cjs/components/wallet2/selector/ChainSelector.d.ts.map +1 -1
- package/dist/cjs/components/wallet2/selector/ChainSelector.js +2 -3
- package/dist/cjs/components/wallet2/selector/ChainSelector.js.map +1 -1
- package/dist/cjs/components/wallet2/selector/getSupportedChainIdsFromWalletConnectSession.d.ts +4 -0
- package/dist/cjs/components/wallet2/selector/getSupportedChainIdsFromWalletConnectSession.d.ts.map +1 -0
- package/dist/cjs/components/wallet2/selector/getSupportedChainIdsFromWalletConnectSession.js +35 -0
- package/dist/cjs/components/wallet2/selector/getSupportedChainIdsFromWalletConnectSession.js.map +1 -0
- package/dist/cjs/hooks/connection/useSwitchChain.d.ts.map +1 -1
- package/dist/cjs/hooks/connection/useSwitchChain.js +4 -1
- package/dist/cjs/hooks/connection/useSwitchChain.js.map +1 -1
- package/dist/cjs/lib/chains/getNativeLogoURI.d.ts.map +1 -1
- package/dist/cjs/lib/chains/getNativeLogoURI.js +2 -1
- package/dist/cjs/lib/chains/getNativeLogoURI.js.map +1 -1
- package/dist/cjs/lib/config/config.d.ts +1 -0
- package/dist/cjs/lib/config/config.d.ts.map +1 -1
- package/dist/cjs/lib/const/chainInfo.d.ts.map +1 -1
- package/dist/cjs/lib/const/chainInfo.js +33 -1
- package/dist/cjs/lib/const/chainInfo.js.map +1 -1
- package/dist/cjs/lib/const/chains.d.ts +6 -3
- package/dist/cjs/lib/const/chains.d.ts.map +1 -1
- package/dist/cjs/lib/const/chains.js +18 -10
- package/dist/cjs/lib/const/chains.js.map +1 -1
- package/dist/cjs/lib/const/networks.d.ts +2 -0
- package/dist/cjs/lib/const/networks.d.ts.map +1 -1
- package/dist/cjs/lib/const/networks.js +13 -3
- package/dist/cjs/lib/const/networks.js.map +1 -1
- package/dist/cjs/lib/const/providers.d.ts +1 -1
- package/dist/cjs/lib/const/providers.d.ts.map +1 -1
- package/dist/cjs/lib/const/providers.js +3 -1
- package/dist/cjs/lib/const/providers.js.map +1 -1
- package/dist/cjs/lib/const/routing.d.ts.map +1 -1
- package/dist/cjs/lib/const/routing.js +10 -0
- package/dist/cjs/lib/const/routing.js.map +1 -1
- package/dist/cjs/lib/const/tokens.d.ts +3 -3
- package/dist/cjs/lib/const/tokens.d.ts.map +1 -1
- package/dist/cjs/lib/const/tokens.js +6 -3
- package/dist/cjs/lib/const/tokens.js.map +1 -1
- package/dist/cjs/lib/opensea/getOpenSeaUrl.d.ts.map +1 -1
- package/dist/cjs/lib/opensea/getOpenSeaUrl.js +12 -0
- package/dist/cjs/lib/opensea/getOpenSeaUrl.js.map +1 -1
- package/dist/cjs/state/hooks.d.ts +1 -1
- package/dist/cjs/state/index.d.ts +1 -1
- package/dist/cjs/state/reducer.d.ts +1 -1
- package/dist/esm/components/wallet2/selector/ChainSelector.d.ts.map +1 -1
- package/dist/esm/components/wallet2/selector/ChainSelector.js +1 -2
- package/dist/esm/components/wallet2/selector/ChainSelector.js.map +1 -1
- package/dist/esm/components/wallet2/selector/getSupportedChainIdsFromWalletConnectSession.d.ts +4 -0
- package/dist/esm/components/wallet2/selector/getSupportedChainIdsFromWalletConnectSession.d.ts.map +1 -0
- package/dist/esm/components/wallet2/selector/getSupportedChainIdsFromWalletConnectSession.js +31 -0
- package/dist/esm/components/wallet2/selector/getSupportedChainIdsFromWalletConnectSession.js.map +1 -0
- package/dist/esm/hooks/connection/useSwitchChain.d.ts.map +1 -1
- package/dist/esm/hooks/connection/useSwitchChain.js +5 -2
- package/dist/esm/hooks/connection/useSwitchChain.js.map +1 -1
- package/dist/esm/lib/chains/getNativeLogoURI.d.ts.map +1 -1
- package/dist/esm/lib/chains/getNativeLogoURI.js +2 -1
- package/dist/esm/lib/chains/getNativeLogoURI.js.map +1 -1
- package/dist/esm/lib/config/config.d.ts +1 -0
- package/dist/esm/lib/config/config.d.ts.map +1 -1
- package/dist/esm/lib/const/chainInfo.d.ts.map +1 -1
- package/dist/esm/lib/const/chainInfo.js +34 -2
- package/dist/esm/lib/const/chainInfo.js.map +1 -1
- package/dist/esm/lib/const/chains.d.ts +6 -3
- package/dist/esm/lib/const/chains.d.ts.map +1 -1
- package/dist/esm/lib/const/chains.js +17 -9
- package/dist/esm/lib/const/chains.js.map +1 -1
- package/dist/esm/lib/const/networks.d.ts +2 -0
- package/dist/esm/lib/const/networks.d.ts.map +1 -1
- package/dist/esm/lib/const/networks.js +13 -3
- package/dist/esm/lib/const/networks.js.map +1 -1
- package/dist/esm/lib/const/providers.d.ts +1 -1
- package/dist/esm/lib/const/providers.d.ts.map +1 -1
- package/dist/esm/lib/const/providers.js +4 -2
- package/dist/esm/lib/const/providers.js.map +1 -1
- package/dist/esm/lib/const/routing.d.ts.map +1 -1
- package/dist/esm/lib/const/routing.js +11 -1
- package/dist/esm/lib/const/routing.js.map +1 -1
- package/dist/esm/lib/const/tokens.d.ts +3 -3
- package/dist/esm/lib/const/tokens.d.ts.map +1 -1
- package/dist/esm/lib/const/tokens.js +5 -2
- package/dist/esm/lib/const/tokens.js.map +1 -1
- package/dist/esm/lib/opensea/getOpenSeaUrl.d.ts.map +1 -1
- package/dist/esm/lib/opensea/getOpenSeaUrl.js +12 -0
- package/dist/esm/lib/opensea/getOpenSeaUrl.js.map +1 -1
- package/dist/esm/state/hooks.d.ts +1 -1
- package/dist/esm/state/index.d.ts +1 -1
- package/dist/esm/state/reducer.d.ts +1 -1
- package/package.json +2 -3
- package/src/components/wallet2/selector/ChainSelector.tsx +1 -2
- package/src/components/wallet2/selector/getSupportedChainIdsFromWalletConnectSession.ts +39 -0
- package/src/hooks/connection/useSwitchChain.ts +10 -2
- package/src/lib/chains/getNativeLogoURI.ts +2 -1
- package/src/lib/const/chainInfo.ts +40 -2
- package/src/lib/const/chains.ts +12 -4
- package/src/lib/const/networks.ts +13 -3
- package/src/lib/const/providers.ts +10 -3
- package/src/lib/const/routing.ts +12 -1
- package/src/lib/const/tokens.ts +24 -7
- package/src/lib/opensea/getOpenSeaUrl.ts +15 -0
- package/LICENSE +0 -202
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ChainId } from "@uniswap/sdk-core";
|
|
2
2
|
import EthereumLogo from "../../assets/svg/ethereum_square_logo.svg";
|
|
3
3
|
import MaticLogo from "../../assets/svg/matic-token-icon.svg";
|
|
4
|
+
import { ChainId_POLYGON_AMOY } from "../const/chains";
|
|
4
5
|
|
|
5
6
|
export function getNativeLogoURI(
|
|
6
7
|
chainId: ChainId | number = ChainId.MAINNET
|
|
@@ -8,7 +9,7 @@ export function getNativeLogoURI(
|
|
|
8
9
|
switch (chainId) {
|
|
9
10
|
case ChainId.POLYGON:
|
|
10
11
|
case ChainId.POLYGON_MUMBAI:
|
|
11
|
-
case
|
|
12
|
+
case ChainId_POLYGON_AMOY:
|
|
12
13
|
return MaticLogo;
|
|
13
14
|
default:
|
|
14
15
|
return EthereumLogo;
|
|
@@ -5,7 +5,13 @@ import polygonMaticLogo from "../../assets/svg/polygon-matic-logo.svg";
|
|
|
5
5
|
import polygonSquareLogoUrl from "../../assets/svg/polygon_square_logo.svg";
|
|
6
6
|
import ms from "ms";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
LocalChainId,
|
|
10
|
+
SupportedL1ChainId,
|
|
11
|
+
SupportedL2ChainId,
|
|
12
|
+
ChainId_POLYGON_AMOY,
|
|
13
|
+
ChainId_BASE_SEPOLIA
|
|
14
|
+
} from "./chains";
|
|
9
15
|
|
|
10
16
|
export const AVERAGE_L1_BLOCK_TIME = ms(`12s`);
|
|
11
17
|
|
|
@@ -99,7 +105,7 @@ const CHAIN_INFO: ChainInfoMap = {
|
|
|
99
105
|
decimals: 18
|
|
100
106
|
}
|
|
101
107
|
},
|
|
102
|
-
|
|
108
|
+
[ChainId_POLYGON_AMOY]: {
|
|
103
109
|
networkType: NetworkType.L1,
|
|
104
110
|
blockWaitMsBeforeWarning: ms(`10m`),
|
|
105
111
|
bridge: "https://wallet.polygon.technology/polygon/bridge/deposit",
|
|
@@ -114,6 +120,38 @@ const CHAIN_INFO: ChainInfoMap = {
|
|
|
114
120
|
decimals: 18
|
|
115
121
|
}
|
|
116
122
|
},
|
|
123
|
+
[ChainId.BASE]: {
|
|
124
|
+
networkType: NetworkType.L2,
|
|
125
|
+
blockWaitMsBeforeWarning: ms(`10m`),
|
|
126
|
+
bridge: "https://superbridge.app/base",
|
|
127
|
+
docs: "https://www.base.org",
|
|
128
|
+
explorer: "https://basescan.org/",
|
|
129
|
+
infoLink: "https://info.uniswap.org/#/base/",
|
|
130
|
+
label: "Base",
|
|
131
|
+
logoUrl: ethereumLogoUrl,
|
|
132
|
+
nativeCurrency: {
|
|
133
|
+
name: "Ether",
|
|
134
|
+
symbol: "ETH",
|
|
135
|
+
decimals: 18
|
|
136
|
+
},
|
|
137
|
+
defaultListUrl: ""
|
|
138
|
+
},
|
|
139
|
+
[ChainId_BASE_SEPOLIA]: {
|
|
140
|
+
networkType: NetworkType.L2,
|
|
141
|
+
blockWaitMsBeforeWarning: ms(`10m`),
|
|
142
|
+
bridge: "https://testnets.superbridge.app/base-sepolia",
|
|
143
|
+
docs: "https://www.base.org",
|
|
144
|
+
explorer: "https://sepolia.basescan.org/",
|
|
145
|
+
infoLink: "https://info.uniswap.org/#/base-sepolia/",
|
|
146
|
+
label: "Base Sepolia",
|
|
147
|
+
logoUrl: ethereumLogoUrl,
|
|
148
|
+
nativeCurrency: {
|
|
149
|
+
name: "Ether",
|
|
150
|
+
symbol: "ETH",
|
|
151
|
+
decimals: 18
|
|
152
|
+
},
|
|
153
|
+
defaultListUrl: ""
|
|
154
|
+
},
|
|
117
155
|
[LocalChainId]: {
|
|
118
156
|
networkType: NetworkType.L1,
|
|
119
157
|
docs: "https://docs.uniswap.org/",
|
package/src/lib/const/chains.ts
CHANGED
|
@@ -7,13 +7,14 @@ import { EnvironmentType } from "@bosonprotocol/core-sdk";
|
|
|
7
7
|
|
|
8
8
|
export const LocalChainId = 31337;
|
|
9
9
|
export const ChainId_POLYGON_AMOY = 80002;
|
|
10
|
+
export const ChainId_BASE_SEPOLIA = 84532;
|
|
10
11
|
|
|
11
12
|
export const UniWalletSupportedChains = [
|
|
12
13
|
ChainId.MAINNET,
|
|
13
14
|
// ChainId.ARBITRUM_ONE,
|
|
14
15
|
// ChainId.OPTIMISM,
|
|
15
|
-
ChainId.POLYGON
|
|
16
|
-
|
|
16
|
+
ChainId.POLYGON,
|
|
17
|
+
ChainId.BASE
|
|
17
18
|
];
|
|
18
19
|
|
|
19
20
|
export const CHAIN_IDS_TO_NAMES = {
|
|
@@ -33,6 +34,7 @@ export const CHAIN_IDS_TO_NAMES = {
|
|
|
33
34
|
[ChainId.AVALANCHE]: "avalanche",
|
|
34
35
|
[ChainId.BASE]: "base",
|
|
35
36
|
[ChainId.BASE_GOERLI]: "base_goerli",
|
|
37
|
+
[ChainId_BASE_SEPOLIA]: "base_sepolia",
|
|
36
38
|
[LocalChainId]: "local"
|
|
37
39
|
} as const;
|
|
38
40
|
|
|
@@ -53,12 +55,14 @@ export const CHAIN_IDS_TO_FRIENDLY_NAMES = {
|
|
|
53
55
|
[ChainId.AVALANCHE]: "Avalanche",
|
|
54
56
|
[ChainId.BASE]: "Base",
|
|
55
57
|
[ChainId.BASE_GOERLI]: "Base Goerli",
|
|
58
|
+
[ChainId_BASE_SEPOLIA]: "Base Sepolia",
|
|
56
59
|
[LocalChainId]: "Local Hardhat"
|
|
57
60
|
} as const;
|
|
58
61
|
|
|
59
62
|
const SUPPORTED_CHAINS = [
|
|
60
63
|
LocalChainId,
|
|
61
64
|
ChainId_POLYGON_AMOY,
|
|
65
|
+
ChainId_BASE_SEPOLIA,
|
|
62
66
|
..._SUPPORTED_CHAINS
|
|
63
67
|
] as const;
|
|
64
68
|
export declare type SupportedChainsType = (typeof SUPPORTED_CHAINS)[number];
|
|
@@ -94,6 +98,7 @@ export const TESTNET_CHAIN_IDS = [
|
|
|
94
98
|
ChainId.SEPOLIA,
|
|
95
99
|
ChainId.POLYGON_MUMBAI,
|
|
96
100
|
ChainId_POLYGON_AMOY,
|
|
101
|
+
ChainId_BASE_SEPOLIA,
|
|
97
102
|
LocalChainId
|
|
98
103
|
// ChainId.ARBITRUM_GOERLI,
|
|
99
104
|
// ChainId.OPTIMISM_GOERLI,
|
|
@@ -129,7 +134,8 @@ export const L2_CHAIN_IDS = [
|
|
|
129
134
|
// ChainId.ARBITRUM_GOERLI,
|
|
130
135
|
// ChainId.OPTIMISM,
|
|
131
136
|
// ChainId.OPTIMISM_GOERLI
|
|
132
|
-
|
|
137
|
+
ChainId.BASE,
|
|
138
|
+
ChainId_BASE_SEPOLIA
|
|
133
139
|
// ChainId.BASE_GOERLI
|
|
134
140
|
] as const;
|
|
135
141
|
|
|
@@ -148,7 +154,9 @@ export function getChainPriority(chainId: number): number {
|
|
|
148
154
|
return 0;
|
|
149
155
|
case ChainId.POLYGON:
|
|
150
156
|
case ChainId.POLYGON_MUMBAI:
|
|
151
|
-
case
|
|
157
|
+
case ChainId_POLYGON_AMOY:
|
|
158
|
+
case ChainId.BASE:
|
|
159
|
+
case ChainId_BASE_SEPOLIA:
|
|
152
160
|
return 1;
|
|
153
161
|
// case ChainId.ARBITRUM_ONE:
|
|
154
162
|
// case ChainId.ARBITRUM_GOERLI:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChainId } from "@uniswap/sdk-core";
|
|
2
|
+
import { ChainId_BASE_SEPOLIA, ChainId_POLYGON_AMOY } from "./chains";
|
|
2
3
|
|
|
3
4
|
// TODO: comment out?
|
|
4
5
|
// const QUICKNODE_BNB_RPC_URL = process.env.REACT_APP_BNB_RPC_URL;
|
|
@@ -71,7 +72,7 @@ export const FALLBACK_URLS = {
|
|
|
71
72
|
"https://rpc-mumbai.maticvigil.com",
|
|
72
73
|
"https://matic-testnet-archive-rpc.bwarelabs.com"
|
|
73
74
|
],
|
|
74
|
-
|
|
75
|
+
[ChainId_POLYGON_AMOY]: [
|
|
75
76
|
// "Safe" URLs
|
|
76
77
|
"https://rpc-amoy.polygon.technology"
|
|
77
78
|
],
|
|
@@ -135,6 +136,10 @@ export const FALLBACK_URLS = {
|
|
|
135
136
|
/*TODO:QUICKNODE_BASE_GOERLI_RPC_URL,*/
|
|
136
137
|
"https://base-goerli.blastapi.io/b5a802d8-151d-4443-90a7-699108dc4e01",
|
|
137
138
|
"https://svc.blockdaemon.com/base/testnet/native?apiKey=zpka_1334e7c450464d06b6e33a972a7a4e57_75320f43"
|
|
139
|
+
],
|
|
140
|
+
[ChainId_BASE_SEPOLIA]: [
|
|
141
|
+
// "Safe" URLs
|
|
142
|
+
"https://sepolia.base.org"
|
|
138
143
|
]
|
|
139
144
|
};
|
|
140
145
|
|
|
@@ -179,10 +184,10 @@ export const getRpcUrls = (infuraKey: string) => ({
|
|
|
179
184
|
`https://polygon-mumbai.infura.io/v3/${infuraKey}`,
|
|
180
185
|
...FALLBACK_URLS[ChainId.POLYGON_MUMBAI]
|
|
181
186
|
],
|
|
182
|
-
|
|
187
|
+
[ChainId_POLYGON_AMOY]: [
|
|
183
188
|
// AMOY
|
|
184
189
|
`https://polygon-amoy.infura.io/v3/${infuraKey}`,
|
|
185
|
-
...FALLBACK_URLS[
|
|
190
|
+
...FALLBACK_URLS[ChainId_POLYGON_AMOY]
|
|
186
191
|
],
|
|
187
192
|
[ChainId.CELO]: FALLBACK_URLS[ChainId.CELO],
|
|
188
193
|
[ChainId.CELO_ALFAJORES]: FALLBACK_URLS[ChainId.CELO_ALFAJORES],
|
|
@@ -201,6 +206,11 @@ export const getRpcUrls = (infuraKey: string) => ({
|
|
|
201
206
|
`https://base-goerli.infura.io/v3/${infuraKey}`,
|
|
202
207
|
...FALLBACK_URLS[ChainId.BASE_GOERLI]
|
|
203
208
|
],
|
|
209
|
+
[ChainId_BASE_SEPOLIA]: [
|
|
210
|
+
// BASE_SEPOLIA
|
|
211
|
+
`https://base-sepolia.infura.io/v3/${infuraKey}`,
|
|
212
|
+
...FALLBACK_URLS[ChainId_BASE_SEPOLIA]
|
|
213
|
+
],
|
|
204
214
|
31337: [
|
|
205
215
|
`https://mainnet.infura.io/v3/${infuraKey}`,
|
|
206
216
|
...FALLBACK_URLS[ChainId.MAINNET]
|
|
@@ -3,10 +3,15 @@ import { deepCopy } from "@ethersproject/properties";
|
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
|
4
4
|
import { StaticJsonRpcProvider } from "@ethersproject/providers";
|
|
5
5
|
import { isPlain } from "@reduxjs/toolkit";
|
|
6
|
-
import { ChainId
|
|
6
|
+
import { ChainId } from "@uniswap/sdk-core";
|
|
7
7
|
|
|
8
8
|
import { AVERAGE_L1_BLOCK_TIME } from "./chainInfo";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
CHAIN_IDS_TO_NAMES,
|
|
11
|
+
ChainId_BASE_SEPOLIA,
|
|
12
|
+
ChainId_POLYGON_AMOY,
|
|
13
|
+
SupportedChainsType
|
|
14
|
+
} from "./chains";
|
|
10
15
|
import { CONFIG } from "../config/config";
|
|
11
16
|
const RPC_URLS = CONFIG.rpcUrls;
|
|
12
17
|
|
|
@@ -81,10 +86,12 @@ export const RPC_PROVIDERS: {
|
|
|
81
86
|
[ChainId.ARBITRUM_GOERLI]: new AppJsonRpcProvider(ChainId.ARBITRUM_GOERLI),
|
|
82
87
|
[ChainId.POLYGON]: new AppJsonRpcProvider(ChainId.POLYGON),
|
|
83
88
|
[ChainId.POLYGON_MUMBAI]: new AppJsonRpcProvider(ChainId.POLYGON_MUMBAI),
|
|
89
|
+
[ChainId_POLYGON_AMOY]: new AppJsonRpcProvider(ChainId_POLYGON_AMOY),
|
|
84
90
|
[ChainId.CELO]: new AppJsonRpcProvider(ChainId.CELO),
|
|
85
91
|
[ChainId.CELO_ALFAJORES]: new AppJsonRpcProvider(ChainId.CELO_ALFAJORES),
|
|
86
92
|
[ChainId.BNB]: new AppJsonRpcProvider(ChainId.BNB),
|
|
87
93
|
[ChainId.AVALANCHE]: new AppJsonRpcProvider(ChainId.AVALANCHE),
|
|
88
94
|
[ChainId.BASE]: new AppJsonRpcProvider(ChainId.BASE),
|
|
89
|
-
[ChainId.BASE_GOERLI]: new AppJsonRpcProvider(ChainId.BASE_GOERLI)
|
|
95
|
+
[ChainId.BASE_GOERLI]: new AppJsonRpcProvider(ChainId.BASE_GOERLI),
|
|
96
|
+
[ChainId_BASE_SEPOLIA]: new AppJsonRpcProvider(ChainId_BASE_SEPOLIA)
|
|
90
97
|
};
|
package/src/lib/const/routing.ts
CHANGED
|
@@ -42,8 +42,10 @@ import {
|
|
|
42
42
|
WETH_AVALANCHE,
|
|
43
43
|
WETH_POLYGON,
|
|
44
44
|
WETH_POLYGON_MUMBAI,
|
|
45
|
-
WRAPPED_NATIVE_CURRENCY
|
|
45
|
+
WRAPPED_NATIVE_CURRENCY,
|
|
46
|
+
WETH_POLYGON_AMOY
|
|
46
47
|
} from "./tokens";
|
|
48
|
+
import { ChainId_BASE_SEPOLIA, ChainId_POLYGON_AMOY } from "./chains";
|
|
47
49
|
|
|
48
50
|
type ChainTokenList = {
|
|
49
51
|
readonly [chainId: number]: Token[];
|
|
@@ -111,6 +113,10 @@ export const COMMON_BASES: ChainCurrencyList = {
|
|
|
111
113
|
nativeOnChain(ChainId.BASE_GOERLI),
|
|
112
114
|
WRAPPED_NATIVE_CURRENCY[ChainId.BASE_GOERLI] as Token
|
|
113
115
|
],
|
|
116
|
+
[ChainId_BASE_SEPOLIA]: [
|
|
117
|
+
nativeOnChain(ChainId_BASE_SEPOLIA),
|
|
118
|
+
WRAPPED_NATIVE_CURRENCY[ChainId_BASE_SEPOLIA] as Token
|
|
119
|
+
],
|
|
114
120
|
[ChainId.POLYGON]: [
|
|
115
121
|
nativeOnChain(ChainId.POLYGON),
|
|
116
122
|
WETH_POLYGON,
|
|
@@ -124,6 +130,11 @@ export const COMMON_BASES: ChainCurrencyList = {
|
|
|
124
130
|
WRAPPED_NATIVE_CURRENCY[ChainId.POLYGON_MUMBAI] as Token,
|
|
125
131
|
WETH_POLYGON_MUMBAI
|
|
126
132
|
],
|
|
133
|
+
[ChainId_POLYGON_AMOY]: [
|
|
134
|
+
nativeOnChain(ChainId_POLYGON_AMOY),
|
|
135
|
+
WRAPPED_NATIVE_CURRENCY[ChainId_POLYGON_AMOY] as Token,
|
|
136
|
+
WETH_POLYGON_AMOY
|
|
137
|
+
],
|
|
127
138
|
|
|
128
139
|
[ChainId.CELO]: [
|
|
129
140
|
nativeOnChain(ChainId.CELO),
|
package/src/lib/const/tokens.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
WETH9
|
|
8
8
|
} from "@uniswap/sdk-core";
|
|
9
9
|
import invariant from "tiny-invariant";
|
|
10
|
+
import { ChainId_BASE_SEPOLIA, ChainId_POLYGON_AMOY } from "./chains";
|
|
10
11
|
|
|
11
12
|
export const NATIVE_CHAIN_ID = "NATIVE";
|
|
12
13
|
|
|
@@ -193,6 +194,14 @@ export const WETH_POLYGON_MUMBAI = new Token(
|
|
|
193
194
|
"Wrapped Ether"
|
|
194
195
|
);
|
|
195
196
|
|
|
197
|
+
export const WETH_POLYGON_AMOY = new Token(
|
|
198
|
+
ChainId_POLYGON_AMOY,
|
|
199
|
+
"0x52eF3d68BaB452a294342DC3e5f464d7f610f72E",
|
|
200
|
+
18,
|
|
201
|
+
"WETH",
|
|
202
|
+
"Wrapped Ether"
|
|
203
|
+
);
|
|
204
|
+
|
|
196
205
|
export const WETH_POLYGON = new Token(
|
|
197
206
|
ChainId.POLYGON,
|
|
198
207
|
"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
|
|
@@ -376,6 +385,13 @@ export const WRAPPED_NATIVE_CURRENCY: { [chainId: number]: Token | undefined } =
|
|
|
376
385
|
"WETH",
|
|
377
386
|
"Wrapped Ether"
|
|
378
387
|
),
|
|
388
|
+
[ChainId_BASE_SEPOLIA]: new Token(
|
|
389
|
+
ChainId_BASE_SEPOLIA,
|
|
390
|
+
"0x4200000000000000000000000000000000000006",
|
|
391
|
+
18,
|
|
392
|
+
"WETH",
|
|
393
|
+
"Wrapped Ether"
|
|
394
|
+
),
|
|
379
395
|
[ChainId.ARBITRUM_ONE]: new Token(
|
|
380
396
|
ChainId.ARBITRUM_ONE,
|
|
381
397
|
"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
|
|
@@ -411,9 +427,9 @@ export const WRAPPED_NATIVE_CURRENCY: { [chainId: number]: Token | undefined } =
|
|
|
411
427
|
"WMATIC",
|
|
412
428
|
"Wrapped MATIC"
|
|
413
429
|
),
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
"
|
|
430
|
+
[ChainId_POLYGON_AMOY]: new Token(
|
|
431
|
+
ChainId_POLYGON_AMOY,
|
|
432
|
+
"0x778f1b662a461695633791d03a77d992c24b588a",
|
|
417
433
|
18,
|
|
418
434
|
"WMATIC",
|
|
419
435
|
"Wrapped MATIC"
|
|
@@ -465,15 +481,16 @@ function getCeloNativeCurrency(chainId: number) {
|
|
|
465
481
|
}
|
|
466
482
|
}
|
|
467
483
|
|
|
468
|
-
type NewType = 80002;
|
|
469
|
-
|
|
470
484
|
export function isMatic(
|
|
471
485
|
chainId: number
|
|
472
|
-
): chainId is
|
|
486
|
+
): chainId is
|
|
487
|
+
| ChainId.POLYGON
|
|
488
|
+
| ChainId.POLYGON_MUMBAI
|
|
489
|
+
| typeof ChainId_POLYGON_AMOY {
|
|
473
490
|
return (
|
|
474
491
|
chainId === ChainId.POLYGON_MUMBAI ||
|
|
475
492
|
chainId === ChainId.POLYGON ||
|
|
476
|
-
chainId ===
|
|
493
|
+
chainId === ChainId_POLYGON_AMOY
|
|
477
494
|
);
|
|
478
495
|
}
|
|
479
496
|
|
|
@@ -15,6 +15,11 @@ const openSeaUrlMap = new Map([
|
|
|
15
15
|
"testing-11155111-0",
|
|
16
16
|
(tokenId: string, contractAddress: string) =>
|
|
17
17
|
`https://testnets.opensea.io/assets/sepolia/${contractAddress}/${tokenId}`
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"testing-84532-0",
|
|
21
|
+
(tokenId: string, contractAddress: string) =>
|
|
22
|
+
`https://testnets.opensea.io/assets/base_sepolia/${contractAddress}/${tokenId}`
|
|
18
23
|
]
|
|
19
24
|
])
|
|
20
25
|
],
|
|
@@ -30,6 +35,11 @@ const openSeaUrlMap = new Map([
|
|
|
30
35
|
"staging-11155111-0",
|
|
31
36
|
(tokenId: string, contractAddress: string) =>
|
|
32
37
|
`https://testnets.opensea.io/assets/sepolia/${contractAddress}/${tokenId}`
|
|
38
|
+
],
|
|
39
|
+
[
|
|
40
|
+
"staging-84532-0",
|
|
41
|
+
(tokenId: string, contractAddress: string) =>
|
|
42
|
+
`https://testnets.opensea.io/assets/base_sepolia/${contractAddress}/${tokenId}`
|
|
33
43
|
]
|
|
34
44
|
])
|
|
35
45
|
],
|
|
@@ -45,6 +55,11 @@ const openSeaUrlMap = new Map([
|
|
|
45
55
|
"production-1-0",
|
|
46
56
|
(tokenId: string, contractAddress: string) =>
|
|
47
57
|
`https://opensea.io/assets/ethereum/${contractAddress}/${tokenId}`
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"production-8453-0",
|
|
61
|
+
(tokenId: string, contractAddress: string) =>
|
|
62
|
+
`https://opensea.io/assets/base/${contractAddress}/${tokenId}`
|
|
48
63
|
]
|
|
49
64
|
])
|
|
50
65
|
]
|
package/LICENSE
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
Apache License
|
|
3
|
-
Version 2.0, January 2004
|
|
4
|
-
http://www.apache.org/licenses/
|
|
5
|
-
|
|
6
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
-
|
|
8
|
-
1. Definitions.
|
|
9
|
-
|
|
10
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
-
|
|
13
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
-
the copyright owner that is granting the License.
|
|
15
|
-
|
|
16
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
-
other entities that control, are controlled by, or are under common
|
|
18
|
-
control with that entity. For the purposes of this definition,
|
|
19
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
-
direction or management of such entity, whether by contract or
|
|
21
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
-
|
|
24
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
-
exercising permissions granted by this License.
|
|
26
|
-
|
|
27
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
-
including but not limited to software source code, documentation
|
|
29
|
-
source, and configuration files.
|
|
30
|
-
|
|
31
|
-
"Object" form shall mean any form resulting from mechanical
|
|
32
|
-
transformation or translation of a Source form, including but
|
|
33
|
-
not limited to compiled object code, generated documentation,
|
|
34
|
-
and conversions to other media types.
|
|
35
|
-
|
|
36
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
-
Object form, made available under the License, as indicated by a
|
|
38
|
-
copyright notice that is included in or attached to the work
|
|
39
|
-
(an example is provided in the Appendix below).
|
|
40
|
-
|
|
41
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
-
form, that is based on (or derived from) the Work and for which the
|
|
43
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
-
of this License, Derivative Works shall not include works that remain
|
|
46
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
-
the Work and Derivative Works thereof.
|
|
48
|
-
|
|
49
|
-
"Contribution" shall mean any work of authorship, including
|
|
50
|
-
the original version of the Work and any modifications or additions
|
|
51
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
-
means any form of electronic, verbal, or written communication sent
|
|
56
|
-
to the Licensor or its representatives, including but not limited to
|
|
57
|
-
communication on electronic mailing lists, source code control systems,
|
|
58
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
-
excluding communication that is conspicuously marked or otherwise
|
|
61
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
-
|
|
63
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
-
subsequently incorporated within the Work.
|
|
66
|
-
|
|
67
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
-
Work and such Derivative Works in Source or Object form.
|
|
73
|
-
|
|
74
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
-
(except as stated in this section) patent license to make, have made,
|
|
78
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
-
where such license applies only to those patent claims licensable
|
|
80
|
-
by such Contributor that are necessarily infringed by their
|
|
81
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
-
institute patent litigation against any entity (including a
|
|
84
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
-
or contributory patent infringement, then any patent licenses
|
|
87
|
-
granted to You under this License for that Work shall terminate
|
|
88
|
-
as of the date such litigation is filed.
|
|
89
|
-
|
|
90
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
-
modifications, and in Source or Object form, provided that You
|
|
93
|
-
meet the following conditions:
|
|
94
|
-
|
|
95
|
-
(a) You must give any other recipients of the Work or
|
|
96
|
-
Derivative Works a copy of this License; and
|
|
97
|
-
|
|
98
|
-
(b) You must cause any modified files to carry prominent notices
|
|
99
|
-
stating that You changed the files; and
|
|
100
|
-
|
|
101
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
-
that You distribute, all copyright, patent, trademark, and
|
|
103
|
-
attribution notices from the Source form of the Work,
|
|
104
|
-
excluding those notices that do not pertain to any part of
|
|
105
|
-
the Derivative Works; and
|
|
106
|
-
|
|
107
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
-
distribution, then any Derivative Works that You distribute must
|
|
109
|
-
include a readable copy of the attribution notices contained
|
|
110
|
-
within such NOTICE file, excluding those notices that do not
|
|
111
|
-
pertain to any part of the Derivative Works, in at least one
|
|
112
|
-
of the following places: within a NOTICE text file distributed
|
|
113
|
-
as part of the Derivative Works; within the Source form or
|
|
114
|
-
documentation, if provided along with the Derivative Works; or,
|
|
115
|
-
within a display generated by the Derivative Works, if and
|
|
116
|
-
wherever such third-party notices normally appear. The contents
|
|
117
|
-
of the NOTICE file are for informational purposes only and
|
|
118
|
-
do not modify the License. You may add Your own attribution
|
|
119
|
-
notices within Derivative Works that You distribute, alongside
|
|
120
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
-
that such additional attribution notices cannot be construed
|
|
122
|
-
as modifying the License.
|
|
123
|
-
|
|
124
|
-
You may add Your own copyright statement to Your modifications and
|
|
125
|
-
may provide additional or different license terms and conditions
|
|
126
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
-
the conditions stated in this License.
|
|
130
|
-
|
|
131
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
-
this License, without any additional terms or conditions.
|
|
135
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
-
the terms of any separate license agreement you may have executed
|
|
137
|
-
with Licensor regarding such Contributions.
|
|
138
|
-
|
|
139
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
-
except as required for reasonable and customary use in describing the
|
|
142
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
-
|
|
144
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
-
implied, including, without limitation, any warranties or conditions
|
|
149
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
-
appropriateness of using or redistributing the Work and assume any
|
|
152
|
-
risks associated with Your exercise of permissions under this License.
|
|
153
|
-
|
|
154
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
-
unless required by applicable law (such as deliberate and grossly
|
|
157
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
-
liable to You for damages, including any direct, indirect, special,
|
|
159
|
-
incidental, or consequential damages of any character arising as a
|
|
160
|
-
result of this License or out of the use or inability to use the
|
|
161
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
-
other commercial damages or losses), even if such Contributor
|
|
164
|
-
has been advised of the possibility of such damages.
|
|
165
|
-
|
|
166
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
-
or other liability obligations and/or rights consistent with this
|
|
170
|
-
License. However, in accepting such obligations, You may act only
|
|
171
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
-
defend, and hold each Contributor harmless for any liability
|
|
174
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
-
of your accepting any such warranty or additional liability.
|
|
176
|
-
|
|
177
|
-
END OF TERMS AND CONDITIONS
|
|
178
|
-
|
|
179
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
-
|
|
181
|
-
To apply the Apache License to your work, attach the following
|
|
182
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
-
replaced with your own identifying information. (Don't include
|
|
184
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
-
comment syntax for the file format. We also recommend that a
|
|
186
|
-
file or class name and description of purpose be included on the
|
|
187
|
-
same "printed page" as the copyright notice for easier
|
|
188
|
-
identification within third-party archives.
|
|
189
|
-
|
|
190
|
-
Copyright [2022] [Boson Protocol]
|
|
191
|
-
|
|
192
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
-
you may not use this file except in compliance with the License.
|
|
194
|
-
You may obtain a copy of the License at
|
|
195
|
-
|
|
196
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
-
|
|
198
|
-
Unless required by applicable law or agreed to in writing, software
|
|
199
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
-
See the License for the specific language governing permissions and
|
|
202
|
-
limitations under the License.
|