@multiversx/sdk-dapp-liquidity 1.1.7 → 2.0.0-alpha.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.
Files changed (81) hide show
  1. package/index.js +7 -0
  2. package/index.mjs +8 -1
  3. package/package.json +19 -16
  4. package/reactjs/adapters/SuiAdapter.d.ts +60 -0
  5. package/reactjs/adapters/SuiAdapter.js +350 -0
  6. package/reactjs/adapters/SuiAdapter.mjs +349 -0
  7. package/reactjs/components/AmountInput/AmountInput.js +1 -1
  8. package/reactjs/components/AmountInput/AmountInput.mjs +1 -1
  9. package/reactjs/components/BridgeForm/Deposit.js +57 -18
  10. package/reactjs/components/BridgeForm/Deposit.mjs +57 -18
  11. package/reactjs/components/BridgeForm/Transfer.js +17 -10
  12. package/reactjs/components/BridgeForm/Transfer.mjs +17 -10
  13. package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.js +31 -9
  14. package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.mjs +31 -9
  15. package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.d.ts +6 -0
  16. package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.js +18 -0
  17. package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.mjs +18 -0
  18. package/reactjs/components/BridgeHistory/BridgeHistory.js +2 -2
  19. package/reactjs/components/BridgeHistory/BridgeHistory.mjs +2 -2
  20. package/reactjs/components/Connect/BridgeAccountDisplay.js +77 -25
  21. package/reactjs/components/Connect/BridgeAccountDisplay.mjs +77 -25
  22. package/reactjs/components/Connect/BridgeConnectButton.js +1 -1
  23. package/reactjs/components/Connect/BridgeConnectButton.mjs +1 -1
  24. package/reactjs/components/Connect/ChainSelectConnect.d.ts +7 -0
  25. package/reactjs/components/Connect/ChainSelectConnect.js +144 -0
  26. package/reactjs/components/Connect/ChainSelectConnect.mjs +143 -0
  27. package/reactjs/components/Connect/MvxAccountDisplay.js +17 -3
  28. package/reactjs/components/Connect/MvxAccountDisplay.mjs +17 -3
  29. package/reactjs/components/Connect/MvxConnectButton.js +2 -2
  30. package/reactjs/components/Connect/MvxConnectButton.mjs +2 -2
  31. package/reactjs/components/Connect/index.d.ts +1 -0
  32. package/reactjs/components/Connect/index.js +2 -0
  33. package/reactjs/components/Connect/index.mjs +2 -0
  34. package/reactjs/components/TokenSelector/components/TokenItem.js +11 -1
  35. package/reactjs/components/TokenSelector/components/TokenItem.mjs +11 -1
  36. package/reactjs/components/TrimAddress/TrimAddress.js +1 -1
  37. package/reactjs/components/TrimAddress/TrimAddress.mjs +1 -1
  38. package/reactjs/components/index.js +2 -0
  39. package/reactjs/components/index.mjs +2 -0
  40. package/reactjs/constants/chains.d.ts +7 -1
  41. package/reactjs/constants/chains.js +6 -0
  42. package/reactjs/constants/chains.mjs +6 -0
  43. package/reactjs/helpers/index.d.ts +1 -0
  44. package/reactjs/helpers/index.js +7 -0
  45. package/reactjs/helpers/index.mjs +6 -0
  46. package/reactjs/helpers/resolveBridgeApiChainId.d.ts +18 -0
  47. package/reactjs/helpers/resolveBridgeApiChainId.js +41 -0
  48. package/reactjs/helpers/resolveBridgeApiChainId.mjs +40 -0
  49. package/reactjs/hooks/index.d.ts +2 -0
  50. package/reactjs/hooks/index.js +4 -0
  51. package/reactjs/hooks/index.mjs +4 -0
  52. package/reactjs/hooks/useBridgeApiChainId.d.ts +2 -0
  53. package/reactjs/hooks/useBridgeApiChainId.js +14 -0
  54. package/reactjs/hooks/useBridgeApiChainId.mjs +13 -0
  55. package/reactjs/hooks/useFetchTokens.js +17 -17
  56. package/reactjs/hooks/useFetchTokens.mjs +17 -17
  57. package/reactjs/hooks/useGenericSignMessage.d.ts +1 -1
  58. package/reactjs/hooks/useGenericSignMessage.js +14 -0
  59. package/reactjs/hooks/useGenericSignMessage.mjs +14 -0
  60. package/reactjs/hooks/useSignTransaction.d.ts +418 -3
  61. package/reactjs/hooks/useSignTransaction.js +28 -0
  62. package/reactjs/hooks/useSignTransaction.mjs +28 -0
  63. package/reactjs/hooks/useSuiConnect.d.ts +8 -0
  64. package/reactjs/hooks/useSuiConnect.js +87 -0
  65. package/reactjs/hooks/useSuiConnect.mjs +86 -0
  66. package/reactjs/index.js +7 -0
  67. package/reactjs/index.mjs +8 -1
  68. package/reactjs/init/index.js +1 -0
  69. package/reactjs/init/index.mjs +2 -1
  70. package/reactjs/init/init.d.ts +9 -30
  71. package/reactjs/init/init.js +90 -9
  72. package/reactjs/init/init.mjs +91 -10
  73. package/reactjs/queries/useCheckAccount.query.js +4 -14
  74. package/reactjs/queries/useCheckAccount.query.mjs +4 -14
  75. package/reactjs/queries/useGetNonMvxTokensBalances.query.js +1 -0
  76. package/reactjs/queries/useGetNonMvxTokensBalances.query.mjs +1 -0
  77. package/style.css +51 -0
  78. package/types/chainType.d.ts +2 -1
  79. package/types/chainType.js +1 -0
  80. package/types/chainType.mjs +1 -0
  81. package/types/transaction.d.ts +5 -0
@@ -17,6 +17,8 @@ export declare const useSignTransaction: () => {
17
17
  failureReason: import('@wagmi/core').SendTransactionErrorType | null;
18
18
  isPaused: boolean;
19
19
  submittedAt: number;
20
+ mutate: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
21
+ mutateAsync: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
20
22
  sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
21
23
  hash: `0x${string}` | undefined;
22
24
  signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
@@ -25,7 +27,139 @@ export declare const useSignTransaction: () => {
25
27
  status: "pending";
26
28
  reset: () => void;
27
29
  context: unknown;
28
- variables: import('wagmi/query').SendTransactionVariables<import('wagmi').Config, number>;
30
+ variables: {
31
+ gasPrice?: bigint | undefined;
32
+ maxFeePerBlobGas?: undefined | undefined;
33
+ maxFeePerGas?: undefined | undefined;
34
+ maxPriorityFeePerGas?: undefined | undefined;
35
+ type?: "legacy" | undefined;
36
+ nonce?: number | undefined;
37
+ to?: `0x${string}` | null | undefined;
38
+ value?: bigint | undefined;
39
+ accessList?: undefined;
40
+ authorizationList?: undefined;
41
+ blobVersionedHashes?: undefined;
42
+ data?: `0x${string}` | undefined;
43
+ blobs?: undefined;
44
+ kzg?: undefined;
45
+ sidecars?: undefined;
46
+ account?: `0x${string}` | import('viem').Account | null | undefined;
47
+ dataSuffix?: `0x${string}` | undefined;
48
+ assertChainId?: boolean | undefined | undefined;
49
+ chainId?: number | undefined;
50
+ connector?: import('wagmi').Connector | undefined;
51
+ gas?: bigint | null | undefined;
52
+ } | {
53
+ gasPrice?: bigint | undefined;
54
+ maxFeePerBlobGas?: undefined | undefined;
55
+ maxFeePerGas?: undefined | undefined;
56
+ maxPriorityFeePerGas?: undefined | undefined;
57
+ type?: "eip2930" | undefined;
58
+ nonce?: number | undefined;
59
+ to?: `0x${string}` | null | undefined;
60
+ value?: bigint | undefined;
61
+ accessList?: import('viem').AccessList | undefined;
62
+ authorizationList?: undefined;
63
+ blobVersionedHashes?: undefined;
64
+ data?: `0x${string}` | undefined;
65
+ blobs?: undefined;
66
+ kzg?: undefined;
67
+ sidecars?: undefined;
68
+ account?: `0x${string}` | import('viem').Account | null | undefined;
69
+ dataSuffix?: `0x${string}` | undefined;
70
+ assertChainId?: boolean | undefined | undefined;
71
+ chainId?: number | undefined;
72
+ connector?: import('wagmi').Connector | undefined;
73
+ gas?: bigint | null | undefined;
74
+ } | {
75
+ gasPrice?: undefined | undefined;
76
+ maxFeePerBlobGas?: undefined | undefined;
77
+ maxFeePerGas?: bigint | undefined;
78
+ maxPriorityFeePerGas?: bigint | undefined;
79
+ type?: "eip1559" | undefined;
80
+ nonce?: number | undefined;
81
+ to?: `0x${string}` | null | undefined;
82
+ value?: bigint | undefined;
83
+ accessList?: import('viem').AccessList | undefined;
84
+ authorizationList?: undefined;
85
+ blobVersionedHashes?: undefined;
86
+ data?: `0x${string}` | undefined;
87
+ blobs?: undefined;
88
+ kzg?: undefined;
89
+ sidecars?: undefined;
90
+ account?: `0x${string}` | import('viem').Account | null | undefined;
91
+ dataSuffix?: `0x${string}` | undefined;
92
+ assertChainId?: boolean | undefined | undefined;
93
+ chainId?: number | undefined;
94
+ connector?: import('wagmi').Connector | undefined;
95
+ gas?: bigint | null | undefined;
96
+ } | {
97
+ gasPrice?: undefined | undefined;
98
+ maxFeePerBlobGas?: bigint | undefined;
99
+ maxFeePerGas?: bigint | undefined;
100
+ maxPriorityFeePerGas?: bigint | undefined;
101
+ type?: "eip4844" | undefined;
102
+ nonce?: number | undefined;
103
+ to: `0x${string}` | null;
104
+ value?: bigint | undefined;
105
+ accessList?: import('viem').AccessList | undefined;
106
+ authorizationList?: undefined;
107
+ blobVersionedHashes: readonly import('viem').Hex[];
108
+ data?: `0x${string}` | undefined;
109
+ blobs?: readonly `0x${string}`[] | readonly import('viem').ByteArray[] | undefined;
110
+ kzg?: undefined;
111
+ sidecars?: readonly import('viem').BlobSidecar<`0x${string}`>[] | undefined;
112
+ account?: `0x${string}` | import('viem').Account | null | undefined;
113
+ dataSuffix?: `0x${string}` | undefined;
114
+ assertChainId?: boolean | undefined | undefined;
115
+ chainId?: number | undefined;
116
+ connector?: import('wagmi').Connector | undefined;
117
+ gas?: bigint | null | undefined;
118
+ } | {
119
+ gasPrice?: undefined | undefined;
120
+ maxFeePerBlobGas?: bigint | undefined;
121
+ maxFeePerGas?: bigint | undefined;
122
+ maxPriorityFeePerGas?: bigint | undefined;
123
+ type?: "eip4844" | undefined;
124
+ nonce?: number | undefined;
125
+ to: `0x${string}` | null;
126
+ value?: bigint | undefined;
127
+ accessList?: import('viem').AccessList | undefined;
128
+ authorizationList?: undefined;
129
+ blobVersionedHashes?: readonly `0x${string}`[] | undefined;
130
+ data?: `0x${string}` | undefined;
131
+ blobs: readonly import('viem').Hex[] | readonly import('viem').ByteArray[];
132
+ kzg?: import('viem').Kzg | undefined;
133
+ sidecars?: readonly import('viem').BlobSidecar<`0x${string}`>[] | undefined;
134
+ account?: `0x${string}` | import('viem').Account | null | undefined;
135
+ dataSuffix?: `0x${string}` | undefined;
136
+ assertChainId?: boolean | undefined | undefined;
137
+ chainId?: number | undefined;
138
+ connector?: import('wagmi').Connector | undefined;
139
+ gas?: bigint | null | undefined;
140
+ } | {
141
+ gasPrice?: undefined | undefined;
142
+ maxFeePerBlobGas?: undefined | undefined;
143
+ maxFeePerGas?: bigint | undefined;
144
+ maxPriorityFeePerGas?: bigint | undefined;
145
+ type?: "eip7702" | undefined;
146
+ nonce?: number | undefined;
147
+ to?: `0x${string}` | null | undefined;
148
+ value?: bigint | undefined;
149
+ accessList?: import('viem').AccessList | undefined;
150
+ authorizationList?: import('viem').AuthorizationList<number, boolean> | undefined;
151
+ blobVersionedHashes?: undefined;
152
+ data?: `0x${string}` | undefined;
153
+ blobs?: undefined;
154
+ kzg?: undefined;
155
+ sidecars?: undefined;
156
+ account?: `0x${string}` | import('viem').Account | null | undefined;
157
+ dataSuffix?: `0x${string}` | undefined;
158
+ assertChainId?: boolean | undefined | undefined;
159
+ chainId?: number | undefined;
160
+ connector?: import('wagmi').Connector | undefined;
161
+ gas?: bigint | null | undefined;
162
+ };
29
163
  isError: false;
30
164
  isIdle: false;
31
165
  isPending: true;
@@ -34,6 +168,8 @@ export declare const useSignTransaction: () => {
34
168
  failureReason: import('@wagmi/core').SendTransactionErrorType | null;
35
169
  isPaused: boolean;
36
170
  submittedAt: number;
171
+ mutate: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
172
+ mutateAsync: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
37
173
  sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
38
174
  hash: `0x${string}` | undefined;
39
175
  signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
@@ -42,7 +178,139 @@ export declare const useSignTransaction: () => {
42
178
  status: "error";
43
179
  reset: () => void;
44
180
  context: unknown;
45
- variables: import('wagmi/query').SendTransactionVariables<import('wagmi').Config, number>;
181
+ variables: {
182
+ gasPrice?: bigint | undefined;
183
+ maxFeePerBlobGas?: undefined | undefined;
184
+ maxFeePerGas?: undefined | undefined;
185
+ maxPriorityFeePerGas?: undefined | undefined;
186
+ type?: "legacy" | undefined;
187
+ nonce?: number | undefined;
188
+ to?: `0x${string}` | null | undefined;
189
+ value?: bigint | undefined;
190
+ accessList?: undefined;
191
+ authorizationList?: undefined;
192
+ blobVersionedHashes?: undefined;
193
+ data?: `0x${string}` | undefined;
194
+ blobs?: undefined;
195
+ kzg?: undefined;
196
+ sidecars?: undefined;
197
+ account?: `0x${string}` | import('viem').Account | null | undefined;
198
+ dataSuffix?: `0x${string}` | undefined;
199
+ assertChainId?: boolean | undefined | undefined;
200
+ chainId?: number | undefined;
201
+ connector?: import('wagmi').Connector | undefined;
202
+ gas?: bigint | null | undefined;
203
+ } | {
204
+ gasPrice?: bigint | undefined;
205
+ maxFeePerBlobGas?: undefined | undefined;
206
+ maxFeePerGas?: undefined | undefined;
207
+ maxPriorityFeePerGas?: undefined | undefined;
208
+ type?: "eip2930" | undefined;
209
+ nonce?: number | undefined;
210
+ to?: `0x${string}` | null | undefined;
211
+ value?: bigint | undefined;
212
+ accessList?: import('viem').AccessList | undefined;
213
+ authorizationList?: undefined;
214
+ blobVersionedHashes?: undefined;
215
+ data?: `0x${string}` | undefined;
216
+ blobs?: undefined;
217
+ kzg?: undefined;
218
+ sidecars?: undefined;
219
+ account?: `0x${string}` | import('viem').Account | null | undefined;
220
+ dataSuffix?: `0x${string}` | undefined;
221
+ assertChainId?: boolean | undefined | undefined;
222
+ chainId?: number | undefined;
223
+ connector?: import('wagmi').Connector | undefined;
224
+ gas?: bigint | null | undefined;
225
+ } | {
226
+ gasPrice?: undefined | undefined;
227
+ maxFeePerBlobGas?: undefined | undefined;
228
+ maxFeePerGas?: bigint | undefined;
229
+ maxPriorityFeePerGas?: bigint | undefined;
230
+ type?: "eip1559" | undefined;
231
+ nonce?: number | undefined;
232
+ to?: `0x${string}` | null | undefined;
233
+ value?: bigint | undefined;
234
+ accessList?: import('viem').AccessList | undefined;
235
+ authorizationList?: undefined;
236
+ blobVersionedHashes?: undefined;
237
+ data?: `0x${string}` | undefined;
238
+ blobs?: undefined;
239
+ kzg?: undefined;
240
+ sidecars?: undefined;
241
+ account?: `0x${string}` | import('viem').Account | null | undefined;
242
+ dataSuffix?: `0x${string}` | undefined;
243
+ assertChainId?: boolean | undefined | undefined;
244
+ chainId?: number | undefined;
245
+ connector?: import('wagmi').Connector | undefined;
246
+ gas?: bigint | null | undefined;
247
+ } | {
248
+ gasPrice?: undefined | undefined;
249
+ maxFeePerBlobGas?: bigint | undefined;
250
+ maxFeePerGas?: bigint | undefined;
251
+ maxPriorityFeePerGas?: bigint | undefined;
252
+ type?: "eip4844" | undefined;
253
+ nonce?: number | undefined;
254
+ to: `0x${string}` | null;
255
+ value?: bigint | undefined;
256
+ accessList?: import('viem').AccessList | undefined;
257
+ authorizationList?: undefined;
258
+ blobVersionedHashes: readonly import('viem').Hex[];
259
+ data?: `0x${string}` | undefined;
260
+ blobs?: readonly `0x${string}`[] | readonly import('viem').ByteArray[] | undefined;
261
+ kzg?: undefined;
262
+ sidecars?: readonly import('viem').BlobSidecar<`0x${string}`>[] | undefined;
263
+ account?: `0x${string}` | import('viem').Account | null | undefined;
264
+ dataSuffix?: `0x${string}` | undefined;
265
+ assertChainId?: boolean | undefined | undefined;
266
+ chainId?: number | undefined;
267
+ connector?: import('wagmi').Connector | undefined;
268
+ gas?: bigint | null | undefined;
269
+ } | {
270
+ gasPrice?: undefined | undefined;
271
+ maxFeePerBlobGas?: bigint | undefined;
272
+ maxFeePerGas?: bigint | undefined;
273
+ maxPriorityFeePerGas?: bigint | undefined;
274
+ type?: "eip4844" | undefined;
275
+ nonce?: number | undefined;
276
+ to: `0x${string}` | null;
277
+ value?: bigint | undefined;
278
+ accessList?: import('viem').AccessList | undefined;
279
+ authorizationList?: undefined;
280
+ blobVersionedHashes?: readonly `0x${string}`[] | undefined;
281
+ data?: `0x${string}` | undefined;
282
+ blobs: readonly import('viem').Hex[] | readonly import('viem').ByteArray[];
283
+ kzg?: import('viem').Kzg | undefined;
284
+ sidecars?: readonly import('viem').BlobSidecar<`0x${string}`>[] | undefined;
285
+ account?: `0x${string}` | import('viem').Account | null | undefined;
286
+ dataSuffix?: `0x${string}` | undefined;
287
+ assertChainId?: boolean | undefined | undefined;
288
+ chainId?: number | undefined;
289
+ connector?: import('wagmi').Connector | undefined;
290
+ gas?: bigint | null | undefined;
291
+ } | {
292
+ gasPrice?: undefined | undefined;
293
+ maxFeePerBlobGas?: undefined | undefined;
294
+ maxFeePerGas?: bigint | undefined;
295
+ maxPriorityFeePerGas?: bigint | undefined;
296
+ type?: "eip7702" | undefined;
297
+ nonce?: number | undefined;
298
+ to?: `0x${string}` | null | undefined;
299
+ value?: bigint | undefined;
300
+ accessList?: import('viem').AccessList | undefined;
301
+ authorizationList?: import('viem').AuthorizationList<number, boolean> | undefined;
302
+ blobVersionedHashes?: undefined;
303
+ data?: `0x${string}` | undefined;
304
+ blobs?: undefined;
305
+ kzg?: undefined;
306
+ sidecars?: undefined;
307
+ account?: `0x${string}` | import('viem').Account | null | undefined;
308
+ dataSuffix?: `0x${string}` | undefined;
309
+ assertChainId?: boolean | undefined | undefined;
310
+ chainId?: number | undefined;
311
+ connector?: import('wagmi').Connector | undefined;
312
+ gas?: bigint | null | undefined;
313
+ };
46
314
  isError: true;
47
315
  isIdle: false;
48
316
  isPending: false;
@@ -51,6 +319,8 @@ export declare const useSignTransaction: () => {
51
319
  failureReason: import('@wagmi/core').SendTransactionErrorType | null;
52
320
  isPaused: boolean;
53
321
  submittedAt: number;
322
+ mutate: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
323
+ mutateAsync: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
54
324
  sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
55
325
  hash: `0x${string}` | undefined;
56
326
  signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
@@ -59,7 +329,139 @@ export declare const useSignTransaction: () => {
59
329
  status: "success";
60
330
  reset: () => void;
61
331
  context: unknown;
62
- variables: import('wagmi/query').SendTransactionVariables<import('wagmi').Config, number>;
332
+ variables: {
333
+ gasPrice?: bigint | undefined;
334
+ maxFeePerBlobGas?: undefined | undefined;
335
+ maxFeePerGas?: undefined | undefined;
336
+ maxPriorityFeePerGas?: undefined | undefined;
337
+ type?: "legacy" | undefined;
338
+ nonce?: number | undefined;
339
+ to?: `0x${string}` | null | undefined;
340
+ value?: bigint | undefined;
341
+ accessList?: undefined;
342
+ authorizationList?: undefined;
343
+ blobVersionedHashes?: undefined;
344
+ data?: `0x${string}` | undefined;
345
+ blobs?: undefined;
346
+ kzg?: undefined;
347
+ sidecars?: undefined;
348
+ account?: `0x${string}` | import('viem').Account | null | undefined;
349
+ dataSuffix?: `0x${string}` | undefined;
350
+ assertChainId?: boolean | undefined | undefined;
351
+ chainId?: number | undefined;
352
+ connector?: import('wagmi').Connector | undefined;
353
+ gas?: bigint | null | undefined;
354
+ } | {
355
+ gasPrice?: bigint | undefined;
356
+ maxFeePerBlobGas?: undefined | undefined;
357
+ maxFeePerGas?: undefined | undefined;
358
+ maxPriorityFeePerGas?: undefined | undefined;
359
+ type?: "eip2930" | undefined;
360
+ nonce?: number | undefined;
361
+ to?: `0x${string}` | null | undefined;
362
+ value?: bigint | undefined;
363
+ accessList?: import('viem').AccessList | undefined;
364
+ authorizationList?: undefined;
365
+ blobVersionedHashes?: undefined;
366
+ data?: `0x${string}` | undefined;
367
+ blobs?: undefined;
368
+ kzg?: undefined;
369
+ sidecars?: undefined;
370
+ account?: `0x${string}` | import('viem').Account | null | undefined;
371
+ dataSuffix?: `0x${string}` | undefined;
372
+ assertChainId?: boolean | undefined | undefined;
373
+ chainId?: number | undefined;
374
+ connector?: import('wagmi').Connector | undefined;
375
+ gas?: bigint | null | undefined;
376
+ } | {
377
+ gasPrice?: undefined | undefined;
378
+ maxFeePerBlobGas?: undefined | undefined;
379
+ maxFeePerGas?: bigint | undefined;
380
+ maxPriorityFeePerGas?: bigint | undefined;
381
+ type?: "eip1559" | undefined;
382
+ nonce?: number | undefined;
383
+ to?: `0x${string}` | null | undefined;
384
+ value?: bigint | undefined;
385
+ accessList?: import('viem').AccessList | undefined;
386
+ authorizationList?: undefined;
387
+ blobVersionedHashes?: undefined;
388
+ data?: `0x${string}` | undefined;
389
+ blobs?: undefined;
390
+ kzg?: undefined;
391
+ sidecars?: undefined;
392
+ account?: `0x${string}` | import('viem').Account | null | undefined;
393
+ dataSuffix?: `0x${string}` | undefined;
394
+ assertChainId?: boolean | undefined | undefined;
395
+ chainId?: number | undefined;
396
+ connector?: import('wagmi').Connector | undefined;
397
+ gas?: bigint | null | undefined;
398
+ } | {
399
+ gasPrice?: undefined | undefined;
400
+ maxFeePerBlobGas?: bigint | undefined;
401
+ maxFeePerGas?: bigint | undefined;
402
+ maxPriorityFeePerGas?: bigint | undefined;
403
+ type?: "eip4844" | undefined;
404
+ nonce?: number | undefined;
405
+ to: `0x${string}` | null;
406
+ value?: bigint | undefined;
407
+ accessList?: import('viem').AccessList | undefined;
408
+ authorizationList?: undefined;
409
+ blobVersionedHashes: readonly import('viem').Hex[];
410
+ data?: `0x${string}` | undefined;
411
+ blobs?: readonly `0x${string}`[] | readonly import('viem').ByteArray[] | undefined;
412
+ kzg?: undefined;
413
+ sidecars?: readonly import('viem').BlobSidecar<`0x${string}`>[] | undefined;
414
+ account?: `0x${string}` | import('viem').Account | null | undefined;
415
+ dataSuffix?: `0x${string}` | undefined;
416
+ assertChainId?: boolean | undefined | undefined;
417
+ chainId?: number | undefined;
418
+ connector?: import('wagmi').Connector | undefined;
419
+ gas?: bigint | null | undefined;
420
+ } | {
421
+ gasPrice?: undefined | undefined;
422
+ maxFeePerBlobGas?: bigint | undefined;
423
+ maxFeePerGas?: bigint | undefined;
424
+ maxPriorityFeePerGas?: bigint | undefined;
425
+ type?: "eip4844" | undefined;
426
+ nonce?: number | undefined;
427
+ to: `0x${string}` | null;
428
+ value?: bigint | undefined;
429
+ accessList?: import('viem').AccessList | undefined;
430
+ authorizationList?: undefined;
431
+ blobVersionedHashes?: readonly `0x${string}`[] | undefined;
432
+ data?: `0x${string}` | undefined;
433
+ blobs: readonly import('viem').Hex[] | readonly import('viem').ByteArray[];
434
+ kzg?: import('viem').Kzg | undefined;
435
+ sidecars?: readonly import('viem').BlobSidecar<`0x${string}`>[] | undefined;
436
+ account?: `0x${string}` | import('viem').Account | null | undefined;
437
+ dataSuffix?: `0x${string}` | undefined;
438
+ assertChainId?: boolean | undefined | undefined;
439
+ chainId?: number | undefined;
440
+ connector?: import('wagmi').Connector | undefined;
441
+ gas?: bigint | null | undefined;
442
+ } | {
443
+ gasPrice?: undefined | undefined;
444
+ maxFeePerBlobGas?: undefined | undefined;
445
+ maxFeePerGas?: bigint | undefined;
446
+ maxPriorityFeePerGas?: bigint | undefined;
447
+ type?: "eip7702" | undefined;
448
+ nonce?: number | undefined;
449
+ to?: `0x${string}` | null | undefined;
450
+ value?: bigint | undefined;
451
+ accessList?: import('viem').AccessList | undefined;
452
+ authorizationList?: import('viem').AuthorizationList<number, boolean> | undefined;
453
+ blobVersionedHashes?: undefined;
454
+ data?: `0x${string}` | undefined;
455
+ blobs?: undefined;
456
+ kzg?: undefined;
457
+ sidecars?: undefined;
458
+ account?: `0x${string}` | import('viem').Account | null | undefined;
459
+ dataSuffix?: `0x${string}` | undefined;
460
+ assertChainId?: boolean | undefined | undefined;
461
+ chainId?: number | undefined;
462
+ connector?: import('wagmi').Connector | undefined;
463
+ gas?: bigint | null | undefined;
464
+ };
63
465
  isError: false;
64
466
  isIdle: false;
65
467
  isPending: false;
@@ -68,6 +470,8 @@ export declare const useSignTransaction: () => {
68
470
  failureReason: import('@wagmi/core').SendTransactionErrorType | null;
69
471
  isPaused: boolean;
70
472
  submittedAt: number;
473
+ mutate: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
474
+ mutateAsync: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
71
475
  sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
72
476
  hash: `0x${string}` | undefined;
73
477
  signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
@@ -93,4 +497,15 @@ export declare const useSignTransaction: () => {
93
497
  }) => Promise<string>;
94
498
  walletProvider: BitcoinConnector;
95
499
  };
500
+ sui: {
501
+ signTransaction: (suiParams?: {
502
+ /** Base64 BCS transaction bytes (Reown / WalletConnect `sui_signAndExecuteTransaction`). */
503
+ transaction?: string;
504
+ /** @deprecated use `transaction` — same bytes, older name */
505
+ transactionBlock?: string;
506
+ address: string;
507
+ options?: Record<string, unknown>;
508
+ }) => Promise<any>;
509
+ walletProvider: any;
510
+ };
96
511
  };
@@ -14,6 +14,7 @@ const useSignTransaction = () => {
14
14
  const { connection } = react.useAppKitConnection();
15
15
  const { walletProvider: solWalletProvider } = react$1.useAppKitProvider("solana");
16
16
  const { walletProvider: btcWalletProvider } = react$1.useAppKitProvider("bip122");
17
+ const { walletProvider: suiWalletProvider } = react$1.useAppKitProvider("sui");
17
18
  const signTransactionSolanaTransaction = async ({
18
19
  feePayer,
19
20
  instructions,
@@ -39,6 +40,29 @@ const useSignTransaction = () => {
39
40
  const signature = await btcWalletProvider.signPSBT(params);
40
41
  return signature.psbt;
41
42
  };
43
+ const signSuiTransaction = async (suiParams) => {
44
+ const transaction = (suiParams == null ? void 0 : suiParams.transaction) ?? (suiParams == null ? void 0 : suiParams.transactionBlock);
45
+ if (!transaction) {
46
+ throw new Error("No Sui transaction bytes provided");
47
+ }
48
+ if (!(suiParams == null ? void 0 : suiParams.address)) {
49
+ throw new Error("No Sui sender address");
50
+ }
51
+ if (!suiWalletProvider) {
52
+ throw new Error("Sui wallet not connected");
53
+ }
54
+ const result = await suiWalletProvider.request({
55
+ method: "sui_signTransaction",
56
+ params: {
57
+ transaction,
58
+ address: suiParams.address
59
+ }
60
+ });
61
+ if (!result) {
62
+ throw new Error("Sui wallet did not return a signature");
63
+ }
64
+ return result.signature;
65
+ };
42
66
  return {
43
67
  evm: {
44
68
  hash,
@@ -53,6 +77,10 @@ const useSignTransaction = () => {
53
77
  bitcoin: {
54
78
  signTransaction: signPSBT,
55
79
  walletProvider: btcWalletProvider
80
+ },
81
+ sui: {
82
+ signTransaction: signSuiTransaction,
83
+ walletProvider: suiWalletProvider
56
84
  }
57
85
  };
58
86
  };
@@ -11,6 +11,7 @@ const useSignTransaction = () => {
11
11
  const { connection } = useAppKitConnection();
12
12
  const { walletProvider: solWalletProvider } = useAppKitProvider("solana");
13
13
  const { walletProvider: btcWalletProvider } = useAppKitProvider("bip122");
14
+ const { walletProvider: suiWalletProvider } = useAppKitProvider("sui");
14
15
  const signTransactionSolanaTransaction = async ({
15
16
  feePayer,
16
17
  instructions,
@@ -36,6 +37,29 @@ const useSignTransaction = () => {
36
37
  const signature = await btcWalletProvider.signPSBT(params);
37
38
  return signature.psbt;
38
39
  };
40
+ const signSuiTransaction = async (suiParams) => {
41
+ const transaction = (suiParams == null ? void 0 : suiParams.transaction) ?? (suiParams == null ? void 0 : suiParams.transactionBlock);
42
+ if (!transaction) {
43
+ throw new Error("No Sui transaction bytes provided");
44
+ }
45
+ if (!(suiParams == null ? void 0 : suiParams.address)) {
46
+ throw new Error("No Sui sender address");
47
+ }
48
+ if (!suiWalletProvider) {
49
+ throw new Error("Sui wallet not connected");
50
+ }
51
+ const result = await suiWalletProvider.request({
52
+ method: "sui_signTransaction",
53
+ params: {
54
+ transaction,
55
+ address: suiParams.address
56
+ }
57
+ });
58
+ if (!result) {
59
+ throw new Error("Sui wallet did not return a signature");
60
+ }
61
+ return result.signature;
62
+ };
39
63
  return {
40
64
  evm: {
41
65
  hash,
@@ -50,6 +74,10 @@ const useSignTransaction = () => {
50
74
  bitcoin: {
51
75
  signTransaction: signPSBT,
52
76
  walletProvider: btcWalletProvider
77
+ },
78
+ sui: {
79
+ signTransaction: signSuiTransaction,
80
+ walletProvider: suiWalletProvider
53
81
  }
54
82
  };
55
83
  };
@@ -0,0 +1,8 @@
1
+ export declare function useSuiConnect(): {
2
+ suiAddress: string | null;
3
+ isConnecting: boolean;
4
+ isConnected: boolean;
5
+ connect: () => void;
6
+ disconnect: () => Promise<void>;
7
+ cancelPendingConnection: () => Promise<void>;
8
+ };
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const react = require("@reown/appkit/react");
5
+ const appkitControllers = require("@reown/appkit-controllers");
6
+ const React = require("react");
7
+ const SUI_NS = "sui";
8
+ const STUCK_WHILE_MODAL_OPEN_MS = 6e4;
9
+ const STUCK_WHILE_MODAL_CLOSED_MS = 8e3;
10
+ const MODAL_CLOSE_SETTLE_MS = 200;
11
+ const WC_RECONNECT_GRACE_MS = 25e3;
12
+ function useSuiConnect() {
13
+ const { open: openAppKitModal } = react.useAppKit();
14
+ const { open: isModalOpen } = react.useAppKitState();
15
+ const { disconnect: appKitDisconnect } = react.useDisconnect();
16
+ const appKitAccount = react.useAppKitAccount({ namespace: SUI_NS });
17
+ const wasModalOpenRef = React.useRef(isModalOpen);
18
+ const [reconnectGraceExpired, setReconnectGraceExpired] = React.useState(false);
19
+ React.useEffect(() => {
20
+ const t = globalThis.setTimeout(
21
+ () => setReconnectGraceExpired(true),
22
+ WC_RECONNECT_GRACE_MS
23
+ );
24
+ return () => globalThis.clearTimeout(t);
25
+ }, []);
26
+ const clearStuckConnecting = React.useCallback(async () => {
27
+ if (appKitAccount.status !== "connecting" || appKitAccount.isConnected) {
28
+ return;
29
+ }
30
+ try {
31
+ await appKitDisconnect({ namespace: SUI_NS });
32
+ } catch {
33
+ }
34
+ try {
35
+ appkitControllers.ChainController.resetAccount(SUI_NS);
36
+ } catch {
37
+ }
38
+ }, [appKitAccount.status, appKitAccount.isConnected, appKitDisconnect]);
39
+ React.useEffect(() => {
40
+ const prev = wasModalOpenRef.current;
41
+ wasModalOpenRef.current = isModalOpen;
42
+ if (prev === true && isModalOpen === false) {
43
+ const t = globalThis.setTimeout(() => {
44
+ void clearStuckConnecting();
45
+ }, MODAL_CLOSE_SETTLE_MS);
46
+ return () => globalThis.clearTimeout(t);
47
+ }
48
+ }, [isModalOpen, clearStuckConnecting]);
49
+ React.useEffect(() => {
50
+ if (appKitAccount.status !== "connecting" || appKitAccount.isConnected) {
51
+ return;
52
+ }
53
+ if (!reconnectGraceExpired) {
54
+ return;
55
+ }
56
+ const delayMs = isModalOpen ? STUCK_WHILE_MODAL_OPEN_MS : STUCK_WHILE_MODAL_CLOSED_MS;
57
+ const t = globalThis.setTimeout(() => {
58
+ void clearStuckConnecting();
59
+ }, delayMs);
60
+ return () => globalThis.clearTimeout(t);
61
+ }, [
62
+ appKitAccount.status,
63
+ appKitAccount.isConnected,
64
+ isModalOpen,
65
+ reconnectGraceExpired,
66
+ clearStuckConnecting
67
+ ]);
68
+ const connect = React.useCallback(() => {
69
+ openAppKitModal({ view: "Connect", namespace: SUI_NS });
70
+ }, [openAppKitModal]);
71
+ const disconnect = React.useCallback(async () => {
72
+ try {
73
+ await appKitDisconnect({ namespace: SUI_NS });
74
+ } catch (error) {
75
+ console.error("Sui disconnect failed:", error);
76
+ }
77
+ }, [appKitDisconnect]);
78
+ return {
79
+ suiAddress: appKitAccount.address ?? null,
80
+ isConnecting: appKitAccount.status === "connecting",
81
+ isConnected: appKitAccount.isConnected,
82
+ connect,
83
+ disconnect,
84
+ cancelPendingConnection: clearStuckConnecting
85
+ };
86
+ }
87
+ exports.useSuiConnect = useSuiConnect;