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