@tria-sdk/constants 1.0.7 → 1.0.8
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 +27 -30
- package/dist/src/config.js +10 -17
- package/dist/src/connect.js +5 -8
- package/dist/src/txn.js +41 -44
- 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,19 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.zkLinkTestnet = "ZKLINK-NOVA-TESTNET";
|
|
6
|
-
exports.bitlayerTestnet = "BITLAYER-TESTNET";
|
|
7
|
-
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 TESTNET_CHAINS = [
|
|
8
5
|
"MUMBAI",
|
|
9
6
|
"FUSESPARK",
|
|
10
7
|
"MANTA-TESTNET",
|
|
11
8
|
"METIS-TESTNET",
|
|
12
9
|
"MANTLE-TESTNET",
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
zkLinkTestnet,
|
|
11
|
+
bitlayerTestnet,
|
|
15
12
|
];
|
|
16
|
-
|
|
13
|
+
export const SUPPORTED_EVM_CHAINS = [
|
|
17
14
|
"ETH",
|
|
18
15
|
"POLYGON",
|
|
19
16
|
"AVALANCHE",
|
|
@@ -30,11 +27,11 @@ exports.SUPPORTED_EVM_CHAINS = [
|
|
|
30
27
|
"METIS-TESTNET",
|
|
31
28
|
"MANTLE",
|
|
32
29
|
"MANTLE-TESTNET",
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
zkLink,
|
|
31
|
+
zkLinkTestnet,
|
|
32
|
+
bitlayerTestnet,
|
|
36
33
|
];
|
|
37
|
-
|
|
34
|
+
export const AA_SUPPORTED_EVM_CHAINS = [
|
|
38
35
|
"ETH",
|
|
39
36
|
"POLYGON",
|
|
40
37
|
"AVALANCHE",
|
|
@@ -45,7 +42,7 @@ exports.AA_SUPPORTED_EVM_CHAINS = [
|
|
|
45
42
|
"FUSE",
|
|
46
43
|
"MUMBAI",
|
|
47
44
|
];
|
|
48
|
-
|
|
45
|
+
export const ALLCHAINS = [
|
|
49
46
|
"ETH",
|
|
50
47
|
"POLYGON",
|
|
51
48
|
"AVALANCHE",
|
|
@@ -63,13 +60,13 @@ exports.ALLCHAINS = [
|
|
|
63
60
|
"MANTLE",
|
|
64
61
|
"MANTLE-TESTNET",
|
|
65
62
|
"SOLANA",
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
zkLink,
|
|
64
|
+
zkLinkTestnet,
|
|
65
|
+
bitlayerTestnet,
|
|
69
66
|
];
|
|
70
67
|
const baseLogoUrl = "https://static.tria.so/chain-logo-w";
|
|
71
68
|
const baseLogoUrlBlack = "https://static.tria.so/chain-logo-b";
|
|
72
|
-
|
|
69
|
+
export const networks = [
|
|
73
70
|
{
|
|
74
71
|
chainName: "ETH",
|
|
75
72
|
logo: `${baseLogoUrl}/Ethereum.webp`,
|
|
@@ -143,19 +140,19 @@ exports.networks = [
|
|
|
143
140
|
logo: `${baseLogoUrl}/Solana.webp`,
|
|
144
141
|
},
|
|
145
142
|
{
|
|
146
|
-
chainName:
|
|
143
|
+
chainName: zkLink,
|
|
147
144
|
logo: ``,
|
|
148
145
|
},
|
|
149
146
|
{
|
|
150
|
-
chainName:
|
|
147
|
+
chainName: zkLinkTestnet,
|
|
151
148
|
logo: ``,
|
|
152
149
|
},
|
|
153
150
|
{
|
|
154
|
-
chainName:
|
|
151
|
+
chainName: bitlayerTestnet,
|
|
155
152
|
logo: ``,
|
|
156
153
|
},
|
|
157
154
|
];
|
|
158
|
-
|
|
155
|
+
export const chainNameToLogo = {
|
|
159
156
|
ETH: `${baseLogoUrl}/Ethereum.webp`,
|
|
160
157
|
FANTOM: `${baseLogoUrl}/Fantom.webp`,
|
|
161
158
|
POLYGON: `${baseLogoUrl}/Polygon.webp`,
|
|
@@ -174,11 +171,11 @@ exports.chainNameToLogo = {
|
|
|
174
171
|
MANTLE: `${baseLogoUrl}/Mantle.webp`,
|
|
175
172
|
"MANTLE-TESTNET": `${baseLogoUrl}/Mantle.webp`,
|
|
176
173
|
SOLANA: `${baseLogoUrl}/Solana.webp`,
|
|
177
|
-
[
|
|
178
|
-
[
|
|
179
|
-
[
|
|
174
|
+
[zkLink]: `${baseLogoUrl}/Ethereum.webp`,
|
|
175
|
+
[zkLinkTestnet]: `${baseLogoUrl}/Ethereum.webp`,
|
|
176
|
+
[bitlayerTestnet]: `${baseLogoUrl}/Ethereum.webp`,
|
|
180
177
|
};
|
|
181
|
-
|
|
178
|
+
export const chainNameToLogoBlack = {
|
|
182
179
|
ETH: `${baseLogoUrlBlack}/Ethereum.webp`,
|
|
183
180
|
BINANCE: `${baseLogoUrlBlack}/binance.webp`,
|
|
184
181
|
FANTOM: `${baseLogoUrlBlack}/Fantom.webp`,
|
|
@@ -197,7 +194,7 @@ exports.chainNameToLogoBlack = {
|
|
|
197
194
|
MANTLE: `${baseLogoUrlBlack}/Mantle.webp`,
|
|
198
195
|
"MANTLE-TESTNET": `${baseLogoUrlBlack}/Mantle.webp`,
|
|
199
196
|
SOLANA: `${baseLogoUrlBlack}/Solana.webp`,
|
|
200
|
-
[
|
|
201
|
-
[
|
|
202
|
-
[
|
|
197
|
+
[zkLink]: `${baseLogoUrlBlack}/Ethereum.webp`,
|
|
198
|
+
[zkLinkTestnet]: `${baseLogoUrlBlack}/Ethereum.webp`,
|
|
199
|
+
[bitlayerTestnet]: `${baseLogoUrlBlack}/Ethereum.webp`,
|
|
203
200
|
};
|
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
|
socialSignUp: "Social Sign up",
|
|
@@ -16,12 +13,12 @@ exports.eventTypes = {
|
|
|
16
13
|
idTokenPass: "Id Token Pass",
|
|
17
14
|
saveToAuth: "Save to Auth Iframe",
|
|
18
15
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
export const TRIA_WALLET_STORE = "tria.wallet.store";
|
|
17
|
+
export const TRIA_WALLET_SELECTED_CHAIN = "tria.wallet.selectedChain";
|
|
18
|
+
export const storageKeys = {
|
|
22
19
|
TRIA_WALLET_STORE: "tria.wallet.store",
|
|
23
20
|
TRIA_WALLET_SELECTED_CHAIN: "tria.wallet.selectedChain",
|
|
24
21
|
PERSIST_ROOT: "persist:root",
|
|
25
22
|
};
|
|
26
|
-
|
|
23
|
+
export const triaAuthUrl = "https://auth.tria.so";
|
|
27
24
|
// 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, 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,32 +20,32 @@ 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
|
-
[
|
|
23
|
+
[zkLink]: "https://explorer.zklink.io",
|
|
24
|
+
[zkLinkTestnet]: "https://goerli.explorer.zklink.io",
|
|
25
|
+
[bitlayerTestnet]: "https://testnet-scan.bitlayer.org/en-us",
|
|
29
26
|
};
|
|
30
|
-
|
|
31
|
-
ETH: `${
|
|
32
|
-
POLYGON: `${
|
|
33
|
-
AVALANCHE: `${
|
|
34
|
-
ARBITRUM: `${
|
|
35
|
-
BINANCE: `${
|
|
36
|
-
OPTIMISM: `${
|
|
37
|
-
FANTOM: `${
|
|
38
|
-
FUSE: `${
|
|
39
|
-
FUSESPARK: `${
|
|
40
|
-
MUMBAI: `${
|
|
41
|
-
METIS: `${
|
|
42
|
-
"METIS-TESTNET": `${
|
|
43
|
-
MANTLE: `${
|
|
44
|
-
"MANTLE-TESTNET": `${
|
|
45
|
-
MANTA: `${
|
|
46
|
-
"MANTA-TESTNET": `${
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
27
|
+
export const txnBaseUrl = {
|
|
28
|
+
ETH: `${explorerBaseUrls.ETH}/tx`, // /txHash
|
|
29
|
+
POLYGON: `${explorerBaseUrls.POLYGON}/tx`,
|
|
30
|
+
AVALANCHE: `${explorerBaseUrls.AVALANCHE}/tx`,
|
|
31
|
+
ARBITRUM: `${explorerBaseUrls.ARBITRUM}/tx`,
|
|
32
|
+
BINANCE: `${explorerBaseUrls.BINANCE}/tx`,
|
|
33
|
+
OPTIMISM: `${explorerBaseUrls.OPTIMISM}/tx`,
|
|
34
|
+
FANTOM: `${explorerBaseUrls.FANTOM}/tx`,
|
|
35
|
+
FUSE: `${explorerBaseUrls.FUSE}/tx`,
|
|
36
|
+
FUSESPARK: `${explorerBaseUrls.FUSESPARK}/tx`,
|
|
37
|
+
MUMBAI: `${explorerBaseUrls.MUMBAI}/tx`,
|
|
38
|
+
METIS: `${explorerBaseUrls.METIS}/tx`,
|
|
39
|
+
"METIS-TESTNET": `${explorerBaseUrls["METIS-TESTNET"]}/tx`,
|
|
40
|
+
MANTLE: `${explorerBaseUrls.MANTLE}/tx`,
|
|
41
|
+
"MANTLE-TESTNET": `${explorerBaseUrls["MANTLE-TESTNET"]}/tx`,
|
|
42
|
+
MANTA: `${explorerBaseUrls.MANTA}/tx`,
|
|
43
|
+
"MANTA-TESTNET": `${explorerBaseUrls["MANTA-TESTNET"]}/tx`,
|
|
44
|
+
[zkLink]: `${explorerBaseUrls[zkLink]}/tx`,
|
|
45
|
+
[zkLinkTestnet]: `${explorerBaseUrls[zkLinkTestnet]}/tx`,
|
|
46
|
+
[bitlayerTestnet]: `${explorerBaseUrls[bitlayerTestnet]}/tx`,
|
|
50
47
|
};
|
|
51
|
-
|
|
48
|
+
export const nativeTokenDetails = {
|
|
52
49
|
ETH: {
|
|
53
50
|
name: "Ether",
|
|
54
51
|
symbol: "ETH",
|
|
@@ -134,24 +131,24 @@ exports.nativeTokenDetails = {
|
|
|
134
131
|
symbol: "SOL",
|
|
135
132
|
logoUrl: "https://static.tria.so/chain-logo-w/Solana.webp",
|
|
136
133
|
},
|
|
137
|
-
[
|
|
134
|
+
[zkLink]: {
|
|
138
135
|
name: "Ether",
|
|
139
136
|
symbol: "ETH",
|
|
140
137
|
logoUrl: "https://static.tria.so/chain-logo-w/Ethereum.webp",
|
|
141
138
|
},
|
|
142
|
-
[
|
|
139
|
+
[zkLinkTestnet]: {
|
|
143
140
|
name: "Ether",
|
|
144
141
|
symbol: "ETH",
|
|
145
142
|
logoUrl: "https://static.tria.so/chain-logo-w/bitcoin.webp",
|
|
146
143
|
},
|
|
147
|
-
[
|
|
144
|
+
[bitlayerTestnet]: {
|
|
148
145
|
name: "Bitcoin",
|
|
149
146
|
symbol: "BTC",
|
|
150
147
|
logoUrl: "https://static.tria.so/chain-logo-w/bitcoin.webp",
|
|
151
148
|
},
|
|
152
149
|
};
|
|
153
150
|
const alchemyKey = "kcuWVV9ss_iLWJ2Lw6xdHbmtZYixfY7Z";
|
|
154
|
-
|
|
151
|
+
export const rpcUrls = {
|
|
155
152
|
MUMBAI: `https://polygon-mumbai.g.alchemy.com/v2/${alchemyKey}`, //'https://polygon-mumbai.blockpi.network/v1/rpc/public',
|
|
156
153
|
ETH: "https://eth.llamarpc.com",
|
|
157
154
|
POLYGON: `https://polygon-mainnet.g.alchemy.com/v2/${alchemyKey}`, // 'https://polygon.llamarpc.com',
|
|
@@ -168,11 +165,11 @@ exports.rpcUrls = {
|
|
|
168
165
|
"METIS-TESTNET": "https://goerli.gateway.metisdevops.link",
|
|
169
166
|
MANTLE: "https://rpc.mantle.xyz",
|
|
170
167
|
"MANTLE-TESTNET": "https://rpc.testnet.mantle.xyz",
|
|
171
|
-
[
|
|
172
|
-
[
|
|
173
|
-
[
|
|
168
|
+
[zkLink]: "https://rpc.zklink.io",
|
|
169
|
+
[zkLinkTestnet]: "https://goerli.rpc.zklink.io",
|
|
170
|
+
[bitlayerTestnet]: "https://testnet-rpc.bitlayer.org",
|
|
174
171
|
};
|
|
175
|
-
|
|
172
|
+
export const chainNameToChainId = {
|
|
176
173
|
MUMBAI: 80001,
|
|
177
174
|
POLYGON: 137,
|
|
178
175
|
ETH: 1,
|
|
@@ -189,11 +186,11 @@ exports.chainNameToChainId = {
|
|
|
189
186
|
"METIS-TESTNET": 599,
|
|
190
187
|
MANTLE: 5000,
|
|
191
188
|
"MANTLE-TESTNET": 5001,
|
|
192
|
-
[
|
|
193
|
-
[
|
|
194
|
-
[
|
|
189
|
+
[zkLink]: 810180,
|
|
190
|
+
[zkLinkTestnet]: 810182,
|
|
191
|
+
[bitlayerTestnet]: 200810,
|
|
195
192
|
};
|
|
196
|
-
|
|
193
|
+
export const chainIdToChainName = {
|
|
197
194
|
80001: "MUMBAI",
|
|
198
195
|
137: "POLYGON",
|
|
199
196
|
1: "ETH",
|
|
@@ -210,7 +207,7 @@ exports.chainIdToChainName = {
|
|
|
210
207
|
599: "METIS-TESTNET",
|
|
211
208
|
169: "MANTA",
|
|
212
209
|
3441005: "MANTA-TESTNET",
|
|
213
|
-
810180:
|
|
214
|
-
810182:
|
|
215
|
-
200810:
|
|
210
|
+
810180: zkLink,
|
|
211
|
+
810182: zkLinkTestnet,
|
|
212
|
+
200810: bitlayerTestnet,
|
|
216
213
|
};
|
package/package.json
CHANGED