@varla/sdk 2.20.0 → 3.0.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 (87) hide show
  1. package/AGENTS.md +7 -7
  2. package/CHANGELOG.md +27 -0
  3. package/README.md +2 -2
  4. package/dist/abi/full/OpinionCtfExecutionEngineAdapter.d.ts +4 -0
  5. package/dist/abi/full/OpinionCtfExecutionEngineAdapter.d.ts.map +1 -1
  6. package/dist/abi/full/OpinionCtfExecutionEngineAdapter.js +5 -0
  7. package/dist/abi/full/OpinionCtfExecutionEngineAdapter.js.map +1 -1
  8. package/dist/abi/full/PolymarketCtfAdapter.d.ts +32 -0
  9. package/dist/abi/full/PolymarketCtfAdapter.d.ts.map +1 -1
  10. package/dist/abi/full/PolymarketCtfAdapter.js +41 -0
  11. package/dist/abi/full/PolymarketCtfAdapter.js.map +1 -1
  12. package/dist/abi/full/VarlaConvertLiquidator.d.ts +39 -0
  13. package/dist/abi/full/VarlaConvertLiquidator.d.ts.map +1 -1
  14. package/dist/abi/full/VarlaConvertLiquidator.js +50 -0
  15. package/dist/abi/full/VarlaConvertLiquidator.js.map +1 -1
  16. package/dist/abi/full/VarlaCore.d.ts +82 -0
  17. package/dist/abi/full/VarlaCore.d.ts.map +1 -1
  18. package/dist/abi/full/VarlaCore.js +106 -0
  19. package/dist/abi/full/VarlaCore.js.map +1 -1
  20. package/dist/abi/full/VarlaMergeLiquidator.d.ts +0 -39
  21. package/dist/abi/full/VarlaMergeLiquidator.d.ts.map +1 -1
  22. package/dist/abi/full/VarlaMergeLiquidator.js +0 -50
  23. package/dist/abi/full/VarlaMergeLiquidator.js.map +1 -1
  24. package/dist/abi/full/VarlaPool.d.ts +326 -0
  25. package/dist/abi/full/VarlaPool.d.ts.map +1 -1
  26. package/dist/abi/full/VarlaPool.js +424 -0
  27. package/dist/abi/full/VarlaPool.js.map +1 -1
  28. package/dist/abi/index.d.ts +0 -1
  29. package/dist/abi/index.d.ts.map +1 -1
  30. package/dist/abi/index.js +0 -1
  31. package/dist/abi/index.js.map +1 -1
  32. package/dist/actions/admin.d.ts +14 -0
  33. package/dist/actions/admin.d.ts.map +1 -1
  34. package/dist/actions/admin.js +18 -0
  35. package/dist/actions/admin.js.map +1 -1
  36. package/dist/actions/core.d.ts +14 -0
  37. package/dist/actions/core.d.ts.map +1 -1
  38. package/dist/actions/core.js +18 -0
  39. package/dist/actions/core.js.map +1 -1
  40. package/dist/actions/pool.d.ts +17 -0
  41. package/dist/actions/pool.d.ts.map +1 -1
  42. package/dist/actions/pool.js +18 -0
  43. package/dist/actions/pool.js.map +1 -1
  44. package/dist/addresses/polygon.d.ts.map +1 -1
  45. package/dist/addresses/polygon.js +11 -12
  46. package/dist/addresses/polygon.js.map +1 -1
  47. package/dist/addresses/polygonProxy.d.ts.map +1 -1
  48. package/dist/addresses/polygonProxy.js +4 -5
  49. package/dist/addresses/polygonProxy.js.map +1 -1
  50. package/dist/contracts.d.ts +1 -2
  51. package/dist/contracts.d.ts.map +1 -1
  52. package/dist/contracts.js +0 -8
  53. package/dist/contracts.js.map +1 -1
  54. package/dist/generated.d.ts +470 -273
  55. package/dist/generated.d.ts.map +1 -1
  56. package/dist/generated.js +0 -1
  57. package/dist/generated.js.map +1 -1
  58. package/dist/meta.d.ts +16 -1
  59. package/dist/meta.d.ts.map +1 -1
  60. package/dist/meta.js +17 -2
  61. package/dist/meta.js.map +1 -1
  62. package/dist/types.d.ts +0 -1
  63. package/dist/types.d.ts.map +1 -1
  64. package/dist/views/core.d.ts +2 -1
  65. package/dist/views/core.d.ts.map +1 -1
  66. package/dist/views/core.js +2 -1
  67. package/dist/views/core.js.map +1 -1
  68. package/package.json +1 -1
  69. package/src/abi/full/OpinionCtfExecutionEngineAdapter.ts +5 -0
  70. package/src/abi/full/PolymarketCtfAdapter.ts +41 -0
  71. package/src/abi/full/VarlaConvertLiquidator.ts +50 -0
  72. package/src/abi/full/VarlaCore.ts +106 -0
  73. package/src/abi/full/VarlaMergeLiquidator.ts +0 -50
  74. package/src/abi/full/VarlaPool.ts +424 -0
  75. package/src/abi/index.ts +0 -1
  76. package/src/actions/admin.ts +32 -0
  77. package/src/actions/core.ts +32 -0
  78. package/src/actions/pool.ts +35 -0
  79. package/src/addresses/polygon-proxy.json +18 -0
  80. package/src/addresses/polygon.json +11 -10
  81. package/src/addresses/polygon.ts +11 -12
  82. package/src/addresses/polygonProxy.ts +4 -5
  83. package/src/contracts.ts +0 -11
  84. package/src/generated.ts +0 -1
  85. package/src/meta.ts +33 -3
  86. package/src/types.ts +0 -1
  87. package/src/views/core.ts +2 -1
@@ -83,6 +83,27 @@ export const VARLAPOOL_ABI = [
83
83
  "name": "BorrowCapExceeded",
84
84
  "type": "error"
85
85
  },
86
+ {
87
+ "inputs": [
88
+ {
89
+ "internalType": "uint256",
90
+ "name": "expected",
91
+ "type": "uint256"
92
+ },
93
+ {
94
+ "internalType": "uint256",
95
+ "name": "actual",
96
+ "type": "uint256"
97
+ }
98
+ ],
99
+ "name": "CollateralAmountMismatch",
100
+ "type": "error"
101
+ },
102
+ {
103
+ "inputs": [],
104
+ "name": "CollateralRampNotConfigured",
105
+ "type": "error"
106
+ },
86
107
  {
87
108
  "inputs": [
88
109
  {
@@ -343,6 +364,17 @@ export const VARLAPOOL_ABI = [
343
364
  "name": "StrategyNotContract",
344
365
  "type": "error"
345
366
  },
367
+ {
368
+ "inputs": [
369
+ {
370
+ "internalType": "address",
371
+ "name": "asset",
372
+ "type": "address"
373
+ }
374
+ ],
375
+ "name": "UnsupportedWrappedAsset",
376
+ "type": "error"
377
+ },
346
378
  {
347
379
  "inputs": [],
348
380
  "name": "VarlaCoreAlreadySet",
@@ -441,6 +473,37 @@ export const VARLAPOOL_ABI = [
441
473
  "name": "BorrowCapUpdated",
442
474
  "type": "event"
443
475
  },
476
+ {
477
+ "anonymous": false,
478
+ "inputs": [
479
+ {
480
+ "indexed": true,
481
+ "internalType": "address",
482
+ "name": "oldOnramp",
483
+ "type": "address"
484
+ },
485
+ {
486
+ "indexed": true,
487
+ "internalType": "address",
488
+ "name": "newOnramp",
489
+ "type": "address"
490
+ },
491
+ {
492
+ "indexed": true,
493
+ "internalType": "address",
494
+ "name": "oldOfframp",
495
+ "type": "address"
496
+ },
497
+ {
498
+ "indexed": false,
499
+ "internalType": "address",
500
+ "name": "newOfframp",
501
+ "type": "address"
502
+ }
503
+ ],
504
+ "name": "CollateralRampsSet",
505
+ "type": "event"
506
+ },
444
507
  {
445
508
  "anonymous": false,
446
509
  "inputs": [
@@ -698,6 +761,37 @@ export const VARLAPOOL_ABI = [
698
761
  "name": "Withdraw",
699
762
  "type": "event"
700
763
  },
764
+ {
765
+ "anonymous": false,
766
+ "inputs": [
767
+ {
768
+ "indexed": true,
769
+ "internalType": "address",
770
+ "name": "oldUsdc",
771
+ "type": "address"
772
+ },
773
+ {
774
+ "indexed": true,
775
+ "internalType": "address",
776
+ "name": "newUsdc",
777
+ "type": "address"
778
+ },
779
+ {
780
+ "indexed": true,
781
+ "internalType": "address",
782
+ "name": "oldUsdce",
783
+ "type": "address"
784
+ },
785
+ {
786
+ "indexed": false,
787
+ "internalType": "address",
788
+ "name": "newUsdce",
789
+ "type": "address"
790
+ }
791
+ ],
792
+ "name": "WrappedCollateralAssetsSet",
793
+ "type": "event"
794
+ },
701
795
  {
702
796
  "inputs": [],
703
797
  "name": "PRECISION",
@@ -856,6 +950,45 @@ export const VARLAPOOL_ABI = [
856
950
  "stateMutability": "view",
857
951
  "type": "function"
858
952
  },
953
+ {
954
+ "inputs": [],
955
+ "name": "bridgedUsdc",
956
+ "outputs": [
957
+ {
958
+ "internalType": "address",
959
+ "name": "",
960
+ "type": "address"
961
+ }
962
+ ],
963
+ "stateMutability": "view",
964
+ "type": "function"
965
+ },
966
+ {
967
+ "inputs": [],
968
+ "name": "collateralOfframp",
969
+ "outputs": [
970
+ {
971
+ "internalType": "address",
972
+ "name": "",
973
+ "type": "address"
974
+ }
975
+ ],
976
+ "stateMutability": "view",
977
+ "type": "function"
978
+ },
979
+ {
980
+ "inputs": [],
981
+ "name": "collateralOnramp",
982
+ "outputs": [
983
+ {
984
+ "internalType": "address",
985
+ "name": "",
986
+ "type": "address"
987
+ }
988
+ ],
989
+ "stateMutability": "view",
990
+ "type": "function"
991
+ },
859
992
  {
860
993
  "inputs": [
861
994
  {
@@ -944,6 +1077,83 @@ export const VARLAPOOL_ABI = [
944
1077
  "stateMutability": "view",
945
1078
  "type": "function"
946
1079
  },
1080
+ {
1081
+ "inputs": [
1082
+ {
1083
+ "internalType": "uint256",
1084
+ "name": "amount",
1085
+ "type": "uint256"
1086
+ },
1087
+ {
1088
+ "internalType": "address",
1089
+ "name": "receiver",
1090
+ "type": "address"
1091
+ }
1092
+ ],
1093
+ "name": "depositUSDC",
1094
+ "outputs": [
1095
+ {
1096
+ "internalType": "uint256",
1097
+ "name": "shares",
1098
+ "type": "uint256"
1099
+ }
1100
+ ],
1101
+ "stateMutability": "nonpayable",
1102
+ "type": "function"
1103
+ },
1104
+ {
1105
+ "inputs": [
1106
+ {
1107
+ "internalType": "uint256",
1108
+ "name": "amount",
1109
+ "type": "uint256"
1110
+ },
1111
+ {
1112
+ "internalType": "address",
1113
+ "name": "receiver",
1114
+ "type": "address"
1115
+ }
1116
+ ],
1117
+ "name": "depositUSDCE",
1118
+ "outputs": [
1119
+ {
1120
+ "internalType": "uint256",
1121
+ "name": "shares",
1122
+ "type": "uint256"
1123
+ }
1124
+ ],
1125
+ "stateMutability": "nonpayable",
1126
+ "type": "function"
1127
+ },
1128
+ {
1129
+ "inputs": [
1130
+ {
1131
+ "internalType": "address",
1132
+ "name": "inputAsset",
1133
+ "type": "address"
1134
+ },
1135
+ {
1136
+ "internalType": "uint256",
1137
+ "name": "amount",
1138
+ "type": "uint256"
1139
+ },
1140
+ {
1141
+ "internalType": "address",
1142
+ "name": "receiver",
1143
+ "type": "address"
1144
+ }
1145
+ ],
1146
+ "name": "depositWrappedAsset",
1147
+ "outputs": [
1148
+ {
1149
+ "internalType": "uint256",
1150
+ "name": "shares",
1151
+ "type": "uint256"
1152
+ }
1153
+ ],
1154
+ "stateMutability": "nonpayable",
1155
+ "type": "function"
1156
+ },
947
1157
  {
948
1158
  "inputs": [
949
1159
  {
@@ -955,6 +1165,11 @@ export const VARLAPOOL_ABI = [
955
1165
  "internalType": "uint256",
956
1166
  "name": "amount",
957
1167
  "type": "uint256"
1168
+ },
1169
+ {
1170
+ "internalType": "address",
1171
+ "name": "outputAsset",
1172
+ "type": "address"
958
1173
  }
959
1174
  ],
960
1175
  "name": "drawFunds",
@@ -1254,6 +1469,35 @@ export const VARLAPOOL_ABI = [
1254
1469
  "stateMutability": "nonpayable",
1255
1470
  "type": "function"
1256
1471
  },
1472
+ {
1473
+ "inputs": [
1474
+ {
1475
+ "internalType": "address",
1476
+ "name": "inputAsset",
1477
+ "type": "address"
1478
+ },
1479
+ {
1480
+ "internalType": "uint256",
1481
+ "name": "shares",
1482
+ "type": "uint256"
1483
+ },
1484
+ {
1485
+ "internalType": "address",
1486
+ "name": "receiver",
1487
+ "type": "address"
1488
+ }
1489
+ ],
1490
+ "name": "mintWrappedAsset",
1491
+ "outputs": [
1492
+ {
1493
+ "internalType": "uint256",
1494
+ "name": "assets",
1495
+ "type": "uint256"
1496
+ }
1497
+ ],
1498
+ "stateMutability": "nonpayable",
1499
+ "type": "function"
1500
+ },
1257
1501
  {
1258
1502
  "inputs": [],
1259
1503
  "name": "name",
@@ -1267,6 +1511,19 @@ export const VARLAPOOL_ABI = [
1267
1511
  "stateMutability": "view",
1268
1512
  "type": "function"
1269
1513
  },
1514
+ {
1515
+ "inputs": [],
1516
+ "name": "nativeUsdc",
1517
+ "outputs": [
1518
+ {
1519
+ "internalType": "address",
1520
+ "name": "",
1521
+ "type": "address"
1522
+ }
1523
+ ],
1524
+ "stateMutability": "view",
1525
+ "type": "function"
1526
+ },
1270
1527
  {
1271
1528
  "inputs": [
1272
1529
  {
@@ -1354,6 +1611,11 @@ export const VARLAPOOL_ABI = [
1354
1611
  "internalType": "uint256",
1355
1612
  "name": "actualAmount",
1356
1613
  "type": "uint256"
1614
+ },
1615
+ {
1616
+ "internalType": "address",
1617
+ "name": "inputAsset",
1618
+ "type": "address"
1357
1619
  }
1358
1620
  ],
1359
1621
  "name": "receiveFunds",
@@ -1390,6 +1652,40 @@ export const VARLAPOOL_ABI = [
1390
1652
  "stateMutability": "nonpayable",
1391
1653
  "type": "function"
1392
1654
  },
1655
+ {
1656
+ "inputs": [
1657
+ {
1658
+ "internalType": "address",
1659
+ "name": "outputAsset",
1660
+ "type": "address"
1661
+ },
1662
+ {
1663
+ "internalType": "uint256",
1664
+ "name": "shares",
1665
+ "type": "uint256"
1666
+ },
1667
+ {
1668
+ "internalType": "address",
1669
+ "name": "receiver",
1670
+ "type": "address"
1671
+ },
1672
+ {
1673
+ "internalType": "address",
1674
+ "name": "owner",
1675
+ "type": "address"
1676
+ }
1677
+ ],
1678
+ "name": "redeemAsWrappedAsset",
1679
+ "outputs": [
1680
+ {
1681
+ "internalType": "uint256",
1682
+ "name": "assets",
1683
+ "type": "uint256"
1684
+ }
1685
+ ],
1686
+ "stateMutability": "nonpayable",
1687
+ "type": "function"
1688
+ },
1393
1689
  {
1394
1690
  "inputs": [],
1395
1691
  "name": "reserveBalance",
@@ -1442,6 +1738,24 @@ export const VARLAPOOL_ABI = [
1442
1738
  "stateMutability": "nonpayable",
1443
1739
  "type": "function"
1444
1740
  },
1741
+ {
1742
+ "inputs": [
1743
+ {
1744
+ "internalType": "address",
1745
+ "name": "newOnramp",
1746
+ "type": "address"
1747
+ },
1748
+ {
1749
+ "internalType": "address",
1750
+ "name": "newOfframp",
1751
+ "type": "address"
1752
+ }
1753
+ ],
1754
+ "name": "setCollateralRamps",
1755
+ "outputs": [],
1756
+ "stateMutability": "nonpayable",
1757
+ "type": "function"
1758
+ },
1445
1759
  {
1446
1760
  "inputs": [
1447
1761
  {
@@ -1481,6 +1795,24 @@ export const VARLAPOOL_ABI = [
1481
1795
  "stateMutability": "nonpayable",
1482
1796
  "type": "function"
1483
1797
  },
1798
+ {
1799
+ "inputs": [
1800
+ {
1801
+ "internalType": "address",
1802
+ "name": "newNativeUsdc",
1803
+ "type": "address"
1804
+ },
1805
+ {
1806
+ "internalType": "address",
1807
+ "name": "newBridgedUsdc",
1808
+ "type": "address"
1809
+ }
1810
+ ],
1811
+ "name": "setWrappedCollateralAssets",
1812
+ "outputs": [],
1813
+ "stateMutability": "nonpayable",
1814
+ "type": "function"
1815
+ },
1484
1816
  {
1485
1817
  "inputs": [],
1486
1818
  "name": "symbol",
@@ -1615,6 +1947,40 @@ export const VARLAPOOL_ABI = [
1615
1947
  "stateMutability": "nonpayable",
1616
1948
  "type": "function"
1617
1949
  },
1950
+ {
1951
+ "inputs": [
1952
+ {
1953
+ "internalType": "address",
1954
+ "name": "outputAsset",
1955
+ "type": "address"
1956
+ },
1957
+ {
1958
+ "internalType": "uint256",
1959
+ "name": "assets",
1960
+ "type": "uint256"
1961
+ },
1962
+ {
1963
+ "internalType": "address",
1964
+ "name": "receiver",
1965
+ "type": "address"
1966
+ },
1967
+ {
1968
+ "internalType": "address",
1969
+ "name": "owner",
1970
+ "type": "address"
1971
+ }
1972
+ ],
1973
+ "name": "withdrawAsWrappedAsset",
1974
+ "outputs": [
1975
+ {
1976
+ "internalType": "uint256",
1977
+ "name": "shares",
1978
+ "type": "uint256"
1979
+ }
1980
+ ],
1981
+ "stateMutability": "nonpayable",
1982
+ "type": "function"
1983
+ },
1618
1984
  {
1619
1985
  "inputs": [
1620
1986
  {
@@ -1632,6 +1998,64 @@ export const VARLAPOOL_ABI = [
1632
1998
  "outputs": [],
1633
1999
  "stateMutability": "nonpayable",
1634
2000
  "type": "function"
2001
+ },
2002
+ {
2003
+ "inputs": [
2004
+ {
2005
+ "internalType": "uint256",
2006
+ "name": "assets",
2007
+ "type": "uint256"
2008
+ },
2009
+ {
2010
+ "internalType": "address",
2011
+ "name": "receiver",
2012
+ "type": "address"
2013
+ },
2014
+ {
2015
+ "internalType": "address",
2016
+ "name": "owner",
2017
+ "type": "address"
2018
+ }
2019
+ ],
2020
+ "name": "withdrawUSDC",
2021
+ "outputs": [
2022
+ {
2023
+ "internalType": "uint256",
2024
+ "name": "shares",
2025
+ "type": "uint256"
2026
+ }
2027
+ ],
2028
+ "stateMutability": "nonpayable",
2029
+ "type": "function"
2030
+ },
2031
+ {
2032
+ "inputs": [
2033
+ {
2034
+ "internalType": "uint256",
2035
+ "name": "assets",
2036
+ "type": "uint256"
2037
+ },
2038
+ {
2039
+ "internalType": "address",
2040
+ "name": "receiver",
2041
+ "type": "address"
2042
+ },
2043
+ {
2044
+ "internalType": "address",
2045
+ "name": "owner",
2046
+ "type": "address"
2047
+ }
2048
+ ],
2049
+ "name": "withdrawUSDCE",
2050
+ "outputs": [
2051
+ {
2052
+ "internalType": "uint256",
2053
+ "name": "shares",
2054
+ "type": "uint256"
2055
+ }
2056
+ ],
2057
+ "stateMutability": "nonpayable",
2058
+ "type": "function"
1635
2059
  }
1636
2060
  ] as const satisfies Abi;
1637
2061
 
package/src/abi/index.ts CHANGED
@@ -13,7 +13,6 @@ export { VARLAMERGELIQUIDATOR_ABI } from "./full/VarlaMergeLiquidator.js";
13
13
  export { VARLACONVERTLIQUIDATOR_ABI } from "./full/VarlaConvertLiquidator.js";
14
14
  export { VARLASTAKING_ABI } from "./full/VarlaStaking.js";
15
15
  export { POLYMARKETCTFADAPTER_ABI } from "./full/PolymarketCtfAdapter.js";
16
- export { POLYMARKETNEGRISKMERGEADAPTER_ABI } from "./full/PolymarketNegRiskMergeAdapter.js";
17
16
  export { OPINIONCTFEXECUTIONENGINEADAPTER_ABI } from "./full/OpinionCtfExecutionEngineAdapter.js";
18
17
  export { VARLAORACLE_ABI_REGISTRY } from "./subsets/VarlaOracle.registry.js";
19
18
 
@@ -246,6 +246,38 @@ export async function preparePoolSetInterestRateStrategy(params: {
246
246
  } as any)) as any;
247
247
  }
248
248
 
249
+ export async function preparePoolSetCollateralRamps(params: {
250
+ publicClient: Pick<PublicClient, "simulateContract">;
251
+ poolAddress: Address;
252
+ account: Address;
253
+ onramp: Address;
254
+ offramp: Address;
255
+ }): Promise<SimulatedTx> {
256
+ return (await params.publicClient.simulateContract({
257
+ address: params.poolAddress,
258
+ abi: abis.VARLAPOOL_ABI,
259
+ functionName: "setCollateralRamps",
260
+ args: [params.onramp, params.offramp],
261
+ account: params.account,
262
+ } as any)) as any;
263
+ }
264
+
265
+ export async function preparePoolSetWrappedCollateralAssets(params: {
266
+ publicClient: Pick<PublicClient, "simulateContract">;
267
+ poolAddress: Address;
268
+ account: Address;
269
+ nativeUsdc: Address;
270
+ bridgedUsdc: Address;
271
+ }): Promise<SimulatedTx> {
272
+ return (await params.publicClient.simulateContract({
273
+ address: params.poolAddress,
274
+ abi: abis.VARLAPOOL_ABI,
275
+ functionName: "setWrappedCollateralAssets",
276
+ args: [params.nativeUsdc, params.bridgedUsdc],
277
+ account: params.account,
278
+ } as any)) as any;
279
+ }
280
+
249
281
  // -----------------
250
282
  // Oracle admin
251
283
  // -----------------
@@ -52,6 +52,22 @@ export async function prepareCoreBorrow(params: {
52
52
  } as any)) as any;
53
53
  }
54
54
 
55
+ export async function prepareCoreBorrowWithAsset(params: {
56
+ publicClient: Pick<PublicClient, "simulateContract">;
57
+ coreAddress: Address;
58
+ account: Address;
59
+ amount: bigint;
60
+ outputAsset: Address;
61
+ }): Promise<SimulatedTx> {
62
+ return (await params.publicClient.simulateContract({
63
+ address: params.coreAddress,
64
+ abi: abis.VARLACORE_ABI,
65
+ functionName: "borrow",
66
+ args: [params.amount, params.outputAsset],
67
+ account: params.account,
68
+ } as any)) as any;
69
+ }
70
+
55
71
  export async function prepareCoreRepay(params: {
56
72
  publicClient: Pick<PublicClient, "simulateContract">;
57
73
  coreAddress: Address;
@@ -66,3 +82,19 @@ export async function prepareCoreRepay(params: {
66
82
  account: params.account,
67
83
  } as any)) as any;
68
84
  }
85
+
86
+ export async function prepareCoreRepayWithAsset(params: {
87
+ publicClient: Pick<PublicClient, "simulateContract">;
88
+ coreAddress: Address;
89
+ account: Address;
90
+ amount: bigint;
91
+ inputAsset: Address;
92
+ }): Promise<SimulatedTx> {
93
+ return (await params.publicClient.simulateContract({
94
+ address: params.coreAddress,
95
+ abi: abis.VARLACORE_ABI,
96
+ functionName: "repay",
97
+ args: [params.amount, params.inputAsset],
98
+ account: params.account,
99
+ } as any)) as any;
100
+ }
@@ -25,6 +25,23 @@ export async function preparePoolDeposit(params: {
25
25
  } as any)) as any;
26
26
  }
27
27
 
28
+ export async function preparePoolDepositWrappedAsset(params: {
29
+ publicClient: Pick<PublicClient, "simulateContract">;
30
+ poolAddress: Address;
31
+ account: Address;
32
+ inputAsset: Address;
33
+ amount: bigint;
34
+ receiver: Address;
35
+ }): Promise<SimulatedTx> {
36
+ return (await params.publicClient.simulateContract({
37
+ address: params.poolAddress,
38
+ abi: abis.VARLAPOOL_ABI,
39
+ functionName: "depositWrappedAsset",
40
+ args: [params.inputAsset, params.amount, params.receiver],
41
+ account: params.account,
42
+ } as any)) as any;
43
+ }
44
+
28
45
  export async function preparePoolMint(params: {
29
46
  publicClient: Pick<PublicClient, "simulateContract">;
30
47
  poolAddress: Address;
@@ -58,6 +75,24 @@ export async function preparePoolWithdraw(params: {
58
75
  } as any)) as any;
59
76
  }
60
77
 
78
+ export async function preparePoolWithdrawAsWrappedAsset(params: {
79
+ publicClient: Pick<PublicClient, "simulateContract">;
80
+ poolAddress: Address;
81
+ account: Address;
82
+ assets: bigint;
83
+ outputAsset: Address;
84
+ receiver: Address;
85
+ owner: Address;
86
+ }): Promise<SimulatedTx> {
87
+ return (await params.publicClient.simulateContract({
88
+ address: params.poolAddress,
89
+ abi: abis.VARLAPOOL_ABI,
90
+ functionName: "withdrawAsWrappedAsset",
91
+ args: [params.assets, params.outputAsset, params.receiver, params.owner],
92
+ account: params.account,
93
+ } as any)) as any;
94
+ }
95
+
61
96
  export async function preparePoolRedeem(params: {
62
97
  publicClient: Pick<PublicClient, "simulateContract">;
63
98
  poolAddress: Address;
@@ -0,0 +1,18 @@
1
+ {
2
+ "chain": "polygon-proxy",
3
+ "generatedAt": "",
4
+ "deploymentsDir": "polygon-proxy",
5
+ "contracts": {
6
+ "VarlaAccessManager": "0x5069d899bA3EBC4e12aB357F44B1DA3b0D0395f4",
7
+ "VarlaOracle": "0x14e102a52474f569eB6C536a1bb15b9F69c5ba8f",
8
+ "VarlaCore": "0xb4b6887eBFFF5532a1fcED5A1B30F4Cf37aBf78f",
9
+ "VarlaPool": "0xB5f6F3F547c4CcedF92007B7d05C765aaA998497",
10
+ "OracleUpdaterRouter": "0x3E1e6B54626D486b844C94e2385773b018fEB891",
11
+ "VarlaInterestRateStrategy": "0x80B990D9D637DEe4781A79da1CA9D36Bb3C949f6",
12
+ "VarlaProxyAdmin": "0x084aBfA2f32A53741DDd12D3166dA1318e7d73f7",
13
+ "VarlaLiquidator": "0x91949971c5B6F0783dC90F86938B7244215A7311",
14
+ "VarlaMergeLiquidator": "0x3F86802a7823C2d2D8bBBC3C7208289AfD9aCD96",
15
+ "VarlaConvertLiquidator": "0xdc0DDd1a58C21f84fA7FCBdA56e8a6f012e4fC43",
16
+ "PolymarketCtfAdapter": "0x86B39800540D2C42eF1E34DF69117CB34F35a341"
17
+ }
18
+ }