@sign-global/tokentable-core 1.12.0 → 1.13.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/CHANGELOG.md +6 -0
- package/dist/index.d.mts +863 -895
- package/dist/index.d.ts +863 -895
- package/dist/index.js +45 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/constants/chain-config.ts +42 -27
- package/src/services/airdrop/index.ts +9 -3
- package/src/utils/biz.ts +2 -2
- package/src/utils/utils.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sign-global/tokentable-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@tonconnect/sdk": "^3.0.6",
|
|
21
|
-
"viem": "^2.
|
|
21
|
+
"viem": "^2.39.3",
|
|
22
22
|
"@coral-xyz/anchor": "^0.30.1",
|
|
23
23
|
"@solana/spl-token": "^0.4.12",
|
|
24
24
|
"@solana/wallet-adapter-base": "^0.9.26",
|
|
@@ -13,7 +13,9 @@ import {
|
|
|
13
13
|
arbitrum,
|
|
14
14
|
sonic,
|
|
15
15
|
xLayer,
|
|
16
|
-
megaethTestnet
|
|
16
|
+
megaethTestnet,
|
|
17
|
+
monadTestnet,
|
|
18
|
+
monad
|
|
17
19
|
} from 'viem/chains';
|
|
18
20
|
import {
|
|
19
21
|
aptosTestNet,
|
|
@@ -29,7 +31,35 @@ import {
|
|
|
29
31
|
} from './network';
|
|
30
32
|
import { CHAIN } from '@tonconnect/sdk';
|
|
31
33
|
|
|
32
|
-
export const
|
|
34
|
+
export const SupportedChains = [
|
|
35
|
+
mainnet,
|
|
36
|
+
bsc,
|
|
37
|
+
base,
|
|
38
|
+
cyber,
|
|
39
|
+
zetachain,
|
|
40
|
+
arbitrum,
|
|
41
|
+
monad,
|
|
42
|
+
tonTestNet,
|
|
43
|
+
tonMainNet,
|
|
44
|
+
signBrBTestnet,
|
|
45
|
+
sonic,
|
|
46
|
+
xLayer,
|
|
47
|
+
hyperEVM,
|
|
48
|
+
sepolia,
|
|
49
|
+
baseSepolia,
|
|
50
|
+
zetachainAthensTestnet,
|
|
51
|
+
berachainTestnet,
|
|
52
|
+
polygonMumbai,
|
|
53
|
+
polygonAmoy,
|
|
54
|
+
mevmDevNet,
|
|
55
|
+
megaethTestnet,
|
|
56
|
+
monadTestnet
|
|
57
|
+
] as const;
|
|
58
|
+
|
|
59
|
+
export type SupportedChainIds = (typeof SupportedChains)[number]['id'];
|
|
60
|
+
type ChainConfigItem = { contractAddress: string; rpcUrl: string } & Record<string, unknown>;
|
|
61
|
+
|
|
62
|
+
export const ChainConfig: Record<SupportedChainIds, ChainConfigItem> = {
|
|
33
63
|
[mainnet.id]: {
|
|
34
64
|
contractAddress: '0x0993Dd5384BcD116A3543889BC6ffA6C98948631',
|
|
35
65
|
rpcUrl: 'https://eth-mainnet.g.alchemy.com/v2/udrqNPSB6i5n5L6QSM31Ng72h_hFOrVT'
|
|
@@ -42,13 +72,17 @@ export const ChainConfig = {
|
|
|
42
72
|
contractAddress: '0x3d1abcD56d53f7C8b04A753C6AF397903DC0f0F2',
|
|
43
73
|
rpcUrl: 'https://base-mainnet.g.alchemy.com/v2/udrqNPSB6i5n5L6QSM31Ng72h_hFOrVT'
|
|
44
74
|
},
|
|
75
|
+
[monad.id]: {
|
|
76
|
+
contractAddress: '',
|
|
77
|
+
rpcUrl: monad.rpcUrls.default.http[0]
|
|
78
|
+
},
|
|
45
79
|
[cyber.id]: {
|
|
46
80
|
contractAddress: '0x7915dA247674E430b2a4Dcf01e4471f709428Bc0',
|
|
47
81
|
rpcUrl: cyber.rpcUrls.default.http[0]
|
|
48
82
|
},
|
|
49
83
|
[sepolia.id]: {
|
|
50
84
|
contractAddress: '0xf3f5243B35376c6dea04169983A8c853c8BE6d69',
|
|
51
|
-
rpcUrl: 'https://eth-sepolia.
|
|
85
|
+
rpcUrl: 'https://eth-sepolia.g.alchemy.com/v2/1tmk0FrhwTJHXh0XIyae7_SXw1lDCjgs'
|
|
52
86
|
},
|
|
53
87
|
[baseSepolia.id]: {
|
|
54
88
|
contractAddress: '0x66c9fe5c76672B06Bf497eFfdaAfDf897D1e68d8',
|
|
@@ -74,6 +108,10 @@ export const ChainConfig = {
|
|
|
74
108
|
contractAddress: '0xa6A2d42E16a690E03bDe181319fDD085880F2605',
|
|
75
109
|
rpcUrl: megaethTestnet.rpcUrls.default.http[0]
|
|
76
110
|
},
|
|
111
|
+
[monadTestnet.id]: {
|
|
112
|
+
contractAddress: '0xa6A2d42E16a690E03bDe181319fDD085880F2605',
|
|
113
|
+
rpcUrl: monadTestnet.rpcUrls.default.http[0]
|
|
114
|
+
},
|
|
77
115
|
[berachainTestnet.id]: {
|
|
78
116
|
contractAddress: '',
|
|
79
117
|
rpcUrl: '',
|
|
@@ -102,7 +140,7 @@ export const ChainConfig = {
|
|
|
102
140
|
rpcUrl: sonic.rpcUrls.default.http[0]
|
|
103
141
|
},
|
|
104
142
|
[xLayer.id]: {
|
|
105
|
-
contractAddress: '
|
|
143
|
+
contractAddress: '0xa6a2d42e16a690e03bde181319fdd085880f2605',
|
|
106
144
|
rpcUrl: 'https://xlayerrpc.okx.com'
|
|
107
145
|
},
|
|
108
146
|
[CHAIN.TESTNET]: {
|
|
@@ -140,26 +178,3 @@ export const ChainConfig = {
|
|
|
140
178
|
rpcUrl: aptosTestNet.rpcUrls.default.http[0]
|
|
141
179
|
}
|
|
142
180
|
};
|
|
143
|
-
|
|
144
|
-
export const SupportedChains = [
|
|
145
|
-
mainnet,
|
|
146
|
-
bsc,
|
|
147
|
-
base,
|
|
148
|
-
cyber,
|
|
149
|
-
zetachain,
|
|
150
|
-
arbitrum,
|
|
151
|
-
tonTestNet,
|
|
152
|
-
tonMainNet,
|
|
153
|
-
signBrBTestnet,
|
|
154
|
-
sonic,
|
|
155
|
-
xLayer,
|
|
156
|
-
hyperEVM,
|
|
157
|
-
sepolia,
|
|
158
|
-
baseSepolia,
|
|
159
|
-
zetachainAthensTestnet,
|
|
160
|
-
berachainTestnet,
|
|
161
|
-
polygonMumbai,
|
|
162
|
-
polygonAmoy,
|
|
163
|
-
mevmDevNet,
|
|
164
|
-
megaethTestnet
|
|
165
|
-
];
|
|
@@ -96,9 +96,15 @@ interface WalletBindParams {
|
|
|
96
96
|
encodedMessage?: string;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
const getSidHeader = (projectId: string) =>
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
const getSidHeader = (projectId: string) => {
|
|
100
|
+
if (typeof window === 'undefined') {
|
|
101
|
+
throw new Error('getSidHeader must be called in a browser environment');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return {
|
|
105
|
+
sid: window.localStorage.getItem(`sid_${projectId}`) || ''
|
|
106
|
+
};
|
|
107
|
+
};
|
|
102
108
|
|
|
103
109
|
export const connectTwitter = async (data: SocialConnectParams, baseURL?: string): Promise<SidResponse> => {
|
|
104
110
|
const client = createApiClient(baseURL);
|
package/src/utils/biz.ts
CHANGED
|
@@ -20,7 +20,7 @@ export const batchCheckClaimedForSignature = async ({
|
|
|
20
20
|
const service = new EvmSignatureAirdropService({
|
|
21
21
|
chainId: chainId as any,
|
|
22
22
|
contractAddress: contractAddress,
|
|
23
|
-
chainRpc: chainRpc || getChainRpc(chainId)
|
|
23
|
+
chainRpc: chainRpc || getChainRpc(chainId as any)
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
try {
|
|
@@ -44,7 +44,7 @@ export const getAvailableClaimAmountForSignature = async ({
|
|
|
44
44
|
const service = new EvmSignatureAirdropService({
|
|
45
45
|
chainId: chainId as any,
|
|
46
46
|
contractAddress: contractAddress,
|
|
47
|
-
chainRpc: getChainRpc(chainId)
|
|
47
|
+
chainRpc: getChainRpc(chainId as any)
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
const claimIds = claims.map((claim) => claim.claimId);
|
package/src/utils/utils.ts
CHANGED
|
@@ -41,6 +41,9 @@ export async function retry<T>(fn: () => Promise<T>, options: { retries: number;
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export const isMobile = () => {
|
|
44
|
+
if (typeof window === 'undefined') {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
44
47
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
45
48
|
};
|
|
46
49
|
|