@oakagentkit/core 0.3.4 → 0.3.6

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 (564) hide show
  1. package/build/dist/api/addresses.d.ts +14 -0
  2. package/build/dist/api/addresses.js +1 -1
  3. package/build/dist/api/chain.js +1 -1
  4. package/build/dist/api/history.d.ts +2 -0
  5. package/build/dist/api/history.js +1 -1
  6. package/build/dist/api/identity-link.js +1 -1
  7. package/build/dist/api/metadata.js +1 -1
  8. package/build/dist/api/modules/beefy/boosts.js +1 -1
  9. package/build/dist/api/modules/beefy/clm.js +1 -1
  10. package/build/dist/api/modules/beefy/guard.js +1 -1
  11. package/build/dist/api/modules/beefy/index.js +1 -1
  12. package/build/dist/api/modules/beefy/liquidity.js +1 -1
  13. package/build/dist/api/modules/beefy/management.js +1 -1
  14. package/build/dist/api/modules/beefy/vaults.js +1 -1
  15. package/build/dist/api/modules/borro/actions.js +1 -1
  16. package/build/dist/api/modules/borro/index.js +1 -1
  17. package/build/dist/api/modules/borro/liquidity.js +1 -1
  18. package/build/dist/api/modules/borro/positions.js +1 -1
  19. package/build/dist/api/modules/borro/reader.js +1 -1
  20. package/build/dist/api/modules/chop/actions.d.ts +13 -1
  21. package/build/dist/api/modules/chop/actions.js +1 -1
  22. package/build/dist/api/modules/chop/checks.js +1 -1
  23. package/build/dist/api/modules/chop/copy.d.ts +1 -0
  24. package/build/dist/api/modules/chop/copy.js +1 -1
  25. package/build/dist/api/modules/chop/display.d.ts +36 -0
  26. package/build/dist/api/modules/chop/display.js +1 -0
  27. package/build/dist/api/modules/chop/guard.js +1 -1
  28. package/build/dist/api/modules/chop/index.js +1 -1
  29. package/build/dist/api/modules/chop/pins.d.ts +1 -0
  30. package/build/dist/api/modules/chop/pins.js +1 -1
  31. package/build/dist/api/modules/chop/positions.js +1 -1
  32. package/build/dist/api/modules/chop/reader.d.ts +6 -1
  33. package/build/dist/api/modules/chop/reader.js +1 -1
  34. package/build/dist/api/modules/chop/types.d.ts +7 -0
  35. package/build/dist/api/modules/chop/unfarm.d.ts +16 -0
  36. package/build/dist/api/modules/chop/unfarm.js +1 -0
  37. package/build/dist/api/modules/clanker/extensions.js +1 -1
  38. package/build/dist/api/modules/clanker/index.js +1 -1
  39. package/build/dist/api/modules/clanker/manage.js +1 -1
  40. package/build/dist/api/modules/clanker/pool-config.js +1 -1
  41. package/build/dist/api/modules/clanker/protocol.js +1 -1
  42. package/build/dist/api/modules/clanker/state.js +1 -1
  43. package/build/dist/api/modules/earn/index.js +1 -1
  44. package/build/dist/api/modules/erc8004/common.js +1 -1
  45. package/build/dist/api/modules/erc8004/domain.js +1 -1
  46. package/build/dist/api/modules/erc8004/index.js +1 -1
  47. package/build/dist/api/modules/erc8004/management.js +1 -1
  48. package/build/dist/api/modules/erc8004/reputation.js +1 -1
  49. package/build/dist/api/modules/erc8004/services.js +1 -1
  50. package/build/dist/api/modules/erc8004/thesis.js +1 -1
  51. package/build/dist/api/modules/erc8004/validation.js +1 -1
  52. package/build/dist/api/modules/factor/actions.js +1 -1
  53. package/build/dist/api/modules/factor/api.js +1 -1
  54. package/build/dist/api/modules/factor/checks.js +1 -1
  55. package/build/dist/api/modules/factor/copy.d.ts +11 -11
  56. package/build/dist/api/modules/factor/copy.js +1 -1
  57. package/build/dist/api/modules/factor/guard.js +1 -1
  58. package/build/dist/api/modules/factor/index.js +1 -1
  59. package/build/dist/api/modules/factor/reader.js +1 -1
  60. package/build/dist/api/modules/fobo/client.js +1 -1
  61. package/build/dist/api/modules/fobo/index.js +1 -1
  62. package/build/dist/api/modules/fobo/intent.js +1 -1
  63. package/build/dist/api/modules/fobo/steps.js +1 -1
  64. package/build/dist/api/modules/fobo/verify.js +1 -1
  65. package/build/dist/api/modules/gloam/index.js +1 -1
  66. package/build/dist/api/modules/grove/index.js +1 -1
  67. package/build/dist/api/modules/heyresearch/builder-feed.js +1 -1
  68. package/build/dist/api/modules/heyresearch/index.js +1 -1
  69. package/build/dist/api/modules/heyresearch/public-reads.js +1 -1
  70. package/build/dist/api/modules/heyresearch/scan.js +1 -1
  71. package/build/dist/api/modules/heyresearch/token-facts.js +1 -1
  72. package/build/dist/api/modules/hoodag/chain-reads.js +1 -1
  73. package/build/dist/api/modules/hoodag/index.js +1 -1
  74. package/build/dist/api/modules/hoodag/management.js +1 -1
  75. package/build/dist/api/modules/hoodag/public-reads.js +1 -1
  76. package/build/dist/api/modules/hoodag/reconstruct.js +1 -1
  77. package/build/dist/api/modules/hoodlock/airdrop.js +1 -1
  78. package/build/dist/api/modules/hoodlock/buyback.js +1 -1
  79. package/build/dist/api/modules/hoodlock/commerce.js +1 -1
  80. package/build/dist/api/modules/hoodlock/fee.js +1 -1
  81. package/build/dist/api/modules/hoodlock/guard.js +1 -1
  82. package/build/dist/api/modules/hoodlock/index.js +1 -1
  83. package/build/dist/api/modules/hoodlock/lifecycle.js +1 -1
  84. package/build/dist/api/modules/hoodlock/locks-burn.js +1 -1
  85. package/build/dist/api/modules/hoodlock/public.js +1 -1
  86. package/build/dist/api/modules/hookr/actions.d.ts +39 -2
  87. package/build/dist/api/modules/hookr/actions.js +1 -1
  88. package/build/dist/api/modules/hookr/addons.js +1 -1
  89. package/build/dist/api/modules/hookr/agent-gate.d.ts +14 -2
  90. package/build/dist/api/modules/hookr/agent-gate.js +1 -1
  91. package/build/dist/api/modules/hookr/agent-link.d.ts +17 -0
  92. package/build/dist/api/modules/hookr/agent-link.js +1 -0
  93. package/build/dist/api/modules/hookr/api-client.d.ts +9 -0
  94. package/build/dist/api/modules/hookr/api-client.js +1 -0
  95. package/build/dist/api/modules/hookr/blocks/advisory.d.ts +41 -0
  96. package/build/dist/api/modules/hookr/blocks/advisory.js +1 -0
  97. package/build/dist/api/modules/hookr/blocks/buy-sell-block.d.ts +7 -0
  98. package/build/dist/api/modules/hookr/blocks/buy-sell-block.js +1 -0
  99. package/build/dist/api/modules/hookr/blocks/core-settings.d.ts +6 -0
  100. package/build/dist/api/modules/hookr/blocks/core-settings.js +1 -0
  101. package/build/dist/api/modules/hookr/blocks/exit-clock.d.ts +14 -0
  102. package/build/dist/api/modules/hookr/blocks/exit-clock.js +1 -0
  103. package/build/dist/api/modules/hookr/blocks/holder-pot.d.ts +30 -0
  104. package/build/dist/api/modules/hookr/blocks/holder-pot.js +1 -0
  105. package/build/dist/api/modules/hookr/blocks/managed-fee.d.ts +96 -0
  106. package/build/dist/api/modules/hookr/blocks/managed-fee.js +1 -0
  107. package/build/dist/api/modules/hookr/blocks/market-guard.d.ts +116 -0
  108. package/build/dist/api/modules/hookr/blocks/market-guard.js +1 -0
  109. package/build/dist/api/modules/hookr/blocks/market-hours-fee.d.ts +87 -0
  110. package/build/dist/api/modules/hookr/blocks/market-hours-fee.js +1 -0
  111. package/build/dist/api/modules/hookr/blocks/pay-later.d.ts +199 -0
  112. package/build/dist/api/modules/hookr/blocks/pay-later.js +1 -0
  113. package/build/dist/api/modules/hookr/blocks/sandwich-guard.d.ts +3 -0
  114. package/build/dist/api/modules/hookr/blocks/sandwich-guard.js +1 -0
  115. package/build/dist/api/modules/hookr/blocks/storm-fee.d.ts +3 -0
  116. package/build/dist/api/modules/hookr/blocks/storm-fee.js +1 -0
  117. package/build/dist/api/modules/hookr/blocks/swap-cut.d.ts +3 -0
  118. package/build/dist/api/modules/hookr/blocks/swap-cut.js +1 -0
  119. package/build/dist/api/modules/hookr/blocks/swap-reward-mint.d.ts +125 -0
  120. package/build/dist/api/modules/hookr/blocks/swap-reward-mint.js +1 -0
  121. package/build/dist/api/modules/hookr/blocks/wallet-cap.d.ts +3 -0
  122. package/build/dist/api/modules/hookr/blocks/wallet-cap.js +1 -0
  123. package/build/dist/api/modules/hookr/blocks/zap-source.d.ts +161 -0
  124. package/build/dist/api/modules/hookr/blocks/zap-source.js +1 -0
  125. package/build/dist/api/modules/hookr/blocks/zap-target.d.ts +51 -0
  126. package/build/dist/api/modules/hookr/blocks/zap-target.js +1 -0
  127. package/build/dist/api/modules/hookr/claims.d.ts +53 -0
  128. package/build/dist/api/modules/hookr/claims.js +1 -0
  129. package/build/dist/api/modules/hookr/contracts.d.ts +3 -1
  130. package/build/dist/api/modules/hookr/contracts.js +1 -1
  131. package/build/dist/api/modules/hookr/create-cancel.js +1 -1
  132. package/build/dist/api/modules/hookr/discovery.d.ts +2 -2
  133. package/build/dist/api/modules/hookr/discovery.js +1 -1
  134. package/build/dist/api/modules/hookr/fill-bounty.d.ts +2 -0
  135. package/build/dist/api/modules/hookr/fill-bounty.js +1 -1
  136. package/build/dist/api/modules/hookr/gas.d.ts +48 -0
  137. package/build/dist/api/modules/hookr/gas.js +1 -0
  138. package/build/dist/api/modules/hookr/gates.d.ts +51 -0
  139. package/build/dist/api/modules/hookr/gates.js +1 -0
  140. package/build/dist/api/modules/hookr/hook-blocks.d.ts +304 -0
  141. package/build/dist/api/modules/hookr/hook-blocks.js +1 -0
  142. package/build/dist/api/modules/hookr/index.d.ts +4 -2
  143. package/build/dist/api/modules/hookr/index.js +1 -1
  144. package/build/dist/api/modules/hookr/jobs.d.ts +7 -0
  145. package/build/dist/api/modules/hookr/jobs.js +1 -0
  146. package/build/dist/api/modules/hookr/launch-options.d.ts +52 -3
  147. package/build/dist/api/modules/hookr/launch-options.js +1 -1
  148. package/build/dist/api/modules/hookr/launch-profile.d.ts +8 -0
  149. package/build/dist/api/modules/hookr/launch-profile.js +1 -1
  150. package/build/dist/api/modules/hookr/launch-receipt.js +1 -1
  151. package/build/dist/api/modules/hookr/launch.d.ts +24 -0
  152. package/build/dist/api/modules/hookr/launch.js +1 -1
  153. package/build/dist/api/modules/hookr/liquidity.js +1 -1
  154. package/build/dist/api/modules/hookr/lp-positions.js +1 -1
  155. package/build/dist/api/modules/hookr/lp-reads.js +1 -1
  156. package/build/dist/api/modules/hookr/lp-receipt.js +1 -1
  157. package/build/dist/api/modules/hookr/lp-state.d.ts +90 -2
  158. package/build/dist/api/modules/hookr/lp-state.js +1 -1
  159. package/build/dist/api/modules/hookr/pay-later-actions.d.ts +52 -0
  160. package/build/dist/api/modules/hookr/pay-later-actions.js +1 -0
  161. package/build/dist/api/modules/hookr/pins.d.ts +5 -0
  162. package/build/dist/api/modules/hookr/pins.js +1 -1
  163. package/build/dist/api/modules/hookr/pm-liquidity.d.ts +215 -0
  164. package/build/dist/api/modules/hookr/pm-liquidity.js +1 -0
  165. package/build/dist/api/modules/hookr/public-reads.d.ts +1 -1
  166. package/build/dist/api/modules/hookr/public-reads.js +1 -1
  167. package/build/dist/api/modules/hookr/read-utils.js +1 -1
  168. package/build/dist/api/modules/hookr/relay.js +1 -1
  169. package/build/dist/api/modules/hookr/revenue.d.ts +4 -1
  170. package/build/dist/api/modules/hookr/revenue.js +1 -1
  171. package/build/dist/api/modules/hookr/scan.d.ts +25 -0
  172. package/build/dist/api/modules/hookr/scan.js +1 -0
  173. package/build/dist/api/modules/hookr/swap.d.ts +161 -0
  174. package/build/dist/api/modules/hookr/swap.js +1 -0
  175. package/build/dist/api/modules/kyberswap/index.js +1 -1
  176. package/build/dist/api/modules/kyberswap/source-pools.js +1 -1
  177. package/build/dist/api/modules/layerbank/abi.js +1 -1
  178. package/build/dist/api/modules/layerbank/actions.js +1 -1
  179. package/build/dist/api/modules/layerbank/checks.js +1 -1
  180. package/build/dist/api/modules/layerbank/index.js +1 -1
  181. package/build/dist/api/modules/layerbank/merkl.js +1 -1
  182. package/build/dist/api/modules/layerbank/reader.js +1 -1
  183. package/build/dist/api/modules/layerbank/reserve.js +1 -1
  184. package/build/dist/api/modules/lighter/index.js +1 -1
  185. package/build/dist/api/modules/longbow/administration.js +1 -1
  186. package/build/dist/api/modules/longbow/analytics.js +1 -1
  187. package/build/dist/api/modules/longbow/fixed.js +1 -1
  188. package/build/dist/api/modules/longbow/index.js +1 -1
  189. package/build/dist/api/modules/longbow/nft.js +1 -1
  190. package/build/dist/api/modules/longbow/rebates.js +1 -1
  191. package/build/dist/api/modules/longbow/staking.js +1 -1
  192. package/build/dist/api/modules/meridian/index.js +1 -1
  193. package/build/dist/api/modules/meridian/markets.js +1 -1
  194. package/build/dist/api/modules/meridian/rfq.js +1 -1
  195. package/build/dist/api/modules/merkl/discovery.js +1 -1
  196. package/build/dist/api/modules/merkl/index.js +1 -1
  197. package/build/dist/api/modules/merkl/manage.js +1 -1
  198. package/build/dist/api/modules/merkl/protocol.js +1 -1
  199. package/build/dist/api/modules/morpho/allocator.js +1 -1
  200. package/build/dist/api/modules/morpho/bundles.js +1 -1
  201. package/build/dist/api/modules/morpho/in-kind.js +1 -1
  202. package/build/dist/api/modules/morpho/index.js +1 -1
  203. package/build/dist/api/modules/morpho/local-guard.js +1 -1
  204. package/build/dist/api/modules/morpho/midnight.js +1 -1
  205. package/build/dist/api/modules/morpho/protocol.js +1 -1
  206. package/build/dist/api/modules/morpho/vault-management.js +1 -1
  207. package/build/dist/api/modules/morpho/vault-tools.js +1 -1
  208. package/build/dist/api/modules/morpho/vault-v2.js +1 -1
  209. package/build/dist/api/modules/netnet/card-plan.js +1 -1
  210. package/build/dist/api/modules/netnet/card-read.js +1 -1
  211. package/build/dist/api/modules/netnet/card-recovery.js +1 -1
  212. package/build/dist/api/modules/netnet/desk-action.js +1 -1
  213. package/build/dist/api/modules/netnet/desk-read.js +1 -1
  214. package/build/dist/api/modules/netnet/financial.js +1 -1
  215. package/build/dist/api/modules/netnet/index.js +1 -1
  216. package/build/dist/api/modules/netnet/staking.js +1 -1
  217. package/build/dist/api/modules/orbio/index.js +1 -1
  218. package/build/dist/api/modules/orbio/positions.js +1 -1
  219. package/build/dist/api/modules/pendle/costs.js +1 -1
  220. package/build/dist/api/modules/pendle/index.js +1 -1
  221. package/build/dist/api/modules/pendle/markets.js +1 -1
  222. package/build/dist/api/modules/pendle/positions.js +1 -1
  223. package/build/dist/api/modules/pendle/pricecheck.js +1 -1
  224. package/build/dist/api/modules/pendle/reader.js +1 -1
  225. package/build/dist/api/modules/pendle/redeem.js +1 -1
  226. package/build/dist/api/modules/pendle/trade.js +1 -1
  227. package/build/dist/api/modules/pendle/validate.js +1 -1
  228. package/build/dist/api/modules/pendle/verify.js +1 -1
  229. package/build/dist/api/modules/pons/claim.js +1 -1
  230. package/build/dist/api/modules/pons/index.js +1 -1
  231. package/build/dist/api/modules/pons/launch-status.js +1 -1
  232. package/build/dist/api/modules/pons/prices.js +1 -1
  233. package/build/dist/api/modules/pons/reads.js +1 -1
  234. package/build/dist/api/modules/pons/swap-terms.js +1 -1
  235. package/build/dist/api/modules/pons/trade.js +1 -1
  236. package/build/dist/api/modules/poolstrade/index.js +1 -1
  237. package/build/dist/api/modules/priors/coverage.js +1 -1
  238. package/build/dist/api/modules/priors/discovery.js +1 -1
  239. package/build/dist/api/modules/priors/features.js +1 -1
  240. package/build/dist/api/modules/priors/holdings.js +1 -1
  241. package/build/dist/api/modules/priors/index.js +1 -1
  242. package/build/dist/api/modules/priors/integration.js +1 -1
  243. package/build/dist/api/modules/priors/market.js +1 -1
  244. package/build/dist/api/modules/priors/pt.js +1 -1
  245. package/build/dist/api/modules/priors/savings-exit.js +1 -1
  246. package/build/dist/api/modules/priors/starter-line.js +1 -1
  247. package/build/dist/api/modules/priors/stock-swap.js +1 -1
  248. package/build/dist/api/modules/raeto/index.js +1 -1
  249. package/build/dist/api/modules/relay/bootstrap.js +1 -1
  250. package/build/dist/api/modules/relay/discovery.js +1 -1
  251. package/build/dist/api/modules/relay/inbound.js +1 -1
  252. package/build/dist/api/modules/relay/index.js +1 -1
  253. package/build/dist/api/modules/relay/outbound-status.js +1 -1
  254. package/build/dist/api/modules/relay/reads.js +1 -1
  255. package/build/dist/api/modules/spark/actions.js +1 -1
  256. package/build/dist/api/modules/spark/details.js +1 -1
  257. package/build/dist/api/modules/spark/index.js +1 -1
  258. package/build/dist/api/modules/spark/management.js +1 -1
  259. package/build/dist/api/modules/steakhouse/analytics.js +1 -1
  260. package/build/dist/api/modules/steakhouse/erc4626.js +1 -1
  261. package/build/dist/api/modules/steakhouse/index.js +1 -1
  262. package/build/dist/api/modules/steakhouse/local-guard.js +1 -1
  263. package/build/dist/api/modules/steakhouse/management.js +1 -1
  264. package/build/dist/api/modules/steakhouse/v2-exit.js +1 -1
  265. package/build/dist/api/modules/tickerspring/basket-routes.js +1 -1
  266. package/build/dist/api/modules/tickerspring/contract-reads.js +1 -1
  267. package/build/dist/api/modules/tickerspring/discovery.js +1 -1
  268. package/build/dist/api/modules/tickerspring/exit-preview.js +1 -1
  269. package/build/dist/api/modules/tickerspring/guards.js +1 -1
  270. package/build/dist/api/modules/tickerspring/index.js +1 -1
  271. package/build/dist/api/modules/tickerspring/journeys.js +1 -1
  272. package/build/dist/api/modules/tickerspring/ladder.js +1 -1
  273. package/build/dist/api/modules/tickerspring/maker.js +1 -1
  274. package/build/dist/api/modules/tickerspring/order-accounting.js +1 -1
  275. package/build/dist/api/modules/tickerspring/research.js +1 -1
  276. package/build/dist/api/modules/tickerspring/strategies.js +1 -1
  277. package/build/dist/api/modules/uniswap/auction-create.js +1 -1
  278. package/build/dist/api/modules/uniswap/auction.js +1 -1
  279. package/build/dist/api/modules/uniswap/batch.js +1 -1
  280. package/build/dist/api/modules/uniswap/common.js +1 -1
  281. package/build/dist/api/modules/uniswap/fees.js +1 -1
  282. package/build/dist/api/modules/uniswap/index.js +1 -1
  283. package/build/dist/api/modules/uniswap/local-guard.js +1 -1
  284. package/build/dist/api/modules/uniswap/oracle.js +1 -1
  285. package/build/dist/api/modules/uniswap/pool-math.js +1 -1
  286. package/build/dist/api/modules/uniswap/pools.js +1 -1
  287. package/build/dist/api/modules/uniswap/position.js +1 -1
  288. package/build/dist/api/modules/uniswap/protocol.js +1 -1
  289. package/build/dist/api/modules/uniswap/quote-guard.js +1 -1
  290. package/build/dist/api/modules/uniswap/stock-prices.d.ts +25 -0
  291. package/build/dist/api/modules/uniswap/stock-prices.js +1 -1
  292. package/build/dist/api/modules/uniswap/stocks.js +1 -1
  293. package/build/dist/api/modules/uniswap/token-jar.js +1 -1
  294. package/build/dist/api/modules/uniswap/trade-batch.js +1 -1
  295. package/build/dist/api/modules/uniswap/trade.js +1 -1
  296. package/build/dist/api/modules/uniswap/v2.js +1 -1
  297. package/build/dist/api/modules/uniswap/v3.js +1 -1
  298. package/build/dist/api/modules/uniswap/v4.js +1 -1
  299. package/build/dist/api/modules/uniswap/wrap.js +1 -1
  300. package/build/dist/api/modules/velora/claims.js +1 -1
  301. package/build/dist/api/modules/velora/delta-reads.js +1 -1
  302. package/build/dist/api/modules/velora/index.js +1 -1
  303. package/build/dist/api/modules/wormhole/index.js +1 -1
  304. package/build/dist/api/modules/wormhole/scan-text.d.ts +1 -1
  305. package/build/dist/api/positions.js +1 -1
  306. package/build/dist/api/pricenote.js +1 -1
  307. package/build/dist/api/prices.d.ts +5 -0
  308. package/build/dist/api/prices.js +1 -1
  309. package/build/dist/api/rpc.js +1 -1
  310. package/build/dist/api/send.js +1 -1
  311. package/build/dist/api/signing-registry.js +1 -1
  312. package/build/dist/api/signing.js +1 -1
  313. package/build/dist/api/simulate.js +1 -1
  314. package/build/dist/api/swap.d.ts +2 -0
  315. package/build/dist/api/swap.js +1 -1
  316. package/build/dist/api/tokens.d.ts +10 -1
  317. package/build/dist/api/tokens.js +1 -1
  318. package/build/dist/api/tool-policy.js +1 -1
  319. package/build/dist/api/universal-router.js +1 -1
  320. package/build/dist/api/usd-estimate.d.ts +2 -0
  321. package/build/dist/api/usd-estimate.js +1 -1
  322. package/build/dist/chunks/{DMDOSHV7.js → 266VIESP.js} +1 -1
  323. package/build/dist/chunks/{KNBNKG7P.js → 2BKZLF5A.js} +1 -1
  324. package/build/dist/chunks/{HFVXNKA5.js → 2BM2WX2G.js} +1 -1
  325. package/build/dist/chunks/{OY5W7ZSL.js → 2H2OZE6X.js} +1 -1
  326. package/build/dist/chunks/{E76Z2TT4.js → 2QQ5CGQI.js} +1 -1
  327. package/build/dist/chunks/{4PLLS6CT.js → 2VYA6WIN.js} +1 -1
  328. package/build/dist/chunks/{LCH6F5HT.js → 342OZP53.js} +1 -1
  329. package/build/dist/chunks/{FQTO7VJG.js → 3HF6WE4L.js} +1 -1
  330. package/build/dist/chunks/3M7RMROZ.js +1 -0
  331. package/build/dist/chunks/3RGED2KO.js +1 -0
  332. package/build/dist/chunks/{RUSXMQSJ.js → 3XIJCHT7.js} +1 -1
  333. package/build/dist/chunks/3XY44BP5.js +1 -0
  334. package/build/dist/chunks/3YNXQ3EZ.js +1 -0
  335. package/build/dist/chunks/45QP74CE.js +1 -0
  336. package/build/dist/chunks/{NYHKIXJR.js → 4GAU3JLN.js} +1 -1
  337. package/build/dist/chunks/{Y2QADJOB.js → 4P6DRKY3.js} +1 -1
  338. package/build/dist/chunks/{W3DGFMQE.js → 4RTXP2YP.js} +1 -1
  339. package/build/dist/chunks/{7FYM7FJA.js → 4SXRXNHG.js} +1 -1
  340. package/build/dist/chunks/{ZTKT3ZQK.js → 53VBLEYS.js} +1 -1
  341. package/build/dist/chunks/5677LZOV.js +1 -0
  342. package/build/dist/chunks/{ADIPEGNN.js → 5AO2QPWE.js} +1 -1
  343. package/build/dist/chunks/{GQITAJVF.js → 5BPFF7NX.js} +1 -1
  344. package/build/dist/chunks/{PXUML7HJ.js → 5DWQUEBA.js} +1 -1
  345. package/build/dist/chunks/{WAKZWSHB.js → 5KKAN7XQ.js} +1 -1
  346. package/build/dist/chunks/{VVAM3EAK.js → 5N6YJFFA.js} +1 -1
  347. package/build/dist/chunks/{QIB6OMQV.js → 5O67QQIY.js} +1 -1
  348. package/build/dist/chunks/5PNFV7HH.js +1 -0
  349. package/build/dist/chunks/5RAZFRO4.js +1 -0
  350. package/build/dist/chunks/{FAH7FKUT.js → 5UWVXEPD.js} +1 -1
  351. package/build/dist/chunks/5VKVAUFQ.js +1 -0
  352. package/build/dist/chunks/5Y457HYC.js +1 -0
  353. package/build/dist/chunks/64LAWFBE.js +1 -0
  354. package/build/dist/chunks/{JJGZ7W3V.js → 6AS3TGOX.js} +1 -1
  355. package/build/dist/chunks/6EWSLHXL.js +1 -0
  356. package/build/dist/chunks/{6F527FLN.js → 6HNQAYBM.js} +1 -1
  357. package/build/dist/chunks/{FUP53K6G.js → 6LDC5D2S.js} +1 -1
  358. package/build/dist/chunks/{YR44GQG4.js → 6QXTL65K.js} +1 -1
  359. package/build/dist/chunks/6RVAV6BB.js +1 -0
  360. package/build/dist/chunks/{WSILNJS2.js → 6STUQOFL.js} +1 -1
  361. package/build/dist/chunks/{OKXKDDBX.js → 6Y2546JA.js} +1 -1
  362. package/build/dist/chunks/{4Z3IGMU6.js → 7AYP4ATZ.js} +1 -1
  363. package/build/dist/chunks/{YGW4ODAP.js → 7EPU3XGY.js} +1 -1
  364. package/build/dist/chunks/7GL547YZ.js +1 -0
  365. package/build/dist/chunks/7JTXYMNP.js +1 -0
  366. package/build/dist/chunks/{A3BJSQ23.js → 7VU5VCTL.js} +1 -1
  367. package/build/dist/chunks/{Z7FGEWO2.js → 7WXAS54T.js} +1 -1
  368. package/build/dist/chunks/{3D7FXI6G.js → 7X5JVF3F.js} +1 -1
  369. package/build/dist/chunks/{DRLBTB4E.js → A72ADVYF.js} +1 -1
  370. package/build/dist/chunks/{ANIF3JMV.js → AG66NM3J.js} +1 -1
  371. package/build/dist/chunks/{AOX6DKYU.js → AL6UXNGH.js} +1 -1
  372. package/build/dist/chunks/AODUTN65.js +1 -0
  373. package/build/dist/chunks/{PQG3ULRT.js → AONO47JX.js} +1 -1
  374. package/build/dist/chunks/{JTPHZCO3.js → AQJLEG6B.js} +1 -1
  375. package/build/dist/chunks/AZBTNUXF.js +1 -0
  376. package/build/dist/chunks/{O56EZB5Y.js → B5BU645H.js} +1 -1
  377. package/build/dist/chunks/{LQSPWRHN.js → B75SS7H6.js} +1 -1
  378. package/build/dist/chunks/{GBIBRYOV.js → B7HVPHSS.js} +1 -1
  379. package/build/dist/chunks/{LT5P6PZW.js → B7WZJHIJ.js} +1 -1
  380. package/build/dist/chunks/{3A2IKFTV.js → BIFANUTV.js} +1 -1
  381. package/build/dist/chunks/BM4KHOFB.js +1 -0
  382. package/build/dist/chunks/{X3YEDVRN.js → BSV65PCA.js} +1 -1
  383. package/build/dist/chunks/{HDBDBKEA.js → BW755PNH.js} +1 -1
  384. package/build/dist/chunks/{VXCGMALF.js → BWE5PXRE.js} +1 -1
  385. package/build/dist/chunks/{7U62MMUQ.js → BY2OWKZB.js} +1 -1
  386. package/build/dist/chunks/{SRHVSNPX.js → C2H3BWN5.js} +1 -1
  387. package/build/dist/chunks/{F7MGYRPU.js → CCPG6PRL.js} +1 -1
  388. package/build/dist/chunks/{ZTX4WT62.js → CFPJDLTZ.js} +1 -1
  389. package/build/dist/chunks/{OI3N4EW4.js → CG7ABZXH.js} +1 -1
  390. package/build/dist/chunks/CJMVRV34.js +1 -0
  391. package/build/dist/chunks/CQPIR6ER.js +1 -0
  392. package/build/dist/chunks/{FP7DHVK2.js → CR7DPGI6.js} +1 -1
  393. package/build/dist/chunks/{W5FM2OVB.js → CVVNAFUE.js} +1 -1
  394. package/build/dist/chunks/{LEHBRAZX.js → CW37EGPL.js} +1 -1
  395. package/build/dist/chunks/{MI5HZDMH.js → D6JOXK7Q.js} +1 -1
  396. package/build/dist/chunks/{SGHSCK22.js → DJRS3TR5.js} +1 -1
  397. package/build/dist/chunks/{IZFED3R2.js → DLNDJZR4.js} +1 -1
  398. package/build/dist/chunks/{SYERFEJ4.js → DPSFR3ZS.js} +1 -1
  399. package/build/dist/chunks/{2T6O77QZ.js → DV2HVFTM.js} +1 -1
  400. package/build/dist/chunks/{NMJVQX5M.js → DWRRIFXS.js} +1 -1
  401. package/build/dist/chunks/{3ZH5SOC2.js → EFOC337C.js} +1 -1
  402. package/build/dist/chunks/EHQRAA3R.js +1 -0
  403. package/build/dist/chunks/{WX7OYCNS.js → EJIP7RBG.js} +1 -1
  404. package/build/dist/chunks/EPOIAXCV.js +3 -0
  405. package/build/dist/chunks/EWZFZUVF.js +1 -0
  406. package/build/dist/chunks/{OB7BFDOV.js → EYE3ZAJB.js} +1 -1
  407. package/build/dist/chunks/{MQ5F2VOK.js → EZUQMTLE.js} +1 -1
  408. package/build/dist/chunks/F36IA5RI.js +1 -0
  409. package/build/dist/chunks/{DD47RZFU.js → F74ARK4H.js} +1 -1
  410. package/build/dist/chunks/{Q4HSQL65.js → FGGDAAHW.js} +1 -1
  411. package/build/dist/chunks/FMEO7RX7.js +1 -0
  412. package/build/dist/chunks/{V6EVQWAL.js → FN6XY6ET.js} +1 -1
  413. package/build/dist/chunks/G4IX4CYN.js +1 -0
  414. package/build/dist/chunks/G53U6Y4L.js +1 -0
  415. package/build/dist/chunks/{XHFAF5PZ.js → GBIL2I2K.js} +1 -1
  416. package/build/dist/chunks/{RKM62HC5.js → GCFHKJIO.js} +1 -1
  417. package/build/dist/chunks/{K7HTDKAT.js → GMMTHTCP.js} +1 -1
  418. package/build/dist/chunks/{O5QTITN6.js → GRHBE4MQ.js} +1 -1
  419. package/build/dist/chunks/GTJ6LBGB.js +1 -0
  420. package/build/dist/chunks/GV6Z3MET.js +1 -0
  421. package/build/dist/chunks/{GK3D7OKG.js → GVCNTGLC.js} +1 -1
  422. package/build/dist/chunks/GX2RCAHG.js +1 -0
  423. package/build/dist/chunks/{O3XWE4FO.js → H5KU4DUU.js} +1 -1
  424. package/build/dist/chunks/H7ZJ7LAB.js +1 -0
  425. package/build/dist/chunks/{DCGNVMKG.js → HC3QFA5I.js} +1 -1
  426. package/build/dist/chunks/{RK3PPFRX.js → HEQBTHFS.js} +1 -1
  427. package/build/dist/chunks/{C76D54YG.js → HGSFRN57.js} +1 -1
  428. package/build/dist/chunks/HJI7KO6F.js +1 -0
  429. package/build/dist/chunks/{L6CVMDWQ.js → HNBYPHTA.js} +1 -1
  430. package/build/dist/chunks/{MSRCJ2BS.js → HPBTSJW7.js} +1 -1
  431. package/build/dist/chunks/HPO673QQ.js +1 -0
  432. package/build/dist/chunks/{ZFRTBBIW.js → HRGLFGFL.js} +1 -1
  433. package/build/dist/chunks/{DGDMRATN.js → ICHT3H3W.js} +1 -1
  434. package/build/dist/chunks/IJVBCEA2.js +1 -0
  435. package/build/dist/chunks/{2TX7HP6M.js → IKVRFAUP.js} +1 -1
  436. package/build/dist/chunks/IM7ZF7XZ.js +1 -0
  437. package/build/dist/chunks/{I4473OC6.js → IMD33NQS.js} +1 -1
  438. package/build/dist/chunks/IR7KDBFU.js +1 -0
  439. package/build/dist/chunks/{X24YTJST.js → IY7FWTAL.js} +1 -1
  440. package/build/dist/chunks/IYOWMW5B.js +1 -0
  441. package/build/dist/chunks/J2J73XYU.js +1 -0
  442. package/build/dist/chunks/JCS24YBB.js +1 -0
  443. package/build/dist/chunks/JQVTHPUO.js +1 -0
  444. package/build/dist/chunks/{USZCTSPI.js → JTWJT2O3.js} +1 -1
  445. package/build/dist/chunks/{2YYKQGJZ.js → K4CYAWNL.js} +1 -1
  446. package/build/dist/chunks/{7VH6JQ2H.js → K5C6QBOO.js} +1 -1
  447. package/build/dist/chunks/K5OXLIPK.js +1 -0
  448. package/build/dist/chunks/{4PB6MSGZ.js → K6GECT3F.js} +1 -1
  449. package/build/dist/chunks/{HU2JXDLH.js → KB2JWQZ4.js} +1 -1
  450. package/build/dist/chunks/{EFESPGA2.js → KCZUJ57H.js} +1 -1
  451. package/build/dist/chunks/{YW4W3LPQ.js → KHLM6NIZ.js} +1 -1
  452. package/build/dist/chunks/{OIQTZOBN.js → KKGHXNM4.js} +1 -1
  453. package/build/dist/chunks/{SUNTJ6IU.js → KYANIEPX.js} +1 -1
  454. package/build/dist/chunks/{MOZBDCVV.js → L3IAEXQR.js} +1 -1
  455. package/build/dist/chunks/{ZZ6FZGHF.js → L4UFGM7M.js} +1 -1
  456. package/build/dist/chunks/{DMB64UIN.js → L76P6WIH.js} +1 -1
  457. package/build/dist/chunks/{QMNUB2GM.js → LBT6WR4U.js} +1 -1
  458. package/build/dist/chunks/LD3A2KLN.js +1 -0
  459. package/build/dist/chunks/{WRUTW6CG.js → LFSNAQ7V.js} +1 -1
  460. package/build/dist/chunks/{5ZVIAGLX.js → LKRAUTYI.js} +1 -1
  461. package/build/dist/chunks/{23HNDJ76.js → M2SWILNG.js} +1 -1
  462. package/build/dist/chunks/{IT2JLILU.js → MFKDNAHB.js} +1 -1
  463. package/build/dist/chunks/MFQTBUSD.js +1 -0
  464. package/build/dist/chunks/{V4UJMUIB.js → MLN5KTG7.js} +1 -1
  465. package/build/dist/chunks/{S4JUFCT4.js → MSQNOK3I.js} +1 -1
  466. package/build/dist/chunks/{FA3GBXQP.js → MXI7LX2F.js} +1 -1
  467. package/build/dist/chunks/N6YNJGEF.js +1 -0
  468. package/build/dist/chunks/{DXAPKN7H.js → NLC36QHL.js} +1 -1
  469. package/build/dist/chunks/NUTTPUYJ.js +1 -0
  470. package/build/dist/chunks/{O4S6XAYV.js → O7L55XM3.js} +1 -1
  471. package/build/dist/chunks/{NAO7VWZF.js → OCIEVYPR.js} +1 -1
  472. package/build/dist/chunks/{4NBXBKOX.js → OD7CY6BY.js} +1 -1
  473. package/build/dist/chunks/{RUTSEGGD.js → OHZHQSCA.js} +1 -1
  474. package/build/dist/chunks/{T3QEN3S6.js → OIGTTRN5.js} +1 -1
  475. package/build/dist/chunks/{5OTQCE2E.js → P6JE2NRA.js} +1 -1
  476. package/build/dist/chunks/PD5NXIRT.js +1 -0
  477. package/build/dist/chunks/{TXGZ6NWN.js → PG7HZIZL.js} +1 -1
  478. package/build/dist/chunks/{WXZ4LAKO.js → PXVF2SHU.js} +1 -1
  479. package/build/dist/chunks/{UBVE2U6X.js → Q43WPRYU.js} +1 -1
  480. package/build/dist/chunks/QA6Z2CYP.js +2 -0
  481. package/build/dist/chunks/QAAKUIWE.js +1 -0
  482. package/build/dist/chunks/{PQOWIRKQ.js → QAVP3CWL.js} +1 -1
  483. package/build/dist/chunks/{YXXK6EPI.js → QBHY2QRC.js} +1 -1
  484. package/build/dist/chunks/{ELHRXA5U.js → QFK335LC.js} +1 -1
  485. package/build/dist/chunks/{3PHJUFU2.js → QFUSCK5C.js} +1 -1
  486. package/build/dist/chunks/{IPU656WB.js → QKH7ED6B.js} +1 -1
  487. package/build/dist/chunks/{AHUCYDBC.js → QKIQ7ZKD.js} +1 -1
  488. package/build/dist/chunks/{XW3VGWXK.js → QMWHQRYC.js} +1 -1
  489. package/build/dist/chunks/{N6PHSHBE.js → QP2B7AYX.js} +1 -1
  490. package/build/dist/chunks/{VHK5AYC2.js → QZ6V6J6W.js} +1 -1
  491. package/build/dist/chunks/{MDLJFCT4.js → R5Z4HPCA.js} +1 -1
  492. package/build/dist/chunks/RKJFSDGV.js +1 -0
  493. package/build/dist/chunks/RKS3M7L5.js +1 -0
  494. package/build/dist/chunks/{GDOHHXNH.js → RLX6YTNT.js} +1 -1
  495. package/build/dist/chunks/RYEQIZ2H.js +1 -0
  496. package/build/dist/chunks/{USEF3QKG.js → S432S6NA.js} +1 -1
  497. package/build/dist/chunks/S47M3IPR.js +1 -0
  498. package/build/dist/chunks/S65KXMZ7.js +3 -0
  499. package/build/dist/chunks/{2OVJ2BTJ.js → SEXKWYUM.js} +1 -1
  500. package/build/dist/chunks/{2ILYVUFA.js → SRYX65GZ.js} +1 -1
  501. package/build/dist/chunks/{GNOHIL4Q.js → TMENUIBC.js} +1 -1
  502. package/build/dist/chunks/{BSX4LFYI.js → TNHU5UBQ.js} +1 -1
  503. package/build/dist/chunks/{PDPTJMTJ.js → TT2ST3Q3.js} +1 -1
  504. package/build/dist/chunks/TTBB6EFN.js +1 -0
  505. package/build/dist/chunks/{Z5YI6KLN.js → TWVDWNTG.js} +1 -1
  506. package/build/dist/chunks/TZG7HTVM.js +1 -0
  507. package/build/dist/chunks/{OVM4QIET.js → U4MSIH4G.js} +1 -1
  508. package/build/dist/chunks/UEOS6SHR.js +1 -0
  509. package/build/dist/chunks/{EIE2U4OX.js → UGFRBJDQ.js} +1 -1
  510. package/build/dist/chunks/{HUKDISRE.js → UIVOYAO2.js} +1 -1
  511. package/build/dist/chunks/{XRDLMTBJ.js → UMY6SP7C.js} +1 -1
  512. package/build/dist/chunks/UNBRUWSV.js +1 -0
  513. package/build/dist/chunks/{LGLWEGPY.js → UPX3OWKA.js} +1 -1
  514. package/build/dist/chunks/{MHONMLF6.js → URTQNYWU.js} +1 -1
  515. package/build/dist/chunks/{4RCYYN6O.js → V7HTGO23.js} +1 -1
  516. package/build/dist/chunks/{HZSYMGJ2.js → VS7ZA4OF.js} +1 -1
  517. package/build/dist/chunks/{BJ2U2VXJ.js → VTWAVH74.js} +1 -1
  518. package/build/dist/chunks/{5GQJVKVY.js → W5GWK72I.js} +1 -1
  519. package/build/dist/chunks/{65OITTDL.js → W73SLWBT.js} +1 -1
  520. package/build/dist/chunks/WRA3ZC6W.js +1 -0
  521. package/build/dist/chunks/{PRBIC3UK.js → WUONMIA2.js} +1 -1
  522. package/build/dist/chunks/{XL3W7DAQ.js → X3BB6WME.js} +1 -1
  523. package/build/dist/chunks/{K3TZYPSV.js → X53QVHBC.js} +1 -1
  524. package/build/dist/chunks/{LVFI74ST.js → XNJ6NDQQ.js} +1 -1
  525. package/build/dist/chunks/{GBPB7JIB.js → XSQJOOEY.js} +1 -1
  526. package/build/dist/chunks/XUDQYSPU.js +1 -0
  527. package/build/dist/chunks/{VKNKVUAA.js → XWZ5SL5Q.js} +1 -1
  528. package/build/dist/chunks/{365B4YEV.js → XXLQDQEX.js} +1 -1
  529. package/build/dist/chunks/{BDLV42SD.js → Y5T36EEU.js} +1 -1
  530. package/build/dist/chunks/{R73R4KN3.js → YBLJ2MCR.js} +1 -1
  531. package/build/dist/chunks/{WNWRF4HE.js → YZHJ4BAP.js} +1 -1
  532. package/build/dist/chunks/ZSGW2ZSO.js +1 -0
  533. package/build/dist/chunks/{HRAHGYNK.js → ZTNBX4VH.js} +1 -1
  534. package/package.json +1 -1
  535. package/build/dist/chunks/2QP6WGKZ.js +0 -1
  536. package/build/dist/chunks/3AOTYJPX.js +0 -1
  537. package/build/dist/chunks/4E7FJQLL.js +0 -1
  538. package/build/dist/chunks/4J245N3F.js +0 -1
  539. package/build/dist/chunks/4M6XBG6X.js +0 -1
  540. package/build/dist/chunks/BA66J5YQ.js +0 -1
  541. package/build/dist/chunks/BIY2F6MO.js +0 -1
  542. package/build/dist/chunks/CZ66MYKR.js +0 -1
  543. package/build/dist/chunks/DFM4T6ZE.js +0 -1
  544. package/build/dist/chunks/DGCJZ3HO.js +0 -1
  545. package/build/dist/chunks/DHX3Q5RV.js +0 -2
  546. package/build/dist/chunks/DWQJ7NSX.js +0 -1
  547. package/build/dist/chunks/EFUACKDK.js +0 -1
  548. package/build/dist/chunks/EQEMI54U.js +0 -1
  549. package/build/dist/chunks/GYPMUYB5.js +0 -1
  550. package/build/dist/chunks/JFC2QCMW.js +0 -1
  551. package/build/dist/chunks/JW7GLNLB.js +0 -3
  552. package/build/dist/chunks/MEB727X5.js +0 -1
  553. package/build/dist/chunks/MIKQWF6Q.js +0 -3
  554. package/build/dist/chunks/MQK6OP7S.js +0 -1
  555. package/build/dist/chunks/OSMOBKRQ.js +0 -1
  556. package/build/dist/chunks/P6MPKIU2.js +0 -1
  557. package/build/dist/chunks/P7C3TYI4.js +0 -1
  558. package/build/dist/chunks/RN3WUJIO.js +0 -1
  559. package/build/dist/chunks/TI727O2H.js +0 -1
  560. package/build/dist/chunks/UHIJMDD2.js +0 -1
  561. package/build/dist/chunks/VQJXQLFW.js +0 -1
  562. package/build/dist/chunks/W32UECOL.js +0 -1
  563. package/build/dist/chunks/WWNAGOCD.js +0 -1
  564. package/build/dist/chunks/ZNX3YVF2.js +0 -1
@@ -1 +1 @@
1
- import{a as g}from"./X5V2Z2NM.js";import{a as m}from"./43LI5NKJ.js";import{a as k}from"./66F5ZH34.js";import{e as A,g as u,i as b}from"./NWNYJ26T.js";import{b as l,j as x,t as y}from"./TI727O2H.js";import{a as o}from"./XSD5NL7J.js";import{b as w}from"./JXOEJPJ4.js";import{Buffer as v}from"node:buffer";import{decodeEventLog as $}from"viem";var R="Profile contents and oak.registrar are mutable, self-asserted metadata, not registry-validated claims or proof of provenance. Oak registration always writes the public oak.registrar = oak marker on Robinhood Chain. Anyone can see it, and the transaction stays in the public history even if the marker is changed later.",B="oak.registrar",D="0x6f616b",L=k("Agent ID as a decimal uint256 integer string."),j={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},q={type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"32-byte hex value."},z={type:"string",pattern:"^0x([0-9a-fA-F]{2})*$"},T="0x0000000000000000000000000000000000000000";function h(t){let e=t.network??"mainnet",{chainId:n,identityRegistry:r}=y[e],s=e==="mainnet"?x[l].identity:void 0;return{network:e,chainId:n,registry:r,registryId:`eip155:${n}:${r}`,reputation:s?.reputationRegistry.address,validation:s?.validationRegistry.address}}function K(t){let{chainId:e,reputation:n}=h(t);if(!n)throw new o("Oak has no pinned ERC-8004 reputation registry for this network.");return{chainId:e,address:n}}function V(t){let{chainId:e,validation:n}=h(t);if(!n)throw new o("Oak has no pinned ERC-8004 validation registry for this network.");return{chainId:e,address:n}}function Z(t){return u(t,T)}function G(t){if(typeof t!="string"||!/^[0-9]+$/.test(t)||t.length>78||BigInt(t)>=2n**256n)throw new o("Provide an agent ID as a decimal uint256 integer string.");return BigInt(t)}function J(t,e){return b(t,`Provide a valid ${e} address.`)}function Q(t,e){let n=h(t).chainId;if(e!==void 0&&e!==n)throw new o(`ERC-8004 actions are supported only on chain ${n}.`)}function X(t,e){if(typeof t!="string"||!/^0x[0-9a-fA-F]{64}$/.test(t))throw new o(`Provide ${e} as 32-byte hex.`);return t.toLowerCase()}function I(t,e,n,r=!0){if(t===void 0){if(r)return"";throw new o(`Provide ${e}.`)}if(typeof t!="string"||!r&&!t.trim()||t.length>n||w(t))throw new o(`${e} must be plain text of at most ${n} characters.`);return t}function Y(t,e){if(typeof t!="string"||!t.trim()||t.length>2048)throw new o(`Provide a valid ${e}.`);try{let n=new URL(t);if(!["https:","ipfs:"].includes(n.protocol)||!n.hostname||n.username||n.password||w(t))throw new Error}catch{throw new o(`${e} must be an HTTPS or IPFS URI without credentials.`)}return t}function tt(t){let e=/^data:application\/json;base64,([A-Za-z0-9+/=]+)$/.exec(t);if(e)try{let n=JSON.parse(v.from(e[1],"base64").toString("utf8"));return A(n)?n:void 0}catch{return}}async function C(t,e,n,r,s=!0){let i=await t.preview(e,n),a=i.changes.map(({amount:d,token:f})=>{let c=d.startsWith("-");return`${c?"-":""}${t.formatAmount(c?d.slice(1):d,f.decimals)} ${f.symbol} (${f.address}, chain ${f.chainId})`});return{txs:e,summary:`${i.summary} ${a.join("; ")} ${s?`${R} `:""}${r}`}}async function et(t,e,n,r="update this profile"){let{chainId:s,registry:i}=h(t),a=t.clientFor(s),d=await a.readContract({address:i,abi:g,functionName:"ownerOf",args:[e]});if(m(d),u(d,n))return d;let[f,c]=await Promise.all([a.readContract({address:i,abi:g,functionName:"getApproved",args:[e]}),a.readContract({address:i,abi:g,functionName:"isApprovedForAll",args:[d,n]})]);if(m(f),typeof c!="boolean")throw new o("The registry returned invalid operator approval data.");if(!u(f,n)&&!c)throw new o(`Only the agent owner or an approved operator can ${r}.`);return d}async function nt(t,e,n){let{chainId:r,registry:s}=h(t),i=t.clientFor(r),a=await i.readContract({address:s,abi:g,functionName:"ownerOf",args:[e]});if(m(a),u(a,n))return a;if(await i.readContract({address:s,abi:g,functionName:"isApprovedForAll",args:[a,n]})!==!0)throw new o("Only the agent owner or an operator approved for all of its agents can change the token approval.");return a}async function H(t,e,n,r,s){let{chainId:i,registry:a}=h(t),d=s??a;if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e))throw new o("Provide the mined transaction hash.");let f=t.clientFor(i),c=await f.getTransactionReceipt({hash:e});if(!c)throw new o("The transaction is not mined yet. Try again after confirmation.");if(c.status!=="success"||!c.to||!u(c.to,d)||!u(c.from,n)||!u(c.transactionHash,e))throw new o("The receipt is not a successful matching registry transaction.");let p=await f.getTransaction({hash:e});if(p.chainId!==i||p.value!==0n||!p.to||!u(p.to,d)||!u(p.from,n))throw new o("The transaction does not match this chain, registry and wallet.");if(!(typeof r=="function"?typeof p.input=="string"&&r(p.input):typeof p.input=="string"&&u(p.input,r)))throw new o("The mined transaction calldata does not match the exact operation Oak built.");return c}function rt(t,e,n,r){let s=t.logs.filter(i=>u(i.address,e)&&!i.removed).flatMap(i=>{try{let a=$({abi:n,topics:i.topics,data:i.data,strict:!0});return a.eventName===r?[a.args]:[]}catch{return[]}});if(s.length!==1)throw new o(`The receipt must contain one matching ${r} event.`);return s[0]}function ot(t){let e=I(t,"metadata key",128,!1);if(e==="agentWallet")throw new o("The key agentWallet is reserved: use erc8004_set_wallet / erc8004_unset_wallet, which prove control of the wallet.");return e}function it(t){if(t.value===void 0==(t.text===void 0))throw new o("Provide exactly one of value (0x hex bytes) or text (UTF-8).");let e;if(t.value!==void 0){if(typeof t.value!="string"||!/^0x([0-9a-fA-F]{2})*$/.test(t.value))throw new o("Metadata value must be 0x-prefixed hex bytes.");e=t.value}else{if(typeof t.text!="string")throw new o("Metadata text must be a string.");e=`0x${v.from(t.text,"utf8").toString("hex")}`}if((e.length-2)/2>4096)throw new o("Metadata values are limited to 4096 bytes.");return e}async function at(t,e,n,r){let{chainId:s}=h(t);if(n.transactionHash!==void 0){let a=await H(t,n.transactionHash,e,r.matcher??r.data,r.to);return r.verify(a)}await r.authority();let i=t.unsignedTx({to:r.to,data:r.data,value:"0",chainId:s,description:r.description});return C(t,[i],e,r.summary,!1)}export{R as a,B as b,D as c,L as d,j as e,q as f,z as g,h,K as i,V as j,Z as k,G as l,J as m,Q as n,X as o,I as p,Y as q,tt as r,C as s,et as t,nt as u,H as v,rt as w,ot as x,it as y,at as z};
1
+ import{a as g}from"./X5V2Z2NM.js";import{a as m}from"./43LI5NKJ.js";import{a as k}from"./66F5ZH34.js";import{e as A,g as u,i as b}from"./NWNYJ26T.js";import{b as l,j as x,t as y}from"./EWZFZUVF.js";import{a as o}from"./XSD5NL7J.js";import{b as w}from"./JXOEJPJ4.js";import{Buffer as v}from"node:buffer";import{decodeEventLog as $}from"viem";var R="Profile contents and oak.registrar are mutable, self-asserted metadata, not registry-validated claims or proof of provenance. Oak registration always writes the public oak.registrar = oak marker on Robinhood Chain. Anyone can see it, and the transaction stays in the public history even if the marker is changed later.",B="oak.registrar",D="0x6f616b",L=k("Agent ID as a decimal uint256 integer string."),j={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},q={type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"32-byte hex value."},z={type:"string",pattern:"^0x([0-9a-fA-F]{2})*$"},T="0x0000000000000000000000000000000000000000";function h(t){let e=t.network??"mainnet",{chainId:n,identityRegistry:r}=y[e],s=e==="mainnet"?x[l].identity:void 0;return{network:e,chainId:n,registry:r,registryId:`eip155:${n}:${r}`,reputation:s?.reputationRegistry.address,validation:s?.validationRegistry.address}}function K(t){let{chainId:e,reputation:n}=h(t);if(!n)throw new o("Oak has no pinned ERC-8004 reputation registry for this network.");return{chainId:e,address:n}}function V(t){let{chainId:e,validation:n}=h(t);if(!n)throw new o("Oak has no pinned ERC-8004 validation registry for this network.");return{chainId:e,address:n}}function Z(t){return u(t,T)}function G(t){if(typeof t!="string"||!/^[0-9]+$/.test(t)||t.length>78||BigInt(t)>=2n**256n)throw new o("Provide an agent ID as a decimal uint256 integer string.");return BigInt(t)}function J(t,e){return b(t,`Provide a valid ${e} address.`)}function Q(t,e){let n=h(t).chainId;if(e!==void 0&&e!==n)throw new o(`ERC-8004 actions are supported only on chain ${n}.`)}function X(t,e){if(typeof t!="string"||!/^0x[0-9a-fA-F]{64}$/.test(t))throw new o(`Provide ${e} as 32-byte hex.`);return t.toLowerCase()}function I(t,e,n,r=!0){if(t===void 0){if(r)return"";throw new o(`Provide ${e}.`)}if(typeof t!="string"||!r&&!t.trim()||t.length>n||w(t))throw new o(`${e} must be plain text of at most ${n} characters.`);return t}function Y(t,e){if(typeof t!="string"||!t.trim()||t.length>2048)throw new o(`Provide a valid ${e}.`);try{let n=new URL(t);if(!["https:","ipfs:"].includes(n.protocol)||!n.hostname||n.username||n.password||w(t))throw new Error}catch{throw new o(`${e} must be an HTTPS or IPFS URI without credentials.`)}return t}function tt(t){let e=/^data:application\/json;base64,([A-Za-z0-9+/=]+)$/.exec(t);if(e)try{let n=JSON.parse(v.from(e[1],"base64").toString("utf8"));return A(n)?n:void 0}catch{return}}async function C(t,e,n,r,s=!0){let i=await t.preview(e,n),a=i.changes.map(({amount:d,token:f})=>{let c=d.startsWith("-");return`${c?"-":""}${t.formatAmount(c?d.slice(1):d,f.decimals)} ${f.symbol} (${f.address}, chain ${f.chainId})`});return{txs:e,summary:`${i.summary} ${a.join("; ")} ${s?`${R} `:""}${r}`}}async function et(t,e,n,r="update this profile"){let{chainId:s,registry:i}=h(t),a=t.clientFor(s),d=await a.readContract({address:i,abi:g,functionName:"ownerOf",args:[e]});if(m(d),u(d,n))return d;let[f,c]=await Promise.all([a.readContract({address:i,abi:g,functionName:"getApproved",args:[e]}),a.readContract({address:i,abi:g,functionName:"isApprovedForAll",args:[d,n]})]);if(m(f),typeof c!="boolean")throw new o("The registry returned invalid operator approval data.");if(!u(f,n)&&!c)throw new o(`Only the agent owner or an approved operator can ${r}.`);return d}async function nt(t,e,n){let{chainId:r,registry:s}=h(t),i=t.clientFor(r),a=await i.readContract({address:s,abi:g,functionName:"ownerOf",args:[e]});if(m(a),u(a,n))return a;if(await i.readContract({address:s,abi:g,functionName:"isApprovedForAll",args:[a,n]})!==!0)throw new o("Only the agent owner or an operator approved for all of its agents can change the token approval.");return a}async function H(t,e,n,r,s){let{chainId:i,registry:a}=h(t),d=s??a;if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e))throw new o("Provide the mined transaction hash.");let f=t.clientFor(i),c=await f.getTransactionReceipt({hash:e});if(!c)throw new o("The transaction is not mined yet. Try again after confirmation.");if(c.status!=="success"||!c.to||!u(c.to,d)||!u(c.from,n)||!u(c.transactionHash,e))throw new o("The receipt is not a successful matching registry transaction.");let p=await f.getTransaction({hash:e});if(p.chainId!==i||p.value!==0n||!p.to||!u(p.to,d)||!u(p.from,n))throw new o("The transaction does not match this chain, registry and wallet.");if(!(typeof r=="function"?typeof p.input=="string"&&r(p.input):typeof p.input=="string"&&u(p.input,r)))throw new o("The mined transaction calldata does not match the exact operation Oak built.");return c}function rt(t,e,n,r){let s=t.logs.filter(i=>u(i.address,e)&&!i.removed).flatMap(i=>{try{let a=$({abi:n,topics:i.topics,data:i.data,strict:!0});return a.eventName===r?[a.args]:[]}catch{return[]}});if(s.length!==1)throw new o(`The receipt must contain one matching ${r} event.`);return s[0]}function ot(t){let e=I(t,"metadata key",128,!1);if(e==="agentWallet")throw new o("The key agentWallet is reserved: use erc8004_set_wallet / erc8004_unset_wallet, which prove control of the wallet.");return e}function it(t){if(t.value===void 0==(t.text===void 0))throw new o("Provide exactly one of value (0x hex bytes) or text (UTF-8).");let e;if(t.value!==void 0){if(typeof t.value!="string"||!/^0x([0-9a-fA-F]{2})*$/.test(t.value))throw new o("Metadata value must be 0x-prefixed hex bytes.");e=t.value}else{if(typeof t.text!="string")throw new o("Metadata text must be a string.");e=`0x${v.from(t.text,"utf8").toString("hex")}`}if((e.length-2)/2>4096)throw new o("Metadata values are limited to 4096 bytes.");return e}async function at(t,e,n,r){let{chainId:s}=h(t);if(n.transactionHash!==void 0){let a=await H(t,n.transactionHash,e,r.matcher??r.data,r.to);return r.verify(a)}await r.authority();let i=t.unsignedTx({to:r.to,data:r.data,value:"0",chainId:s,description:r.description});return C(t,[i],e,r.summary,!1)}export{R as a,B as b,D as c,L as d,j as e,q as f,z as g,h,K as i,V as j,Z as k,G as l,J as m,Q as n,X as o,I as p,Y as q,tt as r,C as s,et as t,nt as u,H as v,rt as w,ot as x,it as y,at as z};
@@ -0,0 +1 @@
1
+ import{e as m,f as a,i as o,j as g,k as h,p as x,r as w}from"./UMY6SP7C.js";import{a as s}from"./XSD5NL7J.js";import{decodeAbiParameters as F,encodeAbiParameters as A,keccak256 as O,parseAbi as P,stringToHex as N,zeroAddress as p}from"viem";var c={id:"managed-fee",supported:!0,contract:"HookrFeeAdvisory",address:"0x3B6b3f00684987B831fcF9EB5f0d5B806afF7306",source:"src/extensions/HookrFeeAdvisory.sol",advisoryTerms:"cap:uint24, surcharge:uint24, premium0:uint24, premium1:uint24, maxStep:uint24, minInterval:uint32, maxTtl:uint32",payment:"Returns an LP fee surcharge; an admitted keeper can reprice within the frozen bounds.",wiring:"Requires a separate fee advisory binding and verified keeper, phase, gas and fee-cap handling."},y=[{type:"tuple",components:[{name:"cap",type:"uint24"},{name:"surcharge",type:"uint24"},{name:"premium0",type:"uint24"},{name:"premium1",type:"uint24"},{name:"maxStep",type:"uint24"},{name:"minInterval",type:"uint32"},{name:"maxTtl",type:"uint32"}]}];function b(r){m(r,["cap","surcharge","premium0","premium1","maxStep","minInterval","maxTtl"],["cap","surcharge","premium0","premium1","maxStep","minInterval","maxTtl"]);let e={cap:Number(a(r.cap,24)),surcharge:Number(a(r.surcharge,24)),premium0:Number(a(r.premium0,24)),premium1:Number(a(r.premium1,24)),maxStep:Number(a(r.maxStep,24)),minInterval:Number(a(r.minInterval,32)),maxTtl:Number(a(r.maxTtl,32))};if(e.cap===0||e.cap>6e5||e.surcharge+e.premium0>e.cap||e.surcharge+e.premium1>e.cap||e.maxStep===0||e.minInterval===0||e.minInterval>86400||e.maxTtl===0||e.maxTtl>259200)throw new s("Invalid managed-fee advisory terms.");return A(y,[e])}function k(r){let[e]=F(y,r),n=Object.fromEntries(Object.entries(e).map(([t,i])=>[t,String(i)]));if(b(n).toLowerCase()!==r.toLowerCase())throw new s("Non-canonical managed-fee advisory terms.");return e}function H(r){let e=k(r);return`Managed LP surcharge: cap ${e.cap} pips, default ${e.surcharge} plus directional premiums ${e.premium0}/${e.premium1}, max keeper step ${e.maxStep}, minimum update interval ${e.minInterval} seconds, maximum target lifetime ${e.maxTtl} seconds. An admitted keeper may reprice within these bounds; after a target expires the directional defaults apply. During the launch guard the buy surcharge may be clipped to available fee room. Surcharge is an LP fee for in-range LPs.`}var M={address:c.address,codeHash:"0x9b3c56e0749889dd01ab6c1a5247c1fb2f47bf92da5d08737f6570ed48fead74",schemaHash:O(N("hookr.advisory.fee.config")),phaseMask:1,feeOnly:!0,failOpen:!1,gasMin:3e4},B=P(["function owner() view returns (address)","function registry() view returns (address)","function isKeeper(address) view returns (bool)","function pendingOwner() view returns (address)","function delay() view returns (uint48)"]);async function j(r,e,n){m(n,["terms","keeper","owner"],["terms","keeper","owner"]);let t=o(n.keeper),i=o(n.owner);if(t===p||i===p)throw new s("Managed fee keeper and owner must be nonzero.");let d=b(m(n.terms,["cap","surcharge","premium0","premium1","maxStep","minInterval","maxTtl"],["cap","surcharge","premium0","premium1","maxStep","minInterval","maxTtl"])),[v,T,S,I,$]=await Promise.all(["owner","registry","isKeeper","pendingOwner","delay"].map(f=>x(r,c.address,B,f,f==="isKeeper"?[t]:[],e)));if(v!==i||T!==w||!h(S))throw new s("Managed fee owner, registry or keeper differs at the named block.");let u=o(I),l=g($,48);if(u!==p)throw new s(`Managed fee refused: an ownership transfer to ${u} is pending on advisory ${c.address}. Whoever accepts it decides which keepers can reprice this pool's fee. Retry after the transfer is accepted or cancelled, naming the owner you then see.`);return{data:d,summary:`${H(d)} Named admitted keeper ${t}; other admitted keepers can also reprice. Governance owner ${i} can add keepers after a timelock of ${l} seconds and remove them immediately; Oak cannot list keeper additions already queued. No ownership transfer is pending at the checked block. The owner and keepers are not fixed by this launch and can change later; an ownership transfer waits the same timelock and must then be accepted.`,delaySeconds:l,descriptor:M,phases:1,requiredCaps:{maxLpFeePips:BigInt(k(d).cap),maxQuoteTakePips:0n,maxSubjectTakeBps:0n},keeper:t,owner:i}}export{c as a,b,k as c,H as d,M as e,B as f,j as g};
@@ -1 +1 @@
1
- import{c as A,d as M,m as $}from"./HU2JXDLH.js";import{f as C,g as H}from"./N6PHSHBE.js";import{d as m,e as s,z as k}from"./4E7FJQLL.js";import{g as b}from"./NWNYJ26T.js";import{b as x}from"./TI727O2H.js";import{a as e}from"./XSD5NL7J.js";import{decodeFunctionData as v,encodeFunctionData as B,erc20Abi as q,getAddress as F}from"viem";function Q(u){return{tools:[{name:"uniswap_swap_batch",inputSchema:{type:"object",additionalProperties:!1,required:["routes"],properties:{routes:{description:"One to twenty complete uniswap_swap argument objects, each with its own minAmountOut or maxAmountIn bound.",type:"array",minItems:1,maxItems:20,items:{type:"object",description:"Complete uniswap_swap arguments, including an absolute minAmountOut or maxAmountIn."}}}},async execute(n,y){if(H(n,["routes"]),!Array.isArray(n.routes)||n.routes.length<1||n.routes.length>20)throw new e("Provide 1 to 20 explicit bounded Uniswap routes.");let p=[],I=[],l=new Map,i="0x",E=0n,a,w=[],P=new Set;for(let t of n.routes){if(!t||typeof t!="object"||Array.isArray(t))throw new e("Each route must contain uniswap_swap arguments.");let c=await $(u,t,y,!1);if(!("txs"in c))throw new e("Route did not build swap transactions.");p.push(...c.warnings??[]),I.push(...c.confirmationWarnings??[]);let R=c.txs;for(let r of R.slice(0,-1))if(b(r.to,m)){let[o,N,O,U]=v({abi:M,data:r.data}).args;if(N!==s)throw new e("Unexpected route approval spender.");let _=o.toLowerCase(),d=l.get(_),j=(d?.amount??0n)+O;if(j>=1n<<160n)throw new e("Combined input approvals exceed uint160.");l.set(_,{token:o,amount:j,expiration:d&&d.expiration<BigInt(U)?d.expiration:BigInt(U)})}else{let o=v({abi:q,data:r.data});if(o.functionName!=="approve"||!b(o.args[0],m))throw new e("Unexpected route prerequisite.")}let g=R.at(-1);if(g.to!==s)throw new e("Route does not use the pinned Universal Router.");E+=BigInt(g.value);let[D,h,S]=v({abi:A,data:g.data}).args,T=D.slice(2).match(/../g)??[];if(T.length!==h.length)throw new e("Unexpected route command/parameter count.");T.forEach((r,o)=>{r==="04"?P.add(h[o]):(i=`${i}${r}`,w.push(h[o]))}),a=a===void 0||S<a?S:a}for(let t of P)i=`${i}04`,w.push(t);let f=[];for(let t of l.values())f.push(u.approval(F(t.token),m,t.amount.toString(),x),k(t.token,s,t.amount.toString(),t.expiration.toString()));return f.push(u.unsignedTx({to:s,data:B({abi:A,functionName:"execute",args:[i,w,a]}),value:E.toString(),chainId:x,description:`Atomically execute ${n.routes.length} caller-selected v2/v3/v4 routes, preserving each route's trade bound.`})),{...await C(u,f,y,`${p.join(" ")}${p.length?" ":""}Explicit mixed-version/split routes; every route must meet its own bound. No automatic best-route search or allow-revert branch. The wallet must fund each independently previewed route.`),warnings:p,confirmationWarnings:I}}}]}}export{Q as a};
1
+ import{c as A,d as M,m as $}from"./KB2JWQZ4.js";import{f as C,g as H}from"./QP2B7AYX.js";import{d as m,e as s,z as k}from"./5677LZOV.js";import{g as b}from"./NWNYJ26T.js";import{b as x}from"./EWZFZUVF.js";import{a as e}from"./XSD5NL7J.js";import{decodeFunctionData as v,encodeFunctionData as B,erc20Abi as q,getAddress as F}from"viem";function Q(u){return{tools:[{name:"uniswap_swap_batch",inputSchema:{type:"object",additionalProperties:!1,required:["routes"],properties:{routes:{description:"One to twenty complete uniswap_swap argument objects, each with its own minAmountOut or maxAmountIn bound.",type:"array",minItems:1,maxItems:20,items:{type:"object",description:"Complete uniswap_swap arguments, including an absolute minAmountOut or maxAmountIn."}}}},async execute(n,y){if(H(n,["routes"]),!Array.isArray(n.routes)||n.routes.length<1||n.routes.length>20)throw new e("Provide 1 to 20 explicit bounded Uniswap routes.");let p=[],I=[],l=new Map,i="0x",E=0n,a,w=[],P=new Set;for(let t of n.routes){if(!t||typeof t!="object"||Array.isArray(t))throw new e("Each route must contain uniswap_swap arguments.");let c=await $(u,t,y,!1);if(!("txs"in c))throw new e("Route did not build swap transactions.");p.push(...c.warnings??[]),I.push(...c.confirmationWarnings??[]);let R=c.txs;for(let r of R.slice(0,-1))if(b(r.to,m)){let[o,N,O,U]=v({abi:M,data:r.data}).args;if(N!==s)throw new e("Unexpected route approval spender.");let _=o.toLowerCase(),d=l.get(_),j=(d?.amount??0n)+O;if(j>=1n<<160n)throw new e("Combined input approvals exceed uint160.");l.set(_,{token:o,amount:j,expiration:d&&d.expiration<BigInt(U)?d.expiration:BigInt(U)})}else{let o=v({abi:q,data:r.data});if(o.functionName!=="approve"||!b(o.args[0],m))throw new e("Unexpected route prerequisite.")}let g=R.at(-1);if(g.to!==s)throw new e("Route does not use the pinned Universal Router.");E+=BigInt(g.value);let[D,h,S]=v({abi:A,data:g.data}).args,T=D.slice(2).match(/../g)??[];if(T.length!==h.length)throw new e("Unexpected route command/parameter count.");T.forEach((r,o)=>{r==="04"?P.add(h[o]):(i=`${i}${r}`,w.push(h[o]))}),a=a===void 0||S<a?S:a}for(let t of P)i=`${i}04`,w.push(t);let f=[];for(let t of l.values())f.push(u.approval(F(t.token),m,t.amount.toString(),x),k(t.token,s,t.amount.toString(),t.expiration.toString()));return f.push(u.unsignedTx({to:s,data:B({abi:A,functionName:"execute",args:[i,w,a]}),value:E.toString(),chainId:x,description:`Atomically execute ${n.routes.length} caller-selected v2/v3/v4 routes, preserving each route's trade bound.`})),{...await C(u,f,y,`${p.join(" ")}${p.length?" ":""}Explicit mixed-version/split routes; every route must meet its own bound. No automatic best-route search or allow-revert branch. The wallet must fund each independently previewed route.`),warnings:p,confirmationWarnings:I}}}]}}export{Q as a};
@@ -1 +1 @@
1
- import{a as p,c as s}from"./JW7GLNLB.js";import{a}from"./SPJCSEKP.js";import{b as i}from"./TI727O2H.js";import{a as o}from"./XSD5NL7J.js";async function u(e,n,t){if(!Object.prototype.hasOwnProperty.call(p,e.name))throw new o("Local Chop guard cannot rebuild this action; nothing was signed.");if(e.chainId!==void 0&&e.chainId!==i)throw new o("Local Chop guard requires chain 4663; nothing was signed.");let r=async()=>{throw new o("Local Chop guard does not use HTTP, swaps or a preview service.")},d=a({clientFor:c=>{if(c!==i)throw new o("Local Chop guard requires chain 4663; nothing was signed.");return t.client},http:r,quoteSwap:r,buildSwap:r,preview:r});return(await s(d,e.name,e.args,n)).built}function g(e){return(n,t)=>u(n,t,e)}export{u as a,g as b};
1
+ import{a as p,c as s}from"./EPOIAXCV.js";import{a}from"./SPJCSEKP.js";import{b as i}from"./EWZFZUVF.js";import{a as o}from"./XSD5NL7J.js";async function u(e,n,t){if(!Object.prototype.hasOwnProperty.call(p,e.name))throw new o("Local Chop guard cannot rebuild this action; nothing was signed.");if(e.chainId!==void 0&&e.chainId!==i)throw new o("Local Chop guard requires chain 4663; nothing was signed.");let r=async()=>{throw new o("Local Chop guard does not use HTTP, swaps or a preview service.")},d=a({clientFor:c=>{if(c!==i)throw new o("Local Chop guard requires chain 4663; nothing was signed.");return t.client},http:r,quoteSwap:r,buildSwap:r,preview:r});return(await s(d,e.name,e.args,n)).built}function g(e){return(n,t)=>u(n,t,e)}export{u as a,g as b};
@@ -1 +1 @@
1
- import{m as J,n as Z}from"./4NBXBKOX.js";import{a as x}from"./G2LAO23N.js";import{a as V}from"./66F5ZH34.js";import{b as K,c as X,g as C}from"./NWNYJ26T.js";import{b as f}from"./TI727O2H.js";import{a as u}from"./XSD5NL7J.js";import{encodeFunctionData as G,getAddress as b,hashTypedData as T,parseAbi as A,recoverTypedDataAddress as ie}from"viem";var oe={pool:b("0x281210097f0de7A8FB6F87310AF0f089c9C8DE21"),registry:b("0x8004A169FB4a3325136EB29fA0ceB6D2e539a432"),usdg:b("0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168"),priors:b("0xeDBf91223639800BCd5756815CAf908Df3b890bE"),stock:b("0xbEcd07EC689988e16b870C121756C4c2C8cb02B6"),backing:b("0xC999014C6218EC41f0aE412d49AE8f2aA4c539fD"),treasury:b("0xFe8fdf43c4b0443aCF8E8CD8facD62F1B770e267"),bond:b("0x346d3360B7258a18E8a2a55fe20E0F467113a53A"),autopay:b("0x72B510AF4e66e5960aB9b975e0BdCf80239e83A0"),savings:b("0xBeEff033F34C046626B8D0A041844C5d1A5409dd"),market:b("0x6a4583242B8313313E684d02aB7dc6bFf8749670"),market1:b("0xe5C8b3FacD7802099C1DfB88c0C818Cd0ebA7B19"),bidSpender:b("0x0dbd031a3e8cc91C2b0A3Bf6BD1d14c7AeD92878"),seats3:b("0x59D155C42A9263fA7596867b992bB3e84dF680a9"),seats4:b("0xb1c3a04496238D62E3c93118C297163855e22192")},c=oe,$="(uint256 agentId,uint256 sponsorId,address owner,uint256 maxPremiumBps,uint256 nonce,uint256 deadline)",ne=A(["function ownerOf(uint256) view returns (address)","function getAgentWallet(uint256) view returns (address)"]),z=A(["function nonces(uint256) view returns (uint256)"]),re=A(["function isValidSignature(bytes32,bytes) view returns (bytes4)"]),ae="0x0000000000000000000000000000000000000000",O="Owner stake is collateral, not a return. A default burns 75% of owner stake (50% of other backing); pending and leaving stake remains at risk until released. New backing waits 24 hours. Exit mode 0 holds, 1 returns PRIORS, 2 requests USDG through the guarded exit queue; no immediate payout is promised.",e=(t,i,n,r,a={})=>({name:`priors_${t}`,contract:i,signature:`function ${n}`,fields:r,note:"",...a}),o=["agentId","id"],v=["amount","uint"],Q=["on","bool"],_=["generation","uint32"],D=["day","uint32"],P=["layer","uint8"],s={read:!0},te=[e("set_delegate","pool","setDelegate(uint256,address)",[o,["delegate","address"]],{owner:"agentId",note:"Owner only. Delegate controls borrowing/repayment, not transfer of identity; clear with the zero address."}),e("root_enroll","pool","enrollRoot(uint256,uint256)",[o,v],{owner:"agentId",approval:"usdg",note:"Owner only. Locks USDG pool shares behind this sponsor root; active delegated lines and fees constrain withdrawals."}),e("root_add_stake","pool","addStake(uint256,uint256)",[o,v],{approval:"usdg",note:"Anyone may add USDG; only the root owner can withdraw it. This may give funds to another owner."}),e("root_unlock","pool","unlock(uint256,uint256,address)",[o,["shares","uint"]],{owner:"agentId",args:["agentId","shares","$wallet"],note:"Owner only. Withdraw root pool shares to this wallet, subject to delegated backing and fee locks."}),e("root_retire","pool","retireRoot(uint256)",[o],{owner:"agentId",note:"Owner only; requires no remaining stake or delegated lines."}),e("root_vouch","pool","vouch(uint256,uint256,uint256)",[["sponsorId","id"],o,v],{owner:"sponsorId",note:"Owner of sponsor only. Adds the exact USDG amount of undrawn backing to an existing sponsored line."}),e("root_unvouch","pool","unvouch(uint256,uint256,uint256)",[["sponsorId","id"],o,v],{owner:"sponsorId",note:"Owner of sponsor only. Recalls undrawn backing; outstanding debt remains backed."}),e("root_freeze","pool","freeze(uint256,bool)",[o,["frozen","bool"]],{note:"Current sponsor owner only; freeze/unfreeze the agent line. Contract checks sponsor ownership."}),e("root_set_premium","pool","setPremium(uint256,uint256)",[o,["premiumBps","uint"]],{note:"Current sponsor owner only. Future loan premium cannot exceed the owner-consented cap."}),e("root_claim_fees","pool","claimSponsorFees(uint256,address)",[o],{owner:"agentId",args:["agentId","$wallet"],note:"Owner only; claim sponsor USDG fees to this wallet."}),e("root_set_hook","pool","setHook(uint256,address)",[o,["hook","address"]],{owner:"agentId",note:"Owner only. Changes root lending policy hook; pool enforces the delay while backing is committed."}),e("root_apply_hook","pool","applyHook(uint256)",[o],{note:"Apply a previously scheduled root hook after its on-chain delay."}),e("mark_default","pool","markDefault(uint256)",[["loanId","id"]],{note:"Irreversible: mark a past-grace unpaid loan defaulted, burn sponsor backing and mark the owner. Preview and confirm deliberately."}),e("import_history","pool","importFromV1(uint256)",[o],{note:"Import the v1 record, including defaults; this never imports unbacked capacity."}),e("fund_reserve","pool","fundReserve(uint256)",[v],{approval:"usdg",note:"Donate USDG to the pool reserve; receives no redeemable shares."}),e("root_shares","pool","rootShares(uint256) view returns (uint256)",[o],s),e("root_fee_locked","pool","feeLocked(uint256) view returns (uint256)",[o],s),e("root_fees_owed","pool","sponsorFees(uint256) view returns (uint256)",[o],s),e("root_backing","pool","backing(uint256) view returns (uint256)",[o],s),e("root_free_backing","pool","freeBacking(uint256) view returns (uint256)",[o],s),e("pool_parameters","pool","getParams() view returns ((uint256 minLoan,uint256 maxLoan,uint64 minTerm,uint64 maxTerm,uint64 grace,uint64 minScoreTerm,uint256 feeBps,uint256 sponsorFeeBps,uint256 protocolFeeBps,uint256 minStake,uint256 maxUtilizationBps,uint256 keeperBounty))",[],s),e("bond_deposit","bond","deposit(uint256)",[o],{owner:"agentId",approval:"bond",note:"Owner only. V2 treasury bond remains locked while any line or loan is open; it may replace and refund a former owner bond. Leave and release the legacy bond before Treasury V5 migration."}),e("bond_release","bond","release(uint256)",[o],{note:"Return V2 bond to its original depositor, not necessarily this wallet; contract enforces no line, no loan and age."}),e("bond_slash","bond","slash(uint256)",[o],{note:"Irreversible: send defaulted agent V2 bond to the configured beneficiary."}),e("bond_status","bond","bonds(uint256) view returns ((address depositor,uint64 at,uint256 amount))",[o],s),e("bond_releasable","bond","releasable(uint256) view returns (bool)",[o],s),e("bond_release_at","bond","unusedReleaseAt(uint256) view returns (uint256)",[o],s),e("treasury_move","treasury",`move(uint256,${$},bytes)`,[o],{owner:"agentId",consentRoot:8793n,externalConsent:!0,args:["agentId","$consent","$signature"],note:"Move a former Treasury V4 line to V5, no loan open. Close old line, release legacy bond, deposit V2 bond first. V4 record and current-owner V2 bond are required."}),e("treasury_raise","treasury","raise(uint256)",[o],{note:"Raise an eligible Treasury V5 line using its current rules, score, history, age, weekly room and free backing. No unbacked credit."}),e("treasury_reclaim","treasury","reclaim(uint256)",[o],{note:"Reclaim an idle treasury line under on-chain rules; this ends borrowing access."}),e("treasury_first_line","treasury",`firstLine(uint256,uint64,bytes,${$},bytes)`,[o,["expiry","uint"],["invite","bytes"]],{owner:"agentId",consentRoot:8793n,externalConsent:!0,args:["agentId","expiry","invite","$consent","$signature"],note:"Redeem an already-issued Treasury V5 invite with V5 pool consent. Requires a valid V5 inviter signature; the current owner V2 bond is needed before borrowing. V4 invites cannot be reused."}),e("treasury_raise_room","treasury","raiseRoom() view returns (uint256)",[],s),e("treasury_first_lined","treasury","firstLined(uint256) view returns (bool)",[o],s),e("treasury_eligible_raise","treasury","eligibleForRaise(uint256) view returns (bool)",[o],s),e("treasury_room","treasury","epochRoom() view returns (uint256)",[],s),e("treasury_rules","treasury","rules() view returns (uint256 reserveBps,uint256 firstLine,uint256 secondLine,uint256 epochCap,uint64 epochLength,uint64 minSeasoning,uint256 minQualified,uint256 minScore,uint64 idleAfter)",[],s),e("stock_open","stock",`open(uint256,address,uint256,${$},bytes) returns (uint256)`,[o,["token","address"],v],{owner:"agentId",consentRoot:6424n,externalConsent:!0,approval:"stock",args:["agentId","token","amount","$consent","$signature"],note:"Owner or on-chain controller with a supplied owner consent posts exact collateral. Token must be accepted and usable; live price, LTV, line cap and backing determine the line. Default seizes debt plus buffer; issuer restrictions and burns may reduce returned collateral."}),e("stock_add","stock","addCollateral(uint256,uint256)",[o,v],{approval:"stock",note:"Depositor only. Adds exact position token collateral; contract decides resulting draw room."}),e("stock_close","stock","close(uint256)",[o],{note:"Depositor or controller closes/freezes the line; collateral pays its depositor after the last loan, subject to default and issuer shortfalls."}),e("stock_expire","stock","expire(uint256)",[o],{note:"Expire idle stock line after on-chain idle rules; may close borrowing access."}),e("stock_reconcile","stock","reconcile(uint256,uint256)",[o,["maxLoans","uint"]],{note:"Reconcile the collateral debt walk against pool loans; contract ignores maxLoans in this implementation."}),e("stock_settle","stock","settle(uint256,uint256)",[o,["loanId","id"]],{note:"Reconcile stock collateral after a default or missed hook; may seize collateral according to the loan."}),e("stock_record_feed","stock","record(address,uint256) returns (uint80)",[["feed","address"],["maxRounds","uint"]],{note:"Advance public oracle price tape; may unblock new stock lines and default settlement."}),e("stock_reclaim","stock","reclaim(uint256)",[o],{note:"Reclaim a written-off stock position after it is no longer backed; return remains subject to vault token shortfall."}),e("stock_state","stock","getPosition(uint256) view returns ((address depositor,address owner,address token,uint64 openedAt,bool closing,uint8 status,uint128 line,uint256 amount))",[o],s),e("stock_borrow_room","stock","borrowRoom(uint256) view returns (uint256)",[o],s),e("stock_asset_state","stock","assets(address) view returns (address feed,uint64 maxAge,uint8 tokenDecimals,uint8 feedDecimals,bool enabled,uint16 ltvBps,uint128 lineCap)",[["token","address"]],s),e("stock_lending_status","stock","lendStatus(address) view returns (uint8)",[["token","address"]],s),e("stock_value","stock","valueOf(address,uint256) view returns (bool ok,uint256 value)",[["token","address"],v],s),e("stock_ltv","stock","ltvOf(uint256,address) view returns (uint256)",[o,["token","address"]],s),e("backing_open","backing",`open(uint256,uint256,bool,${$},bytes)`,[o,v,["autoAdd","bool"]],{owner:"agentId",consentRoot:8762n,approval:"priors",args:["agentId","amount","autoAdd","$consent","$signature"],note:O}),e("backing_open_with_usdg","backing",`openWithUsdg(uint256,uint256,uint256,uint256,uint256,bool,${$},bytes)`,[o,["priorsIn","uint"],["usdgIn","uint"],["minOut","uint"],["deadline","uint"],["autoAdd","bool"]],{owner:"agentId",consentRoot:8762n,approval:"mixed",args:["agentId","priorsIn","usdgIn","minOut","deadline","autoAdd","$consent","$signature"],note:O}),e("backing_add","backing","back(uint256,uint256,bool)",[o,v,["autoAdd","bool"]],{approval:"priors",note:O+" Owner-only at launch; other backers require both global and individual permission."}),e("backing_add_with_usdg","backing","backWithUsdg(uint256,uint256,uint256,uint256,uint256,bool)",[o,["priorsIn","uint"],["usdgIn","uint"],["minOut","uint"],["deadline","uint"],["autoAdd","bool"]],{approval:"mixed",note:O}),e("backing_leave","backing","leave(uint256,uint256,uint8)",[o,v,["exitMode","uint8"]],{note:O}),e("backing_close","backing","close(uint256,uint8)",[o,["exitMode","uint8"]],{note:O}),...["refresh","promote","expire","sync","pokeFees","recordRepay","noteDelegate"].map(t=>e(`backing_${t.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`)}`,"backing",`${t}(uint256)`,[o],{note:"Reconcile this V5 book against current pool, owner, record, tier and backing rules; no payout is promised."})),...["setAutoAdd","setProtocolBacking","setOthersBacking"].map(t=>e(`backing_${t.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`)}`,"backing",`${t}(uint256,bool)`,[o,Q],{note:"Change this V5 book setting under the contract ownership/holder rules. Auto-add can compound rewards into stake at risk."})),e("backing_reconsent","backing",`reconsent(uint256,${$},bytes)`,[o],{owner:"agentId",consentRoot:8762n,args:["agentId","$consent","$signature"],note:"Owner only. Renew the pool consent for V5 backing."}),e("backing_release","backing","release(uint256,uint32,uint32,uint256,uint256)",[o,_,D,["minUsdgOut","uint"],["deadline","uint"]],{note:"Release caller day bucket after its release rule. Zero minUsdgOut returns PRIORS; positive requests a guarded sale. Stake stays burnable until release. Read generation/day from chain events."}),e("backing_release_for","backing","releaseFor(uint256,uint32,address,uint32)",[o,_,["holder","address"],D],{note:"Return eligible PRIORS to its holder under generation/day release rules, never redirect proceeds."}),e("backing_finish_close","backing","finishClose(uint256,uint32)",[o,_],{note:"Finish an eligible generation close; pays the bound owner under its release rules."}),e("backing_claim_settled","backing","claimSettled(uint256,uint32,address)",[o,_,["holder","address"]],{note:"Pay settled generation stake to the named holder, after any default burn."}),e("backing_claim_record","backing","claimSettled(uint256,uint32,address,uint8,uint32)",[o,_,["holder","address"],P,D],{note:"Pay settled day record to its holder after any default burn."}),e("backing_queue_exit","backing","queueExit(uint256,uint32,address,uint8,uint32)",[o,_,["holder","address"],P,D],{note:"Holder/keeper queues ready USDG-mode stake; minimum and queue window apply. A queue entry is not a fill or payout."}),e("backing_settle","backing","settle(uint256,uint32,uint256)",[o,_,["loanId","id"]],{note:"Reconcile V5 generation with a pool loan/default after a missed hook."}),e("backing_record_loan","backing","recordLoan(uint256)",[["loanId","id"]],{note:"Record current pool loan in V5 book."}),e("backing_record_default","backing","recordDefault(uint256)",[["loanId","id"]],{note:"Reconcile a marked pool default and its stake burn."}),e("backing_collect","backing","collect(uint256[],uint32[]) returns (uint256)",[["agentIds","ids"],["generations","gens"]],{note:"Collect caller fees for explicitly selected generations; auto-add settings may retain stake."}),e("backing_fund","backing","fund(uint256)",[v],{approval:"usdg",note:"Donate USDG to V5 root backing; donor receives no withdrawable claim."}),e("backing_book","backing","getGen(uint256,uint32) view returns ((address owner,uint64 openedAt,uint8 status,bool ownerChanged,bool optOut,bool othersOff,bool pointsVoid,bool openRoomCharged,bool closedByOwner,bool movePending,bool splitPending,uint64 movePendingAt,uint8 tier,uint8 countedAtTier,uint8 listLen,uint32 tierStep,uint64 tierSince,uint64 lastLateAt,uint64 closedMark,uint64 lastRaiseAt,uint64 promoEpoch,uint64 stakeEpoch,uint64 placeEpoch,uint160 movePendingSqrt,uint256 roomLine,uint256 openLine,uint256 promoCredit,uint256 stakeRaised,uint256 placed,uint256 index,uint256 divisor,uint256 defaultProof,uint256 cLive,uint256 cUnits,uint256[3] list,uint256[3] counted,uint256[3] pendingTok,uint256[3] leavingLive,uint256[3] tokens,uint64[3] layerEnd,uint160[3] endSqrt,uint8[3] ownerEndMode,uint32[2][3] liveDay,uint32[3] leaveHead,(uint64 epoch,uint192 points)[5] points))",[o,_],s),e("backing_generation","backing","latestGen(uint256) view returns (uint32)",[o],s),e("backing_line","backing","lineOf(uint256) view returns (uint256)",[o],s),e("backing_quote","backing","needed(uint256,uint256,bool) view returns ((uint256 minA,uint256 fullLine,uint256 capA,uint160 sqrtP,uint8 k,uint8 kCached,bool depthGuard,uint256 line,uint256 ownerA,uint256 ownBacking,uint256 roomB,uint256 lineIfAdded,uint256 weekAfter))",[o,["tokens","uint"],["asOwner","bool"]],s),e("backing_position","backing","position(uint256,uint32,uint8,address) view returns ((uint256 counted,uint256 checkpoint,uint256 a0,uint256 a1,uint32 d0,uint32 d1,bool autoAdd))",[o,_,P,["holder","address"]],s),e("backing_record","backing","record(uint256,uint32,uint8,uint32,address) view returns ((uint256 counted,uint256 uncounted,uint256 creditedTo,uint160 sqrtLeave,uint8 mode,uint64 entry))",[o,_,P,D,["holder","address"]],s),e("backing_bucket","backing","leavingBucket(uint256,uint32,uint8,uint32) view returns ((bool exists,bool retired,uint64 latestLeave,uint64 releasableAt,uint256 loanCount,uint256 counted,uint256 uncounted,uint256 retireIndex))",[o,_,P,D],s),e("backing_settings","backing","settings() view returns (bool openBacking,uint256 premiumCap,uint256 maxSwapUsdg,uint256 openRoom,uint256 raiseRoom,uint256 vouchCap,uint8 minDrawK,bool premiumCheck,uint64 pausedUntil)",[],s),e("backing_reopen_at","backing","reopenAt(uint256) view returns (uint64)",[o],s),e("backing_sync_prices","backing","sync()",[],{note:"Update global V5 price/guard observations."}),e("backing_exit_service_open","backing","exitServiceOpen() view returns (bool)",[],s),e("backing_usdg_path","backing","usdgPathOpen(uint256) view returns (bool,uint8)",[["usdgIn","uint"]],s),e("backing_entry_rule","backing","entryRule() view returns (uint8 minEntryLoans,uint32 minEntryDays)",[],s),e("backing_target_premium","backing","targetPremiumBps(uint256) view returns (uint256)",[o],s),e("backing_price_cache","backing","priceCache() view returns (uint160 sqrtMedian,uint64 obsAt,uint160 sqrtWeekLow,uint160 sqrtObservation)",[],s),e("backing_pending_bucket","backing","pendingBucket(uint256,uint32,uint8,uint32) view returns ((uint128 amount,uint64 lastDeposit,bool merged,bool dead,uint256 mergeIndex))",[o,_,P,D],s),e("backing_exit_head","backing","exitHead() view returns (uint256 entryId,address holder,uint256 rest,uint160 sqrtPLeave,uint64 joinedAt)",[],s),e("backing_exit_entry","backing","entry(uint256) view returns ((uint256 id,uint32 gen,uint8 layer,uint32 day,address holder,uint64 joinedAt,uint64 prev,uint64 next))",[["entryId","uint"]],s),e("backing_flush","backing","flush()",[],{note:"Reconcile V5 fees and backing buffers; no payout to caller is promised."}),e("backing_claimable","backing","claimable(address) view returns (uint256)",[],{...s,args:["$wallet"]}),e("autopay_hold","autopay","hold(bool)",[Q],{note:"Hold/resume future autopay attempts for this wallet; allowances remain until explicitly revoked."}),e("autopay_max_cap","autopay","MAX_CAP() view returns (uint256)",[],s),e("autopay_window","autopay","WINDOW() view returns (uint64)",[],s),e("autopay_paused_until","autopay","pausedUntil() view returns (uint64)",[],s),e("autopay_plan","autopay","planOf(address,uint256) view returns (uint32 cap,address owner,bool on,bool useSavings,bool late,uint32 epoch)",[o],{...s,args:["$wallet","agentId"]}),e("autopay_check","autopay","check(uint256) view returns ((uint8 status,uint256 agentId,uint256 due,uint64 opens,uint64 closes,address wallet,uint256 fromWallet,uint256 fromWalletSavings,address owner,uint256 fromOwner,uint256 fromOwnerSavings))",[["loanId","id"]],s),e("autopay_epoch","autopay","epochOf(uint256) view returns (uint32 epoch,bool stale)",[o],s),e("autopay_held","autopay","held(address) view returns (bool)",[],{...s,args:["$wallet"]}),e("savings_deposit","savings","deposit(uint256,address) returns (uint256)",[v],{approval:"usdg",args:["amount","$wallet"],note:"Deposit own USDG into Priors default external Morpho savings vault; vault/allocator risk and withdrawal liquidity apply."}),e("savings_withdraw","savings","withdraw(uint256,address,address) returns (uint256)",[v],{args:["amount","$wallet","$wallet"],note:"Withdraw exact USDG amount from own savings. Insufficient liquidity fails the preview; no immediate exit is promised."}),e("savings_redeem","savings","redeem(uint256,address,address) returns (uint256)",[["shares","uint"]],{args:["shares","$wallet","$wallet"],note:"Redeem exact own savings shares to this wallet; liquidity and rounding apply."}),e("savings_balance","savings","balanceOf(address) view returns (uint256)",[],{...s,args:["$wallet"]}),e("savings_value","savings","previewRedeem(uint256) view returns (uint256)",[["shares","uint"]],s),...["market","market1"].flatMap((t,i)=>[e(`market_v${i===0?2:1}_listing`,t,"listingOf(uint256) view returns ((address seller,uint256 price,uint64 expiry,uint256 nonce,bytes32 uriHash,uint256 loansRepaid))",[o],s),e(`market_v${i===0?2:1}_record_hash`,t,"recordHash(uint256) view returns (bytes32)",[o],s),e(`market_v${i===0?2:1}_list`,t,"list(uint256,uint256,uint64)",[o,["price","uint"],["expiry","uint"]],{owner:"agentId",approval:"nft",note:"Owner sells this ERC-8004 NFT, its record and any followed treasury line. This does not transfer code, keys or servers. Approves only this NFT; confirm the sale terms and contract-enforced hold/line rules."}),e(`market_v${i===0?2:1}_cancel`,t,"cancel(uint256)",[o],{note:"Cancel the standing listing; NFT approval can remain until explicitly cleared."}),e(`market_v${i===0?2:1}_buy`,t,"buy(uint256,uint256,uint256,bytes32,bytes32)",[o,["maxPrice","uint"],["nonce","uint"],["uriHash","bytes32"],["recordHash","bytes32"]],{approval:"market",note:"Buy an ERC-8004 NFT to this wallet with exact live asking-price approval and pinned listing nonce, tokenURI and current credit record. A followed line still needs the new owner bond before borrowing. No keys/code/servers are included."})]),e("market_bid","market","bid(uint256,uint256,uint64,bytes32,uint256,uint256) returns (uint256)",[o,["price","uint"],["expiry","uint"],["uriHash","bytes32"],["minRepaid","uint"],["minLine","uint"],["reserveBudget","uint"]],{args:["agentId","price","expiry","uriHash","minRepaid","minLine"],approval:"bid",note:"Standing future purchase authority: another owner can fill this bid later without a new click. Exact reserveBudget USDG allowance is shared by all this wallet bids and replaces the old allowance. Cancel bid and clear unused budget deliberately."}),e("market_bid_any","market","bidAny(bytes32,uint256,uint256,uint64,uint256,uint256) returns (uint256)",[["root","bytes32"],["count","uint"],["price","uint"],["expiry","uint"],["minRepaid","uint"],["minLine","uint"],["reserveBudget","uint"]],{args:["root","count","price","expiry","minRepaid","minLine"],approval:"bid",note:"Standing future authority to buy count identities committed by the explicit Merkle root; shared exact reserveBudget USDG allowance. Inspect the committed ID list before authorizing. No code, keys or servers transfer."}),e("market_cancel_bid","market","cancelBid(uint256)",[["bidId","id"]],{note:"Cancel this bid; shared USDG allowance is unchanged so other bids can still fill."}),e("market_accept_bid","market","acceptBid(uint256,uint256,bytes32[],uint256)",[["bidId","id"],o,["proof","proof"],["minNet","uint"]],{owner:"agentId",approval:"nft",note:"Sell only this NFT into a currently valid bid; minNet pins seller USDG proceeds. Merkle proof and current bid rules are checked on chain during preview."}),e("market_bid_state","market","bidOf(uint256) view returns ((address maker,uint64 expiry,uint16 left,bool any,uint96 price,uint96 minLine,uint64 minRepaid,bytes32 target,bytes32 uriHash))",[["bidId","id"]],s),e("market_builder","market","builderOf(uint256) view returns ((address to,uint16 bps))",[o],s),e("market_set_builder","market","setBuilder(uint256,address,uint256)",[o,["to","address"],["bps","uint"]],{owner:"agentId",note:"Owner-only attribution before first sale; assigns future sale revenue share to to. Contract enforces enabled switch, no listing, and maximum 500 bps."}),e("market_change_builder","market","changeBuilder(uint256,address,uint256)",[o,["to","address"],["bps","uint"]],{note:"Current builder only; may lower or redirect own revenue share, never increase it."}),e("market_sale_split","market","saleSplit(uint256) view returns (uint256 fee,uint256 share,uint256 net)",[o],s),...["seats3","seats4"].flatMap((t,i)=>[e(`legacy_v${i+3}_close`,t,"close(uint256)",[o],{note:"Existing seat only. Close/freeze and return stake to original staker after final loan; default burn still applies. No new seats are opened."}),e(`legacy_v${i+3}_withdraw_offer`,t,"withdrawOffer(uint256,address)",[o],{args:["agentId","$wallet"],note:"Withdraw caller unaccepted offer; PRIORS returns to the staker."}),e(`legacy_v${i+3}_expire`,t,"expire(uint256)",[o],{note:"Expire idle seat under current contract rules."}),e(`legacy_v${i+3}_settle`,t,"settle(uint256,uint256)",[o,["loanId","id"]],{note:"Reconcile existing seat against pool loan/default after a missed hook."}),e(`legacy_v${i+3}_claim`,t,"claim(address) returns (uint256)",[],{args:["$wallet"],note:"Claim caller legacy seat USDG fees to this wallet."}),e(`legacy_v${i+3}_seat`,t,"getSeat(uint256) view returns ((address staker,uint64 openedAt,bool closing,uint8 status,uint128 line,uint128 burnBps,uint256 amount,uint256 feeMark,address owner))",[o],s),e(`legacy_v${i+3}_pending_fees`,t,"pendingFees(uint256) view returns (uint256)",[o],s),e(`legacy_v${i+3}_fees`,t,"feesOwed(address) view returns (uint256)",[],{...s,args:["$wallet"]}),e(`legacy_v${i+3}_offer`,t,"offers(uint256,address) view returns (uint256)",[o],{...s,args:["agentId","$wallet"]})])];function Y(t){return JSON.parse(JSON.stringify(t,(i,n)=>typeof n=="bigint"?n.toString():n))}function l(t,i,n=256){if(typeof t!="string"||!/^[0-9]+$/.test(t)||BigInt(t)>=1n<<BigInt(n))throw new u(`${i} must be a decimal base-unit string fitting uint${n}.`);return BigInt(t)}function se(t,[i,n]){let r=t[i];if(n==="address"){if(typeof r!="string"||!K.test(r))throw new u(`${i} must be a token or wallet address.`);return b(r)}if(n==="bool"){if(typeof r!="boolean")throw new u(`${i} must be true or false.`);return r}if(n==="bytes32"){if(typeof r!="string"||!/^0x[0-9a-fA-F]{64}$/.test(r))throw new u(`${i} must be bytes32.`);return r}if(n==="proof"){if(!Array.isArray(r)||r.length>32||!r.every(d=>typeof d=="string"&&/^0x[0-9a-fA-F]{64}$/.test(d)))throw new u("proof needs at most 32 bytes32 hashes.");return r}if(n==="bytes"){if(typeof r!="string"||!/^0x(?:[0-9a-fA-F]{2})*$/.test(r)||r.length>32770)throw new u(`${i} must be bounded hexadecimal bytes.`);return r}if(n==="ids"||n==="gens"){if(!Array.isArray(r)||r.length===0||r.length>100)throw new u(`${i} needs 1 to 100 decimal strings.`);return r.map(d=>l(d,i,n==="gens"?32:256))}let a=l(r,i,n==="uint8"?8:n==="uint32"?32:256);if(n==="id"&&a===0n)throw new u(`${i} must be positive.`);if(i==="exitMode"&&a>2n)throw new u("exitMode must be 0 (hold), 1 (PRIORS), or 2 (USDG queue).");if(i==="layer"&&a>2n)throw new u("layer must be 0, 1, or 2.");return a}var R=x.amount("USDG",6,"1000000"),L=x.amount("PRIORS",18,"1000000000000000000"),H='Amount of the stock token in base units (read its decimals with priors_stock_asset_state). Example: "1000000000000000000" = 1 token at 18 decimals.',ue={priors_root_enroll:R,priors_root_add_stake:R,priors_root_vouch:R,priors_root_unvouch:R,priors_root_offer:R,priors_fund_reserve:R,priors_backing_fund:R,priors_savings_deposit:R,priors_savings_withdraw:R,priors_stock_open:H,priors_stock_add:H,priors_stock_value:H,priors_backing_open:L,priors_backing_add:L,priors_backing_leave:L},B={agentId:'ERC-8004 agent ID, as a decimal string. Example: "437".',sponsorId:'ERC-8004 ID of the sponsor root, as a decimal string. Example: "6228".',loanId:x.id("Priors pool loan"),bidId:x.id("AgentMarket V2 bid"),entryId:x.id("V5 exit-queue entry"),delegate:"Address to appoint as pool delegate (borrow and repay only, never identity transfer); the zero address clears it.",frozen:"true freezes the agent line; false unfreezes it.",premiumBps:"Loan premium in basis points (50 = 0.5%); at most the owner-consented cap.",maxPremiumBps:'Owner-consented maximum sponsor premium in basis points (50 = 0.5%), at most 200. Default "0".',hook:"Address of the root lending-policy hook contract (0x followed by 40 hex digits).",expiry:"Expiry in Unix seconds. Market listings and bids allow at most 30 days ahead; a V5 invite uses its issued expiry.",invite:"Treasury V5 inviter signature bytes as 0x hex, exactly as issued.",token:"Address of the stock token (0x followed by 40 hex digits); it must be an accepted Priors stock collateral.",maxLoans:"Loan count bound passed to reconcile, as a decimal string; this contract version ignores it.",feed:"Address of the public oracle price feed to record (0x followed by 40 hex digits).",maxRounds:"Maximum oracle rounds to record in this call, as a decimal string.",autoAdd:"true compounds rewards into the stake at risk; false leaves them out.",priorsIn:x.amount("PRIORS",18,"1000000000000000000"),usdgIn:x.amount("USDG",6,"1000000"),minOut:"Minimum PRIORS received from the USDG conversion, in base units (PRIORS has 18 decimals); must be positive when usdgIn is.",deadline:"Deadline in Unix seconds, within the next hour. Example: 1800000000.",exitMode:x.enumValues({0:"hold",1:"return PRIORS",2:"request USDG through the guarded exit queue"}),generation:"V5 book generation number, as a decimal string; read it from priors_backing_generation or chain events.",day:"Day bucket number, as a decimal string, read from chain events; never guess it.",layer:'Backing layer "0", "1" or "2", as recorded in chain events.',holder:"Address of the stake holder; any payout goes only to this holder.",minUsdgOut:'"0" returns PRIORS; a positive value requests a guarded USDG sale with this minimum, in USDG base units (6 decimals).',agentIds:"ERC-8004 agent IDs as decimal strings, paired by position with generations (1 to 100).",generations:"Generation numbers as decimal strings, paired by position with agentIds.",tokens:'PRIORS amount in base units (PRIORS has 18 decimals) passed to the contract needed() quote. Example: "0".',asOwner:"true quotes as the agent owner; false as another backer.",price:'Price per identity in USDG base units (6 decimals); minimum "5000000" = 5 USDG.',maxPrice:"Highest asking price you accept, in USDG base units (6 decimals); read the listing first.",nonce:"Listing nonce from the listing read, as a decimal string; it pins the exact listing.",uriHash:"bytes32 hash of the agent tokenURI (0x followed by 64 hex digits), from the listing or priors_market_pins.",recordHash:"bytes32 hash of the agent credit record (0x followed by 64 hex digits), from priors_market_v1/v2_record_hash.",minRepaid:"Minimum repaid-loan count in the agent record for the bid to fill, as a decimal string.",minLine:"Minimum credit line the agent must carry for the bid to fill, in USDG base units (6 decimals).",reserveBudget:"Exact USDG allowance shared by all bids of this wallet, in base units (6 decimals); must cover price times count.",root:"Merkle root (bytes32) committing the agent ID list; rebuild it with priors_market_origin.",count:"Number of identities to buy from the committed list, 1 to 20, as a decimal string.",proof:"Merkle proof for this agent in the bid root: at most 32 bytes32 hashes.",minNet:"Minimum seller USDG proceeds, in base units (USDG has 6 decimals).",to:x.recipient("builder sale share recipient"),bps:"Builder sale share in basis points (50 = 0.5%); at most 500.",on:"true turns this setting on; false turns it off.",cap:'Per-loan repayment cap in USDG base units (USDG has 6 decimals), at most the contract MAX_CAP. Example: "5000000" = 5 USDG.',budget:"Total USDG allowance for AutoRepay in base units (6 decimals); at least cap, and shared by all plans of this wallet.",savingsShares:'Savings vault share allowance in base units (read the vault decimals); "0" disables savings use.',late:"AutoRepay late flag stored in the plan (true or false); read priors_autopay_plan to confirm it.",continuation:"Opaque state from the previous step; pass it back unchanged. Never build it by hand.",signature:"Local signature for the confirmed step, as 0x hex; the bridge supplies it. Never a key."},de={priors_root_unlock:"Root pool shares to withdraw, in pool share base units (read root_shares); not USDG.",priors_savings_redeem:"Savings vault shares to redeem, in base units (read the vault decimals); not USDG.",priors_savings_value:"Savings vault shares to value, in base units (read the vault decimals); not USDG."};function le(t,i){return i==="amount"?ue[t]:i==="shares"?de[t]:t==="priors_autopay_hold"&&i==="on"?"true holds future autopay attempts; false resumes them.":B[i]}function ce(t,i,n){let r=le(t,i);return r===void 0?n:{...n,description:r}}function F(t,i,n={}){return{type:"object",additionalProperties:!1,required:i.map(([r])=>r),properties:Object.fromEntries([...i.map(([r,a])=>[r,ce(t,r,a==="bool"?{type:"boolean"}:a==="address"?X:a==="proof"?{type:"array",maxItems:32,items:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$"}}:a==="ids"||a==="gens"?{type:"array",maxItems:100,items:V()}:{type:"string",...a==="bytes32"?{pattern:"^0x[0-9a-fA-F]{64}$"}:a!=="bytes"?{pattern:"^[0-9]+$"}:{}})]),...Object.entries(n)])}}async function I(t,i,n,r=[]){let a=[`function ${n}`],d=A(a);return t.clientFor(f).readContract({address:i,abi:d,functionName:d[0].name,args:r})}async function U(t,i){return b(await t.clientFor(f).readContract({address:c.registry,abi:ne,functionName:"ownerOf",args:[i]}))}function E(t){if(t.network==="testnet")throw new u("Priors ecosystem features are configured only on chain 4663.")}function M(t,i,n,r,a,d="0"){return{domain:Z(),types:{Consent:[...J.Consent]},primaryType:"Consent",message:{agentId:t,sponsorId:i,owner:b(n),nonce:r,deadline:a,maxPremiumBps:d}}}async function j(t,i,n){if(!i||!i.request||T(i.request)!==T(n)||typeof i.signature!="string"||!/^0x(?:[a-fA-F0-9]{2}){1,4096}$/.test(i.signature))throw new u("Consent differs from this agent, sponsor, owner, premium cap, nonce or deadline.");let r=n.message.owner,a=await t.clientFor(f).getCode({address:r});if(a&&a!=="0x"){if(await t.clientFor(f).readContract({address:r,abi:re,functionName:"isValidSignature",args:[T(n),i.signature]})!=="0x1626ba7e")throw new u("The owner contract rejected the consent signature.")}else if(!C(await ie({...n,signature:i.signature}),r))throw new u("The consent signature is not from the current agent owner.")}function pe(t,i,n,r,a,d){let g=te.find(k=>k.name===t),p=t==="priors_sign_consent"?l(i.sponsorId,"sponsorId"):g?.consentRoot;if(!p||a.stage!=="priors_consent"||a.tool!==t||a.wallet!==b(n)||a.chainId!==f||a.agentId!==i.agentId||r.length!==1||r[0]?.kind!=="typedData")throw new u("Unexpected Priors consent continuation.");let w=l(a.nonce,"nonce").toString(),h=l(a.deadline,"deadline");if(h<=BigInt(d)||h>BigInt(d+3600))throw new u("Priors consent expired or exceeds its one-hour window.");let y=M(String(i.agentId),p.toString(),n,w,h.toString(),String(i.maxPremiumBps??"0"));if(!r[0].request||T(r[0].request)!==T(y))throw new u("Priors consent differs from the requested agent, root, owner or premium.")}async function ee(t,i,n,r,a){let d=l(n.agentId,"agentId");if(!C(await U(t,d),r))throw new u("This operation requires the current identity owner wallet; a delegate cannot consent. Use the owner wallet.");let g=await t.clientFor(f).readContract({address:c.pool,abi:z,functionName:"nonces",args:[d]}),p=n.continuation,w=p?l(p.deadline,"deadline"):BigInt(Math.floor(Date.now()/1e3)+1800),h=l(n.maxPremiumBps??"0","maxPremiumBps");if(n.signature!==void 0&&!n.continuation)throw new u("A signature needs its locally confirmed Priors consent continuation.");if(h>200n)throw new u("maxPremiumBps exceeds the pool maximum of 200.");let y=M(d.toString(),a.toString(),r,g.toString(),w.toString(),h.toString());if(!p)return{steps:[{kind:"typedData",request:y}],continuation:{stage:"priors_consent",tool:i,wallet:r,chainId:f,agentId:d.toString(),nonce:g.toString(),deadline:w.toString()},summary:`Owner consent to sponsor #${a} for agent #${d}, premium cap ${h} bps; expires ${w}. No funds move from this signature. The local bridge must confirm the exact EIP-712 fields.`};if(pe(i,n,r,[{kind:"typedData",request:y}],p,Math.floor(Date.now()/1e3)),String(p.nonce)!==g.toString())throw new u("Priors consent nonce changed. Start the action again.");let k={request:y,signature:n.signature};return await j(t,k,y),{signedConsent:k}}async function ge(t,i,n,r){let a=c[i.contract],d=(p,w)=>w>0n?[t.approval(p,a,w.toString(),f)]:[];if(i.approval==="nft"){let p=l(n.agentId,"agentId"),w=await Promise.all([c.market,c.market1].map(h=>I(t,h,"listingOf(uint256) view returns ((address seller,uint256 price,uint64 expiry,uint256 nonce,bytes32 uriHash,uint256 loansRepaid))",[p])));for(let h of w){if(!h||typeof h!="object"||!("seller"in h)||typeof h.seller!="string")throw new u("Could not verify standing listings on both Priors markets; no NFT approval was built.");if(C(h.seller,r))throw new u("A standing listing in Priors market V1 or V2 could reactivate when NFT approval mines. Cancel it with priors_market_v1_cancel or priors_market_v2_cancel, verify both listings are cleared, then retry. No approval was built.")}return[t.approval(c.registry,a,p.toString(),f)]}if(i.approval==="market"){let p=await I(t,a,"listingOf(uint256) view returns ((address seller,uint256 price,uint64 expiry,uint256 nonce,bytes32 uriHash,uint256 loansRepaid))",[l(n.agentId,"agentId")]);if(p.price<=0n||p.price>l(n.maxPrice,"maxPrice")||p.nonce!==l(n.nonce,"nonce")||!C(p.uriHash,String(n.uriHash)))throw new u("Listing price, nonce or URI changed; read the listing again.");return d(c.usdg,p.price)}if(i.approval==="bid"){let p=l(n.reserveBudget,"reserveBudget");if(p>=1n<<128n||p<l(n.price,"price")*l(n.count??"1","count"))throw new u("Provide a finite exact bid reserve covering price times count.");return[t.approval(c.usdg,c.bidSpender,p.toString(),f)]}if(i.approval==="bond")return d(c.usdg,BigInt(await I(t,c.bond,"amount() view returns (uint256)")));if(i.approval==="mixed"){let p=l(n.priorsIn,"priorsIn"),w=l(n.usdgIn,"usdgIn");if(p+w===0n)throw new u("Provide a positive PRIORS or USDG input.");if(w>0n&&l(n.minOut,"minOut")===0n)throw new u("USDG conversion requires a positive minimum PRIORS output.");return[...d(c.priors,p),...d(c.usdg,w)]}if(!i.approval)return[];let g=l(n.amount,"amount");if(g===0n)throw new u("amount must be positive.");if(i.approval==="stock"){let p=i.name==="priors_stock_open"?b(String(n.token)):b((await I(t,c.stock,"getPosition(uint256) view returns ((address depositor,address owner,address token,uint64 openedAt,bool closing,uint8 status,uint128 line,uint256 amount))",[l(n.agentId,"agentId")])).token);if(p===ae)throw new u("No stock collateral position exists.");return d(p,g)}return d(c[i.approval],g)}function _e(t){let i=te.map(n=>({name:n.name,inputSchema:{...F(n.name,n.fields,n.consentRoot?{maxPremiumBps:V(B.maxPremiumBps),continuation:{type:"object",description:B.continuation},signature:{type:"string",pattern:"^0x([a-fA-F0-9]{2})+$",description:B.signature},...n.externalConsent?{signedConsent:{type:"object",description:"Optional public owner signature from priors_sign_consent; controller may supply collateral. Never pass a key."}}:{}}:{}),description:n.note||"Read current Priors contract state. All amounts are token base-unit decimal strings."},async execute(r,a){E(t),a=b(a);let d=Object.fromEntries(n.fields.map(m=>[m[0],se(r,m)]));if(n.owner&&!(n.externalConsent&&r.signedConsent)&&!C(await U(t,d[n.owner]),a))throw new u("Owner-only feature: call from the current identity owner wallet. Nothing was signed.");if(n.contract==="savings"&&b(String(await I(t,c.savings,"asset() view returns (address)")))!==c.usdg)throw new u("The savings vault asset is not USDG. Nothing was signed.");if(n.contract==="autopay"&&await I(t,c.autopay,"VERSION() view returns (uint256)")!==2n)throw new u("AutoRepay VERSION is not 2. Nothing was signed.");if(n.contract==="market"||n.contract==="market1"){if(r.expiry!==void 0){let m=l(r.expiry,"expiry",64),S=BigInt(Math.floor(Date.now()/1e3));if(m<=S||m>S+2592000n)throw new u("Market expiry must be within 30 days.")}if(r.price!==void 0&&l(r.price,"price")<5000000n)throw new u("Market price minimum is 5 USDG.");if(r.count!==void 0&&(l(r.count,"count")<1n||l(r.count,"count")>20n))throw new u("Bid count must be 1 to 20.")}if(n.name==="priors_treasury_first_line"&&l(r.expiry,"expiry",64)<=BigInt(Math.floor(Date.now()/1e3)))throw new u("Treasury V5 invite expired.");if(r.deadline!==void 0){let m=l(r.deadline,"deadline"),S=BigInt(Math.floor(Date.now()/1e3));if(m<=S||m>S+3600n)throw new u("deadline must be in the next hour.")}if(r.agentIds&&r.agentIds.length!==r.generations.length)throw new u("agentIds and generations must have equal length.");let g;if(n.consentRoot)if(n.externalConsent&&r.signedConsent){if(g=r.signedConsent,!g.request?.message)throw new u("Provide the public signedConsent from the current identity owner.");let m=l(r.agentId,"agentId"),S=await U(t,m),q=await t.clientFor(f).readContract({address:c.pool,abi:z,functionName:"nonces",args:[m]}),N=l(g.request.message.deadline,"consent deadline");if(N<=BigInt(Math.floor(Date.now()/1e3)))throw new u("Owner consent expired.");let W=l(r.maxPremiumBps??"0","maxPremiumBps");if(W>200n)throw new u("maxPremiumBps exceeds the pool cap.");await j(t,g,M(m.toString(),n.consentRoot.toString(),S,q.toString(),N.toString(),W.toString()))}else{let m=await ee(t,n.name,r,a,n.consentRoot);if("steps"in m)return m;g=m.signedConsent}let p=(n.args??n.fields.map(([m])=>m)).map(m=>m==="$wallet"?a:m==="$consent"?g.request.message:m==="$signature"?g.signature:d[m]),w=A([n.signature]),h=w[0].name;if(n.read)return{chainId:f,contract:c[n.contract],units:"Base units; USDG 6 decimals, PRIORS 18 decimals; stock/savings scales come from token metadata.",value:Y(await t.clientFor(f).readContract({address:c[n.contract],abi:w,functionName:h,args:p}))};let y=[...await ge(t,n,r,a),t.unsignedTx({to:c[n.contract],data:G({abi:w,functionName:h,args:p}),value:"0",chainId:f,description:`${n.name}: ${n.note}`})],k=await t.preview(y,a);return{txs:y,summary:`${n.note} Inputs (base units): ${JSON.stringify(Y(d))}. ${k.summary}`}}}));return i.push({name:"priors_sign_consent",inputSchema:F("priors_sign_consent",[o,["sponsorId","id"],["maxPremiumBps","uint"]],{continuation:{type:"object",description:B.continuation},signature:{type:"string",pattern:"^0x([a-fA-F0-9]{2})+$",description:B.signature}}),async execute(n,r){return E(t),ee(t,"priors_sign_consent",n,b(r),l(n.sponsorId,"sponsorId"))}}),i.push({name:"priors_root_offer",inputSchema:F("priors_root_offer",[["sponsorId","id"],o,v,["premiumBps","uint"]],{signedConsent:{type:"object",description:"The current agent owner output of priors_sign_consent. This is public signed authorization, never a private key."}}),async execute(n,r){E(t),r=b(r);let a=l(n.sponsorId,"sponsorId"),d=l(n.agentId,"agentId");if(!C(await U(t,a),r))throw new u("Only the sponsor root owner can send this offer.");let g=n.signedConsent;if(!g?.request?.message)throw new u("Ask the current agent owner to run priors_sign_consent from their wallet first.");let p=g.request.message,w=await t.clientFor(f).readContract({address:c.pool,abi:z,functionName:"nonces",args:[d]}),h=l(p.deadline,"consent deadline");if(h<=BigInt(Math.floor(Date.now()/1e3)))throw new u("Owner consent expired; request a fresh consent.");let y=l(n.premiumBps,"premiumBps"),k=l(p.maxPremiumBps,"maxPremiumBps");if(y>k||k>200n)throw new u("premiumBps exceeds the owner consent or pool cap.");let m=M(d.toString(),a.toString(),await U(t,d),w.toString(),h.toString(),k.toString());await j(t,g,m);let S=A([`function vouchWithConsent(uint256,uint256,uint256,uint256,${$},bytes)`]),q=[t.unsignedTx({to:c.pool,data:G({abi:S,functionName:"vouchWithConsent",args:[a,d,l(n.amount,"amount"),y,m.message,g.signature]}),value:"0",chainId:f,description:"Sponsor-owned backing handoff with exact current-owner consent."})],N=await t.preview(q,r);return{txs:q,summary:`Vouch ${n.amount} USDG base units from sponsor #${a} to agent #${d}; ${y} bps premium (cap ${k}). Replaces its old sponsor only with no loan open. ${N.summary}`}}}),i.push(...me(t)),{tools:i}}function me(t){return[{name:"priors_autopay_on",inputSchema:F("priors_autopay_on",[o,["cap","uint"],["budget","uint"],["savingsShares","uint"],["late","bool"]]),async execute(i,n){E(t),n=b(n);let r=l(i.agentId,"agentId"),a=l(i.cap,"cap"),d=l(i.budget,"budget"),g=l(i.savingsShares,"savingsShares");if(typeof i.late!="boolean")throw new u("late must be true or false.");if(await I(t,c.autopay,"VERSION() view returns (uint256)")!==2n)throw new u("AutoRepay VERSION is not 2.");let p=await I(t,c.autopay,"MAX_CAP() view returns (uint256)");if(a===0n||a>p||a>=1n<<32n||d<a||d===(1n<<256n)-1n||g===(1n<<256n)-1n)throw new u("Provide a positive supported per-loan cap and explicit finite budget at least cap; unlimited approvals are refused.");let w=await t.clientFor(f).readContract({address:c.registry,abi:ne,functionName:"getAgentWallet",args:[r]});if(b(w)!==n)throw new u("Autopay enrollment requires the ERC-8004 declared agent wallet, not just its owner or pool delegate.");if(g>0n&&b(String(await I(t,c.savings,"asset() view returns (address)")))!==c.usdg)throw new u("Savings asset is not USDG.");let h=g>0n?await I(t,c.savings,"previewRedeem(uint256) view returns (uint256)",[g]):0n,y=A(["function enroll(uint256,uint256,bool,bool)"]),k=[t.approval(c.usdg,c.autopay,d.toString(),f),t.approval(c.savings,c.autopay,g.toString(),f),t.unsignedTx({to:c.autopay,data:G({abi:y,functionName:"enroll",args:[r,a,g>0n,i.late]}),value:"0",chainId:f,description:"Enroll future autopay with explicit finite USDG and savings share budgets."})],m=await t.preview(k,n);return{txs:k,summary:`Persistent future spending authorization: AutoRepay v2 can repay agent #${r} loans without a confirmation per loan, at most ${a} USDG base units per loan; exact total wallet allowance ${d} USDG base units and ${g} savings shares (currently ${h} USDG base units). These two allowances replace the budgets shared by ALL this wallet autopay plans, including setting savings allowance to zero when disabled. late=${i.late}; savings=${g>0n}. Revoke with priors_autopay_off, which also clears both allowances. ${m.summary}`}}},{name:"priors_autopay_off",inputSchema:F("priors_autopay_off",[o]),async execute(i,n){E(t),n=b(n);let r=A(["function revoke(uint256)"]),a=[t.unsignedTx({to:c.autopay,data:G({abi:r,functionName:"revoke",args:[l(i.agentId,"agentId")]}),value:"0",chainId:f,description:"Revoke own autopay plan."}),t.approval(c.usdg,c.autopay,"0",f),t.approval(c.savings,c.autopay,"0",f)],d=await t.preview(a,n);return{txs:a,summary:`Revoke this wallet autopay plan and zero both shared AutoRepay allowances. This also stops funding other plans using this wallet. ${d.summary}`}}}]}export{oe as a,O as b,te as c,Y as d,l as e,M as f,pe as g,_e as h};
1
+ import{m as J,n as Z}from"./OD7CY6BY.js";import{a as x}from"./G2LAO23N.js";import{a as V}from"./66F5ZH34.js";import{b as K,c as X,g as C}from"./NWNYJ26T.js";import{b as f}from"./EWZFZUVF.js";import{a as u}from"./XSD5NL7J.js";import{encodeFunctionData as G,getAddress as b,hashTypedData as T,parseAbi as A,recoverTypedDataAddress as ie}from"viem";var oe={pool:b("0x281210097f0de7A8FB6F87310AF0f089c9C8DE21"),registry:b("0x8004A169FB4a3325136EB29fA0ceB6D2e539a432"),usdg:b("0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168"),priors:b("0xeDBf91223639800BCd5756815CAf908Df3b890bE"),stock:b("0xbEcd07EC689988e16b870C121756C4c2C8cb02B6"),backing:b("0xC999014C6218EC41f0aE412d49AE8f2aA4c539fD"),treasury:b("0xFe8fdf43c4b0443aCF8E8CD8facD62F1B770e267"),bond:b("0x346d3360B7258a18E8a2a55fe20E0F467113a53A"),autopay:b("0x72B510AF4e66e5960aB9b975e0BdCf80239e83A0"),savings:b("0xBeEff033F34C046626B8D0A041844C5d1A5409dd"),market:b("0x6a4583242B8313313E684d02aB7dc6bFf8749670"),market1:b("0xe5C8b3FacD7802099C1DfB88c0C818Cd0ebA7B19"),bidSpender:b("0x0dbd031a3e8cc91C2b0A3Bf6BD1d14c7AeD92878"),seats3:b("0x59D155C42A9263fA7596867b992bB3e84dF680a9"),seats4:b("0xb1c3a04496238D62E3c93118C297163855e22192")},c=oe,$="(uint256 agentId,uint256 sponsorId,address owner,uint256 maxPremiumBps,uint256 nonce,uint256 deadline)",ne=A(["function ownerOf(uint256) view returns (address)","function getAgentWallet(uint256) view returns (address)"]),z=A(["function nonces(uint256) view returns (uint256)"]),re=A(["function isValidSignature(bytes32,bytes) view returns (bytes4)"]),ae="0x0000000000000000000000000000000000000000",O="Owner stake is collateral, not a return. A default burns 75% of owner stake (50% of other backing); pending and leaving stake remains at risk until released. New backing waits 24 hours. Exit mode 0 holds, 1 returns PRIORS, 2 requests USDG through the guarded exit queue; no immediate payout is promised.",e=(t,i,n,r,a={})=>({name:`priors_${t}`,contract:i,signature:`function ${n}`,fields:r,note:"",...a}),o=["agentId","id"],v=["amount","uint"],Q=["on","bool"],_=["generation","uint32"],D=["day","uint32"],P=["layer","uint8"],s={read:!0},te=[e("set_delegate","pool","setDelegate(uint256,address)",[o,["delegate","address"]],{owner:"agentId",note:"Owner only. Delegate controls borrowing/repayment, not transfer of identity; clear with the zero address."}),e("root_enroll","pool","enrollRoot(uint256,uint256)",[o,v],{owner:"agentId",approval:"usdg",note:"Owner only. Locks USDG pool shares behind this sponsor root; active delegated lines and fees constrain withdrawals."}),e("root_add_stake","pool","addStake(uint256,uint256)",[o,v],{approval:"usdg",note:"Anyone may add USDG; only the root owner can withdraw it. This may give funds to another owner."}),e("root_unlock","pool","unlock(uint256,uint256,address)",[o,["shares","uint"]],{owner:"agentId",args:["agentId","shares","$wallet"],note:"Owner only. Withdraw root pool shares to this wallet, subject to delegated backing and fee locks."}),e("root_retire","pool","retireRoot(uint256)",[o],{owner:"agentId",note:"Owner only; requires no remaining stake or delegated lines."}),e("root_vouch","pool","vouch(uint256,uint256,uint256)",[["sponsorId","id"],o,v],{owner:"sponsorId",note:"Owner of sponsor only. Adds the exact USDG amount of undrawn backing to an existing sponsored line."}),e("root_unvouch","pool","unvouch(uint256,uint256,uint256)",[["sponsorId","id"],o,v],{owner:"sponsorId",note:"Owner of sponsor only. Recalls undrawn backing; outstanding debt remains backed."}),e("root_freeze","pool","freeze(uint256,bool)",[o,["frozen","bool"]],{note:"Current sponsor owner only; freeze/unfreeze the agent line. Contract checks sponsor ownership."}),e("root_set_premium","pool","setPremium(uint256,uint256)",[o,["premiumBps","uint"]],{note:"Current sponsor owner only. Future loan premium cannot exceed the owner-consented cap."}),e("root_claim_fees","pool","claimSponsorFees(uint256,address)",[o],{owner:"agentId",args:["agentId","$wallet"],note:"Owner only; claim sponsor USDG fees to this wallet."}),e("root_set_hook","pool","setHook(uint256,address)",[o,["hook","address"]],{owner:"agentId",note:"Owner only. Changes root lending policy hook; pool enforces the delay while backing is committed."}),e("root_apply_hook","pool","applyHook(uint256)",[o],{note:"Apply a previously scheduled root hook after its on-chain delay."}),e("mark_default","pool","markDefault(uint256)",[["loanId","id"]],{note:"Irreversible: mark a past-grace unpaid loan defaulted, burn sponsor backing and mark the owner. Preview and confirm deliberately."}),e("import_history","pool","importFromV1(uint256)",[o],{note:"Import the v1 record, including defaults; this never imports unbacked capacity."}),e("fund_reserve","pool","fundReserve(uint256)",[v],{approval:"usdg",note:"Donate USDG to the pool reserve; receives no redeemable shares."}),e("root_shares","pool","rootShares(uint256) view returns (uint256)",[o],s),e("root_fee_locked","pool","feeLocked(uint256) view returns (uint256)",[o],s),e("root_fees_owed","pool","sponsorFees(uint256) view returns (uint256)",[o],s),e("root_backing","pool","backing(uint256) view returns (uint256)",[o],s),e("root_free_backing","pool","freeBacking(uint256) view returns (uint256)",[o],s),e("pool_parameters","pool","getParams() view returns ((uint256 minLoan,uint256 maxLoan,uint64 minTerm,uint64 maxTerm,uint64 grace,uint64 minScoreTerm,uint256 feeBps,uint256 sponsorFeeBps,uint256 protocolFeeBps,uint256 minStake,uint256 maxUtilizationBps,uint256 keeperBounty))",[],s),e("bond_deposit","bond","deposit(uint256)",[o],{owner:"agentId",approval:"bond",note:"Owner only. V2 treasury bond remains locked while any line or loan is open; it may replace and refund a former owner bond. Leave and release the legacy bond before Treasury V5 migration."}),e("bond_release","bond","release(uint256)",[o],{note:"Return V2 bond to its original depositor, not necessarily this wallet; contract enforces no line, no loan and age."}),e("bond_slash","bond","slash(uint256)",[o],{note:"Irreversible: send defaulted agent V2 bond to the configured beneficiary."}),e("bond_status","bond","bonds(uint256) view returns ((address depositor,uint64 at,uint256 amount))",[o],s),e("bond_releasable","bond","releasable(uint256) view returns (bool)",[o],s),e("bond_release_at","bond","unusedReleaseAt(uint256) view returns (uint256)",[o],s),e("treasury_move","treasury",`move(uint256,${$},bytes)`,[o],{owner:"agentId",consentRoot:8793n,externalConsent:!0,args:["agentId","$consent","$signature"],note:"Move a former Treasury V4 line to V5, no loan open. Close old line, release legacy bond, deposit V2 bond first. V4 record and current-owner V2 bond are required."}),e("treasury_raise","treasury","raise(uint256)",[o],{note:"Raise an eligible Treasury V5 line using its current rules, score, history, age, weekly room and free backing. No unbacked credit."}),e("treasury_reclaim","treasury","reclaim(uint256)",[o],{note:"Reclaim an idle treasury line under on-chain rules; this ends borrowing access."}),e("treasury_first_line","treasury",`firstLine(uint256,uint64,bytes,${$},bytes)`,[o,["expiry","uint"],["invite","bytes"]],{owner:"agentId",consentRoot:8793n,externalConsent:!0,args:["agentId","expiry","invite","$consent","$signature"],note:"Redeem an already-issued Treasury V5 invite with V5 pool consent. Requires a valid V5 inviter signature; the current owner V2 bond is needed before borrowing. V4 invites cannot be reused."}),e("treasury_raise_room","treasury","raiseRoom() view returns (uint256)",[],s),e("treasury_first_lined","treasury","firstLined(uint256) view returns (bool)",[o],s),e("treasury_eligible_raise","treasury","eligibleForRaise(uint256) view returns (bool)",[o],s),e("treasury_room","treasury","epochRoom() view returns (uint256)",[],s),e("treasury_rules","treasury","rules() view returns (uint256 reserveBps,uint256 firstLine,uint256 secondLine,uint256 epochCap,uint64 epochLength,uint64 minSeasoning,uint256 minQualified,uint256 minScore,uint64 idleAfter)",[],s),e("stock_open","stock",`open(uint256,address,uint256,${$},bytes) returns (uint256)`,[o,["token","address"],v],{owner:"agentId",consentRoot:6424n,externalConsent:!0,approval:"stock",args:["agentId","token","amount","$consent","$signature"],note:"Owner or on-chain controller with a supplied owner consent posts exact collateral. Token must be accepted and usable; live price, LTV, line cap and backing determine the line. Default seizes debt plus buffer; issuer restrictions and burns may reduce returned collateral."}),e("stock_add","stock","addCollateral(uint256,uint256)",[o,v],{approval:"stock",note:"Depositor only. Adds exact position token collateral; contract decides resulting draw room."}),e("stock_close","stock","close(uint256)",[o],{note:"Depositor or controller closes/freezes the line; collateral pays its depositor after the last loan, subject to default and issuer shortfalls."}),e("stock_expire","stock","expire(uint256)",[o],{note:"Expire idle stock line after on-chain idle rules; may close borrowing access."}),e("stock_reconcile","stock","reconcile(uint256,uint256)",[o,["maxLoans","uint"]],{note:"Reconcile the collateral debt walk against pool loans; contract ignores maxLoans in this implementation."}),e("stock_settle","stock","settle(uint256,uint256)",[o,["loanId","id"]],{note:"Reconcile stock collateral after a default or missed hook; may seize collateral according to the loan."}),e("stock_record_feed","stock","record(address,uint256) returns (uint80)",[["feed","address"],["maxRounds","uint"]],{note:"Advance public oracle price tape; may unblock new stock lines and default settlement."}),e("stock_reclaim","stock","reclaim(uint256)",[o],{note:"Reclaim a written-off stock position after it is no longer backed; return remains subject to vault token shortfall."}),e("stock_state","stock","getPosition(uint256) view returns ((address depositor,address owner,address token,uint64 openedAt,bool closing,uint8 status,uint128 line,uint256 amount))",[o],s),e("stock_borrow_room","stock","borrowRoom(uint256) view returns (uint256)",[o],s),e("stock_asset_state","stock","assets(address) view returns (address feed,uint64 maxAge,uint8 tokenDecimals,uint8 feedDecimals,bool enabled,uint16 ltvBps,uint128 lineCap)",[["token","address"]],s),e("stock_lending_status","stock","lendStatus(address) view returns (uint8)",[["token","address"]],s),e("stock_value","stock","valueOf(address,uint256) view returns (bool ok,uint256 value)",[["token","address"],v],s),e("stock_ltv","stock","ltvOf(uint256,address) view returns (uint256)",[o,["token","address"]],s),e("backing_open","backing",`open(uint256,uint256,bool,${$},bytes)`,[o,v,["autoAdd","bool"]],{owner:"agentId",consentRoot:8762n,approval:"priors",args:["agentId","amount","autoAdd","$consent","$signature"],note:O}),e("backing_open_with_usdg","backing",`openWithUsdg(uint256,uint256,uint256,uint256,uint256,bool,${$},bytes)`,[o,["priorsIn","uint"],["usdgIn","uint"],["minOut","uint"],["deadline","uint"],["autoAdd","bool"]],{owner:"agentId",consentRoot:8762n,approval:"mixed",args:["agentId","priorsIn","usdgIn","minOut","deadline","autoAdd","$consent","$signature"],note:O}),e("backing_add","backing","back(uint256,uint256,bool)",[o,v,["autoAdd","bool"]],{approval:"priors",note:O+" Owner-only at launch; other backers require both global and individual permission."}),e("backing_add_with_usdg","backing","backWithUsdg(uint256,uint256,uint256,uint256,uint256,bool)",[o,["priorsIn","uint"],["usdgIn","uint"],["minOut","uint"],["deadline","uint"],["autoAdd","bool"]],{approval:"mixed",note:O}),e("backing_leave","backing","leave(uint256,uint256,uint8)",[o,v,["exitMode","uint8"]],{note:O}),e("backing_close","backing","close(uint256,uint8)",[o,["exitMode","uint8"]],{note:O}),...["refresh","promote","expire","sync","pokeFees","recordRepay","noteDelegate"].map(t=>e(`backing_${t.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`)}`,"backing",`${t}(uint256)`,[o],{note:"Reconcile this V5 book against current pool, owner, record, tier and backing rules; no payout is promised."})),...["setAutoAdd","setProtocolBacking","setOthersBacking"].map(t=>e(`backing_${t.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`)}`,"backing",`${t}(uint256,bool)`,[o,Q],{note:"Change this V5 book setting under the contract ownership/holder rules. Auto-add can compound rewards into stake at risk."})),e("backing_reconsent","backing",`reconsent(uint256,${$},bytes)`,[o],{owner:"agentId",consentRoot:8762n,args:["agentId","$consent","$signature"],note:"Owner only. Renew the pool consent for V5 backing."}),e("backing_release","backing","release(uint256,uint32,uint32,uint256,uint256)",[o,_,D,["minUsdgOut","uint"],["deadline","uint"]],{note:"Release caller day bucket after its release rule. Zero minUsdgOut returns PRIORS; positive requests a guarded sale. Stake stays burnable until release. Read generation/day from chain events."}),e("backing_release_for","backing","releaseFor(uint256,uint32,address,uint32)",[o,_,["holder","address"],D],{note:"Return eligible PRIORS to its holder under generation/day release rules, never redirect proceeds."}),e("backing_finish_close","backing","finishClose(uint256,uint32)",[o,_],{note:"Finish an eligible generation close; pays the bound owner under its release rules."}),e("backing_claim_settled","backing","claimSettled(uint256,uint32,address)",[o,_,["holder","address"]],{note:"Pay settled generation stake to the named holder, after any default burn."}),e("backing_claim_record","backing","claimSettled(uint256,uint32,address,uint8,uint32)",[o,_,["holder","address"],P,D],{note:"Pay settled day record to its holder after any default burn."}),e("backing_queue_exit","backing","queueExit(uint256,uint32,address,uint8,uint32)",[o,_,["holder","address"],P,D],{note:"Holder/keeper queues ready USDG-mode stake; minimum and queue window apply. A queue entry is not a fill or payout."}),e("backing_settle","backing","settle(uint256,uint32,uint256)",[o,_,["loanId","id"]],{note:"Reconcile V5 generation with a pool loan/default after a missed hook."}),e("backing_record_loan","backing","recordLoan(uint256)",[["loanId","id"]],{note:"Record current pool loan in V5 book."}),e("backing_record_default","backing","recordDefault(uint256)",[["loanId","id"]],{note:"Reconcile a marked pool default and its stake burn."}),e("backing_collect","backing","collect(uint256[],uint32[]) returns (uint256)",[["agentIds","ids"],["generations","gens"]],{note:"Collect caller fees for explicitly selected generations; auto-add settings may retain stake."}),e("backing_fund","backing","fund(uint256)",[v],{approval:"usdg",note:"Donate USDG to V5 root backing; donor receives no withdrawable claim."}),e("backing_book","backing","getGen(uint256,uint32) view returns ((address owner,uint64 openedAt,uint8 status,bool ownerChanged,bool optOut,bool othersOff,bool pointsVoid,bool openRoomCharged,bool closedByOwner,bool movePending,bool splitPending,uint64 movePendingAt,uint8 tier,uint8 countedAtTier,uint8 listLen,uint32 tierStep,uint64 tierSince,uint64 lastLateAt,uint64 closedMark,uint64 lastRaiseAt,uint64 promoEpoch,uint64 stakeEpoch,uint64 placeEpoch,uint160 movePendingSqrt,uint256 roomLine,uint256 openLine,uint256 promoCredit,uint256 stakeRaised,uint256 placed,uint256 index,uint256 divisor,uint256 defaultProof,uint256 cLive,uint256 cUnits,uint256[3] list,uint256[3] counted,uint256[3] pendingTok,uint256[3] leavingLive,uint256[3] tokens,uint64[3] layerEnd,uint160[3] endSqrt,uint8[3] ownerEndMode,uint32[2][3] liveDay,uint32[3] leaveHead,(uint64 epoch,uint192 points)[5] points))",[o,_],s),e("backing_generation","backing","latestGen(uint256) view returns (uint32)",[o],s),e("backing_line","backing","lineOf(uint256) view returns (uint256)",[o],s),e("backing_quote","backing","needed(uint256,uint256,bool) view returns ((uint256 minA,uint256 fullLine,uint256 capA,uint160 sqrtP,uint8 k,uint8 kCached,bool depthGuard,uint256 line,uint256 ownerA,uint256 ownBacking,uint256 roomB,uint256 lineIfAdded,uint256 weekAfter))",[o,["tokens","uint"],["asOwner","bool"]],s),e("backing_position","backing","position(uint256,uint32,uint8,address) view returns ((uint256 counted,uint256 checkpoint,uint256 a0,uint256 a1,uint32 d0,uint32 d1,bool autoAdd))",[o,_,P,["holder","address"]],s),e("backing_record","backing","record(uint256,uint32,uint8,uint32,address) view returns ((uint256 counted,uint256 uncounted,uint256 creditedTo,uint160 sqrtLeave,uint8 mode,uint64 entry))",[o,_,P,D,["holder","address"]],s),e("backing_bucket","backing","leavingBucket(uint256,uint32,uint8,uint32) view returns ((bool exists,bool retired,uint64 latestLeave,uint64 releasableAt,uint256 loanCount,uint256 counted,uint256 uncounted,uint256 retireIndex))",[o,_,P,D],s),e("backing_settings","backing","settings() view returns (bool openBacking,uint256 premiumCap,uint256 maxSwapUsdg,uint256 openRoom,uint256 raiseRoom,uint256 vouchCap,uint8 minDrawK,bool premiumCheck,uint64 pausedUntil)",[],s),e("backing_reopen_at","backing","reopenAt(uint256) view returns (uint64)",[o],s),e("backing_sync_prices","backing","sync()",[],{note:"Update global V5 price/guard observations."}),e("backing_exit_service_open","backing","exitServiceOpen() view returns (bool)",[],s),e("backing_usdg_path","backing","usdgPathOpen(uint256) view returns (bool,uint8)",[["usdgIn","uint"]],s),e("backing_entry_rule","backing","entryRule() view returns (uint8 minEntryLoans,uint32 minEntryDays)",[],s),e("backing_target_premium","backing","targetPremiumBps(uint256) view returns (uint256)",[o],s),e("backing_price_cache","backing","priceCache() view returns (uint160 sqrtMedian,uint64 obsAt,uint160 sqrtWeekLow,uint160 sqrtObservation)",[],s),e("backing_pending_bucket","backing","pendingBucket(uint256,uint32,uint8,uint32) view returns ((uint128 amount,uint64 lastDeposit,bool merged,bool dead,uint256 mergeIndex))",[o,_,P,D],s),e("backing_exit_head","backing","exitHead() view returns (uint256 entryId,address holder,uint256 rest,uint160 sqrtPLeave,uint64 joinedAt)",[],s),e("backing_exit_entry","backing","entry(uint256) view returns ((uint256 id,uint32 gen,uint8 layer,uint32 day,address holder,uint64 joinedAt,uint64 prev,uint64 next))",[["entryId","uint"]],s),e("backing_flush","backing","flush()",[],{note:"Reconcile V5 fees and backing buffers; no payout to caller is promised."}),e("backing_claimable","backing","claimable(address) view returns (uint256)",[],{...s,args:["$wallet"]}),e("autopay_hold","autopay","hold(bool)",[Q],{note:"Hold/resume future autopay attempts for this wallet; allowances remain until explicitly revoked."}),e("autopay_max_cap","autopay","MAX_CAP() view returns (uint256)",[],s),e("autopay_window","autopay","WINDOW() view returns (uint64)",[],s),e("autopay_paused_until","autopay","pausedUntil() view returns (uint64)",[],s),e("autopay_plan","autopay","planOf(address,uint256) view returns (uint32 cap,address owner,bool on,bool useSavings,bool late,uint32 epoch)",[o],{...s,args:["$wallet","agentId"]}),e("autopay_check","autopay","check(uint256) view returns ((uint8 status,uint256 agentId,uint256 due,uint64 opens,uint64 closes,address wallet,uint256 fromWallet,uint256 fromWalletSavings,address owner,uint256 fromOwner,uint256 fromOwnerSavings))",[["loanId","id"]],s),e("autopay_epoch","autopay","epochOf(uint256) view returns (uint32 epoch,bool stale)",[o],s),e("autopay_held","autopay","held(address) view returns (bool)",[],{...s,args:["$wallet"]}),e("savings_deposit","savings","deposit(uint256,address) returns (uint256)",[v],{approval:"usdg",args:["amount","$wallet"],note:"Deposit own USDG into Priors default external Morpho savings vault; vault/allocator risk and withdrawal liquidity apply."}),e("savings_withdraw","savings","withdraw(uint256,address,address) returns (uint256)",[v],{args:["amount","$wallet","$wallet"],note:"Withdraw exact USDG amount from own savings. Insufficient liquidity fails the preview; no immediate exit is promised."}),e("savings_redeem","savings","redeem(uint256,address,address) returns (uint256)",[["shares","uint"]],{args:["shares","$wallet","$wallet"],note:"Redeem exact own savings shares to this wallet; liquidity and rounding apply."}),e("savings_balance","savings","balanceOf(address) view returns (uint256)",[],{...s,args:["$wallet"]}),e("savings_value","savings","previewRedeem(uint256) view returns (uint256)",[["shares","uint"]],s),...["market","market1"].flatMap((t,i)=>[e(`market_v${i===0?2:1}_listing`,t,"listingOf(uint256) view returns ((address seller,uint256 price,uint64 expiry,uint256 nonce,bytes32 uriHash,uint256 loansRepaid))",[o],s),e(`market_v${i===0?2:1}_record_hash`,t,"recordHash(uint256) view returns (bytes32)",[o],s),e(`market_v${i===0?2:1}_list`,t,"list(uint256,uint256,uint64)",[o,["price","uint"],["expiry","uint"]],{owner:"agentId",approval:"nft",note:"Owner sells this ERC-8004 NFT, its record and any followed treasury line. This does not transfer code, keys or servers. Approves only this NFT; confirm the sale terms and contract-enforced hold/line rules."}),e(`market_v${i===0?2:1}_cancel`,t,"cancel(uint256)",[o],{note:"Cancel the standing listing; NFT approval can remain until explicitly cleared."}),e(`market_v${i===0?2:1}_buy`,t,"buy(uint256,uint256,uint256,bytes32,bytes32)",[o,["maxPrice","uint"],["nonce","uint"],["uriHash","bytes32"],["recordHash","bytes32"]],{approval:"market",note:"Buy an ERC-8004 NFT to this wallet with exact live asking-price approval and pinned listing nonce, tokenURI and current credit record. A followed line still needs the new owner bond before borrowing. No keys/code/servers are included."})]),e("market_bid","market","bid(uint256,uint256,uint64,bytes32,uint256,uint256) returns (uint256)",[o,["price","uint"],["expiry","uint"],["uriHash","bytes32"],["minRepaid","uint"],["minLine","uint"],["reserveBudget","uint"]],{args:["agentId","price","expiry","uriHash","minRepaid","minLine"],approval:"bid",note:"Standing future purchase authority: another owner can fill this bid later without a new click. Exact reserveBudget USDG allowance is shared by all this wallet bids and replaces the old allowance. Cancel bid and clear unused budget deliberately."}),e("market_bid_any","market","bidAny(bytes32,uint256,uint256,uint64,uint256,uint256) returns (uint256)",[["root","bytes32"],["count","uint"],["price","uint"],["expiry","uint"],["minRepaid","uint"],["minLine","uint"],["reserveBudget","uint"]],{args:["root","count","price","expiry","minRepaid","minLine"],approval:"bid",note:"Standing future authority to buy count identities committed by the explicit Merkle root; shared exact reserveBudget USDG allowance. Inspect the committed ID list before authorizing. No code, keys or servers transfer."}),e("market_cancel_bid","market","cancelBid(uint256)",[["bidId","id"]],{note:"Cancel this bid; shared USDG allowance is unchanged so other bids can still fill."}),e("market_accept_bid","market","acceptBid(uint256,uint256,bytes32[],uint256)",[["bidId","id"],o,["proof","proof"],["minNet","uint"]],{owner:"agentId",approval:"nft",note:"Sell only this NFT into a currently valid bid; minNet pins seller USDG proceeds. Merkle proof and current bid rules are checked on chain during preview."}),e("market_bid_state","market","bidOf(uint256) view returns ((address maker,uint64 expiry,uint16 left,bool any,uint96 price,uint96 minLine,uint64 minRepaid,bytes32 target,bytes32 uriHash))",[["bidId","id"]],s),e("market_builder","market","builderOf(uint256) view returns ((address to,uint16 bps))",[o],s),e("market_set_builder","market","setBuilder(uint256,address,uint256)",[o,["to","address"],["bps","uint"]],{owner:"agentId",note:"Owner-only attribution before first sale; assigns future sale revenue share to to. Contract enforces enabled switch, no listing, and maximum 500 bps."}),e("market_change_builder","market","changeBuilder(uint256,address,uint256)",[o,["to","address"],["bps","uint"]],{note:"Current builder only; may lower or redirect own revenue share, never increase it."}),e("market_sale_split","market","saleSplit(uint256) view returns (uint256 fee,uint256 share,uint256 net)",[o],s),...["seats3","seats4"].flatMap((t,i)=>[e(`legacy_v${i+3}_close`,t,"close(uint256)",[o],{note:"Existing seat only. Close/freeze and return stake to original staker after final loan; default burn still applies. No new seats are opened."}),e(`legacy_v${i+3}_withdraw_offer`,t,"withdrawOffer(uint256,address)",[o],{args:["agentId","$wallet"],note:"Withdraw caller unaccepted offer; PRIORS returns to the staker."}),e(`legacy_v${i+3}_expire`,t,"expire(uint256)",[o],{note:"Expire idle seat under current contract rules."}),e(`legacy_v${i+3}_settle`,t,"settle(uint256,uint256)",[o,["loanId","id"]],{note:"Reconcile existing seat against pool loan/default after a missed hook."}),e(`legacy_v${i+3}_claim`,t,"claim(address) returns (uint256)",[],{args:["$wallet"],note:"Claim caller legacy seat USDG fees to this wallet."}),e(`legacy_v${i+3}_seat`,t,"getSeat(uint256) view returns ((address staker,uint64 openedAt,bool closing,uint8 status,uint128 line,uint128 burnBps,uint256 amount,uint256 feeMark,address owner))",[o],s),e(`legacy_v${i+3}_pending_fees`,t,"pendingFees(uint256) view returns (uint256)",[o],s),e(`legacy_v${i+3}_fees`,t,"feesOwed(address) view returns (uint256)",[],{...s,args:["$wallet"]}),e(`legacy_v${i+3}_offer`,t,"offers(uint256,address) view returns (uint256)",[o],{...s,args:["agentId","$wallet"]})])];function Y(t){return JSON.parse(JSON.stringify(t,(i,n)=>typeof n=="bigint"?n.toString():n))}function l(t,i,n=256){if(typeof t!="string"||!/^[0-9]+$/.test(t)||BigInt(t)>=1n<<BigInt(n))throw new u(`${i} must be a decimal base-unit string fitting uint${n}.`);return BigInt(t)}function se(t,[i,n]){let r=t[i];if(n==="address"){if(typeof r!="string"||!K.test(r))throw new u(`${i} must be a token or wallet address.`);return b(r)}if(n==="bool"){if(typeof r!="boolean")throw new u(`${i} must be true or false.`);return r}if(n==="bytes32"){if(typeof r!="string"||!/^0x[0-9a-fA-F]{64}$/.test(r))throw new u(`${i} must be bytes32.`);return r}if(n==="proof"){if(!Array.isArray(r)||r.length>32||!r.every(d=>typeof d=="string"&&/^0x[0-9a-fA-F]{64}$/.test(d)))throw new u("proof needs at most 32 bytes32 hashes.");return r}if(n==="bytes"){if(typeof r!="string"||!/^0x(?:[0-9a-fA-F]{2})*$/.test(r)||r.length>32770)throw new u(`${i} must be bounded hexadecimal bytes.`);return r}if(n==="ids"||n==="gens"){if(!Array.isArray(r)||r.length===0||r.length>100)throw new u(`${i} needs 1 to 100 decimal strings.`);return r.map(d=>l(d,i,n==="gens"?32:256))}let a=l(r,i,n==="uint8"?8:n==="uint32"?32:256);if(n==="id"&&a===0n)throw new u(`${i} must be positive.`);if(i==="exitMode"&&a>2n)throw new u("exitMode must be 0 (hold), 1 (PRIORS), or 2 (USDG queue).");if(i==="layer"&&a>2n)throw new u("layer must be 0, 1, or 2.");return a}var R=x.amount("USDG",6,"1000000"),L=x.amount("PRIORS",18,"1000000000000000000"),H='Amount of the stock token in base units (read its decimals with priors_stock_asset_state). Example: "1000000000000000000" = 1 token at 18 decimals.',ue={priors_root_enroll:R,priors_root_add_stake:R,priors_root_vouch:R,priors_root_unvouch:R,priors_root_offer:R,priors_fund_reserve:R,priors_backing_fund:R,priors_savings_deposit:R,priors_savings_withdraw:R,priors_stock_open:H,priors_stock_add:H,priors_stock_value:H,priors_backing_open:L,priors_backing_add:L,priors_backing_leave:L},B={agentId:'ERC-8004 agent ID, as a decimal string. Example: "437".',sponsorId:'ERC-8004 ID of the sponsor root, as a decimal string. Example: "6228".',loanId:x.id("Priors pool loan"),bidId:x.id("AgentMarket V2 bid"),entryId:x.id("V5 exit-queue entry"),delegate:"Address to appoint as pool delegate (borrow and repay only, never identity transfer); the zero address clears it.",frozen:"true freezes the agent line; false unfreezes it.",premiumBps:"Loan premium in basis points (50 = 0.5%); at most the owner-consented cap.",maxPremiumBps:'Owner-consented maximum sponsor premium in basis points (50 = 0.5%), at most 200. Default "0".',hook:"Address of the root lending-policy hook contract (0x followed by 40 hex digits).",expiry:"Expiry in Unix seconds. Market listings and bids allow at most 30 days ahead; a V5 invite uses its issued expiry.",invite:"Treasury V5 inviter signature bytes as 0x hex, exactly as issued.",token:"Address of the stock token (0x followed by 40 hex digits); it must be an accepted Priors stock collateral.",maxLoans:"Loan count bound passed to reconcile, as a decimal string; this contract version ignores it.",feed:"Address of the public oracle price feed to record (0x followed by 40 hex digits).",maxRounds:"Maximum oracle rounds to record in this call, as a decimal string.",autoAdd:"true compounds rewards into the stake at risk; false leaves them out.",priorsIn:x.amount("PRIORS",18,"1000000000000000000"),usdgIn:x.amount("USDG",6,"1000000"),minOut:"Minimum PRIORS received from the USDG conversion, in base units (PRIORS has 18 decimals); must be positive when usdgIn is.",deadline:"Deadline in Unix seconds, within the next hour. Example: 1800000000.",exitMode:x.enumValues({0:"hold",1:"return PRIORS",2:"request USDG through the guarded exit queue"}),generation:"V5 book generation number, as a decimal string; read it from priors_backing_generation or chain events.",day:"Day bucket number, as a decimal string, read from chain events; never guess it.",layer:'Backing layer "0", "1" or "2", as recorded in chain events.',holder:"Address of the stake holder; any payout goes only to this holder.",minUsdgOut:'"0" returns PRIORS; a positive value requests a guarded USDG sale with this minimum, in USDG base units (6 decimals).',agentIds:"ERC-8004 agent IDs as decimal strings, paired by position with generations (1 to 100).",generations:"Generation numbers as decimal strings, paired by position with agentIds.",tokens:'PRIORS amount in base units (PRIORS has 18 decimals) passed to the contract needed() quote. Example: "0".',asOwner:"true quotes as the agent owner; false as another backer.",price:'Price per identity in USDG base units (6 decimals); minimum "5000000" = 5 USDG.',maxPrice:"Highest asking price you accept, in USDG base units (6 decimals); read the listing first.",nonce:"Listing nonce from the listing read, as a decimal string; it pins the exact listing.",uriHash:"bytes32 hash of the agent tokenURI (0x followed by 64 hex digits), from the listing or priors_market_pins.",recordHash:"bytes32 hash of the agent credit record (0x followed by 64 hex digits), from priors_market_v1/v2_record_hash.",minRepaid:"Minimum repaid-loan count in the agent record for the bid to fill, as a decimal string.",minLine:"Minimum credit line the agent must carry for the bid to fill, in USDG base units (6 decimals).",reserveBudget:"Exact USDG allowance shared by all bids of this wallet, in base units (6 decimals); must cover price times count.",root:"Merkle root (bytes32) committing the agent ID list; rebuild it with priors_market_origin.",count:"Number of identities to buy from the committed list, 1 to 20, as a decimal string.",proof:"Merkle proof for this agent in the bid root: at most 32 bytes32 hashes.",minNet:"Minimum seller USDG proceeds, in base units (USDG has 6 decimals).",to:x.recipient("builder sale share recipient"),bps:"Builder sale share in basis points (50 = 0.5%); at most 500.",on:"true turns this setting on; false turns it off.",cap:'Per-loan repayment cap in USDG base units (USDG has 6 decimals), at most the contract MAX_CAP. Example: "5000000" = 5 USDG.',budget:"Total USDG allowance for AutoRepay in base units (6 decimals); at least cap, and shared by all plans of this wallet.",savingsShares:'Savings vault share allowance in base units (read the vault decimals); "0" disables savings use.',late:"AutoRepay late flag stored in the plan (true or false); read priors_autopay_plan to confirm it.",continuation:"Opaque state from the previous step; pass it back unchanged. Never build it by hand.",signature:"Local signature for the confirmed step, as 0x hex; the bridge supplies it. Never a key."},de={priors_root_unlock:"Root pool shares to withdraw, in pool share base units (read root_shares); not USDG.",priors_savings_redeem:"Savings vault shares to redeem, in base units (read the vault decimals); not USDG.",priors_savings_value:"Savings vault shares to value, in base units (read the vault decimals); not USDG."};function le(t,i){return i==="amount"?ue[t]:i==="shares"?de[t]:t==="priors_autopay_hold"&&i==="on"?"true holds future autopay attempts; false resumes them.":B[i]}function ce(t,i,n){let r=le(t,i);return r===void 0?n:{...n,description:r}}function F(t,i,n={}){return{type:"object",additionalProperties:!1,required:i.map(([r])=>r),properties:Object.fromEntries([...i.map(([r,a])=>[r,ce(t,r,a==="bool"?{type:"boolean"}:a==="address"?X:a==="proof"?{type:"array",maxItems:32,items:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$"}}:a==="ids"||a==="gens"?{type:"array",maxItems:100,items:V()}:{type:"string",...a==="bytes32"?{pattern:"^0x[0-9a-fA-F]{64}$"}:a!=="bytes"?{pattern:"^[0-9]+$"}:{}})]),...Object.entries(n)])}}async function I(t,i,n,r=[]){let a=[`function ${n}`],d=A(a);return t.clientFor(f).readContract({address:i,abi:d,functionName:d[0].name,args:r})}async function U(t,i){return b(await t.clientFor(f).readContract({address:c.registry,abi:ne,functionName:"ownerOf",args:[i]}))}function E(t){if(t.network==="testnet")throw new u("Priors ecosystem features are configured only on chain 4663.")}function M(t,i,n,r,a,d="0"){return{domain:Z(),types:{Consent:[...J.Consent]},primaryType:"Consent",message:{agentId:t,sponsorId:i,owner:b(n),nonce:r,deadline:a,maxPremiumBps:d}}}async function j(t,i,n){if(!i||!i.request||T(i.request)!==T(n)||typeof i.signature!="string"||!/^0x(?:[a-fA-F0-9]{2}){1,4096}$/.test(i.signature))throw new u("Consent differs from this agent, sponsor, owner, premium cap, nonce or deadline.");let r=n.message.owner,a=await t.clientFor(f).getCode({address:r});if(a&&a!=="0x"){if(await t.clientFor(f).readContract({address:r,abi:re,functionName:"isValidSignature",args:[T(n),i.signature]})!=="0x1626ba7e")throw new u("The owner contract rejected the consent signature.")}else if(!C(await ie({...n,signature:i.signature}),r))throw new u("The consent signature is not from the current agent owner.")}function pe(t,i,n,r,a,d){let g=te.find(k=>k.name===t),p=t==="priors_sign_consent"?l(i.sponsorId,"sponsorId"):g?.consentRoot;if(!p||a.stage!=="priors_consent"||a.tool!==t||a.wallet!==b(n)||a.chainId!==f||a.agentId!==i.agentId||r.length!==1||r[0]?.kind!=="typedData")throw new u("Unexpected Priors consent continuation.");let w=l(a.nonce,"nonce").toString(),h=l(a.deadline,"deadline");if(h<=BigInt(d)||h>BigInt(d+3600))throw new u("Priors consent expired or exceeds its one-hour window.");let y=M(String(i.agentId),p.toString(),n,w,h.toString(),String(i.maxPremiumBps??"0"));if(!r[0].request||T(r[0].request)!==T(y))throw new u("Priors consent differs from the requested agent, root, owner or premium.")}async function ee(t,i,n,r,a){let d=l(n.agentId,"agentId");if(!C(await U(t,d),r))throw new u("This operation requires the current identity owner wallet; a delegate cannot consent. Use the owner wallet.");let g=await t.clientFor(f).readContract({address:c.pool,abi:z,functionName:"nonces",args:[d]}),p=n.continuation,w=p?l(p.deadline,"deadline"):BigInt(Math.floor(Date.now()/1e3)+1800),h=l(n.maxPremiumBps??"0","maxPremiumBps");if(n.signature!==void 0&&!n.continuation)throw new u("A signature needs its locally confirmed Priors consent continuation.");if(h>200n)throw new u("maxPremiumBps exceeds the pool maximum of 200.");let y=M(d.toString(),a.toString(),r,g.toString(),w.toString(),h.toString());if(!p)return{steps:[{kind:"typedData",request:y}],continuation:{stage:"priors_consent",tool:i,wallet:r,chainId:f,agentId:d.toString(),nonce:g.toString(),deadline:w.toString()},summary:`Owner consent to sponsor #${a} for agent #${d}, premium cap ${h} bps; expires ${w}. No funds move from this signature. The local bridge must confirm the exact EIP-712 fields.`};if(pe(i,n,r,[{kind:"typedData",request:y}],p,Math.floor(Date.now()/1e3)),String(p.nonce)!==g.toString())throw new u("Priors consent nonce changed. Start the action again.");let k={request:y,signature:n.signature};return await j(t,k,y),{signedConsent:k}}async function ge(t,i,n,r){let a=c[i.contract],d=(p,w)=>w>0n?[t.approval(p,a,w.toString(),f)]:[];if(i.approval==="nft"){let p=l(n.agentId,"agentId"),w=await Promise.all([c.market,c.market1].map(h=>I(t,h,"listingOf(uint256) view returns ((address seller,uint256 price,uint64 expiry,uint256 nonce,bytes32 uriHash,uint256 loansRepaid))",[p])));for(let h of w){if(!h||typeof h!="object"||!("seller"in h)||typeof h.seller!="string")throw new u("Could not verify standing listings on both Priors markets; no NFT approval was built.");if(C(h.seller,r))throw new u("A standing listing in Priors market V1 or V2 could reactivate when NFT approval mines. Cancel it with priors_market_v1_cancel or priors_market_v2_cancel, verify both listings are cleared, then retry. No approval was built.")}return[t.approval(c.registry,a,p.toString(),f)]}if(i.approval==="market"){let p=await I(t,a,"listingOf(uint256) view returns ((address seller,uint256 price,uint64 expiry,uint256 nonce,bytes32 uriHash,uint256 loansRepaid))",[l(n.agentId,"agentId")]);if(p.price<=0n||p.price>l(n.maxPrice,"maxPrice")||p.nonce!==l(n.nonce,"nonce")||!C(p.uriHash,String(n.uriHash)))throw new u("Listing price, nonce or URI changed; read the listing again.");return d(c.usdg,p.price)}if(i.approval==="bid"){let p=l(n.reserveBudget,"reserveBudget");if(p>=1n<<128n||p<l(n.price,"price")*l(n.count??"1","count"))throw new u("Provide a finite exact bid reserve covering price times count.");return[t.approval(c.usdg,c.bidSpender,p.toString(),f)]}if(i.approval==="bond")return d(c.usdg,BigInt(await I(t,c.bond,"amount() view returns (uint256)")));if(i.approval==="mixed"){let p=l(n.priorsIn,"priorsIn"),w=l(n.usdgIn,"usdgIn");if(p+w===0n)throw new u("Provide a positive PRIORS or USDG input.");if(w>0n&&l(n.minOut,"minOut")===0n)throw new u("USDG conversion requires a positive minimum PRIORS output.");return[...d(c.priors,p),...d(c.usdg,w)]}if(!i.approval)return[];let g=l(n.amount,"amount");if(g===0n)throw new u("amount must be positive.");if(i.approval==="stock"){let p=i.name==="priors_stock_open"?b(String(n.token)):b((await I(t,c.stock,"getPosition(uint256) view returns ((address depositor,address owner,address token,uint64 openedAt,bool closing,uint8 status,uint128 line,uint256 amount))",[l(n.agentId,"agentId")])).token);if(p===ae)throw new u("No stock collateral position exists.");return d(p,g)}return d(c[i.approval],g)}function _e(t){let i=te.map(n=>({name:n.name,inputSchema:{...F(n.name,n.fields,n.consentRoot?{maxPremiumBps:V(B.maxPremiumBps),continuation:{type:"object",description:B.continuation},signature:{type:"string",pattern:"^0x([a-fA-F0-9]{2})+$",description:B.signature},...n.externalConsent?{signedConsent:{type:"object",description:"Optional public owner signature from priors_sign_consent; controller may supply collateral. Never pass a key."}}:{}}:{}),description:n.note||"Read current Priors contract state. All amounts are token base-unit decimal strings."},async execute(r,a){E(t),a=b(a);let d=Object.fromEntries(n.fields.map(m=>[m[0],se(r,m)]));if(n.owner&&!(n.externalConsent&&r.signedConsent)&&!C(await U(t,d[n.owner]),a))throw new u("Owner-only feature: call from the current identity owner wallet. Nothing was signed.");if(n.contract==="savings"&&b(String(await I(t,c.savings,"asset() view returns (address)")))!==c.usdg)throw new u("The savings vault asset is not USDG. Nothing was signed.");if(n.contract==="autopay"&&await I(t,c.autopay,"VERSION() view returns (uint256)")!==2n)throw new u("AutoRepay VERSION is not 2. Nothing was signed.");if(n.contract==="market"||n.contract==="market1"){if(r.expiry!==void 0){let m=l(r.expiry,"expiry",64),S=BigInt(Math.floor(Date.now()/1e3));if(m<=S||m>S+2592000n)throw new u("Market expiry must be within 30 days.")}if(r.price!==void 0&&l(r.price,"price")<5000000n)throw new u("Market price minimum is 5 USDG.");if(r.count!==void 0&&(l(r.count,"count")<1n||l(r.count,"count")>20n))throw new u("Bid count must be 1 to 20.")}if(n.name==="priors_treasury_first_line"&&l(r.expiry,"expiry",64)<=BigInt(Math.floor(Date.now()/1e3)))throw new u("Treasury V5 invite expired.");if(r.deadline!==void 0){let m=l(r.deadline,"deadline"),S=BigInt(Math.floor(Date.now()/1e3));if(m<=S||m>S+3600n)throw new u("deadline must be in the next hour.")}if(r.agentIds&&r.agentIds.length!==r.generations.length)throw new u("agentIds and generations must have equal length.");let g;if(n.consentRoot)if(n.externalConsent&&r.signedConsent){if(g=r.signedConsent,!g.request?.message)throw new u("Provide the public signedConsent from the current identity owner.");let m=l(r.agentId,"agentId"),S=await U(t,m),q=await t.clientFor(f).readContract({address:c.pool,abi:z,functionName:"nonces",args:[m]}),N=l(g.request.message.deadline,"consent deadline");if(N<=BigInt(Math.floor(Date.now()/1e3)))throw new u("Owner consent expired.");let W=l(r.maxPremiumBps??"0","maxPremiumBps");if(W>200n)throw new u("maxPremiumBps exceeds the pool cap.");await j(t,g,M(m.toString(),n.consentRoot.toString(),S,q.toString(),N.toString(),W.toString()))}else{let m=await ee(t,n.name,r,a,n.consentRoot);if("steps"in m)return m;g=m.signedConsent}let p=(n.args??n.fields.map(([m])=>m)).map(m=>m==="$wallet"?a:m==="$consent"?g.request.message:m==="$signature"?g.signature:d[m]),w=A([n.signature]),h=w[0].name;if(n.read)return{chainId:f,contract:c[n.contract],units:"Base units; USDG 6 decimals, PRIORS 18 decimals; stock/savings scales come from token metadata.",value:Y(await t.clientFor(f).readContract({address:c[n.contract],abi:w,functionName:h,args:p}))};let y=[...await ge(t,n,r,a),t.unsignedTx({to:c[n.contract],data:G({abi:w,functionName:h,args:p}),value:"0",chainId:f,description:`${n.name}: ${n.note}`})],k=await t.preview(y,a);return{txs:y,summary:`${n.note} Inputs (base units): ${JSON.stringify(Y(d))}. ${k.summary}`}}}));return i.push({name:"priors_sign_consent",inputSchema:F("priors_sign_consent",[o,["sponsorId","id"],["maxPremiumBps","uint"]],{continuation:{type:"object",description:B.continuation},signature:{type:"string",pattern:"^0x([a-fA-F0-9]{2})+$",description:B.signature}}),async execute(n,r){return E(t),ee(t,"priors_sign_consent",n,b(r),l(n.sponsorId,"sponsorId"))}}),i.push({name:"priors_root_offer",inputSchema:F("priors_root_offer",[["sponsorId","id"],o,v,["premiumBps","uint"]],{signedConsent:{type:"object",description:"The current agent owner output of priors_sign_consent. This is public signed authorization, never a private key."}}),async execute(n,r){E(t),r=b(r);let a=l(n.sponsorId,"sponsorId"),d=l(n.agentId,"agentId");if(!C(await U(t,a),r))throw new u("Only the sponsor root owner can send this offer.");let g=n.signedConsent;if(!g?.request?.message)throw new u("Ask the current agent owner to run priors_sign_consent from their wallet first.");let p=g.request.message,w=await t.clientFor(f).readContract({address:c.pool,abi:z,functionName:"nonces",args:[d]}),h=l(p.deadline,"consent deadline");if(h<=BigInt(Math.floor(Date.now()/1e3)))throw new u("Owner consent expired; request a fresh consent.");let y=l(n.premiumBps,"premiumBps"),k=l(p.maxPremiumBps,"maxPremiumBps");if(y>k||k>200n)throw new u("premiumBps exceeds the owner consent or pool cap.");let m=M(d.toString(),a.toString(),await U(t,d),w.toString(),h.toString(),k.toString());await j(t,g,m);let S=A([`function vouchWithConsent(uint256,uint256,uint256,uint256,${$},bytes)`]),q=[t.unsignedTx({to:c.pool,data:G({abi:S,functionName:"vouchWithConsent",args:[a,d,l(n.amount,"amount"),y,m.message,g.signature]}),value:"0",chainId:f,description:"Sponsor-owned backing handoff with exact current-owner consent."})],N=await t.preview(q,r);return{txs:q,summary:`Vouch ${n.amount} USDG base units from sponsor #${a} to agent #${d}; ${y} bps premium (cap ${k}). Replaces its old sponsor only with no loan open. ${N.summary}`}}}),i.push(...me(t)),{tools:i}}function me(t){return[{name:"priors_autopay_on",inputSchema:F("priors_autopay_on",[o,["cap","uint"],["budget","uint"],["savingsShares","uint"],["late","bool"]]),async execute(i,n){E(t),n=b(n);let r=l(i.agentId,"agentId"),a=l(i.cap,"cap"),d=l(i.budget,"budget"),g=l(i.savingsShares,"savingsShares");if(typeof i.late!="boolean")throw new u("late must be true or false.");if(await I(t,c.autopay,"VERSION() view returns (uint256)")!==2n)throw new u("AutoRepay VERSION is not 2.");let p=await I(t,c.autopay,"MAX_CAP() view returns (uint256)");if(a===0n||a>p||a>=1n<<32n||d<a||d===(1n<<256n)-1n||g===(1n<<256n)-1n)throw new u("Provide a positive supported per-loan cap and explicit finite budget at least cap; unlimited approvals are refused.");let w=await t.clientFor(f).readContract({address:c.registry,abi:ne,functionName:"getAgentWallet",args:[r]});if(b(w)!==n)throw new u("Autopay enrollment requires the ERC-8004 declared agent wallet, not just its owner or pool delegate.");if(g>0n&&b(String(await I(t,c.savings,"asset() view returns (address)")))!==c.usdg)throw new u("Savings asset is not USDG.");let h=g>0n?await I(t,c.savings,"previewRedeem(uint256) view returns (uint256)",[g]):0n,y=A(["function enroll(uint256,uint256,bool,bool)"]),k=[t.approval(c.usdg,c.autopay,d.toString(),f),t.approval(c.savings,c.autopay,g.toString(),f),t.unsignedTx({to:c.autopay,data:G({abi:y,functionName:"enroll",args:[r,a,g>0n,i.late]}),value:"0",chainId:f,description:"Enroll future autopay with explicit finite USDG and savings share budgets."})],m=await t.preview(k,n);return{txs:k,summary:`Persistent future spending authorization: AutoRepay v2 can repay agent #${r} loans without a confirmation per loan, at most ${a} USDG base units per loan; exact total wallet allowance ${d} USDG base units and ${g} savings shares (currently ${h} USDG base units). These two allowances replace the budgets shared by ALL this wallet autopay plans, including setting savings allowance to zero when disabled. late=${i.late}; savings=${g>0n}. Revoke with priors_autopay_off, which also clears both allowances. ${m.summary}`}}},{name:"priors_autopay_off",inputSchema:F("priors_autopay_off",[o]),async execute(i,n){E(t),n=b(n);let r=A(["function revoke(uint256)"]),a=[t.unsignedTx({to:c.autopay,data:G({abi:r,functionName:"revoke",args:[l(i.agentId,"agentId")]}),value:"0",chainId:f,description:"Revoke own autopay plan."}),t.approval(c.usdg,c.autopay,"0",f),t.approval(c.savings,c.autopay,"0",f)],d=await t.preview(a,n);return{txs:a,summary:`Revoke this wallet autopay plan and zero both shared AutoRepay allowances. This also stops funding other plans using this wallet. ${d.summary}`}}}]}export{oe as a,O as b,te as c,Y as d,l as e,M as f,pe as g,_e as h};
@@ -1 +1 @@
1
- import{b as S}from"./LCH6F5HT.js";import{a as w}from"./43LI5NKJ.js";import{g as R}from"./NWNYJ26T.js";import{b as o,j as k,k as v}from"./TI727O2H.js";import{a as t}from"./XSD5NL7J.js";import{encodeFunctionData as O,getAddress as h,keccak256 as C,parseAbi as T,parseAbiItem as x,toHex as A,zeroHash as D}from"viem";var s=h(k[o].vaults.spark.address),g={admin:D,setter:C(A("SETTER_ROLE")),taker:C(A("TAKER_ROLE"))},E=[["drip()","any"],["setVsr(uint256 rate)","setter"],["setVsrBounds(uint256 minimum,uint256 maximum)","admin"],["setDepositCap(uint256 cap)","admin"],["take(uint256 assets)","taker"],["grantRole(bytes32 role,address account)","admin"],["revokeRole(bytes32 role,address account)","admin"],["renounceRole(bytes32 role,address account)","any"],["upgradeToAndCall(address implementation,bytes data)","admin"]],N=E.map(([r,a])=>({abi:x(`function ${r}`),authority:a})),p=T(["function asset() view returns (address)","function hasRole(bytes32,address) view returns (bool)","function getRoleMemberCount(bytes32) view returns (uint256)","function getRoleMember(bytes32,uint256) view returns (address)"]);function _(r){return[{name:"spark_roles",inputSchema:{type:"object",properties:{},additionalProperties:!1},execute:async(a,i)=>{try{if(w(i),Object.keys(a).length)throw new t("Spark roles takes no arguments.");let e=r.clientFor(o);if(await e.getChainId()!==o)throw new t("Spark requires chain 4663.");let u=await e.getBlockNumber({cacheTime:0}),c=await Promise.all(Object.entries(g).map(async([f,d])=>{let m=await e.readContract({address:s,abi:p,functionName:"getRoleMemberCount",args:[d],blockNumber:u});if(m>256n)throw new t("Spark role membership exceeds this reader\u2019s supported size.");let[b,n]=await Promise.all([e.readContract({address:s,abi:p,functionName:"hasRole",args:[d,i],blockNumber:u}),Promise.all(Array.from({length:Number(m)},(y,l)=>e.readContract({address:s,abi:p,functionName:"getRoleMember",args:[d,BigInt(l)],blockNumber:u})))]);return{name:f,role:d,heldByWallet:b,members:n.map(y=>h(y))}}));return{vault:s,chainId:o,blockNumber:u.toString(),roles:c}}catch(e){throw new t(r.plainError(e))}}},{name:"spark_manage",inputSchema:{type:"object",additionalProperties:!1,required:["operation","values"],properties:{operation:{type:"string",enum:N.map(a=>a.abi.name),description:"Role-gated vault admin call: drip, setVsr, setVsrBounds, setDepositCap, take, grantRole, revokeRole, renounceRole or upgradeToAndCall. Pass its inputs in values; Oak checks your role."},values:{type:"array",maxItems:2,items:{type:"string"},description:"Ordered contract inputs; all integers are decimal base-unit strings."}}},execute:async(a,i)=>{try{if(w(i),Object.keys(a).some(n=>!["operation","values"].includes(n)))throw new t("Unexpected Spark management argument.");let e=N.find(n=>n.abi.name===a.operation);if(!e||!Array.isArray(a.values)||a.values.length!==e.abi.inputs.length)throw new t("Provide a supported Spark operation and its exact ordered values.");let u=e.abi.inputs.map((n,y)=>{let l=a.values[y];if(n.type==="bytes32"){if(typeof l!="string"||!Object.values(g).includes(l))throw new t("Provide a documented Spark role identifier.");return l}return S(n.type,l)});if(e.abi.name==="renounceRole"&&!R(String(u[1]),i))throw new t("Role renunciation must name this wallet.");let c=r.clientFor(o);if(await c.getChainId()!==o)throw new t("Spark requires chain 4663.");let f=await c.readContract({address:s,abi:p,functionName:"asset"});if(h(f)!==h(v))throw new t("Spark does not use canonical USDG.");if(e.authority!=="any"&&await c.readContract({address:s,abi:p,functionName:"hasRole",args:[g[e.authority],i]})!==!0)throw new t("This wallet does not hold the required Spark role. No transaction was built.");let d=`${e.abi.name} on Spark ${s}; ordered values ${JSON.stringify(a.values)}. ${e.abi.name==="upgradeToAndCall"?"Replaces vault implementation; Oak must review and re-pin upgraded code before subsequent use.":e.abi.name==="take"?"Pulls vault liquidity to this role-authorized wallet; it mints no savings shares.":""}`,m=[r.unsignedTx({to:s,data:O({abi:[e.abi],functionName:e.abi.name,args:u}),value:"0",chainId:o,description:d})],b=await r.preview(m,i);return{txs:m,preview:b,summary:`${d} ${b.summary} Role and rate bounds are enforced again by the contract at execution.`}}catch(e){throw new t(r.plainError(e))}}}]}export{N as a,_ as b};
1
+ import{b as S}from"./342OZP53.js";import{a as w}from"./43LI5NKJ.js";import{g as R}from"./NWNYJ26T.js";import{b as o,j as k,k as v}from"./EWZFZUVF.js";import{a as t}from"./XSD5NL7J.js";import{encodeFunctionData as O,getAddress as h,keccak256 as C,parseAbi as T,parseAbiItem as x,toHex as A,zeroHash as D}from"viem";var s=h(k[o].vaults.spark.address),g={admin:D,setter:C(A("SETTER_ROLE")),taker:C(A("TAKER_ROLE"))},E=[["drip()","any"],["setVsr(uint256 rate)","setter"],["setVsrBounds(uint256 minimum,uint256 maximum)","admin"],["setDepositCap(uint256 cap)","admin"],["take(uint256 assets)","taker"],["grantRole(bytes32 role,address account)","admin"],["revokeRole(bytes32 role,address account)","admin"],["renounceRole(bytes32 role,address account)","any"],["upgradeToAndCall(address implementation,bytes data)","admin"]],N=E.map(([r,a])=>({abi:x(`function ${r}`),authority:a})),p=T(["function asset() view returns (address)","function hasRole(bytes32,address) view returns (bool)","function getRoleMemberCount(bytes32) view returns (uint256)","function getRoleMember(bytes32,uint256) view returns (address)"]);function _(r){return[{name:"spark_roles",inputSchema:{type:"object",properties:{},additionalProperties:!1},execute:async(a,i)=>{try{if(w(i),Object.keys(a).length)throw new t("Spark roles takes no arguments.");let e=r.clientFor(o);if(await e.getChainId()!==o)throw new t("Spark requires chain 4663.");let u=await e.getBlockNumber({cacheTime:0}),c=await Promise.all(Object.entries(g).map(async([f,d])=>{let m=await e.readContract({address:s,abi:p,functionName:"getRoleMemberCount",args:[d],blockNumber:u});if(m>256n)throw new t("Spark role membership exceeds this reader\u2019s supported size.");let[b,n]=await Promise.all([e.readContract({address:s,abi:p,functionName:"hasRole",args:[d,i],blockNumber:u}),Promise.all(Array.from({length:Number(m)},(y,l)=>e.readContract({address:s,abi:p,functionName:"getRoleMember",args:[d,BigInt(l)],blockNumber:u})))]);return{name:f,role:d,heldByWallet:b,members:n.map(y=>h(y))}}));return{vault:s,chainId:o,blockNumber:u.toString(),roles:c}}catch(e){throw new t(r.plainError(e))}}},{name:"spark_manage",inputSchema:{type:"object",additionalProperties:!1,required:["operation","values"],properties:{operation:{type:"string",enum:N.map(a=>a.abi.name),description:"Role-gated vault admin call: drip, setVsr, setVsrBounds, setDepositCap, take, grantRole, revokeRole, renounceRole or upgradeToAndCall. Pass its inputs in values; Oak checks your role."},values:{type:"array",maxItems:2,items:{type:"string"},description:"Ordered contract inputs; all integers are decimal base-unit strings."}}},execute:async(a,i)=>{try{if(w(i),Object.keys(a).some(n=>!["operation","values"].includes(n)))throw new t("Unexpected Spark management argument.");let e=N.find(n=>n.abi.name===a.operation);if(!e||!Array.isArray(a.values)||a.values.length!==e.abi.inputs.length)throw new t("Provide a supported Spark operation and its exact ordered values.");let u=e.abi.inputs.map((n,y)=>{let l=a.values[y];if(n.type==="bytes32"){if(typeof l!="string"||!Object.values(g).includes(l))throw new t("Provide a documented Spark role identifier.");return l}return S(n.type,l)});if(e.abi.name==="renounceRole"&&!R(String(u[1]),i))throw new t("Role renunciation must name this wallet.");let c=r.clientFor(o);if(await c.getChainId()!==o)throw new t("Spark requires chain 4663.");let f=await c.readContract({address:s,abi:p,functionName:"asset"});if(h(f)!==h(v))throw new t("Spark does not use canonical USDG.");if(e.authority!=="any"&&await c.readContract({address:s,abi:p,functionName:"hasRole",args:[g[e.authority],i]})!==!0)throw new t("This wallet does not hold the required Spark role. No transaction was built.");let d=`${e.abi.name} on Spark ${s}; ordered values ${JSON.stringify(a.values)}. ${e.abi.name==="upgradeToAndCall"?"Replaces vault implementation; Oak must review and re-pin upgraded code before subsequent use.":e.abi.name==="take"?"Pulls vault liquidity to this role-authorized wallet; it mints no savings shares.":""}`,m=[r.unsignedTx({to:s,data:O({abi:[e.abi],functionName:e.abi.name,args:u}),value:"0",chainId:o,description:d})],b=await r.preview(m,i);return{txs:m,preview:b,summary:`${d} ${b.summary} Role and rate bounds are enforced again by the contract at execution.`}}catch(e){throw new t(r.plainError(e))}}}]}export{N as a,_ as b};
@@ -1 +1 @@
1
- import{a as q}from"./NCQFWPAW.js";import{a as v}from"./RUTSEGGD.js";import{L as A}from"./SYERFEJ4.js";import{c as k}from"./4J245N3F.js";import{a as $}from"./43LI5NKJ.js";import{a as I}from"./66F5ZH34.js";import{d as M,g as F,i as G,m as U}from"./NWNYJ26T.js";import{b as y}from"./TI727O2H.js";import{a as o}from"./XSD5NL7J.js";import{encodeFunctionData as L,erc20Abi as R,getAddress as N,zeroAddress as j}from"viem";var C={genesis:N("0x575b7B7c97Ef3E21C82DAeB427899d583e1E913f"),bond:N("0xff32a969A0c567129eECD926D04657728E1980C1"),inverse:N("0x92166e94Eea5B7799b761653881692f881dFC4C9"),treasury:N("0x04822Ea321A0DEE6F40656172F29312104855d66"),pteam:N("0x650F58079dAa17ee28928c2F92d22291d038B2B0"),rwa:N("0x99B6eE6eDe47d9a8a9bfd03F728a99B789df1961"),premium:N("0x346e1a31171A0f7aC73909010b5435768d3B5462"),tax:N("0x086C58400b8708Ef993f256E12e752dcF0AC918e")},z=N("0x59F95461E68e0c77605299791E1449f175165B54"),O={genesis:["purchase","finalize","refund","claim"],bond:["deposit","redeem"],inverse:["swap"],treasury:["rebalanceToMorpho","rebalanceFromMorpho","mintNet","spendUsdg"],pteam:["exercise"],rwa:["redeem","depositInventory","pokeHwm","setDiscount","setInventoryMax","setHalt","setMenu","skim"],premium:["execute"],tax:["convert"]},V={genesis:["wired","finalized","finalizeTime","saleStart","saleDeadline","raisedRaw","totalRaised","registryLength"],bond:["wired","enabled","startTime","marketCount"],inverse:["active","price","capacityRemaining","spreadBps"],treasury:["wired","rfv","backingPerToken","liquidUsdg","morphoAssets","polRfv","morphoCapBps","morphoVault","canonicalPair"],pteam:["wired","holder","vestedFraction","exercisableNow","exercised","strikeWad","capBps","circulatingSupply","excludedFromFloat"],rwa:["manager","halted","inventory","inventoryMax","owedNet","bHwm","deskDiscountBps","VEST","MAX_DISCOUNT_BPS","INVENTORY_HARD_CAP","menu","routerSource","sleeve"],premium:["active","clipSize","lastExecuteAt","premiumThresholdWad","router","pairContract"],tax:["wired","pendingNet","teamBps","treasuryBps","teamWallet","router","pairContract"]},T=h=>JSON.parse(JSON.stringify(h,(P,S)=>typeof S=="bigint"?S.toString():S));function g(h){return G(h,"Provide a checksummed address.",M)}var oe=h=>{async function P(t){if(typeof t!="string"||!Object.hasOwn(C,t))throw new o("Choose a published NetNet financial product.");let c=t,e=C[c],r=q[c],u=h.clientFor(y);if(await u.getChainId()!==y)throw new o("NetNet requires chain 4663.");let n=await u.getBlock(),a=(w,x=[])=>u.readContract({address:e,abi:r,functionName:w,args:x,blockNumber:n.number}),[i,s,l,p]=await Promise.all([a("net"),a("usdg"),u.readContract({address:v.address,abi:R,functionName:"decimals",blockNumber:n.number}),u.readContract({address:k.address,abi:R,functionName:"decimals",blockNumber:n.number})]);if(g(i)!==v.address||g(s)!==k.address||l!==v.decimals||p!==k.decimals)throw new o("NetNet financial token pins or decimals do not match the deployment.");return{product:c,contract:e,abi:r,rpc:u,block:n,read:a}}async function S(t){$(t);let c=(e,r)=>({module:"netnet",id:`4663:${C.bond.toLowerCase()}:${e}`,chainId:y,incomplete:!0,assets:[],description:`NetNet bond notes unreadable: ${h.plainError(r)} Use netnet_financial_status with product bond to inspect notes.`});try{let e=await P("bond"),r=U(await e.read("noteCount",[t]),"Invalid NetNet bond note count."),u=r<50n?Number(r):50,n=[];for(let a=0;a<u;a++)try{let i=await e.read("notes",[t,BigInt(a)]);if(!Array.isArray(i)||i.length!==4)throw new o("Invalid NetNet bond note.");let[s,l,p,w]=i.map(B=>U(B,"Invalid NetNet bond note amount or timestamp."));if(l>s||w<=p||w>=1n<<64n)throw new o("Invalid NetNet bond note vesting or claimed amount.");let x=s-l;if(x===0n)continue;let E=e.block.timestamp>=w?s:e.block.timestamp<=p?0n:s*(e.block.timestamp-p)/(w-p),D=E>l?E-l:0n;n.push({module:"netnet",id:`4663:${e.contract.toLowerCase()}:${a}`,chainId:y,matured:e.block.timestamp>=w,assets:[{token:v,amount:x.toString()}],description:`NetNet bond note ${a}: ${x} NET base units outstanding; ${D} claimable now, vesting ends at Unix ${w}. Redeem vested NET with netnet_financial_action product bond operation redeem. Payment cannot be withdrawn. Block ${e.block.number}.`})}catch(i){n.push(c(String(a),i))}return r>BigInt(u)&&n.push({module:"netnet",id:`4663:${e.contract.toLowerCase()}:coverage`,chainId:y,incomplete:!0,assets:[],description:`NetNet bond positions checked the first ${u} of ${r} notes. Use netnet_financial_status product bond offset ${u} to read the remaining notes.`}),n}catch(e){return[c("unreadable",e)]}}let _=(t,c,e,r)=>({name:t,inputSchema:{type:"object",properties:c,required:e,additionalProperties:!1},execute:async(u,n)=>{try{if($(n),Object.keys(u).some(a=>!Object.hasOwn(c,a)))throw new o("Unsupported NetNet financial argument.");return await r(u,n)}catch(a){throw new o(h.plainError(a))}}}),W={type:"string",enum:Object.keys(C),description:"NetNet financial product: genesis (founding sale), bond, inverse (NET buyback), treasury, pteam (team option), rwa (equity desk), premium (premium keeper) or tax (tax collector)."};return{positions:S,tools:[_("netnet_financial_status",{product:W,offset:{type:"integer",minimum:0,description:"Index of the first wallet note to return (bond and rwa products only). Default 0."},limit:{type:"integer",minimum:1,maximum:50,description:"Maximum notes to return, 1 to 50 (default 20; bond and rwa products only)."}},["product"],async(t,c)=>{let e=await P(t.product),r=V[e.product],u=t.offset??0,n=t.limit??20;if(!Number.isSafeInteger(u)||Number(u)<0||!Number.isSafeInteger(n)||Number(n)<1||Number(n)>50)throw new o("Use a nonnegative offset and limit 1..50.");let a=await Promise.all(r.map(async s=>{try{return[s,{value:T(await e.read(s))}]}catch(l){return[s,{unavailable:h.plainError(l)}]}})),i={};if(e.product==="genesis")for(let s of["purchasedRaw","purchasedNetOf","claimedNet","claimableNetOf"])i[s]=T(await e.read(s,[c]));if(e.product==="bond"||e.product==="rwa"){i.pending=T(await e.read("pendingFor",[c]));let s=await e.read("noteCount",[c]);if(typeof s!="bigint"||s<0n)throw new o("Invalid NetNet note count.");let l=s<BigInt(Number(u)+Number(n))?s:BigInt(Number(u)+Number(n));i.noteCount=s.toString(),i.notes=await Promise.all(Array.from({length:Math.max(0,Number(l-BigInt(Number(u))))},async(p,w)=>({id:String(Number(u)+w),note:T(await e.read(e.product==="bond"?"notes":"noteAt",[c,BigInt(Number(u)+w)]))}))),i.nextOffset=l<s?l.toString():null,e.product==="bond"&&(i.markets=await Promise.all([0n,1n].map(async p=>{try{return{id:p.toString(),quoteToken:g(await e.read("quoteToken",[p])),priceWad:String(await e.read("bondPrice",[p]))}}catch(w){return{id:p.toString(),unavailable:h.plainError(w)}}})))}return e.product==="treasury"&&(i.isMinter=await e.read("isMinter",[c]),i.isSpender=await e.read("isSpender",[c])),{chainId:y,contract:e.contract,product:e.product,blockNumber:String(e.block.number),tokens:[v,k],metrics:Object.fromEntries(a),wallet:i,units:"Raw token amounts use each token\u2019s decimals. Prices, NAV, reserve values and capacityRemaining use 18-decimal USDG WAD. Note timestamps are Unix seconds.",operations:O[e.product],caveat:"An unavailable metric is not zero. Formulaic eligibility, oracle liveness, caps and vesting are checked by the action preview. RWA entry/router calldata and initial deployment wiring remain unsupported."}}),_("netnet_financial_action",{product:W,operation:{type:"string",enum:[...new Set(Object.values(O).flat())],description:"Action to run; it must be one the chosen product supports, for example bond deposit or redeem, genesis purchase or claim, inverse swap."},amount:I('Amount in base units of the token the operation spends or moves: USDG has 6 decimals, NET 9 ("1000000" = 1 USDG, "1000000000" = 1 NET).'),minAmountOut:I('Least output you must receive, in base units of the output token (USDG 6 decimals, NET 9). Example: "1000000" = 1 USDG.'),maxPriceWad:I("Highest bond price you accept, as an 18-decimal wad of USDG per NET in base units (1e18 = 1 USDG). Bond deposit only."),maxPayment:I('Most USDG you will pay to exercise, in USDG base units (6 decimals). Example: "1000000" = 1 USDG. pteam exercise only.'),marketId:{type:"integer",enum:[0,1],description:"Bond market: 0 pays with USDG, 1 pays with the canonical NET/USDG LP token. Bond deposit only."},recipient:{type:"string",description:"Address that receives the minted NET or spent USDG. Treasury mintNet and spendUsdg only; use the intended address."},halted:{type:"boolean",description:"rwa setHalt only: true halts the desk, false resumes it."},token:{type:"string",description:"Address of the stray token to sweep (0x + 40 hex digits). rwa skim only."},noteIds:{type:"array",maxItems:50,description:"Bond note ids to redeem, unique decimal strings (rwa redeem only); omit to redeem every vested note.",items:I('Note id (index of the wallet note), as a decimal string. Example: "0".')},menu:{type:"array",maxItems:32,description:"Complete replacement RWA equity menu (rwa setMenu only): up to 32 entries; target weights must sum to 10000 basis points.",items:{type:"object",description:"Menu entry with token and feed addresses, targetWeightBps (10000 = 100%) and active (boolean)."}}},["product","operation"],async(t,c)=>{let e=await P(t.product),r=t.operation;if(typeof r!="string"||!O[e.product].includes(r))throw new o("This operation is not supported by the selected financial product.");let u=new Set(["product","operation"]),n=[],a,i=0n,s="",l=(...d)=>d.forEach(m=>u.add(m)),p=()=>(l("amount"),A(t.amount)),w=()=>(l("minAmountOut"),A(t.minAmountOut));if(e.product==="genesis"){if(r==="purchase"&&(i=p(),a=k,n=[i],s="Founding subscription; NET is claimable only after successful finalization and vesting. A failed sale requires refund."),r==="claim"&&await e.read("claimableNetOf",[c])===0n)throw new o("No vested founding NET is claimable by this wallet.")}else if(e.product==="bond")if(r==="deposit"){if(l("marketId","maxPriceWad"),t.marketId!==0&&t.marketId!==1)throw new o("Bond marketId must be 0 (USDG) or 1 (canonical LP).");let d=BigInt(t.marketId);if(g(await e.read("quoteToken",[d]))!==(d===0n?k.address:z))throw new o("Bond quote token is not the pinned USDG or canonical LP.");i=p(),a=d===0n?k:{address:z,decimals:18,symbol:"NET/USDG LP",chainId:y};let f=A(t.maxPriceWad),b=await e.read("bondPrice",[d]);if(typeof b!="bigint"||b===0n||b>f)throw new o("Bond price exceeds maxPriceWad or is invalid.");n=[d,i,f,c],s="Payment is exchanged for a non-transferable NET note with two-day linear vesting. Redeem vested NET with the same product; payment cannot be withdrawn."}else n=[c];else if(e.product==="inverse"){if(i=p(),a=v,n=[i,w()],s="Purchased NET is burned permanently; USDG pays directly to this wallet. Capacity is denominated in USDG WAD, not raw USDG.",await e.read("active")!==!0)throw new o("NetNet buyback is inactive: oracle, finalization or capacity is unavailable.")}else if(e.product==="pteam"){if(g(await e.read("holder"))!==N(c))throw new o("This wallet is not the immutable pTEAM holder.");let d=p();if(l("maxPayment"),d>await e.read("exercisableNow"))throw new o("The NET exercise amount exceeds the vested cap.");let m=await e.read("strikeWad");if(i=(d*m/10n**BigInt(v.decimals)+10n**12n-1n)/10n**12n,i===0n||i>A(t.maxPayment))throw new o("The exercise payment exceeds maxPayment or rounds to zero.");a=k,n=[d],s=`Exercise pays ${i} USDG base units into treasury reserves and mints ${d} NET base units to the immutable holder. No withdrawal or exercise reversal exists.`}else if(e.product==="treasury"){let d=p();if(r==="mintNet"||r==="spendUsdg"){l("recipient");let m=g(t.recipient);if(await e.read(r==="mintNet"?"isMinter":"isSpender",[c])!==!0)throw new o("This wallet lacks the fixed NetNet treasury minter/spender role.");n=[m,d],s=`Protocol treasury operation sends ${d} base units to ${m}; it does not deposit into this wallet\u2019s savings.`}else n=[d],s="Permissionless protocol reserve rebalance; assets remain owned by the NetNet treasury. The deployed fraction is constrained by the immutable cap."}else if(e.product==="rwa"){if(["depositInventory","setDiscount","setInventoryMax","setHalt","setMenu"].includes(r)&&g(await e.read("manager"))!==N(c))throw new o("This wallet lacks the immutable RWA manager role.");if(r==="redeem")if(l("noteIds"),t.noteIds===void 0)n=[c];else{if(!Array.isArray(t.noteIds)||!t.noteIds.length||t.noteIds.length>50)throw new o("Provide 1..50 unique note IDs.");let m=t.noteIds.map(b=>A(b,!0));if(new Set(m.map(String)).size!==m.length)throw new o("Note IDs must be unique.");let f=await e.read("noteCount",[c]);if(m.some(b=>b>=f))throw new o("RWA note ID is out of range.");n=[c,m]}else if(r==="setHalt"){if(l("halted"),typeof t.halted!="boolean")throw new o("Provide halted as a boolean.");n=[t.halted]}else if(r==="setMenu"){if(l("menu"),!Array.isArray(t.menu)||!t.menu.length||t.menu.length>32)throw new o("Provide 1..32 explicit RWA menu entries.");let m=t.menu.map(f=>{if(!f||typeof f!="object"||Array.isArray(f)||Object.keys(f).some(H=>!["token","feed","targetWeightBps","active"].includes(H)))throw new o("Invalid RWA menu fields.");let b=f;if(typeof b.active!="boolean")throw new o("RWA active must be boolean.");return{token:g(b.token),feed:g(b.feed),targetWeightBps:A(b.targetWeightBps,!0),active:b.active}});if(new Set(m.map(f=>f.token)).size!==m.length||m.reduce((f,b)=>f+b.targetWeightBps,0n)!==10000n||m.some(f=>f.active&&(f.token===j||f.feed===j)))throw new o("RWA menu tokens must be unique, weights sum to 10000, active feeds/tokens nonzero.");n=[m],s=`Replace the complete RWA equity menu: ${JSON.stringify(T(m))}.`}else if(r==="skim")l("token"),n=[g(t.token)],s=`Sweep eligible stray assets to sleeve ${g(await e.read("sleeve"))}, not to this wallet.`;else if(r!=="pokeHwm"){let m=p();if(n=[m],r==="depositInventory"&&(a=v,i=m,s="Inventory funding is one-way. The manager cannot withdraw these NET; they are committed to bond obligations."),r==="setDiscount"&&m>await e.read("MAX_DISCOUNT_BPS")||r==="setInventoryMax"&&m>await e.read("INVENTORY_HARD_CAP"))throw new o("RWA setting exceeds its immutable maximum.")}}else e.product==="premium"?(n=[w()],s="Permissionless mint-and-sell keeper operation; all sale proceeds go to NetNet treasury. The caller receives no reward."):(n=[p(),w()],s="Convert NET already owned by the tax collector. Proceeds split to treasury and team; the caller receives no reward and supplies no NET.");if(Object.keys(t).some(d=>!u.has(d)))throw new o("Unexpected fields for this NetNet operation.");if(a&&await e.rpc.readContract({address:a.address,abi:R,functionName:"balanceOf",args:[c],blockNumber:e.block.number})<i)throw new o(`Top up ${a.symbol}: needs ${i} base units.`);let x=`NetNet ${e.product}.${r}, contract ${e.contract}, chain ${y}, values ${JSON.stringify(T(n))}. ${a?`Approve exactly ${i} ${a.symbol} base units (${a.address}, decimals ${a.decimals}). `:""}${s}`,E=[...a?[h.approval(a.address,e.contract,i.toString(),y)]:[],h.unsignedTx({to:e.contract,data:L({abi:e.abi,functionName:r,args:n}),value:"0",chainId:y,description:x})],D=await h.preview(E,c),B=0n;for(let d of D.changes){if(!/^-?\d+$/.test(d.amount))throw new o("Invalid NetNet preview amount.");if(BigInt(d.amount)<0n&&(B-=BigInt(d.amount)),BigInt(d.amount)<0n&&(!a||d.token.chainId!==y||!F(d.token.address,a.address)||d.token.decimals!==a.decimals||-BigInt(d.amount)>i))throw new o("NetNet preview spends outside the exact input budget.")}if(B>i)throw new o("NetNet preview exceeds the aggregate input budget.");return{txs:E,preview:D,summary:x}})]}};export{C as a,z as b,oe as c};
1
+ import{a as v}from"./OHZHQSCA.js";import{a as q}from"./NCQFWPAW.js";import{L as A}from"./DPSFR3ZS.js";import{c as k}from"./5PNFV7HH.js";import{a as $}from"./43LI5NKJ.js";import{a as I}from"./66F5ZH34.js";import{d as M,g as F,i as G,m as U}from"./NWNYJ26T.js";import{b as y}from"./EWZFZUVF.js";import{a as o}from"./XSD5NL7J.js";import{encodeFunctionData as L,erc20Abi as R,getAddress as N,zeroAddress as j}from"viem";var C={genesis:N("0x575b7B7c97Ef3E21C82DAeB427899d583e1E913f"),bond:N("0xff32a969A0c567129eECD926D04657728E1980C1"),inverse:N("0x92166e94Eea5B7799b761653881692f881dFC4C9"),treasury:N("0x04822Ea321A0DEE6F40656172F29312104855d66"),pteam:N("0x650F58079dAa17ee28928c2F92d22291d038B2B0"),rwa:N("0x99B6eE6eDe47d9a8a9bfd03F728a99B789df1961"),premium:N("0x346e1a31171A0f7aC73909010b5435768d3B5462"),tax:N("0x086C58400b8708Ef993f256E12e752dcF0AC918e")},z=N("0x59F95461E68e0c77605299791E1449f175165B54"),O={genesis:["purchase","finalize","refund","claim"],bond:["deposit","redeem"],inverse:["swap"],treasury:["rebalanceToMorpho","rebalanceFromMorpho","mintNet","spendUsdg"],pteam:["exercise"],rwa:["redeem","depositInventory","pokeHwm","setDiscount","setInventoryMax","setHalt","setMenu","skim"],premium:["execute"],tax:["convert"]},V={genesis:["wired","finalized","finalizeTime","saleStart","saleDeadline","raisedRaw","totalRaised","registryLength"],bond:["wired","enabled","startTime","marketCount"],inverse:["active","price","capacityRemaining","spreadBps"],treasury:["wired","rfv","backingPerToken","liquidUsdg","morphoAssets","polRfv","morphoCapBps","morphoVault","canonicalPair"],pteam:["wired","holder","vestedFraction","exercisableNow","exercised","strikeWad","capBps","circulatingSupply","excludedFromFloat"],rwa:["manager","halted","inventory","inventoryMax","owedNet","bHwm","deskDiscountBps","VEST","MAX_DISCOUNT_BPS","INVENTORY_HARD_CAP","menu","routerSource","sleeve"],premium:["active","clipSize","lastExecuteAt","premiumThresholdWad","router","pairContract"],tax:["wired","pendingNet","teamBps","treasuryBps","teamWallet","router","pairContract"]},T=h=>JSON.parse(JSON.stringify(h,(P,S)=>typeof S=="bigint"?S.toString():S));function g(h){return G(h,"Provide a checksummed address.",M)}var oe=h=>{async function P(t){if(typeof t!="string"||!Object.hasOwn(C,t))throw new o("Choose a published NetNet financial product.");let c=t,e=C[c],r=q[c],u=h.clientFor(y);if(await u.getChainId()!==y)throw new o("NetNet requires chain 4663.");let n=await u.getBlock(),a=(w,x=[])=>u.readContract({address:e,abi:r,functionName:w,args:x,blockNumber:n.number}),[i,s,l,p]=await Promise.all([a("net"),a("usdg"),u.readContract({address:v.address,abi:R,functionName:"decimals",blockNumber:n.number}),u.readContract({address:k.address,abi:R,functionName:"decimals",blockNumber:n.number})]);if(g(i)!==v.address||g(s)!==k.address||l!==v.decimals||p!==k.decimals)throw new o("NetNet financial token pins or decimals do not match the deployment.");return{product:c,contract:e,abi:r,rpc:u,block:n,read:a}}async function S(t){$(t);let c=(e,r)=>({module:"netnet",id:`4663:${C.bond.toLowerCase()}:${e}`,chainId:y,incomplete:!0,assets:[],description:`NetNet bond notes unreadable: ${h.plainError(r)} Use netnet_financial_status with product bond to inspect notes.`});try{let e=await P("bond"),r=U(await e.read("noteCount",[t]),"Invalid NetNet bond note count."),u=r<50n?Number(r):50,n=[];for(let a=0;a<u;a++)try{let i=await e.read("notes",[t,BigInt(a)]);if(!Array.isArray(i)||i.length!==4)throw new o("Invalid NetNet bond note.");let[s,l,p,w]=i.map(B=>U(B,"Invalid NetNet bond note amount or timestamp."));if(l>s||w<=p||w>=1n<<64n)throw new o("Invalid NetNet bond note vesting or claimed amount.");let x=s-l;if(x===0n)continue;let E=e.block.timestamp>=w?s:e.block.timestamp<=p?0n:s*(e.block.timestamp-p)/(w-p),D=E>l?E-l:0n;n.push({module:"netnet",id:`4663:${e.contract.toLowerCase()}:${a}`,chainId:y,matured:e.block.timestamp>=w,assets:[{token:v,amount:x.toString()}],description:`NetNet bond note ${a}: ${x} NET base units outstanding; ${D} claimable now, vesting ends at Unix ${w}. Redeem vested NET with netnet_financial_action product bond operation redeem. Payment cannot be withdrawn. Block ${e.block.number}.`})}catch(i){n.push(c(String(a),i))}return r>BigInt(u)&&n.push({module:"netnet",id:`4663:${e.contract.toLowerCase()}:coverage`,chainId:y,incomplete:!0,assets:[],description:`NetNet bond positions checked the first ${u} of ${r} notes. Use netnet_financial_status product bond offset ${u} to read the remaining notes.`}),n}catch(e){return[c("unreadable",e)]}}let _=(t,c,e,r)=>({name:t,inputSchema:{type:"object",properties:c,required:e,additionalProperties:!1},execute:async(u,n)=>{try{if($(n),Object.keys(u).some(a=>!Object.hasOwn(c,a)))throw new o("Unsupported NetNet financial argument.");return await r(u,n)}catch(a){throw new o(h.plainError(a))}}}),W={type:"string",enum:Object.keys(C),description:"NetNet financial product: genesis (founding sale), bond, inverse (NET buyback), treasury, pteam (team option), rwa (equity desk), premium (premium keeper) or tax (tax collector)."};return{positions:S,tools:[_("netnet_financial_status",{product:W,offset:{type:"integer",minimum:0,description:"Index of the first wallet note to return (bond and rwa products only). Default 0."},limit:{type:"integer",minimum:1,maximum:50,description:"Maximum notes to return, 1 to 50 (default 20; bond and rwa products only)."}},["product"],async(t,c)=>{let e=await P(t.product),r=V[e.product],u=t.offset??0,n=t.limit??20;if(!Number.isSafeInteger(u)||Number(u)<0||!Number.isSafeInteger(n)||Number(n)<1||Number(n)>50)throw new o("Use a nonnegative offset and limit 1..50.");let a=await Promise.all(r.map(async s=>{try{return[s,{value:T(await e.read(s))}]}catch(l){return[s,{unavailable:h.plainError(l)}]}})),i={};if(e.product==="genesis")for(let s of["purchasedRaw","purchasedNetOf","claimedNet","claimableNetOf"])i[s]=T(await e.read(s,[c]));if(e.product==="bond"||e.product==="rwa"){i.pending=T(await e.read("pendingFor",[c]));let s=await e.read("noteCount",[c]);if(typeof s!="bigint"||s<0n)throw new o("Invalid NetNet note count.");let l=s<BigInt(Number(u)+Number(n))?s:BigInt(Number(u)+Number(n));i.noteCount=s.toString(),i.notes=await Promise.all(Array.from({length:Math.max(0,Number(l-BigInt(Number(u))))},async(p,w)=>({id:String(Number(u)+w),note:T(await e.read(e.product==="bond"?"notes":"noteAt",[c,BigInt(Number(u)+w)]))}))),i.nextOffset=l<s?l.toString():null,e.product==="bond"&&(i.markets=await Promise.all([0n,1n].map(async p=>{try{return{id:p.toString(),quoteToken:g(await e.read("quoteToken",[p])),priceWad:String(await e.read("bondPrice",[p]))}}catch(w){return{id:p.toString(),unavailable:h.plainError(w)}}})))}return e.product==="treasury"&&(i.isMinter=await e.read("isMinter",[c]),i.isSpender=await e.read("isSpender",[c])),{chainId:y,contract:e.contract,product:e.product,blockNumber:String(e.block.number),tokens:[v,k],metrics:Object.fromEntries(a),wallet:i,units:"Raw token amounts use each token\u2019s decimals. Prices, NAV, reserve values and capacityRemaining use 18-decimal USDG WAD. Note timestamps are Unix seconds.",operations:O[e.product],caveat:"An unavailable metric is not zero. Formulaic eligibility, oracle liveness, caps and vesting are checked by the action preview. RWA entry/router calldata and initial deployment wiring remain unsupported."}}),_("netnet_financial_action",{product:W,operation:{type:"string",enum:[...new Set(Object.values(O).flat())],description:"Action to run; it must be one the chosen product supports, for example bond deposit or redeem, genesis purchase or claim, inverse swap."},amount:I('Amount in base units of the token the operation spends or moves: USDG has 6 decimals, NET 9 ("1000000" = 1 USDG, "1000000000" = 1 NET).'),minAmountOut:I('Least output you must receive, in base units of the output token (USDG 6 decimals, NET 9). Example: "1000000" = 1 USDG.'),maxPriceWad:I("Highest bond price you accept, as an 18-decimal wad of USDG per NET in base units (1e18 = 1 USDG). Bond deposit only."),maxPayment:I('Most USDG you will pay to exercise, in USDG base units (6 decimals). Example: "1000000" = 1 USDG. pteam exercise only.'),marketId:{type:"integer",enum:[0,1],description:"Bond market: 0 pays with USDG, 1 pays with the canonical NET/USDG LP token. Bond deposit only."},recipient:{type:"string",description:"Address that receives the minted NET or spent USDG. Treasury mintNet and spendUsdg only; use the intended address."},halted:{type:"boolean",description:"rwa setHalt only: true halts the desk, false resumes it."},token:{type:"string",description:"Address of the stray token to sweep (0x + 40 hex digits). rwa skim only."},noteIds:{type:"array",maxItems:50,description:"Bond note ids to redeem, unique decimal strings (rwa redeem only); omit to redeem every vested note.",items:I('Note id (index of the wallet note), as a decimal string. Example: "0".')},menu:{type:"array",maxItems:32,description:"Complete replacement RWA equity menu (rwa setMenu only): up to 32 entries; target weights must sum to 10000 basis points.",items:{type:"object",description:"Menu entry with token and feed addresses, targetWeightBps (10000 = 100%) and active (boolean)."}}},["product","operation"],async(t,c)=>{let e=await P(t.product),r=t.operation;if(typeof r!="string"||!O[e.product].includes(r))throw new o("This operation is not supported by the selected financial product.");let u=new Set(["product","operation"]),n=[],a,i=0n,s="",l=(...d)=>d.forEach(m=>u.add(m)),p=()=>(l("amount"),A(t.amount)),w=()=>(l("minAmountOut"),A(t.minAmountOut));if(e.product==="genesis"){if(r==="purchase"&&(i=p(),a=k,n=[i],s="Founding subscription; NET is claimable only after successful finalization and vesting. A failed sale requires refund."),r==="claim"&&await e.read("claimableNetOf",[c])===0n)throw new o("No vested founding NET is claimable by this wallet.")}else if(e.product==="bond")if(r==="deposit"){if(l("marketId","maxPriceWad"),t.marketId!==0&&t.marketId!==1)throw new o("Bond marketId must be 0 (USDG) or 1 (canonical LP).");let d=BigInt(t.marketId);if(g(await e.read("quoteToken",[d]))!==(d===0n?k.address:z))throw new o("Bond quote token is not the pinned USDG or canonical LP.");i=p(),a=d===0n?k:{address:z,decimals:18,symbol:"NET/USDG LP",chainId:y};let f=A(t.maxPriceWad),b=await e.read("bondPrice",[d]);if(typeof b!="bigint"||b===0n||b>f)throw new o("Bond price exceeds maxPriceWad or is invalid.");n=[d,i,f,c],s="Payment is exchanged for a non-transferable NET note with two-day linear vesting. Redeem vested NET with the same product; payment cannot be withdrawn."}else n=[c];else if(e.product==="inverse"){if(i=p(),a=v,n=[i,w()],s="Purchased NET is burned permanently; USDG pays directly to this wallet. Capacity is denominated in USDG WAD, not raw USDG.",await e.read("active")!==!0)throw new o("NetNet buyback is inactive: oracle, finalization or capacity is unavailable.")}else if(e.product==="pteam"){if(g(await e.read("holder"))!==N(c))throw new o("This wallet is not the immutable pTEAM holder.");let d=p();if(l("maxPayment"),d>await e.read("exercisableNow"))throw new o("The NET exercise amount exceeds the vested cap.");let m=await e.read("strikeWad");if(i=(d*m/10n**BigInt(v.decimals)+10n**12n-1n)/10n**12n,i===0n||i>A(t.maxPayment))throw new o("The exercise payment exceeds maxPayment or rounds to zero.");a=k,n=[d],s=`Exercise pays ${i} USDG base units into treasury reserves and mints ${d} NET base units to the immutable holder. No withdrawal or exercise reversal exists.`}else if(e.product==="treasury"){let d=p();if(r==="mintNet"||r==="spendUsdg"){l("recipient");let m=g(t.recipient);if(await e.read(r==="mintNet"?"isMinter":"isSpender",[c])!==!0)throw new o("This wallet lacks the fixed NetNet treasury minter/spender role.");n=[m,d],s=`Protocol treasury operation sends ${d} base units to ${m}; it does not deposit into this wallet\u2019s savings.`}else n=[d],s="Permissionless protocol reserve rebalance; assets remain owned by the NetNet treasury. The deployed fraction is constrained by the immutable cap."}else if(e.product==="rwa"){if(["depositInventory","setDiscount","setInventoryMax","setHalt","setMenu"].includes(r)&&g(await e.read("manager"))!==N(c))throw new o("This wallet lacks the immutable RWA manager role.");if(r==="redeem")if(l("noteIds"),t.noteIds===void 0)n=[c];else{if(!Array.isArray(t.noteIds)||!t.noteIds.length||t.noteIds.length>50)throw new o("Provide 1..50 unique note IDs.");let m=t.noteIds.map(b=>A(b,!0));if(new Set(m.map(String)).size!==m.length)throw new o("Note IDs must be unique.");let f=await e.read("noteCount",[c]);if(m.some(b=>b>=f))throw new o("RWA note ID is out of range.");n=[c,m]}else if(r==="setHalt"){if(l("halted"),typeof t.halted!="boolean")throw new o("Provide halted as a boolean.");n=[t.halted]}else if(r==="setMenu"){if(l("menu"),!Array.isArray(t.menu)||!t.menu.length||t.menu.length>32)throw new o("Provide 1..32 explicit RWA menu entries.");let m=t.menu.map(f=>{if(!f||typeof f!="object"||Array.isArray(f)||Object.keys(f).some(H=>!["token","feed","targetWeightBps","active"].includes(H)))throw new o("Invalid RWA menu fields.");let b=f;if(typeof b.active!="boolean")throw new o("RWA active must be boolean.");return{token:g(b.token),feed:g(b.feed),targetWeightBps:A(b.targetWeightBps,!0),active:b.active}});if(new Set(m.map(f=>f.token)).size!==m.length||m.reduce((f,b)=>f+b.targetWeightBps,0n)!==10000n||m.some(f=>f.active&&(f.token===j||f.feed===j)))throw new o("RWA menu tokens must be unique, weights sum to 10000, active feeds/tokens nonzero.");n=[m],s=`Replace the complete RWA equity menu: ${JSON.stringify(T(m))}.`}else if(r==="skim")l("token"),n=[g(t.token)],s=`Sweep eligible stray assets to sleeve ${g(await e.read("sleeve"))}, not to this wallet.`;else if(r!=="pokeHwm"){let m=p();if(n=[m],r==="depositInventory"&&(a=v,i=m,s="Inventory funding is one-way. The manager cannot withdraw these NET; they are committed to bond obligations."),r==="setDiscount"&&m>await e.read("MAX_DISCOUNT_BPS")||r==="setInventoryMax"&&m>await e.read("INVENTORY_HARD_CAP"))throw new o("RWA setting exceeds its immutable maximum.")}}else e.product==="premium"?(n=[w()],s="Permissionless mint-and-sell keeper operation; all sale proceeds go to NetNet treasury. The caller receives no reward."):(n=[p(),w()],s="Convert NET already owned by the tax collector. Proceeds split to treasury and team; the caller receives no reward and supplies no NET.");if(Object.keys(t).some(d=>!u.has(d)))throw new o("Unexpected fields for this NetNet operation.");if(a&&await e.rpc.readContract({address:a.address,abi:R,functionName:"balanceOf",args:[c],blockNumber:e.block.number})<i)throw new o(`Top up ${a.symbol}: needs ${i} base units.`);let x=`NetNet ${e.product}.${r}, contract ${e.contract}, chain ${y}, values ${JSON.stringify(T(n))}. ${a?`Approve exactly ${i} ${a.symbol} base units (${a.address}, decimals ${a.decimals}). `:""}${s}`,E=[...a?[h.approval(a.address,e.contract,i.toString(),y)]:[],h.unsignedTx({to:e.contract,data:L({abi:e.abi,functionName:r,args:n}),value:"0",chainId:y,description:x})],D=await h.preview(E,c),B=0n;for(let d of D.changes){if(!/^-?\d+$/.test(d.amount))throw new o("Invalid NetNet preview amount.");if(BigInt(d.amount)<0n&&(B-=BigInt(d.amount)),BigInt(d.amount)<0n&&(!a||d.token.chainId!==y||!F(d.token.address,a.address)||d.token.decimals!==a.decimals||-BigInt(d.amount)>i))throw new o("NetNet preview spends outside the exact input budget.")}if(B>i)throw new o("NetNet preview exceeds the aggregate input budget.");return{txs:E,preview:D,summary:x}})]}};export{C as a,z as b,oe as c};
@@ -1 +1 @@
1
- import{i as s,j as h,k as p,m as E,n as C,p as T,r as O,v as w,y as L}from"./Y64GFBTA.js";import{b as P,c as I,e as k,g as S}from"./NWNYJ26T.js";import{b as $}from"./TI727O2H.js";import{a as d}from"./XSD5NL7J.js";import{a as D}from"./JXOEJPJ4.js";import{getAddress as R}from"viem";var u={type:"integer",minimum:1},l={type:"string",minLength:1,maxLength:512},_={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},g={type:"integer",minimum:1,maximum:100},v={limit:{...g,description:"Maximum number of results."},cursor:{...l,description:"Continuation cursor from a previous page."}},M={relay_chain_health:"Read Relay service health. chainId is required.",relay_requests:"Page this wallet\u2019s requests. Requires server OAK_RELAY_API_KEY; the wallet filter is automatic. Optional id, chain and status filters narrow results.",relay_balance_events:"Page this wallet\u2019s balance events. Requires server OAK_RELAY_API_KEY with access to this resource.",relay_exchange_rates:"Read reference rates without a freshness guarantee. Relay may be unavailable; use relay_token_price for an individual token."};function q(n,r){if(r.type==="string"){if(typeof n!="string"||n.length<Number(r.minLength??0)||n.length>Number(r.maxLength??1024)||typeof r.pattern=="string"&&!new RegExp(r.pattern).test(n))throw new d("Provide a valid Relay search, address or cursor.")}else if(r.type==="integer"){if(typeof n!="number"||!Number.isSafeInteger(n)||n<Number(r.minimum??0)||n>Number(r.maximum??Number.MAX_SAFE_INTEGER))throw new d("Provide an integer within the Relay parameter bounds.")}else{if(r.type==="boolean"&&typeof n!="boolean")throw new d("Provide a boolean Relay filter.");if(r.type==="array"){if(!Array.isArray(n)||n.length>100)throw new d("Provide at most 100 Relay search values.");for(let i of n)q(i,s(r.items))}}if(Array.isArray(r.enum)&&!r.enum.includes(n))throw new d("Choose a supported Relay filter.")}function y(n){return new URLSearchParams(Object.entries(n).map(([r,i])=>[r==="cursor"?"continuation":r,String(i)])).toString()}function x(n){if(n!=null)return q(n,l),n}function m(n){return typeof n=="string"?P.test(n)?R(n.toLowerCase()):/^(?:0x[0-9a-fA-F]{64}|-?\d+(?:\.\d+)?)$/.test(n)?n:D(n):Array.isArray(n)?n.map(m):k(n)?Object.fromEntries(Object.entries(n).filter(([r])=>!/api.?key|signature|authorization|secret/i.test(r)).map(([r,i])=>[r,m(i)])):n}function A(n){return h(n).map(r=>{let i=s(r),e=i.decimals;if(typeof e!="number"||!Number.isInteger(e)||e<0||e>255||typeof i.address!="string")throw new d("Relay returned invalid currency metadata.");let t=i.vmType===void 0||i.vmType==="evm";return{chainId:E(i.chainId),address:t?R(p(i.address)):D(i.address),symbol:w(i.symbol)??"unknown",decimals:e,vmType:w(i.vmType),verified:k(i.metadata)&&i.metadata.verified===!0}})}var B=["relay_vault_status","relay_currencies","relay_token_price","relay_currency_classifications","relay_liquidity","relay_swap_sources","relay_requests","relay_app_fee_balance","relay_app_fee_claims","relay_balance_events","relay_deposit_address","relay_recovery_balances","relay_withdrawal_status","relay_chain_health","relay_token_details","relay_token_chart","relay_trending","relay_exchange_rates","relay_protocol_execution"],X=n=>{let r=L(n);function i(e,t,a,o){return{name:e,inputSchema:{type:"object",...M[e]?{description:M[e]}:{},additionalProperties:!1,properties:t,required:a},execute:async(c,b)=>{for(let f of a)if(c[f]===void 0)throw new d(`Provide ${f} for ${e}.`);for(let[f,j]of Object.entries(c)){if(!Object.hasOwn(t,f))throw new d(`Unsupported ${e} parameter ${f}.`);q(j,t[f])}return o(c,p(b))}}}return{tools:[i("relay_chain_health",{chainId:{...u,description:"Chain ID."}},["chainId"],async e=>{let t=s(await r(`/chains/health?${y(e)}`));if(typeof t.healthy!="boolean")throw new d("Relay returned invalid chain health.");return{healthy:t.healthy,chainId:e.chainId}}),i("relay_token_details",{chainId:{...u,description:"Chain ID."},address:{...I,description:"Token address filter."}},["chainId","address"],async e=>{let t=s(await r(`/chains/${e.chainId}/currencies/${p(e.address)}`));if(t.chainId!==e.chainId||p(t.address)!==p(e.address))throw new d("Relay returned another token.");return{token:A([t])[0],data:m(t)}}),i("relay_token_chart",{chainId:{...u,description:"Chain ID."},address:{...I,description:"Token address filter."},timeframe:{type:"string",enum:["5M","1H","4H","24H","7D","30D","MAX"],description:"Chart period: 5M = 5 minutes, 1H = 1 hour, 4H = 4 hours, 24H = 1 day, 7D = 7 days, 30D = 30 days, MAX = all history."}},["chainId","address"],async e=>{let t=s(await r(`/chains/${e.chainId}/currencies/${p(e.address)}/chart?${y(e.timeframe===void 0?{}:{timeframe:e.timeframe})}`));return{chainId:e.chainId,address:R(p(e.address)),data:m(t),summary:"Relay historical market data. Chart prices and volumes are not token base-unit balances."}}),i("relay_trending",{chainId:{...u,description:"Chain ID."},limit:{...g,maximum:20,description:"Maximum number of results, from 1 to 20."},sortBy:{type:"string",enum:["relay24hBuyTxCount","relay24hBuyUsdVolume","coingecko6hTrending"],description:"Sort by 24-hour buy count, 24-hour USD volume, or six-hour CoinGecko trending."}},[],async e=>({currencies:A(await r(`/currencies/trending?${y(e)}`))})),i("relay_exchange_rates",{},[],async()=>({rates:m(s(await r("/prices/rates"))),summary:"Relay reference rates; timestamps are not supplied. These are prices, not token base-unit amounts."})),i("relay_protocol_execution",{id:{..._,description:"Protocol execution idempotency key as a 0x-prefixed 32-byte hex string."}},["id"],async e=>{let t=s(await r(`/protocol/executions/${e.id}`)),a=s(t.execution);if(!S(T(a.idempotencyKey),String(e.id)))throw new d("Relay returned another protocol execution.");return{data:m(t),summary:"Oracle execution status only; this does not prove a destination bridge fill."}}),i("relay_currencies",{chainIds:{type:"array",items:u,description:"Chain IDs to search."},term:{...l,maxLength:256,description:"Token search term."},address:{...l,description:"Token address filter."},currencyId:{...l,description:"Relay currency ID filter."},symbol:{...l,description:"Token symbol filter."},groupID:{...l,description:"Relay currency group ID filter."},tokens:{type:"array",items:l,description:"Token identifiers to filter."},verified:{type:"boolean",description:"Filter by Relay verification status."},defaultList:{type:"boolean",description:"Filter by Relay default-list status."},includeAllChains:{type:"boolean",description:"Include currencies on all chains."},useExternalSearch:{type:"boolean",description:"Include external search results."},depositAddressOnly:{type:"boolean",description:"Include only deposit-address currencies."},limit:{...g,description:"Maximum number of results."}},[],async e=>({currencies:A(await r("/currencies/v2",{chainIds:[$],...e})),summary:"Relay currency search. Provider verification is not an Oak token endorsement; obtain a quote to check route availability."})),i("relay_token_price",{chainId:{...u,description:"Chain ID."},address:{...I,description:"Token address filter."}},["chainId","address"],async e=>{let t=s(await r(`/currencies/token/price/v2?${y(e)}`));if(typeof t.price!="string"||!/^\d+(?:\.\d+)?$/.test(t.price))throw new d("Relay returned an invalid USD price.");return{chainId:e.chainId,address:R(p(e.address)),priceUsd:t.price,summary:"Relay USD price; freshness is not supplied by this endpoint."}}),i("relay_currency_classifications",{},[],async()=>{let e=s(await r("/currencies/classifications"));return{major:h(e.major).map(t=>w(t)??"unknown"),stable:h(e.stable).map(t=>w(t)??"unknown")}}),i("relay_liquidity",{chainId:{...u,description:"Chain ID."}},["chainId"],async e=>{let t=s(await r(`/chains/liquidity?${y(e)}`));return{liquidity:h(t.liquidity).map(a=>{let o=s(a);if(o.chainId!==e.chainId)throw new d("Relay liquidity chain does not match the request.");return{...A([o])[0],amount:C(o.balance)}}),summary:"Relay solver balances are indicative capacity, not a reserved route or user funds."}}),i("relay_swap_sources",{chainId:{...u,description:"Chain ID."}},[],async e=>({sources:h(s(await r(`/swap-sources?${y(e)}`)).sources).map(t=>w(t,"name")??"unknown")})),i("relay_requests",{...v,originChainId:{...u,description:"Origin chain ID filter."},destinationChainId:{...u,description:"Destination chain ID filter."},chainId:{...u,description:"Chain ID."},id:{..._,description:"Relay request ID as a 0x-prefixed 32-byte hex string."},orderId:{..._,description:"Relay order ID as a 0x-prefixed 32-byte hex string."},depositTxHash:{..._,description:"Deposit transaction hash as a 0x-prefixed 32-byte hex string."},fillTxHash:{..._,description:"Fill transaction hash as a 0x-prefixed 32-byte hex string."},refundTxHash:{..._,description:"Refund transaction hash as a 0x-prefixed 32-byte hex string."},status:{type:"string",enum:["success","failure","refund","pending","depositing"],description:"Filter by success, failure, refund, pending or depositing status."},includeChildRequests:{type:"boolean",description:"Include child requests."}},[],async(e,t)=>{let a=s(await r(`/requests/v3?${y({...e,user:t,includePendingRequests:!0})}`)),o=h(a.requests).map(s);for(let c of o){let b=k(c.depositAddress)?c.depositAddress.depositor:void 0;if(![c.user,c.sender,b].some(f=>typeof f=="string"&&f.toLowerCase()===t))throw new d("Relay returned a request for another wallet.");T(c.id)}return{requests:m(o),nextCursor:x(a.continuation),summary:"One page of this wallet\u2019s Relay requests, including pending requests. Pass nextCursor as cursor to resume; provider success is not destination receipt verification."}}),i("relay_app_fee_balance",{},[],async(e,t)=>{let a=s(await r(`/app-fees/${t}/balances`));return{balances:h(a.balances).map(o=>{let c=O(o);return{...c,token:{...c.token,address:R(c.token.address),symbol:w(c.token.symbol)??"unknown"}}}),summary:"Off-chain Relay app fee credits for this wallet. Claiming requires separate local signature integration."}}),i("relay_app_fee_claims",v,[],async(e,t)=>{let a=s(await r(`/app-fees/${t}/claims?${y(e)}`)),o=h(a.claims).map(s);for(let c of o)if(p(c.wallet)!==t)throw new d("Relay returned a fee claim for another wallet.");return{claims:m(o),nextCursor:x(a.continuation)}}),i("relay_balance_events",{...v,limit:{...g,maximum:50,description:"Maximum number of results, from 1 to 50."},requestId:{..._,description:"Relay request ID as a 0x-prefixed 32-byte hex string."},chainId:{...u,description:"Chain ID."},currency:{...I,description:"Token address filter."},startTimestamp:{type:"integer",minimum:0,description:"Start time in Unix seconds."},endTimestamp:{type:"integer",minimum:0,description:"End time in Unix seconds."},type:{...l,description:"Balance event type filter."}},[],async(e,t)=>{let a=s(await r(`/balance/${t}/events?${y(e)}`));if(p(a.wallet)!==t)throw new d("Relay returned balance events for another wallet.");let o=h(a.events).map(s);for(let c of o)if(p(c.wallet)!==t)throw new d("Relay returned a balance event for another wallet.");return{events:m(o),nextCursor:x(a.continuation)}}),i("relay_deposit_address",{address:{...l,description:"Deposit address to look up; supply this or depositAddressId."},depositAddressId:{...l,description:"Relay deposit address ID; supply this or address."},pageSize:{...g,maximum:50,description:"Maximum number of results, from 1 to 50."},pageToken:{...l,description:"Page token from a previous response."}},[],async e=>{if(e.address===void 0==(e.depositAddressId===void 0))throw new d("Provide exactly one deposit address or depositAddressId.");let t=s(await r(`/deposit-addresses/v2?${y(e)}`)),a=s(t.data),o=s(a.depositAddress);if(e.address!==void 0&&o.address!==e.address||e.depositAddressId!==void 0&&o.id!==e.depositAddressId)throw new d("Relay returned another deposit address.");return{data:m(a),nextPageToken:x(a.nextPageToken),summary:"Deposit address monitoring only. Reading an address does not create, change, fund or recover it."}}),i("relay_recovery_balances",{...v,limit:{...g,maximum:50,description:"Maximum number of results, from 1 to 50."},ownerChainId:{...u,description:"Recovery owner chain ID."}},["ownerChainId"],async(e,t)=>{let a=s(await r(`/withdrawals/balances?${y({...e,recoveryAddress:t})}`)),o=h(a.balances).map(c=>{let b=s(c);return C(b.amount),b});return{balances:m(o),nextCursor:x(a.continuation),summary:"Credited recovery balances only. Empty balances do not prove that an unattested deposit has no recoverable funds. Withdrawal signing remains a separate action."}}),i("relay_withdrawal_status",{id:{...l,description:"Relay withdrawal job ID."}},["id"],async e=>{let t=s(await r(`/withdrawals/status?${y(e)}`));if(typeof t.status!="string")throw new d("Relay returned an invalid withdrawal status.");return{status:w(t.status)??"unknown",data:m(t),summary:"Relay withdrawal job status; verify any reported transaction on its chain before treating funds as received."}})]}};export{B as a,X as b};
1
+ import{i as s,j as h,k as p,m as E,n as C,p as T,r as O,v as w,y as L}from"./Y64GFBTA.js";import{b as P,c as I,e as k,g as S}from"./NWNYJ26T.js";import{b as $}from"./EWZFZUVF.js";import{a as d}from"./XSD5NL7J.js";import{a as D}from"./JXOEJPJ4.js";import{getAddress as R}from"viem";var u={type:"integer",minimum:1},l={type:"string",minLength:1,maxLength:512},_={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},g={type:"integer",minimum:1,maximum:100},v={limit:{...g,description:"Maximum number of results."},cursor:{...l,description:"Continuation cursor from a previous page."}},M={relay_chain_health:"Read Relay service health. chainId is required.",relay_requests:"Page this wallet\u2019s requests. Requires server OAK_RELAY_API_KEY; the wallet filter is automatic. Optional id, chain and status filters narrow results.",relay_balance_events:"Page this wallet\u2019s balance events. Requires server OAK_RELAY_API_KEY with access to this resource.",relay_exchange_rates:"Read reference rates without a freshness guarantee. Relay may be unavailable; use relay_token_price for an individual token."};function q(n,r){if(r.type==="string"){if(typeof n!="string"||n.length<Number(r.minLength??0)||n.length>Number(r.maxLength??1024)||typeof r.pattern=="string"&&!new RegExp(r.pattern).test(n))throw new d("Provide a valid Relay search, address or cursor.")}else if(r.type==="integer"){if(typeof n!="number"||!Number.isSafeInteger(n)||n<Number(r.minimum??0)||n>Number(r.maximum??Number.MAX_SAFE_INTEGER))throw new d("Provide an integer within the Relay parameter bounds.")}else{if(r.type==="boolean"&&typeof n!="boolean")throw new d("Provide a boolean Relay filter.");if(r.type==="array"){if(!Array.isArray(n)||n.length>100)throw new d("Provide at most 100 Relay search values.");for(let i of n)q(i,s(r.items))}}if(Array.isArray(r.enum)&&!r.enum.includes(n))throw new d("Choose a supported Relay filter.")}function y(n){return new URLSearchParams(Object.entries(n).map(([r,i])=>[r==="cursor"?"continuation":r,String(i)])).toString()}function x(n){if(n!=null)return q(n,l),n}function m(n){return typeof n=="string"?P.test(n)?R(n.toLowerCase()):/^(?:0x[0-9a-fA-F]{64}|-?\d+(?:\.\d+)?)$/.test(n)?n:D(n):Array.isArray(n)?n.map(m):k(n)?Object.fromEntries(Object.entries(n).filter(([r])=>!/api.?key|signature|authorization|secret/i.test(r)).map(([r,i])=>[r,m(i)])):n}function A(n){return h(n).map(r=>{let i=s(r),e=i.decimals;if(typeof e!="number"||!Number.isInteger(e)||e<0||e>255||typeof i.address!="string")throw new d("Relay returned invalid currency metadata.");let t=i.vmType===void 0||i.vmType==="evm";return{chainId:E(i.chainId),address:t?R(p(i.address)):D(i.address),symbol:w(i.symbol)??"unknown",decimals:e,vmType:w(i.vmType),verified:k(i.metadata)&&i.metadata.verified===!0}})}var B=["relay_vault_status","relay_currencies","relay_token_price","relay_currency_classifications","relay_liquidity","relay_swap_sources","relay_requests","relay_app_fee_balance","relay_app_fee_claims","relay_balance_events","relay_deposit_address","relay_recovery_balances","relay_withdrawal_status","relay_chain_health","relay_token_details","relay_token_chart","relay_trending","relay_exchange_rates","relay_protocol_execution"],X=n=>{let r=L(n);function i(e,t,a,o){return{name:e,inputSchema:{type:"object",...M[e]?{description:M[e]}:{},additionalProperties:!1,properties:t,required:a},execute:async(c,b)=>{for(let f of a)if(c[f]===void 0)throw new d(`Provide ${f} for ${e}.`);for(let[f,j]of Object.entries(c)){if(!Object.hasOwn(t,f))throw new d(`Unsupported ${e} parameter ${f}.`);q(j,t[f])}return o(c,p(b))}}}return{tools:[i("relay_chain_health",{chainId:{...u,description:"Chain ID."}},["chainId"],async e=>{let t=s(await r(`/chains/health?${y(e)}`));if(typeof t.healthy!="boolean")throw new d("Relay returned invalid chain health.");return{healthy:t.healthy,chainId:e.chainId}}),i("relay_token_details",{chainId:{...u,description:"Chain ID."},address:{...I,description:"Token address filter."}},["chainId","address"],async e=>{let t=s(await r(`/chains/${e.chainId}/currencies/${p(e.address)}`));if(t.chainId!==e.chainId||p(t.address)!==p(e.address))throw new d("Relay returned another token.");return{token:A([t])[0],data:m(t)}}),i("relay_token_chart",{chainId:{...u,description:"Chain ID."},address:{...I,description:"Token address filter."},timeframe:{type:"string",enum:["5M","1H","4H","24H","7D","30D","MAX"],description:"Chart period: 5M = 5 minutes, 1H = 1 hour, 4H = 4 hours, 24H = 1 day, 7D = 7 days, 30D = 30 days, MAX = all history."}},["chainId","address"],async e=>{let t=s(await r(`/chains/${e.chainId}/currencies/${p(e.address)}/chart?${y(e.timeframe===void 0?{}:{timeframe:e.timeframe})}`));return{chainId:e.chainId,address:R(p(e.address)),data:m(t),summary:"Relay historical market data. Chart prices and volumes are not token base-unit balances."}}),i("relay_trending",{chainId:{...u,description:"Chain ID."},limit:{...g,maximum:20,description:"Maximum number of results, from 1 to 20."},sortBy:{type:"string",enum:["relay24hBuyTxCount","relay24hBuyUsdVolume","coingecko6hTrending"],description:"Sort by 24-hour buy count, 24-hour USD volume, or six-hour CoinGecko trending."}},[],async e=>({currencies:A(await r(`/currencies/trending?${y(e)}`))})),i("relay_exchange_rates",{},[],async()=>({rates:m(s(await r("/prices/rates"))),summary:"Relay reference rates; timestamps are not supplied. These are prices, not token base-unit amounts."})),i("relay_protocol_execution",{id:{..._,description:"Protocol execution idempotency key as a 0x-prefixed 32-byte hex string."}},["id"],async e=>{let t=s(await r(`/protocol/executions/${e.id}`)),a=s(t.execution);if(!S(T(a.idempotencyKey),String(e.id)))throw new d("Relay returned another protocol execution.");return{data:m(t),summary:"Oracle execution status only; this does not prove a destination bridge fill."}}),i("relay_currencies",{chainIds:{type:"array",items:u,description:"Chain IDs to search."},term:{...l,maxLength:256,description:"Token search term."},address:{...l,description:"Token address filter."},currencyId:{...l,description:"Relay currency ID filter."},symbol:{...l,description:"Token symbol filter."},groupID:{...l,description:"Relay currency group ID filter."},tokens:{type:"array",items:l,description:"Token identifiers to filter."},verified:{type:"boolean",description:"Filter by Relay verification status."},defaultList:{type:"boolean",description:"Filter by Relay default-list status."},includeAllChains:{type:"boolean",description:"Include currencies on all chains."},useExternalSearch:{type:"boolean",description:"Include external search results."},depositAddressOnly:{type:"boolean",description:"Include only deposit-address currencies."},limit:{...g,description:"Maximum number of results."}},[],async e=>({currencies:A(await r("/currencies/v2",{chainIds:[$],...e})),summary:"Relay currency search. Provider verification is not an Oak token endorsement; obtain a quote to check route availability."})),i("relay_token_price",{chainId:{...u,description:"Chain ID."},address:{...I,description:"Token address filter."}},["chainId","address"],async e=>{let t=s(await r(`/currencies/token/price/v2?${y(e)}`));if(typeof t.price!="string"||!/^\d+(?:\.\d+)?$/.test(t.price))throw new d("Relay returned an invalid USD price.");return{chainId:e.chainId,address:R(p(e.address)),priceUsd:t.price,summary:"Relay USD price; freshness is not supplied by this endpoint."}}),i("relay_currency_classifications",{},[],async()=>{let e=s(await r("/currencies/classifications"));return{major:h(e.major).map(t=>w(t)??"unknown"),stable:h(e.stable).map(t=>w(t)??"unknown")}}),i("relay_liquidity",{chainId:{...u,description:"Chain ID."}},["chainId"],async e=>{let t=s(await r(`/chains/liquidity?${y(e)}`));return{liquidity:h(t.liquidity).map(a=>{let o=s(a);if(o.chainId!==e.chainId)throw new d("Relay liquidity chain does not match the request.");return{...A([o])[0],amount:C(o.balance)}}),summary:"Relay solver balances are indicative capacity, not a reserved route or user funds."}}),i("relay_swap_sources",{chainId:{...u,description:"Chain ID."}},[],async e=>({sources:h(s(await r(`/swap-sources?${y(e)}`)).sources).map(t=>w(t,"name")??"unknown")})),i("relay_requests",{...v,originChainId:{...u,description:"Origin chain ID filter."},destinationChainId:{...u,description:"Destination chain ID filter."},chainId:{...u,description:"Chain ID."},id:{..._,description:"Relay request ID as a 0x-prefixed 32-byte hex string."},orderId:{..._,description:"Relay order ID as a 0x-prefixed 32-byte hex string."},depositTxHash:{..._,description:"Deposit transaction hash as a 0x-prefixed 32-byte hex string."},fillTxHash:{..._,description:"Fill transaction hash as a 0x-prefixed 32-byte hex string."},refundTxHash:{..._,description:"Refund transaction hash as a 0x-prefixed 32-byte hex string."},status:{type:"string",enum:["success","failure","refund","pending","depositing"],description:"Filter by success, failure, refund, pending or depositing status."},includeChildRequests:{type:"boolean",description:"Include child requests."}},[],async(e,t)=>{let a=s(await r(`/requests/v3?${y({...e,user:t,includePendingRequests:!0})}`)),o=h(a.requests).map(s);for(let c of o){let b=k(c.depositAddress)?c.depositAddress.depositor:void 0;if(![c.user,c.sender,b].some(f=>typeof f=="string"&&f.toLowerCase()===t))throw new d("Relay returned a request for another wallet.");T(c.id)}return{requests:m(o),nextCursor:x(a.continuation),summary:"One page of this wallet\u2019s Relay requests, including pending requests. Pass nextCursor as cursor to resume; provider success is not destination receipt verification."}}),i("relay_app_fee_balance",{},[],async(e,t)=>{let a=s(await r(`/app-fees/${t}/balances`));return{balances:h(a.balances).map(o=>{let c=O(o);return{...c,token:{...c.token,address:R(c.token.address),symbol:w(c.token.symbol)??"unknown"}}}),summary:"Off-chain Relay app fee credits for this wallet. Claiming requires separate local signature integration."}}),i("relay_app_fee_claims",v,[],async(e,t)=>{let a=s(await r(`/app-fees/${t}/claims?${y(e)}`)),o=h(a.claims).map(s);for(let c of o)if(p(c.wallet)!==t)throw new d("Relay returned a fee claim for another wallet.");return{claims:m(o),nextCursor:x(a.continuation)}}),i("relay_balance_events",{...v,limit:{...g,maximum:50,description:"Maximum number of results, from 1 to 50."},requestId:{..._,description:"Relay request ID as a 0x-prefixed 32-byte hex string."},chainId:{...u,description:"Chain ID."},currency:{...I,description:"Token address filter."},startTimestamp:{type:"integer",minimum:0,description:"Start time in Unix seconds."},endTimestamp:{type:"integer",minimum:0,description:"End time in Unix seconds."},type:{...l,description:"Balance event type filter."}},[],async(e,t)=>{let a=s(await r(`/balance/${t}/events?${y(e)}`));if(p(a.wallet)!==t)throw new d("Relay returned balance events for another wallet.");let o=h(a.events).map(s);for(let c of o)if(p(c.wallet)!==t)throw new d("Relay returned a balance event for another wallet.");return{events:m(o),nextCursor:x(a.continuation)}}),i("relay_deposit_address",{address:{...l,description:"Deposit address to look up; supply this or depositAddressId."},depositAddressId:{...l,description:"Relay deposit address ID; supply this or address."},pageSize:{...g,maximum:50,description:"Maximum number of results, from 1 to 50."},pageToken:{...l,description:"Page token from a previous response."}},[],async e=>{if(e.address===void 0==(e.depositAddressId===void 0))throw new d("Provide exactly one deposit address or depositAddressId.");let t=s(await r(`/deposit-addresses/v2?${y(e)}`)),a=s(t.data),o=s(a.depositAddress);if(e.address!==void 0&&o.address!==e.address||e.depositAddressId!==void 0&&o.id!==e.depositAddressId)throw new d("Relay returned another deposit address.");return{data:m(a),nextPageToken:x(a.nextPageToken),summary:"Deposit address monitoring only. Reading an address does not create, change, fund or recover it."}}),i("relay_recovery_balances",{...v,limit:{...g,maximum:50,description:"Maximum number of results, from 1 to 50."},ownerChainId:{...u,description:"Recovery owner chain ID."}},["ownerChainId"],async(e,t)=>{let a=s(await r(`/withdrawals/balances?${y({...e,recoveryAddress:t})}`)),o=h(a.balances).map(c=>{let b=s(c);return C(b.amount),b});return{balances:m(o),nextCursor:x(a.continuation),summary:"Credited recovery balances only. Empty balances do not prove that an unattested deposit has no recoverable funds. Withdrawal signing remains a separate action."}}),i("relay_withdrawal_status",{id:{...l,description:"Relay withdrawal job ID."}},["id"],async e=>{let t=s(await r(`/withdrawals/status?${y(e)}`));if(typeof t.status!="string")throw new d("Relay returned an invalid withdrawal status.");return{status:w(t.status)??"unknown",data:m(t),summary:"Relay withdrawal job status; verify any reported transaction on its chain before treating funds as received."}})]}};export{B as a,X as b};
@@ -1 +1 @@
1
- var a={registry:{address:"0xF2A26110396b4162d48A16eE8683372a6A2c3b76",codeHash:"0xb08c7571b87c9a5d1d0d32b2a9accb4e4e923f191127a733072d99b00f463479"},helper:{address:"0x88BfFDf0ce9EB8889577924Cf802B2237bf8aD79",codeHash:"0xa33bd7460219439ad0e659548b6f08a71b3aab40ac02109ab69b364a00a5f036"},whitelist:{address:"0xab74612eB2ef5642fa804A52529fEDC6D98f6Cbd",codeHash:"0x335b0b4210eaa3c3d8956b16e2326851b54918bf85266b1fbf9c04461ea2a512"},beacon:{address:"0x5413041ebddd006f8b50a03a05236eade8fa884e",codeHash:"0xa0693b5efe62447f561c327fb56d7d1ab0930a5bb147a0f8844461a6b976b7f7"},implementation:{address:"0x1570a79aa494043DC01Ecc96405d5A8b45d24bDa",codeHash:"0xd3a1db41d5c42de3d2b6ff176e8603b9b825ff5603de555ed8f41cb270d71985"},staking:{codeHash:"0x533bcf9a4518b33b2bb541af1c1daa06f69ab6092cfd84944c1d57ebec825a69"},rewards:{address:"0x20DBb6906B3A7c04d9bA5258Eacaaa6CEdaDDdb0",codeHash:"0x6a482e5367e1aced7f5448e31e40140e4b899959376d040e0be502c37ce739b1"},oakLog:{address:"0x715DeAD3a80f8461d29aA6F9F7B39554c1294075",codeHash:"0x813f4e3ccc34b924559faf1f81706763c9649bad4c4f6c07547acd5713f481b9"},proxy:{codeHash:"0x813f4e3ccc34b924559faf1f81706763c9649bad4c4f6c07547acd5713f481b9"},stakingBeacon:{address:"0x9df506ae33dad46c83d226be462849c3071f63ac",codeHash:"0xa0693b5efe62447f561c327fb56d7d1ab0930a5bb147a0f8844461a6b976b7f7"},stakingImplementation:{address:"0x4c6b1D5377e353C6959C65d389aAe3127a84EC4e",codeHash:"0x30c917d96f73c2075d7d0cca801cd34c459060567ec90dfdb30b361bf29dd2ed"},rewardsBeacon:{address:"0x4768574074cf48b025457b14d109983079952134",codeHash:"0xa0693b5efe62447f561c327fb56d7d1ab0930a5bb147a0f8844461a6b976b7f7"},rewardsImplementation:{address:"0x15a8Ef0EA82c5D087BD8D89b5D10BA85FfD3BefE",codeHash:"0x2cdf99c071739c5bbde722901ab43a9085674c99647372d6d66ad2bec10ee3db"},oak:"0x6511c233790Ec10f7d673c64DC82C3F941D57828",dormantOak:"0x38fE199550E677Fa9caC196495460dfF97BCe28F",chop:"0x100765a16f42636Bd84EE1e86Bc5107b84bCdBA3",chainId:4663,measuredAtBlock:"106718816",source:"https://rpc.mainnet.chain.robinhood.com"},d={poolId:"0x8111082d181841cbd123e82bced032b1331140332b6ce3da37f53a6b24ed736c",stateView:"0xf3334192d15450cdd385c8b70e03f9a6bd9e673b",poolManager:"0x8366a39cc670b4001a1121b8f6a443a643e40951",key:{currency0:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",currency1:"0x100765a16f42636Bd84EE1e86Bc5107b84bCdBA3",fee:8388608,tickSpacing:200,hooks:"0x4e3468951D49f2EEa976eD0D6e75fFCb44a9a544"},dustV2Pool:"0x32c9b1748b914fd740054518d9322240a14b8aec"};export{a,d as b};
1
+ var a={registry:{address:"0xF2A26110396b4162d48A16eE8683372a6A2c3b76",codeHash:"0xb08c7571b87c9a5d1d0d32b2a9accb4e4e923f191127a733072d99b00f463479"},helper:{address:"0x88BfFDf0ce9EB8889577924Cf802B2237bf8aD79",codeHash:"0xa33bd7460219439ad0e659548b6f08a71b3aab40ac02109ab69b364a00a5f036"},whitelist:{address:"0xab74612eB2ef5642fa804A52529fEDC6D98f6Cbd",codeHash:"0x335b0b4210eaa3c3d8956b16e2326851b54918bf85266b1fbf9c04461ea2a512"},beacon:{address:"0x5413041ebddd006f8b50a03a05236eade8fa884e",codeHash:"0xa0693b5efe62447f561c327fb56d7d1ab0930a5bb147a0f8844461a6b976b7f7"},implementation:{address:"0x1570a79aa494043DC01Ecc96405d5A8b45d24bDa",codeHash:"0xd3a1db41d5c42de3d2b6ff176e8603b9b825ff5603de555ed8f41cb270d71985"},staking:{codeHash:"0x533bcf9a4518b33b2bb541af1c1daa06f69ab6092cfd84944c1d57ebec825a69"},rewards:{address:"0x20DBb6906B3A7c04d9bA5258Eacaaa6CEdaDDdb0",codeHash:"0x6a482e5367e1aced7f5448e31e40140e4b899959376d040e0be502c37ce739b1"},oakLog:{address:"0x715DeAD3a80f8461d29aA6F9F7B39554c1294075",codeHash:"0x813f4e3ccc34b924559faf1f81706763c9649bad4c4f6c07547acd5713f481b9"},proxy:{codeHash:"0x813f4e3ccc34b924559faf1f81706763c9649bad4c4f6c07547acd5713f481b9"},stakingBeacon:{address:"0x9df506ae33dad46c83d226be462849c3071f63ac",codeHash:"0xa0693b5efe62447f561c327fb56d7d1ab0930a5bb147a0f8844461a6b976b7f7"},stakingImplementation:{address:"0x4c6b1D5377e353C6959C65d389aAe3127a84EC4e",codeHash:"0x30c917d96f73c2075d7d0cca801cd34c459060567ec90dfdb30b361bf29dd2ed"},rewardsBeacon:{address:"0x4768574074cf48b025457b14d109983079952134",codeHash:"0xa0693b5efe62447f561c327fb56d7d1ab0930a5bb147a0f8844461a6b976b7f7"},rewardsImplementation:{address:"0x15a8Ef0EA82c5D087BD8D89b5D10BA85FfD3BefE",codeHash:"0x2cdf99c071739c5bbde722901ab43a9085674c99647372d6d66ad2bec10ee3db"},oak:"0x6511c233790Ec10f7d673c64DC82C3F941D57828",dormantOak:"0x38fE199550E677Fa9caC196495460dfF97BCe28F",chop:"0x100765a16f42636Bd84EE1e86Bc5107b84bCdBA3",chainId:4663,measuredAtBlock:"106718816",source:"https://rpc.mainnet.chain.robinhood.com"},d="0x4d7b4223144e14Ca1FB1324e28753b43277fD9F3",e={poolId:"0x8111082d181841cbd123e82bced032b1331140332b6ce3da37f53a6b24ed736c",stateView:"0xf3334192d15450cdd385c8b70e03f9a6bd9e673b",poolManager:"0x8366a39cc670b4001a1121b8f6a443a643e40951",key:{currency0:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",currency1:"0x100765a16f42636Bd84EE1e86Bc5107b84bCdBA3",fee:8388608,tickSpacing:200,hooks:"0x4e3468951D49f2EEa976eD0D6e75fFCb44a9a544"},dustV2Pool:"0x32c9b1748b914fd740054518d9322240a14b8aec"};export{a,d as b,e as c};