@sign-global/tokentable 0.3.0 → 0.4.0-beta.2

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.
Files changed (148) hide show
  1. package/.github/workflows/beta.yml +28 -0
  2. package/dist/cjs/airdrop/AirdropClient.d.ts +46 -0
  3. package/dist/cjs/airdrop/AirdropClient.js +251 -0
  4. package/dist/cjs/airdrop/AirdropClient.js.map +1 -0
  5. package/dist/cjs/airdrop/SignatureAirdropClient.d.ts +24 -0
  6. package/dist/cjs/airdrop/SignatureAirdropClient.js +109 -0
  7. package/dist/cjs/airdrop/SignatureAirdropClient.js.map +1 -0
  8. package/dist/cjs/airdrop/common/index.d.ts +1 -1
  9. package/dist/cjs/airdrop/constants/index.d.ts +4 -0
  10. package/dist/cjs/airdrop/constants/index.js +5 -1
  11. package/dist/cjs/airdrop/constants/index.js.map +1 -1
  12. package/dist/cjs/airdrop/core/evm/contracts/AirdropSignatureClient.d.ts +15 -0
  13. package/dist/cjs/airdrop/core/evm/contracts/AirdropSignatureClient.js +51 -0
  14. package/dist/cjs/airdrop/core/evm/contracts/AirdropSignatureClient.js.map +1 -0
  15. package/dist/cjs/airdrop/core/evm/contracts/abis/FungibleTokenECDSADistributor.json +564 -0
  16. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/WalletBase.d.ts +32 -0
  17. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/WalletBase.js +71 -0
  18. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/WalletBase.js.map +1 -0
  19. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/WalletFactory.d.ts +8 -0
  20. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/WalletFactory.js +38 -0
  21. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/WalletFactory.js.map +1 -0
  22. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/index.d.ts +2 -0
  23. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/index.js +21 -0
  24. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/index.js.map +1 -0
  25. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/evm/EvmWallet.d.ts +26 -0
  26. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/evm/EvmWallet.js +70 -0
  27. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/evm/EvmWallet.js.map +1 -0
  28. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/evm/index.d.ts +9 -0
  29. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/evm/index.js +35 -0
  30. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/evm/index.js.map +1 -0
  31. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/index.d.ts +3 -0
  32. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/index.js +14 -0
  33. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/index.js.map +1 -0
  34. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/solana/index.d.ts +27 -0
  35. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/solana/index.js +119 -0
  36. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/solana/index.js.map +1 -0
  37. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/ton/TonWallet.d.ts +23 -0
  38. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/ton/TonWallet.js +117 -0
  39. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/ton/TonWallet.js.map +1 -0
  40. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/ton/index.d.ts +9 -0
  41. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/ton/index.js +29 -0
  42. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/ton/index.js.map +1 -0
  43. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/types.d.ts +38 -0
  44. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/types.js +30 -0
  45. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/types.js.map +1 -0
  46. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/utils/index.d.ts +8 -0
  47. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/utils/index.js +41 -0
  48. package/dist/cjs/airdrop/core/useWeb3ConnectWallet/utils/index.js.map +1 -0
  49. package/dist/cjs/airdrop/index.d.ts +4 -46
  50. package/dist/cjs/airdrop/index.js +22 -241
  51. package/dist/cjs/airdrop/index.js.map +1 -1
  52. package/dist/cjs/airdrop/services/index.d.ts +15 -0
  53. package/dist/cjs/airdrop/services/index.js +16 -1
  54. package/dist/cjs/airdrop/services/index.js.map +1 -1
  55. package/dist/cjs/airdrop/types/index.d.ts +19 -4
  56. package/dist/cjs/airdrop/types/index.js +7 -1
  57. package/dist/cjs/airdrop/types/index.js.map +1 -1
  58. package/dist/cjs/index.d.ts +1 -1
  59. package/dist/cjs/index.js +7 -1
  60. package/dist/cjs/index.js.map +1 -1
  61. package/dist/cjs/utils/utils.d.ts +1 -0
  62. package/dist/cjs/utils/utils.js +2 -1
  63. package/dist/cjs/utils/utils.js.map +1 -1
  64. package/dist/esm/airdrop/AirdropClient.d.ts +46 -0
  65. package/dist/esm/airdrop/AirdropClient.js +247 -0
  66. package/dist/esm/airdrop/AirdropClient.js.map +1 -0
  67. package/dist/esm/airdrop/SignatureAirdropClient.d.ts +24 -0
  68. package/dist/esm/airdrop/SignatureAirdropClient.js +105 -0
  69. package/dist/esm/airdrop/SignatureAirdropClient.js.map +1 -0
  70. package/dist/esm/airdrop/common/index.d.ts +1 -1
  71. package/dist/esm/airdrop/constants/index.d.ts +4 -0
  72. package/dist/esm/airdrop/constants/index.js +4 -0
  73. package/dist/esm/airdrop/constants/index.js.map +1 -1
  74. package/dist/esm/airdrop/core/evm/contracts/AirdropSignatureClient.d.ts +15 -0
  75. package/dist/esm/airdrop/core/evm/contracts/AirdropSignatureClient.js +44 -0
  76. package/dist/esm/airdrop/core/evm/contracts/AirdropSignatureClient.js.map +1 -0
  77. package/dist/esm/airdrop/core/evm/contracts/abis/FungibleTokenECDSADistributor.json +564 -0
  78. package/dist/esm/airdrop/core/useWeb3ConnectWallet/WalletBase.d.ts +32 -0
  79. package/dist/esm/airdrop/core/useWeb3ConnectWallet/WalletBase.js +67 -0
  80. package/dist/esm/airdrop/core/useWeb3ConnectWallet/WalletBase.js.map +1 -0
  81. package/dist/esm/airdrop/core/useWeb3ConnectWallet/WalletFactory.d.ts +8 -0
  82. package/dist/esm/airdrop/core/useWeb3ConnectWallet/WalletFactory.js +34 -0
  83. package/dist/esm/airdrop/core/useWeb3ConnectWallet/WalletFactory.js.map +1 -0
  84. package/dist/esm/airdrop/core/useWeb3ConnectWallet/index.d.ts +2 -0
  85. package/dist/esm/airdrop/core/useWeb3ConnectWallet/index.js +3 -0
  86. package/dist/esm/airdrop/core/useWeb3ConnectWallet/index.js.map +1 -0
  87. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/evm/EvmWallet.d.ts +26 -0
  88. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/evm/EvmWallet.js +65 -0
  89. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/evm/EvmWallet.js.map +1 -0
  90. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/evm/index.d.ts +9 -0
  91. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/evm/index.js +29 -0
  92. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/evm/index.js.map +1 -0
  93. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/index.d.ts +3 -0
  94. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/index.js +5 -0
  95. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/index.js.map +1 -0
  96. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/solana/index.d.ts +27 -0
  97. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/solana/index.js +109 -0
  98. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/solana/index.js.map +1 -0
  99. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/ton/TonWallet.d.ts +23 -0
  100. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/ton/TonWallet.js +112 -0
  101. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/ton/TonWallet.js.map +1 -0
  102. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/ton/index.d.ts +9 -0
  103. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/ton/index.js +24 -0
  104. package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/ton/index.js.map +1 -0
  105. package/dist/esm/airdrop/core/useWeb3ConnectWallet/types.d.ts +38 -0
  106. package/dist/esm/airdrop/core/useWeb3ConnectWallet/types.js +27 -0
  107. package/dist/esm/airdrop/core/useWeb3ConnectWallet/types.js.map +1 -0
  108. package/dist/esm/airdrop/core/useWeb3ConnectWallet/utils/index.d.ts +8 -0
  109. package/dist/esm/airdrop/core/useWeb3ConnectWallet/utils/index.js +35 -0
  110. package/dist/esm/airdrop/core/useWeb3ConnectWallet/utils/index.js.map +1 -0
  111. package/dist/esm/airdrop/index.d.ts +4 -46
  112. package/dist/esm/airdrop/index.js +4 -239
  113. package/dist/esm/airdrop/index.js.map +1 -1
  114. package/dist/esm/airdrop/services/index.d.ts +15 -0
  115. package/dist/esm/airdrop/services/index.js +12 -0
  116. package/dist/esm/airdrop/services/index.js.map +1 -1
  117. package/dist/esm/airdrop/types/index.d.ts +19 -4
  118. package/dist/esm/airdrop/types/index.js +6 -0
  119. package/dist/esm/airdrop/types/index.js.map +1 -1
  120. package/dist/esm/index.d.ts +1 -1
  121. package/dist/esm/index.js +1 -1
  122. package/dist/esm/index.js.map +1 -1
  123. package/dist/esm/utils/utils.d.ts +1 -0
  124. package/dist/esm/utils/utils.js +1 -0
  125. package/dist/esm/utils/utils.js.map +1 -1
  126. package/package.json +15 -3
  127. package/src/airdrop/AirdropClient.ts +307 -0
  128. package/src/airdrop/SignatureAirdropClient.ts +120 -0
  129. package/src/airdrop/constants/index.ts +5 -0
  130. package/src/airdrop/core/evm/contracts/AirdropSignatureClient.ts +59 -0
  131. package/src/airdrop/core/evm/contracts/abis/FungibleTokenECDSADistributor.json +564 -0
  132. package/src/airdrop/core/useWeb3ConnectWallet/WalletBase.ts +92 -0
  133. package/src/airdrop/core/useWeb3ConnectWallet/WalletFactory.tsx +35 -0
  134. package/src/airdrop/core/useWeb3ConnectWallet/index.ts +3 -0
  135. package/src/airdrop/core/useWeb3ConnectWallet/providers/evm/EvmWallet.ts +90 -0
  136. package/src/airdrop/core/useWeb3ConnectWallet/providers/evm/index.tsx +43 -0
  137. package/src/airdrop/core/useWeb3ConnectWallet/providers/index.ts +4 -0
  138. package/src/airdrop/core/useWeb3ConnectWallet/providers/solana/index.tsx +141 -0
  139. package/src/airdrop/core/useWeb3ConnectWallet/providers/ton/TonWallet.ts +149 -0
  140. package/src/airdrop/core/useWeb3ConnectWallet/providers/ton/index.tsx +41 -0
  141. package/src/airdrop/core/useWeb3ConnectWallet/types.ts +45 -0
  142. package/src/airdrop/core/useWeb3ConnectWallet/utils/index.ts +61 -0
  143. package/src/airdrop/index.ts +4 -304
  144. package/src/airdrop/services/index.ts +29 -1
  145. package/src/airdrop/types/index.ts +23 -5
  146. package/src/index.ts +9 -1
  147. package/src/utils/utils.ts +2 -0
  148. package/tsconfig.json +2 -2
@@ -0,0 +1,564 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "internalType": "address",
6
+ "name": "target",
7
+ "type": "address"
8
+ }
9
+ ],
10
+ "name": "AddressEmptyCode",
11
+ "type": "error"
12
+ },
13
+ {
14
+ "inputs": [
15
+ {
16
+ "internalType": "address",
17
+ "name": "implementation",
18
+ "type": "address"
19
+ }
20
+ ],
21
+ "name": "ERC1967InvalidImplementation",
22
+ "type": "error"
23
+ },
24
+ {
25
+ "inputs": [],
26
+ "name": "ERC1967NonPayable",
27
+ "type": "error"
28
+ },
29
+ {
30
+ "inputs": [],
31
+ "name": "EnforcedPause",
32
+ "type": "error"
33
+ },
34
+ {
35
+ "inputs": [],
36
+ "name": "ExpectedPause",
37
+ "type": "error"
38
+ },
39
+ {
40
+ "inputs": [],
41
+ "name": "FailedCall",
42
+ "type": "error"
43
+ },
44
+ {
45
+ "inputs": [],
46
+ "name": "IncorrectFees",
47
+ "type": "error"
48
+ },
49
+ {
50
+ "inputs": [],
51
+ "name": "InvalidInitialization",
52
+ "type": "error"
53
+ },
54
+ {
55
+ "inputs": [],
56
+ "name": "InvalidSignature",
57
+ "type": "error"
58
+ },
59
+ {
60
+ "inputs": [],
61
+ "name": "NotInitializing",
62
+ "type": "error"
63
+ },
64
+ {
65
+ "inputs": [],
66
+ "name": "OutsideClaimableTimeRange",
67
+ "type": "error"
68
+ },
69
+ {
70
+ "inputs": [
71
+ {
72
+ "internalType": "address",
73
+ "name": "owner",
74
+ "type": "address"
75
+ }
76
+ ],
77
+ "name": "OwnableInvalidOwner",
78
+ "type": "error"
79
+ },
80
+ {
81
+ "inputs": [
82
+ {
83
+ "internalType": "address",
84
+ "name": "account",
85
+ "type": "address"
86
+ }
87
+ ],
88
+ "name": "OwnableUnauthorizedAccount",
89
+ "type": "error"
90
+ },
91
+ {
92
+ "inputs": [],
93
+ "name": "ReentrancyGuardReentrantCall",
94
+ "type": "error"
95
+ },
96
+ {
97
+ "inputs": [
98
+ {
99
+ "internalType": "address",
100
+ "name": "token",
101
+ "type": "address"
102
+ }
103
+ ],
104
+ "name": "SafeERC20FailedOperation",
105
+ "type": "error"
106
+ },
107
+ {
108
+ "inputs": [],
109
+ "name": "TimeInactive",
110
+ "type": "error"
111
+ },
112
+ {
113
+ "inputs": [],
114
+ "name": "UUPSUnauthorizedCallContext",
115
+ "type": "error"
116
+ },
117
+ {
118
+ "inputs": [
119
+ {
120
+ "internalType": "bytes32",
121
+ "name": "slot",
122
+ "type": "bytes32"
123
+ }
124
+ ],
125
+ "name": "UUPSUnsupportedProxiableUUID",
126
+ "type": "error"
127
+ },
128
+ {
129
+ "inputs": [],
130
+ "name": "UnsupportedOperation",
131
+ "type": "error"
132
+ },
133
+ {
134
+ "anonymous": false,
135
+ "inputs": [
136
+ {
137
+ "indexed": false,
138
+ "internalType": "uint64",
139
+ "name": "version",
140
+ "type": "uint64"
141
+ }
142
+ ],
143
+ "name": "Initialized",
144
+ "type": "event"
145
+ },
146
+ {
147
+ "anonymous": false,
148
+ "inputs": [
149
+ {
150
+ "indexed": true,
151
+ "internalType": "address",
152
+ "name": "previousOwner",
153
+ "type": "address"
154
+ },
155
+ {
156
+ "indexed": true,
157
+ "internalType": "address",
158
+ "name": "newOwner",
159
+ "type": "address"
160
+ }
161
+ ],
162
+ "name": "OwnershipTransferred",
163
+ "type": "event"
164
+ },
165
+ {
166
+ "anonymous": false,
167
+ "inputs": [
168
+ {
169
+ "indexed": false,
170
+ "internalType": "address",
171
+ "name": "account",
172
+ "type": "address"
173
+ }
174
+ ],
175
+ "name": "Paused",
176
+ "type": "event"
177
+ },
178
+ {
179
+ "anonymous": false,
180
+ "inputs": [
181
+ {
182
+ "indexed": false,
183
+ "internalType": "address",
184
+ "name": "account",
185
+ "type": "address"
186
+ }
187
+ ],
188
+ "name": "Unpaused",
189
+ "type": "event"
190
+ },
191
+ {
192
+ "anonymous": false,
193
+ "inputs": [
194
+ {
195
+ "indexed": true,
196
+ "internalType": "address",
197
+ "name": "implementation",
198
+ "type": "address"
199
+ }
200
+ ],
201
+ "name": "Upgraded",
202
+ "type": "event"
203
+ },
204
+ {
205
+ "inputs": [],
206
+ "name": "UPGRADE_INTERFACE_VERSION",
207
+ "outputs": [
208
+ {
209
+ "internalType": "string",
210
+ "name": "",
211
+ "type": "string"
212
+ }
213
+ ],
214
+ "stateMutability": "view",
215
+ "type": "function"
216
+ },
217
+ {
218
+ "inputs": [
219
+ {
220
+ "internalType": "address[]",
221
+ "name": "recipients",
222
+ "type": "address[]"
223
+ },
224
+ {
225
+ "internalType": "bytes32[]",
226
+ "name": "userClaimIds",
227
+ "type": "bytes32[]"
228
+ },
229
+ {
230
+ "internalType": "bytes[]",
231
+ "name": "datas",
232
+ "type": "bytes[]"
233
+ },
234
+ {
235
+ "internalType": "bytes[]",
236
+ "name": "signatures",
237
+ "type": "bytes[]"
238
+ },
239
+ {
240
+ "internalType": "bytes[]",
241
+ "name": "extraDatas",
242
+ "type": "bytes[]"
243
+ }
244
+ ],
245
+ "name": "claim",
246
+ "outputs": [],
247
+ "stateMutability": "payable",
248
+ "type": "function"
249
+ },
250
+ {
251
+ "inputs": [
252
+ {
253
+ "internalType": "bytes",
254
+ "name": "userClaimData",
255
+ "type": "bytes"
256
+ }
257
+ ],
258
+ "name": "decodeUserClaimData",
259
+ "outputs": [
260
+ {
261
+ "components": [
262
+ {
263
+ "internalType": "uint256",
264
+ "name": "claimableTimestamp",
265
+ "type": "uint256"
266
+ },
267
+ {
268
+ "internalType": "uint256",
269
+ "name": "claimableAmount",
270
+ "type": "uint256"
271
+ }
272
+ ],
273
+ "internalType": "struct FungibleTokenECDSADistributorData",
274
+ "name": "",
275
+ "type": "tuple"
276
+ }
277
+ ],
278
+ "stateMutability": "pure",
279
+ "type": "function"
280
+ },
281
+ {
282
+ "inputs": [
283
+ {
284
+ "internalType": "bytes32",
285
+ "name": "userClaimId",
286
+ "type": "bytes32"
287
+ },
288
+ {
289
+ "internalType": "bytes",
290
+ "name": "userClaimData",
291
+ "type": "bytes"
292
+ }
293
+ ],
294
+ "name": "encodeHashToBeSigned",
295
+ "outputs": [
296
+ {
297
+ "internalType": "bytes32",
298
+ "name": "",
299
+ "type": "bytes32"
300
+ }
301
+ ],
302
+ "stateMutability": "view",
303
+ "type": "function"
304
+ },
305
+ {
306
+ "inputs": [
307
+ {
308
+ "internalType": "bytes32[]",
309
+ "name": "userClaimIds",
310
+ "type": "bytes32[]"
311
+ }
312
+ ],
313
+ "name": "getClaimStatus",
314
+ "outputs": [
315
+ {
316
+ "internalType": "bool[]",
317
+ "name": "",
318
+ "type": "bool[]"
319
+ }
320
+ ],
321
+ "stateMutability": "view",
322
+ "type": "function"
323
+ },
324
+ {
325
+ "inputs": [],
326
+ "name": "getStorage",
327
+ "outputs": [
328
+ {
329
+ "internalType": "string",
330
+ "name": "version_",
331
+ "type": "string"
332
+ },
333
+ {
334
+ "internalType": "address",
335
+ "name": "owner",
336
+ "type": "address"
337
+ },
338
+ {
339
+ "internalType": "bool",
340
+ "name": "paused",
341
+ "type": "bool"
342
+ },
343
+ {
344
+ "internalType": "address",
345
+ "name": "deployer",
346
+ "type": "address"
347
+ },
348
+ {
349
+ "internalType": "address",
350
+ "name": "authorizedSigner",
351
+ "type": "address"
352
+ },
353
+ {
354
+ "internalType": "address",
355
+ "name": "token",
356
+ "type": "address"
357
+ },
358
+ {
359
+ "internalType": "address",
360
+ "name": "claimHook",
361
+ "type": "address"
362
+ },
363
+ {
364
+ "internalType": "uint256",
365
+ "name": "startTime",
366
+ "type": "uint256"
367
+ },
368
+ {
369
+ "internalType": "uint256",
370
+ "name": "endTime",
371
+ "type": "uint256"
372
+ }
373
+ ],
374
+ "stateMutability": "view",
375
+ "type": "function"
376
+ },
377
+ {
378
+ "inputs": [
379
+ {
380
+ "internalType": "address",
381
+ "name": "owner_",
382
+ "type": "address"
383
+ }
384
+ ],
385
+ "name": "initialize",
386
+ "outputs": [],
387
+ "stateMutability": "nonpayable",
388
+ "type": "function"
389
+ },
390
+ {
391
+ "inputs": [],
392
+ "name": "owner",
393
+ "outputs": [
394
+ {
395
+ "internalType": "address",
396
+ "name": "",
397
+ "type": "address"
398
+ }
399
+ ],
400
+ "stateMutability": "view",
401
+ "type": "function"
402
+ },
403
+ {
404
+ "inputs": [],
405
+ "name": "paused",
406
+ "outputs": [
407
+ {
408
+ "internalType": "bool",
409
+ "name": "",
410
+ "type": "bool"
411
+ }
412
+ ],
413
+ "stateMutability": "view",
414
+ "type": "function"
415
+ },
416
+ {
417
+ "inputs": [],
418
+ "name": "proxiableUUID",
419
+ "outputs": [
420
+ {
421
+ "internalType": "bytes32",
422
+ "name": "",
423
+ "type": "bytes32"
424
+ }
425
+ ],
426
+ "stateMutability": "view",
427
+ "type": "function"
428
+ },
429
+ {
430
+ "inputs": [],
431
+ "name": "renounceOwnership",
432
+ "outputs": [],
433
+ "stateMutability": "nonpayable",
434
+ "type": "function"
435
+ },
436
+ {
437
+ "inputs": [
438
+ {
439
+ "internalType": "address",
440
+ "name": "token",
441
+ "type": "address"
442
+ },
443
+ {
444
+ "internalType": "uint256",
445
+ "name": "startTime",
446
+ "type": "uint256"
447
+ },
448
+ {
449
+ "internalType": "uint256",
450
+ "name": "endTime",
451
+ "type": "uint256"
452
+ },
453
+ {
454
+ "internalType": "address",
455
+ "name": "authorizedSigner",
456
+ "type": "address"
457
+ }
458
+ ],
459
+ "name": "setBaseParams",
460
+ "outputs": [],
461
+ "stateMutability": "nonpayable",
462
+ "type": "function"
463
+ },
464
+ {
465
+ "inputs": [
466
+ {
467
+ "internalType": "address",
468
+ "name": "hook",
469
+ "type": "address"
470
+ }
471
+ ],
472
+ "name": "setClaimHook",
473
+ "outputs": [],
474
+ "stateMutability": "nonpayable",
475
+ "type": "function"
476
+ },
477
+ {
478
+ "inputs": [],
479
+ "name": "togglePause",
480
+ "outputs": [],
481
+ "stateMutability": "nonpayable",
482
+ "type": "function"
483
+ },
484
+ {
485
+ "inputs": [
486
+ {
487
+ "internalType": "address",
488
+ "name": "newOwner",
489
+ "type": "address"
490
+ }
491
+ ],
492
+ "name": "transferOwnership",
493
+ "outputs": [],
494
+ "stateMutability": "nonpayable",
495
+ "type": "function"
496
+ },
497
+ {
498
+ "inputs": [
499
+ {
500
+ "internalType": "address",
501
+ "name": "newImplementation",
502
+ "type": "address"
503
+ },
504
+ {
505
+ "internalType": "bytes",
506
+ "name": "data",
507
+ "type": "bytes"
508
+ }
509
+ ],
510
+ "name": "upgradeToAndCall",
511
+ "outputs": [],
512
+ "stateMutability": "payable",
513
+ "type": "function"
514
+ },
515
+ {
516
+ "inputs": [
517
+ {
518
+ "internalType": "address",
519
+ "name": "signer",
520
+ "type": "address"
521
+ },
522
+ {
523
+ "internalType": "bytes32",
524
+ "name": "hash",
525
+ "type": "bytes32"
526
+ },
527
+ {
528
+ "internalType": "bytes",
529
+ "name": "signature",
530
+ "type": "bytes"
531
+ }
532
+ ],
533
+ "name": "verify",
534
+ "outputs": [],
535
+ "stateMutability": "view",
536
+ "type": "function"
537
+ },
538
+ {
539
+ "inputs": [],
540
+ "name": "version",
541
+ "outputs": [
542
+ {
543
+ "internalType": "string",
544
+ "name": "",
545
+ "type": "string"
546
+ }
547
+ ],
548
+ "stateMutability": "pure",
549
+ "type": "function"
550
+ },
551
+ {
552
+ "inputs": [
553
+ {
554
+ "internalType": "bytes",
555
+ "name": "",
556
+ "type": "bytes"
557
+ }
558
+ ],
559
+ "name": "withdraw",
560
+ "outputs": [],
561
+ "stateMutability": "nonpayable",
562
+ "type": "function"
563
+ }
564
+ ]
@@ -0,0 +1,32 @@
1
+ import { ISignResult } from './types';
2
+ export declare abstract class WalletBase<S> {
3
+ type: string;
4
+ provider: any;
5
+ address?: string;
6
+ publicKey?: string;
7
+ chainId?: number | string;
8
+ protocolTag?: string;
9
+ authType: string;
10
+ userAddress?: string;
11
+ network?: string;
12
+ constructor(type: string, userAddress?: string);
13
+ protected get isConnected(): boolean;
14
+ abstract connect(_?: string): void;
15
+ abstract sign(_: string, _1?: string): Promise<ISignResult>;
16
+ safeSign(_: string, _1?: string): Promise<ISignResult>;
17
+ signin(statement?: string): Promise<ISignResult>;
18
+ signByEIP712(_: string): Promise<ISignResult>;
19
+ getSignEIP712Message(_: {
20
+ chainId: number | string;
21
+ info: string;
22
+ hash: string;
23
+ }): string;
24
+ getWallet(): {
25
+ address?: string;
26
+ isConnected: boolean;
27
+ publicKey: string | undefined;
28
+ type: string;
29
+ network: string | undefined;
30
+ };
31
+ abstract getStore(): S;
32
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WalletBase = void 0;
4
+ const utils_1 = require("./utils");
5
+ class WalletBase {
6
+ type;
7
+ provider;
8
+ address;
9
+ publicKey;
10
+ chainId;
11
+ protocolTag;
12
+ authType;
13
+ userAddress;
14
+ network;
15
+ constructor(type, userAddress) {
16
+ this.type = type;
17
+ this.provider = null;
18
+ this.address = '';
19
+ this.chainId = 1;
20
+ this.authType = '';
21
+ this.userAddress = userAddress || '';
22
+ // this.init();
23
+ }
24
+ // abstract init(): void;
25
+ // abstract init(): void;
26
+ get isConnected() {
27
+ throw new Error('Not implemented');
28
+ }
29
+ // checkAddressValidity(): boolean {
30
+ // console.log(this.userAddress, this.address);
31
+ // if (!this.address) {
32
+ // // 兼容ton的情况,ton只有sign之后才有地址
33
+ // return true;
34
+ // }
35
+ // if (this.userAddress && this.address !== this.userAddress) {
36
+ // console.error('Wallet address and user address do not match.');
37
+ // globalVm.toggleAccountChangedModal(true);
38
+ // return false;
39
+ // }
40
+ // return true;
41
+ // }
42
+ async safeSign(_, _1) {
43
+ // if (!this.checkAddressValidity()) {
44
+ // throw new Error('Wallet address and user address do not match.');
45
+ // }
46
+ return this.sign(_, _1);
47
+ }
48
+ async signin(statement) {
49
+ const msgRes = (0, utils_1.prepareSignMessage)({ statement, chainId: this.chainId, address: this.address });
50
+ return this.sign(JSON.stringify(msgRes, null, ' '));
51
+ }
52
+ // for metamask sign of EIP-712
53
+ signByEIP712(_) {
54
+ throw new Error(`received message:${_},Method not implemented.`);
55
+ }
56
+ getSignEIP712Message(_) {
57
+ throw new Error(`received message:${JSON.stringify(_)},Method not implemented.`);
58
+ }
59
+ getWallet() {
60
+ // 获取钱包信息
61
+ return {
62
+ type: this.type,
63
+ isConnected: this.isConnected,
64
+ address: this.address,
65
+ publicKey: this.publicKey,
66
+ network: this.network
67
+ };
68
+ }
69
+ }
70
+ exports.WalletBase = WalletBase;
71
+ //# sourceMappingURL=WalletBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WalletBase.js","sourceRoot":"","sources":["../../../../../src/airdrop/core/useWeb3ConnectWallet/WalletBase.ts"],"names":[],"mappings":";;;AACA,mCAA6C;AAE7C,MAAsB,UAAU;IAC9B,IAAI,CAAS;IACb,QAAQ,CAAM;IACd,OAAO,CAAU;IACjB,SAAS,CAAU;IACnB,OAAO,CAAmB;IAC1B,WAAW,CAAU;IACrB,QAAQ,CAAS;IACjB,WAAW,CAAU;IACrB,OAAO,CAAU;IAEjB,YAAY,IAAY,EAAE,WAAoB;QAC5C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,WAAW,IAAI,EAAE,CAAC;QACrC,eAAe;IACjB,CAAC;IAED,yBAAyB;IAEzB,yBAAyB;IACzB,IAAc,WAAW;QACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;IAOD,oCAAoC;IACpC,mDAAmD;IACnD,2BAA2B;IAC3B,sCAAsC;IACtC,uBAAuB;IACvB,QAAQ;IACR,mEAAmE;IACnE,0EAA0E;IAC1E,oDAAoD;IACpD,wBAAwB;IACxB,QAAQ;IACR,mBAAmB;IACnB,IAAI;IAEJ,KAAK,CAAC,QAAQ,CAAC,CAAS,EAAE,EAAW;QACnC,sCAAsC;QACtC,wEAAwE;QACxE,IAAI;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,SAAkB;QAC7B,MAAM,MAAM,GAAG,IAAA,0BAAkB,EAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,OAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,OAAQ,EAAE,CAAC,CAAC;QACjG,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,+BAA+B;IAC/B,YAAY,CAAC,CAAS;QACpB,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,0BAA0B,CAAC,CAAC;IACnE,CAAC;IAED,oBAAoB,CAAC,CAA2D;QAC9E,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC;IACnF,CAAC;IAED,SAAS;QAOP,SAAS;QACT,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;IACJ,CAAC;CAKF;AAxFD,gCAwFC"}
@@ -0,0 +1,8 @@
1
+ import { EvmWallet } from './providers/evm';
2
+ import { ChainType } from './types';
3
+ import { TonWallet } from './providers/ton';
4
+ import { SolWallet } from './providers/solana';
5
+ export declare abstract class WalletFactory {
6
+ private static instances;
7
+ static getWallet(type: ChainType, userAddress?: string): EvmWallet | TonWallet | SolWallet;
8
+ }