@b3dotfun/sdk 0.0.51 → 0.0.52-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 (31) hide show
  1. package/dist/cjs/anyspend/abis/upsideStaking.d.ts +2058 -0
  2. package/dist/cjs/anyspend/abis/upsideStaking.js +1139 -0
  3. package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.d.ts +11 -0
  4. package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.js +44 -0
  5. package/dist/cjs/anyspend/types/chain.d.ts +1 -0
  6. package/dist/cjs/anyspend/utils/chain.js +56 -47
  7. package/dist/cjs/global-account/react/components/B3DynamicModal.js +5 -0
  8. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +21 -1
  9. package/dist/cjs/shared/utils/simplehash.d.ts +1 -1
  10. package/dist/esm/anyspend/abis/upsideStaking.d.ts +2058 -0
  11. package/dist/esm/anyspend/abis/upsideStaking.js +1136 -0
  12. package/dist/esm/anyspend/react/components/AnySpendStakeUpside.d.ts +11 -0
  13. package/dist/esm/anyspend/react/components/AnySpendStakeUpside.js +38 -0
  14. package/dist/esm/anyspend/types/chain.d.ts +1 -0
  15. package/dist/esm/anyspend/utils/chain.js +57 -48
  16. package/dist/esm/global-account/react/components/B3DynamicModal.js +5 -0
  17. package/dist/esm/global-account/react/stores/useModalStore.d.ts +21 -1
  18. package/dist/esm/shared/utils/simplehash.d.ts +1 -1
  19. package/dist/styles/index.css +1 -1
  20. package/dist/types/anyspend/abis/upsideStaking.d.ts +2058 -0
  21. package/dist/types/anyspend/react/components/AnySpendStakeUpside.d.ts +11 -0
  22. package/dist/types/anyspend/types/chain.d.ts +1 -0
  23. package/dist/types/global-account/react/stores/useModalStore.d.ts +21 -1
  24. package/dist/types/shared/utils/simplehash.d.ts +1 -1
  25. package/package.json +1 -1
  26. package/src/anyspend/abis/upsideStaking.ts +1137 -0
  27. package/src/anyspend/react/components/AnySpendStakeUpside.tsx +96 -0
  28. package/src/anyspend/types/chain.ts +1 -0
  29. package/src/anyspend/utils/chain.ts +49 -53
  30. package/src/global-account/react/components/B3DynamicModal.tsx +5 -0
  31. package/src/global-account/react/stores/useModalStore.ts +22 -0
@@ -0,0 +1,1136 @@
1
+ export const WETH_STAKING_CONTRACT = [
2
+ { inputs: [{ internalType: "address", name: "target", type: "address" }], name: "AddressEmptyCode", type: "error" },
3
+ {
4
+ inputs: [{ internalType: "address", name: "implementation", type: "address" }],
5
+ name: "ERC1967InvalidImplementation",
6
+ type: "error",
7
+ },
8
+ { inputs: [], name: "ERC1967NonPayable", type: "error" },
9
+ { inputs: [], name: "EnforcedPause", type: "error" },
10
+ { inputs: [], name: "ExpectedPause", type: "error" },
11
+ { inputs: [], name: "FailedCall", type: "error" },
12
+ { inputs: [], name: "InvalidInitialization", type: "error" },
13
+ { inputs: [], name: "NotInitializing", type: "error" },
14
+ { inputs: [{ internalType: "address", name: "owner", type: "address" }], name: "OwnableInvalidOwner", type: "error" },
15
+ {
16
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
17
+ name: "OwnableUnauthorizedAccount",
18
+ type: "error",
19
+ },
20
+ { inputs: [], name: "ReentrancyGuardReentrantCall", type: "error" },
21
+ {
22
+ inputs: [{ internalType: "address", name: "token", type: "address" }],
23
+ name: "SafeERC20FailedOperation",
24
+ type: "error",
25
+ },
26
+ { inputs: [], name: "UUPSUnauthorizedCallContext", type: "error" },
27
+ {
28
+ inputs: [{ internalType: "bytes32", name: "slot", type: "bytes32" }],
29
+ name: "UUPSUnsupportedProxiableUUID",
30
+ type: "error",
31
+ },
32
+ {
33
+ anonymous: false,
34
+ inputs: [
35
+ { indexed: true, internalType: "address", name: "user", type: "address" },
36
+ { indexed: true, internalType: "address", name: "to", type: "address" },
37
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
38
+ { indexed: false, internalType: "uint256", name: "requestIndex", type: "uint256" },
39
+ { indexed: false, internalType: "uint256", name: "timestamp", type: "uint256" },
40
+ { indexed: false, internalType: "uint256", name: "nonce", type: "uint256" },
41
+ ],
42
+ name: "DelayedUnstakeClaimed",
43
+ type: "event",
44
+ },
45
+ {
46
+ anonymous: false,
47
+ inputs: [
48
+ { indexed: true, internalType: "address", name: "user", type: "address" },
49
+ { indexed: true, internalType: "address", name: "to", type: "address" },
50
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
51
+ { indexed: false, internalType: "uint256", name: "newTotal", type: "uint256" },
52
+ { indexed: false, internalType: "uint256", name: "requestTime", type: "uint256" },
53
+ { indexed: false, internalType: "uint256", name: "claimableTime", type: "uint256" },
54
+ { indexed: false, internalType: "uint256", name: "requestIndex", type: "uint256" },
55
+ { indexed: true, internalType: "uint256", name: "nonce", type: "uint256" },
56
+ ],
57
+ name: "DelayedUnstakeRequested",
58
+ type: "event",
59
+ },
60
+ {
61
+ anonymous: false,
62
+ inputs: [
63
+ { indexed: true, internalType: "address", name: "token", type: "address" },
64
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
65
+ ],
66
+ name: "EmergencyWithdraw",
67
+ type: "event",
68
+ },
69
+ {
70
+ anonymous: false,
71
+ inputs: [
72
+ { indexed: true, internalType: "address", name: "oldRecipient", type: "address" },
73
+ { indexed: true, internalType: "address", name: "newRecipient", type: "address" },
74
+ ],
75
+ name: "FeeRecipientUpdated",
76
+ type: "event",
77
+ },
78
+ {
79
+ anonymous: false,
80
+ inputs: [{ indexed: false, internalType: "uint64", name: "version", type: "uint64" }],
81
+ name: "Initialized",
82
+ type: "event",
83
+ },
84
+ {
85
+ anonymous: false,
86
+ inputs: [
87
+ { indexed: false, internalType: "uint256", name: "oldFee", type: "uint256" },
88
+ { indexed: false, internalType: "uint256", name: "newFee", type: "uint256" },
89
+ ],
90
+ name: "InstantUnstakeFeeUpdated",
91
+ type: "event",
92
+ },
93
+ {
94
+ anonymous: false,
95
+ inputs: [
96
+ { indexed: true, internalType: "address", name: "user", type: "address" },
97
+ { indexed: true, internalType: "address", name: "to", type: "address" },
98
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
99
+ { indexed: false, internalType: "uint256", name: "fee", type: "uint256" },
100
+ { indexed: false, internalType: "uint256", name: "netAmount", type: "uint256" },
101
+ { indexed: false, internalType: "uint256", name: "newTotal", type: "uint256" },
102
+ { indexed: false, internalType: "uint256", name: "timestamp", type: "uint256" },
103
+ { indexed: true, internalType: "uint256", name: "nonce", type: "uint256" },
104
+ { indexed: false, internalType: "address", name: "feeRecipient", type: "address" },
105
+ ],
106
+ name: "InstantUnstaked",
107
+ type: "event",
108
+ },
109
+ {
110
+ anonymous: false,
111
+ inputs: [
112
+ { indexed: true, internalType: "address", name: "previousOwner", type: "address" },
113
+ { indexed: true, internalType: "address", name: "newOwner", type: "address" },
114
+ ],
115
+ name: "OwnershipTransferred",
116
+ type: "event",
117
+ },
118
+ {
119
+ anonymous: false,
120
+ inputs: [{ indexed: false, internalType: "address", name: "account", type: "address" }],
121
+ name: "Paused",
122
+ type: "event",
123
+ },
124
+ {
125
+ anonymous: false,
126
+ inputs: [
127
+ { indexed: true, internalType: "address", name: "staker", type: "address" },
128
+ { indexed: true, internalType: "address", name: "user", type: "address" },
129
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
130
+ { indexed: false, internalType: "uint256", name: "newTotal", type: "uint256" },
131
+ { indexed: false, internalType: "uint256", name: "timestamp", type: "uint256" },
132
+ { indexed: false, internalType: "uint256", name: "nonce", type: "uint256" },
133
+ ],
134
+ name: "Staked",
135
+ type: "event",
136
+ },
137
+ {
138
+ anonymous: false,
139
+ inputs: [
140
+ { indexed: true, internalType: "address", name: "oldWallet", type: "address" },
141
+ { indexed: true, internalType: "address", name: "newWallet", type: "address" },
142
+ ],
143
+ name: "TreasuryWalletUpdated",
144
+ type: "event",
145
+ },
146
+ {
147
+ anonymous: false,
148
+ inputs: [{ indexed: false, internalType: "address", name: "account", type: "address" }],
149
+ name: "Unpaused",
150
+ type: "event",
151
+ },
152
+ {
153
+ anonymous: false,
154
+ inputs: [
155
+ { indexed: true, internalType: "address", name: "user", type: "address" },
156
+ { indexed: true, internalType: "address", name: "to", type: "address" },
157
+ { indexed: true, internalType: "uint256", name: "requestIndex", type: "uint256" },
158
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
159
+ { indexed: false, internalType: "uint256", name: "newTotal", type: "uint256" },
160
+ { indexed: false, internalType: "uint256", name: "nonce", type: "uint256" },
161
+ ],
162
+ name: "UnstakeCancelled",
163
+ type: "event",
164
+ },
165
+ {
166
+ anonymous: false,
167
+ inputs: [
168
+ { indexed: false, internalType: "uint256", name: "oldDelay", type: "uint256" },
169
+ { indexed: false, internalType: "uint256", name: "newDelay", type: "uint256" },
170
+ ],
171
+ name: "UnstakeDelayUpdated",
172
+ type: "event",
173
+ },
174
+ {
175
+ anonymous: false,
176
+ inputs: [{ indexed: true, internalType: "address", name: "implementation", type: "address" }],
177
+ name: "Upgraded",
178
+ type: "event",
179
+ },
180
+ {
181
+ inputs: [],
182
+ name: "BASIS_POINTS",
183
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
184
+ stateMutability: "view",
185
+ type: "function",
186
+ },
187
+ {
188
+ inputs: [],
189
+ name: "UPGRADE_INTERFACE_VERSION",
190
+ outputs: [{ internalType: "string", name: "", type: "string" }],
191
+ stateMutability: "view",
192
+ type: "function",
193
+ },
194
+ {
195
+ inputs: [{ internalType: "uint256[]", name: "requestIndices", type: "uint256[]" }],
196
+ name: "batchClaimDelayedUnstakes",
197
+ outputs: [],
198
+ stateMutability: "nonpayable",
199
+ type: "function",
200
+ },
201
+ {
202
+ inputs: [
203
+ { internalType: "address", name: "user", type: "address" },
204
+ { internalType: "uint256[]", name: "requestIndices", type: "uint256[]" },
205
+ ],
206
+ name: "batchClaimDelayedUnstakesFor",
207
+ outputs: [],
208
+ stateMutability: "nonpayable",
209
+ type: "function",
210
+ },
211
+ {
212
+ inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
213
+ name: "calculateInstantUnstakeFee",
214
+ outputs: [
215
+ { internalType: "uint256", name: "fee", type: "uint256" },
216
+ { internalType: "uint256", name: "netAmount", type: "uint256" },
217
+ ],
218
+ stateMutability: "view",
219
+ type: "function",
220
+ },
221
+ {
222
+ inputs: [{ internalType: "uint256", name: "requestIndex", type: "uint256" }],
223
+ name: "cancelUnstake",
224
+ outputs: [],
225
+ stateMutability: "nonpayable",
226
+ type: "function",
227
+ },
228
+ {
229
+ inputs: [
230
+ { internalType: "address", name: "user", type: "address" },
231
+ { internalType: "uint256", name: "requestIndex", type: "uint256" },
232
+ ],
233
+ name: "cancelUnstakeFor",
234
+ outputs: [],
235
+ stateMutability: "nonpayable",
236
+ type: "function",
237
+ },
238
+ {
239
+ inputs: [{ internalType: "uint256", name: "requestIndex", type: "uint256" }],
240
+ name: "claimDelayedUnstake",
241
+ outputs: [],
242
+ stateMutability: "nonpayable",
243
+ type: "function",
244
+ },
245
+ {
246
+ inputs: [
247
+ { internalType: "address", name: "user", type: "address" },
248
+ { internalType: "uint256", name: "requestIndex", type: "uint256" },
249
+ ],
250
+ name: "claimDelayedUnstakeFor",
251
+ outputs: [],
252
+ stateMutability: "nonpayable",
253
+ type: "function",
254
+ },
255
+ { inputs: [], name: "emergencyWithdraw", outputs: [], stateMutability: "nonpayable", type: "function" },
256
+ {
257
+ inputs: [],
258
+ name: "feeRecipient",
259
+ outputs: [{ internalType: "address", name: "", type: "address" }],
260
+ stateMutability: "view",
261
+ type: "function",
262
+ },
263
+ {
264
+ inputs: [],
265
+ name: "getContractBalance",
266
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
267
+ stateMutability: "view",
268
+ type: "function",
269
+ },
270
+ {
271
+ inputs: [],
272
+ name: "getCurrentNonce",
273
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
274
+ stateMutability: "view",
275
+ type: "function",
276
+ },
277
+ {
278
+ inputs: [],
279
+ name: "getTotalStaked",
280
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
281
+ stateMutability: "view",
282
+ type: "function",
283
+ },
284
+ {
285
+ inputs: [
286
+ { internalType: "address", name: "user", type: "address" },
287
+ { internalType: "uint256", name: "requestIndex", type: "uint256" },
288
+ ],
289
+ name: "getUnstakeRequest",
290
+ outputs: [
291
+ {
292
+ components: [
293
+ { internalType: "uint256", name: "amount", type: "uint256" },
294
+ { internalType: "uint256", name: "requestTime", type: "uint256" },
295
+ { internalType: "bool", name: "claimed", type: "bool" },
296
+ ],
297
+ internalType: "struct ERC20StakingUpgradeable.UnstakeRequest",
298
+ name: "",
299
+ type: "tuple",
300
+ },
301
+ ],
302
+ stateMutability: "view",
303
+ type: "function",
304
+ },
305
+ {
306
+ inputs: [{ internalType: "address", name: "user", type: "address" }],
307
+ name: "getUserStakeInfo",
308
+ outputs: [
309
+ { internalType: "uint256", name: "amount", type: "uint256" },
310
+ { internalType: "uint256", name: "timestamp", type: "uint256" },
311
+ {
312
+ components: [
313
+ { internalType: "uint256", name: "amount", type: "uint256" },
314
+ { internalType: "uint256", name: "requestTime", type: "uint256" },
315
+ { internalType: "bool", name: "claimed", type: "bool" },
316
+ ],
317
+ internalType: "struct ERC20StakingUpgradeable.UnstakeRequest[]",
318
+ name: "requests",
319
+ type: "tuple[]",
320
+ },
321
+ { internalType: "uint256", name: "totalPending", type: "uint256" },
322
+ { internalType: "uint256[]", name: "claimableRequestIndices", type: "uint256[]" },
323
+ { internalType: "uint256", name: "totalClaimableAmount", type: "uint256" },
324
+ ],
325
+ stateMutability: "view",
326
+ type: "function",
327
+ },
328
+ {
329
+ inputs: [
330
+ { internalType: "address", name: "initialOwner", type: "address" },
331
+ { internalType: "contract IERC20", name: "_stakingToken", type: "address" },
332
+ { internalType: "address", name: "_treasuryWallet", type: "address" },
333
+ { internalType: "address", name: "_feeRecipient", type: "address" },
334
+ ],
335
+ name: "initialize",
336
+ outputs: [],
337
+ stateMutability: "nonpayable",
338
+ type: "function",
339
+ },
340
+ {
341
+ inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
342
+ name: "instantUnstake",
343
+ outputs: [],
344
+ stateMutability: "nonpayable",
345
+ type: "function",
346
+ },
347
+ {
348
+ inputs: [],
349
+ name: "instantUnstakeFeePercentage",
350
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
351
+ stateMutability: "view",
352
+ type: "function",
353
+ },
354
+ {
355
+ inputs: [
356
+ { internalType: "address", name: "user", type: "address" },
357
+ { internalType: "address", name: "to", type: "address" },
358
+ { internalType: "uint256", name: "amount", type: "uint256" },
359
+ ],
360
+ name: "instantUnstakeFor",
361
+ outputs: [],
362
+ stateMutability: "nonpayable",
363
+ type: "function",
364
+ },
365
+ {
366
+ inputs: [
367
+ { internalType: "uint256", name: "amount", type: "uint256" },
368
+ { internalType: "address", name: "to", type: "address" },
369
+ ],
370
+ name: "instantUnstakeTo",
371
+ outputs: [],
372
+ stateMutability: "nonpayable",
373
+ type: "function",
374
+ },
375
+ {
376
+ inputs: [],
377
+ name: "nonce",
378
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
379
+ stateMutability: "view",
380
+ type: "function",
381
+ },
382
+ {
383
+ inputs: [],
384
+ name: "owner",
385
+ outputs: [{ internalType: "address", name: "", type: "address" }],
386
+ stateMutability: "view",
387
+ type: "function",
388
+ },
389
+ { inputs: [], name: "pause", outputs: [], stateMutability: "nonpayable", type: "function" },
390
+ {
391
+ inputs: [],
392
+ name: "paused",
393
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
394
+ stateMutability: "view",
395
+ type: "function",
396
+ },
397
+ {
398
+ inputs: [],
399
+ name: "proxiableUUID",
400
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
401
+ stateMutability: "view",
402
+ type: "function",
403
+ },
404
+ { inputs: [], name: "renounceOwnership", outputs: [], stateMutability: "nonpayable", type: "function" },
405
+ {
406
+ inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
407
+ name: "requestDelayedUnstake",
408
+ outputs: [],
409
+ stateMutability: "nonpayable",
410
+ type: "function",
411
+ },
412
+ {
413
+ inputs: [
414
+ { internalType: "address", name: "user", type: "address" },
415
+ { internalType: "uint256", name: "amount", type: "uint256" },
416
+ ],
417
+ name: "requestDelayedUnstakeFor",
418
+ outputs: [],
419
+ stateMutability: "nonpayable",
420
+ type: "function",
421
+ },
422
+ {
423
+ inputs: [
424
+ { internalType: "uint256", name: "amount", type: "uint256" },
425
+ { internalType: "address", name: "to", type: "address" },
426
+ ],
427
+ name: "requestDelayedUnstakeTo",
428
+ outputs: [],
429
+ stateMutability: "nonpayable",
430
+ type: "function",
431
+ },
432
+ {
433
+ inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
434
+ name: "stake",
435
+ outputs: [],
436
+ stateMutability: "nonpayable",
437
+ type: "function",
438
+ },
439
+ {
440
+ inputs: [
441
+ { internalType: "address", name: "user", type: "address" },
442
+ { internalType: "uint256", name: "amount", type: "uint256" },
443
+ ],
444
+ name: "stakeFor",
445
+ outputs: [],
446
+ stateMutability: "nonpayable",
447
+ type: "function",
448
+ },
449
+ {
450
+ inputs: [{ internalType: "address", name: "", type: "address" }],
451
+ name: "stakeTimestamps",
452
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
453
+ stateMutability: "view",
454
+ type: "function",
455
+ },
456
+ {
457
+ inputs: [{ internalType: "address", name: "", type: "address" }],
458
+ name: "stakedAmounts",
459
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
460
+ stateMutability: "view",
461
+ type: "function",
462
+ },
463
+ {
464
+ inputs: [],
465
+ name: "stakingToken",
466
+ outputs: [{ internalType: "contract IERC20", name: "", type: "address" }],
467
+ stateMutability: "view",
468
+ type: "function",
469
+ },
470
+ {
471
+ inputs: [{ internalType: "address", name: "", type: "address" }],
472
+ name: "totalPendingUnstakes",
473
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
474
+ stateMutability: "view",
475
+ type: "function",
476
+ },
477
+ {
478
+ inputs: [],
479
+ name: "totalStaked",
480
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
481
+ stateMutability: "view",
482
+ type: "function",
483
+ },
484
+ {
485
+ inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
486
+ name: "transferOwnership",
487
+ outputs: [],
488
+ stateMutability: "nonpayable",
489
+ type: "function",
490
+ },
491
+ {
492
+ inputs: [],
493
+ name: "treasuryWallet",
494
+ outputs: [{ internalType: "address", name: "", type: "address" }],
495
+ stateMutability: "view",
496
+ type: "function",
497
+ },
498
+ { inputs: [], name: "unpause", outputs: [], stateMutability: "nonpayable", type: "function" },
499
+ {
500
+ inputs: [],
501
+ name: "unstakeDelay",
502
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
503
+ stateMutability: "view",
504
+ type: "function",
505
+ },
506
+ {
507
+ inputs: [
508
+ { internalType: "address", name: "", type: "address" },
509
+ { internalType: "uint256", name: "", type: "uint256" },
510
+ ],
511
+ name: "unstakeRequestRecipients",
512
+ outputs: [{ internalType: "address", name: "", type: "address" }],
513
+ stateMutability: "view",
514
+ type: "function",
515
+ },
516
+ {
517
+ inputs: [
518
+ { internalType: "address", name: "", type: "address" },
519
+ { internalType: "uint256", name: "", type: "uint256" },
520
+ ],
521
+ name: "unstakeRequests",
522
+ outputs: [
523
+ { internalType: "uint256", name: "amount", type: "uint256" },
524
+ { internalType: "uint256", name: "requestTime", type: "uint256" },
525
+ { internalType: "bool", name: "claimed", type: "bool" },
526
+ ],
527
+ stateMutability: "view",
528
+ type: "function",
529
+ },
530
+ {
531
+ inputs: [{ internalType: "address", name: "_newFeeRecipient", type: "address" }],
532
+ name: "updateFeeRecipient",
533
+ outputs: [],
534
+ stateMutability: "nonpayable",
535
+ type: "function",
536
+ },
537
+ {
538
+ inputs: [{ internalType: "uint256", name: "_newFeePercentage", type: "uint256" }],
539
+ name: "updateInstantUnstakeFee",
540
+ outputs: [],
541
+ stateMutability: "nonpayable",
542
+ type: "function",
543
+ },
544
+ {
545
+ inputs: [{ internalType: "address", name: "_newTreasuryWallet", type: "address" }],
546
+ name: "updateTreasuryWallet",
547
+ outputs: [],
548
+ stateMutability: "nonpayable",
549
+ type: "function",
550
+ },
551
+ {
552
+ inputs: [{ internalType: "uint256", name: "_newDelay", type: "uint256" }],
553
+ name: "updateUnstakeDelay",
554
+ outputs: [],
555
+ stateMutability: "nonpayable",
556
+ type: "function",
557
+ },
558
+ {
559
+ inputs: [
560
+ { internalType: "address", name: "newImplementation", type: "address" },
561
+ { internalType: "bytes", name: "data", type: "bytes" },
562
+ ],
563
+ name: "upgradeToAndCall",
564
+ outputs: [],
565
+ stateMutability: "payable",
566
+ type: "function",
567
+ },
568
+ ];
569
+ export const B3_STAKING_CONTRACT = [
570
+ { inputs: [{ internalType: "address", name: "target", type: "address" }], name: "AddressEmptyCode", type: "error" },
571
+ {
572
+ inputs: [{ internalType: "address", name: "implementation", type: "address" }],
573
+ name: "ERC1967InvalidImplementation",
574
+ type: "error",
575
+ },
576
+ { inputs: [], name: "ERC1967NonPayable", type: "error" },
577
+ { inputs: [], name: "EnforcedPause", type: "error" },
578
+ { inputs: [], name: "ExpectedPause", type: "error" },
579
+ { inputs: [], name: "FailedCall", type: "error" },
580
+ { inputs: [], name: "InvalidInitialization", type: "error" },
581
+ { inputs: [], name: "NotInitializing", type: "error" },
582
+ { inputs: [{ internalType: "address", name: "owner", type: "address" }], name: "OwnableInvalidOwner", type: "error" },
583
+ {
584
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
585
+ name: "OwnableUnauthorizedAccount",
586
+ type: "error",
587
+ },
588
+ { inputs: [], name: "ReentrancyGuardReentrantCall", type: "error" },
589
+ {
590
+ inputs: [{ internalType: "address", name: "token", type: "address" }],
591
+ name: "SafeERC20FailedOperation",
592
+ type: "error",
593
+ },
594
+ { inputs: [], name: "UUPSUnauthorizedCallContext", type: "error" },
595
+ {
596
+ inputs: [{ internalType: "bytes32", name: "slot", type: "bytes32" }],
597
+ name: "UUPSUnsupportedProxiableUUID",
598
+ type: "error",
599
+ },
600
+ {
601
+ anonymous: false,
602
+ inputs: [
603
+ { indexed: true, internalType: "address", name: "user", type: "address" },
604
+ { indexed: true, internalType: "address", name: "to", type: "address" },
605
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
606
+ { indexed: false, internalType: "uint256", name: "requestIndex", type: "uint256" },
607
+ { indexed: false, internalType: "uint256", name: "timestamp", type: "uint256" },
608
+ { indexed: false, internalType: "uint256", name: "nonce", type: "uint256" },
609
+ ],
610
+ name: "DelayedUnstakeClaimed",
611
+ type: "event",
612
+ },
613
+ {
614
+ anonymous: false,
615
+ inputs: [
616
+ { indexed: true, internalType: "address", name: "user", type: "address" },
617
+ { indexed: true, internalType: "address", name: "to", type: "address" },
618
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
619
+ { indexed: false, internalType: "uint256", name: "newTotal", type: "uint256" },
620
+ { indexed: false, internalType: "uint256", name: "requestTime", type: "uint256" },
621
+ { indexed: false, internalType: "uint256", name: "claimableTime", type: "uint256" },
622
+ { indexed: false, internalType: "uint256", name: "requestIndex", type: "uint256" },
623
+ { indexed: true, internalType: "uint256", name: "nonce", type: "uint256" },
624
+ ],
625
+ name: "DelayedUnstakeRequested",
626
+ type: "event",
627
+ },
628
+ {
629
+ anonymous: false,
630
+ inputs: [
631
+ { indexed: true, internalType: "address", name: "token", type: "address" },
632
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
633
+ ],
634
+ name: "EmergencyWithdraw",
635
+ type: "event",
636
+ },
637
+ {
638
+ anonymous: false,
639
+ inputs: [
640
+ { indexed: true, internalType: "address", name: "oldRecipient", type: "address" },
641
+ { indexed: true, internalType: "address", name: "newRecipient", type: "address" },
642
+ ],
643
+ name: "FeeRecipientUpdated",
644
+ type: "event",
645
+ },
646
+ {
647
+ anonymous: false,
648
+ inputs: [{ indexed: false, internalType: "uint64", name: "version", type: "uint64" }],
649
+ name: "Initialized",
650
+ type: "event",
651
+ },
652
+ {
653
+ anonymous: false,
654
+ inputs: [
655
+ { indexed: false, internalType: "uint256", name: "oldFee", type: "uint256" },
656
+ { indexed: false, internalType: "uint256", name: "newFee", type: "uint256" },
657
+ ],
658
+ name: "InstantUnstakeFeeUpdated",
659
+ type: "event",
660
+ },
661
+ {
662
+ anonymous: false,
663
+ inputs: [
664
+ { indexed: true, internalType: "address", name: "user", type: "address" },
665
+ { indexed: true, internalType: "address", name: "to", type: "address" },
666
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
667
+ { indexed: false, internalType: "uint256", name: "fee", type: "uint256" },
668
+ { indexed: false, internalType: "uint256", name: "netAmount", type: "uint256" },
669
+ { indexed: false, internalType: "uint256", name: "newTotal", type: "uint256" },
670
+ { indexed: false, internalType: "uint256", name: "timestamp", type: "uint256" },
671
+ { indexed: true, internalType: "uint256", name: "nonce", type: "uint256" },
672
+ { indexed: false, internalType: "address", name: "feeRecipient", type: "address" },
673
+ ],
674
+ name: "InstantUnstaked",
675
+ type: "event",
676
+ },
677
+ {
678
+ anonymous: false,
679
+ inputs: [
680
+ { indexed: true, internalType: "address", name: "previousOwner", type: "address" },
681
+ { indexed: true, internalType: "address", name: "newOwner", type: "address" },
682
+ ],
683
+ name: "OwnershipTransferred",
684
+ type: "event",
685
+ },
686
+ {
687
+ anonymous: false,
688
+ inputs: [{ indexed: false, internalType: "address", name: "account", type: "address" }],
689
+ name: "Paused",
690
+ type: "event",
691
+ },
692
+ {
693
+ anonymous: false,
694
+ inputs: [
695
+ { indexed: true, internalType: "address", name: "staker", type: "address" },
696
+ { indexed: true, internalType: "address", name: "user", type: "address" },
697
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
698
+ { indexed: false, internalType: "uint256", name: "newTotal", type: "uint256" },
699
+ { indexed: false, internalType: "uint256", name: "timestamp", type: "uint256" },
700
+ { indexed: false, internalType: "uint256", name: "nonce", type: "uint256" },
701
+ ],
702
+ name: "Staked",
703
+ type: "event",
704
+ },
705
+ {
706
+ anonymous: false,
707
+ inputs: [
708
+ { indexed: true, internalType: "address", name: "oldWallet", type: "address" },
709
+ { indexed: true, internalType: "address", name: "newWallet", type: "address" },
710
+ ],
711
+ name: "TreasuryWalletUpdated",
712
+ type: "event",
713
+ },
714
+ {
715
+ anonymous: false,
716
+ inputs: [{ indexed: false, internalType: "address", name: "account", type: "address" }],
717
+ name: "Unpaused",
718
+ type: "event",
719
+ },
720
+ {
721
+ anonymous: false,
722
+ inputs: [
723
+ { indexed: true, internalType: "address", name: "user", type: "address" },
724
+ { indexed: true, internalType: "address", name: "to", type: "address" },
725
+ { indexed: true, internalType: "uint256", name: "requestIndex", type: "uint256" },
726
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
727
+ { indexed: false, internalType: "uint256", name: "newTotal", type: "uint256" },
728
+ { indexed: false, internalType: "uint256", name: "nonce", type: "uint256" },
729
+ ],
730
+ name: "UnstakeCancelled",
731
+ type: "event",
732
+ },
733
+ {
734
+ anonymous: false,
735
+ inputs: [
736
+ { indexed: false, internalType: "uint256", name: "oldDelay", type: "uint256" },
737
+ { indexed: false, internalType: "uint256", name: "newDelay", type: "uint256" },
738
+ ],
739
+ name: "UnstakeDelayUpdated",
740
+ type: "event",
741
+ },
742
+ {
743
+ anonymous: false,
744
+ inputs: [{ indexed: true, internalType: "address", name: "implementation", type: "address" }],
745
+ name: "Upgraded",
746
+ type: "event",
747
+ },
748
+ {
749
+ inputs: [],
750
+ name: "BASIS_POINTS",
751
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
752
+ stateMutability: "view",
753
+ type: "function",
754
+ },
755
+ {
756
+ inputs: [],
757
+ name: "UPGRADE_INTERFACE_VERSION",
758
+ outputs: [{ internalType: "string", name: "", type: "string" }],
759
+ stateMutability: "view",
760
+ type: "function",
761
+ },
762
+ {
763
+ inputs: [{ internalType: "uint256[]", name: "requestIndices", type: "uint256[]" }],
764
+ name: "batchClaimDelayedUnstakes",
765
+ outputs: [],
766
+ stateMutability: "nonpayable",
767
+ type: "function",
768
+ },
769
+ {
770
+ inputs: [
771
+ { internalType: "address", name: "user", type: "address" },
772
+ { internalType: "uint256[]", name: "requestIndices", type: "uint256[]" },
773
+ ],
774
+ name: "batchClaimDelayedUnstakesFor",
775
+ outputs: [],
776
+ stateMutability: "nonpayable",
777
+ type: "function",
778
+ },
779
+ {
780
+ inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
781
+ name: "calculateInstantUnstakeFee",
782
+ outputs: [
783
+ { internalType: "uint256", name: "fee", type: "uint256" },
784
+ { internalType: "uint256", name: "netAmount", type: "uint256" },
785
+ ],
786
+ stateMutability: "view",
787
+ type: "function",
788
+ },
789
+ {
790
+ inputs: [{ internalType: "uint256", name: "requestIndex", type: "uint256" }],
791
+ name: "cancelUnstake",
792
+ outputs: [],
793
+ stateMutability: "nonpayable",
794
+ type: "function",
795
+ },
796
+ {
797
+ inputs: [
798
+ { internalType: "address", name: "user", type: "address" },
799
+ { internalType: "uint256", name: "requestIndex", type: "uint256" },
800
+ ],
801
+ name: "cancelUnstakeFor",
802
+ outputs: [],
803
+ stateMutability: "nonpayable",
804
+ type: "function",
805
+ },
806
+ {
807
+ inputs: [{ internalType: "uint256", name: "requestIndex", type: "uint256" }],
808
+ name: "claimDelayedUnstake",
809
+ outputs: [],
810
+ stateMutability: "nonpayable",
811
+ type: "function",
812
+ },
813
+ {
814
+ inputs: [
815
+ { internalType: "address", name: "user", type: "address" },
816
+ { internalType: "uint256", name: "requestIndex", type: "uint256" },
817
+ ],
818
+ name: "claimDelayedUnstakeFor",
819
+ outputs: [],
820
+ stateMutability: "nonpayable",
821
+ type: "function",
822
+ },
823
+ { inputs: [], name: "emergencyWithdraw", outputs: [], stateMutability: "nonpayable", type: "function" },
824
+ {
825
+ inputs: [],
826
+ name: "feeRecipient",
827
+ outputs: [{ internalType: "address", name: "", type: "address" }],
828
+ stateMutability: "view",
829
+ type: "function",
830
+ },
831
+ {
832
+ inputs: [],
833
+ name: "getContractBalance",
834
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
835
+ stateMutability: "view",
836
+ type: "function",
837
+ },
838
+ {
839
+ inputs: [],
840
+ name: "getCurrentNonce",
841
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
842
+ stateMutability: "view",
843
+ type: "function",
844
+ },
845
+ {
846
+ inputs: [],
847
+ name: "getTotalStaked",
848
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
849
+ stateMutability: "view",
850
+ type: "function",
851
+ },
852
+ {
853
+ inputs: [
854
+ { internalType: "address", name: "user", type: "address" },
855
+ { internalType: "uint256", name: "requestIndex", type: "uint256" },
856
+ ],
857
+ name: "getUnstakeRequest",
858
+ outputs: [
859
+ {
860
+ components: [
861
+ { internalType: "uint256", name: "amount", type: "uint256" },
862
+ { internalType: "uint256", name: "requestTime", type: "uint256" },
863
+ { internalType: "bool", name: "claimed", type: "bool" },
864
+ ],
865
+ internalType: "struct ERC20StakingUpgradeableV3.UnstakeRequest",
866
+ name: "",
867
+ type: "tuple",
868
+ },
869
+ ],
870
+ stateMutability: "view",
871
+ type: "function",
872
+ },
873
+ {
874
+ inputs: [{ internalType: "address", name: "user", type: "address" }],
875
+ name: "getUserStakeInfo",
876
+ outputs: [
877
+ { internalType: "uint256", name: "amount", type: "uint256" },
878
+ { internalType: "uint256", name: "timestamp", type: "uint256" },
879
+ {
880
+ components: [
881
+ { internalType: "uint256", name: "amount", type: "uint256" },
882
+ { internalType: "uint256", name: "requestTime", type: "uint256" },
883
+ { internalType: "bool", name: "claimed", type: "bool" },
884
+ ],
885
+ internalType: "struct ERC20StakingUpgradeableV3.UnstakeRequest[]",
886
+ name: "requests",
887
+ type: "tuple[]",
888
+ },
889
+ { internalType: "uint256", name: "totalPending", type: "uint256" },
890
+ { internalType: "uint256[]", name: "claimableRequestIndices", type: "uint256[]" },
891
+ { internalType: "uint256", name: "totalClaimableAmount", type: "uint256" },
892
+ ],
893
+ stateMutability: "view",
894
+ type: "function",
895
+ },
896
+ {
897
+ inputs: [
898
+ { internalType: "address", name: "initialOwner", type: "address" },
899
+ { internalType: "contract IERC20", name: "_stakingToken", type: "address" },
900
+ { internalType: "address", name: "_treasuryWallet", type: "address" },
901
+ { internalType: "address", name: "_feeRecipient", type: "address" },
902
+ ],
903
+ name: "initialize",
904
+ outputs: [],
905
+ stateMutability: "nonpayable",
906
+ type: "function",
907
+ },
908
+ {
909
+ inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
910
+ name: "instantUnstake",
911
+ outputs: [],
912
+ stateMutability: "nonpayable",
913
+ type: "function",
914
+ },
915
+ {
916
+ inputs: [],
917
+ name: "instantUnstakeFeePercentage",
918
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
919
+ stateMutability: "view",
920
+ type: "function",
921
+ },
922
+ {
923
+ inputs: [
924
+ { internalType: "address", name: "user", type: "address" },
925
+ { internalType: "address", name: "to", type: "address" },
926
+ { internalType: "uint256", name: "amount", type: "uint256" },
927
+ ],
928
+ name: "instantUnstakeFor",
929
+ outputs: [],
930
+ stateMutability: "nonpayable",
931
+ type: "function",
932
+ },
933
+ {
934
+ inputs: [
935
+ { internalType: "uint256", name: "amount", type: "uint256" },
936
+ { internalType: "address", name: "to", type: "address" },
937
+ ],
938
+ name: "instantUnstakeTo",
939
+ outputs: [],
940
+ stateMutability: "nonpayable",
941
+ type: "function",
942
+ },
943
+ {
944
+ inputs: [],
945
+ name: "nonce",
946
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
947
+ stateMutability: "view",
948
+ type: "function",
949
+ },
950
+ {
951
+ inputs: [],
952
+ name: "owner",
953
+ outputs: [{ internalType: "address", name: "", type: "address" }],
954
+ stateMutability: "view",
955
+ type: "function",
956
+ },
957
+ { inputs: [], name: "pause", outputs: [], stateMutability: "nonpayable", type: "function" },
958
+ {
959
+ inputs: [],
960
+ name: "paused",
961
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
962
+ stateMutability: "view",
963
+ type: "function",
964
+ },
965
+ {
966
+ inputs: [],
967
+ name: "proxiableUUID",
968
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
969
+ stateMutability: "view",
970
+ type: "function",
971
+ },
972
+ { inputs: [], name: "renounceOwnership", outputs: [], stateMutability: "nonpayable", type: "function" },
973
+ {
974
+ inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
975
+ name: "requestDelayedUnstake",
976
+ outputs: [],
977
+ stateMutability: "nonpayable",
978
+ type: "function",
979
+ },
980
+ {
981
+ inputs: [
982
+ { internalType: "address", name: "user", type: "address" },
983
+ { internalType: "uint256", name: "amount", type: "uint256" },
984
+ ],
985
+ name: "requestDelayedUnstakeFor",
986
+ outputs: [],
987
+ stateMutability: "nonpayable",
988
+ type: "function",
989
+ },
990
+ {
991
+ inputs: [
992
+ { internalType: "uint256", name: "amount", type: "uint256" },
993
+ { internalType: "address", name: "to", type: "address" },
994
+ ],
995
+ name: "requestDelayedUnstakeTo",
996
+ outputs: [],
997
+ stateMutability: "nonpayable",
998
+ type: "function",
999
+ },
1000
+ {
1001
+ inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
1002
+ name: "stake",
1003
+ outputs: [],
1004
+ stateMutability: "nonpayable",
1005
+ type: "function",
1006
+ },
1007
+ {
1008
+ inputs: [
1009
+ { internalType: "address", name: "user", type: "address" },
1010
+ { internalType: "uint256", name: "amount", type: "uint256" },
1011
+ ],
1012
+ name: "stakeFor",
1013
+ outputs: [],
1014
+ stateMutability: "nonpayable",
1015
+ type: "function",
1016
+ },
1017
+ {
1018
+ inputs: [{ internalType: "address", name: "", type: "address" }],
1019
+ name: "stakeTimestamps",
1020
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1021
+ stateMutability: "view",
1022
+ type: "function",
1023
+ },
1024
+ {
1025
+ inputs: [{ internalType: "address", name: "", type: "address" }],
1026
+ name: "stakedAmounts",
1027
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1028
+ stateMutability: "view",
1029
+ type: "function",
1030
+ },
1031
+ {
1032
+ inputs: [],
1033
+ name: "stakingToken",
1034
+ outputs: [{ internalType: "contract IERC20", name: "", type: "address" }],
1035
+ stateMutability: "view",
1036
+ type: "function",
1037
+ },
1038
+ {
1039
+ inputs: [{ internalType: "address", name: "", type: "address" }],
1040
+ name: "totalPendingUnstakes",
1041
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1042
+ stateMutability: "view",
1043
+ type: "function",
1044
+ },
1045
+ {
1046
+ inputs: [],
1047
+ name: "totalStaked",
1048
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1049
+ stateMutability: "view",
1050
+ type: "function",
1051
+ },
1052
+ {
1053
+ inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
1054
+ name: "transferOwnership",
1055
+ outputs: [],
1056
+ stateMutability: "nonpayable",
1057
+ type: "function",
1058
+ },
1059
+ {
1060
+ inputs: [],
1061
+ name: "treasuryWallet",
1062
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1063
+ stateMutability: "view",
1064
+ type: "function",
1065
+ },
1066
+ { inputs: [], name: "unpause", outputs: [], stateMutability: "nonpayable", type: "function" },
1067
+ {
1068
+ inputs: [],
1069
+ name: "unstakeDelay",
1070
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1071
+ stateMutability: "view",
1072
+ type: "function",
1073
+ },
1074
+ {
1075
+ inputs: [
1076
+ { internalType: "address", name: "", type: "address" },
1077
+ { internalType: "uint256", name: "", type: "uint256" },
1078
+ ],
1079
+ name: "unstakeRequestRecipients",
1080
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1081
+ stateMutability: "view",
1082
+ type: "function",
1083
+ },
1084
+ {
1085
+ inputs: [
1086
+ { internalType: "address", name: "", type: "address" },
1087
+ { internalType: "uint256", name: "", type: "uint256" },
1088
+ ],
1089
+ name: "unstakeRequests",
1090
+ outputs: [
1091
+ { internalType: "uint256", name: "amount", type: "uint256" },
1092
+ { internalType: "uint256", name: "requestTime", type: "uint256" },
1093
+ { internalType: "bool", name: "claimed", type: "bool" },
1094
+ ],
1095
+ stateMutability: "view",
1096
+ type: "function",
1097
+ },
1098
+ {
1099
+ inputs: [{ internalType: "address", name: "_newFeeRecipient", type: "address" }],
1100
+ name: "updateFeeRecipient",
1101
+ outputs: [],
1102
+ stateMutability: "nonpayable",
1103
+ type: "function",
1104
+ },
1105
+ {
1106
+ inputs: [{ internalType: "uint256", name: "_newFeePercentage", type: "uint256" }],
1107
+ name: "updateInstantUnstakeFee",
1108
+ outputs: [],
1109
+ stateMutability: "nonpayable",
1110
+ type: "function",
1111
+ },
1112
+ {
1113
+ inputs: [{ internalType: "address", name: "_newTreasuryWallet", type: "address" }],
1114
+ name: "updateTreasuryWallet",
1115
+ outputs: [],
1116
+ stateMutability: "nonpayable",
1117
+ type: "function",
1118
+ },
1119
+ {
1120
+ inputs: [{ internalType: "uint256", name: "_newDelay", type: "uint256" }],
1121
+ name: "updateUnstakeDelay",
1122
+ outputs: [],
1123
+ stateMutability: "nonpayable",
1124
+ type: "function",
1125
+ },
1126
+ {
1127
+ inputs: [
1128
+ { internalType: "address", name: "newImplementation", type: "address" },
1129
+ { internalType: "bytes", name: "data", type: "bytes" },
1130
+ ],
1131
+ name: "upgradeToAndCall",
1132
+ outputs: [],
1133
+ stateMutability: "payable",
1134
+ type: "function",
1135
+ },
1136
+ ];