@sign-global/tokentable-core 1.12.0 → 1.14.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sign-global/tokentable-core",
3
- "version": "1.12.0",
3
+ "version": "1.14.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.38.0",
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,11 @@ import {
13
13
  arbitrum,
14
14
  sonic,
15
15
  xLayer,
16
- megaethTestnet
16
+ megaethTestnet,
17
+ monadTestnet,
18
+ monad,
19
+ memecore,
20
+ cronos
17
21
  } from 'viem/chains';
18
22
  import {
19
23
  aptosTestNet,
@@ -29,7 +33,37 @@ import {
29
33
  } from './network';
30
34
  import { CHAIN } from '@tonconnect/sdk';
31
35
 
32
- export const ChainConfig = {
36
+ export const SupportedChains = [
37
+ mainnet,
38
+ bsc,
39
+ base,
40
+ cyber,
41
+ zetachain,
42
+ arbitrum,
43
+ monad,
44
+ cronos,
45
+ memecore,
46
+ tonTestNet,
47
+ tonMainNet,
48
+ signBrBTestnet,
49
+ sonic,
50
+ xLayer,
51
+ hyperEVM,
52
+ sepolia,
53
+ baseSepolia,
54
+ zetachainAthensTestnet,
55
+ berachainTestnet,
56
+ polygonMumbai,
57
+ polygonAmoy,
58
+ mevmDevNet,
59
+ megaethTestnet,
60
+ monadTestnet
61
+ ] as const;
62
+
63
+ export type SupportedChainIds = (typeof SupportedChains)[number]['id'];
64
+ type ChainConfigItem = { contractAddress: string; rpcUrl: string } & Record<string, unknown>;
65
+
66
+ export const ChainConfig: Record<SupportedChainIds, ChainConfigItem> = {
33
67
  [mainnet.id]: {
34
68
  contractAddress: '0x0993Dd5384BcD116A3543889BC6ffA6C98948631',
35
69
  rpcUrl: 'https://eth-mainnet.g.alchemy.com/v2/udrqNPSB6i5n5L6QSM31Ng72h_hFOrVT'
@@ -42,13 +76,25 @@ export const ChainConfig = {
42
76
  contractAddress: '0x3d1abcD56d53f7C8b04A753C6AF397903DC0f0F2',
43
77
  rpcUrl: 'https://base-mainnet.g.alchemy.com/v2/udrqNPSB6i5n5L6QSM31Ng72h_hFOrVT'
44
78
  },
79
+ [monad.id]: {
80
+ contractAddress: '0xa6A2d42E16a690E03bDe181319fDD085880F2605',
81
+ rpcUrl: monad.rpcUrls.default.http[0]
82
+ },
83
+ [cronos.id]: {
84
+ contractAddress: '0xa6A2d42E16a690E03bDe181319fDD085880F2605',
85
+ rpcUrl: cronos.rpcUrls.default.http[0]
86
+ },
87
+ [memecore.id]: {
88
+ contractAddress: '0xa6A2d42E16a690E03bDe181319fDD085880F2605',
89
+ rpcUrl: memecore.rpcUrls.default.http[0]
90
+ },
45
91
  [cyber.id]: {
46
92
  contractAddress: '0x7915dA247674E430b2a4Dcf01e4471f709428Bc0',
47
93
  rpcUrl: cyber.rpcUrls.default.http[0]
48
94
  },
49
95
  [sepolia.id]: {
50
96
  contractAddress: '0xf3f5243B35376c6dea04169983A8c853c8BE6d69',
51
- rpcUrl: 'https://eth-sepolia.public.blastapi.io'
97
+ rpcUrl: 'https://eth-sepolia.g.alchemy.com/v2/1tmk0FrhwTJHXh0XIyae7_SXw1lDCjgs'
52
98
  },
53
99
  [baseSepolia.id]: {
54
100
  contractAddress: '0x66c9fe5c76672B06Bf497eFfdaAfDf897D1e68d8',
@@ -74,6 +120,10 @@ export const ChainConfig = {
74
120
  contractAddress: '0xa6A2d42E16a690E03bDe181319fDD085880F2605',
75
121
  rpcUrl: megaethTestnet.rpcUrls.default.http[0]
76
122
  },
123
+ [monadTestnet.id]: {
124
+ contractAddress: '0xa6A2d42E16a690E03bDe181319fDD085880F2605',
125
+ rpcUrl: monadTestnet.rpcUrls.default.http[0]
126
+ },
77
127
  [berachainTestnet.id]: {
78
128
  contractAddress: '',
79
129
  rpcUrl: '',
@@ -102,7 +152,7 @@ export const ChainConfig = {
102
152
  rpcUrl: sonic.rpcUrls.default.http[0]
103
153
  },
104
154
  [xLayer.id]: {
105
- contractAddress: '0x231F598D8B82E2435b11e78960FE4d84F8d63E2C',
155
+ contractAddress: '0xa6a2d42e16a690e03bde181319fdd085880f2605',
106
156
  rpcUrl: 'https://xlayerrpc.okx.com'
107
157
  },
108
158
  [CHAIN.TESTNET]: {
@@ -140,26 +190,3 @@ export const ChainConfig = {
140
190
  rpcUrl: aptosTestNet.rpcUrls.default.http[0]
141
191
  }
142
192
  };
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
- sid: window.localStorage.getItem(`sid_${projectId}`) || ''
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);
@@ -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