@coinbase/agentkit 0.0.0-nightly-20250328174338

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 (292) hide show
  1. package/README.md +827 -0
  2. package/dist/action-providers/across/acrossActionProvider.d.ts +50 -0
  3. package/dist/action-providers/across/acrossActionProvider.js +333 -0
  4. package/dist/action-providers/across/acrossActionProvider.test.d.ts +1 -0
  5. package/dist/action-providers/across/acrossActionProvider.test.js +391 -0
  6. package/dist/action-providers/across/constants.d.ts +1 -0
  7. package/dist/action-providers/across/constants.js +2 -0
  8. package/dist/action-providers/across/index.d.ts +1 -0
  9. package/dist/action-providers/across/index.js +17 -0
  10. package/dist/action-providers/across/schemas.d.ts +36 -0
  11. package/dist/action-providers/across/schemas.js +46 -0
  12. package/dist/action-providers/across/utils.d.ts +7 -0
  13. package/dist/action-providers/across/utils.js +25 -0
  14. package/dist/action-providers/actionDecorator.d.ts +69 -0
  15. package/dist/action-providers/actionDecorator.js +96 -0
  16. package/dist/action-providers/actionProvider.d.ts +48 -0
  17. package/dist/action-providers/actionProvider.js +62 -0
  18. package/dist/action-providers/alchemy/alchemyTokenPricesActionProvider.d.ts +55 -0
  19. package/dist/action-providers/alchemy/alchemyTokenPricesActionProvider.js +173 -0
  20. package/dist/action-providers/alchemy/alchemyTokenPricesActionProvider.test.d.ts +1 -0
  21. package/dist/action-providers/alchemy/alchemyTokenPricesActionProvider.test.js +131 -0
  22. package/dist/action-providers/alchemy/index.d.ts +2 -0
  23. package/dist/action-providers/alchemy/index.js +18 -0
  24. package/dist/action-providers/alchemy/schemas.d.ts +41 -0
  25. package/dist/action-providers/alchemy/schemas.js +34 -0
  26. package/dist/action-providers/allora/alloraActionProvider.d.ts +44 -0
  27. package/dist/action-providers/allora/alloraActionProvider.js +195 -0
  28. package/dist/action-providers/allora/alloraActionProvider.test.d.ts +1 -0
  29. package/dist/action-providers/allora/alloraActionProvider.test.js +109 -0
  30. package/dist/action-providers/allora/index.d.ts +2 -0
  31. package/dist/action-providers/allora/index.js +18 -0
  32. package/dist/action-providers/allora/schemas.d.ts +28 -0
  33. package/dist/action-providers/allora/schemas.js +30 -0
  34. package/dist/action-providers/basename/basenameActionProvider.d.ts +30 -0
  35. package/dist/action-providers/basename/basenameActionProvider.js +109 -0
  36. package/dist/action-providers/basename/basenameActionProvider.test.d.ts +1 -0
  37. package/dist/action-providers/basename/basenameActionProvider.test.js +146 -0
  38. package/dist/action-providers/basename/constants.d.ts +52 -0
  39. package/dist/action-providers/basename/constants.js +81 -0
  40. package/dist/action-providers/basename/index.d.ts +2 -0
  41. package/dist/action-providers/basename/index.js +18 -0
  42. package/dist/action-providers/basename/schemas.d.ts +14 -0
  43. package/dist/action-providers/basename/schemas.js +14 -0
  44. package/dist/action-providers/cdp/cdpApiActionProvider.d.ts +43 -0
  45. package/dist/action-providers/cdp/cdpApiActionProvider.js +128 -0
  46. package/dist/action-providers/cdp/cdpApiActionProvider.test.d.ts +1 -0
  47. package/dist/action-providers/cdp/cdpApiActionProvider.test.js +146 -0
  48. package/dist/action-providers/cdp/cdpWalletActionProvider.d.ts +58 -0
  49. package/dist/action-providers/cdp/cdpWalletActionProvider.js +224 -0
  50. package/dist/action-providers/cdp/cdpWalletActionProvider.test.d.ts +1 -0
  51. package/dist/action-providers/cdp/cdpWalletActionProvider.test.js +267 -0
  52. package/dist/action-providers/cdp/constants.d.ts +31 -0
  53. package/dist/action-providers/cdp/constants.js +34 -0
  54. package/dist/action-providers/cdp/index.d.ts +3 -0
  55. package/dist/action-providers/cdp/index.js +19 -0
  56. package/dist/action-providers/cdp/schemas.d.ts +91 -0
  57. package/dist/action-providers/cdp/schemas.js +77 -0
  58. package/dist/action-providers/compound/compoundActionProvider.d.ts +67 -0
  59. package/dist/action-providers/compound/compoundActionProvider.js +365 -0
  60. package/dist/action-providers/compound/compoundActionProvider.test.d.ts +1 -0
  61. package/dist/action-providers/compound/compoundActionProvider.test.js +353 -0
  62. package/dist/action-providers/compound/constants.d.ts +180 -0
  63. package/dist/action-providers/compound/constants.js +129 -0
  64. package/dist/action-providers/compound/index.d.ts +1 -0
  65. package/dist/action-providers/compound/index.js +17 -0
  66. package/dist/action-providers/compound/schemas.d.ts +57 -0
  67. package/dist/action-providers/compound/schemas.js +58 -0
  68. package/dist/action-providers/compound/utils.d.ts +95 -0
  69. package/dist/action-providers/compound/utils.js +353 -0
  70. package/dist/action-providers/customActionProvider.d.ts +30 -0
  71. package/dist/action-providers/customActionProvider.js +66 -0
  72. package/dist/action-providers/defillama/constants.d.ts +8 -0
  73. package/dist/action-providers/defillama/constants.js +11 -0
  74. package/dist/action-providers/defillama/defillamaActionProvider.d.ts +54 -0
  75. package/dist/action-providers/defillama/defillamaActionProvider.js +180 -0
  76. package/dist/action-providers/defillama/defillamaActionProvider.test.d.ts +1 -0
  77. package/dist/action-providers/defillama/defillamaActionProvider.test.js +114 -0
  78. package/dist/action-providers/defillama/index.d.ts +1 -0
  79. package/dist/action-providers/defillama/index.js +17 -0
  80. package/dist/action-providers/defillama/schemas.d.ts +34 -0
  81. package/dist/action-providers/defillama/schemas.js +34 -0
  82. package/dist/action-providers/defillama/types.d.ts +73 -0
  83. package/dist/action-providers/defillama/types.js +2 -0
  84. package/dist/action-providers/defillama/utils.d.ts +10 -0
  85. package/dist/action-providers/defillama/utils.js +87 -0
  86. package/dist/action-providers/defillama/utils.test.d.ts +1 -0
  87. package/dist/action-providers/defillama/utils.test.js +124 -0
  88. package/dist/action-providers/erc20/constants.d.ts +137 -0
  89. package/dist/action-providers/erc20/constants.js +202 -0
  90. package/dist/action-providers/erc20/erc20ActionProvider.d.ts +38 -0
  91. package/dist/action-providers/erc20/erc20ActionProvider.js +142 -0
  92. package/dist/action-providers/erc20/erc20ActionProvider.test.d.ts +1 -0
  93. package/dist/action-providers/erc20/erc20ActionProvider.test.js +131 -0
  94. package/dist/action-providers/erc20/index.d.ts +1 -0
  95. package/dist/action-providers/erc20/index.js +17 -0
  96. package/dist/action-providers/erc20/schemas.d.ts +27 -0
  97. package/dist/action-providers/erc20/schemas.js +26 -0
  98. package/dist/action-providers/erc721/constants.d.ts +232 -0
  99. package/dist/action-providers/erc721/constants.js +298 -0
  100. package/dist/action-providers/erc721/erc721ActionProvider.d.ts +46 -0
  101. package/dist/action-providers/erc721/erc721ActionProvider.js +164 -0
  102. package/dist/action-providers/erc721/erc721ActionProvider.test.d.ts +1 -0
  103. package/dist/action-providers/erc721/erc721ActionProvider.test.js +137 -0
  104. package/dist/action-providers/erc721/index.d.ts +1 -0
  105. package/dist/action-providers/erc721/index.js +17 -0
  106. package/dist/action-providers/erc721/schemas.d.ts +46 -0
  107. package/dist/action-providers/erc721/schemas.js +44 -0
  108. package/dist/action-providers/farcaster/farcasterActionProvider.d.ts +57 -0
  109. package/dist/action-providers/farcaster/farcasterActionProvider.js +142 -0
  110. package/dist/action-providers/farcaster/farcasterActionProvider.test.d.ts +1 -0
  111. package/dist/action-providers/farcaster/farcasterActionProvider.test.js +151 -0
  112. package/dist/action-providers/farcaster/index.d.ts +2 -0
  113. package/dist/action-providers/farcaster/index.js +18 -0
  114. package/dist/action-providers/farcaster/schemas.d.ts +15 -0
  115. package/dist/action-providers/farcaster/schemas.js +20 -0
  116. package/dist/action-providers/index.d.ts +24 -0
  117. package/dist/action-providers/index.js +40 -0
  118. package/dist/action-providers/jupiter/index.d.ts +1 -0
  119. package/dist/action-providers/jupiter/index.js +17 -0
  120. package/dist/action-providers/jupiter/jupiterActionProvider.d.ts +36 -0
  121. package/dist/action-providers/jupiter/jupiterActionProvider.js +115 -0
  122. package/dist/action-providers/jupiter/jupiterActionProvider.test.d.ts +1 -0
  123. package/dist/action-providers/jupiter/jupiterActionProvider.test.js +146 -0
  124. package/dist/action-providers/jupiter/schemas.d.ts +20 -0
  125. package/dist/action-providers/jupiter/schemas.js +20 -0
  126. package/dist/action-providers/messari/constants.d.ts +17 -0
  127. package/dist/action-providers/messari/constants.js +20 -0
  128. package/dist/action-providers/messari/index.d.ts +5 -0
  129. package/dist/action-providers/messari/index.js +21 -0
  130. package/dist/action-providers/messari/messariActionProvider.d.ts +42 -0
  131. package/dist/action-providers/messari/messariActionProvider.js +128 -0
  132. package/dist/action-providers/messari/messariActionProvider.test.d.ts +1 -0
  133. package/dist/action-providers/messari/messariActionProvider.test.js +152 -0
  134. package/dist/action-providers/messari/schemas.d.ts +11 -0
  135. package/dist/action-providers/messari/schemas.js +16 -0
  136. package/dist/action-providers/messari/types.d.ts +40 -0
  137. package/dist/action-providers/messari/types.js +2 -0
  138. package/dist/action-providers/messari/utils.d.ts +22 -0
  139. package/dist/action-providers/messari/utils.js +65 -0
  140. package/dist/action-providers/moonwell/constants.d.ts +78 -0
  141. package/dist/action-providers/moonwell/constants.js +111 -0
  142. package/dist/action-providers/moonwell/index.d.ts +1 -0
  143. package/dist/action-providers/moonwell/index.js +5 -0
  144. package/dist/action-providers/moonwell/moonwellActionProvider.d.ts +39 -0
  145. package/dist/action-providers/moonwell/moonwellActionProvider.js +249 -0
  146. package/dist/action-providers/moonwell/moonwellActionProvider.test.d.ts +1 -0
  147. package/dist/action-providers/moonwell/moonwellActionProvider.test.js +455 -0
  148. package/dist/action-providers/moonwell/schemas.d.ts +30 -0
  149. package/dist/action-providers/moonwell/schemas.js +39 -0
  150. package/dist/action-providers/morpho/constants.d.ts +16 -0
  151. package/dist/action-providers/morpho/constants.js +27 -0
  152. package/dist/action-providers/morpho/index.d.ts +2 -0
  153. package/dist/action-providers/morpho/index.js +18 -0
  154. package/dist/action-providers/morpho/morphoActionProvider.d.ts +39 -0
  155. package/dist/action-providers/morpho/morphoActionProvider.js +154 -0
  156. package/dist/action-providers/morpho/morphoActionProvider.test.d.ts +1 -0
  157. package/dist/action-providers/morpho/morphoActionProvider.test.js +128 -0
  158. package/dist/action-providers/morpho/schemas.d.ts +36 -0
  159. package/dist/action-providers/morpho/schemas.js +47 -0
  160. package/dist/action-providers/opensea/index.d.ts +1 -0
  161. package/dist/action-providers/opensea/index.js +17 -0
  162. package/dist/action-providers/opensea/openseaActionProvider.d.ts +59 -0
  163. package/dist/action-providers/opensea/openseaActionProvider.js +146 -0
  164. package/dist/action-providers/opensea/openseaActionProvider.test.d.ts +1 -0
  165. package/dist/action-providers/opensea/openseaActionProvider.test.js +201 -0
  166. package/dist/action-providers/opensea/schemas.d.ts +30 -0
  167. package/dist/action-providers/opensea/schemas.js +33 -0
  168. package/dist/action-providers/opensea/utils.d.ts +12 -0
  169. package/dist/action-providers/opensea/utils.js +47 -0
  170. package/dist/action-providers/pyth/index.d.ts +2 -0
  171. package/dist/action-providers/pyth/index.js +18 -0
  172. package/dist/action-providers/pyth/pythActionProvider.d.ts +33 -0
  173. package/dist/action-providers/pyth/pythActionProvider.js +121 -0
  174. package/dist/action-providers/pyth/pythActionProvider.test.d.ts +1 -0
  175. package/dist/action-providers/pyth/pythActionProvider.test.js +113 -0
  176. package/dist/action-providers/pyth/schemas.d.ts +21 -0
  177. package/dist/action-providers/pyth/schemas.js +20 -0
  178. package/dist/action-providers/spl/index.d.ts +1 -0
  179. package/dist/action-providers/spl/index.js +17 -0
  180. package/dist/action-providers/spl/schemas.d.ts +30 -0
  181. package/dist/action-providers/spl/schemas.js +26 -0
  182. package/dist/action-providers/spl/splActionProvider.d.ts +45 -0
  183. package/dist/action-providers/spl/splActionProvider.js +173 -0
  184. package/dist/action-providers/spl/splActionProvider.test.d.ts +1 -0
  185. package/dist/action-providers/spl/splActionProvider.test.js +300 -0
  186. package/dist/action-providers/twitter/index.d.ts +2 -0
  187. package/dist/action-providers/twitter/index.js +18 -0
  188. package/dist/action-providers/twitter/schemas.d.ts +38 -0
  189. package/dist/action-providers/twitter/schemas.js +44 -0
  190. package/dist/action-providers/twitter/twitterActionProvider.d.ts +82 -0
  191. package/dist/action-providers/twitter/twitterActionProvider.js +204 -0
  192. package/dist/action-providers/twitter/twitterActionProvider.test.d.ts +1 -0
  193. package/dist/action-providers/twitter/twitterActionProvider.test.js +185 -0
  194. package/dist/action-providers/wallet/index.d.ts +1 -0
  195. package/dist/action-providers/wallet/index.js +17 -0
  196. package/dist/action-providers/wallet/schemas.d.ts +19 -0
  197. package/dist/action-providers/wallet/schemas.js +19 -0
  198. package/dist/action-providers/wallet/walletActionProvider.d.ts +44 -0
  199. package/dist/action-providers/wallet/walletActionProvider.js +140 -0
  200. package/dist/action-providers/wallet/walletActionProvider.test.d.ts +1 -0
  201. package/dist/action-providers/wallet/walletActionProvider.test.js +194 -0
  202. package/dist/action-providers/weth/constants.d.ts +19 -0
  203. package/dist/action-providers/weth/constants.js +29 -0
  204. package/dist/action-providers/weth/index.d.ts +1 -0
  205. package/dist/action-providers/weth/index.js +17 -0
  206. package/dist/action-providers/weth/schemas.d.ts +8 -0
  207. package/dist/action-providers/weth/schemas.js +10 -0
  208. package/dist/action-providers/weth/wethActionProvider.d.ts +30 -0
  209. package/dist/action-providers/weth/wethActionProvider.js +89 -0
  210. package/dist/action-providers/weth/wethActionProvider.test.d.ts +1 -0
  211. package/dist/action-providers/weth/wethActionProvider.test.js +92 -0
  212. package/dist/action-providers/wow/constants.d.ts +15 -0
  213. package/dist/action-providers/wow/constants.js +844 -0
  214. package/dist/action-providers/wow/index.d.ts +2 -0
  215. package/dist/action-providers/wow/index.js +18 -0
  216. package/dist/action-providers/wow/schemas.d.ts +43 -0
  217. package/dist/action-providers/wow/schemas.js +47 -0
  218. package/dist/action-providers/wow/uniswap/constants.d.ts +3 -0
  219. package/dist/action-providers/wow/uniswap/constants.js +100 -0
  220. package/dist/action-providers/wow/uniswap/utils.d.ts +82 -0
  221. package/dist/action-providers/wow/uniswap/utils.js +226 -0
  222. package/dist/action-providers/wow/utils.d.ts +27 -0
  223. package/dist/action-providers/wow/utils.js +63 -0
  224. package/dist/action-providers/wow/wowActionProvider.d.ts +46 -0
  225. package/dist/action-providers/wow/wowActionProvider.js +223 -0
  226. package/dist/action-providers/wow/wowActionProvider.test.d.ts +1 -0
  227. package/dist/action-providers/wow/wowActionProvider.test.js +291 -0
  228. package/dist/agentkit.d.ts +44 -0
  229. package/dist/agentkit.js +68 -0
  230. package/dist/analytics/index.d.ts +1 -0
  231. package/dist/analytics/index.js +17 -0
  232. package/dist/analytics/sendAnalyticsEvent.d.ts +31 -0
  233. package/dist/analytics/sendAnalyticsEvent.js +52 -0
  234. package/dist/index.d.ts +4 -0
  235. package/dist/index.js +20 -0
  236. package/dist/network/index.d.ts +3 -0
  237. package/dist/network/index.js +19 -0
  238. package/dist/network/network.d.ts +20 -0
  239. package/dist/network/network.js +86 -0
  240. package/dist/network/svm.d.ts +15 -0
  241. package/dist/network/svm.js +38 -0
  242. package/dist/network/types.d.ts +17 -0
  243. package/dist/network/types.js +2 -0
  244. package/dist/utils.d.ts +22 -0
  245. package/dist/utils.js +57 -0
  246. package/dist/utils.test.d.ts +1 -0
  247. package/dist/utils.test.js +50 -0
  248. package/dist/wallet-providers/cdpWalletProvider.d.ts +246 -0
  249. package/dist/wallet-providers/cdpWalletProvider.js +421 -0
  250. package/dist/wallet-providers/cdpWalletProvider.test.d.ts +1 -0
  251. package/dist/wallet-providers/cdpWalletProvider.test.js +701 -0
  252. package/dist/wallet-providers/evmWalletProvider.d.ts +51 -0
  253. package/dist/wallet-providers/evmWalletProvider.js +14 -0
  254. package/dist/wallet-providers/evmWalletProvider.test.d.ts +1 -0
  255. package/dist/wallet-providers/evmWalletProvider.test.js +56 -0
  256. package/dist/wallet-providers/index.d.ts +10 -0
  257. package/dist/wallet-providers/index.js +26 -0
  258. package/dist/wallet-providers/privyEvmWalletProvider.d.ts +55 -0
  259. package/dist/wallet-providers/privyEvmWalletProvider.js +140 -0
  260. package/dist/wallet-providers/privyEvmWalletProvider.test.d.ts +1 -0
  261. package/dist/wallet-providers/privyEvmWalletProvider.test.js +331 -0
  262. package/dist/wallet-providers/privyShared.d.ts +40 -0
  263. package/dist/wallet-providers/privyShared.js +49 -0
  264. package/dist/wallet-providers/privySvmWalletProvider.d.ts +128 -0
  265. package/dist/wallet-providers/privySvmWalletProvider.js +212 -0
  266. package/dist/wallet-providers/privySvmWalletProvider.test.d.ts +1 -0
  267. package/dist/wallet-providers/privySvmWalletProvider.test.js +310 -0
  268. package/dist/wallet-providers/privyWalletProvider.d.ts +35 -0
  269. package/dist/wallet-providers/privyWalletProvider.js +39 -0
  270. package/dist/wallet-providers/privyWalletProvider.test.d.ts +1 -0
  271. package/dist/wallet-providers/privyWalletProvider.test.js +124 -0
  272. package/dist/wallet-providers/smartWalletProvider.d.ts +177 -0
  273. package/dist/wallet-providers/smartWalletProvider.js +303 -0
  274. package/dist/wallet-providers/smartWalletProvider.test.d.ts +1 -0
  275. package/dist/wallet-providers/smartWalletProvider.test.js +388 -0
  276. package/dist/wallet-providers/solanaKeypairWalletProvider.d.ts +143 -0
  277. package/dist/wallet-providers/solanaKeypairWalletProvider.js +280 -0
  278. package/dist/wallet-providers/solanaKeypairWalletProvider.test.d.ts +1 -0
  279. package/dist/wallet-providers/solanaKeypairWalletProvider.test.js +218 -0
  280. package/dist/wallet-providers/svmWalletProvider.d.ts +56 -0
  281. package/dist/wallet-providers/svmWalletProvider.js +13 -0
  282. package/dist/wallet-providers/svmWalletProvider.test.d.ts +1 -0
  283. package/dist/wallet-providers/svmWalletProvider.test.js +55 -0
  284. package/dist/wallet-providers/viemWalletProvider.d.ts +103 -0
  285. package/dist/wallet-providers/viemWalletProvider.js +206 -0
  286. package/dist/wallet-providers/viemWalletProvider.test.d.ts +1 -0
  287. package/dist/wallet-providers/viemWalletProvider.test.js +338 -0
  288. package/dist/wallet-providers/walletProvider.d.ts +48 -0
  289. package/dist/wallet-providers/walletProvider.js +41 -0
  290. package/dist/wallet-providers/walletProvider.test.d.ts +1 -0
  291. package/dist/wallet-providers/walletProvider.test.js +103 -0
  292. package/package.json +83 -0
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.morphoActionProvider = exports.MorphoActionProvider = exports.SUPPORTED_NETWORKS = void 0;
13
+ const zod_1 = require("zod");
14
+ const decimal_js_1 = require("decimal.js");
15
+ const viem_1 = require("viem");
16
+ const constants_1 = require("../erc20/constants");
17
+ const actionProvider_1 = require("../actionProvider");
18
+ const wallet_providers_1 = require("../../wallet-providers");
19
+ const actionDecorator_1 = require("../actionDecorator");
20
+ const utils_1 = require("../../utils");
21
+ const constants_2 = require("./constants");
22
+ const schemas_1 = require("./schemas");
23
+ exports.SUPPORTED_NETWORKS = ["base-mainnet", "base-sepolia"];
24
+ /**
25
+ * MorphoActionProvider is an action provider for Morpho Vault interactions.
26
+ */
27
+ class MorphoActionProvider extends actionProvider_1.ActionProvider {
28
+ /**
29
+ * Constructor for the MorphoActionProvider class.
30
+ */
31
+ constructor() {
32
+ super("morpho", []);
33
+ /**
34
+ * Checks if the Morpho action provider supports the given network.
35
+ *
36
+ * @param network - The network to check.
37
+ * @returns True if the Morpho action provider supports the network, false otherwise.
38
+ */
39
+ this.supportsNetwork = (network) => network.protocolFamily === "evm" && exports.SUPPORTED_NETWORKS.includes(network.networkId);
40
+ }
41
+ /**
42
+ * Deposits assets into a Morpho Vault
43
+ *
44
+ * @param wallet - The wallet instance to execute the transaction
45
+ * @param args - The input arguments for the action
46
+ * @returns A success message with transaction details or an error message
47
+ */
48
+ async deposit(wallet, args) {
49
+ const assets = new decimal_js_1.Decimal(args.assets);
50
+ if (assets.comparedTo(new decimal_js_1.Decimal(0.0)) != 1) {
51
+ return "Error: Assets amount must be greater than 0";
52
+ }
53
+ try {
54
+ const decimals = await wallet.readContract({
55
+ address: args.tokenAddress,
56
+ abi: constants_1.abi,
57
+ functionName: "decimals",
58
+ args: [],
59
+ });
60
+ const atomicAssets = (0, viem_1.parseUnits)(args.assets, decimals);
61
+ const approvalResult = await (0, utils_1.approve)(wallet, args.tokenAddress, args.vaultAddress, atomicAssets);
62
+ if (approvalResult.startsWith("Error")) {
63
+ return `Error approving Morpho Vault as spender: ${approvalResult}`;
64
+ }
65
+ const data = (0, viem_1.encodeFunctionData)({
66
+ abi: constants_2.METAMORPHO_ABI,
67
+ functionName: "deposit",
68
+ args: [atomicAssets, args.receiver],
69
+ });
70
+ const txHash = await wallet.sendTransaction({
71
+ to: args.vaultAddress,
72
+ data,
73
+ });
74
+ const receipt = await wallet.waitForTransactionReceipt(txHash);
75
+ return `Deposited ${args.assets} to Morpho Vault ${args.vaultAddress} with transaction hash: ${txHash}\nTransaction receipt: ${JSON.stringify(receipt)}`;
76
+ }
77
+ catch (error) {
78
+ return `Error depositing to Morpho Vault: ${error}`;
79
+ }
80
+ }
81
+ /**
82
+ * Withdraws assets from a Morpho Vault
83
+ *
84
+ * @param wallet - The wallet instance to execute the transaction
85
+ * @param args - The input arguments for the action
86
+ * @returns A success message with transaction details or an error message
87
+ */
88
+ async withdraw(wallet, args) {
89
+ if (BigInt(args.assets) <= 0) {
90
+ return "Error: Assets amount must be greater than 0";
91
+ }
92
+ try {
93
+ const data = (0, viem_1.encodeFunctionData)({
94
+ abi: constants_2.METAMORPHO_ABI,
95
+ functionName: "withdraw",
96
+ args: [BigInt(args.assets), args.receiver, args.receiver],
97
+ });
98
+ const txHash = await wallet.sendTransaction({
99
+ to: args.vaultAddress,
100
+ data,
101
+ });
102
+ const receipt = await wallet.waitForTransactionReceipt(txHash);
103
+ return `Withdrawn ${args.assets} from Morpho Vault ${args.vaultAddress} with transaction hash: ${txHash}\nTransaction receipt: ${JSON.stringify(receipt)}`;
104
+ }
105
+ catch (error) {
106
+ return `Error withdrawing from Morpho Vault: ${error}`;
107
+ }
108
+ }
109
+ }
110
+ exports.MorphoActionProvider = MorphoActionProvider;
111
+ __decorate([
112
+ (0, actionDecorator_1.CreateAction)({
113
+ name: "deposit",
114
+ description: `
115
+ This tool allows depositing assets into a Morpho Vault.
116
+
117
+ It takes:
118
+ - vaultAddress: The address of the Morpho Vault to deposit to
119
+ - assets: The amount of assets to deposit in whole units
120
+ Examples for WETH:
121
+ - 1 WETH
122
+ - 0.1 WETH
123
+ - 0.01 WETH
124
+ - receiver: The address to receive the shares
125
+ - tokenAddress: The address of the token to approve
126
+
127
+ Important notes:
128
+ - Make sure to use the exact amount provided. Do not convert units for assets for this action.
129
+ - Please use a token address (example 0x4200000000000000000000000000000000000006) for the tokenAddress field.
130
+ `,
131
+ schema: schemas_1.DepositSchema,
132
+ }),
133
+ __metadata("design:type", Function),
134
+ __metadata("design:paramtypes", [wallet_providers_1.EvmWalletProvider, void 0]),
135
+ __metadata("design:returntype", Promise)
136
+ ], MorphoActionProvider.prototype, "deposit", null);
137
+ __decorate([
138
+ (0, actionDecorator_1.CreateAction)({
139
+ name: "withdraw",
140
+ description: `
141
+ This tool allows withdrawing assets from a Morpho Vault. It takes:
142
+
143
+ - vaultAddress: The address of the Morpho Vault to withdraw from
144
+ - assets: The amount of assets to withdraw in atomic units (wei)
145
+ - receiver: The address to receive the shares
146
+ `,
147
+ schema: schemas_1.WithdrawSchema,
148
+ }),
149
+ __metadata("design:type", Function),
150
+ __metadata("design:paramtypes", [wallet_providers_1.EvmWalletProvider, void 0]),
151
+ __metadata("design:returntype", Promise)
152
+ ], MorphoActionProvider.prototype, "withdraw", null);
153
+ const morphoActionProvider = () => new MorphoActionProvider();
154
+ exports.morphoActionProvider = morphoActionProvider;
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const viem_1 = require("viem");
4
+ const utils_1 = require("../../utils");
5
+ const morphoActionProvider_1 = require("./morphoActionProvider");
6
+ const constants_1 = require("./constants");
7
+ const MOCK_VAULT_ADDRESS = "0x1234567890123456789012345678901234567890";
8
+ const MOCK_ATOMIC_ASSETS = "1000000000000000000";
9
+ const MOCK_WHOLE_ASSETS = "1.0";
10
+ const MOCK_RECEIVER_ID = "0x9876543210987654321098765432109876543210";
11
+ const MOCK_TOKEN_ADDRESS = "0x4200000000000000000000000000000000000006";
12
+ const MOCK_TX_HASH = "0xabcdef1234567890";
13
+ const MOCK_RECEIPT = { status: 1, blockNumber: 1234567 };
14
+ const MOCK_DECIMALS = 18;
15
+ jest.mock("../../utils");
16
+ const mockApprove = utils_1.approve;
17
+ describe("Morpho Action Provider", () => {
18
+ const actionProvider = new morphoActionProvider_1.MorphoActionProvider();
19
+ let mockWallet;
20
+ beforeEach(() => {
21
+ mockWallet = {
22
+ getAddress: jest.fn().mockReturnValue(MOCK_RECEIVER_ID),
23
+ getNetwork: jest.fn().mockReturnValue({ protocolFamily: "evm", networkId: "1" }),
24
+ sendTransaction: jest.fn().mockResolvedValue(MOCK_TX_HASH),
25
+ waitForTransactionReceipt: jest.fn().mockResolvedValue(MOCK_RECEIPT),
26
+ readContract: jest.fn().mockResolvedValue(MOCK_DECIMALS),
27
+ };
28
+ mockApprove.mockResolvedValue("Approval successful");
29
+ });
30
+ describe("deposit", () => {
31
+ it("should successfully deposit to Morpho vault", async () => {
32
+ const args = {
33
+ vaultAddress: MOCK_VAULT_ADDRESS,
34
+ assets: MOCK_WHOLE_ASSETS,
35
+ receiver: MOCK_RECEIVER_ID,
36
+ tokenAddress: MOCK_TOKEN_ADDRESS,
37
+ };
38
+ const atomicAssets = (0, viem_1.parseEther)(MOCK_WHOLE_ASSETS);
39
+ const response = await actionProvider.deposit(mockWallet, args);
40
+ expect(mockApprove).toHaveBeenCalledWith(mockWallet, MOCK_TOKEN_ADDRESS, MOCK_VAULT_ADDRESS, atomicAssets);
41
+ expect(mockWallet.sendTransaction).toHaveBeenCalledWith({
42
+ to: MOCK_VAULT_ADDRESS,
43
+ data: (0, viem_1.encodeFunctionData)({
44
+ abi: constants_1.METAMORPHO_ABI,
45
+ functionName: "deposit",
46
+ args: [atomicAssets, MOCK_RECEIVER_ID],
47
+ }),
48
+ });
49
+ expect(mockWallet.waitForTransactionReceipt).toHaveBeenCalledWith(MOCK_TX_HASH);
50
+ expect(response).toContain(`Deposited ${MOCK_WHOLE_ASSETS}`);
51
+ expect(response).toContain(MOCK_TX_HASH);
52
+ expect(response).toContain(JSON.stringify(MOCK_RECEIPT));
53
+ });
54
+ it("should handle errors when depositing", async () => {
55
+ const args = {
56
+ vaultAddress: MOCK_VAULT_ADDRESS,
57
+ assets: MOCK_WHOLE_ASSETS,
58
+ receiver: MOCK_RECEIVER_ID,
59
+ tokenAddress: MOCK_TOKEN_ADDRESS,
60
+ };
61
+ mockWallet.sendTransaction.mockRejectedValue(new Error("Failed to deposit"));
62
+ const response = await actionProvider.deposit(mockWallet, args);
63
+ expect(response).toContain("Error depositing to Morpho Vault: Error: Failed to deposit");
64
+ });
65
+ });
66
+ describe("withdraw", () => {
67
+ it("should successfully withdraw from Morpho vault", async () => {
68
+ const args = {
69
+ vaultAddress: MOCK_VAULT_ADDRESS,
70
+ assets: MOCK_ATOMIC_ASSETS,
71
+ receiver: MOCK_RECEIVER_ID,
72
+ };
73
+ const response = await actionProvider.withdraw(mockWallet, args);
74
+ expect(mockWallet.sendTransaction).toHaveBeenCalledWith({
75
+ to: MOCK_VAULT_ADDRESS,
76
+ data: (0, viem_1.encodeFunctionData)({
77
+ abi: constants_1.METAMORPHO_ABI,
78
+ functionName: "withdraw",
79
+ args: [BigInt(MOCK_ATOMIC_ASSETS), MOCK_RECEIVER_ID, MOCK_RECEIVER_ID],
80
+ }),
81
+ });
82
+ expect(mockWallet.waitForTransactionReceipt).toHaveBeenCalledWith(MOCK_TX_HASH);
83
+ expect(response).toContain(`Withdrawn ${MOCK_ATOMIC_ASSETS}`);
84
+ expect(response).toContain(MOCK_TX_HASH);
85
+ expect(response).toContain(JSON.stringify(MOCK_RECEIPT));
86
+ });
87
+ it("should handle errors when withdrawing", async () => {
88
+ const args = {
89
+ vaultAddress: MOCK_VAULT_ADDRESS,
90
+ assets: MOCK_ATOMIC_ASSETS,
91
+ receiver: MOCK_RECEIVER_ID,
92
+ };
93
+ mockWallet.sendTransaction.mockRejectedValue(new Error("Failed to withdraw"));
94
+ const response = await actionProvider.withdraw(mockWallet, args);
95
+ expect(response).toContain("Error withdrawing from Morpho Vault: Error: Failed to withdraw");
96
+ });
97
+ });
98
+ describe("supportsNetwork", () => {
99
+ it("should return true for Base Mainnet", () => {
100
+ const result = actionProvider.supportsNetwork({
101
+ protocolFamily: "evm",
102
+ networkId: "base-mainnet",
103
+ });
104
+ expect(result).toBe(true);
105
+ });
106
+ it("should return true for Base Sepolia", () => {
107
+ const result = actionProvider.supportsNetwork({
108
+ protocolFamily: "evm",
109
+ networkId: "base-sepolia",
110
+ });
111
+ expect(result).toBe(true);
112
+ });
113
+ it("should return false for other EVM networks", () => {
114
+ const result = actionProvider.supportsNetwork({
115
+ protocolFamily: "evm",
116
+ networkId: "ethereum",
117
+ });
118
+ expect(result).toBe(false);
119
+ });
120
+ it("should return false for non-EVM networks", () => {
121
+ const result = actionProvider.supportsNetwork({
122
+ protocolFamily: "bitcoin",
123
+ networkId: "base-mainnet",
124
+ });
125
+ expect(result).toBe(false);
126
+ });
127
+ });
128
+ });
@@ -0,0 +1,36 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Input schema for Morpho Vault deposit action.
4
+ */
5
+ export declare const DepositSchema: z.ZodObject<{
6
+ assets: z.ZodString;
7
+ receiver: z.ZodString;
8
+ tokenAddress: z.ZodString;
9
+ vaultAddress: z.ZodString;
10
+ }, "strip", z.ZodTypeAny, {
11
+ receiver: string;
12
+ assets: string;
13
+ tokenAddress: string;
14
+ vaultAddress: string;
15
+ }, {
16
+ receiver: string;
17
+ assets: string;
18
+ tokenAddress: string;
19
+ vaultAddress: string;
20
+ }>;
21
+ /**
22
+ * Input schema for Morpho Vault withdraw action.
23
+ */
24
+ export declare const WithdrawSchema: z.ZodObject<{
25
+ vaultAddress: z.ZodString;
26
+ assets: z.ZodString;
27
+ receiver: z.ZodString;
28
+ }, "strip", z.ZodTypeAny, {
29
+ receiver: string;
30
+ assets: string;
31
+ vaultAddress: string;
32
+ }, {
33
+ receiver: string;
34
+ assets: string;
35
+ vaultAddress: string;
36
+ }>;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WithdrawSchema = exports.DepositSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Input schema for Morpho Vault deposit action.
7
+ */
8
+ exports.DepositSchema = zod_1.z
9
+ .object({
10
+ assets: zod_1.z
11
+ .string()
12
+ .regex(/^\d+(\.\d+)?$/, "Must be a valid integer or decimal value")
13
+ .describe("The quantity of assets to deposit, in whole units"),
14
+ receiver: zod_1.z
15
+ .string()
16
+ .regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address format")
17
+ .describe("The address that will own the position on the vault which will receive the shares"),
18
+ tokenAddress: zod_1.z
19
+ .string()
20
+ .regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address format")
21
+ .describe("The address of the assets token to approve for deposit"),
22
+ vaultAddress: zod_1.z
23
+ .string()
24
+ .regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address format")
25
+ .describe("The address of the Morpho Vault to deposit to"),
26
+ })
27
+ .describe("Input schema for Morpho Vault deposit action");
28
+ /**
29
+ * Input schema for Morpho Vault withdraw action.
30
+ */
31
+ exports.WithdrawSchema = zod_1.z
32
+ .object({
33
+ vaultAddress: zod_1.z
34
+ .string()
35
+ .regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address format")
36
+ .describe("The address of the Morpho Vault to withdraw from"),
37
+ assets: zod_1.z
38
+ .string()
39
+ .regex(/^\d+$/, "Must be a valid whole number")
40
+ .describe("The amount of assets to withdraw in atomic units e.g. 1"),
41
+ receiver: zod_1.z
42
+ .string()
43
+ .regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address format")
44
+ .describe("The address to receive the shares"),
45
+ })
46
+ .strip()
47
+ .describe("Input schema for Morpho Vault withdraw action");
@@ -0,0 +1 @@
1
+ export * from "./openseaActionProvider";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./openseaActionProvider"), exports);
@@ -0,0 +1,59 @@
1
+ import { z } from "zod";
2
+ import { ActionProvider } from "../actionProvider";
3
+ import { ListNftSchema, GetNftsByAccountSchema } from "./schemas";
4
+ import { Network } from "../../network";
5
+ import { EvmWalletProvider } from "../../wallet-providers";
6
+ /**
7
+ * Configuration options for the OpenseaActionProvider.
8
+ */
9
+ export interface OpenseaActionProviderConfig {
10
+ /**
11
+ * OpenSea API Key.
12
+ */
13
+ apiKey?: string;
14
+ /**
15
+ * The network ID to use for the OpenseaActionProvider.
16
+ */
17
+ networkId?: string;
18
+ /**
19
+ * The private key to use for the OpenseaActionProvider.
20
+ */
21
+ privateKey?: string;
22
+ }
23
+ /**
24
+ * OpenseaActionProvider is an action provider for OpenSea marketplace interactions.
25
+ */
26
+ export declare class OpenseaActionProvider extends ActionProvider<EvmWalletProvider> {
27
+ private readonly apiKey;
28
+ private walletWithProvider;
29
+ private openseaSDK;
30
+ private openseaBaseUrl;
31
+ /**
32
+ * Constructor for the OpenseaActionProvider class.
33
+ *
34
+ * @param config - The configuration options for the OpenseaActionProvider.
35
+ */
36
+ constructor(config?: OpenseaActionProviderConfig);
37
+ /**
38
+ * Lists an NFT for sale on OpenSea.
39
+ *
40
+ * @param args - The input arguments for the action.
41
+ * @returns A message containing the listing details.
42
+ */
43
+ listNft(args: z.infer<typeof ListNftSchema>): Promise<string>;
44
+ /**
45
+ * Fetch NFTs of a specific wallet address.
46
+ *
47
+ * @param args - The input arguments for the action.
48
+ * @returns A JSON string containing the NFTs or error message
49
+ */
50
+ getNftsByAccount(args: z.infer<typeof GetNftsByAccountSchema>): Promise<string>;
51
+ /**
52
+ * Checks if the Opensea action provider supports the given network.
53
+ *
54
+ * @param network - The network to check.
55
+ * @returns True if the Opensea action provider supports the network, false otherwise.
56
+ */
57
+ supportsNetwork: (network: Network) => boolean;
58
+ }
59
+ export declare const openseaActionProvider: (config?: OpenseaActionProviderConfig) => OpenseaActionProvider;
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.openseaActionProvider = exports.OpenseaActionProvider = void 0;
13
+ const zod_1 = require("zod");
14
+ const actionProvider_1 = require("../actionProvider");
15
+ const actionDecorator_1 = require("../actionDecorator");
16
+ const schemas_1 = require("./schemas");
17
+ const opensea_js_1 = require("opensea-js");
18
+ const network_1 = require("../../network");
19
+ const ethers_1 = require("ethers");
20
+ const utils_1 = require("./utils");
21
+ /**
22
+ * OpenseaActionProvider is an action provider for OpenSea marketplace interactions.
23
+ */
24
+ class OpenseaActionProvider extends actionProvider_1.ActionProvider {
25
+ /**
26
+ * Constructor for the OpenseaActionProvider class.
27
+ *
28
+ * @param config - The configuration options for the OpenseaActionProvider.
29
+ */
30
+ constructor(config = {}) {
31
+ super("opensea", []);
32
+ /**
33
+ * Checks if the Opensea action provider supports the given network.
34
+ *
35
+ * @param network - The network to check.
36
+ * @returns True if the Opensea action provider supports the network, false otherwise.
37
+ */
38
+ this.supportsNetwork = (network) => network.chainId !== undefined && utils_1.supportedChains[network.chainId] !== undefined;
39
+ const apiKey = config.apiKey || process.env.OPENSEA_API_KEY;
40
+ if (!apiKey) {
41
+ throw new Error("OPENSEA_API_KEY is not configured.");
42
+ }
43
+ this.apiKey = apiKey;
44
+ const chainId = network_1.NETWORK_ID_TO_CHAIN_ID[config.networkId || "base-sepolia"];
45
+ const provider = ethers_1.ethers.getDefaultProvider(parseInt(chainId));
46
+ const walletWithProvider = new ethers_1.Wallet(config.privateKey, provider);
47
+ this.walletWithProvider = walletWithProvider;
48
+ const openseaSDK = new opensea_js_1.OpenSeaSDK(walletWithProvider, {
49
+ chain: (0, utils_1.chainIdToOpenseaChain)(chainId),
50
+ apiKey: this.apiKey,
51
+ });
52
+ this.openseaSDK = openseaSDK;
53
+ this.openseaBaseUrl = this.openseaSDK.api.apiBaseUrl.replace("-api", "").replace("api", "");
54
+ }
55
+ /**
56
+ * Lists an NFT for sale on OpenSea.
57
+ *
58
+ * @param args - The input arguments for the action.
59
+ * @returns A message containing the listing details.
60
+ */
61
+ async listNft(args) {
62
+ try {
63
+ const expirationTime = Math.round(Date.now() / 1000 + args.expirationDays * 24 * 60 * 60);
64
+ await this.openseaSDK.createListing({
65
+ asset: {
66
+ tokenId: args.tokenId,
67
+ tokenAddress: args.contractAddress,
68
+ },
69
+ startAmount: args.price,
70
+ quantity: 1,
71
+ paymentTokenAddress: "0x0000000000000000000000000000000000000000", // ETH
72
+ expirationTime,
73
+ accountAddress: this.walletWithProvider.address,
74
+ });
75
+ const listingLink = `${this.openseaBaseUrl}/assets/${this.openseaSDK.chain}/${args.contractAddress}/${args.tokenId}`;
76
+ return `Successfully listed NFT ${args.contractAddress} token ${args.tokenId} for ${args.price} ETH, expiring in ${args.expirationDays} days. Listing on OpenSea: ${listingLink}.`;
77
+ }
78
+ catch (error) {
79
+ return `Error listing NFT ${args.contractAddress} token ${args.tokenId} for ${args.price} ETH using account ${this.walletWithProvider.address}: ${error}`;
80
+ }
81
+ }
82
+ /**
83
+ * Fetch NFTs of a specific wallet address.
84
+ *
85
+ * @param args - The input arguments for the action.
86
+ * @returns A JSON string containing the NFTs or error message
87
+ */
88
+ async getNftsByAccount(args) {
89
+ try {
90
+ const address = args.accountAddress || this.walletWithProvider.address;
91
+ const { nfts } = await this.openseaSDK.api.getNFTsByAccount(address);
92
+ return JSON.stringify(nfts);
93
+ }
94
+ catch (error) {
95
+ const address = args.accountAddress || this.walletWithProvider.address;
96
+ return `Error fetching NFTs for account ${address}: ${error}`;
97
+ }
98
+ }
99
+ }
100
+ exports.OpenseaActionProvider = OpenseaActionProvider;
101
+ __decorate([
102
+ (0, actionDecorator_1.CreateAction)({
103
+ name: "list_nft",
104
+ description: `
105
+ This tool will list an NFT for sale on the OpenSea marketplace.
106
+ EVM networks are supported on mainnet and testnets.
107
+
108
+ It takes the following inputs:
109
+ - contractAddress: The NFT contract address to list
110
+ - tokenId: The ID of the NFT to list
111
+ - price: The price in ETH for which the NFT will be listed
112
+ - expirationDays: (Optional) Number of days the listing should be active for (default: 90)
113
+
114
+ Important notes:
115
+ - The wallet must own the NFT
116
+ - Price is in ETH (e.g., 1.5 for 1.5 ETH). This is the amount the seller will receive if the NFT is sold. It is not required to have this amount in the wallet.
117
+ - Listing the NFT requires approval for OpenSea to manage the entire NFT collection:
118
+ - If the collection is not already approved, an onchain transaction is required, which will incur gas fees.
119
+ - If already approved, listing is gasless and does not require any onchain transaction.
120
+ - EVM networks are supported on mainnet and testnets, for example: base-mainnet and base-sepolia.
121
+ `,
122
+ schema: schemas_1.ListNftSchema,
123
+ }),
124
+ __metadata("design:type", Function),
125
+ __metadata("design:paramtypes", [void 0]),
126
+ __metadata("design:returntype", Promise)
127
+ ], OpenseaActionProvider.prototype, "listNft", null);
128
+ __decorate([
129
+ (0, actionDecorator_1.CreateAction)({
130
+ name: "get_nfts_by_account",
131
+ description: `
132
+ This tool will fetch NFTs owned by a specific wallet address on OpenSea.
133
+
134
+ It takes the following inputs:
135
+ - accountAddress: (Optional) The wallet address to fetch NFTs for. If not provided, uses the connected wallet address.
136
+
137
+ The tool will return a JSON string containing the NFTs owned by the specified address.
138
+ `,
139
+ schema: schemas_1.GetNftsByAccountSchema,
140
+ }),
141
+ __metadata("design:type", Function),
142
+ __metadata("design:paramtypes", [void 0]),
143
+ __metadata("design:returntype", Promise)
144
+ ], OpenseaActionProvider.prototype, "getNftsByAccount", null);
145
+ const openseaActionProvider = (config) => new OpenseaActionProvider(config);
146
+ exports.openseaActionProvider = openseaActionProvider;