@underscore-finance/sdk 1.2.20-next.0 → 1.2.20-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/.claude/settings.local.json +31 -0
  2. package/.eslintrc.json +27 -0
  3. package/.prettierrc +9 -0
  4. package/.tool-versions +1 -0
  5. package/LICENSE +41 -0
  6. package/LICENSE_DATE.md +34 -0
  7. package/LICENSE_GRANTS.md +33 -0
  8. package/LICENSE_INFO.md +90 -0
  9. package/README.md +116 -17
  10. package/dapp.config.js +154 -0
  11. package/package.json +17 -44
  12. package/src/getSwapInstructions.ts +55 -0
  13. package/src/index.ts +192 -0
  14. package/tsconfig.json +18 -0
  15. package/AGENTS.md +0 -162
  16. package/abis.json +0 -181875
  17. package/addresses.json +0 -76
  18. package/dist/contracts/AaveV3.d.ts +0 -2594
  19. package/dist/contracts/AaveV3.d.ts.map +0 -1
  20. package/dist/contracts/AaveV3.js +0 -3272
  21. package/dist/contracts/AeroClassic.d.ts +0 -2118
  22. package/dist/contracts/AeroClassic.d.ts.map +0 -1
  23. package/dist/contracts/AeroClassic.js +0 -2679
  24. package/dist/contracts/AeroSlipstream.d.ts +0 -2256
  25. package/dist/contracts/AeroSlipstream.d.ts.map +0 -1
  26. package/dist/contracts/AeroSlipstream.js +0 -2848
  27. package/dist/contracts/AgentSenderGeneric.d.ts +0 -4129
  28. package/dist/contracts/AgentSenderGeneric.d.ts.map +0 -1
  29. package/dist/contracts/AgentSenderGeneric.js +0 -5397
  30. package/dist/contracts/AgentSenderSpecial.d.ts +0 -1997
  31. package/dist/contracts/AgentSenderSpecial.d.ts.map +0 -1
  32. package/dist/contracts/AgentSenderSpecial.js +0 -2532
  33. package/dist/contracts/AgentSenderSpecialSigHelper.d.ts +0 -2245
  34. package/dist/contracts/AgentSenderSpecialSigHelper.d.ts.map +0 -1
  35. package/dist/contracts/AgentSenderSpecialSigHelper.js +0 -2971
  36. package/dist/contracts/AgentWrapper.d.ts +0 -2520
  37. package/dist/contracts/AgentWrapper.d.ts.map +0 -1
  38. package/dist/contracts/AgentWrapper.js +0 -3389
  39. package/dist/contracts/AgentWrapperV1.d.ts +0 -3789
  40. package/dist/contracts/AgentWrapperV1.d.ts.map +0 -1
  41. package/dist/contracts/AgentWrapperV1.js +0 -4945
  42. package/dist/contracts/AgentWrapperV2.d.ts +0 -2494
  43. package/dist/contracts/AgentWrapperV2.d.ts.map +0 -1
  44. package/dist/contracts/AgentWrapperV2.js +0 -3354
  45. package/dist/contracts/Appraiser.d.ts +0 -577
  46. package/dist/contracts/Appraiser.d.ts.map +0 -1
  47. package/dist/contracts/Appraiser.js +0 -735
  48. package/dist/contracts/Avantis.d.ts +0 -2606
  49. package/dist/contracts/Avantis.d.ts.map +0 -1
  50. package/dist/contracts/Avantis.js +0 -3282
  51. package/dist/contracts/Billing.d.ts +0 -381
  52. package/dist/contracts/Billing.d.ts.map +0 -1
  53. package/dist/contracts/Billing.js +0 -451
  54. package/dist/contracts/ChequeBook.d.ts +0 -1704
  55. package/dist/contracts/ChequeBook.d.ts.map +0 -1
  56. package/dist/contracts/ChequeBook.js +0 -1922
  57. package/dist/contracts/CompoundV3.d.ts +0 -2622
  58. package/dist/contracts/CompoundV3.d.ts.map +0 -1
  59. package/dist/contracts/CompoundV3.js +0 -3304
  60. package/dist/contracts/ConvertVaultToken.d.ts +0 -64
  61. package/dist/contracts/ConvertVaultToken.d.ts.map +0 -1
  62. package/dist/contracts/ConvertVaultToken.js +0 -75
  63. package/dist/contracts/Curve.d.ts +0 -1107
  64. package/dist/contracts/Curve.d.ts.map +0 -1
  65. package/dist/contracts/Curve.js +0 -1379
  66. package/dist/contracts/DefaultsBase.d.ts +0 -306
  67. package/dist/contracts/DefaultsBase.d.ts.map +0 -1
  68. package/dist/contracts/DefaultsBase.js +0 -331
  69. package/dist/contracts/ERC20.d.ts +0 -288
  70. package/dist/contracts/ERC20.d.ts.map +0 -1
  71. package/dist/contracts/ERC20.js +0 -359
  72. package/dist/contracts/EarnVault.d.ts +0 -1733
  73. package/dist/contracts/EarnVault.d.ts.map +0 -1
  74. package/dist/contracts/EarnVault.js +0 -2235
  75. package/dist/contracts/EarnVaultAgent.d.ts +0 -1033
  76. package/dist/contracts/EarnVaultAgent.d.ts.map +0 -1
  77. package/dist/contracts/EarnVaultAgent.js +0 -1296
  78. package/dist/contracts/EarnVaultAgentSigHelper.d.ts +0 -905
  79. package/dist/contracts/EarnVaultAgentSigHelper.d.ts.map +0 -1
  80. package/dist/contracts/EarnVaultAgentSigHelper.js +0 -1198
  81. package/dist/contracts/Euler.d.ts +0 -2662
  82. package/dist/contracts/Euler.d.ts.map +0 -1
  83. package/dist/contracts/Euler.js +0 -3350
  84. package/dist/contracts/ExtraFi.d.ts +0 -2637
  85. package/dist/contracts/ExtraFi.d.ts.map +0 -1
  86. package/dist/contracts/ExtraFi.js +0 -3323
  87. package/dist/contracts/Fluid.d.ts +0 -2634
  88. package/dist/contracts/Fluid.d.ts.map +0 -1
  89. package/dist/contracts/Fluid.js +0 -3318
  90. package/dist/contracts/FortyAcres.d.ts +0 -2620
  91. package/dist/contracts/FortyAcres.d.ts.map +0 -1
  92. package/dist/contracts/FortyAcres.js +0 -3300
  93. package/dist/contracts/Hatchery.d.ts +0 -392
  94. package/dist/contracts/Hatchery.d.ts.map +0 -1
  95. package/dist/contracts/Hatchery.js +0 -472
  96. package/dist/contracts/Helpers.d.ts +0 -1463
  97. package/dist/contracts/Helpers.d.ts.map +0 -1
  98. package/dist/contracts/Helpers.js +0 -1763
  99. package/dist/contracts/HighCommand.d.ts +0 -2129
  100. package/dist/contracts/HighCommand.d.ts.map +0 -1
  101. package/dist/contracts/HighCommand.js +0 -2429
  102. package/dist/contracts/Kernel.d.ts +0 -387
  103. package/dist/contracts/Kernel.d.ts.map +0 -1
  104. package/dist/contracts/Kernel.js +0 -442
  105. package/dist/contracts/Ledger.d.ts +0 -708
  106. package/dist/contracts/Ledger.d.ts.map +0 -1
  107. package/dist/contracts/Ledger.js +0 -854
  108. package/dist/contracts/LegoBook.d.ts +0 -1463
  109. package/dist/contracts/LegoBook.d.ts.map +0 -1
  110. package/dist/contracts/LegoBook.js +0 -1763
  111. package/dist/contracts/LegoTools.d.ts +0 -1913
  112. package/dist/contracts/LegoTools.d.ts.map +0 -1
  113. package/dist/contracts/LegoTools.js +0 -2402
  114. package/dist/contracts/LevgVault.d.ts +0 -2115
  115. package/dist/contracts/LevgVault.d.ts.map +0 -1
  116. package/dist/contracts/LevgVault.js +0 -2733
  117. package/dist/contracts/LevgVaultAgent.d.ts +0 -1955
  118. package/dist/contracts/LevgVaultAgent.d.ts.map +0 -1
  119. package/dist/contracts/LevgVaultAgent.js +0 -2508
  120. package/dist/contracts/LevgVaultAgentSigHelper.d.ts +0 -2221
  121. package/dist/contracts/LevgVaultAgentSigHelper.d.ts.map +0 -1
  122. package/dist/contracts/LevgVaultAgentSigHelper.js +0 -2963
  123. package/dist/contracts/LevgVaultHelper.d.ts +0 -977
  124. package/dist/contracts/LevgVaultHelper.d.ts.map +0 -1
  125. package/dist/contracts/LevgVaultHelper.js +0 -1289
  126. package/dist/contracts/LevgVaultTools.d.ts +0 -2629
  127. package/dist/contracts/LevgVaultTools.d.ts.map +0 -1
  128. package/dist/contracts/LevgVaultTools.js +0 -3560
  129. package/dist/contracts/LootDistributor.d.ts +0 -1053
  130. package/dist/contracts/LootDistributor.d.ts.map +0 -1
  131. package/dist/contracts/LootDistributor.js +0 -1291
  132. package/dist/contracts/Migrator.d.ts +0 -289
  133. package/dist/contracts/Migrator.d.ts.map +0 -1
  134. package/dist/contracts/Migrator.js +0 -348
  135. package/dist/contracts/MissionControl.d.ts +0 -1405
  136. package/dist/contracts/MissionControl.d.ts.map +0 -1
  137. package/dist/contracts/MissionControl.js +0 -1592
  138. package/dist/contracts/Moonwell.d.ts +0 -2623
  139. package/dist/contracts/Moonwell.d.ts.map +0 -1
  140. package/dist/contracts/Moonwell.js +0 -3304
  141. package/dist/contracts/Morpho.d.ts +0 -2662
  142. package/dist/contracts/Morpho.d.ts.map +0 -1
  143. package/dist/contracts/Morpho.js +0 -3350
  144. package/dist/contracts/Paymaster.d.ts +0 -1714
  145. package/dist/contracts/Paymaster.d.ts.map +0 -1
  146. package/dist/contracts/Paymaster.js +0 -2098
  147. package/dist/contracts/RipeLego.d.ts +0 -2913
  148. package/dist/contracts/RipeLego.d.ts.map +0 -1
  149. package/dist/contracts/RipeLego.js +0 -3643
  150. package/dist/contracts/Sentinel.d.ts +0 -2064
  151. package/dist/contracts/Sentinel.d.ts.map +0 -1
  152. package/dist/contracts/Sentinel.js +0 -2476
  153. package/dist/contracts/SignatureHelper.d.ts +0 -4250
  154. package/dist/contracts/SignatureHelper.d.ts.map +0 -1
  155. package/dist/contracts/SignatureHelper.js +0 -5714
  156. package/dist/contracts/SignatureHelperV1.d.ts +0 -4250
  157. package/dist/contracts/SignatureHelperV1.d.ts.map +0 -1
  158. package/dist/contracts/SignatureHelperV1.js +0 -5714
  159. package/dist/contracts/SkyPsm.d.ts +0 -2667
  160. package/dist/contracts/SkyPsm.d.ts.map +0 -1
  161. package/dist/contracts/SkyPsm.js +0 -3356
  162. package/dist/contracts/Switchboard.d.ts +0 -1483
  163. package/dist/contracts/Switchboard.d.ts.map +0 -1
  164. package/dist/contracts/Switchboard.js +0 -1790
  165. package/dist/contracts/SwitchboardAlpha.d.ts +0 -3161
  166. package/dist/contracts/SwitchboardAlpha.d.ts.map +0 -1
  167. package/dist/contracts/SwitchboardAlpha.js +0 -3771
  168. package/dist/contracts/SwitchboardBravo.d.ts +0 -1591
  169. package/dist/contracts/SwitchboardBravo.d.ts.map +0 -1
  170. package/dist/contracts/SwitchboardBravo.js +0 -1872
  171. package/dist/contracts/SwitchboardCharlie.d.ts +0 -3172
  172. package/dist/contracts/SwitchboardCharlie.d.ts.map +0 -1
  173. package/dist/contracts/SwitchboardCharlie.js +0 -3713
  174. package/dist/contracts/UnderscoreLego.d.ts +0 -2592
  175. package/dist/contracts/UnderscoreLego.d.ts.map +0 -1
  176. package/dist/contracts/UnderscoreLego.js +0 -3264
  177. package/dist/contracts/UndyAero.d.ts +0 -1733
  178. package/dist/contracts/UndyAero.d.ts.map +0 -1
  179. package/dist/contracts/UndyAero.js +0 -2235
  180. package/dist/contracts/UndyBtc.d.ts +0 -1733
  181. package/dist/contracts/UndyBtc.d.ts.map +0 -1
  182. package/dist/contracts/UndyBtc.js +0 -2235
  183. package/dist/contracts/UndyCbeth.d.ts +0 -1733
  184. package/dist/contracts/UndyCbeth.d.ts.map +0 -1
  185. package/dist/contracts/UndyCbeth.js +0 -2235
  186. package/dist/contracts/UndyEth.d.ts +0 -1733
  187. package/dist/contracts/UndyEth.d.ts.map +0 -1
  188. package/dist/contracts/UndyEth.js +0 -2235
  189. package/dist/contracts/UndyEurc.d.ts +0 -1733
  190. package/dist/contracts/UndyEurc.d.ts.map +0 -1
  191. package/dist/contracts/UndyEurc.js +0 -2235
  192. package/dist/contracts/UndyGho.d.ts +0 -1733
  193. package/dist/contracts/UndyGho.d.ts.map +0 -1
  194. package/dist/contracts/UndyGho.js +0 -2235
  195. package/dist/contracts/UndyHq.d.ts +0 -1677
  196. package/dist/contracts/UndyHq.d.ts.map +0 -1
  197. package/dist/contracts/UndyHq.js +0 -2026
  198. package/dist/contracts/UndyRewardsLego.d.ts +0 -1572
  199. package/dist/contracts/UndyRewardsLego.d.ts.map +0 -1
  200. package/dist/contracts/UndyRewardsLego.js +0 -1994
  201. package/dist/contracts/UndyUsd.d.ts +0 -1733
  202. package/dist/contracts/UndyUsd.d.ts.map +0 -1
  203. package/dist/contracts/UndyUsd.js +0 -2235
  204. package/dist/contracts/UndyUsdV2.d.ts +0 -1762
  205. package/dist/contracts/UndyUsdV2.d.ts.map +0 -1
  206. package/dist/contracts/UndyUsdV2.js +0 -2267
  207. package/dist/contracts/UndyUsds.d.ts +0 -1733
  208. package/dist/contracts/UndyUsds.d.ts.map +0 -1
  209. package/dist/contracts/UndyUsds.js +0 -2235
  210. package/dist/contracts/UndyVirtual.d.ts +0 -1762
  211. package/dist/contracts/UndyVirtual.d.ts.map +0 -1
  212. package/dist/contracts/UndyVirtual.js +0 -2267
  213. package/dist/contracts/UniswapV2.d.ts +0 -2118
  214. package/dist/contracts/UniswapV2.d.ts.map +0 -1
  215. package/dist/contracts/UniswapV2.js +0 -2679
  216. package/dist/contracts/UniswapV3.d.ts +0 -2256
  217. package/dist/contracts/UniswapV3.d.ts.map +0 -1
  218. package/dist/contracts/UniswapV3.js +0 -2848
  219. package/dist/contracts/UserWallet.d.ts +0 -2650
  220. package/dist/contracts/UserWallet.d.ts.map +0 -1
  221. package/dist/contracts/UserWallet.js +0 -3520
  222. package/dist/contracts/UserWalletConfig.d.ts +0 -3901
  223. package/dist/contracts/UserWalletConfig.d.ts.map +0 -1
  224. package/dist/contracts/UserWalletConfig.js +0 -4507
  225. package/dist/contracts/UserWalletConfigV1.d.ts +0 -3692
  226. package/dist/contracts/UserWalletConfigV1.d.ts.map +0 -1
  227. package/dist/contracts/UserWalletConfigV1.js +0 -4276
  228. package/dist/contracts/UserWalletSignatureHelper.d.ts +0 -4552
  229. package/dist/contracts/UserWalletSignatureHelper.d.ts.map +0 -1
  230. package/dist/contracts/UserWalletSignatureHelper.js +0 -6123
  231. package/dist/contracts/UserWalletV1.d.ts +0 -2650
  232. package/dist/contracts/UserWalletV1.d.ts.map +0 -1
  233. package/dist/contracts/UserWalletV1.js +0 -3520
  234. package/dist/contracts/VaultRegistry.d.ts +0 -3162
  235. package/dist/contracts/VaultRegistry.d.ts.map +0 -1
  236. package/dist/contracts/VaultRegistry.js +0 -3893
  237. package/dist/contracts/WalletBackpack.d.ts +0 -1248
  238. package/dist/contracts/WalletBackpack.d.ts.map +0 -1
  239. package/dist/contracts/WalletBackpack.js +0 -1519
  240. package/dist/contracts/Wasabi.d.ts +0 -2620
  241. package/dist/contracts/Wasabi.d.ts.map +0 -1
  242. package/dist/contracts/Wasabi.js +0 -3300
  243. package/dist/contracts/index.d.ts +0 -76
  244. package/dist/contracts/index.d.ts.map +0 -1
  245. package/dist/contracts/index.js +0 -79
  246. package/dist/contracts/sdk.d.ts +0 -156
  247. package/dist/contracts/sdk.d.ts.map +0 -1
  248. package/dist/contracts/sdk.js +0 -158
  249. package/dist/getSwapInstructions.d.ts +0 -34
  250. package/dist/getSwapInstructions.d.ts.map +0 -1
  251. package/dist/getSwapInstructions.js +0 -21
  252. package/dist/index.d.ts +0 -135
  253. package/dist/index.d.ts.map +0 -1
  254. package/dist/index.js +0 -137
@@ -0,0 +1,31 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "mcp__dappql__listContracts",
5
+ "mcp__dappql__getContract",
6
+ "mcp__dappql__callRead",
7
+ "mcp__dappql__multicall",
8
+ "mcp__dappql__searchMethods",
9
+ "mcp__dappql__callWrite",
10
+ "mcp__dappql__simulateWrite",
11
+ "Bash(curl *)",
12
+ "Bash(cast keccak *)",
13
+ "Bash(cast sig *)",
14
+ "Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); logs=d.get\\('result',[]\\); print\\('count:',len\\(logs\\)\\); [print\\(l['transactionHash'], l['blockNumber']\\) for l in logs[:20]]\")",
15
+ "Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); logs=d.get\\('result',[]\\); print\\('count:',len\\(logs\\)\\); err=d.get\\('error'\\); print\\('err:',err\\) if err else None; [print\\(l['transactionHash'], l['blockNumber'], l['data'][:10]\\) for l in logs[:10]]\")",
16
+ "Bash(curl -s -X POST https://mainnet.base.org -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"0x2abae0e\",\"toBlock\":\"0x2abd185\",\"topics\":[\"0x0bc9e50671a07e979d2d6f9d5d8aa8ea24bddecb5f91246c157deaca37c2b7a4\"]}],\"id\":1}')",
17
+ "Bash(python3)",
18
+ "Bash(python3 -c ' *)",
19
+ "mcp__dappql__projectInfo",
20
+ "WebSearch",
21
+ "WebFetch(domain:github.com)",
22
+ "WebFetch(domain:www.npmjs.com)",
23
+ "mcp__dappql__getEvents",
24
+ "mcp__dappql__chainState",
25
+ "mcp__dappql__getDappqlReference",
26
+ "WebFetch(domain:docs.underscore.finance)"
27
+ ]
28
+ },
29
+ "enableAllProjectMcpServers": true,
30
+ "enabledMcpjsonServers": ["dappql"]
31
+ }
package/.eslintrc.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "extends": ["universe/web"],
3
+ "rules": {
4
+ "@typescript-eslint/no-unused-vars": "error",
5
+ "@next/next/no-img-element": "off",
6
+ "import/order": [
7
+ "error",
8
+ {
9
+ "alphabetize": {
10
+ "caseInsensitive": true,
11
+ "order": "asc"
12
+ },
13
+ "groups": ["builtin", "external", "internal"],
14
+ "newlines-between": "always",
15
+ "pathGroups": [
16
+ {
17
+ "group": "external",
18
+ "pattern": "{react,react-native,react-dom}",
19
+ "position": "before"
20
+ }
21
+ ],
22
+ "pathGroupsExcludedImportTypes": ["react"]
23
+ }
24
+ ],
25
+ "no-console": "error"
26
+ }
27
+ }
package/.prettierrc ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "bracketSpacing": true,
3
+ "bracketSameLine": true,
4
+ "printWidth": 120,
5
+ "semi": false,
6
+ "singleQuote": true,
7
+ "trailingComma": "all",
8
+ "tabWidth": 2
9
+ }
package/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ nodejs 22.11.0
package/LICENSE ADDED
@@ -0,0 +1,41 @@
1
+ Business Source License 1.1
2
+
3
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
4
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
5
+
6
+ -----------------------------------------------------------------------------
7
+
8
+ Parameters
9
+
10
+ Licensor: Hightop Financial, Inc.
11
+
12
+ Licensed Work: Underscore Protocol
13
+ The Licensed Work is (c) 2025 Hightop Financial, Inc.
14
+
15
+ Additional Use Grant: Any uses listed and defined at
16
+ https://github.com/underscore-finance/underscore/blob/main/LICENSE_GRANTS.md
17
+
18
+ Change Date: The earlier of 2029-03-06 or a date specified at
19
+ https://github.com/underscore-finance/underscore/blob/main/LICENSE_DATE.md
20
+
21
+ Change License: MIT License
22
+
23
+ -----------------------------------------------------------------------------
24
+
25
+ Terms
26
+
27
+ The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
28
+
29
+ Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
30
+
31
+ If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
32
+
33
+ All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
34
+
35
+ You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
36
+
37
+ Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
38
+
39
+ This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License).
40
+
41
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE.
@@ -0,0 +1,34 @@
1
+ # Underscore Protocol - License Change Date
2
+
3
+ This document specifies the Change Date for the Underscore Protocol's Business Source License 1.1 (BUSL-1.1), as referenced in the license terms.
4
+
5
+ ## Current Change Date
6
+
7
+ **March 6, 2029**
8
+
9
+ On this date, the Underscore Protocol codebase will automatically convert from the Business Source License 1.1 to the MIT License.
10
+
11
+ ## Change Date Policy
12
+
13
+ The Change Date represents Hightop Financial, Inc.'s commitment to eventually releasing the protocol under a fully permissive open source license. This date was chosen to balance:
14
+
15
+ 1. Protection of the protocol's early development and ecosystem
16
+ 2. Commitment to open source principles and long-term community ownership
17
+
18
+ ## Governance Authority
19
+
20
+ The Underscore Protocol governance may vote to move the Change Date earlier than the date specified above, but it cannot be moved later.
21
+
22
+ ## Verification
23
+
24
+ To verify this Change Date, please refer to:
25
+
26
+ 1. The LICENSE file in the repository root
27
+ 2. The BUSL_LICENSE file in the licenses directory
28
+ 3. This document (LICENSE_DATE.md)
29
+
30
+ ## Contact
31
+
32
+ For questions about licensing or to inquire about commercial licensing options before the Change Date, please contact:
33
+
34
+ - Email: team@hightop.com
@@ -0,0 +1,33 @@
1
+ # Underscore Protocol - Additional Use Grants
2
+
3
+ This document lists all Additional Use Grants for the Underscore Protocol, as referenced in the Business Source License 1.1 (BUSL-1.1) under which the protocol is licensed.
4
+
5
+ ## Current Additional Use Grants
6
+
7
+ | Date Granted | Entity | Grant Description | Scope | Expiration |
8
+ | ------------ | ------ | --------------------------------------------- | ----- | ---------- |
9
+ | N/A | N/A | No additional use grants have been issued yet | N/A | N/A |
10
+
11
+ ## Grant Process
12
+
13
+ Additional Use Grants are issued through the Underscore governance process. To request an Additional Use Grant:
14
+
15
+ 1. Create a governance proposal specifying your intended use
16
+ 2. Include the specific entity that would receive the grant
17
+ 3. Provide details about the implementation and how it benefits the ecosystem
18
+ 4. Submit the proposal through the governance process
19
+
20
+ ## Grant Terms
21
+
22
+ Each Additional Use Grant will specify:
23
+
24
+ - The entity receiving the grant
25
+ - The specific use cases permitted
26
+ - Any limitations or conditions
27
+ - The duration of the grant (if applicable)
28
+
29
+ ## Contact
30
+
31
+ For questions about Additional Use Grants or to inquire about commercial licensing options, please contact:
32
+
33
+ - Email: team@hightop.com
@@ -0,0 +1,90 @@
1
+ # Underscore Protocol License Information
2
+
3
+ ## Overview
4
+
5
+ Underscore Protocol is licensed under the Business Source License 1.1 (BUSL-1.1). This license was chosen to balance the benefits of open source with protection for the Underscore community and ecosystem.
6
+
7
+ ## License Structure
8
+
9
+ The Underscore Protocol codebase is licensed under two licenses:
10
+
11
+ 1. **Business Source License 1.1 (BUSL-1.1)**: This applies to the core protocol contracts and implementation details.
12
+ 2. **MIT License**: This applies to interfaces and peripheral contracts needed for integration.
13
+
14
+ ## Directory-Specific Licensing
15
+
16
+ ### BUSL-1.1 Licensed Directories and Files
17
+
18
+ The following directories and their contents are licensed under the Business Source License 1.1:
19
+
20
+ - `contracts/core/` - Core protocol implementation
21
+ - `contracts/legos/` - All DeFi protocol integrations (Uniswap, Aave, etc.)
22
+ - `contracts/modules/` - Supporting modules for the core protocol
23
+ - `contracts/oracles/` - Price oracle implementations
24
+
25
+ ### MIT Licensed Directories and Files
26
+
27
+ The following directories and their contents are licensed under the MIT License:
28
+
29
+ - `interfaces/` - All interface definitions
30
+ - `contracts/mock/` - mock contracts for testing
31
+ - `utils/` - Helper utilities needed for integration
32
+
33
+ ## What the BUSL-1.1 Means for You
34
+
35
+ The BUSL-1.1 license:
36
+
37
+ - Allows you to view, modify, and use the code for non-production purposes (development, testing, academic research, personal learning)
38
+ - Restricts production use unless:
39
+ - You receive an Additional Use Grant
40
+ - The Change Date is reached (March 6, 2029, or earlier if specified at https://github.com/underscore-finance/underscore/blob/main/LICENSE_DATE.md)
41
+ - Will automatically convert to the MIT License on the Change Date
42
+
43
+ ## What You Can Do Without Additional Permission
44
+
45
+ - View and study all code
46
+ - Fork the repository
47
+ - Modify the code for non-production use
48
+ - Use the code for development and testing
49
+ - Contribute to the codebase
50
+ - Integrate with the protocol through the MIT-licensed interfaces
51
+
52
+ ## What Requires Additional Permission
53
+
54
+ Production use of BUSL-1.1 licensed code requires one of the following:
55
+
56
+ 1. **Additional Use Grant**: Specific permission for production use, which can be granted through the governance process
57
+ 2. **Commercial License**: A separate license agreement with Hightop Financial, Inc.
58
+ 3. **Wait for the Change Date**: After March 6, 2029 (or an earlier date if specified), the code will be available under the MIT License
59
+
60
+ ## Obtaining an Additional Use Grant
61
+
62
+ Additional Use Grants may be issued through the Underscore governance process. These grants are recorded at https://github.com/underscore-finance/underscore/blob/main/LICENSE_GRANTS.md.
63
+
64
+ To request an Additional Use Grant, check the above file.
65
+
66
+ ## MIT-Licensed Components
67
+
68
+ The following components are licensed under the MIT License to enable integration with the protocol:
69
+
70
+ - Interface definitions (all files in `interfaces/` directory)
71
+ - Mock smart contracts used for testing (all files in `contracts/mock/` directory)
72
+ - Helper utilities (in the `utils/` directory)
73
+
74
+ ## License Verification
75
+
76
+ To verify which license applies to a specific file:
77
+
78
+ 1. Check the directory-specific licensing section in this document
79
+ 2. If the file is in a directory listed under MIT Licensed Directories, it is MIT licensed
80
+ 3. If the file is in a directory listed under BUSL-1.1 Licensed Directories, it is BUSL-1.1 licensed
81
+
82
+ ## Questions and Commercial Licensing
83
+
84
+ For questions about the license or to inquire about commercial licensing options, please contact:
85
+
86
+ - Email: team@hightop.com
87
+
88
+ ## Disclaimer
89
+
90
+ This document is provided for informational purposes only and does not constitute legal advice. You should consult with a lawyer to discuss your specific situation and licensing needs.
package/README.md CHANGED
@@ -1,32 +1,131 @@
1
- # @underscore-finance/sdk
1
+ # Underscore Smart Contracts SDK
2
2
 
3
- SDK for interacting with Underscore Finance Smart Contracts with TypeScript
3
+ A TypeScript SDK for interacting with Underscore's AI-driven smart contracts on Base network. Underscore enables trustless AI agents to operate on your behalf in DeFi—securely, transparently, and within boundaries you define.
4
4
 
5
- ## Install
5
+ ## Key Features
6
+
7
+ - **Non-Custodial**: Retain full control of your assets; only you can transfer or withdraw funds
8
+ - **Granular Control**: Define precise boundaries for AI agent operations
9
+ - **Rule-Based Autonomy**: Smart contracts strictly enforce your parameters
10
+ - **Minimal Trust**: Built on open-source, immutable code
11
+ - **Extensible**: Add new DeFi protocol integrations without migrating funds
12
+ - **Auditability**: Fully transparent, verifiable code
13
+
14
+ ## Installation
6
15
 
7
16
  ```bash
8
- pnpm add @underscore-finance/sdk
17
+ npm install @underscore-finance/sdk viem
18
+ # or
19
+ yarn add @underscore-finance/sdk viem
20
+ ```
21
+
22
+ ## Quick Start
23
+
24
+ ```typescript
25
+ import Underscore from '@underscore-finance/sdk'
26
+ import { createWalletClient, custom } from 'viem'
27
+ import { base } from 'viem/chains'
28
+
29
+ // Initialize SDK = Read mode only
30
+ const underscore = new Underscore()
31
+
32
+ // For AI agent operations, initialize with a wallet client
33
+ const underscore = new Underscore({
34
+ walletClient: createWalletClient({
35
+ chain: base,
36
+ transport: custom(window.ethereum),
37
+ }),
38
+ })
39
+
40
+ // Create an AI Wallet
41
+ const createWallet = async (owner: string, aiAgent: string) => {
42
+ return await underscore.Factory.createUserWallet(
43
+ owner, // Your wallet address
44
+ aiAgent, // AI agent's address
45
+ )
46
+ }
47
+
48
+ // Configure AI permissions
49
+ const configureAgent = async (agent: string, allowedAssets: string[]) => {
50
+ for (const asset of allowedAssets) {
51
+ await underscore.UserWalletConfig.at('0xWalletAddress').addAssetForAgent(agent, asset)
52
+ }
53
+ }
9
54
  ```
10
55
 
11
- ## Use with DappQL MCP
56
+ ## Core Components
57
+
58
+ ### AI Agent System
59
+
60
+ - `AgentFactory` - Deploy and manage AI wallets
61
+ - `AgentTemplate` - Access to AI agent templates
62
+ - `WalletConfig` - Set AI agent permissions and rules
63
+ - `WalletFunds` - Manage wallet assets
64
+ - `LegoHelper` - Set of helper functions to interact with legos
65
+ - `OracleRegistry` - Registry for price feeds
66
+
67
+ ### Protocol Integrations ("Legos")
12
68
 
13
- Once installed, `@dappql/mcp` auto-discovers this package as a plugin and exposes its contracts, ABIs, and SDK to your AI coding agent.
69
+ Modular DeFi integrations your AI can interact with:
14
70
 
15
- ## Use the SDK directly
71
+ - `LegoAaveV3` - Aave V3 lending/borrowing
72
+ - `LegoCompoundV3` - Compound V3 operations
73
+ - `LegoUniswapV3` - Uniswap V3 swaps
74
+ - `LegoCurve` - Curve pool interactions
75
+ - And many more protocol integrations
16
76
 
17
- ```ts
18
- import createSdk from '@underscore-finance/sdk/sdk'
19
- import { createPublicClient, http } from 'viem'
77
+ ### Price Feed Systems
20
78
 
21
- const publicClient = createPublicClient({ transport: http() })
22
- const sdk = createSdk(publicClient)
79
+ Price oracles your AI can reference:
80
+
81
+ - `ChainlinkFeeds` - Chainlink oracle data
82
+ - `PythFeeds` - Pyth Network feeds
83
+ - `StorkFeeds` - Stork protocol data
84
+
85
+ ## Use Cases
86
+
87
+ 1. **Autonomous Yield Farming**
88
+
89
+ - AI monitors lending rates across protocols
90
+ - Automatically shifts funds to optimal yields
91
+ - Operates within your risk parameters
92
+
93
+ 2. **Smart Portfolio Rebalancing**
94
+
95
+ - AI maintains your desired asset ratios
96
+ - Executes trades based on market conditions
97
+ - Respects your defined boundaries
98
+
99
+ 3. **Risk Management**
100
+ - AI monitors on-chain risk indicators
101
+ - Automatically adjusts positions
102
+ - Follows your pre-set safety rules
103
+
104
+ ## Configuration
105
+
106
+ ```typescript
107
+ interface UnderscoreConfig {
108
+ rpcUrl?: string // Custom RPC URL for Base network
109
+ publicClient?: PublicClient // Custom viem public client
110
+ walletClient?: WalletClient // Required for transactions
111
+ }
23
112
  ```
24
113
 
25
- ## Links
114
+ ## Best Practices
115
+
116
+ 1. Always initialize with a wallet client for AI agent operations
117
+ 2. Use custom RPC URLs in production
118
+ 3. Implement comprehensive error handling
119
+ 4. Set clear boundaries for AI agent actions
120
+
121
+ ## Support
122
+
123
+ - GitHub Issues: Technical support and bug reports
124
+ - Discord Community: [Join our Discord](https://discord.gg/Y6PWmndNaC)
125
+ - Developer Support: [Contact our team](https://underscore.fi)
26
126
 
27
- - Website: https://underscore.finance
28
- - Repo: https://github.com/underscore-finance/typescript-sdk
127
+ ## License
29
128
 
30
- ---
129
+ Business Source License 1.1 - This SDK is provided under a commercial license. All rights reserved. Unauthorized copying, modification, distribution, or use of this software is strictly prohibited without a valid license agreement.
31
130
 
32
- Built with [DappQL](https://dappql.com).
131
+ Built by the team at [Hightop](http://hightop.com) + [Ripe](http://ripe.finance)
package/dapp.config.js ADDED
@@ -0,0 +1,154 @@
1
+ import { createRequire } from 'module'
2
+
3
+ const require = createRequire(import.meta.url)
4
+ const Manifest = require('../underscore-protocol/migration_history/base-mainnet/v1.1/current-manifest.json')
5
+
6
+ // These manifest-only entries are not part of the generated SDK surface.
7
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
8
+ const { LevgVaultHelper, '40Acres': FortyAcres, Yo, Tokemak, ...rest } = Manifest.contracts
9
+
10
+ const PROTOCOL_ABI_ALIASES = {
11
+ ERC20: 'Erc20Token',
12
+ FortyAcres: '40Acres',
13
+ }
14
+
15
+ function protocolAbiPath(name) {
16
+ return `../underscore-protocol/scripts/abis/${name}.json`
17
+ }
18
+
19
+ function protocolAbi(name) {
20
+ return require(protocolAbiPath(name))
21
+ }
22
+
23
+ function protocolAbiNameFor(contractName) {
24
+ const protocolName = PROTOCOL_ABI_ALIASES[contractName] ?? contractName
25
+ try {
26
+ require.resolve(protocolAbiPath(protocolName))
27
+ return protocolName
28
+ } catch {
29
+ return undefined
30
+ }
31
+ }
32
+
33
+ function withProtocolAbi(contractName, baseContract = {}, protocolName = protocolAbiNameFor(contractName)) {
34
+ if (!protocolName) return baseContract
35
+ return {
36
+ ...baseContract,
37
+ abi: protocolAbi(protocolName),
38
+ }
39
+ }
40
+
41
+ function withCurrentProtocolAbis(contracts) {
42
+ return Object.fromEntries(
43
+ Object.entries(contracts).map(([contractName, contract]) => [
44
+ contractName,
45
+ withProtocolAbi(contractName, contract),
46
+ ]),
47
+ )
48
+ }
49
+
50
+ function protocolTemplate(name) {
51
+ return {
52
+ isTemplate: true,
53
+ abi: protocolAbi(name),
54
+ }
55
+ }
56
+
57
+ export default {
58
+ name: 'Underscore Finance',
59
+ description: 'Underscore Finance',
60
+ targetPath: './src/contracts',
61
+ chainId: 8453,
62
+ isModule: true,
63
+ isSdk: true,
64
+ package: {
65
+ source: './src',
66
+ protocol: {
67
+ name: 'Underscore Finance',
68
+ description: 'SDK for interacting with Underscore Finance smart contracts',
69
+ website: 'https://underscore.finance',
70
+ repo: 'https://github.com/underscore-finance/typescript-sdk',
71
+ },
72
+ },
73
+ contracts: {
74
+ ...withCurrentProtocolAbis(rest),
75
+ Addys: protocolTemplate('Addys'),
76
+ AgentSenderSpecialAdmin: protocolTemplate('AgentSenderSpecialAdmin'),
77
+ DefaultsLocal: protocolTemplate('DefaultsLocal'),
78
+ EarnVaultWallet: protocolTemplate('EarnVaultWallet'),
79
+ Erc20Token: protocolTemplate('Erc20Token'),
80
+ FortyAcres: withProtocolAbi('FortyAcres', FortyAcres),
81
+ LevgVaultWallet: protocolTemplate('LevgVaultWallet'),
82
+ LocalGov: protocolTemplate('LocalGov'),
83
+ Ownership: protocolTemplate('Ownership'),
84
+ UndyToken: protocolTemplate('UndyToken'),
85
+ VaultErc20Token: protocolTemplate('VaultErc20Token'),
86
+
87
+ // Keep the historical SDK export name while sourcing the current protocol ABI.
88
+ ERC20: protocolTemplate('Erc20Token'),
89
+
90
+ UserWallet: withProtocolAbi('UserWallet', {
91
+ isTemplate: true,
92
+ address: Manifest.contracts.UserWallet.address,
93
+ }),
94
+ UserWalletConfig: withProtocolAbi('UserWalletConfig', {
95
+ isTemplate: true,
96
+ address: Manifest.contracts.UserWalletConfig.address,
97
+ }),
98
+ ChequeBook: withProtocolAbi('ChequeBook', Manifest.contracts.ChequeBook),
99
+
100
+ UserWalletV1: {
101
+ isTemplate: true,
102
+ address: '0x880E453Ec494FB17bffba537BeaB4Cc6CD1B7C12',
103
+ },
104
+ UserWalletConfigV1: {
105
+ isTemplate: true,
106
+ address: '0x0E7064202c4F906Adc4D9F6D3C92470b62F624F1',
107
+ },
108
+ AgentWrapperV1: {
109
+ isTemplate: true,
110
+ address: '0x9d3F593380875860cC18F5736373ae4B084Ba2F9',
111
+ },
112
+ AgentWrapperV2: {
113
+ isTemplate: true,
114
+ address: '0x761fCDFfF8B187901eA11415237632A3F7E0203B',
115
+ },
116
+ AgentWrapper: withProtocolAbi('AgentWrapper', {
117
+ isTemplate: true,
118
+ ...Manifest.contracts.AgentWrapper,
119
+ }),
120
+ SignatureHelperV1: {
121
+ address: '0x7a938DEd840172e89ef3B90039959E51C1dC6893',
122
+ isTemplate: true,
123
+ ...Manifest.contracts.SignatureHelper,
124
+ },
125
+ UserWalletSignatureHelper: withProtocolAbi('UserWalletSignatureHelper', {
126
+ isTemplate: true,
127
+ ...Manifest.contracts.UserWalletSignatureHelper,
128
+ }),
129
+ AgentSenderSpecialSigHelper: withProtocolAbi('AgentSenderSpecialSigHelper', {
130
+ isTemplate: true,
131
+ ...Manifest.contracts.AgentSenderSpecialSigHelper,
132
+ }),
133
+ AgentSenderSpecial: withProtocolAbi('AgentSenderSpecial', {
134
+ isTemplate: true,
135
+ ...Manifest.contracts.AgentSenderSpecial,
136
+ }),
137
+ AgentSenderGeneric: withProtocolAbi('AgentSenderGeneric', {
138
+ isTemplate: true,
139
+ ...Manifest.contracts.AgentSenderGeneric,
140
+ }),
141
+ EarnVault: withProtocolAbi('EarnVault', {
142
+ isTemplate: true,
143
+ address: Manifest.contracts.UndyUsd.address,
144
+ }),
145
+ LevgVault: withProtocolAbi('LevgVault', {
146
+ isTemplate: true,
147
+ address: '0x936c3C493Dc45D0f4D2FA36C7640f3BCABd64B4B',
148
+ }),
149
+ LevgVaultHelper: withProtocolAbi('LevgVaultHelper', {
150
+ ...LevgVaultHelper,
151
+ isTemplate: true,
152
+ }),
153
+ },
154
+ }
package/package.json CHANGED
@@ -1,58 +1,31 @@
1
1
  {
2
2
  "name": "@underscore-finance/sdk",
3
- "version": "1.2.20-next.0",
3
+ "version": "1.2.20-next.1",
4
4
  "description": "SDK for interacting with Underscore Finance Smart Contracts with TypeScript",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "import": "./dist/index.js",
11
- "types": "./dist/index.d.ts"
12
- },
13
- "./contracts": {
14
- "import": "./dist/contracts/index.js",
15
- "types": "./dist/contracts/index.d.ts"
16
- },
17
- "./sdk": {
18
- "import": "./dist/contracts/sdk.js",
19
- "types": "./dist/contracts/sdk.d.ts"
20
- },
21
- "./abis": "./abis.json",
22
- "./addresses": "./addresses.json",
23
- "./agents": "./AGENTS.md"
5
+ "scripts": {
6
+ "dev": "dappql",
7
+ "pack": "dappql pack",
8
+ "ship": "npm run pack && cd dappql-package && npm publish --access public && cd .. && bump patch --commit --push",
9
+ "test": "echo \"Error: no test specified\" && exit 1"
24
10
  },
25
- "files": [
26
- "dist",
27
- "abis.json",
28
- "addresses.json",
29
- "AGENTS.md",
30
- "README.md"
31
- ],
32
- "license": "BSL-1.0",
33
- "author": "Underscore Finance",
34
11
  "keywords": [],
12
+ "author": "Underscore Finance",
13
+ "license": "BSL-1.0",
35
14
  "bugs": {
36
15
  "url": "https://github.com/underscore-finance/sdk/issues"
37
16
  },
38
17
  "homepage": "https://github.com/underscore-finance/sdk#readme",
18
+ "type": "module",
19
+ "devDependencies": {
20
+ "dappql": "^2.1.2",
21
+ "eslint": "^8.57.1",
22
+ "eslint-config-universe": "^14.0.0",
23
+ "prettier": "^3.5.3",
24
+ "typescript": "^5.8.2",
25
+ "version-bump-prompt": "^6.1.0"
26
+ },
39
27
  "dependencies": {
40
28
  "@dappql/async": "^1.1.3",
41
29
  "viem": "^2.23.7"
42
- },
43
- "dappql": {
44
- "manifestVersion": 1,
45
- "chainId": 8453,
46
- "protocol": {
47
- "name": "Underscore Finance",
48
- "description": "SDK for interacting with Underscore Finance smart contracts",
49
- "website": "https://underscore.finance",
50
- "repo": "https://github.com/underscore-finance/typescript-sdk"
51
- },
52
- "contracts": "./dist/contracts/index.js",
53
- "sdk": "./dist/contracts/sdk.js",
54
- "abis": "./abis.json",
55
- "addresses": "./addresses.json",
56
- "agents": "./AGENTS.md"
57
30
  }
58
31
  }