@paxoslabs/amplify-sdk 0.5.2 → 1.0.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 (62) hide show
  1. package/dist/index.d.mts +3158 -725
  2. package/dist/index.d.ts +3158 -725
  3. package/dist/index.js +15013 -171
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +15067 -6
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +25 -86
  8. package/CHANGELOG.md +0 -320
  9. package/LICENSE +0 -28
  10. package/README.md +0 -119
  11. package/dist/chain-utils-BdJecHBA.d.mts +0 -334
  12. package/dist/chain-utils-BdJecHBA.d.ts +0 -334
  13. package/dist/chunk-5OK753GA.js +0 -1989
  14. package/dist/chunk-5OK753GA.js.map +0 -1
  15. package/dist/chunk-6CU533DM.mjs +0 -39
  16. package/dist/chunk-6CU533DM.mjs.map +0 -1
  17. package/dist/chunk-7JQQ2TH4.mjs +0 -1231
  18. package/dist/chunk-7JQQ2TH4.mjs.map +0 -1
  19. package/dist/chunk-HU5CTL4C.mjs +0 -1962
  20. package/dist/chunk-HU5CTL4C.mjs.map +0 -1
  21. package/dist/chunk-NNDY5TID.js +0 -1143
  22. package/dist/chunk-NNDY5TID.js.map +0 -1
  23. package/dist/chunk-Q5FXJU5Y.mjs +0 -1133
  24. package/dist/chunk-Q5FXJU5Y.mjs.map +0 -1
  25. package/dist/chunk-QZHI2T7O.mjs +0 -457
  26. package/dist/chunk-QZHI2T7O.mjs.map +0 -1
  27. package/dist/chunk-SWUG4PTB.js +0 -464
  28. package/dist/chunk-SWUG4PTB.js.map +0 -1
  29. package/dist/chunk-TNL23CO2.js +0 -45
  30. package/dist/chunk-TNL23CO2.js.map +0 -1
  31. package/dist/chunk-WK7EJRBB.mjs +0 -1482
  32. package/dist/chunk-WK7EJRBB.mjs.map +0 -1
  33. package/dist/chunk-WYBYBPX5.js +0 -1518
  34. package/dist/chunk-WYBYBPX5.js.map +0 -1
  35. package/dist/chunk-ZKDXRGI5.js +0 -1239
  36. package/dist/chunk-ZKDXRGI5.js.map +0 -1
  37. package/dist/core.d.mts +0 -152
  38. package/dist/core.d.ts +0 -152
  39. package/dist/core.js +0 -1220
  40. package/dist/core.js.map +0 -1
  41. package/dist/core.mjs +0 -1194
  42. package/dist/core.mjs.map +0 -1
  43. package/dist/display.d.mts +0 -263
  44. package/dist/display.d.ts +0 -263
  45. package/dist/display.js +0 -36
  46. package/dist/display.js.map +0 -1
  47. package/dist/display.mjs +0 -7
  48. package/dist/display.mjs.map +0 -1
  49. package/dist/index-DXXA8gEA.d.mts +0 -5026
  50. package/dist/index-aE5lTOUH.d.ts +0 -5026
  51. package/dist/utils.d.mts +0 -112
  52. package/dist/utils.d.ts +0 -112
  53. package/dist/utils.js +0 -67
  54. package/dist/utils.js.map +0 -1
  55. package/dist/utils.mjs +0 -25
  56. package/dist/utils.mjs.map +0 -1
  57. package/dist/vaults.d.mts +0 -4
  58. package/dist/vaults.d.ts +0 -4
  59. package/dist/vaults.js +0 -96
  60. package/dist/vaults.js.map +0 -1
  61. package/dist/vaults.mjs +0 -7
  62. package/dist/vaults.mjs.map +0 -1
@@ -1,1143 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkWYBYBPX5_js = require('./chunk-WYBYBPX5.js');
4
- var viem = require('viem');
5
-
6
- // src/abi/accountant-abi.ts
7
- var AccountantAbi = [
8
- {
9
- type: "constructor",
10
- inputs: [
11
- { name: "_owner", type: "address", internalType: "address" },
12
- { name: "_vault", type: "address", internalType: "address" },
13
- { name: "payoutAddress", type: "address", internalType: "address" },
14
- { name: "startingExchangeRate", type: "uint96", internalType: "uint96" },
15
- { name: "_base", type: "address", internalType: "address" },
16
- {
17
- name: "allowedExchangeRateChangeUpper",
18
- type: "uint16",
19
- internalType: "uint16"
20
- },
21
- {
22
- name: "allowedExchangeRateChangeLower",
23
- type: "uint16",
24
- internalType: "uint16"
25
- },
26
- {
27
- name: "minimumUpdateDelayInSeconds",
28
- type: "uint32",
29
- internalType: "uint32"
30
- },
31
- { name: "managementFee", type: "uint16", internalType: "uint16" }
32
- ],
33
- stateMutability: "nonpayable"
34
- },
35
- {
36
- type: "function",
37
- name: "accountantState",
38
- inputs: [],
39
- outputs: [
40
- { name: "payoutAddress", type: "address", internalType: "address" },
41
- { name: "feesOwedInBase", type: "uint128", internalType: "uint128" },
42
- {
43
- name: "totalSharesLastUpdate",
44
- type: "uint128",
45
- internalType: "uint128"
46
- },
47
- { name: "exchangeRate", type: "uint96", internalType: "uint96" },
48
- {
49
- name: "allowedExchangeRateChangeUpper",
50
- type: "uint16",
51
- internalType: "uint16"
52
- },
53
- {
54
- name: "allowedExchangeRateChangeLower",
55
- type: "uint16",
56
- internalType: "uint16"
57
- },
58
- { name: "lastUpdateTimestamp", type: "uint64", internalType: "uint64" },
59
- { name: "isPaused", type: "bool", internalType: "bool" },
60
- {
61
- name: "minimumUpdateDelayInSeconds",
62
- type: "uint32",
63
- internalType: "uint32"
64
- },
65
- { name: "managementFee", type: "uint16", internalType: "uint16" }
66
- ],
67
- stateMutability: "view"
68
- },
69
- {
70
- type: "function",
71
- name: "authority",
72
- inputs: [],
73
- outputs: [
74
- { name: "", type: "address", internalType: "contract Authority" }
75
- ],
76
- stateMutability: "view"
77
- },
78
- {
79
- type: "function",
80
- name: "base",
81
- inputs: [],
82
- outputs: [{ name: "", type: "address", internalType: "contract ERC20" }],
83
- stateMutability: "view"
84
- },
85
- {
86
- type: "function",
87
- name: "claimFees",
88
- inputs: [
89
- { name: "feeAsset", type: "address", internalType: "contract ERC20" }
90
- ],
91
- outputs: [],
92
- stateMutability: "nonpayable"
93
- },
94
- {
95
- type: "function",
96
- name: "decimals",
97
- inputs: [],
98
- outputs: [{ name: "", type: "uint8", internalType: "uint8" }],
99
- stateMutability: "view"
100
- },
101
- {
102
- type: "function",
103
- name: "getRate",
104
- inputs: [],
105
- outputs: [{ name: "rate", type: "uint256", internalType: "uint256" }],
106
- stateMutability: "view"
107
- },
108
- {
109
- type: "function",
110
- name: "getRateInQuote",
111
- inputs: [
112
- { name: "quote", type: "address", internalType: "contract ERC20" }
113
- ],
114
- outputs: [
115
- { name: "rateInQuote", type: "uint256", internalType: "uint256" }
116
- ],
117
- stateMutability: "view"
118
- },
119
- {
120
- type: "function",
121
- name: "getRateInQuoteSafe",
122
- inputs: [
123
- { name: "quote", type: "address", internalType: "contract ERC20" }
124
- ],
125
- outputs: [
126
- { name: "rateInQuote", type: "uint256", internalType: "uint256" }
127
- ],
128
- stateMutability: "view"
129
- },
130
- {
131
- type: "function",
132
- name: "getRateSafe",
133
- inputs: [],
134
- outputs: [{ name: "rate", type: "uint256", internalType: "uint256" }],
135
- stateMutability: "view"
136
- },
137
- {
138
- type: "function",
139
- name: "owner",
140
- inputs: [],
141
- outputs: [{ name: "", type: "address", internalType: "address" }],
142
- stateMutability: "view"
143
- },
144
- {
145
- type: "function",
146
- name: "pause",
147
- inputs: [],
148
- outputs: [],
149
- stateMutability: "nonpayable"
150
- },
151
- {
152
- type: "function",
153
- name: "rateProviderData",
154
- inputs: [{ name: "", type: "address", internalType: "contract ERC20" }],
155
- outputs: [
156
- { name: "isPeggedToBase", type: "bool", internalType: "bool" },
157
- {
158
- name: "rateProvider",
159
- type: "address",
160
- internalType: "contract IRateProvider"
161
- }
162
- ],
163
- stateMutability: "view"
164
- },
165
- {
166
- type: "function",
167
- name: "setAuthority",
168
- inputs: [
169
- {
170
- name: "newAuthority",
171
- type: "address",
172
- internalType: "contract Authority"
173
- }
174
- ],
175
- outputs: [],
176
- stateMutability: "nonpayable"
177
- },
178
- {
179
- type: "function",
180
- name: "setRateProviderData",
181
- inputs: [
182
- { name: "asset", type: "address", internalType: "contract ERC20" },
183
- { name: "isPeggedToBase", type: "bool", internalType: "bool" },
184
- { name: "rateProvider", type: "address", internalType: "address" }
185
- ],
186
- outputs: [],
187
- stateMutability: "nonpayable"
188
- },
189
- {
190
- type: "function",
191
- name: "transferOwnership",
192
- inputs: [{ name: "newOwner", type: "address", internalType: "address" }],
193
- outputs: [],
194
- stateMutability: "nonpayable"
195
- },
196
- {
197
- type: "function",
198
- name: "unpause",
199
- inputs: [],
200
- outputs: [],
201
- stateMutability: "nonpayable"
202
- },
203
- {
204
- type: "function",
205
- name: "updateDelay",
206
- inputs: [
207
- {
208
- name: "minimumUpdateDelayInSeconds",
209
- type: "uint32",
210
- internalType: "uint32"
211
- }
212
- ],
213
- outputs: [],
214
- stateMutability: "nonpayable"
215
- },
216
- {
217
- type: "function",
218
- name: "updateExchangeRate",
219
- inputs: [
220
- { name: "newExchangeRate", type: "uint96", internalType: "uint96" }
221
- ],
222
- outputs: [],
223
- stateMutability: "nonpayable"
224
- },
225
- {
226
- type: "function",
227
- name: "updateLower",
228
- inputs: [
229
- {
230
- name: "allowedExchangeRateChangeLower",
231
- type: "uint16",
232
- internalType: "uint16"
233
- }
234
- ],
235
- outputs: [],
236
- stateMutability: "nonpayable"
237
- },
238
- {
239
- type: "function",
240
- name: "updateManagementFee",
241
- inputs: [{ name: "managementFee", type: "uint16", internalType: "uint16" }],
242
- outputs: [],
243
- stateMutability: "nonpayable"
244
- },
245
- {
246
- type: "function",
247
- name: "updatePayoutAddress",
248
- inputs: [
249
- { name: "payoutAddress", type: "address", internalType: "address" }
250
- ],
251
- outputs: [],
252
- stateMutability: "nonpayable"
253
- },
254
- {
255
- type: "function",
256
- name: "updateUpper",
257
- inputs: [
258
- {
259
- name: "allowedExchangeRateChangeUpper",
260
- type: "uint16",
261
- internalType: "uint16"
262
- }
263
- ],
264
- outputs: [],
265
- stateMutability: "nonpayable"
266
- },
267
- {
268
- type: "function",
269
- name: "vault",
270
- inputs: [],
271
- outputs: [
272
- { name: "", type: "address", internalType: "contract BoringVault" }
273
- ],
274
- stateMutability: "view"
275
- },
276
- {
277
- type: "event",
278
- name: "AuthorityUpdated",
279
- inputs: [
280
- { name: "user", type: "address", indexed: true, internalType: "address" },
281
- {
282
- name: "newAuthority",
283
- type: "address",
284
- indexed: true,
285
- internalType: "contract Authority"
286
- }
287
- ],
288
- anonymous: false
289
- },
290
- {
291
- type: "event",
292
- name: "DelayInSecondsUpdated",
293
- inputs: [
294
- {
295
- name: "oldDelay",
296
- type: "uint32",
297
- indexed: false,
298
- internalType: "uint32"
299
- },
300
- {
301
- name: "newDelay",
302
- type: "uint32",
303
- indexed: false,
304
- internalType: "uint32"
305
- }
306
- ],
307
- anonymous: false
308
- },
309
- {
310
- type: "event",
311
- name: "ExchangeRateUpdated",
312
- inputs: [
313
- {
314
- name: "oldRate",
315
- type: "uint96",
316
- indexed: false,
317
- internalType: "uint96"
318
- },
319
- {
320
- name: "newRate",
321
- type: "uint96",
322
- indexed: false,
323
- internalType: "uint96"
324
- },
325
- {
326
- name: "currentTime",
327
- type: "uint64",
328
- indexed: false,
329
- internalType: "uint64"
330
- }
331
- ],
332
- anonymous: false
333
- },
334
- {
335
- type: "event",
336
- name: "FeesClaimed",
337
- inputs: [
338
- {
339
- name: "feeAsset",
340
- type: "address",
341
- indexed: true,
342
- internalType: "address"
343
- },
344
- {
345
- name: "amount",
346
- type: "uint256",
347
- indexed: false,
348
- internalType: "uint256"
349
- }
350
- ],
351
- anonymous: false
352
- },
353
- {
354
- type: "event",
355
- name: "LowerBoundUpdated",
356
- inputs: [
357
- {
358
- name: "oldBound",
359
- type: "uint16",
360
- indexed: false,
361
- internalType: "uint16"
362
- },
363
- {
364
- name: "newBound",
365
- type: "uint16",
366
- indexed: false,
367
- internalType: "uint16"
368
- }
369
- ],
370
- anonymous: false
371
- },
372
- {
373
- type: "event",
374
- name: "ManagementFeeUpdated",
375
- inputs: [
376
- {
377
- name: "oldFee",
378
- type: "uint16",
379
- indexed: false,
380
- internalType: "uint16"
381
- },
382
- {
383
- name: "newFee",
384
- type: "uint16",
385
- indexed: false,
386
- internalType: "uint16"
387
- }
388
- ],
389
- anonymous: false
390
- },
391
- {
392
- type: "event",
393
- name: "OwnershipTransferred",
394
- inputs: [
395
- { name: "user", type: "address", indexed: true, internalType: "address" },
396
- {
397
- name: "newOwner",
398
- type: "address",
399
- indexed: true,
400
- internalType: "address"
401
- }
402
- ],
403
- anonymous: false
404
- },
405
- { type: "event", name: "Paused", inputs: [], anonymous: false },
406
- {
407
- type: "event",
408
- name: "PayoutAddressUpdated",
409
- inputs: [
410
- {
411
- name: "oldPayout",
412
- type: "address",
413
- indexed: false,
414
- internalType: "address"
415
- },
416
- {
417
- name: "newPayout",
418
- type: "address",
419
- indexed: false,
420
- internalType: "address"
421
- }
422
- ],
423
- anonymous: false
424
- },
425
- {
426
- type: "event",
427
- name: "RateProviderUpdated",
428
- inputs: [
429
- {
430
- name: "asset",
431
- type: "address",
432
- indexed: false,
433
- internalType: "address"
434
- },
435
- { name: "isPegged", type: "bool", indexed: false, internalType: "bool" },
436
- {
437
- name: "rateProvider",
438
- type: "address",
439
- indexed: false,
440
- internalType: "address"
441
- }
442
- ],
443
- anonymous: false
444
- },
445
- { type: "event", name: "Unpaused", inputs: [], anonymous: false },
446
- {
447
- type: "event",
448
- name: "UpperBoundUpdated",
449
- inputs: [
450
- {
451
- name: "oldBound",
452
- type: "uint16",
453
- indexed: false,
454
- internalType: "uint16"
455
- },
456
- {
457
- name: "newBound",
458
- type: "uint16",
459
- indexed: false,
460
- internalType: "uint16"
461
- }
462
- ],
463
- anonymous: false
464
- },
465
- {
466
- type: "error",
467
- name: "AccountantWithRateProviders__LowerBoundTooLarge",
468
- inputs: []
469
- },
470
- {
471
- type: "error",
472
- name: "AccountantWithRateProviders__ManagementFeeTooLarge",
473
- inputs: []
474
- },
475
- {
476
- type: "error",
477
- name: "AccountantWithRateProviders__OnlyCallableByBoringVault",
478
- inputs: []
479
- },
480
- { type: "error", name: "AccountantWithRateProviders__Paused", inputs: [] },
481
- {
482
- type: "error",
483
- name: "AccountantWithRateProviders__UpdateDelayTooLarge",
484
- inputs: []
485
- },
486
- {
487
- type: "error",
488
- name: "AccountantWithRateProviders__UpperBoundTooSmall",
489
- inputs: []
490
- },
491
- {
492
- type: "error",
493
- name: "AccountantWithRateProviders__ZeroFeesOwed",
494
- inputs: []
495
- }
496
- ];
497
-
498
- // src/abi/boring-vault-abi.ts
499
- var BoringVaultAbi = [
500
- {
501
- type: "constructor",
502
- inputs: [
503
- { name: "_owner", type: "address", internalType: "address" },
504
- { name: "_name", type: "string", internalType: "string" },
505
- { name: "_symbol", type: "string", internalType: "string" },
506
- { name: "_decimals", type: "uint8", internalType: "uint8" }
507
- ],
508
- stateMutability: "nonpayable"
509
- },
510
- { type: "receive", stateMutability: "payable" },
511
- {
512
- type: "function",
513
- name: "DOMAIN_SEPARATOR",
514
- inputs: [],
515
- outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
516
- stateMutability: "view"
517
- },
518
- {
519
- type: "function",
520
- name: "allowance",
521
- inputs: [
522
- { name: "", type: "address", internalType: "address" },
523
- { name: "", type: "address", internalType: "address" }
524
- ],
525
- outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
526
- stateMutability: "view"
527
- },
528
- {
529
- type: "function",
530
- name: "approve",
531
- inputs: [
532
- { name: "spender", type: "address", internalType: "address" },
533
- { name: "amount", type: "uint256", internalType: "uint256" }
534
- ],
535
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
536
- stateMutability: "nonpayable"
537
- },
538
- {
539
- type: "function",
540
- name: "authority",
541
- inputs: [],
542
- outputs: [
543
- { name: "", type: "address", internalType: "contract Authority" }
544
- ],
545
- stateMutability: "view"
546
- },
547
- {
548
- type: "function",
549
- name: "balanceOf",
550
- inputs: [{ name: "", type: "address", internalType: "address" }],
551
- outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
552
- stateMutability: "view"
553
- },
554
- {
555
- type: "function",
556
- name: "decimals",
557
- inputs: [],
558
- outputs: [{ name: "", type: "uint8", internalType: "uint8" }],
559
- stateMutability: "view"
560
- },
561
- {
562
- type: "function",
563
- name: "enter",
564
- inputs: [
565
- { name: "from", type: "address", internalType: "address" },
566
- { name: "asset", type: "address", internalType: "contract ERC20" },
567
- { name: "assetAmount", type: "uint256", internalType: "uint256" },
568
- { name: "to", type: "address", internalType: "address" },
569
- { name: "shareAmount", type: "uint256", internalType: "uint256" }
570
- ],
571
- outputs: [],
572
- stateMutability: "nonpayable"
573
- },
574
- {
575
- type: "function",
576
- name: "exit",
577
- inputs: [
578
- { name: "to", type: "address", internalType: "address" },
579
- { name: "asset", type: "address", internalType: "contract ERC20" },
580
- { name: "assetAmount", type: "uint256", internalType: "uint256" },
581
- { name: "from", type: "address", internalType: "address" },
582
- { name: "shareAmount", type: "uint256", internalType: "uint256" }
583
- ],
584
- outputs: [],
585
- stateMutability: "nonpayable"
586
- },
587
- {
588
- type: "function",
589
- name: "hook",
590
- inputs: [],
591
- outputs: [
592
- {
593
- name: "",
594
- type: "address",
595
- internalType: "contract BeforeTransferHook"
596
- }
597
- ],
598
- stateMutability: "view"
599
- },
600
- {
601
- type: "function",
602
- name: "manage",
603
- inputs: [
604
- { name: "targets", type: "address[]", internalType: "address[]" },
605
- { name: "data", type: "bytes[]", internalType: "bytes[]" },
606
- { name: "values", type: "uint256[]", internalType: "uint256[]" }
607
- ],
608
- outputs: [{ name: "results", type: "bytes[]", internalType: "bytes[]" }],
609
- stateMutability: "nonpayable"
610
- },
611
- {
612
- type: "function",
613
- name: "manage",
614
- inputs: [
615
- { name: "target", type: "address", internalType: "address" },
616
- { name: "data", type: "bytes", internalType: "bytes" },
617
- { name: "value", type: "uint256", internalType: "uint256" }
618
- ],
619
- outputs: [{ name: "result", type: "bytes", internalType: "bytes" }],
620
- stateMutability: "nonpayable"
621
- },
622
- {
623
- type: "function",
624
- name: "name",
625
- inputs: [],
626
- outputs: [{ name: "", type: "string", internalType: "string" }],
627
- stateMutability: "view"
628
- },
629
- {
630
- type: "function",
631
- name: "nonces",
632
- inputs: [{ name: "", type: "address", internalType: "address" }],
633
- outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
634
- stateMutability: "view"
635
- },
636
- {
637
- type: "function",
638
- name: "onERC1155BatchReceived",
639
- inputs: [
640
- { name: "", type: "address", internalType: "address" },
641
- { name: "", type: "address", internalType: "address" },
642
- { name: "", type: "uint256[]", internalType: "uint256[]" },
643
- { name: "", type: "uint256[]", internalType: "uint256[]" },
644
- { name: "", type: "bytes", internalType: "bytes" }
645
- ],
646
- outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }],
647
- stateMutability: "nonpayable"
648
- },
649
- {
650
- type: "function",
651
- name: "onERC1155Received",
652
- inputs: [
653
- { name: "", type: "address", internalType: "address" },
654
- { name: "", type: "address", internalType: "address" },
655
- { name: "", type: "uint256", internalType: "uint256" },
656
- { name: "", type: "uint256", internalType: "uint256" },
657
- { name: "", type: "bytes", internalType: "bytes" }
658
- ],
659
- outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }],
660
- stateMutability: "nonpayable"
661
- },
662
- {
663
- type: "function",
664
- name: "onERC721Received",
665
- inputs: [
666
- { name: "", type: "address", internalType: "address" },
667
- { name: "", type: "address", internalType: "address" },
668
- { name: "", type: "uint256", internalType: "uint256" },
669
- { name: "", type: "bytes", internalType: "bytes" }
670
- ],
671
- outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }],
672
- stateMutability: "nonpayable"
673
- },
674
- {
675
- type: "function",
676
- name: "owner",
677
- inputs: [],
678
- outputs: [{ name: "", type: "address", internalType: "address" }],
679
- stateMutability: "view"
680
- },
681
- {
682
- type: "function",
683
- name: "permit",
684
- inputs: [
685
- { name: "owner", type: "address", internalType: "address" },
686
- { name: "spender", type: "address", internalType: "address" },
687
- { name: "value", type: "uint256", internalType: "uint256" },
688
- { name: "deadline", type: "uint256", internalType: "uint256" },
689
- { name: "v", type: "uint8", internalType: "uint8" },
690
- { name: "r", type: "bytes32", internalType: "bytes32" },
691
- { name: "s", type: "bytes32", internalType: "bytes32" }
692
- ],
693
- outputs: [],
694
- stateMutability: "nonpayable"
695
- },
696
- {
697
- type: "function",
698
- name: "setAuthority",
699
- inputs: [
700
- {
701
- name: "newAuthority",
702
- type: "address",
703
- internalType: "contract Authority"
704
- }
705
- ],
706
- outputs: [],
707
- stateMutability: "nonpayable"
708
- },
709
- {
710
- type: "function",
711
- name: "setBeforeTransferHook",
712
- inputs: [{ name: "_hook", type: "address", internalType: "address" }],
713
- outputs: [],
714
- stateMutability: "nonpayable"
715
- },
716
- {
717
- type: "function",
718
- name: "supportsInterface",
719
- inputs: [{ name: "interfaceId", type: "bytes4", internalType: "bytes4" }],
720
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
721
- stateMutability: "view"
722
- },
723
- {
724
- type: "function",
725
- name: "symbol",
726
- inputs: [],
727
- outputs: [{ name: "", type: "string", internalType: "string" }],
728
- stateMutability: "view"
729
- },
730
- {
731
- type: "function",
732
- name: "totalSupply",
733
- inputs: [],
734
- outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
735
- stateMutability: "view"
736
- },
737
- {
738
- type: "function",
739
- name: "transfer",
740
- inputs: [
741
- { name: "to", type: "address", internalType: "address" },
742
- { name: "amount", type: "uint256", internalType: "uint256" }
743
- ],
744
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
745
- stateMutability: "nonpayable"
746
- },
747
- {
748
- type: "function",
749
- name: "transferFrom",
750
- inputs: [
751
- { name: "from", type: "address", internalType: "address" },
752
- { name: "to", type: "address", internalType: "address" },
753
- { name: "amount", type: "uint256", internalType: "uint256" }
754
- ],
755
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
756
- stateMutability: "nonpayable"
757
- },
758
- {
759
- type: "function",
760
- name: "transferOwnership",
761
- inputs: [{ name: "newOwner", type: "address", internalType: "address" }],
762
- outputs: [],
763
- stateMutability: "nonpayable"
764
- },
765
- {
766
- type: "event",
767
- name: "Approval",
768
- inputs: [
769
- {
770
- name: "owner",
771
- type: "address",
772
- indexed: true,
773
- internalType: "address"
774
- },
775
- {
776
- name: "spender",
777
- type: "address",
778
- indexed: true,
779
- internalType: "address"
780
- },
781
- {
782
- name: "amount",
783
- type: "uint256",
784
- indexed: false,
785
- internalType: "uint256"
786
- }
787
- ],
788
- anonymous: false
789
- },
790
- {
791
- type: "event",
792
- name: "AuthorityUpdated",
793
- inputs: [
794
- { name: "user", type: "address", indexed: true, internalType: "address" },
795
- {
796
- name: "newAuthority",
797
- type: "address",
798
- indexed: true,
799
- internalType: "contract Authority"
800
- }
801
- ],
802
- anonymous: false
803
- },
804
- {
805
- type: "event",
806
- name: "Enter",
807
- inputs: [
808
- { name: "from", type: "address", indexed: true, internalType: "address" },
809
- {
810
- name: "asset",
811
- type: "address",
812
- indexed: true,
813
- internalType: "address"
814
- },
815
- {
816
- name: "amount",
817
- type: "uint256",
818
- indexed: false,
819
- internalType: "uint256"
820
- },
821
- { name: "to", type: "address", indexed: true, internalType: "address" },
822
- {
823
- name: "shares",
824
- type: "uint256",
825
- indexed: false,
826
- internalType: "uint256"
827
- }
828
- ],
829
- anonymous: false
830
- },
831
- {
832
- type: "event",
833
- name: "Exit",
834
- inputs: [
835
- { name: "to", type: "address", indexed: true, internalType: "address" },
836
- {
837
- name: "asset",
838
- type: "address",
839
- indexed: true,
840
- internalType: "address"
841
- },
842
- {
843
- name: "amount",
844
- type: "uint256",
845
- indexed: false,
846
- internalType: "uint256"
847
- },
848
- { name: "from", type: "address", indexed: true, internalType: "address" },
849
- {
850
- name: "shares",
851
- type: "uint256",
852
- indexed: false,
853
- internalType: "uint256"
854
- }
855
- ],
856
- anonymous: false
857
- },
858
- {
859
- type: "event",
860
- name: "OwnershipTransferred",
861
- inputs: [
862
- { name: "user", type: "address", indexed: true, internalType: "address" },
863
- {
864
- name: "newOwner",
865
- type: "address",
866
- indexed: true,
867
- internalType: "address"
868
- }
869
- ],
870
- anonymous: false
871
- },
872
- {
873
- type: "event",
874
- name: "Transfer",
875
- inputs: [
876
- { name: "from", type: "address", indexed: true, internalType: "address" },
877
- { name: "to", type: "address", indexed: true, internalType: "address" },
878
- {
879
- name: "amount",
880
- type: "uint256",
881
- indexed: false,
882
- internalType: "uint256"
883
- }
884
- ],
885
- anonymous: false
886
- },
887
- {
888
- type: "error",
889
- name: "AddressEmptyCode",
890
- inputs: [{ name: "target", type: "address", internalType: "address" }]
891
- },
892
- {
893
- type: "error",
894
- name: "AddressInsufficientBalance",
895
- inputs: [{ name: "account", type: "address", internalType: "address" }]
896
- },
897
- { type: "error", name: "FailedInnerCall", inputs: [] }
898
- ];
899
-
900
- // src/api/accountant.ts
901
- var getRateInQuoteWithAssetDecimals = async ({
902
- assetAddress,
903
- accountantAddress,
904
- chainId
905
- }) => {
906
- const client = await chunkWYBYBPX5_js.getClient(chainId);
907
- const results = await client.multicall({
908
- contracts: [
909
- {
910
- abi: viem.erc20Abi,
911
- address: assetAddress,
912
- functionName: "decimals"
913
- },
914
- {
915
- abi: AccountantAbi,
916
- address: accountantAddress,
917
- functionName: "getRateInQuote",
918
- args: [assetAddress]
919
- }
920
- ]
921
- });
922
- return results;
923
- };
924
-
925
- // src/abi/erc2612-abi.ts
926
- var erc2612Abi = [
927
- // Standard ERC20 functions (subset needed for permit flow)
928
- {
929
- constant: true,
930
- inputs: [{ name: "_owner", type: "address" }],
931
- name: "nonces",
932
- outputs: [{ name: "", type: "uint256" }],
933
- type: "function"
934
- },
935
- {
936
- constant: true,
937
- inputs: [],
938
- name: "DOMAIN_SEPARATOR",
939
- outputs: [{ name: "", type: "bytes32" }],
940
- type: "function"
941
- },
942
- {
943
- constant: false,
944
- inputs: [
945
- { name: "owner", type: "address" },
946
- { name: "spender", type: "address" },
947
- { name: "value", type: "uint256" },
948
- { name: "deadline", type: "uint256" },
949
- { name: "v", type: "uint8" },
950
- { name: "r", type: "bytes32" },
951
- { name: "s", type: "bytes32" }
952
- ],
953
- name: "permit",
954
- outputs: [],
955
- type: "function"
956
- },
957
- {
958
- constant: true,
959
- inputs: [],
960
- name: "name",
961
- outputs: [{ name: "", type: "string" }],
962
- type: "function"
963
- },
964
- {
965
- constant: true,
966
- inputs: [],
967
- name: "version",
968
- outputs: [{ name: "", type: "string" }],
969
- type: "function"
970
- }
971
- ];
972
-
973
- // src/api/erc20.ts
974
- var getErc20Balance = async ({
975
- chainId,
976
- tokenAddress,
977
- recipientAddress
978
- }) => {
979
- const client = await chunkWYBYBPX5_js.getClient(chainId);
980
- const balance = await client.readContract({
981
- abi: viem.erc20Abi,
982
- address: tokenAddress,
983
- functionName: "balanceOf",
984
- args: [recipientAddress]
985
- });
986
- return balance;
987
- };
988
- var getErc20Decimals = async ({
989
- chainId,
990
- tokenAddress
991
- }) => {
992
- const client = await chunkWYBYBPX5_js.getClient(chainId);
993
- const balance = await client.readContract({
994
- abi: viem.erc20Abi,
995
- address: tokenAddress,
996
- functionName: "decimals"
997
- });
998
- return balance;
999
- };
1000
- var getErc20Allowance = async ({
1001
- chainId,
1002
- tokenAddress,
1003
- recipientAddress,
1004
- spenderAddress
1005
- }) => {
1006
- const client = await chunkWYBYBPX5_js.getClient(chainId);
1007
- const allowance = await client.readContract({
1008
- abi: viem.erc20Abi,
1009
- address: tokenAddress,
1010
- functionName: "allowance",
1011
- args: [recipientAddress, spenderAddress]
1012
- });
1013
- return allowance;
1014
- };
1015
- var getErc20AllowanceWithDecimals = async ({
1016
- chainId,
1017
- tokenAddress,
1018
- recipientAddress,
1019
- spenderAddress
1020
- }) => {
1021
- const client = await chunkWYBYBPX5_js.getClient(chainId);
1022
- const allowance = await client.multicall({
1023
- contracts: [
1024
- {
1025
- abi: viem.erc20Abi,
1026
- address: tokenAddress,
1027
- functionName: "allowance",
1028
- args: [recipientAddress, spenderAddress]
1029
- },
1030
- {
1031
- abi: viem.erc20Abi,
1032
- address: tokenAddress,
1033
- functionName: "decimals"
1034
- }
1035
- ]
1036
- });
1037
- return allowance;
1038
- };
1039
- var getTokenPermitInfoWithAllowance = async ({
1040
- chainId,
1041
- tokenAddress,
1042
- owner,
1043
- spender
1044
- }) => {
1045
- const client = await chunkWYBYBPX5_js.getClient(chainId);
1046
- const results = await client.multicall({
1047
- contracts: [
1048
- {
1049
- abi: viem.erc20Abi,
1050
- address: tokenAddress,
1051
- functionName: "decimals"
1052
- },
1053
- {
1054
- abi: viem.erc20Abi,
1055
- address: tokenAddress,
1056
- functionName: "allowance",
1057
- args: [owner, spender]
1058
- },
1059
- {
1060
- abi: erc2612Abi,
1061
- address: tokenAddress,
1062
- functionName: "nonces",
1063
- args: [owner]
1064
- },
1065
- {
1066
- abi: erc2612Abi,
1067
- address: tokenAddress,
1068
- functionName: "DOMAIN_SEPARATOR"
1069
- },
1070
- {
1071
- abi: viem.erc20Abi,
1072
- address: tokenAddress,
1073
- functionName: "name"
1074
- },
1075
- {
1076
- abi: erc2612Abi,
1077
- address: tokenAddress,
1078
- functionName: "version"
1079
- }
1080
- ],
1081
- allowFailure: true
1082
- });
1083
- const [
1084
- decimalsResult,
1085
- allowanceResult,
1086
- nonceResult,
1087
- domainSeparatorResult,
1088
- nameResult,
1089
- versionResult
1090
- ] = results;
1091
- if (decimalsResult.status === "failure") {
1092
- throw new chunkWYBYBPX5_js.APIError(
1093
- `Failed to read decimals from token ${tokenAddress}: ${decimalsResult.error?.message || "Unknown error"}`,
1094
- {
1095
- endpoint: "getTokenPermitInfoWithAllowance",
1096
- cause: decimalsResult.error
1097
- }
1098
- );
1099
- }
1100
- if (allowanceResult.status === "failure") {
1101
- throw new chunkWYBYBPX5_js.APIError(
1102
- `Failed to read allowance from token ${tokenAddress}: ${allowanceResult.error?.message || "Unknown error"}`,
1103
- {
1104
- endpoint: "getTokenPermitInfoWithAllowance",
1105
- cause: allowanceResult.error
1106
- }
1107
- );
1108
- }
1109
- if (nameResult.status === "failure") {
1110
- throw new chunkWYBYBPX5_js.APIError(
1111
- `Failed to read name from token ${tokenAddress}: ${nameResult.error?.message || "Unknown error"}`,
1112
- {
1113
- endpoint: "getTokenPermitInfoWithAllowance",
1114
- cause: nameResult.error
1115
- }
1116
- );
1117
- }
1118
- const nonce = nonceResult.status === "success" ? nonceResult.result : null;
1119
- const domainSeparator = domainSeparatorResult.status === "success" ? domainSeparatorResult.result : null;
1120
- const supportsPermit = nonce !== null && domainSeparator !== null;
1121
- const tokenVersion = versionResult.status === "success" ? versionResult.result : "1";
1122
- return {
1123
- decimals: decimalsResult.result,
1124
- allowance: allowanceResult.result,
1125
- supportsPermit,
1126
- nonce,
1127
- domainSeparator,
1128
- tokenName: nameResult.result,
1129
- tokenVersion
1130
- };
1131
- };
1132
-
1133
- exports.AccountantAbi = AccountantAbi;
1134
- exports.BoringVaultAbi = BoringVaultAbi;
1135
- exports.erc2612Abi = erc2612Abi;
1136
- exports.getErc20Allowance = getErc20Allowance;
1137
- exports.getErc20AllowanceWithDecimals = getErc20AllowanceWithDecimals;
1138
- exports.getErc20Balance = getErc20Balance;
1139
- exports.getErc20Decimals = getErc20Decimals;
1140
- exports.getRateInQuoteWithAssetDecimals = getRateInQuoteWithAssetDecimals;
1141
- exports.getTokenPermitInfoWithAllowance = getTokenPermitInfoWithAllowance;
1142
- //# sourceMappingURL=chunk-NNDY5TID.js.map
1143
- //# sourceMappingURL=chunk-NNDY5TID.js.map