@paxoslabs/amplify-sdk 0.0.1-alpha.1

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 (80) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/LICENSE +28 -0
  3. package/README.md +533 -0
  4. package/dist/amplify-sdk-api-B5hBTGrB.d.ts +258 -0
  5. package/dist/amplify-sdk-api-DPrRhynk.d.mts +258 -0
  6. package/dist/chunk-3I3PYX2F.js +45 -0
  7. package/dist/chunk-3I3PYX2F.js.map +1 -0
  8. package/dist/chunk-7RWWVUHP.mjs +39 -0
  9. package/dist/chunk-7RWWVUHP.mjs.map +1 -0
  10. package/dist/chunk-AFWUOS3M.js +15 -0
  11. package/dist/chunk-AFWUOS3M.js.map +1 -0
  12. package/dist/chunk-BDXS57YH.js +828 -0
  13. package/dist/chunk-BDXS57YH.js.map +1 -0
  14. package/dist/chunk-FYNPQXCR.mjs +46 -0
  15. package/dist/chunk-FYNPQXCR.mjs.map +1 -0
  16. package/dist/chunk-GE2VQUPP.mjs +228 -0
  17. package/dist/chunk-GE2VQUPP.mjs.map +1 -0
  18. package/dist/chunk-ICKDAKVS.js +16 -0
  19. package/dist/chunk-ICKDAKVS.js.map +1 -0
  20. package/dist/chunk-ISO6Z7LD.mjs +809 -0
  21. package/dist/chunk-ISO6Z7LD.mjs.map +1 -0
  22. package/dist/chunk-ITB7FXG4.js +14 -0
  23. package/dist/chunk-ITB7FXG4.js.map +1 -0
  24. package/dist/chunk-J3662HYT.mjs +29 -0
  25. package/dist/chunk-J3662HYT.mjs.map +1 -0
  26. package/dist/chunk-JLXNOGZB.js +2061 -0
  27. package/dist/chunk-JLXNOGZB.js.map +1 -0
  28. package/dist/chunk-O5P6SP2O.js +233 -0
  29. package/dist/chunk-O5P6SP2O.js.map +1 -0
  30. package/dist/chunk-R663BFAZ.mjs +14 -0
  31. package/dist/chunk-R663BFAZ.mjs.map +1 -0
  32. package/dist/chunk-RUIAH5HY.js +32 -0
  33. package/dist/chunk-RUIAH5HY.js.map +1 -0
  34. package/dist/chunk-SIR2TCAR.mjs +13 -0
  35. package/dist/chunk-SIR2TCAR.mjs.map +1 -0
  36. package/dist/chunk-XXHRCCZS.mjs +11 -0
  37. package/dist/chunk-XXHRCCZS.mjs.map +1 -0
  38. package/dist/chunk-ZSFIOWWT.js +49 -0
  39. package/dist/chunk-ZSFIOWWT.js.map +1 -0
  40. package/dist/chunk-ZZBZIDZP.mjs +2050 -0
  41. package/dist/chunk-ZZBZIDZP.mjs.map +1 -0
  42. package/dist/config-B-u3VqEX.d.mts +21 -0
  43. package/dist/config-B-u3VqEX.d.ts +21 -0
  44. package/dist/config-BQynVNDC.d.mts +101 -0
  45. package/dist/config-BQynVNDC.d.ts +101 -0
  46. package/dist/core.d.mts +152 -0
  47. package/dist/core.d.ts +152 -0
  48. package/dist/core.js +187 -0
  49. package/dist/core.js.map +1 -0
  50. package/dist/core.mjs +150 -0
  51. package/dist/core.mjs.map +1 -0
  52. package/dist/display.d.mts +25 -0
  53. package/dist/display.d.ts +25 -0
  54. package/dist/display.js +124 -0
  55. package/dist/display.js.map +1 -0
  56. package/dist/display.mjs +105 -0
  57. package/dist/display.mjs.map +1 -0
  58. package/dist/exchange-rate-CRA_CMaX.d.mts +65 -0
  59. package/dist/exchange-rate-D3_FVgqa.d.ts +65 -0
  60. package/dist/index.d.mts +3236 -0
  61. package/dist/index.d.ts +3236 -0
  62. package/dist/index.js +1115 -0
  63. package/dist/index.js.map +1 -0
  64. package/dist/index.mjs +1047 -0
  65. package/dist/index.mjs.map +1 -0
  66. package/dist/utils.d.mts +111 -0
  67. package/dist/utils.d.ts +111 -0
  68. package/dist/utils.js +51 -0
  69. package/dist/utils.js.map +1 -0
  70. package/dist/utils.mjs +17 -0
  71. package/dist/utils.mjs.map +1 -0
  72. package/dist/vault-config-BNzhv3QV.d.ts +15 -0
  73. package/dist/vault-config-BjSE7oL8.d.mts +15 -0
  74. package/dist/vaults.d.mts +6 -0
  75. package/dist/vaults.d.ts +6 -0
  76. package/dist/vaults.js +13 -0
  77. package/dist/vaults.js.map +1 -0
  78. package/dist/vaults.mjs +4 -0
  79. package/dist/vaults.mjs.map +1 -0
  80. package/package.json +142 -0
@@ -0,0 +1,2050 @@
1
+ import { toChainId } from './chunk-J3662HYT.mjs';
2
+ import { getChainFromConfig, fetchVaults } from './chunk-ISO6Z7LD.mjs';
3
+ import { createPublicClient, http, erc20Abi } from 'viem';
4
+
5
+ var clients = /* @__PURE__ */ new Map();
6
+ var getClient = async (chainId) => {
7
+ if (!chainId) {
8
+ throw new Error("Chain ID is required");
9
+ }
10
+ if (!clients.has(chainId)) {
11
+ const chain = await getChainFromConfig(
12
+ toChainId(chainId),
13
+ await fetchVaults()
14
+ );
15
+ const client2 = createPublicClient({
16
+ chain,
17
+ transport: http(chain.rpcUrls.default.http[0])
18
+ });
19
+ clients.set(chainId, client2);
20
+ }
21
+ const client = clients.get(chainId);
22
+ if (!client) {
23
+ throw new Error(`Client not found for chain ID ${chainId}`);
24
+ }
25
+ return client;
26
+ };
27
+
28
+ // src/api/erc20.ts
29
+ var getErc20Balance = async ({
30
+ chainId,
31
+ tokenAddress,
32
+ userAddress
33
+ }) => {
34
+ const client = await getClient(chainId);
35
+ const balance = await client.readContract({
36
+ abi: erc20Abi,
37
+ address: tokenAddress,
38
+ functionName: "balanceOf",
39
+ args: [userAddress]
40
+ });
41
+ return balance;
42
+ };
43
+ var getErc20Decimals = async ({
44
+ chainId,
45
+ tokenAddress
46
+ }) => {
47
+ const client = await getClient(chainId);
48
+ const balance = await client.readContract({
49
+ abi: erc20Abi,
50
+ address: tokenAddress,
51
+ functionName: "decimals"
52
+ });
53
+ return balance;
54
+ };
55
+ var getErc20Allowance = async ({
56
+ chainId,
57
+ tokenAddress,
58
+ userAddress,
59
+ spenderAddress
60
+ }) => {
61
+ const client = await getClient(chainId);
62
+ const allowance = await client.readContract({
63
+ abi: erc20Abi,
64
+ address: tokenAddress,
65
+ functionName: "allowance",
66
+ args: [userAddress, spenderAddress]
67
+ });
68
+ return allowance;
69
+ };
70
+ var getErc20AllowanceWithDecimals = async ({
71
+ chainId,
72
+ tokenAddress,
73
+ userAddress,
74
+ spenderAddress
75
+ }) => {
76
+ const client = await getClient(chainId);
77
+ const allowance = await client.multicall({
78
+ contracts: [
79
+ {
80
+ abi: erc20Abi,
81
+ address: tokenAddress,
82
+ functionName: "allowance",
83
+ args: [userAddress, spenderAddress]
84
+ },
85
+ {
86
+ abi: erc20Abi,
87
+ address: tokenAddress,
88
+ functionName: "decimals"
89
+ }
90
+ ]
91
+ });
92
+ return allowance;
93
+ };
94
+
95
+ // src/abi/accountant-abi.ts
96
+ var AccountantAbi = [
97
+ {
98
+ type: "constructor",
99
+ inputs: [
100
+ { name: "_owner", type: "address", internalType: "address" },
101
+ { name: "_vault", type: "address", internalType: "address" },
102
+ { name: "payoutAddress", type: "address", internalType: "address" },
103
+ { name: "startingExchangeRate", type: "uint96", internalType: "uint96" },
104
+ { name: "_base", type: "address", internalType: "address" },
105
+ {
106
+ name: "allowedExchangeRateChangeUpper",
107
+ type: "uint16",
108
+ internalType: "uint16"
109
+ },
110
+ {
111
+ name: "allowedExchangeRateChangeLower",
112
+ type: "uint16",
113
+ internalType: "uint16"
114
+ },
115
+ {
116
+ name: "minimumUpdateDelayInSeconds",
117
+ type: "uint32",
118
+ internalType: "uint32"
119
+ },
120
+ { name: "managementFee", type: "uint16", internalType: "uint16" }
121
+ ],
122
+ stateMutability: "nonpayable"
123
+ },
124
+ {
125
+ type: "function",
126
+ name: "accountantState",
127
+ inputs: [],
128
+ outputs: [
129
+ { name: "payoutAddress", type: "address", internalType: "address" },
130
+ { name: "feesOwedInBase", type: "uint128", internalType: "uint128" },
131
+ {
132
+ name: "totalSharesLastUpdate",
133
+ type: "uint128",
134
+ internalType: "uint128"
135
+ },
136
+ { name: "exchangeRate", type: "uint96", internalType: "uint96" },
137
+ {
138
+ name: "allowedExchangeRateChangeUpper",
139
+ type: "uint16",
140
+ internalType: "uint16"
141
+ },
142
+ {
143
+ name: "allowedExchangeRateChangeLower",
144
+ type: "uint16",
145
+ internalType: "uint16"
146
+ },
147
+ { name: "lastUpdateTimestamp", type: "uint64", internalType: "uint64" },
148
+ { name: "isPaused", type: "bool", internalType: "bool" },
149
+ {
150
+ name: "minimumUpdateDelayInSeconds",
151
+ type: "uint32",
152
+ internalType: "uint32"
153
+ },
154
+ { name: "managementFee", type: "uint16", internalType: "uint16" }
155
+ ],
156
+ stateMutability: "view"
157
+ },
158
+ {
159
+ type: "function",
160
+ name: "authority",
161
+ inputs: [],
162
+ outputs: [
163
+ { name: "", type: "address", internalType: "contract Authority" }
164
+ ],
165
+ stateMutability: "view"
166
+ },
167
+ {
168
+ type: "function",
169
+ name: "base",
170
+ inputs: [],
171
+ outputs: [{ name: "", type: "address", internalType: "contract ERC20" }],
172
+ stateMutability: "view"
173
+ },
174
+ {
175
+ type: "function",
176
+ name: "claimFees",
177
+ inputs: [
178
+ { name: "feeAsset", type: "address", internalType: "contract ERC20" }
179
+ ],
180
+ outputs: [],
181
+ stateMutability: "nonpayable"
182
+ },
183
+ {
184
+ type: "function",
185
+ name: "decimals",
186
+ inputs: [],
187
+ outputs: [{ name: "", type: "uint8", internalType: "uint8" }],
188
+ stateMutability: "view"
189
+ },
190
+ {
191
+ type: "function",
192
+ name: "getRate",
193
+ inputs: [],
194
+ outputs: [{ name: "rate", type: "uint256", internalType: "uint256" }],
195
+ stateMutability: "view"
196
+ },
197
+ {
198
+ type: "function",
199
+ name: "getRateInQuote",
200
+ inputs: [
201
+ { name: "quote", type: "address", internalType: "contract ERC20" }
202
+ ],
203
+ outputs: [
204
+ { name: "rateInQuote", type: "uint256", internalType: "uint256" }
205
+ ],
206
+ stateMutability: "view"
207
+ },
208
+ {
209
+ type: "function",
210
+ name: "getRateInQuoteSafe",
211
+ inputs: [
212
+ { name: "quote", type: "address", internalType: "contract ERC20" }
213
+ ],
214
+ outputs: [
215
+ { name: "rateInQuote", type: "uint256", internalType: "uint256" }
216
+ ],
217
+ stateMutability: "view"
218
+ },
219
+ {
220
+ type: "function",
221
+ name: "getRateSafe",
222
+ inputs: [],
223
+ outputs: [{ name: "rate", type: "uint256", internalType: "uint256" }],
224
+ stateMutability: "view"
225
+ },
226
+ {
227
+ type: "function",
228
+ name: "owner",
229
+ inputs: [],
230
+ outputs: [{ name: "", type: "address", internalType: "address" }],
231
+ stateMutability: "view"
232
+ },
233
+ {
234
+ type: "function",
235
+ name: "pause",
236
+ inputs: [],
237
+ outputs: [],
238
+ stateMutability: "nonpayable"
239
+ },
240
+ {
241
+ type: "function",
242
+ name: "rateProviderData",
243
+ inputs: [{ name: "", type: "address", internalType: "contract ERC20" }],
244
+ outputs: [
245
+ { name: "isPeggedToBase", type: "bool", internalType: "bool" },
246
+ {
247
+ name: "rateProvider",
248
+ type: "address",
249
+ internalType: "contract IRateProvider"
250
+ }
251
+ ],
252
+ stateMutability: "view"
253
+ },
254
+ {
255
+ type: "function",
256
+ name: "setAuthority",
257
+ inputs: [
258
+ {
259
+ name: "newAuthority",
260
+ type: "address",
261
+ internalType: "contract Authority"
262
+ }
263
+ ],
264
+ outputs: [],
265
+ stateMutability: "nonpayable"
266
+ },
267
+ {
268
+ type: "function",
269
+ name: "setRateProviderData",
270
+ inputs: [
271
+ { name: "asset", type: "address", internalType: "contract ERC20" },
272
+ { name: "isPeggedToBase", type: "bool", internalType: "bool" },
273
+ { name: "rateProvider", type: "address", internalType: "address" }
274
+ ],
275
+ outputs: [],
276
+ stateMutability: "nonpayable"
277
+ },
278
+ {
279
+ type: "function",
280
+ name: "transferOwnership",
281
+ inputs: [{ name: "newOwner", type: "address", internalType: "address" }],
282
+ outputs: [],
283
+ stateMutability: "nonpayable"
284
+ },
285
+ {
286
+ type: "function",
287
+ name: "unpause",
288
+ inputs: [],
289
+ outputs: [],
290
+ stateMutability: "nonpayable"
291
+ },
292
+ {
293
+ type: "function",
294
+ name: "updateDelay",
295
+ inputs: [
296
+ {
297
+ name: "minimumUpdateDelayInSeconds",
298
+ type: "uint32",
299
+ internalType: "uint32"
300
+ }
301
+ ],
302
+ outputs: [],
303
+ stateMutability: "nonpayable"
304
+ },
305
+ {
306
+ type: "function",
307
+ name: "updateExchangeRate",
308
+ inputs: [
309
+ { name: "newExchangeRate", type: "uint96", internalType: "uint96" }
310
+ ],
311
+ outputs: [],
312
+ stateMutability: "nonpayable"
313
+ },
314
+ {
315
+ type: "function",
316
+ name: "updateLower",
317
+ inputs: [
318
+ {
319
+ name: "allowedExchangeRateChangeLower",
320
+ type: "uint16",
321
+ internalType: "uint16"
322
+ }
323
+ ],
324
+ outputs: [],
325
+ stateMutability: "nonpayable"
326
+ },
327
+ {
328
+ type: "function",
329
+ name: "updateManagementFee",
330
+ inputs: [{ name: "managementFee", type: "uint16", internalType: "uint16" }],
331
+ outputs: [],
332
+ stateMutability: "nonpayable"
333
+ },
334
+ {
335
+ type: "function",
336
+ name: "updatePayoutAddress",
337
+ inputs: [
338
+ { name: "payoutAddress", type: "address", internalType: "address" }
339
+ ],
340
+ outputs: [],
341
+ stateMutability: "nonpayable"
342
+ },
343
+ {
344
+ type: "function",
345
+ name: "updateUpper",
346
+ inputs: [
347
+ {
348
+ name: "allowedExchangeRateChangeUpper",
349
+ type: "uint16",
350
+ internalType: "uint16"
351
+ }
352
+ ],
353
+ outputs: [],
354
+ stateMutability: "nonpayable"
355
+ },
356
+ {
357
+ type: "function",
358
+ name: "vault",
359
+ inputs: [],
360
+ outputs: [
361
+ { name: "", type: "address", internalType: "contract BoringVault" }
362
+ ],
363
+ stateMutability: "view"
364
+ },
365
+ {
366
+ type: "event",
367
+ name: "AuthorityUpdated",
368
+ inputs: [
369
+ { name: "user", type: "address", indexed: true, internalType: "address" },
370
+ {
371
+ name: "newAuthority",
372
+ type: "address",
373
+ indexed: true,
374
+ internalType: "contract Authority"
375
+ }
376
+ ],
377
+ anonymous: false
378
+ },
379
+ {
380
+ type: "event",
381
+ name: "DelayInSecondsUpdated",
382
+ inputs: [
383
+ {
384
+ name: "oldDelay",
385
+ type: "uint32",
386
+ indexed: false,
387
+ internalType: "uint32"
388
+ },
389
+ {
390
+ name: "newDelay",
391
+ type: "uint32",
392
+ indexed: false,
393
+ internalType: "uint32"
394
+ }
395
+ ],
396
+ anonymous: false
397
+ },
398
+ {
399
+ type: "event",
400
+ name: "ExchangeRateUpdated",
401
+ inputs: [
402
+ {
403
+ name: "oldRate",
404
+ type: "uint96",
405
+ indexed: false,
406
+ internalType: "uint96"
407
+ },
408
+ {
409
+ name: "newRate",
410
+ type: "uint96",
411
+ indexed: false,
412
+ internalType: "uint96"
413
+ },
414
+ {
415
+ name: "currentTime",
416
+ type: "uint64",
417
+ indexed: false,
418
+ internalType: "uint64"
419
+ }
420
+ ],
421
+ anonymous: false
422
+ },
423
+ {
424
+ type: "event",
425
+ name: "FeesClaimed",
426
+ inputs: [
427
+ {
428
+ name: "feeAsset",
429
+ type: "address",
430
+ indexed: true,
431
+ internalType: "address"
432
+ },
433
+ {
434
+ name: "amount",
435
+ type: "uint256",
436
+ indexed: false,
437
+ internalType: "uint256"
438
+ }
439
+ ],
440
+ anonymous: false
441
+ },
442
+ {
443
+ type: "event",
444
+ name: "LowerBoundUpdated",
445
+ inputs: [
446
+ {
447
+ name: "oldBound",
448
+ type: "uint16",
449
+ indexed: false,
450
+ internalType: "uint16"
451
+ },
452
+ {
453
+ name: "newBound",
454
+ type: "uint16",
455
+ indexed: false,
456
+ internalType: "uint16"
457
+ }
458
+ ],
459
+ anonymous: false
460
+ },
461
+ {
462
+ type: "event",
463
+ name: "ManagementFeeUpdated",
464
+ inputs: [
465
+ {
466
+ name: "oldFee",
467
+ type: "uint16",
468
+ indexed: false,
469
+ internalType: "uint16"
470
+ },
471
+ {
472
+ name: "newFee",
473
+ type: "uint16",
474
+ indexed: false,
475
+ internalType: "uint16"
476
+ }
477
+ ],
478
+ anonymous: false
479
+ },
480
+ {
481
+ type: "event",
482
+ name: "OwnershipTransferred",
483
+ inputs: [
484
+ { name: "user", type: "address", indexed: true, internalType: "address" },
485
+ {
486
+ name: "newOwner",
487
+ type: "address",
488
+ indexed: true,
489
+ internalType: "address"
490
+ }
491
+ ],
492
+ anonymous: false
493
+ },
494
+ { type: "event", name: "Paused", inputs: [], anonymous: false },
495
+ {
496
+ type: "event",
497
+ name: "PayoutAddressUpdated",
498
+ inputs: [
499
+ {
500
+ name: "oldPayout",
501
+ type: "address",
502
+ indexed: false,
503
+ internalType: "address"
504
+ },
505
+ {
506
+ name: "newPayout",
507
+ type: "address",
508
+ indexed: false,
509
+ internalType: "address"
510
+ }
511
+ ],
512
+ anonymous: false
513
+ },
514
+ {
515
+ type: "event",
516
+ name: "RateProviderUpdated",
517
+ inputs: [
518
+ {
519
+ name: "asset",
520
+ type: "address",
521
+ indexed: false,
522
+ internalType: "address"
523
+ },
524
+ { name: "isPegged", type: "bool", indexed: false, internalType: "bool" },
525
+ {
526
+ name: "rateProvider",
527
+ type: "address",
528
+ indexed: false,
529
+ internalType: "address"
530
+ }
531
+ ],
532
+ anonymous: false
533
+ },
534
+ { type: "event", name: "Unpaused", inputs: [], anonymous: false },
535
+ {
536
+ type: "event",
537
+ name: "UpperBoundUpdated",
538
+ inputs: [
539
+ {
540
+ name: "oldBound",
541
+ type: "uint16",
542
+ indexed: false,
543
+ internalType: "uint16"
544
+ },
545
+ {
546
+ name: "newBound",
547
+ type: "uint16",
548
+ indexed: false,
549
+ internalType: "uint16"
550
+ }
551
+ ],
552
+ anonymous: false
553
+ },
554
+ {
555
+ type: "error",
556
+ name: "AccountantWithRateProviders__LowerBoundTooLarge",
557
+ inputs: []
558
+ },
559
+ {
560
+ type: "error",
561
+ name: "AccountantWithRateProviders__ManagementFeeTooLarge",
562
+ inputs: []
563
+ },
564
+ {
565
+ type: "error",
566
+ name: "AccountantWithRateProviders__OnlyCallableByBoringVault",
567
+ inputs: []
568
+ },
569
+ { type: "error", name: "AccountantWithRateProviders__Paused", inputs: [] },
570
+ {
571
+ type: "error",
572
+ name: "AccountantWithRateProviders__UpdateDelayTooLarge",
573
+ inputs: []
574
+ },
575
+ {
576
+ type: "error",
577
+ name: "AccountantWithRateProviders__UpperBoundTooSmall",
578
+ inputs: []
579
+ },
580
+ {
581
+ type: "error",
582
+ name: "AccountantWithRateProviders__ZeroFeesOwed",
583
+ inputs: []
584
+ }
585
+ ];
586
+
587
+ // src/abi/boring-vault-abi.ts
588
+ var BoringVaultAbi = [
589
+ {
590
+ type: "constructor",
591
+ inputs: [
592
+ { name: "_owner", type: "address", internalType: "address" },
593
+ { name: "_name", type: "string", internalType: "string" },
594
+ { name: "_symbol", type: "string", internalType: "string" },
595
+ { name: "_decimals", type: "uint8", internalType: "uint8" }
596
+ ],
597
+ stateMutability: "nonpayable"
598
+ },
599
+ { type: "receive", stateMutability: "payable" },
600
+ {
601
+ type: "function",
602
+ name: "DOMAIN_SEPARATOR",
603
+ inputs: [],
604
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
605
+ stateMutability: "view"
606
+ },
607
+ {
608
+ type: "function",
609
+ name: "allowance",
610
+ inputs: [
611
+ { name: "", type: "address", internalType: "address" },
612
+ { name: "", type: "address", internalType: "address" }
613
+ ],
614
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
615
+ stateMutability: "view"
616
+ },
617
+ {
618
+ type: "function",
619
+ name: "approve",
620
+ inputs: [
621
+ { name: "spender", type: "address", internalType: "address" },
622
+ { name: "amount", type: "uint256", internalType: "uint256" }
623
+ ],
624
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
625
+ stateMutability: "nonpayable"
626
+ },
627
+ {
628
+ type: "function",
629
+ name: "authority",
630
+ inputs: [],
631
+ outputs: [
632
+ { name: "", type: "address", internalType: "contract Authority" }
633
+ ],
634
+ stateMutability: "view"
635
+ },
636
+ {
637
+ type: "function",
638
+ name: "balanceOf",
639
+ inputs: [{ name: "", type: "address", internalType: "address" }],
640
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
641
+ stateMutability: "view"
642
+ },
643
+ {
644
+ type: "function",
645
+ name: "decimals",
646
+ inputs: [],
647
+ outputs: [{ name: "", type: "uint8", internalType: "uint8" }],
648
+ stateMutability: "view"
649
+ },
650
+ {
651
+ type: "function",
652
+ name: "enter",
653
+ inputs: [
654
+ { name: "from", type: "address", internalType: "address" },
655
+ { name: "asset", type: "address", internalType: "contract ERC20" },
656
+ { name: "assetAmount", type: "uint256", internalType: "uint256" },
657
+ { name: "to", type: "address", internalType: "address" },
658
+ { name: "shareAmount", type: "uint256", internalType: "uint256" }
659
+ ],
660
+ outputs: [],
661
+ stateMutability: "nonpayable"
662
+ },
663
+ {
664
+ type: "function",
665
+ name: "exit",
666
+ inputs: [
667
+ { name: "to", type: "address", internalType: "address" },
668
+ { name: "asset", type: "address", internalType: "contract ERC20" },
669
+ { name: "assetAmount", type: "uint256", internalType: "uint256" },
670
+ { name: "from", type: "address", internalType: "address" },
671
+ { name: "shareAmount", type: "uint256", internalType: "uint256" }
672
+ ],
673
+ outputs: [],
674
+ stateMutability: "nonpayable"
675
+ },
676
+ {
677
+ type: "function",
678
+ name: "hook",
679
+ inputs: [],
680
+ outputs: [
681
+ {
682
+ name: "",
683
+ type: "address",
684
+ internalType: "contract BeforeTransferHook"
685
+ }
686
+ ],
687
+ stateMutability: "view"
688
+ },
689
+ {
690
+ type: "function",
691
+ name: "manage",
692
+ inputs: [
693
+ { name: "targets", type: "address[]", internalType: "address[]" },
694
+ { name: "data", type: "bytes[]", internalType: "bytes[]" },
695
+ { name: "values", type: "uint256[]", internalType: "uint256[]" }
696
+ ],
697
+ outputs: [{ name: "results", type: "bytes[]", internalType: "bytes[]" }],
698
+ stateMutability: "nonpayable"
699
+ },
700
+ {
701
+ type: "function",
702
+ name: "manage",
703
+ inputs: [
704
+ { name: "target", type: "address", internalType: "address" },
705
+ { name: "data", type: "bytes", internalType: "bytes" },
706
+ { name: "value", type: "uint256", internalType: "uint256" }
707
+ ],
708
+ outputs: [{ name: "result", type: "bytes", internalType: "bytes" }],
709
+ stateMutability: "nonpayable"
710
+ },
711
+ {
712
+ type: "function",
713
+ name: "name",
714
+ inputs: [],
715
+ outputs: [{ name: "", type: "string", internalType: "string" }],
716
+ stateMutability: "view"
717
+ },
718
+ {
719
+ type: "function",
720
+ name: "nonces",
721
+ inputs: [{ name: "", type: "address", internalType: "address" }],
722
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
723
+ stateMutability: "view"
724
+ },
725
+ {
726
+ type: "function",
727
+ name: "onERC1155BatchReceived",
728
+ inputs: [
729
+ { name: "", type: "address", internalType: "address" },
730
+ { name: "", type: "address", internalType: "address" },
731
+ { name: "", type: "uint256[]", internalType: "uint256[]" },
732
+ { name: "", type: "uint256[]", internalType: "uint256[]" },
733
+ { name: "", type: "bytes", internalType: "bytes" }
734
+ ],
735
+ outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }],
736
+ stateMutability: "nonpayable"
737
+ },
738
+ {
739
+ type: "function",
740
+ name: "onERC1155Received",
741
+ inputs: [
742
+ { name: "", type: "address", internalType: "address" },
743
+ { name: "", type: "address", internalType: "address" },
744
+ { name: "", type: "uint256", internalType: "uint256" },
745
+ { name: "", type: "uint256", internalType: "uint256" },
746
+ { name: "", type: "bytes", internalType: "bytes" }
747
+ ],
748
+ outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }],
749
+ stateMutability: "nonpayable"
750
+ },
751
+ {
752
+ type: "function",
753
+ name: "onERC721Received",
754
+ inputs: [
755
+ { name: "", type: "address", internalType: "address" },
756
+ { name: "", type: "address", internalType: "address" },
757
+ { name: "", type: "uint256", internalType: "uint256" },
758
+ { name: "", type: "bytes", internalType: "bytes" }
759
+ ],
760
+ outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }],
761
+ stateMutability: "nonpayable"
762
+ },
763
+ {
764
+ type: "function",
765
+ name: "owner",
766
+ inputs: [],
767
+ outputs: [{ name: "", type: "address", internalType: "address" }],
768
+ stateMutability: "view"
769
+ },
770
+ {
771
+ type: "function",
772
+ name: "permit",
773
+ inputs: [
774
+ { name: "owner", type: "address", internalType: "address" },
775
+ { name: "spender", type: "address", internalType: "address" },
776
+ { name: "value", type: "uint256", internalType: "uint256" },
777
+ { name: "deadline", type: "uint256", internalType: "uint256" },
778
+ { name: "v", type: "uint8", internalType: "uint8" },
779
+ { name: "r", type: "bytes32", internalType: "bytes32" },
780
+ { name: "s", type: "bytes32", internalType: "bytes32" }
781
+ ],
782
+ outputs: [],
783
+ stateMutability: "nonpayable"
784
+ },
785
+ {
786
+ type: "function",
787
+ name: "setAuthority",
788
+ inputs: [
789
+ {
790
+ name: "newAuthority",
791
+ type: "address",
792
+ internalType: "contract Authority"
793
+ }
794
+ ],
795
+ outputs: [],
796
+ stateMutability: "nonpayable"
797
+ },
798
+ {
799
+ type: "function",
800
+ name: "setBeforeTransferHook",
801
+ inputs: [{ name: "_hook", type: "address", internalType: "address" }],
802
+ outputs: [],
803
+ stateMutability: "nonpayable"
804
+ },
805
+ {
806
+ type: "function",
807
+ name: "supportsInterface",
808
+ inputs: [{ name: "interfaceId", type: "bytes4", internalType: "bytes4" }],
809
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
810
+ stateMutability: "view"
811
+ },
812
+ {
813
+ type: "function",
814
+ name: "symbol",
815
+ inputs: [],
816
+ outputs: [{ name: "", type: "string", internalType: "string" }],
817
+ stateMutability: "view"
818
+ },
819
+ {
820
+ type: "function",
821
+ name: "totalSupply",
822
+ inputs: [],
823
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
824
+ stateMutability: "view"
825
+ },
826
+ {
827
+ type: "function",
828
+ name: "transfer",
829
+ inputs: [
830
+ { name: "to", type: "address", internalType: "address" },
831
+ { name: "amount", type: "uint256", internalType: "uint256" }
832
+ ],
833
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
834
+ stateMutability: "nonpayable"
835
+ },
836
+ {
837
+ type: "function",
838
+ name: "transferFrom",
839
+ inputs: [
840
+ { name: "from", type: "address", internalType: "address" },
841
+ { name: "to", type: "address", internalType: "address" },
842
+ { name: "amount", type: "uint256", internalType: "uint256" }
843
+ ],
844
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
845
+ stateMutability: "nonpayable"
846
+ },
847
+ {
848
+ type: "function",
849
+ name: "transferOwnership",
850
+ inputs: [{ name: "newOwner", type: "address", internalType: "address" }],
851
+ outputs: [],
852
+ stateMutability: "nonpayable"
853
+ },
854
+ {
855
+ type: "event",
856
+ name: "Approval",
857
+ inputs: [
858
+ {
859
+ name: "owner",
860
+ type: "address",
861
+ indexed: true,
862
+ internalType: "address"
863
+ },
864
+ {
865
+ name: "spender",
866
+ type: "address",
867
+ indexed: true,
868
+ internalType: "address"
869
+ },
870
+ {
871
+ name: "amount",
872
+ type: "uint256",
873
+ indexed: false,
874
+ internalType: "uint256"
875
+ }
876
+ ],
877
+ anonymous: false
878
+ },
879
+ {
880
+ type: "event",
881
+ name: "AuthorityUpdated",
882
+ inputs: [
883
+ { name: "user", type: "address", indexed: true, internalType: "address" },
884
+ {
885
+ name: "newAuthority",
886
+ type: "address",
887
+ indexed: true,
888
+ internalType: "contract Authority"
889
+ }
890
+ ],
891
+ anonymous: false
892
+ },
893
+ {
894
+ type: "event",
895
+ name: "Enter",
896
+ inputs: [
897
+ { name: "from", type: "address", indexed: true, internalType: "address" },
898
+ {
899
+ name: "asset",
900
+ type: "address",
901
+ indexed: true,
902
+ internalType: "address"
903
+ },
904
+ {
905
+ name: "amount",
906
+ type: "uint256",
907
+ indexed: false,
908
+ internalType: "uint256"
909
+ },
910
+ { name: "to", type: "address", indexed: true, internalType: "address" },
911
+ {
912
+ name: "shares",
913
+ type: "uint256",
914
+ indexed: false,
915
+ internalType: "uint256"
916
+ }
917
+ ],
918
+ anonymous: false
919
+ },
920
+ {
921
+ type: "event",
922
+ name: "Exit",
923
+ inputs: [
924
+ { name: "to", type: "address", indexed: true, internalType: "address" },
925
+ {
926
+ name: "asset",
927
+ type: "address",
928
+ indexed: true,
929
+ internalType: "address"
930
+ },
931
+ {
932
+ name: "amount",
933
+ type: "uint256",
934
+ indexed: false,
935
+ internalType: "uint256"
936
+ },
937
+ { name: "from", type: "address", indexed: true, internalType: "address" },
938
+ {
939
+ name: "shares",
940
+ type: "uint256",
941
+ indexed: false,
942
+ internalType: "uint256"
943
+ }
944
+ ],
945
+ anonymous: false
946
+ },
947
+ {
948
+ type: "event",
949
+ name: "OwnershipTransferred",
950
+ inputs: [
951
+ { name: "user", type: "address", indexed: true, internalType: "address" },
952
+ {
953
+ name: "newOwner",
954
+ type: "address",
955
+ indexed: true,
956
+ internalType: "address"
957
+ }
958
+ ],
959
+ anonymous: false
960
+ },
961
+ {
962
+ type: "event",
963
+ name: "Transfer",
964
+ inputs: [
965
+ { name: "from", type: "address", indexed: true, internalType: "address" },
966
+ { name: "to", type: "address", indexed: true, internalType: "address" },
967
+ {
968
+ name: "amount",
969
+ type: "uint256",
970
+ indexed: false,
971
+ internalType: "uint256"
972
+ }
973
+ ],
974
+ anonymous: false
975
+ },
976
+ {
977
+ type: "error",
978
+ name: "AddressEmptyCode",
979
+ inputs: [{ name: "target", type: "address", internalType: "address" }]
980
+ },
981
+ {
982
+ type: "error",
983
+ name: "AddressInsufficientBalance",
984
+ inputs: [{ name: "account", type: "address", internalType: "address" }]
985
+ },
986
+ { type: "error", name: "FailedInnerCall", inputs: [] }
987
+ ];
988
+
989
+ // src/api/accountant.ts
990
+ var getRateInQuoteWithAssetDecimals = async ({
991
+ assetAddress,
992
+ accountantAddress,
993
+ chainId
994
+ }) => {
995
+ const client = await getClient(chainId);
996
+ const results = await client.multicall({
997
+ contracts: [
998
+ {
999
+ abi: erc20Abi,
1000
+ address: assetAddress,
1001
+ functionName: "decimals"
1002
+ },
1003
+ {
1004
+ abi: AccountantAbi,
1005
+ address: accountantAddress,
1006
+ functionName: "getRateInQuote",
1007
+ args: [assetAddress]
1008
+ }
1009
+ ]
1010
+ });
1011
+ return results;
1012
+ };
1013
+ var getRateInQuoteAndSharesAndWantAssetDecimals = async ({
1014
+ sharesAssetAddress,
1015
+ wantAssetAddress,
1016
+ accountantAddress,
1017
+ chainId
1018
+ }) => {
1019
+ const client = await getClient(chainId);
1020
+ const results = await client.multicall({
1021
+ contracts: [
1022
+ {
1023
+ abi: erc20Abi,
1024
+ address: wantAssetAddress,
1025
+ functionName: "decimals"
1026
+ },
1027
+ {
1028
+ abi: BoringVaultAbi,
1029
+ address: sharesAssetAddress,
1030
+ functionName: "decimals"
1031
+ },
1032
+ {
1033
+ abi: AccountantAbi,
1034
+ address: accountantAddress,
1035
+ functionName: "getRateInQuote",
1036
+ args: [wantAssetAddress]
1037
+ }
1038
+ ]
1039
+ });
1040
+ return results;
1041
+ };
1042
+
1043
+ // src/abi/teller-abi.ts
1044
+ var TellerAbi = [
1045
+ {
1046
+ inputs: [
1047
+ { internalType: "address", name: "_owner", type: "address" },
1048
+ { internalType: "address", name: "_vault", type: "address" },
1049
+ { internalType: "address", name: "_accountant", type: "address" },
1050
+ { internalType: "address", name: "_endpoint", type: "address" }
1051
+ ],
1052
+ stateMutability: "nonpayable",
1053
+ type: "constructor"
1054
+ },
1055
+ { inputs: [], name: "InvalidDelegate", type: "error" },
1056
+ { inputs: [], name: "InvalidEndpointCall", type: "error" },
1057
+ {
1058
+ inputs: [{ internalType: "uint16", name: "optionType", type: "uint16" }],
1059
+ name: "InvalidOptionType",
1060
+ type: "error"
1061
+ },
1062
+ { inputs: [], name: "LzTokenUnavailable", type: "error" },
1063
+ {
1064
+ inputs: [],
1065
+ name: "MultiChainLayerZeroTellerWithMultiAssetSupport_InvalidToken",
1066
+ type: "error"
1067
+ },
1068
+ {
1069
+ inputs: [],
1070
+ name: "MultiChainTellerBase_DestinationChainReceiverIsZeroAddress",
1071
+ type: "error"
1072
+ },
1073
+ { inputs: [], name: "MultiChainTellerBase_GasLimitExceeded", type: "error" },
1074
+ { inputs: [], name: "MultiChainTellerBase_GasTooLow", type: "error" },
1075
+ {
1076
+ inputs: [{ internalType: "uint32", name: "chainSelector", type: "uint32" }],
1077
+ name: "MultiChainTellerBase_MessagesNotAllowedFrom",
1078
+ type: "error"
1079
+ },
1080
+ {
1081
+ inputs: [
1082
+ { internalType: "uint256", name: "chainSelector", type: "uint256" }
1083
+ ],
1084
+ name: "MultiChainTellerBase_MessagesNotAllowedTo",
1085
+ type: "error"
1086
+ },
1087
+ {
1088
+ inputs: [],
1089
+ name: "MultiChainTellerBase_TargetTellerIsZeroAddress",
1090
+ type: "error"
1091
+ },
1092
+ {
1093
+ inputs: [],
1094
+ name: "MultiChainTellerBase_ZeroMessageGasLimit",
1095
+ type: "error"
1096
+ },
1097
+ {
1098
+ inputs: [{ internalType: "uint32", name: "eid", type: "uint32" }],
1099
+ name: "NoPeer",
1100
+ type: "error"
1101
+ },
1102
+ {
1103
+ inputs: [{ internalType: "uint256", name: "msgValue", type: "uint256" }],
1104
+ name: "NotEnoughNative",
1105
+ type: "error"
1106
+ },
1107
+ {
1108
+ inputs: [{ internalType: "address", name: "addr", type: "address" }],
1109
+ name: "OnlyEndpoint",
1110
+ type: "error"
1111
+ },
1112
+ {
1113
+ inputs: [
1114
+ { internalType: "uint32", name: "eid", type: "uint32" },
1115
+ { internalType: "bytes32", name: "sender", type: "bytes32" }
1116
+ ],
1117
+ name: "OnlyPeer",
1118
+ type: "error"
1119
+ },
1120
+ {
1121
+ inputs: [
1122
+ { internalType: "uint8", name: "bits", type: "uint8" },
1123
+ { internalType: "uint256", name: "value", type: "uint256" }
1124
+ ],
1125
+ name: "SafeCastOverflowedUintDowncast",
1126
+ type: "error"
1127
+ },
1128
+ {
1129
+ inputs: [{ internalType: "address", name: "token", type: "address" }],
1130
+ name: "SafeERC20FailedOperation",
1131
+ type: "error"
1132
+ },
1133
+ {
1134
+ inputs: [],
1135
+ name: "TellerWithMultiAssetSupport__AssetNotSupported",
1136
+ type: "error"
1137
+ },
1138
+ {
1139
+ inputs: [],
1140
+ name: "TellerWithMultiAssetSupport__BadDepositHash",
1141
+ type: "error"
1142
+ },
1143
+ {
1144
+ inputs: [],
1145
+ name: "TellerWithMultiAssetSupport__MinimumAssetsNotMet",
1146
+ type: "error"
1147
+ },
1148
+ {
1149
+ inputs: [],
1150
+ name: "TellerWithMultiAssetSupport__MinimumMintNotMet",
1151
+ type: "error"
1152
+ },
1153
+ { inputs: [], name: "TellerWithMultiAssetSupport__Paused", type: "error" },
1154
+ {
1155
+ inputs: [],
1156
+ name: "TellerWithMultiAssetSupport__PermitFailedAndAllowanceTooLow",
1157
+ type: "error"
1158
+ },
1159
+ {
1160
+ inputs: [],
1161
+ name: "TellerWithMultiAssetSupport__ShareLockPeriodTooLong",
1162
+ type: "error"
1163
+ },
1164
+ {
1165
+ inputs: [],
1166
+ name: "TellerWithMultiAssetSupport__SharesAreLocked",
1167
+ type: "error"
1168
+ },
1169
+ {
1170
+ inputs: [],
1171
+ name: "TellerWithMultiAssetSupport__SharesAreUnLocked",
1172
+ type: "error"
1173
+ },
1174
+ {
1175
+ inputs: [],
1176
+ name: "TellerWithMultiAssetSupport__ZeroAssets",
1177
+ type: "error"
1178
+ },
1179
+ {
1180
+ inputs: [],
1181
+ name: "TellerWithMultiAssetSupport__ZeroShares",
1182
+ type: "error"
1183
+ },
1184
+ {
1185
+ anonymous: false,
1186
+ inputs: [
1187
+ {
1188
+ indexed: true,
1189
+ internalType: "address",
1190
+ name: "asset",
1191
+ type: "address"
1192
+ }
1193
+ ],
1194
+ name: "AssetAdded",
1195
+ type: "event"
1196
+ },
1197
+ {
1198
+ anonymous: false,
1199
+ inputs: [
1200
+ {
1201
+ indexed: true,
1202
+ internalType: "address",
1203
+ name: "asset",
1204
+ type: "address"
1205
+ }
1206
+ ],
1207
+ name: "AssetRemoved",
1208
+ type: "event"
1209
+ },
1210
+ {
1211
+ anonymous: false,
1212
+ inputs: [
1213
+ { indexed: true, internalType: "address", name: "user", type: "address" },
1214
+ {
1215
+ indexed: true,
1216
+ internalType: "contract Authority",
1217
+ name: "newAuthority",
1218
+ type: "address"
1219
+ }
1220
+ ],
1221
+ name: "AuthorityUpdated",
1222
+ type: "event"
1223
+ },
1224
+ {
1225
+ anonymous: false,
1226
+ inputs: [
1227
+ {
1228
+ indexed: true,
1229
+ internalType: "address",
1230
+ name: "asset",
1231
+ type: "address"
1232
+ },
1233
+ {
1234
+ indexed: false,
1235
+ internalType: "uint256",
1236
+ name: "depositAmount",
1237
+ type: "uint256"
1238
+ }
1239
+ ],
1240
+ name: "BulkDeposit",
1241
+ type: "event"
1242
+ },
1243
+ {
1244
+ anonymous: false,
1245
+ inputs: [
1246
+ {
1247
+ indexed: true,
1248
+ internalType: "address",
1249
+ name: "asset",
1250
+ type: "address"
1251
+ },
1252
+ {
1253
+ indexed: false,
1254
+ internalType: "uint256",
1255
+ name: "shareAmount",
1256
+ type: "uint256"
1257
+ }
1258
+ ],
1259
+ name: "BulkWithdraw",
1260
+ type: "event"
1261
+ },
1262
+ {
1263
+ anonymous: false,
1264
+ inputs: [
1265
+ {
1266
+ indexed: false,
1267
+ internalType: "uint256",
1268
+ name: "chainSelector",
1269
+ type: "uint256"
1270
+ },
1271
+ {
1272
+ indexed: false,
1273
+ internalType: "bool",
1274
+ name: "allowMessagesFrom",
1275
+ type: "bool"
1276
+ },
1277
+ {
1278
+ indexed: false,
1279
+ internalType: "bool",
1280
+ name: "allowMessagesTo",
1281
+ type: "bool"
1282
+ },
1283
+ {
1284
+ indexed: false,
1285
+ internalType: "address",
1286
+ name: "targetTeller",
1287
+ type: "address"
1288
+ },
1289
+ {
1290
+ indexed: false,
1291
+ internalType: "uint64",
1292
+ name: "messageGasLimit",
1293
+ type: "uint64"
1294
+ },
1295
+ {
1296
+ indexed: false,
1297
+ internalType: "uint64",
1298
+ name: "messageGasMin",
1299
+ type: "uint64"
1300
+ }
1301
+ ],
1302
+ name: "ChainAdded",
1303
+ type: "event"
1304
+ },
1305
+ {
1306
+ anonymous: false,
1307
+ inputs: [
1308
+ {
1309
+ indexed: false,
1310
+ internalType: "uint256",
1311
+ name: "chainSelector",
1312
+ type: "uint256"
1313
+ },
1314
+ {
1315
+ indexed: false,
1316
+ internalType: "address",
1317
+ name: "targetTeller",
1318
+ type: "address"
1319
+ }
1320
+ ],
1321
+ name: "ChainAllowMessagesFrom",
1322
+ type: "event"
1323
+ },
1324
+ {
1325
+ anonymous: false,
1326
+ inputs: [
1327
+ {
1328
+ indexed: false,
1329
+ internalType: "uint256",
1330
+ name: "chainSelector",
1331
+ type: "uint256"
1332
+ },
1333
+ {
1334
+ indexed: false,
1335
+ internalType: "address",
1336
+ name: "targetTeller",
1337
+ type: "address"
1338
+ }
1339
+ ],
1340
+ name: "ChainAllowMessagesTo",
1341
+ type: "event"
1342
+ },
1343
+ {
1344
+ anonymous: false,
1345
+ inputs: [
1346
+ {
1347
+ indexed: false,
1348
+ internalType: "uint256",
1349
+ name: "chainSelector",
1350
+ type: "uint256"
1351
+ }
1352
+ ],
1353
+ name: "ChainRemoved",
1354
+ type: "event"
1355
+ },
1356
+ {
1357
+ anonymous: false,
1358
+ inputs: [
1359
+ {
1360
+ indexed: false,
1361
+ internalType: "uint256",
1362
+ name: "chainSelector",
1363
+ type: "uint256"
1364
+ },
1365
+ {
1366
+ indexed: false,
1367
+ internalType: "uint64",
1368
+ name: "messageGasLimit",
1369
+ type: "uint64"
1370
+ }
1371
+ ],
1372
+ name: "ChainSetGasLimit",
1373
+ type: "event"
1374
+ },
1375
+ {
1376
+ anonymous: false,
1377
+ inputs: [
1378
+ {
1379
+ indexed: false,
1380
+ internalType: "uint256",
1381
+ name: "chainSelector",
1382
+ type: "uint256"
1383
+ }
1384
+ ],
1385
+ name: "ChainStopMessagesFrom",
1386
+ type: "event"
1387
+ },
1388
+ {
1389
+ anonymous: false,
1390
+ inputs: [
1391
+ {
1392
+ indexed: false,
1393
+ internalType: "uint256",
1394
+ name: "chainSelector",
1395
+ type: "uint256"
1396
+ }
1397
+ ],
1398
+ name: "ChainStopMessagesTo",
1399
+ type: "event"
1400
+ },
1401
+ {
1402
+ anonymous: false,
1403
+ inputs: [
1404
+ {
1405
+ indexed: true,
1406
+ internalType: "uint256",
1407
+ name: "nonce",
1408
+ type: "uint256"
1409
+ },
1410
+ {
1411
+ indexed: true,
1412
+ internalType: "address",
1413
+ name: "receiver",
1414
+ type: "address"
1415
+ },
1416
+ {
1417
+ indexed: true,
1418
+ internalType: "address",
1419
+ name: "depositAsset",
1420
+ type: "address"
1421
+ },
1422
+ {
1423
+ indexed: false,
1424
+ internalType: "uint256",
1425
+ name: "depositAmount",
1426
+ type: "uint256"
1427
+ },
1428
+ {
1429
+ indexed: false,
1430
+ internalType: "uint256",
1431
+ name: "shareAmount",
1432
+ type: "uint256"
1433
+ },
1434
+ {
1435
+ indexed: false,
1436
+ internalType: "uint256",
1437
+ name: "depositTimestamp",
1438
+ type: "uint256"
1439
+ },
1440
+ {
1441
+ indexed: false,
1442
+ internalType: "uint256",
1443
+ name: "shareLockPeriodAtTimeOfDeposit",
1444
+ type: "uint256"
1445
+ }
1446
+ ],
1447
+ name: "Deposit",
1448
+ type: "event"
1449
+ },
1450
+ {
1451
+ anonymous: false,
1452
+ inputs: [
1453
+ {
1454
+ indexed: true,
1455
+ internalType: "uint256",
1456
+ name: "nonce",
1457
+ type: "uint256"
1458
+ },
1459
+ {
1460
+ indexed: false,
1461
+ internalType: "bytes32",
1462
+ name: "depositHash",
1463
+ type: "bytes32"
1464
+ },
1465
+ { indexed: true, internalType: "address", name: "user", type: "address" }
1466
+ ],
1467
+ name: "DepositRefunded",
1468
+ type: "event"
1469
+ },
1470
+ {
1471
+ anonymous: false,
1472
+ inputs: [
1473
+ {
1474
+ indexed: false,
1475
+ internalType: "bytes32",
1476
+ name: "messageId",
1477
+ type: "bytes32"
1478
+ },
1479
+ {
1480
+ indexed: false,
1481
+ internalType: "uint256",
1482
+ name: "shareAmount",
1483
+ type: "uint256"
1484
+ },
1485
+ { indexed: false, internalType: "address", name: "to", type: "address" }
1486
+ ],
1487
+ name: "MessageReceived",
1488
+ type: "event"
1489
+ },
1490
+ {
1491
+ anonymous: false,
1492
+ inputs: [
1493
+ {
1494
+ indexed: false,
1495
+ internalType: "bytes32",
1496
+ name: "messageId",
1497
+ type: "bytes32"
1498
+ },
1499
+ {
1500
+ indexed: false,
1501
+ internalType: "uint256",
1502
+ name: "shareAmount",
1503
+ type: "uint256"
1504
+ },
1505
+ { indexed: false, internalType: "address", name: "to", type: "address" }
1506
+ ],
1507
+ name: "MessageSent",
1508
+ type: "event"
1509
+ },
1510
+ {
1511
+ anonymous: false,
1512
+ inputs: [
1513
+ { indexed: true, internalType: "address", name: "user", type: "address" },
1514
+ {
1515
+ indexed: true,
1516
+ internalType: "address",
1517
+ name: "newOwner",
1518
+ type: "address"
1519
+ }
1520
+ ],
1521
+ name: "OwnershipTransferred",
1522
+ type: "event"
1523
+ },
1524
+ { anonymous: false, inputs: [], name: "Paused", type: "event" },
1525
+ {
1526
+ anonymous: false,
1527
+ inputs: [
1528
+ { indexed: false, internalType: "uint32", name: "eid", type: "uint32" },
1529
+ {
1530
+ indexed: false,
1531
+ internalType: "bytes32",
1532
+ name: "peer",
1533
+ type: "bytes32"
1534
+ }
1535
+ ],
1536
+ name: "PeerSet",
1537
+ type: "event"
1538
+ },
1539
+ { anonymous: false, inputs: [], name: "Unpaused", type: "event" },
1540
+ {
1541
+ inputs: [],
1542
+ name: "accountant",
1543
+ outputs: [
1544
+ {
1545
+ internalType: "contract AccountantWithRateProviders",
1546
+ name: "",
1547
+ type: "address"
1548
+ }
1549
+ ],
1550
+ stateMutability: "view",
1551
+ type: "function"
1552
+ },
1553
+ {
1554
+ inputs: [
1555
+ { internalType: "contract ERC20", name: "asset", type: "address" }
1556
+ ],
1557
+ name: "addAsset",
1558
+ outputs: [],
1559
+ stateMutability: "nonpayable",
1560
+ type: "function"
1561
+ },
1562
+ {
1563
+ inputs: [
1564
+ { internalType: "uint32", name: "chainSelector", type: "uint32" },
1565
+ { internalType: "bool", name: "allowMessagesFrom", type: "bool" },
1566
+ { internalType: "bool", name: "allowMessagesTo", type: "bool" },
1567
+ { internalType: "address", name: "targetTeller", type: "address" },
1568
+ { internalType: "uint64", name: "messageGasLimit", type: "uint64" },
1569
+ { internalType: "uint64", name: "messageGasMin", type: "uint64" }
1570
+ ],
1571
+ name: "addChain",
1572
+ outputs: [],
1573
+ stateMutability: "nonpayable",
1574
+ type: "function"
1575
+ },
1576
+ {
1577
+ inputs: [
1578
+ {
1579
+ components: [
1580
+ { internalType: "uint32", name: "srcEid", type: "uint32" },
1581
+ { internalType: "bytes32", name: "sender", type: "bytes32" },
1582
+ { internalType: "uint64", name: "nonce", type: "uint64" }
1583
+ ],
1584
+ internalType: "struct Origin",
1585
+ name: "origin",
1586
+ type: "tuple"
1587
+ }
1588
+ ],
1589
+ name: "allowInitializePath",
1590
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1591
+ stateMutability: "view",
1592
+ type: "function"
1593
+ },
1594
+ {
1595
+ inputs: [
1596
+ { internalType: "uint32", name: "chainSelector", type: "uint32" },
1597
+ { internalType: "address", name: "targetTeller", type: "address" }
1598
+ ],
1599
+ name: "allowMessagesFromChain",
1600
+ outputs: [],
1601
+ stateMutability: "nonpayable",
1602
+ type: "function"
1603
+ },
1604
+ {
1605
+ inputs: [
1606
+ { internalType: "uint32", name: "chainSelector", type: "uint32" },
1607
+ { internalType: "address", name: "targetTeller", type: "address" },
1608
+ { internalType: "uint64", name: "messageGasLimit", type: "uint64" }
1609
+ ],
1610
+ name: "allowMessagesToChain",
1611
+ outputs: [],
1612
+ stateMutability: "nonpayable",
1613
+ type: "function"
1614
+ },
1615
+ {
1616
+ inputs: [],
1617
+ name: "authority",
1618
+ outputs: [
1619
+ { internalType: "contract Authority", name: "", type: "address" }
1620
+ ],
1621
+ stateMutability: "view",
1622
+ type: "function"
1623
+ },
1624
+ {
1625
+ inputs: [{ internalType: "address", name: "from", type: "address" }],
1626
+ name: "beforeTransfer",
1627
+ outputs: [],
1628
+ stateMutability: "view",
1629
+ type: "function"
1630
+ },
1631
+ {
1632
+ inputs: [
1633
+ { internalType: "uint256", name: "shareAmount", type: "uint256" },
1634
+ {
1635
+ components: [
1636
+ { internalType: "uint32", name: "chainSelector", type: "uint32" },
1637
+ {
1638
+ internalType: "address",
1639
+ name: "destinationChainReceiver",
1640
+ type: "address"
1641
+ },
1642
+ {
1643
+ internalType: "contract ERC20",
1644
+ name: "bridgeFeeToken",
1645
+ type: "address"
1646
+ },
1647
+ { internalType: "uint64", name: "messageGas", type: "uint64" },
1648
+ { internalType: "bytes", name: "data", type: "bytes" }
1649
+ ],
1650
+ internalType: "struct BridgeData",
1651
+ name: "data",
1652
+ type: "tuple"
1653
+ }
1654
+ ],
1655
+ name: "bridge",
1656
+ outputs: [{ internalType: "bytes32", name: "messageId", type: "bytes32" }],
1657
+ stateMutability: "payable",
1658
+ type: "function"
1659
+ },
1660
+ {
1661
+ inputs: [
1662
+ { internalType: "contract ERC20", name: "depositAsset", type: "address" },
1663
+ { internalType: "uint256", name: "depositAmount", type: "uint256" },
1664
+ { internalType: "uint256", name: "minimumMint", type: "uint256" },
1665
+ { internalType: "address", name: "to", type: "address" }
1666
+ ],
1667
+ name: "bulkDeposit",
1668
+ outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
1669
+ stateMutability: "nonpayable",
1670
+ type: "function"
1671
+ },
1672
+ {
1673
+ inputs: [
1674
+ {
1675
+ internalType: "contract ERC20",
1676
+ name: "withdrawAsset",
1677
+ type: "address"
1678
+ },
1679
+ { internalType: "uint256", name: "shareAmount", type: "uint256" },
1680
+ { internalType: "uint256", name: "minimumAssets", type: "uint256" },
1681
+ { internalType: "address", name: "to", type: "address" }
1682
+ ],
1683
+ name: "bulkWithdraw",
1684
+ outputs: [{ internalType: "uint256", name: "assetsOut", type: "uint256" }],
1685
+ stateMutability: "nonpayable",
1686
+ type: "function"
1687
+ },
1688
+ {
1689
+ inputs: [
1690
+ { internalType: "contract ERC20", name: "depositAsset", type: "address" },
1691
+ { internalType: "uint256", name: "depositAmount", type: "uint256" },
1692
+ { internalType: "uint256", name: "minimumMint", type: "uint256" }
1693
+ ],
1694
+ name: "deposit",
1695
+ outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
1696
+ stateMutability: "nonpayable",
1697
+ type: "function"
1698
+ },
1699
+ {
1700
+ inputs: [
1701
+ { internalType: "contract ERC20", name: "depositAsset", type: "address" },
1702
+ { internalType: "uint256", name: "depositAmount", type: "uint256" },
1703
+ { internalType: "uint256", name: "minimumMint", type: "uint256" },
1704
+ {
1705
+ components: [
1706
+ { internalType: "uint32", name: "chainSelector", type: "uint32" },
1707
+ {
1708
+ internalType: "address",
1709
+ name: "destinationChainReceiver",
1710
+ type: "address"
1711
+ },
1712
+ {
1713
+ internalType: "contract ERC20",
1714
+ name: "bridgeFeeToken",
1715
+ type: "address"
1716
+ },
1717
+ { internalType: "uint64", name: "messageGas", type: "uint64" },
1718
+ { internalType: "bytes", name: "data", type: "bytes" }
1719
+ ],
1720
+ internalType: "struct BridgeData",
1721
+ name: "data",
1722
+ type: "tuple"
1723
+ }
1724
+ ],
1725
+ name: "depositAndBridge",
1726
+ outputs: [],
1727
+ stateMutability: "payable",
1728
+ type: "function"
1729
+ },
1730
+ {
1731
+ inputs: [],
1732
+ name: "depositNonce",
1733
+ outputs: [{ internalType: "uint96", name: "", type: "uint96" }],
1734
+ stateMutability: "view",
1735
+ type: "function"
1736
+ },
1737
+ {
1738
+ inputs: [
1739
+ { internalType: "contract ERC20", name: "depositAsset", type: "address" },
1740
+ { internalType: "uint256", name: "depositAmount", type: "uint256" },
1741
+ { internalType: "uint256", name: "minimumMint", type: "uint256" },
1742
+ { internalType: "uint256", name: "deadline", type: "uint256" },
1743
+ { internalType: "uint8", name: "v", type: "uint8" },
1744
+ { internalType: "bytes32", name: "r", type: "bytes32" },
1745
+ { internalType: "bytes32", name: "s", type: "bytes32" }
1746
+ ],
1747
+ name: "depositWithPermit",
1748
+ outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
1749
+ stateMutability: "nonpayable",
1750
+ type: "function"
1751
+ },
1752
+ {
1753
+ inputs: [],
1754
+ name: "endpoint",
1755
+ outputs: [
1756
+ {
1757
+ internalType: "contract ILayerZeroEndpointV2",
1758
+ name: "",
1759
+ type: "address"
1760
+ }
1761
+ ],
1762
+ stateMutability: "view",
1763
+ type: "function"
1764
+ },
1765
+ {
1766
+ inputs: [
1767
+ {
1768
+ components: [
1769
+ { internalType: "uint32", name: "srcEid", type: "uint32" },
1770
+ { internalType: "bytes32", name: "sender", type: "bytes32" },
1771
+ { internalType: "uint64", name: "nonce", type: "uint64" }
1772
+ ],
1773
+ internalType: "struct Origin",
1774
+ name: "",
1775
+ type: "tuple"
1776
+ },
1777
+ { internalType: "bytes", name: "", type: "bytes" },
1778
+ { internalType: "address", name: "_sender", type: "address" }
1779
+ ],
1780
+ name: "isComposeMsgSender",
1781
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1782
+ stateMutability: "view",
1783
+ type: "function"
1784
+ },
1785
+ {
1786
+ inputs: [],
1787
+ name: "isPaused",
1788
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1789
+ stateMutability: "view",
1790
+ type: "function"
1791
+ },
1792
+ {
1793
+ inputs: [{ internalType: "contract ERC20", name: "", type: "address" }],
1794
+ name: "isSupported",
1795
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1796
+ stateMutability: "view",
1797
+ type: "function"
1798
+ },
1799
+ {
1800
+ inputs: [
1801
+ {
1802
+ components: [
1803
+ { internalType: "uint32", name: "srcEid", type: "uint32" },
1804
+ { internalType: "bytes32", name: "sender", type: "bytes32" },
1805
+ { internalType: "uint64", name: "nonce", type: "uint64" }
1806
+ ],
1807
+ internalType: "struct Origin",
1808
+ name: "_origin",
1809
+ type: "tuple"
1810
+ },
1811
+ { internalType: "bytes32", name: "_guid", type: "bytes32" },
1812
+ { internalType: "bytes", name: "_message", type: "bytes" },
1813
+ { internalType: "address", name: "_executor", type: "address" },
1814
+ { internalType: "bytes", name: "_extraData", type: "bytes" }
1815
+ ],
1816
+ name: "lzReceive",
1817
+ outputs: [],
1818
+ stateMutability: "payable",
1819
+ type: "function"
1820
+ },
1821
+ {
1822
+ inputs: [
1823
+ { internalType: "uint32", name: "", type: "uint32" },
1824
+ { internalType: "bytes32", name: "", type: "bytes32" }
1825
+ ],
1826
+ name: "nextNonce",
1827
+ outputs: [{ internalType: "uint64", name: "nonce", type: "uint64" }],
1828
+ stateMutability: "view",
1829
+ type: "function"
1830
+ },
1831
+ {
1832
+ inputs: [],
1833
+ name: "oAppVersion",
1834
+ outputs: [
1835
+ { internalType: "uint64", name: "senderVersion", type: "uint64" },
1836
+ { internalType: "uint64", name: "receiverVersion", type: "uint64" }
1837
+ ],
1838
+ stateMutability: "pure",
1839
+ type: "function"
1840
+ },
1841
+ {
1842
+ inputs: [],
1843
+ name: "owner",
1844
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1845
+ stateMutability: "view",
1846
+ type: "function"
1847
+ },
1848
+ {
1849
+ inputs: [],
1850
+ name: "pause",
1851
+ outputs: [],
1852
+ stateMutability: "nonpayable",
1853
+ type: "function"
1854
+ },
1855
+ {
1856
+ inputs: [{ internalType: "uint32", name: "eid", type: "uint32" }],
1857
+ name: "peers",
1858
+ outputs: [{ internalType: "bytes32", name: "peer", type: "bytes32" }],
1859
+ stateMutability: "view",
1860
+ type: "function"
1861
+ },
1862
+ {
1863
+ inputs: [
1864
+ { internalType: "uint256", name: "shareAmount", type: "uint256" },
1865
+ {
1866
+ components: [
1867
+ { internalType: "uint32", name: "chainSelector", type: "uint32" },
1868
+ {
1869
+ internalType: "address",
1870
+ name: "destinationChainReceiver",
1871
+ type: "address"
1872
+ },
1873
+ {
1874
+ internalType: "contract ERC20",
1875
+ name: "bridgeFeeToken",
1876
+ type: "address"
1877
+ },
1878
+ { internalType: "uint64", name: "messageGas", type: "uint64" },
1879
+ { internalType: "bytes", name: "data", type: "bytes" }
1880
+ ],
1881
+ internalType: "struct BridgeData",
1882
+ name: "data",
1883
+ type: "tuple"
1884
+ }
1885
+ ],
1886
+ name: "previewFee",
1887
+ outputs: [{ internalType: "uint256", name: "fee", type: "uint256" }],
1888
+ stateMutability: "view",
1889
+ type: "function"
1890
+ },
1891
+ {
1892
+ inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1893
+ name: "publicDepositHistory",
1894
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
1895
+ stateMutability: "view",
1896
+ type: "function"
1897
+ },
1898
+ {
1899
+ inputs: [
1900
+ { internalType: "uint256", name: "nonce", type: "uint256" },
1901
+ { internalType: "address", name: "receiver", type: "address" },
1902
+ { internalType: "address", name: "depositAsset", type: "address" },
1903
+ { internalType: "uint256", name: "depositAmount", type: "uint256" },
1904
+ { internalType: "uint256", name: "shareAmount", type: "uint256" },
1905
+ { internalType: "uint256", name: "depositTimestamp", type: "uint256" },
1906
+ {
1907
+ internalType: "uint256",
1908
+ name: "shareLockUpPeriodAtTimeOfDeposit",
1909
+ type: "uint256"
1910
+ }
1911
+ ],
1912
+ name: "refundDeposit",
1913
+ outputs: [],
1914
+ stateMutability: "nonpayable",
1915
+ type: "function"
1916
+ },
1917
+ {
1918
+ inputs: [
1919
+ { internalType: "contract ERC20", name: "asset", type: "address" }
1920
+ ],
1921
+ name: "removeAsset",
1922
+ outputs: [],
1923
+ stateMutability: "nonpayable",
1924
+ type: "function"
1925
+ },
1926
+ {
1927
+ inputs: [{ internalType: "uint32", name: "chainSelector", type: "uint32" }],
1928
+ name: "removeChain",
1929
+ outputs: [],
1930
+ stateMutability: "nonpayable",
1931
+ type: "function"
1932
+ },
1933
+ {
1934
+ inputs: [{ internalType: "uint32", name: "", type: "uint32" }],
1935
+ name: "selectorToChains",
1936
+ outputs: [
1937
+ { internalType: "bool", name: "allowMessagesFrom", type: "bool" },
1938
+ { internalType: "bool", name: "allowMessagesTo", type: "bool" },
1939
+ { internalType: "address", name: "targetTeller", type: "address" },
1940
+ { internalType: "uint64", name: "messageGasLimit", type: "uint64" },
1941
+ { internalType: "uint64", name: "minimumMessageGas", type: "uint64" }
1942
+ ],
1943
+ stateMutability: "view",
1944
+ type: "function"
1945
+ },
1946
+ {
1947
+ inputs: [
1948
+ {
1949
+ internalType: "contract Authority",
1950
+ name: "newAuthority",
1951
+ type: "address"
1952
+ }
1953
+ ],
1954
+ name: "setAuthority",
1955
+ outputs: [],
1956
+ stateMutability: "nonpayable",
1957
+ type: "function"
1958
+ },
1959
+ {
1960
+ inputs: [
1961
+ { internalType: "uint32", name: "chainSelector", type: "uint32" },
1962
+ { internalType: "uint64", name: "messageGasLimit", type: "uint64" }
1963
+ ],
1964
+ name: "setChainGasLimit",
1965
+ outputs: [],
1966
+ stateMutability: "nonpayable",
1967
+ type: "function"
1968
+ },
1969
+ {
1970
+ inputs: [{ internalType: "address", name: "_delegate", type: "address" }],
1971
+ name: "setDelegate",
1972
+ outputs: [],
1973
+ stateMutability: "nonpayable",
1974
+ type: "function"
1975
+ },
1976
+ {
1977
+ inputs: [
1978
+ { internalType: "uint32", name: "_eid", type: "uint32" },
1979
+ { internalType: "bytes32", name: "_peer", type: "bytes32" }
1980
+ ],
1981
+ name: "setPeer",
1982
+ outputs: [],
1983
+ stateMutability: "nonpayable",
1984
+ type: "function"
1985
+ },
1986
+ {
1987
+ inputs: [
1988
+ { internalType: "uint64", name: "_shareLockPeriod", type: "uint64" }
1989
+ ],
1990
+ name: "setShareLockPeriod",
1991
+ outputs: [],
1992
+ stateMutability: "nonpayable",
1993
+ type: "function"
1994
+ },
1995
+ {
1996
+ inputs: [],
1997
+ name: "shareLockPeriod",
1998
+ outputs: [{ internalType: "uint64", name: "", type: "uint64" }],
1999
+ stateMutability: "view",
2000
+ type: "function"
2001
+ },
2002
+ {
2003
+ inputs: [{ internalType: "address", name: "", type: "address" }],
2004
+ name: "shareUnlockTime",
2005
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2006
+ stateMutability: "view",
2007
+ type: "function"
2008
+ },
2009
+ {
2010
+ inputs: [{ internalType: "uint32", name: "chainSelector", type: "uint32" }],
2011
+ name: "stopMessagesFromChain",
2012
+ outputs: [],
2013
+ stateMutability: "nonpayable",
2014
+ type: "function"
2015
+ },
2016
+ {
2017
+ inputs: [{ internalType: "uint32", name: "chainSelector", type: "uint32" }],
2018
+ name: "stopMessagesToChain",
2019
+ outputs: [],
2020
+ stateMutability: "nonpayable",
2021
+ type: "function"
2022
+ },
2023
+ {
2024
+ inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
2025
+ name: "transferOwnership",
2026
+ outputs: [],
2027
+ stateMutability: "nonpayable",
2028
+ type: "function"
2029
+ },
2030
+ {
2031
+ inputs: [],
2032
+ name: "unpause",
2033
+ outputs: [],
2034
+ stateMutability: "nonpayable",
2035
+ type: "function"
2036
+ },
2037
+ {
2038
+ inputs: [],
2039
+ name: "vault",
2040
+ outputs: [
2041
+ { internalType: "contract BoringVault", name: "", type: "address" }
2042
+ ],
2043
+ stateMutability: "view",
2044
+ type: "function"
2045
+ }
2046
+ ];
2047
+
2048
+ export { AccountantAbi, BoringVaultAbi, TellerAbi, getClient, getErc20Allowance, getErc20AllowanceWithDecimals, getErc20Balance, getErc20Decimals, getRateInQuoteAndSharesAndWantAssetDecimals, getRateInQuoteWithAssetDecimals };
2049
+ //# sourceMappingURL=chunk-ZZBZIDZP.mjs.map
2050
+ //# sourceMappingURL=chunk-ZZBZIDZP.mjs.map