@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
package/dist/core.js DELETED
@@ -1,1220 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkNNDY5TID_js = require('./chunk-NNDY5TID.js');
4
- var chunkWYBYBPX5_js = require('./chunk-WYBYBPX5.js');
5
- var viem = require('viem');
6
-
7
- async function getVaultAllowance({
8
- tokenAddress,
9
- spenderAddress,
10
- recipientAddress,
11
- chainId
12
- }) {
13
- const client = await chunkWYBYBPX5_js.getClient(chainId);
14
- const allowance = await client.readContract({
15
- abi: viem.erc20Abi,
16
- address: tokenAddress,
17
- functionName: "allowance",
18
- args: [recipientAddress, spenderAddress]
19
- });
20
- return allowance;
21
- }
22
- async function getTotalSupply({
23
- tokenAddress,
24
- chainId
25
- }) {
26
- const client = await chunkWYBYBPX5_js.getClient(chainId);
27
- const totalSupply = await client.readContract({
28
- abi: viem.erc20Abi,
29
- address: tokenAddress,
30
- functionName: "totalSupply"
31
- });
32
- return totalSupply;
33
- }
34
-
35
- // src/abi/chainlink-abi.ts
36
- var ChainlinkAbi = [
37
- {
38
- type: "function",
39
- name: "latestRoundData",
40
- inputs: [],
41
- outputs: [
42
- {
43
- name: "roundId",
44
- type: "uint80",
45
- internalType: "uint80"
46
- },
47
- {
48
- name: "answer",
49
- type: "int256",
50
- internalType: "int256"
51
- },
52
- {
53
- name: "startedAt",
54
- type: "uint256",
55
- internalType: "uint256"
56
- },
57
- {
58
- name: "updatedAt",
59
- type: "uint256",
60
- internalType: "uint256"
61
- },
62
- {
63
- name: "answeredInRound",
64
- type: "uint80",
65
- internalType: "uint80"
66
- }
67
- ],
68
- stateMutability: "view"
69
- }
70
- ];
71
-
72
- // src/api/chainlink.ts
73
- async function getEthPrice({
74
- chainId
75
- }) {
76
- const client = await chunkWYBYBPX5_js.getClient(chainId);
77
- const priceData = await client.readContract({
78
- abi: ChainlinkAbi,
79
- address: chunkWYBYBPX5_js.CHAINLINK_ADDRESS,
80
- functionName: "latestRoundData",
81
- args: []
82
- });
83
- if (!priceData || !priceData[1]) {
84
- throw new Error("Failed to fetch ETH price from Chainlink");
85
- }
86
- return priceData[1];
87
- }
88
-
89
- // src/abi/teller-abi.ts
90
- var TellerAbi = [
91
- {
92
- inputs: [
93
- { internalType: "address", name: "_owner", type: "address" },
94
- { internalType: "address", name: "_vault", type: "address" },
95
- { internalType: "address", name: "_accountant", type: "address" },
96
- { internalType: "address", name: "_endpoint", type: "address" }
97
- ],
98
- stateMutability: "nonpayable",
99
- type: "constructor"
100
- },
101
- { inputs: [], name: "InvalidDelegate", type: "error" },
102
- { inputs: [], name: "InvalidEndpointCall", type: "error" },
103
- {
104
- inputs: [{ internalType: "uint16", name: "optionType", type: "uint16" }],
105
- name: "InvalidOptionType",
106
- type: "error"
107
- },
108
- { inputs: [], name: "LzTokenUnavailable", type: "error" },
109
- {
110
- inputs: [],
111
- name: "MultiChainLayerZeroTellerWithMultiAssetSupport_InvalidToken",
112
- type: "error"
113
- },
114
- {
115
- inputs: [],
116
- name: "MultiChainTellerBase_DestinationChainReceiverIsZeroAddress",
117
- type: "error"
118
- },
119
- { inputs: [], name: "MultiChainTellerBase_GasLimitExceeded", type: "error" },
120
- { inputs: [], name: "MultiChainTellerBase_GasTooLow", type: "error" },
121
- {
122
- inputs: [{ internalType: "uint32", name: "chainSelector", type: "uint32" }],
123
- name: "MultiChainTellerBase_MessagesNotAllowedFrom",
124
- type: "error"
125
- },
126
- {
127
- inputs: [
128
- { internalType: "uint256", name: "chainSelector", type: "uint256" }
129
- ],
130
- name: "MultiChainTellerBase_MessagesNotAllowedTo",
131
- type: "error"
132
- },
133
- {
134
- inputs: [],
135
- name: "MultiChainTellerBase_TargetTellerIsZeroAddress",
136
- type: "error"
137
- },
138
- {
139
- inputs: [],
140
- name: "MultiChainTellerBase_ZeroMessageGasLimit",
141
- type: "error"
142
- },
143
- {
144
- inputs: [{ internalType: "uint32", name: "eid", type: "uint32" }],
145
- name: "NoPeer",
146
- type: "error"
147
- },
148
- {
149
- inputs: [{ internalType: "uint256", name: "msgValue", type: "uint256" }],
150
- name: "NotEnoughNative",
151
- type: "error"
152
- },
153
- {
154
- inputs: [{ internalType: "address", name: "addr", type: "address" }],
155
- name: "OnlyEndpoint",
156
- type: "error"
157
- },
158
- {
159
- inputs: [
160
- { internalType: "uint32", name: "eid", type: "uint32" },
161
- { internalType: "bytes32", name: "sender", type: "bytes32" }
162
- ],
163
- name: "OnlyPeer",
164
- type: "error"
165
- },
166
- {
167
- inputs: [
168
- { internalType: "uint8", name: "bits", type: "uint8" },
169
- { internalType: "uint256", name: "value", type: "uint256" }
170
- ],
171
- name: "SafeCastOverflowedUintDowncast",
172
- type: "error"
173
- },
174
- {
175
- inputs: [{ internalType: "address", name: "token", type: "address" }],
176
- name: "SafeERC20FailedOperation",
177
- type: "error"
178
- },
179
- {
180
- inputs: [],
181
- name: "TellerWithMultiAssetSupport__AssetNotSupported",
182
- type: "error"
183
- },
184
- {
185
- inputs: [],
186
- name: "TellerWithMultiAssetSupport__BadDepositHash",
187
- type: "error"
188
- },
189
- {
190
- inputs: [],
191
- name: "TellerWithMultiAssetSupport__MinimumAssetsNotMet",
192
- type: "error"
193
- },
194
- {
195
- inputs: [],
196
- name: "TellerWithMultiAssetSupport__MinimumMintNotMet",
197
- type: "error"
198
- },
199
- { inputs: [], name: "TellerWithMultiAssetSupport__Paused", type: "error" },
200
- {
201
- inputs: [],
202
- name: "TellerWithMultiAssetSupport__PermitFailedAndAllowanceTooLow",
203
- type: "error"
204
- },
205
- {
206
- inputs: [],
207
- name: "TellerWithMultiAssetSupport__ShareLockPeriodTooLong",
208
- type: "error"
209
- },
210
- {
211
- inputs: [],
212
- name: "TellerWithMultiAssetSupport__SharesAreLocked",
213
- type: "error"
214
- },
215
- {
216
- inputs: [],
217
- name: "TellerWithMultiAssetSupport__SharesAreUnLocked",
218
- type: "error"
219
- },
220
- {
221
- inputs: [],
222
- name: "TellerWithMultiAssetSupport__ZeroAssets",
223
- type: "error"
224
- },
225
- {
226
- inputs: [],
227
- name: "TellerWithMultiAssetSupport__ZeroShares",
228
- type: "error"
229
- },
230
- {
231
- anonymous: false,
232
- inputs: [
233
- {
234
- indexed: true,
235
- internalType: "address",
236
- name: "asset",
237
- type: "address"
238
- }
239
- ],
240
- name: "AssetAdded",
241
- type: "event"
242
- },
243
- {
244
- anonymous: false,
245
- inputs: [
246
- {
247
- indexed: true,
248
- internalType: "address",
249
- name: "asset",
250
- type: "address"
251
- }
252
- ],
253
- name: "AssetRemoved",
254
- type: "event"
255
- },
256
- {
257
- anonymous: false,
258
- inputs: [
259
- { indexed: true, internalType: "address", name: "user", type: "address" },
260
- {
261
- indexed: true,
262
- internalType: "contract Authority",
263
- name: "newAuthority",
264
- type: "address"
265
- }
266
- ],
267
- name: "AuthorityUpdated",
268
- type: "event"
269
- },
270
- {
271
- anonymous: false,
272
- inputs: [
273
- {
274
- indexed: true,
275
- internalType: "address",
276
- name: "asset",
277
- type: "address"
278
- },
279
- {
280
- indexed: false,
281
- internalType: "uint256",
282
- name: "depositAmount",
283
- type: "uint256"
284
- }
285
- ],
286
- name: "BulkDeposit",
287
- type: "event"
288
- },
289
- {
290
- anonymous: false,
291
- inputs: [
292
- {
293
- indexed: true,
294
- internalType: "address",
295
- name: "asset",
296
- type: "address"
297
- },
298
- {
299
- indexed: false,
300
- internalType: "uint256",
301
- name: "shareAmount",
302
- type: "uint256"
303
- }
304
- ],
305
- name: "BulkWithdraw",
306
- type: "event"
307
- },
308
- {
309
- anonymous: false,
310
- inputs: [
311
- {
312
- indexed: false,
313
- internalType: "uint256",
314
- name: "chainSelector",
315
- type: "uint256"
316
- },
317
- {
318
- indexed: false,
319
- internalType: "bool",
320
- name: "allowMessagesFrom",
321
- type: "bool"
322
- },
323
- {
324
- indexed: false,
325
- internalType: "bool",
326
- name: "allowMessagesTo",
327
- type: "bool"
328
- },
329
- {
330
- indexed: false,
331
- internalType: "address",
332
- name: "targetTeller",
333
- type: "address"
334
- },
335
- {
336
- indexed: false,
337
- internalType: "uint64",
338
- name: "messageGasLimit",
339
- type: "uint64"
340
- },
341
- {
342
- indexed: false,
343
- internalType: "uint64",
344
- name: "messageGasMin",
345
- type: "uint64"
346
- }
347
- ],
348
- name: "ChainAdded",
349
- type: "event"
350
- },
351
- {
352
- anonymous: false,
353
- inputs: [
354
- {
355
- indexed: false,
356
- internalType: "uint256",
357
- name: "chainSelector",
358
- type: "uint256"
359
- },
360
- {
361
- indexed: false,
362
- internalType: "address",
363
- name: "targetTeller",
364
- type: "address"
365
- }
366
- ],
367
- name: "ChainAllowMessagesFrom",
368
- type: "event"
369
- },
370
- {
371
- anonymous: false,
372
- inputs: [
373
- {
374
- indexed: false,
375
- internalType: "uint256",
376
- name: "chainSelector",
377
- type: "uint256"
378
- },
379
- {
380
- indexed: false,
381
- internalType: "address",
382
- name: "targetTeller",
383
- type: "address"
384
- }
385
- ],
386
- name: "ChainAllowMessagesTo",
387
- type: "event"
388
- },
389
- {
390
- anonymous: false,
391
- inputs: [
392
- {
393
- indexed: false,
394
- internalType: "uint256",
395
- name: "chainSelector",
396
- type: "uint256"
397
- }
398
- ],
399
- name: "ChainRemoved",
400
- type: "event"
401
- },
402
- {
403
- anonymous: false,
404
- inputs: [
405
- {
406
- indexed: false,
407
- internalType: "uint256",
408
- name: "chainSelector",
409
- type: "uint256"
410
- },
411
- {
412
- indexed: false,
413
- internalType: "uint64",
414
- name: "messageGasLimit",
415
- type: "uint64"
416
- }
417
- ],
418
- name: "ChainSetGasLimit",
419
- type: "event"
420
- },
421
- {
422
- anonymous: false,
423
- inputs: [
424
- {
425
- indexed: false,
426
- internalType: "uint256",
427
- name: "chainSelector",
428
- type: "uint256"
429
- }
430
- ],
431
- name: "ChainStopMessagesFrom",
432
- type: "event"
433
- },
434
- {
435
- anonymous: false,
436
- inputs: [
437
- {
438
- indexed: false,
439
- internalType: "uint256",
440
- name: "chainSelector",
441
- type: "uint256"
442
- }
443
- ],
444
- name: "ChainStopMessagesTo",
445
- type: "event"
446
- },
447
- {
448
- anonymous: false,
449
- inputs: [
450
- {
451
- indexed: true,
452
- internalType: "uint256",
453
- name: "nonce",
454
- type: "uint256"
455
- },
456
- {
457
- indexed: true,
458
- internalType: "address",
459
- name: "receiver",
460
- type: "address"
461
- },
462
- {
463
- indexed: true,
464
- internalType: "address",
465
- name: "depositAsset",
466
- type: "address"
467
- },
468
- {
469
- indexed: false,
470
- internalType: "uint256",
471
- name: "depositAmount",
472
- type: "uint256"
473
- },
474
- {
475
- indexed: false,
476
- internalType: "uint256",
477
- name: "shareAmount",
478
- type: "uint256"
479
- },
480
- {
481
- indexed: false,
482
- internalType: "uint256",
483
- name: "depositTimestamp",
484
- type: "uint256"
485
- },
486
- {
487
- indexed: false,
488
- internalType: "uint256",
489
- name: "shareLockPeriodAtTimeOfDeposit",
490
- type: "uint256"
491
- }
492
- ],
493
- name: "Deposit",
494
- type: "event"
495
- },
496
- {
497
- anonymous: false,
498
- inputs: [
499
- {
500
- indexed: true,
501
- internalType: "uint256",
502
- name: "nonce",
503
- type: "uint256"
504
- },
505
- {
506
- indexed: false,
507
- internalType: "bytes32",
508
- name: "depositHash",
509
- type: "bytes32"
510
- },
511
- { indexed: true, internalType: "address", name: "user", type: "address" }
512
- ],
513
- name: "DepositRefunded",
514
- type: "event"
515
- },
516
- {
517
- anonymous: false,
518
- inputs: [
519
- {
520
- indexed: false,
521
- internalType: "bytes32",
522
- name: "messageId",
523
- type: "bytes32"
524
- },
525
- {
526
- indexed: false,
527
- internalType: "uint256",
528
- name: "shareAmount",
529
- type: "uint256"
530
- },
531
- { indexed: false, internalType: "address", name: "to", type: "address" }
532
- ],
533
- name: "MessageReceived",
534
- type: "event"
535
- },
536
- {
537
- anonymous: false,
538
- inputs: [
539
- {
540
- indexed: false,
541
- internalType: "bytes32",
542
- name: "messageId",
543
- type: "bytes32"
544
- },
545
- {
546
- indexed: false,
547
- internalType: "uint256",
548
- name: "shareAmount",
549
- type: "uint256"
550
- },
551
- { indexed: false, internalType: "address", name: "to", type: "address" }
552
- ],
553
- name: "MessageSent",
554
- type: "event"
555
- },
556
- {
557
- anonymous: false,
558
- inputs: [
559
- { indexed: true, internalType: "address", name: "user", type: "address" },
560
- {
561
- indexed: true,
562
- internalType: "address",
563
- name: "newOwner",
564
- type: "address"
565
- }
566
- ],
567
- name: "OwnershipTransferred",
568
- type: "event"
569
- },
570
- { anonymous: false, inputs: [], name: "Paused", type: "event" },
571
- {
572
- anonymous: false,
573
- inputs: [
574
- { indexed: false, internalType: "uint32", name: "eid", type: "uint32" },
575
- {
576
- indexed: false,
577
- internalType: "bytes32",
578
- name: "peer",
579
- type: "bytes32"
580
- }
581
- ],
582
- name: "PeerSet",
583
- type: "event"
584
- },
585
- { anonymous: false, inputs: [], name: "Unpaused", type: "event" },
586
- {
587
- inputs: [],
588
- name: "accountant",
589
- outputs: [
590
- {
591
- internalType: "contract AccountantWithRateProviders",
592
- name: "",
593
- type: "address"
594
- }
595
- ],
596
- stateMutability: "view",
597
- type: "function"
598
- },
599
- {
600
- inputs: [
601
- { internalType: "contract ERC20", name: "asset", type: "address" }
602
- ],
603
- name: "addAsset",
604
- outputs: [],
605
- stateMutability: "nonpayable",
606
- type: "function"
607
- },
608
- {
609
- inputs: [
610
- { internalType: "uint32", name: "chainSelector", type: "uint32" },
611
- { internalType: "bool", name: "allowMessagesFrom", type: "bool" },
612
- { internalType: "bool", name: "allowMessagesTo", type: "bool" },
613
- { internalType: "address", name: "targetTeller", type: "address" },
614
- { internalType: "uint64", name: "messageGasLimit", type: "uint64" },
615
- { internalType: "uint64", name: "messageGasMin", type: "uint64" }
616
- ],
617
- name: "addChain",
618
- outputs: [],
619
- stateMutability: "nonpayable",
620
- type: "function"
621
- },
622
- {
623
- inputs: [
624
- {
625
- components: [
626
- { internalType: "uint32", name: "srcEid", type: "uint32" },
627
- { internalType: "bytes32", name: "sender", type: "bytes32" },
628
- { internalType: "uint64", name: "nonce", type: "uint64" }
629
- ],
630
- internalType: "struct Origin",
631
- name: "origin",
632
- type: "tuple"
633
- }
634
- ],
635
- name: "allowInitializePath",
636
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
637
- stateMutability: "view",
638
- type: "function"
639
- },
640
- {
641
- inputs: [
642
- { internalType: "uint32", name: "chainSelector", type: "uint32" },
643
- { internalType: "address", name: "targetTeller", type: "address" }
644
- ],
645
- name: "allowMessagesFromChain",
646
- outputs: [],
647
- stateMutability: "nonpayable",
648
- type: "function"
649
- },
650
- {
651
- inputs: [
652
- { internalType: "uint32", name: "chainSelector", type: "uint32" },
653
- { internalType: "address", name: "targetTeller", type: "address" },
654
- { internalType: "uint64", name: "messageGasLimit", type: "uint64" }
655
- ],
656
- name: "allowMessagesToChain",
657
- outputs: [],
658
- stateMutability: "nonpayable",
659
- type: "function"
660
- },
661
- {
662
- inputs: [],
663
- name: "authority",
664
- outputs: [
665
- { internalType: "contract Authority", name: "", type: "address" }
666
- ],
667
- stateMutability: "view",
668
- type: "function"
669
- },
670
- {
671
- inputs: [{ internalType: "address", name: "from", type: "address" }],
672
- name: "beforeTransfer",
673
- outputs: [],
674
- stateMutability: "view",
675
- type: "function"
676
- },
677
- {
678
- inputs: [
679
- { internalType: "uint256", name: "shareAmount", type: "uint256" },
680
- {
681
- components: [
682
- { internalType: "uint32", name: "chainSelector", type: "uint32" },
683
- {
684
- internalType: "address",
685
- name: "destinationChainReceiver",
686
- type: "address"
687
- },
688
- {
689
- internalType: "contract ERC20",
690
- name: "bridgeFeeToken",
691
- type: "address"
692
- },
693
- { internalType: "uint64", name: "messageGas", type: "uint64" },
694
- { internalType: "bytes", name: "data", type: "bytes" }
695
- ],
696
- internalType: "struct BridgeData",
697
- name: "data",
698
- type: "tuple"
699
- }
700
- ],
701
- name: "bridge",
702
- outputs: [{ internalType: "bytes32", name: "messageId", type: "bytes32" }],
703
- stateMutability: "payable",
704
- type: "function"
705
- },
706
- {
707
- inputs: [
708
- { internalType: "contract ERC20", name: "depositAsset", type: "address" },
709
- { internalType: "uint256", name: "depositAmount", type: "uint256" },
710
- { internalType: "uint256", name: "minimumMint", type: "uint256" },
711
- { internalType: "address", name: "to", type: "address" }
712
- ],
713
- name: "bulkDeposit",
714
- outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
715
- stateMutability: "nonpayable",
716
- type: "function"
717
- },
718
- {
719
- inputs: [
720
- {
721
- internalType: "contract ERC20",
722
- name: "withdrawAsset",
723
- type: "address"
724
- },
725
- { internalType: "uint256", name: "shareAmount", type: "uint256" },
726
- { internalType: "uint256", name: "minimumAssets", type: "uint256" },
727
- { internalType: "address", name: "to", type: "address" }
728
- ],
729
- name: "bulkWithdraw",
730
- outputs: [{ internalType: "uint256", name: "assetsOut", type: "uint256" }],
731
- stateMutability: "nonpayable",
732
- type: "function"
733
- },
734
- {
735
- inputs: [
736
- { internalType: "contract ERC20", name: "depositAsset", type: "address" },
737
- { internalType: "uint256", name: "depositAmount", type: "uint256" },
738
- { internalType: "uint256", name: "minimumMint", type: "uint256" }
739
- ],
740
- name: "deposit",
741
- outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
742
- stateMutability: "nonpayable",
743
- type: "function"
744
- },
745
- {
746
- inputs: [
747
- { internalType: "contract ERC20", name: "depositAsset", type: "address" },
748
- { internalType: "uint256", name: "depositAmount", type: "uint256" },
749
- { internalType: "uint256", name: "minimumMint", type: "uint256" },
750
- {
751
- components: [
752
- { internalType: "uint32", name: "chainSelector", type: "uint32" },
753
- {
754
- internalType: "address",
755
- name: "destinationChainReceiver",
756
- type: "address"
757
- },
758
- {
759
- internalType: "contract ERC20",
760
- name: "bridgeFeeToken",
761
- type: "address"
762
- },
763
- { internalType: "uint64", name: "messageGas", type: "uint64" },
764
- { internalType: "bytes", name: "data", type: "bytes" }
765
- ],
766
- internalType: "struct BridgeData",
767
- name: "data",
768
- type: "tuple"
769
- }
770
- ],
771
- name: "depositAndBridge",
772
- outputs: [],
773
- stateMutability: "payable",
774
- type: "function"
775
- },
776
- {
777
- inputs: [],
778
- name: "depositNonce",
779
- outputs: [{ internalType: "uint96", name: "", type: "uint96" }],
780
- stateMutability: "view",
781
- type: "function"
782
- },
783
- {
784
- inputs: [
785
- { internalType: "contract ERC20", name: "depositAsset", type: "address" },
786
- { internalType: "uint256", name: "depositAmount", type: "uint256" },
787
- { internalType: "uint256", name: "minimumMint", type: "uint256" },
788
- { internalType: "uint256", name: "deadline", type: "uint256" },
789
- { internalType: "uint8", name: "v", type: "uint8" },
790
- { internalType: "bytes32", name: "r", type: "bytes32" },
791
- { internalType: "bytes32", name: "s", type: "bytes32" }
792
- ],
793
- name: "depositWithPermit",
794
- outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
795
- stateMutability: "nonpayable",
796
- type: "function"
797
- },
798
- {
799
- inputs: [],
800
- name: "endpoint",
801
- outputs: [
802
- {
803
- internalType: "contract ILayerZeroEndpointV2",
804
- name: "",
805
- type: "address"
806
- }
807
- ],
808
- stateMutability: "view",
809
- type: "function"
810
- },
811
- {
812
- inputs: [
813
- {
814
- components: [
815
- { internalType: "uint32", name: "srcEid", type: "uint32" },
816
- { internalType: "bytes32", name: "sender", type: "bytes32" },
817
- { internalType: "uint64", name: "nonce", type: "uint64" }
818
- ],
819
- internalType: "struct Origin",
820
- name: "",
821
- type: "tuple"
822
- },
823
- { internalType: "bytes", name: "", type: "bytes" },
824
- { internalType: "address", name: "_sender", type: "address" }
825
- ],
826
- name: "isComposeMsgSender",
827
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
828
- stateMutability: "view",
829
- type: "function"
830
- },
831
- {
832
- inputs: [],
833
- name: "isPaused",
834
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
835
- stateMutability: "view",
836
- type: "function"
837
- },
838
- {
839
- inputs: [{ internalType: "contract ERC20", name: "", type: "address" }],
840
- name: "isSupported",
841
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
842
- stateMutability: "view",
843
- type: "function"
844
- },
845
- {
846
- inputs: [
847
- {
848
- components: [
849
- { internalType: "uint32", name: "srcEid", type: "uint32" },
850
- { internalType: "bytes32", name: "sender", type: "bytes32" },
851
- { internalType: "uint64", name: "nonce", type: "uint64" }
852
- ],
853
- internalType: "struct Origin",
854
- name: "_origin",
855
- type: "tuple"
856
- },
857
- { internalType: "bytes32", name: "_guid", type: "bytes32" },
858
- { internalType: "bytes", name: "_message", type: "bytes" },
859
- { internalType: "address", name: "_executor", type: "address" },
860
- { internalType: "bytes", name: "_extraData", type: "bytes" }
861
- ],
862
- name: "lzReceive",
863
- outputs: [],
864
- stateMutability: "payable",
865
- type: "function"
866
- },
867
- {
868
- inputs: [
869
- { internalType: "uint32", name: "", type: "uint32" },
870
- { internalType: "bytes32", name: "", type: "bytes32" }
871
- ],
872
- name: "nextNonce",
873
- outputs: [{ internalType: "uint64", name: "nonce", type: "uint64" }],
874
- stateMutability: "view",
875
- type: "function"
876
- },
877
- {
878
- inputs: [],
879
- name: "oAppVersion",
880
- outputs: [
881
- { internalType: "uint64", name: "senderVersion", type: "uint64" },
882
- { internalType: "uint64", name: "receiverVersion", type: "uint64" }
883
- ],
884
- stateMutability: "pure",
885
- type: "function"
886
- },
887
- {
888
- inputs: [],
889
- name: "owner",
890
- outputs: [{ internalType: "address", name: "", type: "address" }],
891
- stateMutability: "view",
892
- type: "function"
893
- },
894
- {
895
- inputs: [],
896
- name: "pause",
897
- outputs: [],
898
- stateMutability: "nonpayable",
899
- type: "function"
900
- },
901
- {
902
- inputs: [{ internalType: "uint32", name: "eid", type: "uint32" }],
903
- name: "peers",
904
- outputs: [{ internalType: "bytes32", name: "peer", type: "bytes32" }],
905
- stateMutability: "view",
906
- type: "function"
907
- },
908
- {
909
- inputs: [
910
- { internalType: "uint256", name: "shareAmount", type: "uint256" },
911
- {
912
- components: [
913
- { internalType: "uint32", name: "chainSelector", type: "uint32" },
914
- {
915
- internalType: "address",
916
- name: "destinationChainReceiver",
917
- type: "address"
918
- },
919
- {
920
- internalType: "contract ERC20",
921
- name: "bridgeFeeToken",
922
- type: "address"
923
- },
924
- { internalType: "uint64", name: "messageGas", type: "uint64" },
925
- { internalType: "bytes", name: "data", type: "bytes" }
926
- ],
927
- internalType: "struct BridgeData",
928
- name: "data",
929
- type: "tuple"
930
- }
931
- ],
932
- name: "previewFee",
933
- outputs: [{ internalType: "uint256", name: "fee", type: "uint256" }],
934
- stateMutability: "view",
935
- type: "function"
936
- },
937
- {
938
- inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
939
- name: "publicDepositHistory",
940
- outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
941
- stateMutability: "view",
942
- type: "function"
943
- },
944
- {
945
- inputs: [
946
- { internalType: "uint256", name: "nonce", type: "uint256" },
947
- { internalType: "address", name: "receiver", type: "address" },
948
- { internalType: "address", name: "depositAsset", type: "address" },
949
- { internalType: "uint256", name: "depositAmount", type: "uint256" },
950
- { internalType: "uint256", name: "shareAmount", type: "uint256" },
951
- { internalType: "uint256", name: "depositTimestamp", type: "uint256" },
952
- {
953
- internalType: "uint256",
954
- name: "shareLockUpPeriodAtTimeOfDeposit",
955
- type: "uint256"
956
- }
957
- ],
958
- name: "refundDeposit",
959
- outputs: [],
960
- stateMutability: "nonpayable",
961
- type: "function"
962
- },
963
- {
964
- inputs: [
965
- { internalType: "contract ERC20", name: "asset", type: "address" }
966
- ],
967
- name: "removeAsset",
968
- outputs: [],
969
- stateMutability: "nonpayable",
970
- type: "function"
971
- },
972
- {
973
- inputs: [{ internalType: "uint32", name: "chainSelector", type: "uint32" }],
974
- name: "removeChain",
975
- outputs: [],
976
- stateMutability: "nonpayable",
977
- type: "function"
978
- },
979
- {
980
- inputs: [{ internalType: "uint32", name: "", type: "uint32" }],
981
- name: "selectorToChains",
982
- outputs: [
983
- { internalType: "bool", name: "allowMessagesFrom", type: "bool" },
984
- { internalType: "bool", name: "allowMessagesTo", type: "bool" },
985
- { internalType: "address", name: "targetTeller", type: "address" },
986
- { internalType: "uint64", name: "messageGasLimit", type: "uint64" },
987
- { internalType: "uint64", name: "minimumMessageGas", type: "uint64" }
988
- ],
989
- stateMutability: "view",
990
- type: "function"
991
- },
992
- {
993
- inputs: [
994
- {
995
- internalType: "contract Authority",
996
- name: "newAuthority",
997
- type: "address"
998
- }
999
- ],
1000
- name: "setAuthority",
1001
- outputs: [],
1002
- stateMutability: "nonpayable",
1003
- type: "function"
1004
- },
1005
- {
1006
- inputs: [
1007
- { internalType: "uint32", name: "chainSelector", type: "uint32" },
1008
- { internalType: "uint64", name: "messageGasLimit", type: "uint64" }
1009
- ],
1010
- name: "setChainGasLimit",
1011
- outputs: [],
1012
- stateMutability: "nonpayable",
1013
- type: "function"
1014
- },
1015
- {
1016
- inputs: [{ internalType: "address", name: "_delegate", type: "address" }],
1017
- name: "setDelegate",
1018
- outputs: [],
1019
- stateMutability: "nonpayable",
1020
- type: "function"
1021
- },
1022
- {
1023
- inputs: [
1024
- { internalType: "uint32", name: "_eid", type: "uint32" },
1025
- { internalType: "bytes32", name: "_peer", type: "bytes32" }
1026
- ],
1027
- name: "setPeer",
1028
- outputs: [],
1029
- stateMutability: "nonpayable",
1030
- type: "function"
1031
- },
1032
- {
1033
- inputs: [
1034
- { internalType: "uint64", name: "_shareLockPeriod", type: "uint64" }
1035
- ],
1036
- name: "setShareLockPeriod",
1037
- outputs: [],
1038
- stateMutability: "nonpayable",
1039
- type: "function"
1040
- },
1041
- {
1042
- inputs: [],
1043
- name: "shareLockPeriod",
1044
- outputs: [{ internalType: "uint64", name: "", type: "uint64" }],
1045
- stateMutability: "view",
1046
- type: "function"
1047
- },
1048
- {
1049
- inputs: [{ internalType: "address", name: "", type: "address" }],
1050
- name: "shareUnlockTime",
1051
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1052
- stateMutability: "view",
1053
- type: "function"
1054
- },
1055
- {
1056
- inputs: [{ internalType: "uint32", name: "chainSelector", type: "uint32" }],
1057
- name: "stopMessagesFromChain",
1058
- outputs: [],
1059
- stateMutability: "nonpayable",
1060
- type: "function"
1061
- },
1062
- {
1063
- inputs: [{ internalType: "uint32", name: "chainSelector", type: "uint32" }],
1064
- name: "stopMessagesToChain",
1065
- outputs: [],
1066
- stateMutability: "nonpayable",
1067
- type: "function"
1068
- },
1069
- {
1070
- inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
1071
- name: "transferOwnership",
1072
- outputs: [],
1073
- stateMutability: "nonpayable",
1074
- type: "function"
1075
- },
1076
- {
1077
- inputs: [],
1078
- name: "unpause",
1079
- outputs: [],
1080
- stateMutability: "nonpayable",
1081
- type: "function"
1082
- },
1083
- {
1084
- inputs: [],
1085
- name: "vault",
1086
- outputs: [
1087
- { internalType: "contract BoringVault", name: "", type: "address" }
1088
- ],
1089
- stateMutability: "view",
1090
- type: "function"
1091
- }
1092
- ];
1093
-
1094
- // src/api/multi-call.ts
1095
- var getPausedStates = async ({
1096
- accountantAddress,
1097
- tellerAddress,
1098
- chainId
1099
- }) => {
1100
- const client = await chunkWYBYBPX5_js.getClient(chainId);
1101
- const results = await client.multicall({
1102
- contracts: [
1103
- {
1104
- abi: TellerAbi,
1105
- address: tellerAddress,
1106
- functionName: "isPaused"
1107
- },
1108
- {
1109
- abi: chunkNNDY5TID_js.AccountantAbi,
1110
- address: accountantAddress,
1111
- functionName: "accountantState"
1112
- }
1113
- ]
1114
- });
1115
- return results;
1116
- };
1117
-
1118
- // src/api/withdraw-assets.ts
1119
- var assetsCache = null;
1120
- function constructUrl(params) {
1121
- const withdrawAssetsUrl = `${chunkWYBYBPX5_js.API_BASE_URL}/v1/protocol/withdraw-assets`;
1122
- if (!params) return withdrawAssetsUrl;
1123
- const queryParams = new URLSearchParams();
1124
- if (params.chainId) queryParams.append("chainId", params.chainId.toString());
1125
- if (params.vaultAddress)
1126
- queryParams.append("vaultAddress", params.vaultAddress.toLowerCase());
1127
- return `${withdrawAssetsUrl}?${queryParams.toString()}`;
1128
- }
1129
- async function fetchWithdrawAssets(params) {
1130
- if (!params && assetsCache) {
1131
- return assetsCache;
1132
- }
1133
- try {
1134
- const url = constructUrl(params);
1135
- const response = await fetch(url);
1136
- if (!response.ok) {
1137
- throw new Error(`HTTP error! status: ${response.status}`);
1138
- }
1139
- const data = await response.json();
1140
- if (!params) {
1141
- assetsCache = data;
1142
- }
1143
- return data;
1144
- } catch (error) {
1145
- throw new Error(
1146
- `An unknown error occurred while fetching withdraw assets: ${error instanceof Error ? error.message : String(error)}`
1147
- );
1148
- }
1149
- }
1150
-
1151
- // src/api/solver-slippage.ts
1152
- async function getAssetSlippage(chainId, vaultAddress, tokenAddress, defaultSlippage = chunkWYBYBPX5_js.DEFAULT_SLIPPAGE_BPS) {
1153
- try {
1154
- const withdrawAssets = await fetchWithdrawAssets();
1155
- if (!withdrawAssets) {
1156
- return defaultSlippage;
1157
- }
1158
- if (!withdrawAssets[chainId.toString()]) {
1159
- return defaultSlippage;
1160
- }
1161
- if (!withdrawAssets[chainId.toString()][vaultAddress.toLowerCase()]) {
1162
- return defaultSlippage;
1163
- }
1164
- if (!withdrawAssets[chainId.toString()][vaultAddress.toLowerCase()][tokenAddress.toLowerCase()]) {
1165
- return defaultSlippage;
1166
- }
1167
- return withdrawAssets[chainId.toString()][vaultAddress.toLowerCase()][tokenAddress.toLowerCase()];
1168
- } catch (error) {
1169
- throw new Error(
1170
- `Error fetching asset slippage for chain ${chainId}: ${error instanceof Error ? error.message : String(error)}`
1171
- );
1172
- }
1173
- }
1174
-
1175
- // src/api/teller.ts
1176
- var getPreviewFee = async ({
1177
- shareAmount,
1178
- bridgeData,
1179
- contractAddress,
1180
- chainId
1181
- }) => {
1182
- const client = await chunkWYBYBPX5_js.getClient(chainId);
1183
- const rate = await client.readContract({
1184
- abi: TellerAbi,
1185
- address: contractAddress,
1186
- functionName: "previewFee",
1187
- args: [shareAmount, bridgeData]
1188
- });
1189
- return rate;
1190
- };
1191
-
1192
- Object.defineProperty(exports, "getErc20Allowance", {
1193
- enumerable: true,
1194
- get: function () { return chunkNNDY5TID_js.getErc20Allowance; }
1195
- });
1196
- Object.defineProperty(exports, "getErc20Balance", {
1197
- enumerable: true,
1198
- get: function () { return chunkNNDY5TID_js.getErc20Balance; }
1199
- });
1200
- Object.defineProperty(exports, "getErc20Decimals", {
1201
- enumerable: true,
1202
- get: function () { return chunkNNDY5TID_js.getErc20Decimals; }
1203
- });
1204
- Object.defineProperty(exports, "getRateInQuoteWithAssetDecimals", {
1205
- enumerable: true,
1206
- get: function () { return chunkNNDY5TID_js.getRateInQuoteWithAssetDecimals; }
1207
- });
1208
- Object.defineProperty(exports, "toChainId", {
1209
- enumerable: true,
1210
- get: function () { return chunkWYBYBPX5_js.toChainId; }
1211
- });
1212
- exports.fetchWithdrawAssets = fetchWithdrawAssets;
1213
- exports.getAssetSlippage = getAssetSlippage;
1214
- exports.getEthPrice = getEthPrice;
1215
- exports.getPausedStates = getPausedStates;
1216
- exports.getPreviewFee = getPreviewFee;
1217
- exports.getTotalSupply = getTotalSupply;
1218
- exports.getVaultAllowance = getVaultAllowance;
1219
- //# sourceMappingURL=core.js.map
1220
- //# sourceMappingURL=core.js.map