@underscore-finance/sdk 0.3.5 → 1.0.2

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 (244) hide show
  1. package/dist/contracts/AaveV3.d.ts +2120 -0
  2. package/dist/contracts/AaveV3.d.ts.map +1 -0
  3. package/dist/contracts/AaveV3.js +2714 -0
  4. package/dist/contracts/AeroClassic.d.ts +2017 -0
  5. package/dist/contracts/AeroClassic.d.ts.map +1 -0
  6. package/dist/contracts/AeroClassic.js +2567 -0
  7. package/dist/contracts/AeroSlipstream.d.ts +2113 -0
  8. package/dist/contracts/AeroSlipstream.d.ts.map +1 -0
  9. package/dist/contracts/AeroSlipstream.js +2692 -0
  10. package/dist/contracts/Agent.d.ts +2189 -1138
  11. package/dist/contracts/Agent.d.ts.map +1 -1
  12. package/dist/contracts/Agent.js +2807 -1343
  13. package/dist/contracts/AgentWrapper.d.ts +3760 -0
  14. package/dist/contracts/AgentWrapper.d.ts.map +1 -0
  15. package/dist/contracts/AgentWrapper.js +4922 -0
  16. package/dist/contracts/Appraiser.d.ts +997 -0
  17. package/dist/contracts/Appraiser.d.ts.map +1 -0
  18. package/dist/contracts/Appraiser.js +1285 -0
  19. package/dist/contracts/Billing.d.ts +420 -0
  20. package/dist/contracts/Billing.d.ts.map +1 -0
  21. package/dist/contracts/Billing.js +506 -0
  22. package/dist/contracts/ChequeBook.d.ts +1184 -0
  23. package/dist/contracts/ChequeBook.d.ts.map +1 -0
  24. package/dist/contracts/ChequeBook.js +1352 -0
  25. package/dist/contracts/CompoundV3.d.ts +2158 -0
  26. package/dist/contracts/CompoundV3.d.ts.map +1 -0
  27. package/dist/contracts/CompoundV3.js +2764 -0
  28. package/dist/contracts/Curve.d.ts +1077 -0
  29. package/dist/contracts/Curve.d.ts.map +1 -0
  30. package/dist/contracts/Curve.js +1357 -0
  31. package/dist/contracts/DefaultsBase.d.ts +290 -0
  32. package/dist/contracts/DefaultsBase.d.ts.map +1 -0
  33. package/dist/contracts/DefaultsBase.js +316 -0
  34. package/dist/contracts/Euler.d.ts +2172 -0
  35. package/dist/contracts/Euler.d.ts.map +1 -0
  36. package/dist/contracts/Euler.js +2782 -0
  37. package/dist/contracts/Fluid.d.ts +2106 -0
  38. package/dist/contracts/Fluid.d.ts.map +1 -0
  39. package/dist/contracts/Fluid.js +2696 -0
  40. package/dist/contracts/Hatchery.d.ts +541 -0
  41. package/dist/contracts/Hatchery.d.ts.map +1 -0
  42. package/dist/contracts/Hatchery.js +671 -0
  43. package/dist/contracts/HighCommand.d.ts +1868 -0
  44. package/dist/contracts/HighCommand.d.ts.map +1 -0
  45. package/dist/contracts/HighCommand.js +2149 -0
  46. package/dist/contracts/Kernel.d.ts +354 -0
  47. package/dist/contracts/Kernel.d.ts.map +1 -0
  48. package/dist/contracts/Kernel.js +412 -0
  49. package/dist/contracts/Ledger.d.ts +694 -0
  50. package/dist/contracts/Ledger.d.ts.map +1 -0
  51. package/dist/contracts/Ledger.js +834 -0
  52. package/dist/contracts/LegoBook.d.ts +1424 -0
  53. package/dist/contracts/LegoBook.d.ts.map +1 -0
  54. package/dist/contracts/LegoBook.js +1783 -0
  55. package/dist/contracts/LegoTools.d.ts +1898 -0
  56. package/dist/contracts/LegoTools.d.ts.map +1 -0
  57. package/dist/contracts/LegoTools.js +2378 -0
  58. package/dist/contracts/LegoUniswapV0_2.d.ts +1204 -0
  59. package/dist/contracts/LegoUniswapV0_2.d.ts.map +1 -0
  60. package/dist/contracts/LegoUniswapV0_2.js +1546 -0
  61. package/dist/contracts/LootDistributor.d.ts +996 -0
  62. package/dist/contracts/LootDistributor.d.ts.map +1 -0
  63. package/dist/contracts/LootDistributor.js +1255 -0
  64. package/dist/contracts/Migrator.d.ts +268 -0
  65. package/dist/contracts/Migrator.d.ts.map +1 -0
  66. package/dist/contracts/Migrator.js +324 -0
  67. package/dist/contracts/MissionControl.d.ts +1331 -0
  68. package/dist/contracts/MissionControl.d.ts.map +1 -0
  69. package/dist/contracts/MissionControl.js +1485 -0
  70. package/dist/contracts/Moonwell.d.ts +2137 -0
  71. package/dist/contracts/Moonwell.d.ts.map +1 -0
  72. package/dist/contracts/Moonwell.js +2737 -0
  73. package/dist/contracts/Morpho.d.ts +2172 -0
  74. package/dist/contracts/Morpho.d.ts.map +1 -0
  75. package/dist/contracts/Morpho.js +2782 -0
  76. package/dist/contracts/Paymaster.d.ts +1679 -0
  77. package/dist/contracts/Paymaster.d.ts.map +1 -0
  78. package/dist/contracts/Paymaster.js +2077 -0
  79. package/dist/contracts/RipeLego.d.ts +2263 -0
  80. package/dist/contracts/RipeLego.d.ts.map +1 -0
  81. package/dist/contracts/RipeLego.js +2891 -0
  82. package/dist/contracts/Sentinel.d.ts +1804 -0
  83. package/dist/contracts/Sentinel.d.ts.map +1 -0
  84. package/dist/contracts/Sentinel.js +2152 -0
  85. package/dist/contracts/Switchboard.d.ts +1395 -0
  86. package/dist/contracts/Switchboard.d.ts.map +1 -0
  87. package/dist/contracts/Switchboard.js +1746 -0
  88. package/dist/contracts/SwitchboardAlpha.d.ts +2228 -0
  89. package/dist/contracts/SwitchboardAlpha.d.ts.map +1 -0
  90. package/dist/contracts/SwitchboardAlpha.js +2743 -0
  91. package/dist/contracts/SwitchboardBravo.d.ts +1498 -0
  92. package/dist/contracts/SwitchboardBravo.d.ts.map +1 -0
  93. package/dist/contracts/SwitchboardBravo.js +1855 -0
  94. package/dist/contracts/UndyHq.d.ts +1580 -0
  95. package/dist/contracts/UndyHq.d.ts.map +1 -0
  96. package/dist/contracts/UndyHq.js +1986 -0
  97. package/dist/contracts/UniswapV2.d.ts +2017 -0
  98. package/dist/contracts/UniswapV2.d.ts.map +1 -0
  99. package/dist/contracts/UniswapV2.js +2567 -0
  100. package/dist/contracts/UniswapV3.d.ts +2113 -0
  101. package/dist/contracts/UniswapV3.d.ts.map +1 -0
  102. package/dist/contracts/UniswapV3.js +2692 -0
  103. package/dist/contracts/UserWallet.d.ts +1438 -784
  104. package/dist/contracts/UserWallet.d.ts.map +1 -1
  105. package/dist/contracts/UserWallet.js +1854 -935
  106. package/dist/contracts/UserWalletConfig.d.ts +3034 -1231
  107. package/dist/contracts/UserWalletConfig.d.ts.map +1 -1
  108. package/dist/contracts/UserWalletConfig.js +3395 -1407
  109. package/dist/contracts/WalletBackpack.d.ts +1183 -0
  110. package/dist/contracts/WalletBackpack.d.ts.map +1 -0
  111. package/dist/contracts/WalletBackpack.js +1484 -0
  112. package/dist/contracts/index.d.ts +33 -36
  113. package/dist/contracts/index.d.ts.map +1 -1
  114. package/dist/contracts/index.js +33 -36
  115. package/dist/contracts/sdk.d.ts +66 -72
  116. package/dist/contracts/sdk.d.ts.map +1 -1
  117. package/dist/contracts/sdk.js +66 -72
  118. package/dist/contracts/v0_1_AddyRegistry.d.ts +473 -0
  119. package/dist/contracts/v0_1_AddyRegistry.d.ts.map +1 -0
  120. package/dist/contracts/v0_1_AddyRegistry.js +594 -0
  121. package/dist/contracts/v0_1_Agent.d.ts +2631 -0
  122. package/dist/contracts/v0_1_Agent.d.ts.map +1 -0
  123. package/dist/contracts/v0_1_Agent.js +3372 -0
  124. package/dist/contracts/v0_1_AgentFactory.d.ts +1054 -0
  125. package/dist/contracts/v0_1_AgentFactory.d.ts.map +1 -0
  126. package/dist/contracts/v0_1_AgentFactory.js +1336 -0
  127. package/dist/contracts/v0_1_UserWallet.d.ts +1980 -0
  128. package/dist/contracts/v0_1_UserWallet.d.ts.map +1 -0
  129. package/dist/contracts/v0_1_UserWallet.js +2581 -0
  130. package/dist/contracts/v0_1_UserWalletConfig.d.ts +1400 -0
  131. package/dist/contracts/v0_1_UserWalletConfig.d.ts.map +1 -0
  132. package/dist/contracts/v0_1_UserWalletConfig.js +1676 -0
  133. package/dist/contracts/v0_2_AddyRegistry.d.ts +1050 -0
  134. package/dist/contracts/v0_2_AddyRegistry.d.ts.map +1 -0
  135. package/dist/contracts/v0_2_AddyRegistry.js +1313 -0
  136. package/dist/contracts/v0_2_Agent.d.ts +2709 -0
  137. package/dist/contracts/v0_2_Agent.d.ts.map +1 -0
  138. package/dist/contracts/v0_2_Agent.js +3458 -0
  139. package/dist/contracts/v0_2_AgentFactory.d.ts +1275 -0
  140. package/dist/contracts/v0_2_AgentFactory.d.ts.map +1 -0
  141. package/dist/contracts/v0_2_AgentFactory.js +1609 -0
  142. package/dist/contracts/v0_2_UserWallet.d.ts +1958 -0
  143. package/dist/contracts/v0_2_UserWallet.d.ts.map +1 -0
  144. package/dist/contracts/v0_2_UserWallet.js +2553 -0
  145. package/dist/contracts/v0_2_UserWalletConfig.d.ts +1468 -0
  146. package/dist/contracts/v0_2_UserWalletConfig.d.ts.map +1 -0
  147. package/dist/contracts/v0_2_UserWalletConfig.js +1764 -0
  148. package/dist/contracts/v0_3_AddyRegistry.d.ts +1109 -0
  149. package/dist/contracts/v0_3_AddyRegistry.d.ts.map +1 -0
  150. package/dist/contracts/v0_3_AddyRegistry.js +1392 -0
  151. package/dist/contracts/v0_3_Agent.d.ts +2709 -0
  152. package/dist/contracts/v0_3_Agent.d.ts.map +1 -0
  153. package/dist/contracts/v0_3_Agent.js +3458 -0
  154. package/dist/contracts/v0_3_AgentFactory.d.ts +1665 -0
  155. package/dist/contracts/v0_3_AgentFactory.d.ts.map +1 -0
  156. package/dist/contracts/v0_3_AgentFactory.js +2078 -0
  157. package/dist/contracts/v0_3_ChainlinkFeeds.d.ts +706 -0
  158. package/dist/contracts/v0_3_ChainlinkFeeds.d.ts.map +1 -0
  159. package/dist/contracts/v0_3_ChainlinkFeeds.js +900 -0
  160. package/dist/contracts/v0_3_LegoAaveV3.d.ts +1033 -0
  161. package/dist/contracts/v0_3_LegoAaveV3.d.ts.map +1 -0
  162. package/dist/contracts/v0_3_LegoAaveV3.js +1330 -0
  163. package/dist/contracts/v0_3_LegoAeroClassic.d.ts +1204 -0
  164. package/dist/contracts/v0_3_LegoAeroClassic.d.ts.map +1 -0
  165. package/dist/contracts/v0_3_LegoAeroClassic.js +1546 -0
  166. package/dist/contracts/v0_3_LegoAeroSlipstream.d.ts +1300 -0
  167. package/dist/contracts/v0_3_LegoAeroSlipstream.d.ts.map +1 -0
  168. package/dist/contracts/v0_3_LegoAeroSlipstream.js +1671 -0
  169. package/dist/contracts/v0_3_LegoCommon.d.ts +164 -0
  170. package/dist/contracts/v0_3_LegoCommon.d.ts.map +1 -0
  171. package/dist/contracts/v0_3_LegoCommon.js +202 -0
  172. package/dist/contracts/v0_3_LegoCompoundV3.d.ts +1060 -0
  173. package/dist/contracts/v0_3_LegoCompoundV3.d.ts.map +1 -0
  174. package/dist/contracts/v0_3_LegoCompoundV3.js +1365 -0
  175. package/dist/contracts/v0_3_LegoCredit.d.ts +140 -0
  176. package/dist/contracts/v0_3_LegoCredit.d.ts.map +1 -0
  177. package/dist/contracts/v0_3_LegoCredit.js +179 -0
  178. package/dist/contracts/v0_3_LegoCurve.d.ts +1189 -0
  179. package/dist/contracts/v0_3_LegoCurve.d.ts.map +1 -0
  180. package/dist/contracts/v0_3_LegoCurve.js +1519 -0
  181. package/dist/contracts/v0_3_LegoDex.d.ts +587 -0
  182. package/dist/contracts/v0_3_LegoDex.d.ts.map +1 -0
  183. package/dist/contracts/v0_3_LegoDex.js +774 -0
  184. package/dist/contracts/v0_3_LegoEuler.d.ts +1074 -0
  185. package/dist/contracts/v0_3_LegoEuler.d.ts.map +1 -0
  186. package/dist/contracts/v0_3_LegoEuler.js +1383 -0
  187. package/dist/contracts/v0_3_LegoFluid.d.ts +1025 -0
  188. package/dist/contracts/v0_3_LegoFluid.d.ts.map +1 -0
  189. package/dist/contracts/v0_3_LegoFluid.js +1320 -0
  190. package/dist/contracts/v0_3_LegoHelper.d.ts +1563 -0
  191. package/dist/contracts/v0_3_LegoHelper.d.ts.map +1 -0
  192. package/dist/contracts/v0_3_LegoHelper.js +1947 -0
  193. package/dist/contracts/v0_3_LegoMoonwell.d.ts +1042 -0
  194. package/dist/contracts/v0_3_LegoMoonwell.d.ts.map +1 -0
  195. package/dist/contracts/v0_3_LegoMoonwell.js +1342 -0
  196. package/dist/contracts/v0_3_LegoMorpho.d.ts +1074 -0
  197. package/dist/contracts/v0_3_LegoMorpho.d.ts.map +1 -0
  198. package/dist/contracts/v0_3_LegoMorpho.js +1383 -0
  199. package/dist/contracts/v0_3_LegoRegistry.d.ts +1079 -0
  200. package/dist/contracts/v0_3_LegoRegistry.d.ts.map +1 -0
  201. package/dist/contracts/v0_3_LegoRegistry.js +1368 -0
  202. package/dist/contracts/v0_3_LegoSky.d.ts +923 -0
  203. package/dist/contracts/v0_3_LegoSky.d.ts.map +1 -0
  204. package/dist/contracts/v0_3_LegoSky.js +1180 -0
  205. package/dist/contracts/v0_3_LegoUniswapV3.d.ts +1338 -0
  206. package/dist/contracts/v0_3_LegoUniswapV3.d.ts.map +1 -0
  207. package/dist/contracts/v0_3_LegoUniswapV3.js +1718 -0
  208. package/dist/contracts/v0_3_LegoYield.d.ts +390 -0
  209. package/dist/contracts/v0_3_LegoYield.d.ts.map +1 -0
  210. package/dist/contracts/v0_3_LegoYield.js +511 -0
  211. package/dist/contracts/v0_3_OracleParser.d.ts +207 -0
  212. package/dist/contracts/v0_3_OracleParser.d.ts.map +1 -0
  213. package/dist/contracts/v0_3_OracleParser.js +264 -0
  214. package/dist/contracts/v0_3_OracleRegistry.d.ts +1221 -0
  215. package/dist/contracts/v0_3_OracleRegistry.d.ts.map +1 -0
  216. package/dist/contracts/v0_3_OracleRegistry.js +1562 -0
  217. package/dist/contracts/v0_3_PriceSheets.d.ts +1127 -0
  218. package/dist/contracts/v0_3_PriceSheets.d.ts.map +1 -0
  219. package/dist/contracts/v0_3_PriceSheets.js +1383 -0
  220. package/dist/contracts/v0_3_PythFeeds.d.ts +640 -0
  221. package/dist/contracts/v0_3_PythFeeds.d.ts.map +1 -0
  222. package/dist/contracts/v0_3_PythFeeds.js +813 -0
  223. package/dist/contracts/v0_3_StorkFeeds.d.ts +640 -0
  224. package/dist/contracts/v0_3_StorkFeeds.d.ts.map +1 -0
  225. package/dist/contracts/v0_3_StorkFeeds.js +813 -0
  226. package/dist/contracts/v0_3_UserWallet.d.ts +1975 -0
  227. package/dist/contracts/v0_3_UserWallet.d.ts.map +1 -0
  228. package/dist/contracts/v0_3_UserWallet.js +2577 -0
  229. package/dist/contracts/v0_3_UserWalletConfig.d.ts +1852 -0
  230. package/dist/contracts/v0_3_UserWalletConfig.d.ts.map +1 -0
  231. package/dist/contracts/v0_3_UserWalletConfig.js +2263 -0
  232. package/dist/getContracts.d.ts +75 -0
  233. package/dist/getContracts.d.ts.map +1 -0
  234. package/dist/getContracts.js +62 -0
  235. package/dist/getLegacyContracts.d.ts +69 -0
  236. package/dist/getLegacyContracts.d.ts.map +1 -0
  237. package/dist/getLegacyContracts.js +55 -0
  238. package/dist/getSwapInstructions.d.ts +33 -0
  239. package/dist/getSwapInstructions.d.ts.map +1 -0
  240. package/dist/getSwapInstructions.js +21 -0
  241. package/dist/index.d.ts +3 -475
  242. package/dist/index.d.ts.map +1 -1
  243. package/dist/index.js +8 -182
  244. package/package.json +2 -2
@@ -0,0 +1,164 @@
1
+ import { PublicClient, WalletClient } from 'viem';
2
+ type ExtractArgs<T> = T extends (...args: infer P) => any ? P : never;
3
+ type Address = `0x${string}`;
4
+ export declare const abi: readonly [{
5
+ readonly stateMutability: "view";
6
+ readonly type: "function";
7
+ readonly name: "getRegistries";
8
+ readonly inputs: readonly [];
9
+ readonly outputs: readonly [{
10
+ readonly name: "";
11
+ readonly type: "address[]";
12
+ }];
13
+ }, {
14
+ readonly stateMutability: "view";
15
+ readonly type: "function";
16
+ readonly name: "getAccessForLego";
17
+ readonly inputs: readonly [{
18
+ readonly name: "_user";
19
+ readonly type: "address";
20
+ }];
21
+ readonly outputs: readonly [{
22
+ readonly name: "";
23
+ readonly type: "address";
24
+ }, {
25
+ readonly name: "";
26
+ readonly type: "string";
27
+ }, {
28
+ readonly name: "";
29
+ readonly type: "uint256";
30
+ }];
31
+ }, {
32
+ readonly stateMutability: "nonpayable";
33
+ readonly type: "function";
34
+ readonly name: "claimRewards";
35
+ readonly inputs: readonly [{
36
+ readonly name: "_user";
37
+ readonly type: "address";
38
+ }, {
39
+ readonly name: "_market";
40
+ readonly type: "address";
41
+ }, {
42
+ readonly name: "_rewardToken";
43
+ readonly type: "address";
44
+ }, {
45
+ readonly name: "_rewardAmount";
46
+ readonly type: "uint256";
47
+ }, {
48
+ readonly name: "_proof";
49
+ readonly type: "bytes32";
50
+ }];
51
+ readonly outputs: readonly [];
52
+ }, {
53
+ readonly stateMutability: "nonpayable";
54
+ readonly type: "function";
55
+ readonly name: "recoverFunds";
56
+ readonly inputs: readonly [{
57
+ readonly name: "_asset";
58
+ readonly type: "address";
59
+ }, {
60
+ readonly name: "_recipient";
61
+ readonly type: "address";
62
+ }];
63
+ readonly outputs: readonly [{
64
+ readonly name: "";
65
+ readonly type: "bool";
66
+ }];
67
+ }, {
68
+ readonly stateMutability: "view";
69
+ readonly type: "function";
70
+ readonly name: "legoId";
71
+ readonly inputs: readonly [];
72
+ readonly outputs: readonly [{
73
+ readonly name: "";
74
+ readonly type: "uint256";
75
+ }];
76
+ }, {
77
+ readonly stateMutability: "nonpayable";
78
+ readonly type: "function";
79
+ readonly name: "setLegoId";
80
+ readonly inputs: readonly [{
81
+ readonly name: "_legoId";
82
+ readonly type: "uint256";
83
+ }];
84
+ readonly outputs: readonly [{
85
+ readonly name: "";
86
+ readonly type: "bool";
87
+ }];
88
+ }, {
89
+ readonly stateMutability: "view";
90
+ readonly type: "function";
91
+ readonly name: "hasClaimableRewards";
92
+ readonly inputs: readonly [{
93
+ readonly name: "_user";
94
+ readonly type: "address";
95
+ }];
96
+ readonly outputs: readonly [{
97
+ readonly name: "";
98
+ readonly type: "bool";
99
+ }];
100
+ }];
101
+ export declare const deployAddress: Address | undefined;
102
+ export type Contract = {
103
+ calls: {
104
+ getRegistries: () => Promise<`0x${string}`[]>;
105
+ getAccessForLego: (user: `0x${string}`) => Promise<[`0x${string}`, string, bigint]>;
106
+ legoId: () => Promise<bigint>;
107
+ hasClaimableRewards: (user: `0x${string}`) => Promise<boolean>;
108
+ };
109
+ mutations: {
110
+ claimRewards: (user: `0x${string}`, market: `0x${string}`, rewardToken: `0x${string}`, rewardAmount: bigint, proof: `0x${string}`) => Promise<void>;
111
+ recoverFunds: (asset: `0x${string}`, recipient: `0x${string}`) => Promise<boolean>;
112
+ setLegoId: (legoId: bigint) => Promise<boolean>;
113
+ };
114
+ events: {};
115
+ };
116
+ export type Calls = keyof Contract['calls'];
117
+ export type Request<M extends Calls> = {
118
+ contractName: 'v0_3_LegoCommon';
119
+ method: M;
120
+ args: ExtractArgs<Contract['calls'][M]>;
121
+ address: Address | undefined;
122
+ deployAddress: Address | undefined;
123
+ defaultValue: Awaited<ReturnType<Contract['calls'][M]>> | undefined;
124
+ getAbi: () => typeof abi;
125
+ with: (options: {
126
+ contractAddress?: Address;
127
+ defaultValue?: Awaited<ReturnType<Contract['calls'][M]>>;
128
+ }) => Request<M>;
129
+ defaultTo: (defaultValue: Awaited<ReturnType<Contract['calls'][M]>>) => Request<M>;
130
+ at: (address: Address) => Request<M>;
131
+ };
132
+ export type CallReturn<M extends Calls> = NonNullable<Request<M>['defaultValue']>;
133
+ declare function getRequest<M extends Calls>(method: M, args: ExtractArgs<Contract['calls'][M]>, contractAddressOrOptions?: Address | {
134
+ contractAddress?: Address;
135
+ defaultValue?: Awaited<ReturnType<Contract['calls'][M]>>;
136
+ }): Request<M>;
137
+ type CallType = {
138
+ [K in Calls]: (...args: ExtractArgs<Contract['calls'][K]>) => ReturnType<typeof getRequest<K>>;
139
+ };
140
+ export declare const call: CallType;
141
+ export type Mutations = keyof Contract['mutations'];
142
+ export declare const mutation: {
143
+ [K in Mutations]: {
144
+ contractName: 'v0_3_LegoCommon';
145
+ deployAddress: Address | undefined;
146
+ getAbi: () => typeof abi;
147
+ functionName: K;
148
+ argsType: ExtractArgs<Contract['mutations'][K]> | undefined;
149
+ };
150
+ };
151
+ export type SDK = {
152
+ deployAddress: Address | undefined;
153
+ abi: typeof abi;
154
+ getRegistries: (...args: ExtractArgs<Contract['calls']['getRegistries']>) => Promise<CallReturn<'getRegistries'>>;
155
+ getAccessForLego: (...args: ExtractArgs<Contract['calls']['getAccessForLego']>) => Promise<CallReturn<'getAccessForLego'>>;
156
+ legoId: (...args: ExtractArgs<Contract['calls']['legoId']>) => Promise<CallReturn<'legoId'>>;
157
+ hasClaimableRewards: (...args: ExtractArgs<Contract['calls']['hasClaimableRewards']>) => Promise<CallReturn<'hasClaimableRewards'>>;
158
+ claimRewards: (...args: ExtractArgs<Contract['mutations']['claimRewards']>) => Promise<Address>;
159
+ recoverFunds: (...args: ExtractArgs<Contract['mutations']['recoverFunds']>) => Promise<Address>;
160
+ setLegoId: (...args: ExtractArgs<Contract['mutations']['setLegoId']>) => Promise<Address>;
161
+ };
162
+ export declare function toSdk(deployAddress: Address, publicClient?: PublicClient, walletClient?: WalletClient): SDK;
163
+ export {};
164
+ //# sourceMappingURL=v0_3_LegoCommon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v0_3_LegoCommon.d.ts","sourceRoot":"","sources":["../../src/contracts/v0_3_LegoCommon.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAEjD,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,CAAA;AACrE,KAAK,OAAO,GAAG,KAAK,MAAM,EAAE,CAAA;AAE5B,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqIN,CAAA;AAEV,eAAO,MAAM,aAAa,EAAE,OAAO,GAAG,SAAqB,CAAA;AAE3D,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE;QACL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UAAU,CAAC,qBAAqB,CAAC,CAAC,CAAA;IAC/C,YAAY,EAAE,CAAC,GAAG,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,cAAc,CAAC,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IAC/F,YAAY,EAAE,CAAC,GAAG,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,cAAc,CAAC,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IAC/F,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAC1F,CAAA;AAED,wBAAgB,KAAK,CAAC,aAAa,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,GAAG,CA0B3G"}
@@ -0,0 +1,202 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /* @ts-nocheck */
5
+ import { singleQuery, mutate } from '@dappql/async';
6
+ export const abi = [
7
+ {
8
+ stateMutability: 'view',
9
+ type: 'function',
10
+ name: 'getRegistries',
11
+ inputs: [],
12
+ outputs: [
13
+ {
14
+ name: '',
15
+ type: 'address[]',
16
+ },
17
+ ],
18
+ },
19
+ {
20
+ stateMutability: 'view',
21
+ type: 'function',
22
+ name: 'getAccessForLego',
23
+ inputs: [
24
+ {
25
+ name: '_user',
26
+ type: 'address',
27
+ },
28
+ ],
29
+ outputs: [
30
+ {
31
+ name: '',
32
+ type: 'address',
33
+ },
34
+ {
35
+ name: '',
36
+ type: 'string',
37
+ },
38
+ {
39
+ name: '',
40
+ type: 'uint256',
41
+ },
42
+ ],
43
+ },
44
+ {
45
+ stateMutability: 'nonpayable',
46
+ type: 'function',
47
+ name: 'claimRewards',
48
+ inputs: [
49
+ {
50
+ name: '_user',
51
+ type: 'address',
52
+ },
53
+ {
54
+ name: '_market',
55
+ type: 'address',
56
+ },
57
+ {
58
+ name: '_rewardToken',
59
+ type: 'address',
60
+ },
61
+ {
62
+ name: '_rewardAmount',
63
+ type: 'uint256',
64
+ },
65
+ {
66
+ name: '_proof',
67
+ type: 'bytes32',
68
+ },
69
+ ],
70
+ outputs: [],
71
+ },
72
+ {
73
+ stateMutability: 'nonpayable',
74
+ type: 'function',
75
+ name: 'recoverFunds',
76
+ inputs: [
77
+ {
78
+ name: '_asset',
79
+ type: 'address',
80
+ },
81
+ {
82
+ name: '_recipient',
83
+ type: 'address',
84
+ },
85
+ ],
86
+ outputs: [
87
+ {
88
+ name: '',
89
+ type: 'bool',
90
+ },
91
+ ],
92
+ },
93
+ {
94
+ stateMutability: 'view',
95
+ type: 'function',
96
+ name: 'legoId',
97
+ inputs: [],
98
+ outputs: [
99
+ {
100
+ name: '',
101
+ type: 'uint256',
102
+ },
103
+ ],
104
+ },
105
+ {
106
+ stateMutability: 'nonpayable',
107
+ type: 'function',
108
+ name: 'setLegoId',
109
+ inputs: [
110
+ {
111
+ name: '_legoId',
112
+ type: 'uint256',
113
+ },
114
+ ],
115
+ outputs: [
116
+ {
117
+ name: '',
118
+ type: 'bool',
119
+ },
120
+ ],
121
+ },
122
+ {
123
+ stateMutability: 'view',
124
+ type: 'function',
125
+ name: 'hasClaimableRewards',
126
+ inputs: [
127
+ {
128
+ name: '_user',
129
+ type: 'address',
130
+ },
131
+ ],
132
+ outputs: [
133
+ {
134
+ name: '',
135
+ type: 'bool',
136
+ },
137
+ ],
138
+ },
139
+ ];
140
+ export const deployAddress = undefined;
141
+ function getRequest(method, args, contractAddressOrOptions) {
142
+ const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
143
+ const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
144
+ const call = {
145
+ contractName: 'v0_3_LegoCommon',
146
+ method,
147
+ args,
148
+ address,
149
+ deployAddress,
150
+ defaultValue,
151
+ getAbi: () => abi,
152
+ with: (options) => {
153
+ call.address = options.contractAddress;
154
+ call.defaultValue = options.defaultValue;
155
+ return call;
156
+ },
157
+ defaultTo: (defaultValue) => {
158
+ call.defaultValue = defaultValue;
159
+ return call;
160
+ },
161
+ at: (address) => {
162
+ call.address = address;
163
+ return call;
164
+ },
165
+ };
166
+ return call;
167
+ }
168
+ export const call = {
169
+ getRegistries: (...args) => getRequest('getRegistries', args),
170
+ getAccessForLego: (...args) => getRequest('getAccessForLego', args),
171
+ legoId: (...args) => getRequest('legoId', args),
172
+ hasClaimableRewards: (...args) => getRequest('hasClaimableRewards', args),
173
+ };
174
+ function getMutation(functionName) {
175
+ return {
176
+ contractName: 'v0_3_LegoCommon',
177
+ functionName,
178
+ deployAddress,
179
+ argsType: undefined,
180
+ getAbi: () => abi,
181
+ };
182
+ }
183
+ export const mutation = {
184
+ claimRewards: getMutation('claimRewards'),
185
+ recoverFunds: getMutation('recoverFunds'),
186
+ setLegoId: getMutation('setLegoId'),
187
+ };
188
+ export function toSdk(deployAddress, publicClient, walletClient) {
189
+ return {
190
+ deployAddress,
191
+ abi,
192
+ // Queries
193
+ getRegistries: (...args) => singleQuery(publicClient, call.getRegistries(...args).at(deployAddress)),
194
+ getAccessForLego: (...args) => singleQuery(publicClient, call.getAccessForLego(...args).at(deployAddress)),
195
+ legoId: (...args) => singleQuery(publicClient, call.legoId(...args).at(deployAddress)),
196
+ hasClaimableRewards: (...args) => singleQuery(publicClient, call.hasClaimableRewards(...args).at(deployAddress)),
197
+ // Mutations
198
+ claimRewards: (...args) => mutate(walletClient, mutation.claimRewards, { address: deployAddress })(...args),
199
+ recoverFunds: (...args) => mutate(walletClient, mutation.recoverFunds, { address: deployAddress })(...args),
200
+ setLegoId: (...args) => mutate(walletClient, mutation.setLegoId, { address: deployAddress })(...args),
201
+ };
202
+ }