keyring-agent-core 0.2.1 → 0.2.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 (417) hide show
  1. package/dist/index.d.ts +6692 -27
  2. package/dist/index.js +877 -70
  3. package/package.json +4 -3
  4. package/dist/agent/AgentCore.d.ts +0 -256
  5. package/dist/agent/AgentCore.d.ts.map +0 -1
  6. package/dist/agent/AgentCore.js +0 -1093
  7. package/dist/agent/AgentCore.js.map +0 -1
  8. package/dist/agent/QueryRewriter.d.ts +0 -84
  9. package/dist/agent/QueryRewriter.d.ts.map +0 -1
  10. package/dist/agent/QueryRewriter.js +0 -306
  11. package/dist/agent/QueryRewriter.js.map +0 -1
  12. package/dist/agent/Router.d.ts +0 -33
  13. package/dist/agent/Router.d.ts.map +0 -1
  14. package/dist/agent/Router.js +0 -229
  15. package/dist/agent/Router.js.map +0 -1
  16. package/dist/agent/Subagent.d.ts +0 -80
  17. package/dist/agent/Subagent.d.ts.map +0 -1
  18. package/dist/agent/Subagent.js +0 -272
  19. package/dist/agent/Subagent.js.map +0 -1
  20. package/dist/agent/Synthesizer.d.ts +0 -11
  21. package/dist/agent/Synthesizer.d.ts.map +0 -1
  22. package/dist/agent/Synthesizer.js +0 -86
  23. package/dist/agent/Synthesizer.js.map +0 -1
  24. package/dist/agent/chatGraph.d.ts +0 -364
  25. package/dist/agent/chatGraph.d.ts.map +0 -1
  26. package/dist/agent/chatGraph.js +0 -184
  27. package/dist/agent/chatGraph.js.map +0 -1
  28. package/dist/agent/index.d.ts +0 -10
  29. package/dist/agent/index.d.ts.map +0 -1
  30. package/dist/agent/index.js +0 -24
  31. package/dist/agent/index.js.map +0 -1
  32. package/dist/agent/subagents/AiAgent.d.ts +0 -6
  33. package/dist/agent/subagents/AiAgent.d.ts.map +0 -1
  34. package/dist/agent/subagents/AiAgent.js +0 -52
  35. package/dist/agent/subagents/AiAgent.js.map +0 -1
  36. package/dist/agent/subagents/NftAgent.d.ts +0 -6
  37. package/dist/agent/subagents/NftAgent.d.ts.map +0 -1
  38. package/dist/agent/subagents/NftAgent.js +0 -79
  39. package/dist/agent/subagents/NftAgent.js.map +0 -1
  40. package/dist/agent/subagents/PoolAgent.d.ts +0 -6
  41. package/dist/agent/subagents/PoolAgent.d.ts.map +0 -1
  42. package/dist/agent/subagents/PoolAgent.js +0 -184
  43. package/dist/agent/subagents/PoolAgent.js.map +0 -1
  44. package/dist/agent/subagents/PoolSubgraphAgent.d.ts +0 -6
  45. package/dist/agent/subagents/PoolSubgraphAgent.d.ts.map +0 -1
  46. package/dist/agent/subagents/PoolSubgraphAgent.js +0 -117
  47. package/dist/agent/subagents/PoolSubgraphAgent.js.map +0 -1
  48. package/dist/agent/subagents/TokenAgent.d.ts +0 -6
  49. package/dist/agent/subagents/TokenAgent.d.ts.map +0 -1
  50. package/dist/agent/subagents/TokenAgent.js +0 -76
  51. package/dist/agent/subagents/TokenAgent.js.map +0 -1
  52. package/dist/agent/subagents/WalletActionAgent.d.ts +0 -6
  53. package/dist/agent/subagents/WalletActionAgent.d.ts.map +0 -1
  54. package/dist/agent/subagents/WalletActionAgent.js +0 -55
  55. package/dist/agent/subagents/WalletActionAgent.js.map +0 -1
  56. package/dist/agent/subagents/WalletAgent.d.ts +0 -6
  57. package/dist/agent/subagents/WalletAgent.d.ts.map +0 -1
  58. package/dist/agent/subagents/WalletAgent.js +0 -93
  59. package/dist/agent/subagents/WalletAgent.js.map +0 -1
  60. package/dist/agent/subagents/index.d.ts +0 -34
  61. package/dist/agent/subagents/index.d.ts.map +0 -1
  62. package/dist/agent/subagents/index.js +0 -69
  63. package/dist/agent/subagents/index.js.map +0 -1
  64. package/dist/constants/abi.d.ts +0 -551
  65. package/dist/constants/abi.d.ts.map +0 -1
  66. package/dist/constants/abi.js +0 -690
  67. package/dist/constants/abi.js.map +0 -1
  68. package/dist/functions/pool.d.ts +0 -25
  69. package/dist/functions/pool.d.ts.map +0 -1
  70. package/dist/functions/pool.js +0 -151
  71. package/dist/functions/pool.js.map +0 -1
  72. package/dist/functions/web3.d.ts +0 -31
  73. package/dist/functions/web3.d.ts.map +0 -1
  74. package/dist/functions/web3.js +0 -232
  75. package/dist/functions/web3.js.map +0 -1
  76. package/dist/index.d.ts.map +0 -1
  77. package/dist/index.js.map +0 -1
  78. package/dist/llm/GeminiProvider.d.ts +0 -16
  79. package/dist/llm/GeminiProvider.d.ts.map +0 -1
  80. package/dist/llm/GeminiProvider.js +0 -329
  81. package/dist/llm/GeminiProvider.js.map +0 -1
  82. package/dist/llm/index.d.ts +0 -2
  83. package/dist/llm/index.d.ts.map +0 -1
  84. package/dist/llm/index.js +0 -6
  85. package/dist/llm/index.js.map +0 -1
  86. package/dist/memory/ChatHistory.d.ts +0 -83
  87. package/dist/memory/ChatHistory.d.ts.map +0 -1
  88. package/dist/memory/ChatHistory.js +0 -143
  89. package/dist/memory/ChatHistory.js.map +0 -1
  90. package/dist/memory/KnowledgeBase.d.ts +0 -38
  91. package/dist/memory/KnowledgeBase.d.ts.map +0 -1
  92. package/dist/memory/KnowledgeBase.js +0 -139
  93. package/dist/memory/KnowledgeBase.js.map +0 -1
  94. package/dist/memory/Summarizer.d.ts +0 -12
  95. package/dist/memory/Summarizer.d.ts.map +0 -1
  96. package/dist/memory/Summarizer.js +0 -39
  97. package/dist/memory/Summarizer.js.map +0 -1
  98. package/dist/memory/UpstashKnowledgeBase.d.ts +0 -124
  99. package/dist/memory/UpstashKnowledgeBase.d.ts.map +0 -1
  100. package/dist/memory/UpstashKnowledgeBase.js +0 -152
  101. package/dist/memory/UpstashKnowledgeBase.js.map +0 -1
  102. package/dist/memory/historyUtils.d.ts +0 -58
  103. package/dist/memory/historyUtils.d.ts.map +0 -1
  104. package/dist/memory/historyUtils.js +0 -190
  105. package/dist/memory/historyUtils.js.map +0 -1
  106. package/dist/memory/index.d.ts +0 -7
  107. package/dist/memory/index.d.ts.map +0 -1
  108. package/dist/memory/index.js +0 -12
  109. package/dist/memory/index.js.map +0 -1
  110. package/dist/memory/ingestKnowledgeBase.d.ts +0 -17
  111. package/dist/memory/ingestKnowledgeBase.d.ts.map +0 -1
  112. package/dist/memory/ingestKnowledgeBase.js +0 -35
  113. package/dist/memory/ingestKnowledgeBase.js.map +0 -1
  114. package/dist/services/MoralisService.d.ts +0 -1328
  115. package/dist/services/MoralisService.d.ts.map +0 -1
  116. package/dist/services/MoralisService.js +0 -1239
  117. package/dist/services/MoralisService.js.map +0 -1
  118. package/dist/services/PantographService.d.ts +0 -98
  119. package/dist/services/PantographService.d.ts.map +0 -1
  120. package/dist/services/PantographService.js +0 -451
  121. package/dist/services/PantographService.js.map +0 -1
  122. package/dist/services/PoolService.d.ts +0 -238
  123. package/dist/services/PoolService.d.ts.map +0 -1
  124. package/dist/services/PoolService.js +0 -485
  125. package/dist/services/PoolService.js.map +0 -1
  126. package/dist/services/UniswapService.d.ts +0 -289
  127. package/dist/services/UniswapService.d.ts.map +0 -1
  128. package/dist/services/UniswapService.js +0 -585
  129. package/dist/services/UniswapService.js.map +0 -1
  130. package/dist/services/UniswapSubgraphService.d.ts +0 -144
  131. package/dist/services/UniswapSubgraphService.d.ts.map +0 -1
  132. package/dist/services/UniswapSubgraphService.js +0 -606
  133. package/dist/services/UniswapSubgraphService.js.map +0 -1
  134. package/dist/services/rpc.d.ts +0 -35
  135. package/dist/services/rpc.d.ts.map +0 -1
  136. package/dist/services/rpc.js +0 -110
  137. package/dist/services/rpc.js.map +0 -1
  138. package/dist/services/swap/BaseSwapService.d.ts +0 -17
  139. package/dist/services/swap/BaseSwapService.d.ts.map +0 -1
  140. package/dist/services/swap/BaseSwapService.js +0 -19
  141. package/dist/services/swap/BaseSwapService.js.map +0 -1
  142. package/dist/services/swap/DebridgeAdapter.d.ts +0 -37
  143. package/dist/services/swap/DebridgeAdapter.d.ts.map +0 -1
  144. package/dist/services/swap/DebridgeAdapter.js +0 -243
  145. package/dist/services/swap/DebridgeAdapter.js.map +0 -1
  146. package/dist/services/swap/RelayAdapter.d.ts +0 -19
  147. package/dist/services/swap/RelayAdapter.d.ts.map +0 -1
  148. package/dist/services/swap/RelayAdapter.js +0 -189
  149. package/dist/services/swap/RelayAdapter.js.map +0 -1
  150. package/dist/services/swap/SwapServiceFactory.d.ts +0 -25
  151. package/dist/services/swap/SwapServiceFactory.d.ts.map +0 -1
  152. package/dist/services/swap/SwapServiceFactory.js +0 -79
  153. package/dist/services/swap/SwapServiceFactory.js.map +0 -1
  154. package/dist/services/swap/addresses.d.ts +0 -3
  155. package/dist/services/swap/addresses.d.ts.map +0 -1
  156. package/dist/services/swap/addresses.js +0 -68
  157. package/dist/services/swap/addresses.js.map +0 -1
  158. package/dist/services/swap/affiliate.d.ts +0 -17
  159. package/dist/services/swap/affiliate.d.ts.map +0 -1
  160. package/dist/services/swap/affiliate.js +0 -126
  161. package/dist/services/swap/affiliate.js.map +0 -1
  162. package/dist/services/swap/config.d.ts +0 -9
  163. package/dist/services/swap/config.d.ts.map +0 -1
  164. package/dist/services/swap/config.js +0 -19
  165. package/dist/services/swap/config.js.map +0 -1
  166. package/dist/services/swap/index.d.ts +0 -10
  167. package/dist/services/swap/index.d.ts.map +0 -1
  168. package/dist/services/swap/index.js +0 -22
  169. package/dist/services/swap/index.js.map +0 -1
  170. package/dist/services/swap/types.d.ts +0 -89
  171. package/dist/services/swap/types.d.ts.map +0 -1
  172. package/dist/services/swap/types.js +0 -6
  173. package/dist/services/swap/types.js.map +0 -1
  174. package/dist/tools/BaseTool.d.ts +0 -15
  175. package/dist/tools/BaseTool.d.ts.map +0 -1
  176. package/dist/tools/BaseTool.js +0 -35
  177. package/dist/tools/BaseTool.js.map +0 -1
  178. package/dist/tools/ToolRegistry.d.ts +0 -27
  179. package/dist/tools/ToolRegistry.d.ts.map +0 -1
  180. package/dist/tools/ToolRegistry.js +0 -80
  181. package/dist/tools/ToolRegistry.js.map +0 -1
  182. package/dist/tools/builtin/ai/GeminiSearchAiTool.d.ts +0 -36
  183. package/dist/tools/builtin/ai/GeminiSearchAiTool.d.ts.map +0 -1
  184. package/dist/tools/builtin/ai/GeminiSearchAiTool.js +0 -91
  185. package/dist/tools/builtin/ai/GeminiSearchAiTool.js.map +0 -1
  186. package/dist/tools/builtin/ai/index.d.ts +0 -3
  187. package/dist/tools/builtin/ai/index.d.ts.map +0 -1
  188. package/dist/tools/builtin/ai/index.js +0 -6
  189. package/dist/tools/builtin/ai/index.js.map +0 -1
  190. package/dist/tools/builtin/index.d.ts +0 -8
  191. package/dist/tools/builtin/index.d.ts.map +0 -1
  192. package/dist/tools/builtin/index.js +0 -24
  193. package/dist/tools/builtin/index.js.map +0 -1
  194. package/dist/tools/builtin/nft/BaseNftMessageTool.d.ts +0 -35
  195. package/dist/tools/builtin/nft/BaseNftMessageTool.d.ts.map +0 -1
  196. package/dist/tools/builtin/nft/BaseNftMessageTool.js +0 -45
  197. package/dist/tools/builtin/nft/BaseNftMessageTool.js.map +0 -1
  198. package/dist/tools/builtin/nft/NFTContractInfoTool.d.ts +0 -15
  199. package/dist/tools/builtin/nft/NFTContractInfoTool.d.ts.map +0 -1
  200. package/dist/tools/builtin/nft/NFTContractInfoTool.js +0 -19
  201. package/dist/tools/builtin/nft/NFTContractInfoTool.js.map +0 -1
  202. package/dist/tools/builtin/nft/NFTMetadataTool.d.ts +0 -15
  203. package/dist/tools/builtin/nft/NFTMetadataTool.d.ts.map +0 -1
  204. package/dist/tools/builtin/nft/NFTMetadataTool.js +0 -20
  205. package/dist/tools/builtin/nft/NFTMetadataTool.js.map +0 -1
  206. package/dist/tools/builtin/nft/SendNftTool.d.ts +0 -14
  207. package/dist/tools/builtin/nft/SendNftTool.d.ts.map +0 -1
  208. package/dist/tools/builtin/nft/SendNftTool.js +0 -20
  209. package/dist/tools/builtin/nft/SendNftTool.js.map +0 -1
  210. package/dist/tools/builtin/nft/WalletNFTsTool.d.ts +0 -15
  211. package/dist/tools/builtin/nft/WalletNFTsTool.d.ts.map +0 -1
  212. package/dist/tools/builtin/nft/WalletNFTsTool.js +0 -20
  213. package/dist/tools/builtin/nft/WalletNFTsTool.js.map +0 -1
  214. package/dist/tools/builtin/nft/index.d.ts +0 -7
  215. package/dist/tools/builtin/nft/index.d.ts.map +0 -1
  216. package/dist/tools/builtin/nft/index.js +0 -10
  217. package/dist/tools/builtin/nft/index.js.map +0 -1
  218. package/dist/tools/builtin/pool/EstimatePoolYieldTool.d.ts +0 -124
  219. package/dist/tools/builtin/pool/EstimatePoolYieldTool.d.ts.map +0 -1
  220. package/dist/tools/builtin/pool/EstimatePoolYieldTool.js +0 -236
  221. package/dist/tools/builtin/pool/EstimatePoolYieldTool.js.map +0 -1
  222. package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.d.ts +0 -128
  223. package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.d.ts.map +0 -1
  224. package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.js +0 -520
  225. package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.js.map +0 -1
  226. package/dist/tools/builtin/pool/PoolByAddressTool.d.ts +0 -127
  227. package/dist/tools/builtin/pool/PoolByAddressTool.d.ts.map +0 -1
  228. package/dist/tools/builtin/pool/PoolByAddressTool.js +0 -238
  229. package/dist/tools/builtin/pool/PoolByAddressTool.js.map +0 -1
  230. package/dist/tools/builtin/pool/PoolDetailTool.d.ts +0 -127
  231. package/dist/tools/builtin/pool/PoolDetailTool.d.ts.map +0 -1
  232. package/dist/tools/builtin/pool/PoolDetailTool.js +0 -273
  233. package/dist/tools/builtin/pool/PoolDetailTool.js.map +0 -1
  234. package/dist/tools/builtin/pool/PoolSearchTool.d.ts +0 -50
  235. package/dist/tools/builtin/pool/PoolSearchTool.d.ts.map +0 -1
  236. package/dist/tools/builtin/pool/PoolSearchTool.js +0 -160
  237. package/dist/tools/builtin/pool/PoolSearchTool.js.map +0 -1
  238. package/dist/tools/builtin/pool/PreviewAddLiquidityTool.d.ts +0 -124
  239. package/dist/tools/builtin/pool/PreviewAddLiquidityTool.d.ts.map +0 -1
  240. package/dist/tools/builtin/pool/PreviewAddLiquidityTool.js +0 -382
  241. package/dist/tools/builtin/pool/PreviewAddLiquidityTool.js.map +0 -1
  242. package/dist/tools/builtin/pool/TopPoolsTool.d.ts +0 -68
  243. package/dist/tools/builtin/pool/TopPoolsTool.d.ts.map +0 -1
  244. package/dist/tools/builtin/pool/TopPoolsTool.js +0 -159
  245. package/dist/tools/builtin/pool/TopPoolsTool.js.map +0 -1
  246. package/dist/tools/builtin/pool/index.d.ts +0 -15
  247. package/dist/tools/builtin/pool/index.d.ts.map +0 -1
  248. package/dist/tools/builtin/pool/index.js +0 -18
  249. package/dist/tools/builtin/pool/index.js.map +0 -1
  250. package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.d.ts +0 -54
  251. package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.d.ts.map +0 -1
  252. package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.js +0 -98
  253. package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.js.map +0 -1
  254. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.d.ts +0 -63
  255. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.d.ts.map +0 -1
  256. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.js +0 -82
  257. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.js.map +0 -1
  258. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.d.ts +0 -79
  259. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.d.ts.map +0 -1
  260. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.js +0 -97
  261. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.js.map +0 -1
  262. package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.d.ts +0 -77
  263. package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.d.ts.map +0 -1
  264. package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.js +0 -190
  265. package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.js.map +0 -1
  266. package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.d.ts +0 -107
  267. package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.d.ts.map +0 -1
  268. package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.js +0 -92
  269. package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.js.map +0 -1
  270. package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.d.ts +0 -56
  271. package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.d.ts.map +0 -1
  272. package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.js +0 -94
  273. package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.js.map +0 -1
  274. package/dist/tools/builtin/pool-subgraph/index.d.ts +0 -13
  275. package/dist/tools/builtin/pool-subgraph/index.d.ts.map +0 -1
  276. package/dist/tools/builtin/pool-subgraph/index.js +0 -18
  277. package/dist/tools/builtin/pool-subgraph/index.js.map +0 -1
  278. package/dist/tools/builtin/token/TokenAnalyticsTool.d.ts +0 -71
  279. package/dist/tools/builtin/token/TokenAnalyticsTool.d.ts.map +0 -1
  280. package/dist/tools/builtin/token/TokenAnalyticsTool.js +0 -147
  281. package/dist/tools/builtin/token/TokenAnalyticsTool.js.map +0 -1
  282. package/dist/tools/builtin/token/TokenHoldersTool.d.ts +0 -81
  283. package/dist/tools/builtin/token/TokenHoldersTool.d.ts.map +0 -1
  284. package/dist/tools/builtin/token/TokenHoldersTool.js +0 -139
  285. package/dist/tools/builtin/token/TokenHoldersTool.js.map +0 -1
  286. package/dist/tools/builtin/token/TokenInfoTool.d.ts +0 -40
  287. package/dist/tools/builtin/token/TokenInfoTool.d.ts.map +0 -1
  288. package/dist/tools/builtin/token/TokenInfoTool.js +0 -221
  289. package/dist/tools/builtin/token/TokenInfoTool.js.map +0 -1
  290. package/dist/tools/builtin/token/TokenScoreTool.d.ts +0 -63
  291. package/dist/tools/builtin/token/TokenScoreTool.d.ts.map +0 -1
  292. package/dist/tools/builtin/token/TokenScoreTool.js +0 -148
  293. package/dist/tools/builtin/token/TokenScoreTool.js.map +0 -1
  294. package/dist/tools/builtin/token/TopGainersTool.d.ts +0 -37
  295. package/dist/tools/builtin/token/TopGainersTool.d.ts.map +0 -1
  296. package/dist/tools/builtin/token/TopGainersTool.js +0 -100
  297. package/dist/tools/builtin/token/TopGainersTool.js.map +0 -1
  298. package/dist/tools/builtin/token/TopLosersTool.d.ts +0 -66
  299. package/dist/tools/builtin/token/TopLosersTool.d.ts.map +0 -1
  300. package/dist/tools/builtin/token/TopLosersTool.js +0 -129
  301. package/dist/tools/builtin/token/TopLosersTool.js.map +0 -1
  302. package/dist/tools/builtin/token/TrendingTokensTool.d.ts +0 -39
  303. package/dist/tools/builtin/token/TrendingTokensTool.d.ts.map +0 -1
  304. package/dist/tools/builtin/token/TrendingTokensTool.js +0 -83
  305. package/dist/tools/builtin/token/TrendingTokensTool.js.map +0 -1
  306. package/dist/tools/builtin/token/index.d.ts +0 -13
  307. package/dist/tools/builtin/token/index.d.ts.map +0 -1
  308. package/dist/tools/builtin/token/index.js +0 -16
  309. package/dist/tools/builtin/token/index.js.map +0 -1
  310. package/dist/tools/builtin/wallet/TransactionByHashTool.d.ts +0 -70
  311. package/dist/tools/builtin/wallet/TransactionByHashTool.d.ts.map +0 -1
  312. package/dist/tools/builtin/wallet/TransactionByHashTool.js +0 -111
  313. package/dist/tools/builtin/wallet/TransactionByHashTool.js.map +0 -1
  314. package/dist/tools/builtin/wallet/WalletApprovalsTool.d.ts +0 -107
  315. package/dist/tools/builtin/wallet/WalletApprovalsTool.d.ts.map +0 -1
  316. package/dist/tools/builtin/wallet/WalletApprovalsTool.js +0 -164
  317. package/dist/tools/builtin/wallet/WalletApprovalsTool.js.map +0 -1
  318. package/dist/tools/builtin/wallet/WalletDefiPositionsTool.d.ts +0 -61
  319. package/dist/tools/builtin/wallet/WalletDefiPositionsTool.d.ts.map +0 -1
  320. package/dist/tools/builtin/wallet/WalletDefiPositionsTool.js +0 -100
  321. package/dist/tools/builtin/wallet/WalletDefiPositionsTool.js.map +0 -1
  322. package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.d.ts +0 -68
  323. package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.d.ts.map +0 -1
  324. package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.js +0 -115
  325. package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.js.map +0 -1
  326. package/dist/tools/builtin/wallet/WalletDefiSummaryTool.d.ts +0 -50
  327. package/dist/tools/builtin/wallet/WalletDefiSummaryTool.d.ts.map +0 -1
  328. package/dist/tools/builtin/wallet/WalletDefiSummaryTool.js +0 -80
  329. package/dist/tools/builtin/wallet/WalletDefiSummaryTool.js.map +0 -1
  330. package/dist/tools/builtin/wallet/WalletHistoryTool.d.ts +0 -31
  331. package/dist/tools/builtin/wallet/WalletHistoryTool.d.ts.map +0 -1
  332. package/dist/tools/builtin/wallet/WalletHistoryTool.js +0 -154
  333. package/dist/tools/builtin/wallet/WalletHistoryTool.js.map +0 -1
  334. package/dist/tools/builtin/wallet/WalletNetWorthTool.d.ts +0 -44
  335. package/dist/tools/builtin/wallet/WalletNetWorthTool.d.ts.map +0 -1
  336. package/dist/tools/builtin/wallet/WalletNetWorthTool.js +0 -122
  337. package/dist/tools/builtin/wallet/WalletNetWorthTool.js.map +0 -1
  338. package/dist/tools/builtin/wallet/WalletNftTransfersTool.d.ts +0 -86
  339. package/dist/tools/builtin/wallet/WalletNftTransfersTool.d.ts.map +0 -1
  340. package/dist/tools/builtin/wallet/WalletNftTransfersTool.js +0 -265
  341. package/dist/tools/builtin/wallet/WalletNftTransfersTool.js.map +0 -1
  342. package/dist/tools/builtin/wallet/WalletPnlSummaryTool.d.ts +0 -43
  343. package/dist/tools/builtin/wallet/WalletPnlSummaryTool.d.ts.map +0 -1
  344. package/dist/tools/builtin/wallet/WalletPnlSummaryTool.js +0 -89
  345. package/dist/tools/builtin/wallet/WalletPnlSummaryTool.js.map +0 -1
  346. package/dist/tools/builtin/wallet/WalletPnlTool.d.ts +0 -43
  347. package/dist/tools/builtin/wallet/WalletPnlTool.d.ts.map +0 -1
  348. package/dist/tools/builtin/wallet/WalletPnlTool.js +0 -175
  349. package/dist/tools/builtin/wallet/WalletPnlTool.js.map +0 -1
  350. package/dist/tools/builtin/wallet/WalletTokenBalancesTool.d.ts +0 -35
  351. package/dist/tools/builtin/wallet/WalletTokenBalancesTool.d.ts.map +0 -1
  352. package/dist/tools/builtin/wallet/WalletTokenBalancesTool.js +0 -68
  353. package/dist/tools/builtin/wallet/WalletTokenBalancesTool.js.map +0 -1
  354. package/dist/tools/builtin/wallet/WalletTokenTransfersTool.d.ts +0 -109
  355. package/dist/tools/builtin/wallet/WalletTokenTransfersTool.d.ts.map +0 -1
  356. package/dist/tools/builtin/wallet/WalletTokenTransfersTool.js +0 -354
  357. package/dist/tools/builtin/wallet/WalletTokenTransfersTool.js.map +0 -1
  358. package/dist/tools/builtin/wallet/index.d.ts +0 -28
  359. package/dist/tools/builtin/wallet/index.d.ts.map +0 -1
  360. package/dist/tools/builtin/wallet/index.js +0 -32
  361. package/dist/tools/builtin/wallet/index.js.map +0 -1
  362. package/dist/tools/builtin/wallet-action/ApproveTokenTool.d.ts +0 -25
  363. package/dist/tools/builtin/wallet-action/ApproveTokenTool.d.ts.map +0 -1
  364. package/dist/tools/builtin/wallet-action/ApproveTokenTool.js +0 -98
  365. package/dist/tools/builtin/wallet-action/ApproveTokenTool.js.map +0 -1
  366. package/dist/tools/builtin/wallet-action/BaseWalletActionTool.d.ts +0 -211
  367. package/dist/tools/builtin/wallet-action/BaseWalletActionTool.d.ts.map +0 -1
  368. package/dist/tools/builtin/wallet-action/BaseWalletActionTool.js +0 -499
  369. package/dist/tools/builtin/wallet-action/BaseWalletActionTool.js.map +0 -1
  370. package/dist/tools/builtin/wallet-action/BuyTokenTool.d.ts +0 -240
  371. package/dist/tools/builtin/wallet-action/BuyTokenTool.d.ts.map +0 -1
  372. package/dist/tools/builtin/wallet-action/BuyTokenTool.js +0 -1257
  373. package/dist/tools/builtin/wallet-action/BuyTokenTool.js.map +0 -1
  374. package/dist/tools/builtin/wallet-action/SendNativeTool.d.ts +0 -41
  375. package/dist/tools/builtin/wallet-action/SendNativeTool.d.ts.map +0 -1
  376. package/dist/tools/builtin/wallet-action/SendNativeTool.js +0 -127
  377. package/dist/tools/builtin/wallet-action/SendNativeTool.js.map +0 -1
  378. package/dist/tools/builtin/wallet-action/SendTokenTool.d.ts +0 -63
  379. package/dist/tools/builtin/wallet-action/SendTokenTool.d.ts.map +0 -1
  380. package/dist/tools/builtin/wallet-action/SendTokenTool.js +0 -294
  381. package/dist/tools/builtin/wallet-action/SendTokenTool.js.map +0 -1
  382. package/dist/tools/builtin/wallet-action/SwapTokenTool.d.ts +0 -247
  383. package/dist/tools/builtin/wallet-action/SwapTokenTool.d.ts.map +0 -1
  384. package/dist/tools/builtin/wallet-action/SwapTokenTool.js +0 -1258
  385. package/dist/tools/builtin/wallet-action/SwapTokenTool.js.map +0 -1
  386. package/dist/tools/builtin/wallet-action/UnwrapNativeTool.d.ts +0 -20
  387. package/dist/tools/builtin/wallet-action/UnwrapNativeTool.d.ts.map +0 -1
  388. package/dist/tools/builtin/wallet-action/UnwrapNativeTool.js +0 -36
  389. package/dist/tools/builtin/wallet-action/UnwrapNativeTool.js.map +0 -1
  390. package/dist/tools/builtin/wallet-action/WrapNativeTool.d.ts +0 -23
  391. package/dist/tools/builtin/wallet-action/WrapNativeTool.d.ts.map +0 -1
  392. package/dist/tools/builtin/wallet-action/WrapNativeTool.js +0 -54
  393. package/dist/tools/builtin/wallet-action/WrapNativeTool.js.map +0 -1
  394. package/dist/tools/builtin/wallet-action/amountSpec.d.ts +0 -62
  395. package/dist/tools/builtin/wallet-action/amountSpec.d.ts.map +0 -1
  396. package/dist/tools/builtin/wallet-action/amountSpec.js +0 -93
  397. package/dist/tools/builtin/wallet-action/amountSpec.js.map +0 -1
  398. package/dist/tools/builtin/wallet-action/gasReserve.d.ts +0 -42
  399. package/dist/tools/builtin/wallet-action/gasReserve.d.ts.map +0 -1
  400. package/dist/tools/builtin/wallet-action/gasReserve.js +0 -103
  401. package/dist/tools/builtin/wallet-action/gasReserve.js.map +0 -1
  402. package/dist/tools/builtin/wallet-action/index.d.ts +0 -9
  403. package/dist/tools/builtin/wallet-action/index.d.ts.map +0 -1
  404. package/dist/tools/builtin/wallet-action/index.js +0 -20
  405. package/dist/tools/builtin/wallet-action/index.js.map +0 -1
  406. package/dist/tools/chainResolver.d.ts +0 -98
  407. package/dist/tools/chainResolver.d.ts.map +0 -1
  408. package/dist/tools/chainResolver.js +0 -302
  409. package/dist/tools/chainResolver.js.map +0 -1
  410. package/dist/tools/index.d.ts +0 -4
  411. package/dist/tools/index.d.ts.map +0 -1
  412. package/dist/tools/index.js +0 -23
  413. package/dist/tools/index.js.map +0 -1
  414. package/dist/types/index.d.ts +0 -777
  415. package/dist/types/index.d.ts.map +0 -1
  416. package/dist/types/index.js +0 -6
  417. package/dist/types/index.js.map +0 -1
@@ -1,35 +0,0 @@
1
- /**
2
- * Shared JSON-RPC client + default public RPC endpoints.
3
- *
4
- * Kept dependency-free (no imports from PoolService / swap) so both
5
- * `PoolService` and the swap adapters can use it without a circular import.
6
- */
7
- /** Default public RPC endpoint per hex chain id. Single source of truth. */
8
- export declare const DEFAULT_RPC_BY_CHAIN: Record<string, string>;
9
- /** Resolve a hex chain id to its default RPC URL, or undefined if unsupported. */
10
- export declare function getDefaultRpcUrl(chainId: string): string | undefined;
11
- /**
12
- * Install the shared RPC overrides for the whole core. Replaces any previous
13
- * set. Keys are normalised to lowercase hex chain ids; blank/non-string values
14
- * are ignored so a partial map only overrides the chains it actually names.
15
- * Called once by AgentCore from `AgentConfig.rpcUrls`.
16
- */
17
- export declare function setRpcOverrides(overrides?: Record<string, string>): void;
18
- /**
19
- * Resolve a hex chain id to its RPC URL: the caller-supplied override (see
20
- * {@link setRpcOverrides}) if present, else the built-in public default.
21
- * Returns undefined only when the chain is both un-overridden and unsupported.
22
- */
23
- export declare function resolveRpcUrl(chainId: string): string | undefined;
24
- /** Low-level JSON-RPC call with 429 backoff (5 retries, exponential). */
25
- export declare function rpcCall<T>(rpcUrl: string, method: string, params: unknown[]): Promise<T>;
26
- /** `eth_call` against an explicit RPC URL. `data` is the encoded calldata. */
27
- export declare function ethCallAt(rpcUrl: string, to: string, data: string): Promise<string>;
28
- /**
29
- * `eth_call` resolving the RPC URL from the hex chain id, honouring any shared
30
- * overrides (see {@link setRpcOverrides}) before falling back to the default
31
- * endpoint. Returns `null` when the chain has no known RPC or the call fails —
32
- * callers that need to distinguish errors should use {@link ethCallAt} directly.
33
- */
34
- export declare function ethCallByChain(chainId: string, to: string, data: string): Promise<string | null>;
35
- //# sourceMappingURL=rpc.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../src/services/rpc.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CASvD,CAAC;AAEF,kFAAkF;AAClF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEpE;AAWD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAUxE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGjE;AASD,yEAAyE;AACzE,wBAAsB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAmB9F;AAED,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEnF;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQtG"}
@@ -1,110 +0,0 @@
1
- "use strict";
2
- /**
3
- * Shared JSON-RPC client + default public RPC endpoints.
4
- *
5
- * Kept dependency-free (no imports from PoolService / swap) so both
6
- * `PoolService` and the swap adapters can use it without a circular import.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.DEFAULT_RPC_BY_CHAIN = void 0;
10
- exports.getDefaultRpcUrl = getDefaultRpcUrl;
11
- exports.setRpcOverrides = setRpcOverrides;
12
- exports.resolveRpcUrl = resolveRpcUrl;
13
- exports.rpcCall = rpcCall;
14
- exports.ethCallAt = ethCallAt;
15
- exports.ethCallByChain = ethCallByChain;
16
- /** Default public RPC endpoint per hex chain id. Single source of truth. */
17
- exports.DEFAULT_RPC_BY_CHAIN = {
18
- '0x1': 'https://ethereum-rpc.publicnode.com',
19
- '0xa': 'https://mainnet.optimism.io',
20
- '0x38': 'https://bsc-dataseed.binance.org',
21
- '0x89': 'https://polygon-bor-rpc.publicnode.com"',
22
- '0x2105': 'https://mainnet.base.org',
23
- '0xa4b1': 'https://arb1.arbitrum.io/rpc',
24
- '0xa86a': 'https://avalanche-c-chain-rpc.publicnode.com',
25
- '0xe708': 'https://rpc.linea.build',
26
- };
27
- /** Resolve a hex chain id to its default RPC URL, or undefined if unsupported. */
28
- function getDefaultRpcUrl(chainId) {
29
- return exports.DEFAULT_RPC_BY_CHAIN[chainId.toLowerCase()];
30
- }
31
- /**
32
- * Caller-supplied RPC overrides, keyed by lowercase hex chain id. Shared by the
33
- * whole core (gas-reserve reads, swap allowance checks, PoolService) so a single
34
- * `AgentConfig.rpcUrls` controls every on-chain read. Empty by default — when a
35
- * chain is not overridden, {@link resolveRpcUrl} falls back to
36
- * {@link DEFAULT_RPC_BY_CHAIN}.
37
- */
38
- let RPC_OVERRIDES = {};
39
- /**
40
- * Install the shared RPC overrides for the whole core. Replaces any previous
41
- * set. Keys are normalised to lowercase hex chain ids; blank/non-string values
42
- * are ignored so a partial map only overrides the chains it actually names.
43
- * Called once by AgentCore from `AgentConfig.rpcUrls`.
44
- */
45
- function setRpcOverrides(overrides) {
46
- const next = {};
47
- if (overrides) {
48
- for (const [chainId, url] of Object.entries(overrides)) {
49
- if (typeof url === 'string' && url.trim()) {
50
- next[chainId.toLowerCase()] = url.trim();
51
- }
52
- }
53
- }
54
- RPC_OVERRIDES = next;
55
- }
56
- /**
57
- * Resolve a hex chain id to its RPC URL: the caller-supplied override (see
58
- * {@link setRpcOverrides}) if present, else the built-in public default.
59
- * Returns undefined only when the chain is both un-overridden and unsupported.
60
- */
61
- function resolveRpcUrl(chainId) {
62
- const key = chainId.toLowerCase();
63
- return RPC_OVERRIDES[key] ?? exports.DEFAULT_RPC_BY_CHAIN[key];
64
- }
65
- /** Low-level JSON-RPC call with 429 backoff (5 retries, exponential). */
66
- async function rpcCall(rpcUrl, method, params) {
67
- const maxRetries = 5;
68
- for (let attempt = 0; attempt <= maxRetries; attempt++) {
69
- const res = await fetch(rpcUrl, {
70
- method: 'POST',
71
- headers: { 'Content-Type': 'application/json' },
72
- body: JSON.stringify({ jsonrpc: '2.0', id: Date.now(), method, params }),
73
- });
74
- if (res.status === 429 && attempt < maxRetries) {
75
- await new Promise((r) => setTimeout(r, 2 ** attempt * 500));
76
- continue;
77
- }
78
- if (!res.ok)
79
- throw new Error(`RPC ${method} HTTP ${res.status}`);
80
- const json = (await res.json());
81
- if (json.error)
82
- throw new Error(`RPC ${method}: ${json.error.message}`);
83
- if (json.result === undefined)
84
- throw new Error(`RPC ${method}: empty result`);
85
- return json.result;
86
- }
87
- throw new Error(`RPC ${method}: exceeded max retries (429)`);
88
- }
89
- /** `eth_call` against an explicit RPC URL. `data` is the encoded calldata. */
90
- function ethCallAt(rpcUrl, to, data) {
91
- return rpcCall(rpcUrl, 'eth_call', [{ to, data }, 'latest']);
92
- }
93
- /**
94
- * `eth_call` resolving the RPC URL from the hex chain id, honouring any shared
95
- * overrides (see {@link setRpcOverrides}) before falling back to the default
96
- * endpoint. Returns `null` when the chain has no known RPC or the call fails —
97
- * callers that need to distinguish errors should use {@link ethCallAt} directly.
98
- */
99
- async function ethCallByChain(chainId, to, data) {
100
- const rpcUrl = resolveRpcUrl(chainId);
101
- if (!rpcUrl)
102
- return null;
103
- try {
104
- return await ethCallAt(rpcUrl, to, data);
105
- }
106
- catch {
107
- return null;
108
- }
109
- }
110
- //# sourceMappingURL=rpc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rpc.js","sourceRoot":"","sources":["../../src/services/rpc.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAeH,4CAEC;AAiBD,0CAUC;AAOD,sCAGC;AAUD,0BAmBC;AAGD,8BAEC;AAQD,wCAQC;AAtGD,4EAA4E;AAC/D,QAAA,oBAAoB,GAA2B;IAC1D,KAAK,EAAE,qCAAqC;IAC5C,KAAK,EAAE,6BAA6B;IACpC,MAAM,EAAE,kCAAkC;IAC1C,MAAM,EAAE,yCAAyC;IACjD,QAAQ,EAAE,0BAA0B;IACpC,QAAQ,EAAE,8BAA8B;IACxC,QAAQ,EAAE,8CAA8C;IACxD,QAAQ,EAAE,yBAAyB;CACpC,CAAC;AAEF,kFAAkF;AAClF,SAAgB,gBAAgB,CAAC,OAAe;IAC9C,OAAO,4BAAoB,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;GAMG;AACH,IAAI,aAAa,GAA2B,E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H,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { CheckApprovalParams, CheckApprovalResult, ExecuteSwapParams, ExecuteSwapResult, ProviderName, SwapQuoteParams, SwapQuoteResult, SwapServiceConfig, TrackTransactionParams, TrackTransactionResult } from './types';
2
- /**
3
- * Abstract base for swap/bridge providers. Each adapter must implement the five
4
- * methods below; the factory wires the active provider based on chain config.
5
- */
6
- export declare abstract class BaseSwapService {
7
- protected readonly config: SwapServiceConfig;
8
- protected constructor(config: SwapServiceConfig);
9
- abstract getProviderName(): ProviderName;
10
- /** True when approval is delivered as part of the quote (e.g. Relay). */
11
- hasIntegratedApproval(): boolean;
12
- abstract getQuote(params: SwapQuoteParams): Promise<SwapQuoteResult>;
13
- abstract checkApproval(params: CheckApprovalParams): Promise<CheckApprovalResult>;
14
- abstract executeSwap(params: ExecuteSwapParams): Promise<ExecuteSwapResult>;
15
- abstract trackTransaction(params: TrackTransactionParams): Promise<TrackTransactionResult>;
16
- }
17
- //# sourceMappingURL=BaseSwapService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseSwapService.d.ts","sourceRoot":"","sources":["../../../src/services/swap/BaseSwapService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,8BAAsB,eAAe;IACnC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IAE7C,SAAS,aAAa,MAAM,EAAE,iBAAiB;IAI/C,QAAQ,CAAC,eAAe,IAAI,YAAY;IAExC,yEAAyE;IACzE,qBAAqB,IAAI,OAAO;IAIhC,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAEpE,QAAQ,CAAC,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAEjF,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAE3E,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAC3F"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseSwapService = void 0;
4
- /**
5
- * Abstract base for swap/bridge providers. Each adapter must implement the five
6
- * methods below; the factory wires the active provider based on chain config.
7
- */
8
- class BaseSwapService {
9
- config;
10
- constructor(config) {
11
- this.config = config;
12
- }
13
- /** True when approval is delivered as part of the quote (e.g. Relay). */
14
- hasIntegratedApproval() {
15
- return false;
16
- }
17
- }
18
- exports.BaseSwapService = BaseSwapService;
19
- //# sourceMappingURL=BaseSwapService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseSwapService.js","sourceRoot":"","sources":["../../../src/services/swap/BaseSwapService.ts"],"names":[],"mappings":";;;AAaA;;;GAGG;AACH,MAAsB,eAAe;IAChB,MAAM,CAAoB;IAE7C,YAAsB,MAAyB;QAC7C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAID,yEAAyE;IACzE,qBAAqB;QACnB,OAAO,KAAK,CAAC;IACf,CAAC;CASF;AArBD,0CAqBC"}
@@ -1,37 +0,0 @@
1
- import { BaseSwapService } from './BaseSwapService';
2
- import type { CheckApprovalParams, CheckApprovalResult, ExecuteSwapParams, ExecuteSwapResult, ProviderName, SwapQuoteParams, SwapQuoteResult, SwapServiceConfig, TrackTransactionParams, TrackTransactionResult } from './types';
3
- /**
4
- * deBridge DLN adapter. Same-chain swap uses /chain/transaction; cross-chain
5
- * uses /dln/order/create-tx. Approval is NOT integrated — caller must check
6
- * on-chain allowance against `tx.to` separately.
7
- */
8
- export declare class DebridgeAdapter extends BaseSwapService {
9
- private readonly apiBaseUrl;
10
- private readonly accessToken;
11
- constructor(config?: SwapServiceConfig);
12
- getProviderName(): ProviderName;
13
- hasIntegratedApproval(): boolean;
14
- getQuote(params: SwapQuoteParams): Promise<SwapQuoteResult>;
15
- /**
16
- * deBridge does NOT bundle approval, so the pay token must grant an allowance
17
- * to the swap router — the `to` of the swap tx (`quoteData.tx.to`) — before the
18
- * swap can run. Native coin needs no approval. For an ERC-20 we read the
19
- * on-chain `allowance(userAddress, spender)` and only flag `isNeeded` when the
20
- * current allowance is below `amount` (no redundant approve when already set).
21
- *
22
- * `amount` is the spend in the token's smallest units (wei-equivalent), the
23
- * same value passed as `srcTokenAmount` to the quote.
24
- */
25
- checkApproval(params: CheckApprovalParams): Promise<CheckApprovalResult>;
26
- /**
27
- * Read ERC-20 `allowance(owner, spender)` via the shared RPC client. Returns
28
- * the allowance as a bigint, or `null` when the chain is unknown / the call
29
- * fails / the result can't be parsed. Calldata is the `allowance` selector
30
- * (`0xdd62ed3e`) + two 32-byte-padded addresses.
31
- */
32
- private readAllowance;
33
- executeSwap(params: ExecuteSwapParams): Promise<ExecuteSwapResult>;
34
- trackTransaction(params: TrackTransactionParams): Promise<TrackTransactionResult>;
35
- private get;
36
- }
37
- //# sourceMappingURL=DebridgeAdapter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DebridgeAdapter.d.ts","sourceRoot":"","sources":["../../../src/services/swap/DebridgeAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAMjB;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,eAAe;IAClD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBAEzB,MAAM,GAAE,iBAAsB;IAM1C,eAAe,IAAI,YAAY;IAI/B,qBAAqB,IAAI,OAAO;IAI1B,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAmGjE;;;;;;;;;OASG;IACG,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAwD9E;;;;;OAKG;YACW,aAAa;IAoBrB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAUlE,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC;YAuCzE,GAAG;CAWlB"}
@@ -1,243 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DebridgeAdapter = void 0;
4
- const BaseSwapService_1 = require("./BaseSwapService");
5
- const affiliate_1 = require("./affiliate");
6
- const rpc_1 = require("../rpc");
7
- const DEFAULT_BASE_URL = 'https://dln.debridge.finance/v1.0';
8
- const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
9
- /**
10
- * deBridge DLN adapter. Same-chain swap uses /chain/transaction; cross-chain
11
- * uses /dln/order/create-tx. Approval is NOT integrated — caller must check
12
- * on-chain allowance against `tx.to` separately.
13
- */
14
- class DebridgeAdapter extends BaseSwapService_1.BaseSwapService {
15
- apiBaseUrl;
16
- accessToken;
17
- constructor(config = {}) {
18
- super(config);
19
- this.apiBaseUrl = config.apiBaseUrl ?? DEFAULT_BASE_URL;
20
- this.accessToken = config.accessToken ?? 'd6c45897b8f6';
21
- }
22
- getProviderName() {
23
- return 'debridge';
24
- }
25
- hasIntegratedApproval() {
26
- return false;
27
- }
28
- async getQuote(params) {
29
- const { srcChainId, srcTokenAddress, srcTokenAmount, dstChainId, dstTokenAddress, recipientAddress, senderAddress, slippage, isCrossChain, } = params;
30
- const crossChain = isCrossChain ?? srcChainId !== dstChainId;
31
- const affiliate = await (0, affiliate_1.getAffiliateFee)(this.getProviderName(), srcChainId);
32
- try {
33
- if (crossChain) {
34
- const query = {
35
- srcChainId: String(srcChainId),
36
- srcChainTokenIn: srcTokenAddress,
37
- srcChainTokenInAmount: srcTokenAmount,
38
- dstChainId: String(dstChainId),
39
- dstChainTokenOut: dstTokenAddress,
40
- dstChainTokenOutRecipient: recipientAddress,
41
- srcChainOrderAuthorityAddress: senderAddress,
42
- dstChainOrderAuthorityAddress: recipientAddress,
43
- accesstoken: this.accessToken,
44
- };
45
- if (affiliate) {
46
- query.affiliateFeeRecipient = affiliate.affiliateFeeRecipient;
47
- query.affiliateFeePercent = affiliate.affiliateFeePercent;
48
- }
49
- const res = await this.get(`${this.apiBaseUrl}/dln/order/create-tx`, query);
50
- if (res.error || res.errorMessage) {
51
- return {
52
- success: false,
53
- error: res.error ?? res.errorMessage,
54
- errorMessage: res.errorMessage ?? 'deBridge quote failed',
55
- };
56
- }
57
- return {
58
- success: true,
59
- provider: 'debridge',
60
- tx: res.tx,
61
- estimation: res.estimation,
62
- isCrossChain: true,
63
- srcChainId,
64
- dstChainId,
65
- raw: res,
66
- };
67
- }
68
- const swapQuery = {
69
- chainId: String(srcChainId),
70
- tokenIn: srcTokenAddress,
71
- tokenInAmount: srcTokenAmount,
72
- tokenOut: dstTokenAddress,
73
- tokenOutRecipient: recipientAddress,
74
- accesstoken: this.accessToken,
75
- };
76
- if (affiliate) {
77
- swapQuery.affiliateFeeRecipient = affiliate.affiliateFeeRecipient;
78
- swapQuery.affiliateFeePercent = affiliate.affiliateFeePercent;
79
- }
80
- if (slippage !== undefined)
81
- swapQuery.slippage = slippage;
82
- const res = await this.get(`${this.apiBaseUrl}/chain/transaction`, swapQuery);
83
- if (res.error || res.errorMessage) {
84
- return {
85
- success: false,
86
- error: res.error ?? res.errorMessage,
87
- errorMessage: res.errorMessage ?? 'deBridge quote failed',
88
- };
89
- }
90
- return {
91
- success: true,
92
- provider: 'debridge',
93
- tx: res.tx,
94
- isCrossChain: false,
95
- srcChainId,
96
- dstChainId: srcChainId,
97
- raw: res,
98
- };
99
- }
100
- catch (error) {
101
- return {
102
- success: false,
103
- error,
104
- errorMessage: error instanceof Error ? error.message : 'Failed to fetch quote',
105
- };
106
- }
107
- }
108
- /**
109
- * deBridge does NOT bundle approval, so the pay token must grant an allowance
110
- * to the swap router — the `to` of the swap tx (`quoteData.tx.to`) — before the
111
- * swap can run. Native coin needs no approval. For an ERC-20 we read the
112
- * on-chain `allowance(userAddress, spender)` and only flag `isNeeded` when the
113
- * current allowance is below `amount` (no redundant approve when already set).
114
- *
115
- * `amount` is the spend in the token's smallest units (wei-equivalent), the
116
- * same value passed as `srcTokenAmount` to the quote.
117
- */
118
- async checkApproval(params) {
119
- const { chain, userAddress, tokenAddress, amount } = params;
120
- const spender = params.quoteData?.tx?.to;
121
- if (!spender) {
122
- return { isNeeded: false, error: 'No contract address found in quote' };
123
- }
124
- // Native coin (zero-address sentinel) is never an ERC-20 — no approval.
125
- if (!tokenAddress || tokenAddress.toLowerCase() === ZERO_ADDRESS) {
126
- return {
127
- isNeeded: false,
128
- integrated: false,
129
- contractAddress: spender,
130
- message: 'Native coin needs no approval.',
131
- };
132
- }
133
- // Read the on-chain allowance(owner, spender) for the pay token.
134
- const allowance = await this.readAllowance(chain, tokenAddress, userAddress, spender);
135
- // Couldn't read it — err on the safe side and require approval so the swap
136
- // doesn't revert. The caller approves `amount` to `spender` on `tokenAddress`.
137
- if (allowance === null) {
138
- return {
139
- isNeeded: true,
140
- integrated: false,
141
- contractAddress: spender,
142
- message: 'Could not read allowance; approval required before the swap.',
143
- };
144
- }
145
- let need;
146
- try {
147
- need = BigInt(amount);
148
- }
149
- catch {
150
- need = 0n;
151
- }
152
- if (allowance >= need) {
153
- return {
154
- isNeeded: false,
155
- integrated: false,
156
- contractAddress: spender,
157
- message: 'Sufficient allowance already granted.',
158
- };
159
- }
160
- return {
161
- isNeeded: true,
162
- integrated: false,
163
- contractAddress: spender,
164
- message: 'Approval required: current allowance is below the swap amount.',
165
- };
166
- }
167
- /**
168
- * Read ERC-20 `allowance(owner, spender)` via the shared RPC client. Returns
169
- * the allowance as a bigint, or `null` when the chain is unknown / the call
170
- * fails / the result can't be parsed. Calldata is the `allowance` selector
171
- * (`0xdd62ed3e`) + two 32-byte-padded addresses.
172
- */
173
- async readAllowance(chain, tokenAddress, owner, spender) {
174
- if (!chain)
175
- return null;
176
- const pad = (addr) => addr.toLowerCase().replace(/^0x/, '').padStart(64, '0');
177
- const data = `0xdd62ed3e${pad(owner)}${pad(spender)}`;
178
- const hex = await (0, rpc_1.ethCallByChain)(chain, tokenAddress, data);
179
- if (typeof hex !== 'string' || !/^0x[0-9a-fA-F]*$/.test(hex) || hex === '0x')
180
- return null;
181
- try {
182
- return BigInt(hex);
183
- }
184
- catch {
185
- return null;
186
- }
187
- }
188
- async executeSwap(params) {
189
- const { quoteData } = params;
190
- return {
191
- success: true,
192
- provider: 'debridge',
193
- txData: quoteData.tx ?? undefined,
194
- estimation: quoteData.estimation,
195
- };
196
- }
197
- async trackTransaction(params) {
198
- const { requestIdOrTxHash } = params;
199
- try {
200
- const orderInfo = await this.get(`${this.apiBaseUrl}/dln/tx/${requestIdOrTxHash}/order-ids`, { accesstoken: this.accessToken });
201
- if (!orderInfo.orderIds?.length) {
202
- return { success: false, status: 'PENDING' };
203
- }
204
- const orderId = orderInfo.orderIds[0];
205
- const orderStatusRes = await this.get(`${this.apiBaseUrl}/dln/order/${orderId}/status`, {
206
- accesstoken: this.accessToken,
207
- });
208
- const status = (orderStatusRes.status ?? '').toUpperCase();
209
- switch (status) {
210
- case 'FULFILLED':
211
- case 'SENTUNLOCK':
212
- case 'CLAIMEDUNLOCK':
213
- return { success: true, status: 'COMPLETED' };
214
- case 'ORDERCANCELLED':
215
- case 'SENTORDERCANCEL':
216
- case 'CLAIMEDORDERCANCEL':
217
- return { success: true, status: 'FAILED' };
218
- default:
219
- return { success: true, status: 'PENDING' };
220
- }
221
- }
222
- catch (error) {
223
- return {
224
- success: false,
225
- status: 'ERROR',
226
- error: error instanceof Error ? error.message : String(error),
227
- };
228
- }
229
- }
230
- async get(url, query) {
231
- const qs = Object.entries(query)
232
- .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`)
233
- .join('&');
234
- const fullUrl = qs ? `${url}?${qs}` : url;
235
- const res = await fetch(fullUrl, {
236
- method: 'GET',
237
- headers: { Accept: 'application/json' },
238
- });
239
- return (await res.json());
240
- }
241
- }
242
- exports.DebridgeAdapter = DebridgeAdapter;
243
- //# sourceMappingURL=DebridgeAdapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DebridgeAdapter.js","sourceRoot":"","sources":["../../../src/services/swap/DebridgeAdapter.ts"],"names":[],"mappings":";;;AAAA,uDAAoD;AACpD,2CAA8C;AAC9C,gCAAwC;AAcxC,MAAM,gBAAgB,GAAG,mCAAmC,CAAC;AAE7D,MAAM,YAAY,GAAG,4CAA4C,CAAC;AAElE;;;;GAIG;AACH,MAAa,eAAgB,SAAQ,iCAAe;IACjC,UAAU,CAAS;IACnB,WAAW,CAAS;IAErC,YAAY,SAA4B,EAAE;QACxC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,gBAAgB,CAAC;QACxD,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,cAAc,CAAC;IAC1D,CAAC;IAED,eAAe;QACb,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,qBAAqB;QACnB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,MAAuB;QACpC,MAAM,EACJ,UAAU,EACV,eAAe,EACf,cAAc,EACd,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,YAAY,GACb,GAAG,MAAM,CAAC;QAEX,MAAM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ACd,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC9D,CAAC;QACJ,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,GAAG,CAAI,GAAW,EAAE,KAAsC;QACtE,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;aAC7B,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aAC5E,IAAI,CAAC,GAAG,CAAC,CAAC;QACb,MAAM,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QAC1C,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,OAAO,EAAE;YAC/B,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;SACxC,CAAC,CAAC;QACH,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAM,CAAC;IACjC,CAAC;CACF;AA7QD,0CA6QC"}
@@ -1,19 +0,0 @@
1
- import { BaseSwapService } from './BaseSwapService';
2
- import type { CheckApprovalParams, CheckApprovalResult, ExecuteSwapParams, ExecuteSwapResult, ProviderName, SwapQuoteParams, SwapQuoteResult, SwapServiceConfig, TrackTransactionParams, TrackTransactionResult } from './types';
3
- /**
4
- * Relay.link adapter. Relay bundles approval + swap into a single quote (one
5
- * "approve" step + one "swap"/"deposit" step), so `hasIntegratedApproval` is true.
6
- */
7
- export declare class RelayAdapter extends BaseSwapService {
8
- private readonly apiBaseUrl;
9
- private readonly apiKey?;
10
- constructor(config?: SwapServiceConfig);
11
- getProviderName(): ProviderName;
12
- hasIntegratedApproval(): boolean;
13
- getQuote(params: SwapQuoteParams): Promise<SwapQuoteResult>;
14
- checkApproval(params: CheckApprovalParams): Promise<CheckApprovalResult>;
15
- executeSwap(params: ExecuteSwapParams): Promise<ExecuteSwapResult>;
16
- trackTransaction(params: TrackTransactionParams): Promise<TrackTransactionResult>;
17
- private request;
18
- }
19
- //# sourceMappingURL=RelayAdapter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RelayAdapter.d.ts","sourceRoot":"","sources":["../../../src/services/swap/RelayAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAuCjB;;;GAGG;AACH,qBAAa,YAAa,SAAQ,eAAe;IAC/C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;gBAErB,MAAM,GAAE,iBAAsB;IAM1C,eAAe,IAAI,YAAY;IAI/B,qBAAqB,IAAI,OAAO;IAI1B,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAiG3D,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAqBxE,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAgBlE,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC;YAuBzE,OAAO;CAuBtB"}