@tria-sdk/constants 1.0.2 → 1.0.6
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.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/src/chains.d.ts +60 -0
- package/dist/src/chains.js +200 -0
- package/dist/src/config.d.ts +5 -0
- package/dist/src/config.js +14 -0
- package/dist/src/connect.d.ts +23 -0
- package/dist/src/connect.js +24 -0
- package/dist/src/txn.d.ts +211 -0
- package/dist/src/txn.js +213 -0
- package/package.json +3 -2
- package/tsconfig.json +4 -3
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export declare const zkLink = "ZKLINK-NOVA";
|
|
2
|
+
export declare const zkLinkTestnet = "ZKLINK-NOVA-TESTNET";
|
|
3
|
+
export declare const bitlayerTestnet = "BITLAYER-TESTNET";
|
|
4
|
+
export type ZKLINK = "ZKLINK-NOVA";
|
|
5
|
+
export type ZKLINK_TESTNET = "ZKLINK-NOVA-TESTNET";
|
|
6
|
+
export type BITLAYER_TESTNET = "BITLAYER-TESTNET";
|
|
7
|
+
export declare const TESTNET_CHAINS: string[];
|
|
8
|
+
export declare const SUPPORTED_EVM_CHAINS: string[];
|
|
9
|
+
export declare const AA_SUPPORTED_EVM_CHAINS: string[];
|
|
10
|
+
export declare const ALLCHAINS: string[];
|
|
11
|
+
export declare const networks: {
|
|
12
|
+
chainName: string;
|
|
13
|
+
logo: string;
|
|
14
|
+
}[];
|
|
15
|
+
export declare const chainNameToLogo: {
|
|
16
|
+
ETH: string;
|
|
17
|
+
FANTOM: string;
|
|
18
|
+
POLYGON: string;
|
|
19
|
+
AVALANCHE: string;
|
|
20
|
+
OPTIMISM: string;
|
|
21
|
+
ARBITRUM: string;
|
|
22
|
+
LINEA: string;
|
|
23
|
+
MUMBAI: string;
|
|
24
|
+
FUSE: string;
|
|
25
|
+
FUSESPARK: string;
|
|
26
|
+
BINANCE: string;
|
|
27
|
+
MANTA: string;
|
|
28
|
+
"MANTA-TESTNET": string;
|
|
29
|
+
METIS: string;
|
|
30
|
+
"METIS-TESTNET": string;
|
|
31
|
+
MANTLE: string;
|
|
32
|
+
"MANTLE-TESTNET": string;
|
|
33
|
+
SOLANA: string;
|
|
34
|
+
"ZKLINK-NOVA": string;
|
|
35
|
+
"ZKLINK-NOVA-TESTNET": string;
|
|
36
|
+
"BITLAYER-TESTNET": string;
|
|
37
|
+
};
|
|
38
|
+
export declare const chainNameToLogoBlack: {
|
|
39
|
+
ETH: string;
|
|
40
|
+
BINANCE: string;
|
|
41
|
+
FANTOM: string;
|
|
42
|
+
POLYGON: string;
|
|
43
|
+
AVALANCHE: string;
|
|
44
|
+
OPTIMISM: string;
|
|
45
|
+
ARBITRUM: string;
|
|
46
|
+
LINEA: string;
|
|
47
|
+
MUMBAI: string;
|
|
48
|
+
FUSE: string;
|
|
49
|
+
FUSESPARK: string;
|
|
50
|
+
MANTA: string;
|
|
51
|
+
"MANTA-TESTNET": string;
|
|
52
|
+
METIS: string;
|
|
53
|
+
"METIS-TESTNET": string;
|
|
54
|
+
MANTLE: string;
|
|
55
|
+
"MANTLE-TESTNET": string;
|
|
56
|
+
SOLANA: string;
|
|
57
|
+
"ZKLINK-NOVA": string;
|
|
58
|
+
"ZKLINK-NOVA-TESTNET": string;
|
|
59
|
+
"BITLAYER-TESTNET": string;
|
|
60
|
+
};
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
export const zkLink = "ZKLINK-NOVA";
|
|
2
|
+
export const zkLinkTestnet = "ZKLINK-NOVA-TESTNET";
|
|
3
|
+
export const bitlayerTestnet = "BITLAYER-TESTNET";
|
|
4
|
+
export const TESTNET_CHAINS = [
|
|
5
|
+
"MUMBAI",
|
|
6
|
+
"FUSESPARK",
|
|
7
|
+
"MANTA-TESTNET",
|
|
8
|
+
"METIS-TESTNET",
|
|
9
|
+
"MANTLE-TESTNET",
|
|
10
|
+
zkLinkTestnet,
|
|
11
|
+
bitlayerTestnet,
|
|
12
|
+
];
|
|
13
|
+
export const SUPPORTED_EVM_CHAINS = [
|
|
14
|
+
"ETH",
|
|
15
|
+
"POLYGON",
|
|
16
|
+
"AVALANCHE",
|
|
17
|
+
"ARBITRUM",
|
|
18
|
+
"BINANCE",
|
|
19
|
+
"OPTIMISM",
|
|
20
|
+
"FANTOM",
|
|
21
|
+
"FUSE",
|
|
22
|
+
"FUSESPARK",
|
|
23
|
+
"MUMBAI",
|
|
24
|
+
"MANTA",
|
|
25
|
+
"MANTA-TESTNET",
|
|
26
|
+
"METIS",
|
|
27
|
+
"METIS-TESTNET",
|
|
28
|
+
"MANTLE",
|
|
29
|
+
"MANTLE-TESTNET",
|
|
30
|
+
zkLink,
|
|
31
|
+
zkLinkTestnet,
|
|
32
|
+
bitlayerTestnet,
|
|
33
|
+
];
|
|
34
|
+
export const AA_SUPPORTED_EVM_CHAINS = [
|
|
35
|
+
"ETH",
|
|
36
|
+
"POLYGON",
|
|
37
|
+
"AVALANCHE",
|
|
38
|
+
"ARBITRUM",
|
|
39
|
+
"BINANCE",
|
|
40
|
+
"OPTIMISM",
|
|
41
|
+
"FANTOM",
|
|
42
|
+
"FUSE",
|
|
43
|
+
"MUMBAI",
|
|
44
|
+
];
|
|
45
|
+
export const ALLCHAINS = [
|
|
46
|
+
"ETH",
|
|
47
|
+
"POLYGON",
|
|
48
|
+
"AVALANCHE",
|
|
49
|
+
"ARBITRUM",
|
|
50
|
+
"BINANCE",
|
|
51
|
+
"OPTIMISM",
|
|
52
|
+
"FANTOM",
|
|
53
|
+
"FUSE",
|
|
54
|
+
"FUSESPARK",
|
|
55
|
+
"MUMBAI",
|
|
56
|
+
"MANTA",
|
|
57
|
+
"MANTA-TESTNET",
|
|
58
|
+
"METIS",
|
|
59
|
+
"METIS-TESTNET",
|
|
60
|
+
"MANTLE",
|
|
61
|
+
"MANTLE-TESTNET",
|
|
62
|
+
"SOLANA",
|
|
63
|
+
zkLink,
|
|
64
|
+
zkLinkTestnet,
|
|
65
|
+
bitlayerTestnet,
|
|
66
|
+
];
|
|
67
|
+
const baseLogoUrl = "https://static.tria.so/chain-logo-w";
|
|
68
|
+
const baseLogoUrlBlack = "https://static.tria.so/chain-logo-b";
|
|
69
|
+
export const networks = [
|
|
70
|
+
{
|
|
71
|
+
chainName: "ETH",
|
|
72
|
+
logo: `${baseLogoUrl}/Ethereum.webp`,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
chainName: "FANTOM",
|
|
76
|
+
logo: `${baseLogoUrl}/Fantom.webp`,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
chainName: "POLYGON",
|
|
80
|
+
logo: `${baseLogoUrl}/Polygon.svg`,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
chainName: "AVALANCHE",
|
|
84
|
+
logo: `${baseLogoUrl}/Avalanche.webp`,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
chainName: "OPTIMISM",
|
|
88
|
+
logo: `${baseLogoUrl}/Optimism.webp`,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
chainName: "ARBITRUM",
|
|
92
|
+
logo: `${baseLogoUrl}/Arbitrum.webp`,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
chainName: "FUSE",
|
|
96
|
+
logo: `${baseLogoUrl}/Fuse.webp`,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
chainName: "FUSESPARK",
|
|
100
|
+
logo: `${baseLogoUrl}/Fuse.webp`,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
chainName: "MUMBAI",
|
|
104
|
+
logo: `${baseLogoUrl}/Polygon.svg`,
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
chainName: "BINANCE",
|
|
108
|
+
logo: `${baseLogoUrl}/Binance.svg`,
|
|
109
|
+
},
|
|
110
|
+
// {
|
|
111
|
+
// chainName: 'LINEA',
|
|
112
|
+
// logo: `${baseLogoUrl}/Linea.svg`,
|
|
113
|
+
// },
|
|
114
|
+
{
|
|
115
|
+
chainName: "METIS",
|
|
116
|
+
logo: `${baseLogoUrl}/Metis.webp`,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
chainName: "METIS-TESTNET",
|
|
120
|
+
logo: `${baseLogoUrl}/Metis.webp`,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
chainName: "MANTA",
|
|
124
|
+
logo: `${baseLogoUrl}/Manta.webp`,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
chainName: "MANTA-TESTNET",
|
|
128
|
+
logo: `${baseLogoUrl}/Manta.webp`,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
chainName: "MANTLE",
|
|
132
|
+
logo: `${baseLogoUrl}/Mantle.webp`,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
chainName: "MANTLE-TESTNET",
|
|
136
|
+
logo: `${baseLogoUrl}/Mantle.webp`,
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
chainName: "SOLANA",
|
|
140
|
+
logo: `${baseLogoUrl}/Solana.webp`,
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
chainName: zkLink,
|
|
144
|
+
logo: ``,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
chainName: zkLinkTestnet,
|
|
148
|
+
logo: ``,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
chainName: bitlayerTestnet,
|
|
152
|
+
logo: ``,
|
|
153
|
+
},
|
|
154
|
+
];
|
|
155
|
+
export const chainNameToLogo = {
|
|
156
|
+
ETH: `${baseLogoUrl}/Ethereum.webp`,
|
|
157
|
+
FANTOM: `${baseLogoUrl}/Fantom.webp`,
|
|
158
|
+
POLYGON: `${baseLogoUrl}/Polygon.webp`,
|
|
159
|
+
AVALANCHE: `${baseLogoUrl}/Avalanche.webp`,
|
|
160
|
+
OPTIMISM: `${baseLogoUrl}/Optimism.webp`,
|
|
161
|
+
ARBITRUM: `${baseLogoUrl}/Arbitrum.webp`,
|
|
162
|
+
LINEA: `${baseLogoUrl}/Linea.webp`,
|
|
163
|
+
MUMBAI: `${baseLogoUrl}/Polygon.webp`,
|
|
164
|
+
FUSE: `${baseLogoUrl}/Fuse.webp`,
|
|
165
|
+
FUSESPARK: `${baseLogoUrl}/Fuse.webp`,
|
|
166
|
+
BINANCE: `${baseLogoUrl}/Binance.svg`,
|
|
167
|
+
MANTA: `${baseLogoUrl}/Manta.webp`,
|
|
168
|
+
"MANTA-TESTNET": `${baseLogoUrl}/Manta.webp`,
|
|
169
|
+
METIS: `${baseLogoUrl}/Metis.webp`,
|
|
170
|
+
"METIS-TESTNET": `${baseLogoUrl}/Metis.webp`,
|
|
171
|
+
MANTLE: `${baseLogoUrl}/Mantle.webp`,
|
|
172
|
+
"MANTLE-TESTNET": `${baseLogoUrl}/Mantle.webp`,
|
|
173
|
+
SOLANA: `${baseLogoUrl}/Solana.webp`,
|
|
174
|
+
[zkLink]: `${baseLogoUrl}/Ethereum.webp`,
|
|
175
|
+
[zkLinkTestnet]: `${baseLogoUrl}/Ethereum.webp`,
|
|
176
|
+
[bitlayerTestnet]: `${baseLogoUrl}/Ethereum.webp`,
|
|
177
|
+
};
|
|
178
|
+
export const chainNameToLogoBlack = {
|
|
179
|
+
ETH: `${baseLogoUrlBlack}/Ethereum.webp`,
|
|
180
|
+
BINANCE: `${baseLogoUrlBlack}/binance.webp`,
|
|
181
|
+
FANTOM: `${baseLogoUrlBlack}/Fantom.webp`,
|
|
182
|
+
POLYGON: `${baseLogoUrlBlack}/Polygon.webp`,
|
|
183
|
+
AVALANCHE: `${baseLogoUrlBlack}/Avalanche.webp`,
|
|
184
|
+
OPTIMISM: `${baseLogoUrlBlack}/Optimism.webp`,
|
|
185
|
+
ARBITRUM: `${baseLogoUrlBlack}/Arbitrum.webp`,
|
|
186
|
+
LINEA: `${baseLogoUrlBlack}/Linea.webp`,
|
|
187
|
+
MUMBAI: `${baseLogoUrlBlack}/Polygon.webp`,
|
|
188
|
+
FUSE: `${baseLogoUrlBlack}/fuse.webp`,
|
|
189
|
+
FUSESPARK: `${baseLogoUrlBlack}/fuse.webp`,
|
|
190
|
+
MANTA: `${baseLogoUrlBlack}/Manta.webp`,
|
|
191
|
+
"MANTA-TESTNET": `${baseLogoUrlBlack}/Manta.webp`,
|
|
192
|
+
METIS: `${baseLogoUrlBlack}/Metis.webp`,
|
|
193
|
+
"METIS-TESTNET": `${baseLogoUrlBlack}/Metis.webp`,
|
|
194
|
+
MANTLE: `${baseLogoUrlBlack}/Mantle.webp`,
|
|
195
|
+
"MANTLE-TESTNET": `${baseLogoUrlBlack}/Mantle.webp`,
|
|
196
|
+
SOLANA: `${baseLogoUrlBlack}/Solana.webp`,
|
|
197
|
+
[zkLink]: `${baseLogoUrlBlack}/Ethereum.webp`,
|
|
198
|
+
[zkLinkTestnet]: `${baseLogoUrlBlack}/Ethereum.webp`,
|
|
199
|
+
[bitlayerTestnet]: `${baseLogoUrlBlack}/Ethereum.webp`,
|
|
200
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const prodApiUrl = "https://prod.tria.so";
|
|
2
|
+
export declare const isEvmChain: (chainName: string) => boolean;
|
|
3
|
+
export declare const isAaSupportedChain: (chainName: string) => boolean;
|
|
4
|
+
export declare const isChainSupported: (chainName: string) => boolean;
|
|
5
|
+
export declare const isTestnetChain: (chainName: string) => boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
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);
|
|
5
|
+
};
|
|
6
|
+
export const isAaSupportedChain = (chainName) => {
|
|
7
|
+
return AA_SUPPORTED_EVM_CHAINS.includes(chainName);
|
|
8
|
+
};
|
|
9
|
+
export const isChainSupported = (chainName) => {
|
|
10
|
+
return ALLCHAINS.includes(chainName);
|
|
11
|
+
};
|
|
12
|
+
export const isTestnetChain = (chainName) => {
|
|
13
|
+
return TESTNET_CHAINS.includes(chainName);
|
|
14
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const eventTypes: {
|
|
2
|
+
logIn: string;
|
|
3
|
+
triaSignUp: string;
|
|
4
|
+
socialSignUp: string;
|
|
5
|
+
signMessage: string;
|
|
6
|
+
send: string;
|
|
7
|
+
disconnect: string;
|
|
8
|
+
switchChain: string;
|
|
9
|
+
detected: string;
|
|
10
|
+
logout: string;
|
|
11
|
+
passMessage: string;
|
|
12
|
+
accessToken: string;
|
|
13
|
+
idTokenPass: string;
|
|
14
|
+
saveToAuth: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const TRIA_WALLET_STORE = "tria.wallet.store";
|
|
17
|
+
export declare const TRIA_WALLET_SELECTED_CHAIN = "tria.wallet.selectedChain";
|
|
18
|
+
export declare const storageKeys: {
|
|
19
|
+
TRIA_WALLET_STORE: string;
|
|
20
|
+
TRIA_WALLET_SELECTED_CHAIN: string;
|
|
21
|
+
PERSIST_ROOT: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const triaAuthUrl = "https://auth.tria.so";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const eventTypes = {
|
|
2
|
+
logIn: "Log in",
|
|
3
|
+
triaSignUp: "Tria Sign up",
|
|
4
|
+
socialSignUp: "Social Sign up",
|
|
5
|
+
signMessage: "Sign Message",
|
|
6
|
+
send: "Send",
|
|
7
|
+
disconnect: "Disconnect",
|
|
8
|
+
switchChain: "Switch chain",
|
|
9
|
+
detected: "Detected Logged in Tria account",
|
|
10
|
+
logout: "Logout",
|
|
11
|
+
passMessage: "Pass Message",
|
|
12
|
+
accessToken: "Access Token Pass",
|
|
13
|
+
idTokenPass: "Id Token Pass",
|
|
14
|
+
saveToAuth: "Save to Auth Iframe",
|
|
15
|
+
};
|
|
16
|
+
export const TRIA_WALLET_STORE = "tria.wallet.store";
|
|
17
|
+
export const TRIA_WALLET_SELECTED_CHAIN = "tria.wallet.selectedChain";
|
|
18
|
+
export const storageKeys = {
|
|
19
|
+
TRIA_WALLET_STORE: "tria.wallet.store",
|
|
20
|
+
TRIA_WALLET_SELECTED_CHAIN: "tria.wallet.selectedChain",
|
|
21
|
+
PERSIST_ROOT: "persist:root",
|
|
22
|
+
};
|
|
23
|
+
export const triaAuthUrl = "https://auth.tria.so";
|
|
24
|
+
// export const PARENT_URL = document?.referrer || window?.parent?.[0]?.location?.ancestorOrigins?.[0];
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
export declare const explorerBaseUrls: {
|
|
2
|
+
ETH: string;
|
|
3
|
+
POLYGON: string;
|
|
4
|
+
AVALANCHE: string;
|
|
5
|
+
ARBITRUM: string;
|
|
6
|
+
BINANCE: string;
|
|
7
|
+
OPTIMISM: string;
|
|
8
|
+
FANTOM: string;
|
|
9
|
+
SOLANA: string;
|
|
10
|
+
APTOS: string;
|
|
11
|
+
NEO: string;
|
|
12
|
+
SUI: string;
|
|
13
|
+
FUSE: string;
|
|
14
|
+
FUSESPARK: string;
|
|
15
|
+
MUMBAI: string;
|
|
16
|
+
METIS: string;
|
|
17
|
+
"METIS-TESTNET": string;
|
|
18
|
+
MANTLE: string;
|
|
19
|
+
"MANTLE-TESTNET": string;
|
|
20
|
+
MANTA: string;
|
|
21
|
+
"MANTA-TESTNET": string;
|
|
22
|
+
"ZKLINK-NOVA": string;
|
|
23
|
+
"ZKLINK-NOVA-TESTNET": string;
|
|
24
|
+
"BITLAYER-TESTNET": string;
|
|
25
|
+
};
|
|
26
|
+
export declare const txnBaseUrl: {
|
|
27
|
+
ETH: string;
|
|
28
|
+
POLYGON: string;
|
|
29
|
+
AVALANCHE: string;
|
|
30
|
+
ARBITRUM: string;
|
|
31
|
+
BINANCE: string;
|
|
32
|
+
OPTIMISM: string;
|
|
33
|
+
FANTOM: string;
|
|
34
|
+
FUSE: string;
|
|
35
|
+
FUSESPARK: string;
|
|
36
|
+
MUMBAI: string;
|
|
37
|
+
METIS: string;
|
|
38
|
+
"METIS-TESTNET": string;
|
|
39
|
+
MANTLE: string;
|
|
40
|
+
"MANTLE-TESTNET": string;
|
|
41
|
+
MANTA: string;
|
|
42
|
+
"MANTA-TESTNET": string;
|
|
43
|
+
"ZKLINK-NOVA": string;
|
|
44
|
+
"ZKLINK-NOVA-TESTNET": string;
|
|
45
|
+
"BITLAYER-TESTNET": string;
|
|
46
|
+
};
|
|
47
|
+
export declare const nativeTokenDetails: {
|
|
48
|
+
ETH: {
|
|
49
|
+
name: string;
|
|
50
|
+
symbol: string;
|
|
51
|
+
logoUrl: string;
|
|
52
|
+
};
|
|
53
|
+
POLYGON: {
|
|
54
|
+
name: string;
|
|
55
|
+
symbol: string;
|
|
56
|
+
logoUrl: string;
|
|
57
|
+
};
|
|
58
|
+
AVALANCHE: {
|
|
59
|
+
name: string;
|
|
60
|
+
symbol: string;
|
|
61
|
+
logoUrl: string;
|
|
62
|
+
};
|
|
63
|
+
ARBITRUM: {
|
|
64
|
+
name: string;
|
|
65
|
+
symbol: string;
|
|
66
|
+
logoUrl: string;
|
|
67
|
+
};
|
|
68
|
+
BINANCE: {
|
|
69
|
+
name: string;
|
|
70
|
+
symbol: string;
|
|
71
|
+
logoUrl: string;
|
|
72
|
+
};
|
|
73
|
+
OPTIMISM: {
|
|
74
|
+
name: string;
|
|
75
|
+
symbol: string;
|
|
76
|
+
logoUrl: string;
|
|
77
|
+
};
|
|
78
|
+
FANTOM: {
|
|
79
|
+
name: string;
|
|
80
|
+
symbol: string;
|
|
81
|
+
logoUrl: string;
|
|
82
|
+
};
|
|
83
|
+
FUSE: {
|
|
84
|
+
name: string;
|
|
85
|
+
symbol: string;
|
|
86
|
+
logoUrl: string;
|
|
87
|
+
};
|
|
88
|
+
FUSESPARK: {
|
|
89
|
+
name: string;
|
|
90
|
+
symbol: string;
|
|
91
|
+
logoUrl: string;
|
|
92
|
+
};
|
|
93
|
+
MUMBAI: {
|
|
94
|
+
name: string;
|
|
95
|
+
symbol: string;
|
|
96
|
+
logoUrl: string;
|
|
97
|
+
};
|
|
98
|
+
METIS: {
|
|
99
|
+
name: string;
|
|
100
|
+
symbol: string;
|
|
101
|
+
logoUrl: string;
|
|
102
|
+
};
|
|
103
|
+
"METIS-TESTNET": {
|
|
104
|
+
name: string;
|
|
105
|
+
symbol: string;
|
|
106
|
+
logoUrl: string;
|
|
107
|
+
};
|
|
108
|
+
MANTLE: {
|
|
109
|
+
name: string;
|
|
110
|
+
symbol: string;
|
|
111
|
+
logoUrl: string;
|
|
112
|
+
};
|
|
113
|
+
"MANTLE-TESTNET": {
|
|
114
|
+
name: string;
|
|
115
|
+
symbol: string;
|
|
116
|
+
logoUrl: string;
|
|
117
|
+
};
|
|
118
|
+
MANTA: {
|
|
119
|
+
name: string;
|
|
120
|
+
symbol: string;
|
|
121
|
+
logoUrl: string;
|
|
122
|
+
};
|
|
123
|
+
"MANTA-TESTNET": {
|
|
124
|
+
name: string;
|
|
125
|
+
symbol: string;
|
|
126
|
+
logoUrl: string;
|
|
127
|
+
};
|
|
128
|
+
SOLANA: {
|
|
129
|
+
name: string;
|
|
130
|
+
symbol: string;
|
|
131
|
+
logoUrl: string;
|
|
132
|
+
};
|
|
133
|
+
"ZKLINK-NOVA": {
|
|
134
|
+
name: string;
|
|
135
|
+
symbol: string;
|
|
136
|
+
logoUrl: string;
|
|
137
|
+
};
|
|
138
|
+
"ZKLINK-NOVA-TESTNET": {
|
|
139
|
+
name: string;
|
|
140
|
+
symbol: string;
|
|
141
|
+
logoUrl: string;
|
|
142
|
+
};
|
|
143
|
+
"BITLAYER-TESTNET": {
|
|
144
|
+
name: string;
|
|
145
|
+
symbol: string;
|
|
146
|
+
logoUrl: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
export declare const rpcUrls: {
|
|
150
|
+
MUMBAI: string;
|
|
151
|
+
ETH: string;
|
|
152
|
+
POLYGON: string;
|
|
153
|
+
AVALANCHE: string;
|
|
154
|
+
ARBITRUM: string;
|
|
155
|
+
BINANCE: string;
|
|
156
|
+
OPTIMISM: string;
|
|
157
|
+
FANTOM: string;
|
|
158
|
+
FUSE: string;
|
|
159
|
+
FUSESPARK: string;
|
|
160
|
+
MANTA: string;
|
|
161
|
+
"MANTA-TESTNET": string;
|
|
162
|
+
METIS: string;
|
|
163
|
+
"METIS-TESTNET": string;
|
|
164
|
+
MANTLE: string;
|
|
165
|
+
"MANTLE-TESTNET": string;
|
|
166
|
+
"ZKLINK-NOVA": string;
|
|
167
|
+
"ZKLINK-NOVA-TESTNET": string;
|
|
168
|
+
"BITLAYER-TESTNET": string;
|
|
169
|
+
};
|
|
170
|
+
export declare const chainNameToChainId: {
|
|
171
|
+
MUMBAI: number;
|
|
172
|
+
POLYGON: number;
|
|
173
|
+
ETH: number;
|
|
174
|
+
AVALANCHE: number;
|
|
175
|
+
ARBITRUM: number;
|
|
176
|
+
BINANCE: number;
|
|
177
|
+
OPTIMISM: number;
|
|
178
|
+
FANTOM: number;
|
|
179
|
+
FUSE: number;
|
|
180
|
+
FUSESPARK: number;
|
|
181
|
+
MANTA: number;
|
|
182
|
+
"MANTA-TESTNET": number;
|
|
183
|
+
METIS: number;
|
|
184
|
+
"METIS-TESTNET": number;
|
|
185
|
+
MANTLE: number;
|
|
186
|
+
"MANTLE-TESTNET": number;
|
|
187
|
+
"ZKLINK-NOVA": number;
|
|
188
|
+
"ZKLINK-NOVA-TESTNET": number;
|
|
189
|
+
"BITLAYER-TESTNET": number;
|
|
190
|
+
};
|
|
191
|
+
export declare const chainIdToChainName: {
|
|
192
|
+
80001: string;
|
|
193
|
+
137: string;
|
|
194
|
+
1: string;
|
|
195
|
+
43114: string;
|
|
196
|
+
42161: string;
|
|
197
|
+
56: string;
|
|
198
|
+
10: string;
|
|
199
|
+
250: string;
|
|
200
|
+
122: string;
|
|
201
|
+
123: string;
|
|
202
|
+
5000: string;
|
|
203
|
+
5001: string;
|
|
204
|
+
1088: string;
|
|
205
|
+
599: string;
|
|
206
|
+
169: string;
|
|
207
|
+
3441005: string;
|
|
208
|
+
810180: string;
|
|
209
|
+
810182: string;
|
|
210
|
+
200810: string;
|
|
211
|
+
};
|
package/dist/src/txn.js
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { bitlayerTestnet, zkLink, zkLinkTestnet } from "./chains";
|
|
2
|
+
export const explorerBaseUrls = {
|
|
3
|
+
ETH: "https://etherscan.io",
|
|
4
|
+
POLYGON: "https://polygonscan.com",
|
|
5
|
+
AVALANCHE: "https://snowtrace.io",
|
|
6
|
+
ARBITRUM: "https://arbiscan.io",
|
|
7
|
+
BINANCE: "https://bscscan.com",
|
|
8
|
+
OPTIMISM: "https://optimistic.etherscan.io",
|
|
9
|
+
FANTOM: "https://ftmscan.com",
|
|
10
|
+
SOLANA: "https://solscan.io",
|
|
11
|
+
APTOS: "https://explorer.aptoslabs.com",
|
|
12
|
+
NEO: "https://neo3.neotube.io",
|
|
13
|
+
SUI: "https://suiexplorer.com/?network=mainnet",
|
|
14
|
+
FUSE: "https://explorer.fuse.io",
|
|
15
|
+
FUSESPARK: "https://explorer.fusespark.io",
|
|
16
|
+
MUMBAI: "https://mumbai.polygonscan.com",
|
|
17
|
+
METIS: "https://andromeda-explorer.metis.io",
|
|
18
|
+
"METIS-TESTNET": "https://sepolia.explorer.metisdevops.link",
|
|
19
|
+
MANTLE: "https://explorer.mantle.xyz",
|
|
20
|
+
"MANTLE-TESTNET": "https://explorer.testnet.mantle.xyz",
|
|
21
|
+
MANTA: "https://pacific-explorer.manta.network",
|
|
22
|
+
"MANTA-TESTNET": "https://manta-testnet.calderaexplorer.xyz",
|
|
23
|
+
[zkLink]: "https://explorer.zklink.io",
|
|
24
|
+
[zkLinkTestnet]: "https://goerli.explorer.zklink.io",
|
|
25
|
+
[bitlayerTestnet]: "https://testnet-scan.bitlayer.org/en-us",
|
|
26
|
+
};
|
|
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`,
|
|
47
|
+
};
|
|
48
|
+
export const nativeTokenDetails = {
|
|
49
|
+
ETH: {
|
|
50
|
+
name: "Ether",
|
|
51
|
+
symbol: "ETH",
|
|
52
|
+
logoUrl: "https://www.datocms-assets.com/86369/1669619533-ethereum.png",
|
|
53
|
+
},
|
|
54
|
+
POLYGON: {
|
|
55
|
+
name: "Matic Token",
|
|
56
|
+
symbol: "MATIC",
|
|
57
|
+
logoUrl: "https://logos.covalenthq.com/tokens/1/0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0.png",
|
|
58
|
+
},
|
|
59
|
+
AVALANCHE: {
|
|
60
|
+
name: "Avalanche Coin",
|
|
61
|
+
symbol: "AVAX",
|
|
62
|
+
logoUrl: "https://www.datocms-assets.com/86369/1686152997-avalanche-colour.png",
|
|
63
|
+
},
|
|
64
|
+
ARBITRUM: {
|
|
65
|
+
name: "Arbitrum Mainnet Ether",
|
|
66
|
+
symbol: "ETH",
|
|
67
|
+
logoUrl: "https://www.datocms-assets.com/86369/1669925028-arbitrum.png",
|
|
68
|
+
},
|
|
69
|
+
BINANCE: {
|
|
70
|
+
name: "Binance Coin",
|
|
71
|
+
symbol: "BNB",
|
|
72
|
+
logoUrl: "https://www.datocms-assets.com/86369/1670003837-biance-smart-chain-colour.png",
|
|
73
|
+
},
|
|
74
|
+
OPTIMISM: {
|
|
75
|
+
name: "Ether",
|
|
76
|
+
symbol: "ETH",
|
|
77
|
+
logoUrl: "https://www.datocms-assets.com/86369/1670347461-optimisim-colour.png",
|
|
78
|
+
},
|
|
79
|
+
FANTOM: {
|
|
80
|
+
name: "Fantom",
|
|
81
|
+
symbol: "FTM",
|
|
82
|
+
logoUrl: "https://www.datocms-assets.com/86369/1669925359-fantom-1.png",
|
|
83
|
+
},
|
|
84
|
+
FUSE: {
|
|
85
|
+
name: "Fuse",
|
|
86
|
+
symbol: "FUSE",
|
|
87
|
+
logoUrl: "https://assets.coingecko.com/coins/images/10347/standard/fuse.png",
|
|
88
|
+
},
|
|
89
|
+
FUSESPARK: {
|
|
90
|
+
name: "Spark",
|
|
91
|
+
symbol: "SPARK",
|
|
92
|
+
logoUrl: "https://assets.coingecko.com/coins/images/10347/standard/fuse.png",
|
|
93
|
+
},
|
|
94
|
+
MUMBAI: {
|
|
95
|
+
name: "Matic Token",
|
|
96
|
+
symbol: "MATIC",
|
|
97
|
+
logoUrl: "https://logos.covalenthq.com/tokens/1/0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0.png",
|
|
98
|
+
},
|
|
99
|
+
METIS: {
|
|
100
|
+
name: "Metis Token",
|
|
101
|
+
symbol: "METIS",
|
|
102
|
+
logoUrl: "https://static.tria.so/chain-logo-w/Metis.webp",
|
|
103
|
+
},
|
|
104
|
+
"METIS-TESTNET": {
|
|
105
|
+
name: "Metis Token",
|
|
106
|
+
symbol: "METIS",
|
|
107
|
+
logoUrl: "https://static.tria.so/chain-logo-w/Metis.webp",
|
|
108
|
+
},
|
|
109
|
+
MANTLE: {
|
|
110
|
+
name: "Mantle",
|
|
111
|
+
symbol: "MNT",
|
|
112
|
+
logoUrl: "https://static.tria.so/chain-logo-w/Mantle.webp",
|
|
113
|
+
},
|
|
114
|
+
"MANTLE-TESTNET": {
|
|
115
|
+
name: "Mantle",
|
|
116
|
+
symbol: "MNT",
|
|
117
|
+
logoUrl: "https://static.tria.so/chain-logo-w/Mantle.webp",
|
|
118
|
+
},
|
|
119
|
+
MANTA: {
|
|
120
|
+
name: "Ether",
|
|
121
|
+
symbol: "ETH",
|
|
122
|
+
logoUrl: "https://static.tria.so/chain-logo-w/Manta.webp",
|
|
123
|
+
},
|
|
124
|
+
"MANTA-TESTNET": {
|
|
125
|
+
name: "Ether",
|
|
126
|
+
symbol: "ETH",
|
|
127
|
+
logoUrl: "https://static.tria.so/chain-logo-w/Manta.webp",
|
|
128
|
+
},
|
|
129
|
+
SOLANA: {
|
|
130
|
+
name: "Solana",
|
|
131
|
+
symbol: "SOL",
|
|
132
|
+
logoUrl: "https://static.tria.so/chain-logo-w/Solana.webp",
|
|
133
|
+
},
|
|
134
|
+
[zkLink]: {
|
|
135
|
+
name: "Ether",
|
|
136
|
+
symbol: "ETH",
|
|
137
|
+
logoUrl: "https://static.tria.so/chain-logo-w/Ethereum.webp",
|
|
138
|
+
},
|
|
139
|
+
[zkLinkTestnet]: {
|
|
140
|
+
name: "Ether",
|
|
141
|
+
symbol: "ETH",
|
|
142
|
+
logoUrl: "https://static.tria.so/chain-logo-w/bitcoin.webp",
|
|
143
|
+
},
|
|
144
|
+
[bitlayerTestnet]: {
|
|
145
|
+
name: "Bitcoin",
|
|
146
|
+
symbol: "BTC",
|
|
147
|
+
logoUrl: "https://static.tria.so/chain-logo-w/bitcoin.webp",
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
const alchemyKey = "kcuWVV9ss_iLWJ2Lw6xdHbmtZYixfY7Z";
|
|
151
|
+
export const rpcUrls = {
|
|
152
|
+
MUMBAI: `https://polygon-mumbai.g.alchemy.com/v2/${alchemyKey}`, //'https://polygon-mumbai.blockpi.network/v1/rpc/public',
|
|
153
|
+
ETH: "https://eth.llamarpc.com",
|
|
154
|
+
POLYGON: `https://polygon-mainnet.g.alchemy.com/v2/${alchemyKey}`, // 'https://polygon.llamarpc.com',
|
|
155
|
+
AVALANCHE: "https://avalanche-c-chain.publicnode.com",
|
|
156
|
+
ARBITRUM: "https://arbitrum-one.publicnode.com",
|
|
157
|
+
BINANCE: "https://bsc.publicnode.com",
|
|
158
|
+
OPTIMISM: "https://optimism.meowrpc.com",
|
|
159
|
+
FANTOM: "https://fantom.publicnode.com",
|
|
160
|
+
FUSE: "https://rpc.fuse.io",
|
|
161
|
+
FUSESPARK: "https://rpc.fusespark.io",
|
|
162
|
+
MANTA: "https://1rpc.io/manta",
|
|
163
|
+
"MANTA-TESTNET": "https://manta-testnet.calderachain.xyz/http",
|
|
164
|
+
METIS: "https://metis-pokt.nodies.app",
|
|
165
|
+
"METIS-TESTNET": "https://goerli.gateway.metisdevops.link",
|
|
166
|
+
MANTLE: "https://rpc.mantle.xyz",
|
|
167
|
+
"MANTLE-TESTNET": "https://rpc.testnet.mantle.xyz",
|
|
168
|
+
[zkLink]: "https://rpc.zklink.io",
|
|
169
|
+
[zkLinkTestnet]: "https://goerli.rpc.zklink.io",
|
|
170
|
+
[bitlayerTestnet]: "https://testnet-rpc.bitlayer.org",
|
|
171
|
+
};
|
|
172
|
+
export const chainNameToChainId = {
|
|
173
|
+
MUMBAI: 80001,
|
|
174
|
+
POLYGON: 137,
|
|
175
|
+
ETH: 1,
|
|
176
|
+
AVALANCHE: 43114,
|
|
177
|
+
ARBITRUM: 42161,
|
|
178
|
+
BINANCE: 56,
|
|
179
|
+
OPTIMISM: 10,
|
|
180
|
+
FANTOM: 250,
|
|
181
|
+
FUSE: 122,
|
|
182
|
+
FUSESPARK: 123,
|
|
183
|
+
MANTA: 169,
|
|
184
|
+
"MANTA-TESTNET": 3441005,
|
|
185
|
+
METIS: 1088,
|
|
186
|
+
"METIS-TESTNET": 599,
|
|
187
|
+
MANTLE: 5000,
|
|
188
|
+
"MANTLE-TESTNET": 5001,
|
|
189
|
+
[zkLink]: 810180,
|
|
190
|
+
[zkLinkTestnet]: 810182,
|
|
191
|
+
[bitlayerTestnet]: 200810,
|
|
192
|
+
};
|
|
193
|
+
export const chainIdToChainName = {
|
|
194
|
+
80001: "MUMBAI",
|
|
195
|
+
137: "POLYGON",
|
|
196
|
+
1: "ETH",
|
|
197
|
+
43114: "AVALANCHE",
|
|
198
|
+
42161: "ARBITRUM",
|
|
199
|
+
56: "BINANCE",
|
|
200
|
+
10: "OPTIMISM",
|
|
201
|
+
250: "FANTOM",
|
|
202
|
+
122: "FUSE",
|
|
203
|
+
123: "FUSESPARK",
|
|
204
|
+
5000: "MANTLE",
|
|
205
|
+
5001: "MANTLE-TESTNET",
|
|
206
|
+
1088: "METIS",
|
|
207
|
+
599: "METIS-TESTNET",
|
|
208
|
+
169: "MANTA",
|
|
209
|
+
3441005: "MANTA-TESTNET",
|
|
210
|
+
810180: zkLink,
|
|
211
|
+
810182: zkLinkTestnet,
|
|
212
|
+
200810: bitlayerTestnet,
|
|
213
|
+
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tria-sdk/constants",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
9
|
"build": "tsc --project tsconfig.json"
|
package/tsconfig.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
4
|
-
"module": "
|
|
3
|
+
"target": "ES6",
|
|
4
|
+
"module": "ES6", // "CommonJS",
|
|
5
|
+
"lib": ["ES2022"],
|
|
5
6
|
"skipLibCheck": true,
|
|
6
7
|
"strict": true,
|
|
7
8
|
"esModuleInterop": true,
|
|
@@ -12,5 +13,5 @@
|
|
|
12
13
|
"declaration": true
|
|
13
14
|
},
|
|
14
15
|
"include": ["**/*.ts", "**/*.js"],
|
|
15
|
-
"exclude": ["**/*.d.ts"]
|
|
16
|
+
"exclude": ["tests", "**/*.d.ts", "**/extra.ts"]
|
|
16
17
|
}
|