@ripe-finance/sdk 0.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 (246) hide show
  1. package/LICENSE +41 -0
  2. package/README.md +44 -0
  3. package/dist/contracts/AddyRegistry.d.ts +1109 -0
  4. package/dist/contracts/AddyRegistry.d.ts.map +1 -0
  5. package/dist/contracts/AddyRegistry.js +1392 -0
  6. package/dist/contracts/AddyRegistry_v1.d.ts +473 -0
  7. package/dist/contracts/AddyRegistry_v1.d.ts.map +1 -0
  8. package/dist/contracts/AddyRegistry_v1.js +594 -0
  9. package/dist/contracts/AddyRegistry_v2.d.ts +1050 -0
  10. package/dist/contracts/AddyRegistry_v2.d.ts.map +1 -0
  11. package/dist/contracts/AddyRegistry_v2.js +1313 -0
  12. package/dist/contracts/Agent.d.ts +2709 -0
  13. package/dist/contracts/Agent.d.ts.map +1 -0
  14. package/dist/contracts/Agent.js +3458 -0
  15. package/dist/contracts/AgentFactory.d.ts +1665 -0
  16. package/dist/contracts/AgentFactory.d.ts.map +1 -0
  17. package/dist/contracts/AgentFactory.js +2078 -0
  18. package/dist/contracts/AgentFactory_v1.d.ts +1054 -0
  19. package/dist/contracts/AgentFactory_v1.d.ts.map +1 -0
  20. package/dist/contracts/AgentFactory_v1.js +1336 -0
  21. package/dist/contracts/AgentFactory_v2.d.ts +1275 -0
  22. package/dist/contracts/AgentFactory_v2.d.ts.map +1 -0
  23. package/dist/contracts/AgentFactory_v2.js +1609 -0
  24. package/dist/contracts/AgentTemplate.d.ts +2629 -0
  25. package/dist/contracts/AgentTemplate.d.ts.map +1 -0
  26. package/dist/contracts/AgentTemplate.js +3370 -0
  27. package/dist/contracts/Agent_v1.d.ts +2631 -0
  28. package/dist/contracts/Agent_v1.d.ts.map +1 -0
  29. package/dist/contracts/Agent_v1.js +3372 -0
  30. package/dist/contracts/Agent_v2.d.ts +2709 -0
  31. package/dist/contracts/Agent_v2.d.ts.map +1 -0
  32. package/dist/contracts/Agent_v2.js +3458 -0
  33. package/dist/contracts/AuctionHouse.d.ts +1566 -0
  34. package/dist/contracts/AuctionHouse.d.ts.map +1 -0
  35. package/dist/contracts/AuctionHouse.js +1814 -0
  36. package/dist/contracts/AuctionHouseNFT.d.ts +259 -0
  37. package/dist/contracts/AuctionHouseNFT.d.ts.map +1 -0
  38. package/dist/contracts/AuctionHouseNFT.js +295 -0
  39. package/dist/contracts/BlueChipYieldPrices.d.ts +1916 -0
  40. package/dist/contracts/BlueChipYieldPrices.d.ts.map +1 -0
  41. package/dist/contracts/BlueChipYieldPrices.js +2414 -0
  42. package/dist/contracts/Boardroom.d.ts +276 -0
  43. package/dist/contracts/Boardroom.d.ts.map +1 -0
  44. package/dist/contracts/Boardroom.js +317 -0
  45. package/dist/contracts/BondRoom.d.ts +539 -0
  46. package/dist/contracts/BondRoom.d.ts.map +1 -0
  47. package/dist/contracts/BondRoom.js +640 -0
  48. package/dist/contracts/ChainlinkFeeds.d.ts +706 -0
  49. package/dist/contracts/ChainlinkFeeds.d.ts.map +1 -0
  50. package/dist/contracts/ChainlinkFeeds.js +900 -0
  51. package/dist/contracts/ChainlinkPrices.d.ts +1594 -0
  52. package/dist/contracts/ChainlinkPrices.d.ts.map +1 -0
  53. package/dist/contracts/ChainlinkPrices.js +2023 -0
  54. package/dist/contracts/Contributor.d.ts +731 -0
  55. package/dist/contracts/Contributor.d.ts.map +1 -0
  56. package/dist/contracts/Contributor.js +896 -0
  57. package/dist/contracts/CreditEngine.d.ts +2295 -0
  58. package/dist/contracts/CreditEngine.d.ts.map +1 -0
  59. package/dist/contracts/CreditEngine.js +2662 -0
  60. package/dist/contracts/CurvePrices.d.ts +2041 -0
  61. package/dist/contracts/CurvePrices.d.ts.map +1 -0
  62. package/dist/contracts/CurvePrices.js +2523 -0
  63. package/dist/contracts/DefaultsBase.d.ts +470 -0
  64. package/dist/contracts/DefaultsBase.d.ts.map +1 -0
  65. package/dist/contracts/DefaultsBase.js +512 -0
  66. package/dist/contracts/ERC20.d.ts +271 -0
  67. package/dist/contracts/ERC20.d.ts.map +1 -0
  68. package/dist/contracts/ERC20.js +339 -0
  69. package/dist/contracts/Endaoment.d.ts +2208 -0
  70. package/dist/contracts/Endaoment.d.ts.map +1 -0
  71. package/dist/contracts/Endaoment.js +2877 -0
  72. package/dist/contracts/GreenPool.d.ts +1248 -0
  73. package/dist/contracts/GreenPool.d.ts.map +1 -0
  74. package/dist/contracts/GreenPool.js +1614 -0
  75. package/dist/contracts/GreenToken.d.ts +776 -0
  76. package/dist/contracts/GreenToken.d.ts.map +1 -0
  77. package/dist/contracts/GreenToken.js +990 -0
  78. package/dist/contracts/HumanResources.d.ts +1176 -0
  79. package/dist/contracts/HumanResources.d.ts.map +1 -0
  80. package/dist/contracts/HumanResources.js +1464 -0
  81. package/dist/contracts/Ledger.d.ts +2312 -0
  82. package/dist/contracts/Ledger.d.ts.map +1 -0
  83. package/dist/contracts/Ledger.js +2712 -0
  84. package/dist/contracts/LegoAaveV3.d.ts +1033 -0
  85. package/dist/contracts/LegoAaveV3.d.ts.map +1 -0
  86. package/dist/contracts/LegoAaveV3.js +1330 -0
  87. package/dist/contracts/LegoAeroClassic.d.ts +1204 -0
  88. package/dist/contracts/LegoAeroClassic.d.ts.map +1 -0
  89. package/dist/contracts/LegoAeroClassic.js +1546 -0
  90. package/dist/contracts/LegoAeroSlipstream.d.ts +1300 -0
  91. package/dist/contracts/LegoAeroSlipstream.d.ts.map +1 -0
  92. package/dist/contracts/LegoAeroSlipstream.js +1671 -0
  93. package/dist/contracts/LegoCommon.d.ts +164 -0
  94. package/dist/contracts/LegoCommon.d.ts.map +1 -0
  95. package/dist/contracts/LegoCommon.js +202 -0
  96. package/dist/contracts/LegoCompoundV3.d.ts +1060 -0
  97. package/dist/contracts/LegoCompoundV3.d.ts.map +1 -0
  98. package/dist/contracts/LegoCompoundV3.js +1365 -0
  99. package/dist/contracts/LegoCredit.d.ts +140 -0
  100. package/dist/contracts/LegoCredit.d.ts.map +1 -0
  101. package/dist/contracts/LegoCredit.js +179 -0
  102. package/dist/contracts/LegoCurve.d.ts +1189 -0
  103. package/dist/contracts/LegoCurve.d.ts.map +1 -0
  104. package/dist/contracts/LegoCurve.js +1519 -0
  105. package/dist/contracts/LegoDex.d.ts +587 -0
  106. package/dist/contracts/LegoDex.d.ts.map +1 -0
  107. package/dist/contracts/LegoDex.js +774 -0
  108. package/dist/contracts/LegoEuler.d.ts +1074 -0
  109. package/dist/contracts/LegoEuler.d.ts.map +1 -0
  110. package/dist/contracts/LegoEuler.js +1383 -0
  111. package/dist/contracts/LegoFluid.d.ts +1025 -0
  112. package/dist/contracts/LegoFluid.d.ts.map +1 -0
  113. package/dist/contracts/LegoFluid.js +1320 -0
  114. package/dist/contracts/LegoHelper.d.ts +1563 -0
  115. package/dist/contracts/LegoHelper.d.ts.map +1 -0
  116. package/dist/contracts/LegoHelper.js +1947 -0
  117. package/dist/contracts/LegoMoonwell.d.ts +1042 -0
  118. package/dist/contracts/LegoMoonwell.d.ts.map +1 -0
  119. package/dist/contracts/LegoMoonwell.js +1342 -0
  120. package/dist/contracts/LegoMorpho.d.ts +1074 -0
  121. package/dist/contracts/LegoMorpho.d.ts.map +1 -0
  122. package/dist/contracts/LegoMorpho.js +1383 -0
  123. package/dist/contracts/LegoRegistry.d.ts +1079 -0
  124. package/dist/contracts/LegoRegistry.d.ts.map +1 -0
  125. package/dist/contracts/LegoRegistry.js +1368 -0
  126. package/dist/contracts/LegoSky.d.ts +923 -0
  127. package/dist/contracts/LegoSky.d.ts.map +1 -0
  128. package/dist/contracts/LegoSky.js +1180 -0
  129. package/dist/contracts/LegoUniswapV2.d.ts +1204 -0
  130. package/dist/contracts/LegoUniswapV2.d.ts.map +1 -0
  131. package/dist/contracts/LegoUniswapV2.js +1546 -0
  132. package/dist/contracts/LegoUniswapV3.d.ts +1338 -0
  133. package/dist/contracts/LegoUniswapV3.d.ts.map +1 -0
  134. package/dist/contracts/LegoUniswapV3.js +1718 -0
  135. package/dist/contracts/LegoYield.d.ts +390 -0
  136. package/dist/contracts/LegoYield.d.ts.map +1 -0
  137. package/dist/contracts/LegoYield.js +511 -0
  138. package/dist/contracts/Lootbox.d.ts +1258 -0
  139. package/dist/contracts/Lootbox.d.ts.map +1 -0
  140. package/dist/contracts/Lootbox.js +1435 -0
  141. package/dist/contracts/MissionControl.d.ts +2642 -0
  142. package/dist/contracts/MissionControl.d.ts.map +1 -0
  143. package/dist/contracts/MissionControl.js +2957 -0
  144. package/dist/contracts/OracleParser.d.ts +207 -0
  145. package/dist/contracts/OracleParser.d.ts.map +1 -0
  146. package/dist/contracts/OracleParser.js +264 -0
  147. package/dist/contracts/OracleRegistry.d.ts +1221 -0
  148. package/dist/contracts/OracleRegistry.d.ts.map +1 -0
  149. package/dist/contracts/OracleRegistry.js +1562 -0
  150. package/dist/contracts/PriceDesk.d.ts +1581 -0
  151. package/dist/contracts/PriceDesk.d.ts.map +1 -0
  152. package/dist/contracts/PriceDesk.js +1993 -0
  153. package/dist/contracts/PriceSheets.d.ts +1127 -0
  154. package/dist/contracts/PriceSheets.d.ts.map +1 -0
  155. package/dist/contracts/PriceSheets.js +1383 -0
  156. package/dist/contracts/PythFeeds.d.ts +640 -0
  157. package/dist/contracts/PythFeeds.d.ts.map +1 -0
  158. package/dist/contracts/PythFeeds.js +813 -0
  159. package/dist/contracts/PythPrices.d.ts +1435 -0
  160. package/dist/contracts/PythPrices.d.ts.map +1 -0
  161. package/dist/contracts/PythPrices.js +1819 -0
  162. package/dist/contracts/RebaseErc20.d.ts +1080 -0
  163. package/dist/contracts/RebaseErc20.d.ts.map +1 -0
  164. package/dist/contracts/RebaseErc20.js +1312 -0
  165. package/dist/contracts/RipeGov.d.ts +2157 -0
  166. package/dist/contracts/RipeGov.d.ts.map +1 -0
  167. package/dist/contracts/RipeGov.js +2529 -0
  168. package/dist/contracts/RipeHq.d.ts +1612 -0
  169. package/dist/contracts/RipeHq.d.ts.map +1 -0
  170. package/dist/contracts/RipeHq.js +2029 -0
  171. package/dist/contracts/RipeToken.d.ts +776 -0
  172. package/dist/contracts/RipeToken.d.ts.map +1 -0
  173. package/dist/contracts/RipeToken.js +990 -0
  174. package/dist/contracts/SavingsGreen.d.ts +1160 -0
  175. package/dist/contracts/SavingsGreen.d.ts.map +1 -0
  176. package/dist/contracts/SavingsGreen.js +1505 -0
  177. package/dist/contracts/SimpleErc20.d.ts +1028 -0
  178. package/dist/contracts/SimpleErc20.d.ts.map +1 -0
  179. package/dist/contracts/SimpleErc20.js +1243 -0
  180. package/dist/contracts/StabilityPool.d.ts +1843 -0
  181. package/dist/contracts/StabilityPool.d.ts.map +1 -0
  182. package/dist/contracts/StabilityPool.js +2229 -0
  183. package/dist/contracts/StorkFeeds.d.ts +640 -0
  184. package/dist/contracts/StorkFeeds.d.ts.map +1 -0
  185. package/dist/contracts/StorkFeeds.js +813 -0
  186. package/dist/contracts/StorkPrices.d.ts +1435 -0
  187. package/dist/contracts/StorkPrices.d.ts.map +1 -0
  188. package/dist/contracts/StorkPrices.js +1819 -0
  189. package/dist/contracts/Switchboard.d.ts +1416 -0
  190. package/dist/contracts/Switchboard.d.ts.map +1 -0
  191. package/dist/contracts/Switchboard.js +1767 -0
  192. package/dist/contracts/SwitchboardAlpha.d.ts +2647 -0
  193. package/dist/contracts/SwitchboardAlpha.d.ts.map +1 -0
  194. package/dist/contracts/SwitchboardAlpha.js +3301 -0
  195. package/dist/contracts/SwitchboardBravo.d.ts +2833 -0
  196. package/dist/contracts/SwitchboardBravo.d.ts.map +1 -0
  197. package/dist/contracts/SwitchboardBravo.js +3640 -0
  198. package/dist/contracts/SwitchboardCharlie.d.ts +3651 -0
  199. package/dist/contracts/SwitchboardCharlie.d.ts.map +1 -0
  200. package/dist/contracts/SwitchboardCharlie.js +4642 -0
  201. package/dist/contracts/SwitchboardDelta.d.ts +1490 -0
  202. package/dist/contracts/SwitchboardDelta.d.ts.map +1 -0
  203. package/dist/contracts/SwitchboardDelta.js +1872 -0
  204. package/dist/contracts/Teller.d.ts +2664 -0
  205. package/dist/contracts/Teller.d.ts.map +1 -0
  206. package/dist/contracts/Teller.js +3518 -0
  207. package/dist/contracts/TrainingWheels.d.ts +321 -0
  208. package/dist/contracts/TrainingWheels.d.ts.map +1 -0
  209. package/dist/contracts/TrainingWheels.js +376 -0
  210. package/dist/contracts/UserWallet.d.ts +1975 -0
  211. package/dist/contracts/UserWallet.d.ts.map +1 -0
  212. package/dist/contracts/UserWallet.js +2577 -0
  213. package/dist/contracts/UserWalletConfig.d.ts +1852 -0
  214. package/dist/contracts/UserWalletConfig.d.ts.map +1 -0
  215. package/dist/contracts/UserWalletConfig.js +2263 -0
  216. package/dist/contracts/UserWalletConfig_v1.d.ts +1400 -0
  217. package/dist/contracts/UserWalletConfig_v1.d.ts.map +1 -0
  218. package/dist/contracts/UserWalletConfig_v1.js +1676 -0
  219. package/dist/contracts/UserWalletConfig_v2.d.ts +1468 -0
  220. package/dist/contracts/UserWalletConfig_v2.d.ts.map +1 -0
  221. package/dist/contracts/UserWalletConfig_v2.js +1764 -0
  222. package/dist/contracts/UserWallet_v1.d.ts +1980 -0
  223. package/dist/contracts/UserWallet_v1.d.ts.map +1 -0
  224. package/dist/contracts/UserWallet_v1.js +2581 -0
  225. package/dist/contracts/UserWallet_v2.d.ts +1958 -0
  226. package/dist/contracts/UserWallet_v2.d.ts.map +1 -0
  227. package/dist/contracts/UserWallet_v2.js +2553 -0
  228. package/dist/contracts/VaultBook.d.ts +1416 -0
  229. package/dist/contracts/VaultBook.d.ts.map +1 -0
  230. package/dist/contracts/VaultBook.js +1767 -0
  231. package/dist/contracts/WalletConfig.d.ts +1398 -0
  232. package/dist/contracts/WalletConfig.d.ts.map +1 -0
  233. package/dist/contracts/WalletConfig.js +1674 -0
  234. package/dist/contracts/WalletFunds.d.ts +1978 -0
  235. package/dist/contracts/WalletFunds.d.ts.map +1 -0
  236. package/dist/contracts/WalletFunds.js +2579 -0
  237. package/dist/contracts/index.d.ts +37 -0
  238. package/dist/contracts/index.d.ts.map +1 -0
  239. package/dist/contracts/index.js +40 -0
  240. package/dist/contracts/sdk.d.ts +77 -0
  241. package/dist/contracts/sdk.d.ts.map +1 -0
  242. package/dist/contracts/sdk.js +80 -0
  243. package/dist/index.d.ts +2907 -0
  244. package/dist/index.d.ts.map +1 -0
  245. package/dist/index.js +317 -0
  246. package/package.json +36 -0
@@ -0,0 +1,271 @@
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 type: "event";
6
+ readonly name: "Transfer";
7
+ readonly inputs: readonly [{
8
+ readonly name: "sender";
9
+ readonly type: "address";
10
+ readonly indexed: true;
11
+ }, {
12
+ readonly name: "receiver";
13
+ readonly type: "address";
14
+ readonly indexed: true;
15
+ }, {
16
+ readonly name: "amount";
17
+ readonly type: "uint256";
18
+ readonly indexed: false;
19
+ }];
20
+ readonly anonymous: false;
21
+ }, {
22
+ readonly type: "event";
23
+ readonly name: "Approval";
24
+ readonly inputs: readonly [{
25
+ readonly name: "owner";
26
+ readonly type: "address";
27
+ readonly indexed: true;
28
+ }, {
29
+ readonly name: "spender";
30
+ readonly type: "address";
31
+ readonly indexed: true;
32
+ }, {
33
+ readonly name: "amount";
34
+ readonly type: "uint256";
35
+ readonly indexed: false;
36
+ }];
37
+ readonly anonymous: false;
38
+ }, {
39
+ readonly type: "function";
40
+ readonly name: "name";
41
+ readonly stateMutability: "pure";
42
+ readonly inputs: readonly [];
43
+ readonly outputs: readonly [{
44
+ readonly name: "";
45
+ readonly type: "string";
46
+ }];
47
+ }, {
48
+ readonly type: "function";
49
+ readonly name: "symbol";
50
+ readonly stateMutability: "pure";
51
+ readonly inputs: readonly [];
52
+ readonly outputs: readonly [{
53
+ readonly name: "";
54
+ readonly type: "string";
55
+ }];
56
+ }, {
57
+ readonly type: "function";
58
+ readonly name: "decimals";
59
+ readonly stateMutability: "pure";
60
+ readonly inputs: readonly [];
61
+ readonly outputs: readonly [{
62
+ readonly name: "";
63
+ readonly type: "uint8";
64
+ }];
65
+ }, {
66
+ readonly type: "function";
67
+ readonly name: "transfer";
68
+ readonly stateMutability: "nonpayable";
69
+ readonly inputs: readonly [{
70
+ readonly name: "_recipient";
71
+ readonly type: "address";
72
+ }, {
73
+ readonly name: "_amount";
74
+ readonly type: "uint256";
75
+ }];
76
+ readonly outputs: readonly [{
77
+ readonly name: "";
78
+ readonly type: "bool";
79
+ }];
80
+ }, {
81
+ readonly type: "function";
82
+ readonly name: "transferFrom";
83
+ readonly stateMutability: "nonpayable";
84
+ readonly inputs: readonly [{
85
+ readonly name: "_sender";
86
+ readonly type: "address";
87
+ }, {
88
+ readonly name: "_recipient";
89
+ readonly type: "address";
90
+ }, {
91
+ readonly name: "_amount";
92
+ readonly type: "uint256";
93
+ }];
94
+ readonly outputs: readonly [{
95
+ readonly name: "";
96
+ readonly type: "bool";
97
+ }];
98
+ }, {
99
+ readonly type: "function";
100
+ readonly name: "approve";
101
+ readonly stateMutability: "nonpayable";
102
+ readonly inputs: readonly [{
103
+ readonly name: "_spender";
104
+ readonly type: "address";
105
+ }, {
106
+ readonly name: "_amount";
107
+ readonly type: "uint256";
108
+ }];
109
+ readonly outputs: readonly [{
110
+ readonly name: "";
111
+ readonly type: "bool";
112
+ }];
113
+ }, {
114
+ readonly type: "function";
115
+ readonly name: "permit";
116
+ readonly stateMutability: "nonpayable";
117
+ readonly inputs: readonly [{
118
+ readonly name: "_owner";
119
+ readonly type: "address";
120
+ }, {
121
+ readonly name: "_spender";
122
+ readonly type: "address";
123
+ }, {
124
+ readonly name: "_amount";
125
+ readonly type: "uint256";
126
+ }, {
127
+ readonly name: "_expiry";
128
+ readonly type: "uint256";
129
+ }, {
130
+ readonly name: "_signature";
131
+ readonly type: "bytes";
132
+ }];
133
+ readonly outputs: readonly [{
134
+ readonly name: "";
135
+ readonly type: "bool";
136
+ }];
137
+ }, {
138
+ readonly type: "function";
139
+ readonly name: "totalSupply";
140
+ readonly stateMutability: "view";
141
+ readonly inputs: readonly [];
142
+ readonly outputs: readonly [{
143
+ readonly name: "";
144
+ readonly type: "uint256";
145
+ }];
146
+ }, {
147
+ readonly type: "function";
148
+ readonly name: "balanceOf";
149
+ readonly stateMutability: "view";
150
+ readonly inputs: readonly [{
151
+ readonly name: "arg0";
152
+ readonly type: "address";
153
+ }];
154
+ readonly outputs: readonly [{
155
+ readonly name: "";
156
+ readonly type: "uint256";
157
+ }];
158
+ }, {
159
+ readonly type: "function";
160
+ readonly name: "allowance";
161
+ readonly stateMutability: "view";
162
+ readonly inputs: readonly [{
163
+ readonly name: "arg0";
164
+ readonly type: "address";
165
+ }, {
166
+ readonly name: "arg1";
167
+ readonly type: "address";
168
+ }];
169
+ readonly outputs: readonly [{
170
+ readonly name: "";
171
+ readonly type: "uint256";
172
+ }];
173
+ }, {
174
+ readonly type: "function";
175
+ readonly name: "nonces";
176
+ readonly stateMutability: "view";
177
+ readonly inputs: readonly [{
178
+ readonly name: "arg0";
179
+ readonly type: "address";
180
+ }];
181
+ readonly outputs: readonly [{
182
+ readonly name: "";
183
+ readonly type: "uint256";
184
+ }];
185
+ }, {
186
+ readonly type: "function";
187
+ readonly name: "DOMAIN_SEPARATOR";
188
+ readonly stateMutability: "view";
189
+ readonly inputs: readonly [];
190
+ readonly outputs: readonly [{
191
+ readonly name: "";
192
+ readonly type: "bytes32";
193
+ }];
194
+ }];
195
+ export declare const deployAddress: Address | undefined;
196
+ export type Contract = {
197
+ calls: {
198
+ name: () => Promise<string>;
199
+ symbol: () => Promise<string>;
200
+ decimals: () => Promise<number>;
201
+ totalSupply: () => Promise<bigint>;
202
+ balanceOf: (arg0: `0x${string}`) => Promise<bigint>;
203
+ allowance: (arg0: `0x${string}`, arg1: `0x${string}`) => Promise<bigint>;
204
+ nonces: (arg0: `0x${string}`) => Promise<bigint>;
205
+ DOMAIN_SEPARATOR: () => Promise<`0x${string}`>;
206
+ };
207
+ mutations: {
208
+ transfer: (recipient: `0x${string}`, amount: bigint) => Promise<boolean>;
209
+ transferFrom: (sender: `0x${string}`, recipient: `0x${string}`, amount: bigint) => Promise<boolean>;
210
+ approve: (spender: `0x${string}`, amount: bigint) => Promise<boolean>;
211
+ permit: (owner: `0x${string}`, spender: `0x${string}`, amount: bigint, expiry: bigint, signature: `0x${string}`) => Promise<boolean>;
212
+ };
213
+ events: {
214
+ Transfer: (sender: `0x${string}`, receiver: `0x${string}`, amount: bigint) => Promise<void>;
215
+ Approval: (owner: `0x${string}`, spender: `0x${string}`, amount: bigint) => Promise<void>;
216
+ };
217
+ };
218
+ export type Calls = keyof Contract['calls'];
219
+ export type Request<M extends Calls> = {
220
+ contractName: 'ERC20';
221
+ method: M;
222
+ args: ExtractArgs<Contract['calls'][M]>;
223
+ address: Address | undefined;
224
+ deployAddress: Address | undefined;
225
+ defaultValue: Awaited<ReturnType<Contract['calls'][M]>> | undefined;
226
+ getAbi: () => typeof abi;
227
+ with: (options: {
228
+ contractAddress?: Address;
229
+ defaultValue?: Awaited<ReturnType<Contract['calls'][M]>>;
230
+ }) => Request<M>;
231
+ defaultTo: (defaultValue: Awaited<ReturnType<Contract['calls'][M]>>) => Request<M>;
232
+ at: (address: Address) => Request<M>;
233
+ };
234
+ export type CallReturn<M extends Calls> = NonNullable<Request<M>['defaultValue']>;
235
+ declare function getRequest<M extends Calls>(method: M, args: ExtractArgs<Contract['calls'][M]>, contractAddressOrOptions?: Address | {
236
+ contractAddress?: Address;
237
+ defaultValue?: Awaited<ReturnType<Contract['calls'][M]>>;
238
+ }): Request<M>;
239
+ type CallType = {
240
+ [K in Calls]: (...args: ExtractArgs<Contract['calls'][K]>) => ReturnType<typeof getRequest<K>>;
241
+ };
242
+ export declare const call: CallType;
243
+ export type Mutations = keyof Contract['mutations'];
244
+ export declare const mutation: {
245
+ [K in Mutations]: {
246
+ contractName: 'ERC20';
247
+ deployAddress: Address | undefined;
248
+ getAbi: () => typeof abi;
249
+ functionName: K;
250
+ argsType: ExtractArgs<Contract['mutations'][K]> | undefined;
251
+ };
252
+ };
253
+ export type SDK = {
254
+ deployAddress: Address | undefined;
255
+ abi: typeof abi;
256
+ name: (...args: ExtractArgs<Contract['calls']['name']>) => Promise<CallReturn<'name'>>;
257
+ symbol: (...args: ExtractArgs<Contract['calls']['symbol']>) => Promise<CallReturn<'symbol'>>;
258
+ decimals: (...args: ExtractArgs<Contract['calls']['decimals']>) => Promise<CallReturn<'decimals'>>;
259
+ totalSupply: (...args: ExtractArgs<Contract['calls']['totalSupply']>) => Promise<CallReturn<'totalSupply'>>;
260
+ balanceOf: (...args: ExtractArgs<Contract['calls']['balanceOf']>) => Promise<CallReturn<'balanceOf'>>;
261
+ allowance: (...args: ExtractArgs<Contract['calls']['allowance']>) => Promise<CallReturn<'allowance'>>;
262
+ nonces: (...args: ExtractArgs<Contract['calls']['nonces']>) => Promise<CallReturn<'nonces'>>;
263
+ DOMAIN_SEPARATOR: (...args: ExtractArgs<Contract['calls']['DOMAIN_SEPARATOR']>) => Promise<CallReturn<'DOMAIN_SEPARATOR'>>;
264
+ transfer: (...args: ExtractArgs<Contract['mutations']['transfer']>) => Promise<Address>;
265
+ transferFrom: (...args: ExtractArgs<Contract['mutations']['transferFrom']>) => Promise<Address>;
266
+ approve: (...args: ExtractArgs<Contract['mutations']['approve']>) => Promise<Address>;
267
+ permit: (...args: ExtractArgs<Contract['mutations']['permit']>) => Promise<Address>;
268
+ };
269
+ export declare function toSdk(deployAddress: Address, publicClient?: PublicClient, walletClient?: WalletClient): SDK;
270
+ export {};
271
+ //# sourceMappingURL=ERC20.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ERC20.d.ts","sourceRoot":"","sources":["../../src/contracts/ERC20.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAEjD,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EA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AAY,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,GAAG,CAkC3G"}
@@ -0,0 +1,339 @@
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
+ type: 'event',
9
+ name: 'Transfer',
10
+ inputs: [
11
+ {
12
+ name: 'sender',
13
+ type: 'address',
14
+ indexed: true,
15
+ },
16
+ {
17
+ name: 'receiver',
18
+ type: 'address',
19
+ indexed: true,
20
+ },
21
+ {
22
+ name: 'amount',
23
+ type: 'uint256',
24
+ indexed: false,
25
+ },
26
+ ],
27
+ anonymous: false,
28
+ },
29
+ {
30
+ type: 'event',
31
+ name: 'Approval',
32
+ inputs: [
33
+ {
34
+ name: 'owner',
35
+ type: 'address',
36
+ indexed: true,
37
+ },
38
+ {
39
+ name: 'spender',
40
+ type: 'address',
41
+ indexed: true,
42
+ },
43
+ {
44
+ name: 'amount',
45
+ type: 'uint256',
46
+ indexed: false,
47
+ },
48
+ ],
49
+ anonymous: false,
50
+ },
51
+ {
52
+ type: 'function',
53
+ name: 'name',
54
+ stateMutability: 'pure',
55
+ inputs: [],
56
+ outputs: [
57
+ {
58
+ name: '',
59
+ type: 'string',
60
+ },
61
+ ],
62
+ },
63
+ {
64
+ type: 'function',
65
+ name: 'symbol',
66
+ stateMutability: 'pure',
67
+ inputs: [],
68
+ outputs: [
69
+ {
70
+ name: '',
71
+ type: 'string',
72
+ },
73
+ ],
74
+ },
75
+ {
76
+ type: 'function',
77
+ name: 'decimals',
78
+ stateMutability: 'pure',
79
+ inputs: [],
80
+ outputs: [
81
+ {
82
+ name: '',
83
+ type: 'uint8',
84
+ },
85
+ ],
86
+ },
87
+ {
88
+ type: 'function',
89
+ name: 'transfer',
90
+ stateMutability: 'nonpayable',
91
+ inputs: [
92
+ {
93
+ name: '_recipient',
94
+ type: 'address',
95
+ },
96
+ {
97
+ name: '_amount',
98
+ type: 'uint256',
99
+ },
100
+ ],
101
+ outputs: [
102
+ {
103
+ name: '',
104
+ type: 'bool',
105
+ },
106
+ ],
107
+ },
108
+ {
109
+ type: 'function',
110
+ name: 'transferFrom',
111
+ stateMutability: 'nonpayable',
112
+ inputs: [
113
+ {
114
+ name: '_sender',
115
+ type: 'address',
116
+ },
117
+ {
118
+ name: '_recipient',
119
+ type: 'address',
120
+ },
121
+ {
122
+ name: '_amount',
123
+ type: 'uint256',
124
+ },
125
+ ],
126
+ outputs: [
127
+ {
128
+ name: '',
129
+ type: 'bool',
130
+ },
131
+ ],
132
+ },
133
+ {
134
+ type: 'function',
135
+ name: 'approve',
136
+ stateMutability: 'nonpayable',
137
+ inputs: [
138
+ {
139
+ name: '_spender',
140
+ type: 'address',
141
+ },
142
+ {
143
+ name: '_amount',
144
+ type: 'uint256',
145
+ },
146
+ ],
147
+ outputs: [
148
+ {
149
+ name: '',
150
+ type: 'bool',
151
+ },
152
+ ],
153
+ },
154
+ {
155
+ type: 'function',
156
+ name: 'permit',
157
+ stateMutability: 'nonpayable',
158
+ inputs: [
159
+ {
160
+ name: '_owner',
161
+ type: 'address',
162
+ },
163
+ {
164
+ name: '_spender',
165
+ type: 'address',
166
+ },
167
+ {
168
+ name: '_amount',
169
+ type: 'uint256',
170
+ },
171
+ {
172
+ name: '_expiry',
173
+ type: 'uint256',
174
+ },
175
+ {
176
+ name: '_signature',
177
+ type: 'bytes',
178
+ },
179
+ ],
180
+ outputs: [
181
+ {
182
+ name: '',
183
+ type: 'bool',
184
+ },
185
+ ],
186
+ },
187
+ {
188
+ type: 'function',
189
+ name: 'totalSupply',
190
+ stateMutability: 'view',
191
+ inputs: [],
192
+ outputs: [
193
+ {
194
+ name: '',
195
+ type: 'uint256',
196
+ },
197
+ ],
198
+ },
199
+ {
200
+ type: 'function',
201
+ name: 'balanceOf',
202
+ stateMutability: 'view',
203
+ inputs: [
204
+ {
205
+ name: 'arg0',
206
+ type: 'address',
207
+ },
208
+ ],
209
+ outputs: [
210
+ {
211
+ name: '',
212
+ type: 'uint256',
213
+ },
214
+ ],
215
+ },
216
+ {
217
+ type: 'function',
218
+ name: 'allowance',
219
+ stateMutability: 'view',
220
+ inputs: [
221
+ {
222
+ name: 'arg0',
223
+ type: 'address',
224
+ },
225
+ {
226
+ name: 'arg1',
227
+ type: 'address',
228
+ },
229
+ ],
230
+ outputs: [
231
+ {
232
+ name: '',
233
+ type: 'uint256',
234
+ },
235
+ ],
236
+ },
237
+ {
238
+ type: 'function',
239
+ name: 'nonces',
240
+ stateMutability: 'view',
241
+ inputs: [
242
+ {
243
+ name: 'arg0',
244
+ type: 'address',
245
+ },
246
+ ],
247
+ outputs: [
248
+ {
249
+ name: '',
250
+ type: 'uint256',
251
+ },
252
+ ],
253
+ },
254
+ {
255
+ type: 'function',
256
+ name: 'DOMAIN_SEPARATOR',
257
+ stateMutability: 'view',
258
+ inputs: [],
259
+ outputs: [
260
+ {
261
+ name: '',
262
+ type: 'bytes32',
263
+ },
264
+ ],
265
+ },
266
+ ];
267
+ export const deployAddress = undefined;
268
+ function getRequest(method, args, contractAddressOrOptions) {
269
+ const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
270
+ const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
271
+ const call = {
272
+ contractName: 'ERC20',
273
+ method,
274
+ args,
275
+ address,
276
+ deployAddress,
277
+ defaultValue,
278
+ getAbi: () => abi,
279
+ with: (options) => {
280
+ call.address = options.contractAddress;
281
+ call.defaultValue = options.defaultValue;
282
+ return call;
283
+ },
284
+ defaultTo: (defaultValue) => {
285
+ call.defaultValue = defaultValue;
286
+ return call;
287
+ },
288
+ at: (address) => {
289
+ call.address = address;
290
+ return call;
291
+ },
292
+ };
293
+ return call;
294
+ }
295
+ export const call = {
296
+ name: (...args) => getRequest('name', args),
297
+ symbol: (...args) => getRequest('symbol', args),
298
+ decimals: (...args) => getRequest('decimals', args),
299
+ totalSupply: (...args) => getRequest('totalSupply', args),
300
+ balanceOf: (...args) => getRequest('balanceOf', args),
301
+ allowance: (...args) => getRequest('allowance', args),
302
+ nonces: (...args) => getRequest('nonces', args),
303
+ DOMAIN_SEPARATOR: (...args) => getRequest('DOMAIN_SEPARATOR', args),
304
+ };
305
+ function getMutation(functionName) {
306
+ return {
307
+ contractName: 'ERC20',
308
+ functionName,
309
+ deployAddress,
310
+ argsType: undefined,
311
+ getAbi: () => abi,
312
+ };
313
+ }
314
+ export const mutation = {
315
+ transfer: getMutation('transfer'),
316
+ transferFrom: getMutation('transferFrom'),
317
+ approve: getMutation('approve'),
318
+ permit: getMutation('permit'),
319
+ };
320
+ export function toSdk(deployAddress, publicClient, walletClient) {
321
+ return {
322
+ deployAddress,
323
+ abi,
324
+ // Queries
325
+ name: (...args) => singleQuery(publicClient, call.name(...args).at(deployAddress)),
326
+ symbol: (...args) => singleQuery(publicClient, call.symbol(...args).at(deployAddress)),
327
+ decimals: (...args) => singleQuery(publicClient, call.decimals(...args).at(deployAddress)),
328
+ totalSupply: (...args) => singleQuery(publicClient, call.totalSupply(...args).at(deployAddress)),
329
+ balanceOf: (...args) => singleQuery(publicClient, call.balanceOf(...args).at(deployAddress)),
330
+ allowance: (...args) => singleQuery(publicClient, call.allowance(...args).at(deployAddress)),
331
+ nonces: (...args) => singleQuery(publicClient, call.nonces(...args).at(deployAddress)),
332
+ DOMAIN_SEPARATOR: (...args) => singleQuery(publicClient, call.DOMAIN_SEPARATOR(...args).at(deployAddress)),
333
+ // Mutations
334
+ transfer: (...args) => mutate(walletClient, mutation.transfer, { address: deployAddress })(...args),
335
+ transferFrom: (...args) => mutate(walletClient, mutation.transferFrom, { address: deployAddress })(...args),
336
+ approve: (...args) => mutate(walletClient, mutation.approve, { address: deployAddress })(...args),
337
+ permit: (...args) => mutate(walletClient, mutation.permit, { address: deployAddress })(...args),
338
+ };
339
+ }