@tria-sdk/constants 1.0.13 → 1.0.14
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/index.js +4 -20
- package/dist/src/chains.js +34 -37
- package/dist/src/config.js +10 -17
- package/dist/src/connect.js +5 -8
- package/dist/src/txn.js +47 -50
- package/package.json +1 -1
- package/tsconfig.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./src/config"), exports);
|
|
18
|
-
__exportStar(require("./src/chains"), exports);
|
|
19
|
-
__exportStar(require("./src/txn"), exports);
|
|
20
|
-
__exportStar(require("./src/connect"), exports);
|
|
1
|
+
export * from "./src/config";
|
|
2
|
+
export * from "./src/chains";
|
|
3
|
+
export * from "./src/txn";
|
|
4
|
+
export * from "./src/connect";
|
package/dist/src/chains.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.bitlayerTestnet = "BITLAYER-TESTNET";
|
|
7
|
-
exports.neoxTestnet = "NEOX-TESTNET";
|
|
8
|
-
exports.TESTNET_CHAINS = [
|
|
1
|
+
export const zkLink = "ZKLINK-NOVA";
|
|
2
|
+
export const zkLinkTestnet = "ZKLINK-NOVA-TESTNET";
|
|
3
|
+
export const bitlayerTestnet = "BITLAYER-TESTNET";
|
|
4
|
+
export const neoxTestnet = "NEOX-TESTNET";
|
|
5
|
+
export const TESTNET_CHAINS = [
|
|
9
6
|
"MUMBAI",
|
|
10
7
|
"FUSESPARK",
|
|
11
8
|
"MANTA-TESTNET",
|
|
12
9
|
"METIS-TESTNET",
|
|
13
10
|
"MANTLE-TESTNET",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
zkLinkTestnet,
|
|
12
|
+
bitlayerTestnet,
|
|
13
|
+
neoxTestnet,
|
|
17
14
|
];
|
|
18
|
-
|
|
15
|
+
export const SUPPORTED_EVM_CHAINS = [
|
|
19
16
|
"ETH",
|
|
20
17
|
"POLYGON",
|
|
21
18
|
"AVALANCHE",
|
|
@@ -32,12 +29,12 @@ exports.SUPPORTED_EVM_CHAINS = [
|
|
|
32
29
|
"METIS-TESTNET",
|
|
33
30
|
"MANTLE",
|
|
34
31
|
"MANTLE-TESTNET",
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
zkLink,
|
|
33
|
+
zkLinkTestnet,
|
|
34
|
+
bitlayerTestnet,
|
|
35
|
+
neoxTestnet,
|
|
39
36
|
];
|
|
40
|
-
|
|
37
|
+
export const AA_SUPPORTED_EVM_CHAINS = [
|
|
41
38
|
"ETH",
|
|
42
39
|
"POLYGON",
|
|
43
40
|
"AVALANCHE",
|
|
@@ -48,7 +45,7 @@ exports.AA_SUPPORTED_EVM_CHAINS = [
|
|
|
48
45
|
"FUSE",
|
|
49
46
|
"MUMBAI",
|
|
50
47
|
];
|
|
51
|
-
|
|
48
|
+
export const ALLCHAINS = [
|
|
52
49
|
"ETH",
|
|
53
50
|
"POLYGON",
|
|
54
51
|
"AVALANCHE",
|
|
@@ -66,14 +63,14 @@ exports.ALLCHAINS = [
|
|
|
66
63
|
"MANTLE",
|
|
67
64
|
"MANTLE-TESTNET",
|
|
68
65
|
"SOLANA",
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
zkLink,
|
|
67
|
+
zkLinkTestnet,
|
|
68
|
+
bitlayerTestnet,
|
|
69
|
+
neoxTestnet,
|
|
73
70
|
];
|
|
74
71
|
const baseLogoUrl = "https://static.tria.so/chain-logo-w";
|
|
75
72
|
const baseLogoUrlBlack = "https://static.tria.so/chain-logo-b";
|
|
76
|
-
|
|
73
|
+
export const networks = [
|
|
77
74
|
{
|
|
78
75
|
chainName: "ETH",
|
|
79
76
|
logo: `${baseLogoUrl}/Ethereum.webp`,
|
|
@@ -147,23 +144,23 @@ exports.networks = [
|
|
|
147
144
|
logo: `${baseLogoUrl}/Solana.webp`,
|
|
148
145
|
},
|
|
149
146
|
{
|
|
150
|
-
chainName:
|
|
147
|
+
chainName: zkLink,
|
|
151
148
|
logo: `${baseLogoUrl}/zklink.webp`,
|
|
152
149
|
},
|
|
153
150
|
{
|
|
154
|
-
chainName:
|
|
151
|
+
chainName: zkLinkTestnet,
|
|
155
152
|
logo: `${baseLogoUrl}/zklink.webp`,
|
|
156
153
|
},
|
|
157
154
|
{
|
|
158
|
-
chainName:
|
|
155
|
+
chainName: bitlayerTestnet,
|
|
159
156
|
logo: `${baseLogoUrl}/bitlayer.webp`,
|
|
160
157
|
},
|
|
161
158
|
{
|
|
162
|
-
chainName:
|
|
159
|
+
chainName: neoxTestnet,
|
|
163
160
|
logo: `${baseLogoUrl}/neox.webp`,
|
|
164
161
|
},
|
|
165
162
|
];
|
|
166
|
-
|
|
163
|
+
export const chainNameToLogo = {
|
|
167
164
|
ETH: `${baseLogoUrl}/Ethereum.webp`,
|
|
168
165
|
FANTOM: `${baseLogoUrl}/Fantom.webp`,
|
|
169
166
|
POLYGON: `${baseLogoUrl}/Polygon.webp`,
|
|
@@ -182,12 +179,12 @@ exports.chainNameToLogo = {
|
|
|
182
179
|
MANTLE: `${baseLogoUrl}/Mantle.webp`,
|
|
183
180
|
"MANTLE-TESTNET": `${baseLogoUrl}/Mantle.webp`,
|
|
184
181
|
SOLANA: `${baseLogoUrl}/Solana.webp`,
|
|
185
|
-
[
|
|
186
|
-
[
|
|
187
|
-
[
|
|
188
|
-
[
|
|
182
|
+
[zkLink]: `${baseLogoUrl}/zklink.webp`,
|
|
183
|
+
[zkLinkTestnet]: `${baseLogoUrl}/zklink.webp`,
|
|
184
|
+
[bitlayerTestnet]: `${baseLogoUrl}/bitlayer.webp`,
|
|
185
|
+
[neoxTestnet]: `${baseLogoUrl}/neox.webp`,
|
|
189
186
|
};
|
|
190
|
-
|
|
187
|
+
export const chainNameToLogoBlack = {
|
|
191
188
|
ETH: `${baseLogoUrlBlack}/Ethereum.webp`,
|
|
192
189
|
BINANCE: `${baseLogoUrlBlack}/binance.webp`,
|
|
193
190
|
FANTOM: `${baseLogoUrlBlack}/Fantom.webp`,
|
|
@@ -206,8 +203,8 @@ exports.chainNameToLogoBlack = {
|
|
|
206
203
|
MANTLE: `${baseLogoUrlBlack}/Mantle.webp`,
|
|
207
204
|
"MANTLE-TESTNET": `${baseLogoUrlBlack}/Mantle.webp`,
|
|
208
205
|
SOLANA: `${baseLogoUrlBlack}/Solana.webp`,
|
|
209
|
-
[
|
|
210
|
-
[
|
|
211
|
-
[
|
|
212
|
-
[
|
|
206
|
+
[zkLink]: `${baseLogoUrlBlack}/zklink.webp`,
|
|
207
|
+
[zkLinkTestnet]: `${baseLogoUrlBlack}/zklink.webp`,
|
|
208
|
+
[bitlayerTestnet]: `${baseLogoUrlBlack}/bitlayer.webp`,
|
|
209
|
+
[neoxTestnet]: `${baseLogoUrlBlack}/neox.png`,
|
|
213
210
|
};
|
package/dist/src/config.js
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.prodApiUrl = "https://prod.tria.so";
|
|
6
|
-
const isEvmChain = (chainName) => {
|
|
7
|
-
return chains_1.SUPPORTED_EVM_CHAINS.includes(chainName);
|
|
1
|
+
import { AA_SUPPORTED_EVM_CHAINS, ALLCHAINS, SUPPORTED_EVM_CHAINS, TESTNET_CHAINS, } from "./chains";
|
|
2
|
+
export const prodApiUrl = "https://prod.tria.so";
|
|
3
|
+
export const isEvmChain = (chainName) => {
|
|
4
|
+
return SUPPORTED_EVM_CHAINS.includes(chainName);
|
|
8
5
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return chains_1.AA_SUPPORTED_EVM_CHAINS.includes(chainName);
|
|
6
|
+
export const isAaSupportedChain = (chainName) => {
|
|
7
|
+
return AA_SUPPORTED_EVM_CHAINS.includes(chainName);
|
|
12
8
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return chains_1.ALLCHAINS.includes(chainName);
|
|
9
|
+
export const isChainSupported = (chainName) => {
|
|
10
|
+
return ALLCHAINS.includes(chainName);
|
|
16
11
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return chains_1.TESTNET_CHAINS.includes(chainName);
|
|
12
|
+
export const isTestnetChain = (chainName) => {
|
|
13
|
+
return TESTNET_CHAINS.includes(chainName);
|
|
20
14
|
};
|
|
21
|
-
exports.isTestnetChain = isTestnetChain;
|
package/dist/src/connect.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.triaAuthUrl = exports.storageKeys = exports.TRIA_WALLET_SELECTED_CHAIN = exports.TRIA_WALLET_STORE = exports.eventTypes = void 0;
|
|
4
|
-
exports.eventTypes = {
|
|
1
|
+
export const eventTypes = {
|
|
5
2
|
logIn: "Log in",
|
|
6
3
|
triaSignUp: "Tria Sign up",
|
|
7
4
|
emailPwSignUp: "Email Pwd Sign up",
|
|
@@ -18,12 +15,12 @@ exports.eventTypes = {
|
|
|
18
15
|
saveToAuth: "Save to Auth Iframe",
|
|
19
16
|
triaStoreSet: "triaStoreSet",
|
|
20
17
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
export const TRIA_WALLET_STORE = "tria.wallet.store";
|
|
19
|
+
export const TRIA_WALLET_SELECTED_CHAIN = "tria.wallet.selectedChain";
|
|
20
|
+
export const storageKeys = {
|
|
24
21
|
TRIA_WALLET_STORE: "tria.wallet.store",
|
|
25
22
|
TRIA_WALLET_SELECTED_CHAIN: "tria.wallet.selectedChain",
|
|
26
23
|
PERSIST_ROOT: "persist:root",
|
|
27
24
|
};
|
|
28
|
-
|
|
25
|
+
export const triaAuthUrl = "https://auth.tria.so";
|
|
29
26
|
// export const PARENT_URL = document?.referrer || window?.parent?.[0]?.location?.ancestorOrigins?.[0];
|
package/dist/src/txn.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.chainIdToChainName = exports.chainNameToChainId = exports.rpcUrls = exports.nativeTokenDetails = exports.txnBaseUrl = exports.explorerBaseUrls = void 0;
|
|
4
|
-
const chains_1 = require("./chains");
|
|
5
|
-
exports.explorerBaseUrls = {
|
|
1
|
+
import { bitlayerTestnet, neoxTestnet, zkLink, zkLinkTestnet } from "./chains";
|
|
2
|
+
export const explorerBaseUrls = {
|
|
6
3
|
ETH: "https://etherscan.io",
|
|
7
4
|
POLYGON: "https://polygonscan.com",
|
|
8
5
|
AVALANCHE: "https://snowtrace.io",
|
|
@@ -23,34 +20,34 @@ exports.explorerBaseUrls = {
|
|
|
23
20
|
"MANTLE-TESTNET": "https://explorer.testnet.mantle.xyz",
|
|
24
21
|
MANTA: "https://pacific-explorer.manta.network",
|
|
25
22
|
"MANTA-TESTNET": "https://manta-testnet.calderaexplorer.xyz",
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
23
|
+
[zkLink]: "https://explorer.zklink.io",
|
|
24
|
+
[zkLinkTestnet]: "https://goerli.explorer.zklink.io",
|
|
25
|
+
[bitlayerTestnet]: "https://testnet-scan.bitlayer.org/en-us",
|
|
26
|
+
[neoxTestnet]: "https://xt2scan.ngd.network",
|
|
30
27
|
};
|
|
31
|
-
|
|
32
|
-
ETH: `${
|
|
33
|
-
POLYGON: `${
|
|
34
|
-
AVALANCHE: `${
|
|
35
|
-
ARBITRUM: `${
|
|
36
|
-
BINANCE: `${
|
|
37
|
-
OPTIMISM: `${
|
|
38
|
-
FANTOM: `${
|
|
39
|
-
FUSE: `${
|
|
40
|
-
FUSESPARK: `${
|
|
41
|
-
MUMBAI: `${
|
|
42
|
-
METIS: `${
|
|
43
|
-
"METIS-TESTNET": `${
|
|
44
|
-
MANTLE: `${
|
|
45
|
-
"MANTLE-TESTNET": `${
|
|
46
|
-
MANTA: `${
|
|
47
|
-
"MANTA-TESTNET": `${
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
28
|
+
export const txnBaseUrl = {
|
|
29
|
+
ETH: `${explorerBaseUrls.ETH}/tx`, // /txHash
|
|
30
|
+
POLYGON: `${explorerBaseUrls.POLYGON}/tx`,
|
|
31
|
+
AVALANCHE: `${explorerBaseUrls.AVALANCHE}/tx`,
|
|
32
|
+
ARBITRUM: `${explorerBaseUrls.ARBITRUM}/tx`,
|
|
33
|
+
BINANCE: `${explorerBaseUrls.BINANCE}/tx`,
|
|
34
|
+
OPTIMISM: `${explorerBaseUrls.OPTIMISM}/tx`,
|
|
35
|
+
FANTOM: `${explorerBaseUrls.FANTOM}/tx`,
|
|
36
|
+
FUSE: `${explorerBaseUrls.FUSE}/tx`,
|
|
37
|
+
FUSESPARK: `${explorerBaseUrls.FUSESPARK}/tx`,
|
|
38
|
+
MUMBAI: `${explorerBaseUrls.MUMBAI}/tx`,
|
|
39
|
+
METIS: `${explorerBaseUrls.METIS}/tx`,
|
|
40
|
+
"METIS-TESTNET": `${explorerBaseUrls["METIS-TESTNET"]}/tx`,
|
|
41
|
+
MANTLE: `${explorerBaseUrls.MANTLE}/tx`,
|
|
42
|
+
"MANTLE-TESTNET": `${explorerBaseUrls["MANTLE-TESTNET"]}/tx`,
|
|
43
|
+
MANTA: `${explorerBaseUrls.MANTA}/tx`,
|
|
44
|
+
"MANTA-TESTNET": `${explorerBaseUrls["MANTA-TESTNET"]}/tx`,
|
|
45
|
+
[zkLink]: `${explorerBaseUrls[zkLink]}/tx`,
|
|
46
|
+
[zkLinkTestnet]: `${explorerBaseUrls[zkLinkTestnet]}/tx`,
|
|
47
|
+
[bitlayerTestnet]: `${explorerBaseUrls[bitlayerTestnet]}/tx`,
|
|
48
|
+
[neoxTestnet]: `${explorerBaseUrls[neoxTestnet]}/tx`,
|
|
52
49
|
};
|
|
53
|
-
|
|
50
|
+
export const nativeTokenDetails = {
|
|
54
51
|
ETH: {
|
|
55
52
|
name: "Ether",
|
|
56
53
|
symbol: "ETH",
|
|
@@ -136,29 +133,29 @@ exports.nativeTokenDetails = {
|
|
|
136
133
|
symbol: "SOL",
|
|
137
134
|
logoUrl: "https://static.tria.so/chain-logo-w/Solana.webp",
|
|
138
135
|
},
|
|
139
|
-
[
|
|
136
|
+
[zkLink]: {
|
|
140
137
|
name: "Ether",
|
|
141
138
|
symbol: "ETH",
|
|
142
139
|
logoUrl: "https://static.tria.so/chain-logo-w/zklink.webp",
|
|
143
140
|
},
|
|
144
|
-
[
|
|
141
|
+
[zkLinkTestnet]: {
|
|
145
142
|
name: "Ether",
|
|
146
143
|
symbol: "ETH",
|
|
147
144
|
logoUrl: "https://static.tria.so/chain-logo-w/zklink.webp",
|
|
148
145
|
},
|
|
149
|
-
[
|
|
146
|
+
[bitlayerTestnet]: {
|
|
150
147
|
name: "Bitcoin",
|
|
151
148
|
symbol: "BTC",
|
|
152
149
|
logoUrl: "https://static.tria.so/chain-logo-w/bitlayer.webp",
|
|
153
150
|
},
|
|
154
|
-
[
|
|
151
|
+
[neoxTestnet]: {
|
|
155
152
|
name: "Gas",
|
|
156
153
|
symbol: "GAS",
|
|
157
154
|
logoUrl: "https://assets.coingecko.com/coins/images/858/standard/GAS_512_512.png?1696501992",
|
|
158
155
|
},
|
|
159
156
|
};
|
|
160
157
|
const alchemyKey = "kcuWVV9ss_iLWJ2Lw6xdHbmtZYixfY7Z";
|
|
161
|
-
|
|
158
|
+
export const rpcUrls = {
|
|
162
159
|
MUMBAI: `https://polygon-mumbai.g.alchemy.com/v2/${alchemyKey}`, //'https://polygon-mumbai.blockpi.network/v1/rpc/public',
|
|
163
160
|
ETH: "https://eth.llamarpc.com",
|
|
164
161
|
POLYGON: `https://polygon-mainnet.g.alchemy.com/v2/${alchemyKey}`, // 'https://polygon.llamarpc.com',
|
|
@@ -175,12 +172,12 @@ exports.rpcUrls = {
|
|
|
175
172
|
"METIS-TESTNET": "https://goerli.gateway.metisdevops.link",
|
|
176
173
|
MANTLE: "https://rpc.mantle.xyz",
|
|
177
174
|
"MANTLE-TESTNET": "https://rpc.testnet.mantle.xyz",
|
|
178
|
-
[
|
|
179
|
-
[
|
|
180
|
-
[
|
|
181
|
-
[
|
|
175
|
+
[zkLink]: "https://rpc.zklink.io",
|
|
176
|
+
[zkLinkTestnet]: "https://goerli.rpc.zklink.io",
|
|
177
|
+
[bitlayerTestnet]: "https://testnet-rpc.bitlayer.org",
|
|
178
|
+
[neoxTestnet]: "https://neoxseed1.ngd.network",
|
|
182
179
|
};
|
|
183
|
-
|
|
180
|
+
export const chainNameToChainId = {
|
|
184
181
|
MUMBAI: 80001,
|
|
185
182
|
POLYGON: 137,
|
|
186
183
|
ETH: 1,
|
|
@@ -197,12 +194,12 @@ exports.chainNameToChainId = {
|
|
|
197
194
|
"METIS-TESTNET": 599,
|
|
198
195
|
MANTLE: 5000,
|
|
199
196
|
"MANTLE-TESTNET": 5001,
|
|
200
|
-
[
|
|
201
|
-
[
|
|
202
|
-
[
|
|
203
|
-
[
|
|
197
|
+
[zkLink]: 810180,
|
|
198
|
+
[zkLinkTestnet]: 810182,
|
|
199
|
+
[bitlayerTestnet]: 200810,
|
|
200
|
+
[neoxTestnet]: 12227330,
|
|
204
201
|
};
|
|
205
|
-
|
|
202
|
+
export const chainIdToChainName = {
|
|
206
203
|
80001: "MUMBAI",
|
|
207
204
|
137: "POLYGON",
|
|
208
205
|
1: "ETH",
|
|
@@ -219,8 +216,8 @@ exports.chainIdToChainName = {
|
|
|
219
216
|
599: "METIS-TESTNET",
|
|
220
217
|
169: "MANTA",
|
|
221
218
|
3441005: "MANTA-TESTNET",
|
|
222
|
-
810180:
|
|
223
|
-
810182:
|
|
224
|
-
200810:
|
|
225
|
-
12227330:
|
|
219
|
+
810180: zkLink,
|
|
220
|
+
810182: zkLinkTestnet,
|
|
221
|
+
200810: bitlayerTestnet,
|
|
222
|
+
12227330: neoxTestnet,
|
|
226
223
|
};
|
package/package.json
CHANGED