otto-intel-mcp 0.1.2 → 0.1.4
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.
- package/README.md +76 -18
- package/dist/account-userop-policy-definition.d.ts +14 -0
- package/dist/account-userop-policy-definition.js +12 -0
- package/dist/account-userop-policy-relation.d.ts +371 -0
- package/dist/account-userop-policy-relation.js +87 -0
- package/dist/adapter/cdp-signer.d.ts +76 -9
- package/dist/adapter/cdp-signer.js +274 -33
- package/dist/adapter/evm-call-failure.d.ts +29 -0
- package/dist/adapter/evm-call-failure.js +109 -0
- package/dist/adapter/refusal.d.ts +1 -1
- package/dist/adapter/refusal.js +13 -0
- package/dist/adapter/route-simulator.d.ts +91 -0
- package/dist/adapter/route-simulator.js +143 -0
- package/dist/adapter-cdp-index.d.ts +1 -1
- package/dist/executable-equities.d.ts +55 -0
- package/dist/executable-equities.js +116 -0
- package/dist/executable-yield-markets.d.ts +261 -0
- package/dist/executable-yield-markets.js +154 -0
- package/dist/execution-account-gas-quote.d.ts +141 -0
- package/dist/execution-account-gas-quote.js +443 -0
- package/dist/execution-account-gas-review.d.ts +123 -0
- package/dist/execution-account-gas-review.js +104 -0
- package/dist/execution-account-gas-runtime.d.ts +33 -0
- package/dist/execution-account-gas-runtime.js +131 -0
- package/dist/execution-account-gas-view.d.ts +936 -0
- package/dist/execution-account-gas-view.js +56 -0
- package/dist/execution-config.d.ts +3 -0
- package/dist/execution-config.js +4 -0
- package/dist/execution-delegated-definition.d.ts +7 -6
- package/dist/execution-delegated-definition.js +13 -2
- package/dist/execution-delegation-admin-definition.d.ts +127 -5
- package/dist/execution-delegation-admin-definition.js +155 -5
- package/dist/execution-delegation-admin.d.ts +48 -2
- package/dist/execution-delegation-admin.js +422 -12
- package/dist/execution-delegation-cap-store.d.ts +386 -0
- package/dist/execution-delegation-cap-store.js +1150 -0
- package/dist/execution-delegation-exit-definition.d.ts +309 -0
- package/dist/execution-delegation-exit-definition.js +204 -0
- package/dist/execution-delegation-exit-store.d.ts +114 -0
- package/dist/execution-delegation-exit-store.js +671 -0
- package/dist/execution-delegation-exit.d.ts +4 -0
- package/dist/execution-delegation-exit.js +614 -0
- package/dist/execution-delegation-finality.d.ts +22 -0
- package/dist/execution-delegation-finality.js +90 -0
- package/dist/execution-delegation-operation-store.d.ts +129 -0
- package/dist/execution-delegation-operation-store.js +1107 -0
- package/dist/execution-delegation-operations-definition.d.ts +282 -0
- package/dist/execution-delegation-operations-definition.js +117 -0
- package/dist/execution-delegation-operations.d.ts +6 -0
- package/dist/execution-delegation-operations.js +282 -0
- package/dist/execution-delegation-policy.d.ts +154 -8
- package/dist/execution-delegation-policy.js +273 -40
- package/dist/execution-delegation.d.ts +51 -0
- package/dist/execution-delegation.js +441 -31
- package/dist/execution-errors.d.ts +1 -1
- package/dist/execution-errors.js +122 -0
- package/dist/execution-index.d.ts +7 -2
- package/dist/execution-index.js +7 -2
- package/dist/execution-journal-schema.d.ts +96 -0
- package/dist/execution-journal-schema.js +368 -0
- package/dist/execution-journal-tables.d.ts +14 -0
- package/dist/execution-journal-tables.js +227 -0
- package/dist/execution-policy-compatibility.d.ts +34 -0
- package/dist/execution-policy-compatibility.js +76 -0
- package/dist/execution-registration.d.ts +54 -2
- package/dist/execution-registration.js +151 -5
- package/dist/execution-sponsored-account-profile.d.ts +32 -0
- package/dist/execution-sponsored-account-profile.js +59 -0
- package/dist/execution-sponsored-account.d.ts +1519 -0
- package/dist/execution-sponsored-account.js +222 -0
- package/dist/execution-sponsored-definition.d.ts +1713 -0
- package/dist/execution-sponsored-definition.js +185 -0
- package/dist/execution-sponsored-gas-policy.d.ts +27 -0
- package/dist/execution-sponsored-gas-policy.js +110 -0
- package/dist/execution-sponsored-hosted.d.ts +3 -0
- package/dist/execution-sponsored-hosted.js +71 -0
- package/dist/execution-sponsored-index.d.ts +1322 -0
- package/dist/execution-sponsored-index.js +102 -0
- package/dist/execution-sponsored-mcp-definition.d.ts +1662 -0
- package/dist/execution-sponsored-mcp-definition.js +94 -0
- package/dist/execution-sponsored-receipt.d.ts +47 -0
- package/dist/execution-sponsored-receipt.js +74 -0
- package/dist/execution-sponsored-registration.d.ts +14 -0
- package/dist/execution-sponsored-registration.js +77 -0
- package/dist/execution-sponsored-runtime.d.ts +84 -0
- package/dist/execution-sponsored-runtime.js +149 -0
- package/dist/execution-sponsored-settlement.d.ts +15 -0
- package/dist/execution-sponsored-settlement.js +88 -0
- package/dist/execution-sponsored-store.d.ts +67 -0
- package/dist/execution-sponsored-store.js +517 -0
- package/dist/execution-sponsored-transport.d.ts +90 -0
- package/dist/execution-sponsored-transport.js +180 -0
- package/dist/execution-tool-definitions.d.ts +21 -21
- package/dist/execution-tool-definitions.js +0 -7
- package/dist/execution-tools.d.ts +53 -1
- package/dist/execution-tools.js +171 -13
- package/dist/execution-worker-guard.d.ts +28 -0
- package/dist/execution-worker-guard.js +124 -0
- package/dist/hybrid-yield-index.d.ts +10 -0
- package/dist/hybrid-yield-index.js +11 -0
- package/dist/hybrid-yield-markets.d.ts +96 -0
- package/dist/hybrid-yield-markets.js +124 -0
- package/dist/hybrid-yield.d.ts +411 -0
- package/dist/hybrid-yield.js +155 -0
- package/dist/hyperliquid-order-builder.js +4 -0
- package/dist/lifi-execution-client.d.ts +6 -0
- package/dist/lifi-execution-client.js +3 -0
- package/dist/lp-userop-account.d.ts +461 -0
- package/dist/lp-userop-account.js +417 -0
- package/dist/lp-userop-authority.d.ts +49 -0
- package/dist/lp-userop-authority.js +211 -0
- package/dist/lp-userop-definition.d.ts +233 -0
- package/dist/lp-userop-definition.js +85 -0
- package/dist/lp-userop-hosted.d.ts +3 -0
- package/dist/lp-userop-hosted.js +73 -0
- package/dist/lp-userop-index.d.ts +1569 -0
- package/dist/lp-userop-index.js +112 -0
- package/dist/lp-userop-mcp-definition.d.ts +1220 -0
- package/dist/lp-userop-mcp-definition.js +46 -0
- package/dist/lp-userop-operation.d.ts +1230 -0
- package/dist/lp-userop-operation.js +140 -0
- package/dist/lp-userop-registration.d.ts +14 -0
- package/dist/lp-userop-registration.js +70 -0
- package/dist/lp-userop-settlement.d.ts +89 -0
- package/dist/lp-userop-settlement.js +184 -0
- package/dist/lp-userop.d.ts +643 -0
- package/dist/lp-userop.js +343 -0
- package/dist/native-yield-account-definition.d.ts +1192 -0
- package/dist/native-yield-account-definition.js +232 -0
- package/dist/native-yield-account-gas.d.ts +58 -0
- package/dist/native-yield-account-gas.js +228 -0
- package/dist/native-yield-account-index.d.ts +23 -0
- package/dist/native-yield-account-index.js +28 -0
- package/dist/native-yield-account-policy.d.ts +168 -0
- package/dist/native-yield-account-policy.js +525 -0
- package/dist/native-yield-account-rpc.d.ts +8 -0
- package/dist/native-yield-account-rpc.js +128 -0
- package/dist/native-yield-account-runtime.d.ts +71 -0
- package/dist/native-yield-account-runtime.js +125 -0
- package/dist/native-yield-account-store.d.ts +40 -0
- package/dist/native-yield-account-store.js +307 -0
- package/dist/native-yield-account.d.ts +662 -0
- package/dist/native-yield-account.js +371 -0
- package/dist/native-yield-consent-store.d.ts +20 -0
- package/dist/native-yield-consent-store.js +317 -0
- package/dist/native-yield-definition.d.ts +288 -0
- package/dist/native-yield-definition.js +105 -0
- package/dist/native-yield-reader.d.ts +4 -0
- package/dist/native-yield-reader.js +137 -0
- package/dist/native-yield-settlement.d.ts +48 -0
- package/dist/native-yield-settlement.js +167 -0
- package/dist/native-yield-simulation.d.ts +18 -0
- package/dist/native-yield-simulation.js +45 -0
- package/dist/native-yield-userop-account.d.ts +675 -0
- package/dist/native-yield-userop-account.js +357 -0
- package/dist/native-yield-userop-authority.d.ts +214 -0
- package/dist/native-yield-userop-authority.js +296 -0
- package/dist/native-yield-userop-definition.d.ts +331 -0
- package/dist/native-yield-userop-definition.js +105 -0
- package/dist/native-yield-userop-hosted.d.ts +3 -0
- package/dist/native-yield-userop-hosted.js +71 -0
- package/dist/native-yield-userop-index.d.ts +1522 -0
- package/dist/native-yield-userop-index.js +142 -0
- package/dist/native-yield-userop-mcp-definition.d.ts +1356 -0
- package/dist/native-yield-userop-mcp-definition.js +50 -0
- package/dist/native-yield-userop-operation.d.ts +845 -0
- package/dist/native-yield-userop-operation.js +127 -0
- package/dist/native-yield-userop-policy.d.ts +23 -0
- package/dist/native-yield-userop-policy.js +25 -0
- package/dist/native-yield-userop-registration.d.ts +17 -0
- package/dist/native-yield-userop-registration.js +76 -0
- package/dist/native-yield-userop-settlement.d.ts +8 -0
- package/dist/native-yield-userop-settlement.js +79 -0
- package/dist/native-yield-userop-simulation.d.ts +18 -0
- package/dist/native-yield-userop-simulation.js +34 -0
- package/dist/native-yield-userop.d.ts +35 -0
- package/dist/native-yield-userop.js +156 -0
- package/dist/native-yield-verify.d.ts +30 -0
- package/dist/native-yield-verify.js +141 -0
- package/dist/native-yield.d.ts +17 -0
- package/dist/native-yield.js +119 -0
- package/dist/stdio-main.js +0 -0
- package/dist/stock-buy-definition.d.ts +338 -0
- package/dist/stock-buy-definition.js +127 -0
- package/dist/stock-buy-oracle.d.ts +8 -0
- package/dist/stock-buy-oracle.js +22 -0
- package/dist/stock-buy.d.ts +17 -0
- package/dist/stock-buy.js +164 -0
- package/dist/tool-definitions.d.ts +3 -1
- package/dist/tool-definitions.js +55 -2
- package/dist/vendor/lp-v3/lp-v3-atomic-contract.d.ts +445 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-contract.js +90 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-evidence.d.ts +14 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-evidence.js +82 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-index.d.ts +80 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-index.js +19 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-plan.d.ts +43 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-plan.js +112 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read-contract.d.ts +312 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read-contract.js +41 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read-index.d.ts +3 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read-index.js +3 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read-rpc.d.ts +49 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read-rpc.js +88 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read.d.ts +17 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-read.js +232 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-settlement.d.ts +105 -0
- package/dist/vendor/lp-v3/lp-v3-atomic-settlement.js +162 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-contract.d.ts +606 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-contract.js +59 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-index.d.ts +168 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-index.js +23 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-observation.d.ts +32 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-observation.js +228 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-plan.d.ts +11 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-plan.js +91 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-reconcile.d.ts +9 -0
- package/dist/vendor/lp-v3/lp-v3-collect-protocol-reconcile.js +124 -0
- package/dist/vendor/lp-v3/lp-v3-contract.d.ts +538 -0
- package/dist/vendor/lp-v3/lp-v3-contract.js +137 -0
- package/dist/vendor/lp-v3/lp-v3-evidence.d.ts +25 -0
- package/dist/vendor/lp-v3/lp-v3-evidence.js +168 -0
- package/dist/vendor/lp-v3/lp-v3-plan.d.ts +22 -0
- package/dist/vendor/lp-v3/lp-v3-plan.js +135 -0
- package/dist/vendor/lp-v3/types.d.ts +131 -0
- package/dist/vendor/lp-v3/types.js +6 -0
- package/dist/vendor/lp-v3/v4-math.d.ts +18 -0
- package/dist/vendor/lp-v3/v4-math.js +90 -0
- package/dist/yield-deposit-definition.d.ts +374 -0
- package/dist/yield-deposit-definition.js +123 -0
- package/dist/yield-deposit.d.ts +16 -0
- package/dist/yield-deposit.js +149 -0
- package/dist/yield-route-semantics.d.ts +27 -0
- package/dist/yield-route-semantics.js +71 -0
- package/dist/yield-withdraw-definition.d.ts +357 -0
- package/dist/yield-withdraw-definition.js +90 -0
- package/dist/yield-withdraw.d.ts +11 -0
- package/dist/yield-withdraw.js +122 -0
- package/package.json +239 -7
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `otto_prepare_yield_withdraw` — the twin of `otto_prepare_yield_deposit` (Founder word `fence v2`,
|
|
3
|
+
* 2026-09-03): a delegated Yield Copilot WITHDRAW as a `otto_prepare_swap` pair whose INPUT token is the
|
|
4
|
+
* registry vault's share token and whose OUTPUT token is USDC, delivered to the signing account.
|
|
5
|
+
*
|
|
6
|
+
* WHY A SWAP. LI.FI routes `shares → USDC` through the diamond as a "composer" (zap-out) leg behind the same
|
|
7
|
+
* fenced GenericSwapV3 entry point, at redeem parity: on live quotes (2026-09-03) 0.5 gtUSDCp → 553,533 USDC
|
|
8
|
+
* units = the vault's own `previewRedeem` minus LI.FI's 0.25% fixed fee. The pair is submittable through
|
|
9
|
+
* the unchanged `otto_submit_under_delegation` path ONLY under fence v2 (the share-token approve rule) and
|
|
10
|
+
* ONLY for a permission minted under cap ruleset v2; the send gate values a withdraw at zero against the
|
|
11
|
+
* person's cap (it returns their own assets to them) and bounds it by the engine's share cap instead.
|
|
12
|
+
*
|
|
13
|
+
* WHAT THIS TOOL PINS: the input token is the registry row's `vaultAddress`, the output token is the row's
|
|
14
|
+
* asset (USDC), both never caller inputs; the row is the CURRENT registry record (commitment recomputed);
|
|
15
|
+
* REDEEM PARITY — the quoted USDC may not fall below the vault's own `previewRedeem(shares)` by more than
|
|
16
|
+
* `YIELD_WITHDRAW_PARITY_TOLERANCE_BPS`.
|
|
17
|
+
*/
|
|
18
|
+
import { z } from 'zod';
|
|
19
|
+
import { YIELD_ROUTE_SEMANTICS_SCHEMA } from './yield-route-semantics.js';
|
|
20
|
+
import { ACCOUNT_PROFILE_SCHEMA, EXECUTION_ENVELOPE_SCHEMA, PREPARE_SWAP_INPUT_SCHEMA, } from './execution-tool-definitions.js';
|
|
21
|
+
export const YIELD_WITHDRAW_TOOL_NAME = 'otto_prepare_yield_withdraw';
|
|
22
|
+
/**
|
|
23
|
+
* 🔴 PINNED REDEEM-PARITY TOLERANCE, in bps of the vault's own `previewRedeem(shares)`. Same derivation as the
|
|
24
|
+
* deposit's: LI.FI's fixed fee-collection leg takes 0.25% of the INPUT (here: shares) before the zap-out
|
|
25
|
+
* (25 bps) + rounding headroom (5 bps) = 30 bps. `slippage.maxBps` bounds the on-chain floor, not this.
|
|
26
|
+
* A test pins this value; widening it must redden that test.
|
|
27
|
+
*/
|
|
28
|
+
export const YIELD_WITHDRAW_PARITY_TOLERANCE_BPS = 30;
|
|
29
|
+
const uintString = z
|
|
30
|
+
.string()
|
|
31
|
+
.regex(/^[1-9]\d*$/, 'must be a positive decimal integer')
|
|
32
|
+
.refine((value) => BigInt(value) <= (1n << 256n) - 1n, 'must fit uint256');
|
|
33
|
+
export const PREPARE_YIELD_WITHDRAW_INPUT_SCHEMA = z
|
|
34
|
+
.object({
|
|
35
|
+
accountProfile: ACCOUNT_PROFILE_SCHEMA,
|
|
36
|
+
executableMarketId: z.string().min(1).max(120),
|
|
37
|
+
registryCommitment: z
|
|
38
|
+
.string()
|
|
39
|
+
.regex(/^sha256:[0-9a-f]{64}$/, 'must be the sha256:… registry commitment the READ half served'),
|
|
40
|
+
/** Exact vault shares to redeem, in atomic units (18 decimals) — at most the account's `maxRedeem`. */
|
|
41
|
+
shares: uintString,
|
|
42
|
+
slippage: z
|
|
43
|
+
.object({
|
|
44
|
+
maxBps: z.number().int().min(1).max(1_000),
|
|
45
|
+
})
|
|
46
|
+
.strict(),
|
|
47
|
+
client_ref: z.string().trim().min(1).max(128).optional(),
|
|
48
|
+
})
|
|
49
|
+
.strict();
|
|
50
|
+
const addressOut = z.string().regex(/^0x[0-9a-fA-F]{40}$/);
|
|
51
|
+
const uintOut = z.string().regex(/^\d+$/);
|
|
52
|
+
export const YIELD_WITHDRAW_PREVIEW_SCHEMA = z
|
|
53
|
+
.object({
|
|
54
|
+
market_id: z.string(),
|
|
55
|
+
venue: z.string(),
|
|
56
|
+
protocol: z.literal('MORPHO'),
|
|
57
|
+
chain_id: z.literal(8453),
|
|
58
|
+
vault: addressOut,
|
|
59
|
+
asset: addressOut,
|
|
60
|
+
/** The shares redeemed (atomic, 18 dp) — the approve amount; the engine bounds it by the share cap. */
|
|
61
|
+
shares: uintOut,
|
|
62
|
+
/** USDC (atomic) the route quotes for `shares`. */
|
|
63
|
+
expected_assets: uintOut,
|
|
64
|
+
/** The on-chain floor the router enforces; what `prepareInput.slippage.minAmountOut` carries. */
|
|
65
|
+
min_assets: uintOut,
|
|
66
|
+
/** The vault's own `previewRedeem(shares)` at prepare time. */
|
|
67
|
+
preview_redeem_assets: uintOut,
|
|
68
|
+
parity_shortfall_bps: z.number().int().min(0),
|
|
69
|
+
parity_tolerance_bps: z.literal(YIELD_WITHDRAW_PARITY_TOLERANCE_BPS),
|
|
70
|
+
quoted_fees: z.array(z.object({ name: z.string(), amount_usd: z.string() }).strict()),
|
|
71
|
+
quoted_gas_usd: z.string().optional(),
|
|
72
|
+
route_semantics: YIELD_ROUTE_SEMANTICS_SCHEMA,
|
|
73
|
+
})
|
|
74
|
+
.strict();
|
|
75
|
+
export const PREPARE_YIELD_WITHDRAW_OUTPUT_SCHEMA = z
|
|
76
|
+
.object({
|
|
77
|
+
envelope: EXECUTION_ENVELOPE_SCHEMA,
|
|
78
|
+
prepareInput: PREPARE_SWAP_INPUT_SCHEMA,
|
|
79
|
+
preview: YIELD_WITHDRAW_PREVIEW_SCHEMA,
|
|
80
|
+
registry_commitment: z.string().regex(/^sha256:[0-9a-f]{64}$/),
|
|
81
|
+
})
|
|
82
|
+
.strict();
|
|
83
|
+
export const YIELD_WITHDRAW_TOOL_DEFINITION = Object.freeze({
|
|
84
|
+
name: YIELD_WITHDRAW_TOOL_NAME,
|
|
85
|
+
title: 'Prepare a Yield Copilot vault withdraw (Morpho USDC on Base) as a delegable swap pair',
|
|
86
|
+
description: "Prepare the EXACT otto_prepare_swap pair (envelope + prepareInput) that redeems vault shares from one of the executable Morpho vaults in the Yield Copilot registry back to USDC in the signing account, as a LI.FI exit route (which may sell shares or compose a protocol redemption) whose input token is the vault's ERC-4626 share token. The vault and the asset come from the registry row named by executableMarketId and are never inputs; the caller's registryCommitment must equal the commitment recomputed over the current record. The quoted USDC is checked against the vault's own previewRedeem and refused when it falls short by more than the pinned tolerance. Returns the pair unchanged plus a preview; never signs or submits — submit the pair through otto_submit_under_delegation, which admits a withdraw only under fence v2 and a permission minted under cap ruleset v2, values it at zero against the per-swap cap (it returns the person's own assets), and bounds it by the engine's share cap.",
|
|
87
|
+
inputSchema: PREPARE_YIELD_WITHDRAW_INPUT_SCHEMA,
|
|
88
|
+
outputSchema: PREPARE_YIELD_WITHDRAW_OUTPUT_SCHEMA,
|
|
89
|
+
});
|
|
90
|
+
//# sourceMappingURL=yield-withdraw-definition.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type PublicClient } from 'viem';
|
|
2
|
+
import { type ExecutionToolRuntime } from './execution-tools.js';
|
|
3
|
+
import { type PrepareYieldWithdrawOutput, type YieldVaultReader } from './yield-withdraw-definition.js';
|
|
4
|
+
/** The production reader for BOTH yield constructors: previews over the delegation rig's Base public client. */
|
|
5
|
+
export declare function viemYieldVaultReader(pub: PublicClient): YieldVaultReader;
|
|
6
|
+
/**
|
|
7
|
+
* The shortfall of the quoted USDC against the vault's own `previewRedeem`, in bps of the preview (0 when
|
|
8
|
+
* the route quotes at or above it). Refuses past the pinned tolerance.
|
|
9
|
+
*/
|
|
10
|
+
export declare function assertRedeemParity(previewAssets: bigint, quotedAssets: bigint): number;
|
|
11
|
+
export declare function prepareYieldWithdraw(runtime: ExecutionToolRuntime, rawInput: unknown, signal?: AbortSignal): Promise<PrepareYieldWithdrawOutput>;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `otto_prepare_yield_withdraw` — the constructor. See `yield-withdraw-definition.ts` for WHY it is a swap.
|
|
3
|
+
*
|
|
4
|
+
* Steps, mirroring the deposit: strict input → the registry row (unknown / stale commitment / not Base-USDC-
|
|
5
|
+
* MORPHO → refused by name) → ONE LI.FI quote through `quoteSwap` for `row.vaultAddress → row.asset` from
|
|
6
|
+
* the signing account (both tokens the row's, never the caller's) → redeem parity against the vault's own
|
|
7
|
+
* `previewRedeem(shares)` (reader absent or failing → refused, nothing prepared) → the swap prepareInput
|
|
8
|
+
* with `slippage.minAmountOut` = the quote's floor, then the envelope from THAT quote via
|
|
9
|
+
* `prepareSwapFromQuote`. Nothing here signs, submits, or touches the delegation.
|
|
10
|
+
*/
|
|
11
|
+
import { describeYieldRoute } from './yield-route-semantics.js';
|
|
12
|
+
import { getAddress, parseAbi } from 'viem';
|
|
13
|
+
import { refuse } from './execution-errors.js';
|
|
14
|
+
import { PREPARE_SWAP_INPUT_SCHEMA } from './execution-tool-definitions.js';
|
|
15
|
+
import { prepareSwapFromQuote, quoteSwap, } from './execution-tools.js';
|
|
16
|
+
import { resolveYieldDepositMarket } from './yield-deposit.js';
|
|
17
|
+
import { PREPARE_YIELD_WITHDRAW_INPUT_SCHEMA, PREPARE_YIELD_WITHDRAW_OUTPUT_SCHEMA, YIELD_WITHDRAW_PARITY_TOLERANCE_BPS, } from './yield-withdraw-definition.js';
|
|
18
|
+
const ERC4626_PREVIEW_ABI = parseAbi([
|
|
19
|
+
'function previewDeposit(uint256 assets) view returns (uint256)',
|
|
20
|
+
'function previewRedeem(uint256 shares) view returns (uint256)',
|
|
21
|
+
]);
|
|
22
|
+
/** The production reader for BOTH yield constructors: previews over the delegation rig's Base public client. */
|
|
23
|
+
export function viemYieldVaultReader(pub) {
|
|
24
|
+
return Object.freeze({
|
|
25
|
+
async previewDeposit(vault, assets) {
|
|
26
|
+
return pub.readContract({ address: vault, abi: ERC4626_PREVIEW_ABI, functionName: 'previewDeposit', args: [assets] });
|
|
27
|
+
},
|
|
28
|
+
async previewRedeem(vault, shares) {
|
|
29
|
+
return pub.readContract({ address: vault, abi: ERC4626_PREVIEW_ABI, functionName: 'previewRedeem', args: [shares] });
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The shortfall of the quoted USDC against the vault's own `previewRedeem`, in bps of the preview (0 when
|
|
35
|
+
* the route quotes at or above it). Refuses past the pinned tolerance.
|
|
36
|
+
*/
|
|
37
|
+
export function assertRedeemParity(previewAssets, quotedAssets) {
|
|
38
|
+
if (previewAssets <= 0n) {
|
|
39
|
+
return refuse('YIELD_PREVIEW_UNAVAILABLE', 'the vault previews zero assets for this redeem');
|
|
40
|
+
}
|
|
41
|
+
if (quotedAssets >= previewAssets)
|
|
42
|
+
return 0;
|
|
43
|
+
const shortfallBps = Number(((previewAssets - quotedAssets) * 10000n) / previewAssets);
|
|
44
|
+
// EXACT, by cross-multiplication (codex gate r1 LOW) — see assertDepositParity.
|
|
45
|
+
if ((previewAssets - quotedAssets) * 10000n > previewAssets * BigInt(YIELD_WITHDRAW_PARITY_TOLERANCE_BPS)) {
|
|
46
|
+
return refuse('YIELD_WITHDRAW_PARITY', `the route quotes ${shortfallBps} bps less USDC than the vault's own previewRedeem (tolerance ${YIELD_WITHDRAW_PARITY_TOLERANCE_BPS} bps); the withdraw is not prepared`);
|
|
47
|
+
}
|
|
48
|
+
return shortfallBps;
|
|
49
|
+
}
|
|
50
|
+
function quotedFeeLines(quote) {
|
|
51
|
+
const estimate = quote.estimate;
|
|
52
|
+
const lines = Array.isArray(estimate.feeCosts) ? estimate.feeCosts : [];
|
|
53
|
+
return lines.flatMap((line) => {
|
|
54
|
+
const l = line;
|
|
55
|
+
return typeof l.name === 'string' && typeof l.amountUSD === 'string' ? [{ name: l.name, amount_usd: l.amountUSD }] : [];
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function quotedGasUsd(quote) {
|
|
59
|
+
const estimate = quote.estimate;
|
|
60
|
+
const first = Array.isArray(estimate.gasCosts) ? estimate.gasCosts[0] : undefined;
|
|
61
|
+
return typeof first?.amountUSD === 'string' ? first.amountUSD : undefined;
|
|
62
|
+
}
|
|
63
|
+
export async function prepareYieldWithdraw(runtime, rawInput, signal) {
|
|
64
|
+
const input = PREPARE_YIELD_WITHDRAW_INPUT_SCHEMA.parse(rawInput);
|
|
65
|
+
const market = resolveYieldDepositMarket(input);
|
|
66
|
+
const reader = runtime.yieldVaultReader;
|
|
67
|
+
if (!reader) {
|
|
68
|
+
return refuse('YIELD_PREVIEW_UNAVAILABLE', 'this server has no vault reader, so redeem parity cannot be checked; nothing is prepared');
|
|
69
|
+
}
|
|
70
|
+
const vault = getAddress(market.vaultAddress);
|
|
71
|
+
const asset = getAddress(market.asset.address);
|
|
72
|
+
const shares = BigInt(input.shares);
|
|
73
|
+
// The swap request: fromToken PINNED to the registry vault, toToken PINNED to its asset. Quoted once.
|
|
74
|
+
const quoteInput = PREPARE_SWAP_INPUT_SCHEMA.parse({
|
|
75
|
+
accountProfile: input.accountProfile,
|
|
76
|
+
chainId: market.chainId,
|
|
77
|
+
fromToken: vault,
|
|
78
|
+
toToken: asset,
|
|
79
|
+
fromAmount: input.shares,
|
|
80
|
+
slippage: { maxBps: input.slippage.maxBps },
|
|
81
|
+
...(input.client_ref ? { client_ref: input.client_ref } : {}),
|
|
82
|
+
});
|
|
83
|
+
const quote = await quoteSwap(runtime, quoteInput, signal);
|
|
84
|
+
const expectedAssets = BigInt(quote.estimate.toAmount);
|
|
85
|
+
const minAssets = BigInt(quote.estimate.toAmountMin);
|
|
86
|
+
let previewAssets;
|
|
87
|
+
try {
|
|
88
|
+
previewAssets = await reader.previewRedeem(vault, shares);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return refuse('YIELD_PREVIEW_UNAVAILABLE', "the vault's previewRedeem could not be read, so redeem parity cannot be checked; nothing is prepared");
|
|
92
|
+
}
|
|
93
|
+
const shortfallBps = assertRedeemParity(previewAssets, expectedAssets);
|
|
94
|
+
const prepareInput = PREPARE_SWAP_INPUT_SCHEMA.parse({
|
|
95
|
+
...quoteInput,
|
|
96
|
+
slippage: { maxBps: input.slippage.maxBps, minAmountOut: minAssets.toString() },
|
|
97
|
+
});
|
|
98
|
+
const envelope = prepareSwapFromQuote(runtime, prepareInput, quote);
|
|
99
|
+
return PREPARE_YIELD_WITHDRAW_OUTPUT_SCHEMA.parse({
|
|
100
|
+
envelope,
|
|
101
|
+
prepareInput,
|
|
102
|
+
preview: {
|
|
103
|
+
route_semantics: describeYieldRoute(quote, 'withdraw', vault, market.chainId),
|
|
104
|
+
market_id: market.id,
|
|
105
|
+
venue: market.venue,
|
|
106
|
+
protocol: 'MORPHO',
|
|
107
|
+
chain_id: 8453,
|
|
108
|
+
vault,
|
|
109
|
+
asset,
|
|
110
|
+
shares: shares.toString(),
|
|
111
|
+
expected_assets: expectedAssets.toString(),
|
|
112
|
+
min_assets: minAssets.toString(),
|
|
113
|
+
preview_redeem_assets: previewAssets.toString(),
|
|
114
|
+
parity_shortfall_bps: shortfallBps,
|
|
115
|
+
parity_tolerance_bps: YIELD_WITHDRAW_PARITY_TOLERANCE_BPS,
|
|
116
|
+
quoted_fees: quotedFeeLines(quote),
|
|
117
|
+
...(quotedGasUsd(quote) !== undefined ? { quoted_gas_usd: quotedGasUsd(quote) } : {}),
|
|
118
|
+
},
|
|
119
|
+
registry_commitment: input.registryCommitment,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=yield-withdraw.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "otto-intel-mcp",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Otto AI market intelligence + execution constructors over MCP
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "Otto AI market intelligence + execution constructors over MCP \u2014 hosted at mcp.ottoai.services (first eligible cached call free; crypto news paid-only; pay per call in USDC via x402) or local via `npx otto-intel-mcp`. Library entries: otto-intel-mcp/execution, /adapter, /adapter-cdp.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://docs.useotto.xyz/acp-swarm/otto-intel-mcp",
|
|
7
7
|
"bugs": {
|
|
@@ -71,6 +71,10 @@
|
|
|
71
71
|
"dist/adapter/chain.d.ts",
|
|
72
72
|
"dist/adapter/erc20.js",
|
|
73
73
|
"dist/adapter/erc20.d.ts",
|
|
74
|
+
"dist/adapter/evm-call-failure.js",
|
|
75
|
+
"dist/adapter/evm-call-failure.d.ts",
|
|
76
|
+
"dist/adapter/route-simulator.js",
|
|
77
|
+
"dist/adapter/route-simulator.d.ts",
|
|
74
78
|
"dist/adapter/lifi-decode.js",
|
|
75
79
|
"dist/adapter/lifi-decode.d.ts",
|
|
76
80
|
"dist/adapter/refusal.js",
|
|
@@ -87,6 +91,24 @@
|
|
|
87
91
|
"dist/execution-delegation.d.ts",
|
|
88
92
|
"dist/execution-delegation-policy.js",
|
|
89
93
|
"dist/execution-delegation-policy.d.ts",
|
|
94
|
+
"dist/execution-delegation-cap-store.js",
|
|
95
|
+
"dist/execution-delegation-cap-store.d.ts",
|
|
96
|
+
"dist/execution-delegation-operation-store.js",
|
|
97
|
+
"dist/execution-delegation-operation-store.d.ts",
|
|
98
|
+
"dist/execution-delegation-finality.js",
|
|
99
|
+
"dist/execution-delegation-finality.d.ts",
|
|
100
|
+
"dist/execution-delegation-operations.js",
|
|
101
|
+
"dist/execution-delegation-operations.d.ts",
|
|
102
|
+
"dist/execution-delegation-operations-definition.js",
|
|
103
|
+
"dist/execution-delegation-operations-definition.d.ts",
|
|
104
|
+
"dist/execution-delegation-exit.js",
|
|
105
|
+
"dist/execution-delegation-exit.d.ts",
|
|
106
|
+
"dist/execution-delegation-exit-definition.js",
|
|
107
|
+
"dist/execution-delegation-exit-definition.d.ts",
|
|
108
|
+
"dist/execution-delegation-exit-store.js",
|
|
109
|
+
"dist/execution-delegation-exit-store.d.ts",
|
|
110
|
+
"dist/execution-worker-guard.js",
|
|
111
|
+
"dist/execution-worker-guard.d.ts",
|
|
90
112
|
"dist/execution-delegated-definition.js",
|
|
91
113
|
"dist/execution-delegated-definition.d.ts",
|
|
92
114
|
"dist/prepared-artifacts.js",
|
|
@@ -98,7 +120,189 @@
|
|
|
98
120
|
"dist/boot-redaction.js",
|
|
99
121
|
"dist/boot-redaction.d.ts",
|
|
100
122
|
"dist/package-version.js",
|
|
101
|
-
"dist/package-version.d.ts"
|
|
123
|
+
"dist/package-version.d.ts",
|
|
124
|
+
"dist/executable-equities.js",
|
|
125
|
+
"dist/executable-equities.d.ts",
|
|
126
|
+
"dist/stock-buy.js",
|
|
127
|
+
"dist/stock-buy.d.ts",
|
|
128
|
+
"dist/stock-buy-definition.js",
|
|
129
|
+
"dist/stock-buy-definition.d.ts",
|
|
130
|
+
"dist/stock-buy-oracle.js",
|
|
131
|
+
"dist/stock-buy-oracle.d.ts",
|
|
132
|
+
"dist/yield-deposit.js",
|
|
133
|
+
"dist/yield-deposit.d.ts",
|
|
134
|
+
"dist/yield-deposit-definition.js",
|
|
135
|
+
"dist/yield-deposit-definition.d.ts",
|
|
136
|
+
"dist/executable-yield-markets.js",
|
|
137
|
+
"dist/executable-yield-markets.d.ts",
|
|
138
|
+
"dist/yield-withdraw.js",
|
|
139
|
+
"dist/yield-withdraw.d.ts",
|
|
140
|
+
"dist/yield-withdraw-definition.js",
|
|
141
|
+
"dist/yield-withdraw-definition.d.ts",
|
|
142
|
+
"dist/yield-route-semantics.js",
|
|
143
|
+
"dist/yield-route-semantics.d.ts",
|
|
144
|
+
"dist/hybrid-yield-markets.js",
|
|
145
|
+
"dist/hybrid-yield-markets.d.ts",
|
|
146
|
+
"dist/hybrid-yield.js",
|
|
147
|
+
"dist/hybrid-yield.d.ts",
|
|
148
|
+
"dist/hybrid-yield-index.js",
|
|
149
|
+
"dist/hybrid-yield-index.d.ts",
|
|
150
|
+
"dist/native-yield-definition.js",
|
|
151
|
+
"dist/native-yield-definition.d.ts",
|
|
152
|
+
"dist/native-yield-reader.js",
|
|
153
|
+
"dist/native-yield-reader.d.ts",
|
|
154
|
+
"dist/native-yield.js",
|
|
155
|
+
"dist/native-yield.d.ts",
|
|
156
|
+
"dist/native-yield-verify.js",
|
|
157
|
+
"dist/native-yield-verify.d.ts",
|
|
158
|
+
"dist/native-yield-settlement.js",
|
|
159
|
+
"dist/native-yield-settlement.d.ts",
|
|
160
|
+
"dist/native-yield-simulation.js",
|
|
161
|
+
"dist/native-yield-simulation.d.ts",
|
|
162
|
+
"dist/execution-journal-schema.js",
|
|
163
|
+
"dist/execution-journal-schema.d.ts",
|
|
164
|
+
"dist/execution-policy-compatibility.js",
|
|
165
|
+
"dist/execution-policy-compatibility.d.ts",
|
|
166
|
+
"dist/native-yield-consent-store.js",
|
|
167
|
+
"dist/native-yield-consent-store.d.ts",
|
|
168
|
+
"dist/native-yield-account-definition.js",
|
|
169
|
+
"dist/native-yield-account-definition.d.ts",
|
|
170
|
+
"dist/native-yield-account-policy.js",
|
|
171
|
+
"dist/native-yield-account-policy.d.ts",
|
|
172
|
+
"dist/native-yield-account-gas.js",
|
|
173
|
+
"dist/native-yield-account-gas.d.ts",
|
|
174
|
+
"dist/native-yield-account-rpc.js",
|
|
175
|
+
"dist/native-yield-account-rpc.d.ts",
|
|
176
|
+
"dist/native-yield-account-runtime.js",
|
|
177
|
+
"dist/native-yield-account-runtime.d.ts",
|
|
178
|
+
"dist/native-yield-account-store.js",
|
|
179
|
+
"dist/native-yield-account-store.d.ts",
|
|
180
|
+
"dist/native-yield-account.js",
|
|
181
|
+
"dist/native-yield-account.d.ts",
|
|
182
|
+
"dist/native-yield-account-index.js",
|
|
183
|
+
"dist/native-yield-account-index.d.ts",
|
|
184
|
+
"dist/execution-sponsored-account.js",
|
|
185
|
+
"dist/execution-sponsored-account.d.ts",
|
|
186
|
+
"dist/execution-sponsored-definition.js",
|
|
187
|
+
"dist/execution-sponsored-definition.d.ts",
|
|
188
|
+
"dist/execution-sponsored-index.js",
|
|
189
|
+
"dist/execution-sponsored-index.d.ts",
|
|
190
|
+
"dist/execution-sponsored-receipt.js",
|
|
191
|
+
"dist/execution-sponsored-receipt.d.ts",
|
|
192
|
+
"dist/execution-sponsored-runtime.js",
|
|
193
|
+
"dist/execution-sponsored-runtime.d.ts",
|
|
194
|
+
"dist/execution-sponsored-settlement.js",
|
|
195
|
+
"dist/execution-sponsored-settlement.d.ts",
|
|
196
|
+
"dist/execution-sponsored-store.js",
|
|
197
|
+
"dist/execution-sponsored-store.d.ts",
|
|
198
|
+
"dist/execution-sponsored-transport.js",
|
|
199
|
+
"dist/execution-sponsored-transport.d.ts",
|
|
200
|
+
"dist/execution-journal-tables.js",
|
|
201
|
+
"dist/execution-journal-tables.d.ts",
|
|
202
|
+
"dist/execution-sponsored-mcp-definition.js",
|
|
203
|
+
"dist/execution-sponsored-mcp-definition.d.ts",
|
|
204
|
+
"dist/execution-sponsored-registration.js",
|
|
205
|
+
"dist/execution-sponsored-registration.d.ts",
|
|
206
|
+
"dist/execution-sponsored-hosted.js",
|
|
207
|
+
"dist/execution-sponsored-hosted.d.ts",
|
|
208
|
+
"dist/native-yield-userop.js",
|
|
209
|
+
"dist/native-yield-userop.d.ts",
|
|
210
|
+
"dist/native-yield-userop-account.js",
|
|
211
|
+
"dist/native-yield-userop-account.d.ts",
|
|
212
|
+
"dist/native-yield-userop-authority.js",
|
|
213
|
+
"dist/native-yield-userop-authority.d.ts",
|
|
214
|
+
"dist/native-yield-userop-definition.js",
|
|
215
|
+
"dist/native-yield-userop-definition.d.ts",
|
|
216
|
+
"dist/native-yield-userop-hosted.js",
|
|
217
|
+
"dist/native-yield-userop-hosted.d.ts",
|
|
218
|
+
"dist/native-yield-userop-index.js",
|
|
219
|
+
"dist/native-yield-userop-index.d.ts",
|
|
220
|
+
"dist/native-yield-userop-mcp-definition.js",
|
|
221
|
+
"dist/native-yield-userop-mcp-definition.d.ts",
|
|
222
|
+
"dist/native-yield-userop-operation.js",
|
|
223
|
+
"dist/native-yield-userop-operation.d.ts",
|
|
224
|
+
"dist/native-yield-userop-registration.js",
|
|
225
|
+
"dist/native-yield-userop-registration.d.ts",
|
|
226
|
+
"dist/native-yield-userop-settlement.js",
|
|
227
|
+
"dist/native-yield-userop-settlement.d.ts",
|
|
228
|
+
"dist/native-yield-userop-simulation.js",
|
|
229
|
+
"dist/native-yield-userop-simulation.d.ts",
|
|
230
|
+
"dist/account-userop-policy-definition.js",
|
|
231
|
+
"dist/account-userop-policy-definition.d.ts",
|
|
232
|
+
"dist/account-userop-policy-relation.js",
|
|
233
|
+
"dist/account-userop-policy-relation.d.ts",
|
|
234
|
+
"dist/execution-sponsored-account-profile.js",
|
|
235
|
+
"dist/execution-sponsored-account-profile.d.ts",
|
|
236
|
+
"dist/native-yield-userop-policy.js",
|
|
237
|
+
"dist/native-yield-userop-policy.d.ts",
|
|
238
|
+
"dist/lp-userop.js",
|
|
239
|
+
"dist/lp-userop.d.ts",
|
|
240
|
+
"dist/lp-userop-account.js",
|
|
241
|
+
"dist/lp-userop-account.d.ts",
|
|
242
|
+
"dist/lp-userop-authority.js",
|
|
243
|
+
"dist/lp-userop-authority.d.ts",
|
|
244
|
+
"dist/lp-userop-definition.js",
|
|
245
|
+
"dist/lp-userop-definition.d.ts",
|
|
246
|
+
"dist/lp-userop-hosted.js",
|
|
247
|
+
"dist/lp-userop-hosted.d.ts",
|
|
248
|
+
"dist/lp-userop-index.js",
|
|
249
|
+
"dist/lp-userop-index.d.ts",
|
|
250
|
+
"dist/lp-userop-mcp-definition.js",
|
|
251
|
+
"dist/lp-userop-mcp-definition.d.ts",
|
|
252
|
+
"dist/lp-userop-operation.js",
|
|
253
|
+
"dist/lp-userop-operation.d.ts",
|
|
254
|
+
"dist/lp-userop-registration.js",
|
|
255
|
+
"dist/lp-userop-registration.d.ts",
|
|
256
|
+
"dist/lp-userop-settlement.js",
|
|
257
|
+
"dist/lp-userop-settlement.d.ts",
|
|
258
|
+
"dist/vendor/lp-v3/lp-v3-atomic-contract.js",
|
|
259
|
+
"dist/vendor/lp-v3/lp-v3-atomic-contract.d.ts",
|
|
260
|
+
"dist/vendor/lp-v3/lp-v3-atomic-evidence.js",
|
|
261
|
+
"dist/vendor/lp-v3/lp-v3-atomic-evidence.d.ts",
|
|
262
|
+
"dist/vendor/lp-v3/lp-v3-atomic-index.js",
|
|
263
|
+
"dist/vendor/lp-v3/lp-v3-atomic-index.d.ts",
|
|
264
|
+
"dist/vendor/lp-v3/lp-v3-atomic-plan.js",
|
|
265
|
+
"dist/vendor/lp-v3/lp-v3-atomic-plan.d.ts",
|
|
266
|
+
"dist/vendor/lp-v3/lp-v3-atomic-read-contract.js",
|
|
267
|
+
"dist/vendor/lp-v3/lp-v3-atomic-read-contract.d.ts",
|
|
268
|
+
"dist/vendor/lp-v3/lp-v3-atomic-read-index.js",
|
|
269
|
+
"dist/vendor/lp-v3/lp-v3-atomic-read-index.d.ts",
|
|
270
|
+
"dist/vendor/lp-v3/lp-v3-atomic-read-rpc.js",
|
|
271
|
+
"dist/vendor/lp-v3/lp-v3-atomic-read-rpc.d.ts",
|
|
272
|
+
"dist/vendor/lp-v3/lp-v3-atomic-read.js",
|
|
273
|
+
"dist/vendor/lp-v3/lp-v3-atomic-read.d.ts",
|
|
274
|
+
"dist/vendor/lp-v3/lp-v3-atomic-settlement.js",
|
|
275
|
+
"dist/vendor/lp-v3/lp-v3-atomic-settlement.d.ts",
|
|
276
|
+
"dist/vendor/lp-v3/lp-v3-collect-protocol-contract.js",
|
|
277
|
+
"dist/vendor/lp-v3/lp-v3-collect-protocol-contract.d.ts",
|
|
278
|
+
"dist/vendor/lp-v3/lp-v3-collect-protocol-index.js",
|
|
279
|
+
"dist/vendor/lp-v3/lp-v3-collect-protocol-index.d.ts",
|
|
280
|
+
"dist/vendor/lp-v3/lp-v3-collect-protocol-observation.js",
|
|
281
|
+
"dist/vendor/lp-v3/lp-v3-collect-protocol-observation.d.ts",
|
|
282
|
+
"dist/vendor/lp-v3/lp-v3-collect-protocol-plan.js",
|
|
283
|
+
"dist/vendor/lp-v3/lp-v3-collect-protocol-plan.d.ts",
|
|
284
|
+
"dist/vendor/lp-v3/lp-v3-collect-protocol-reconcile.js",
|
|
285
|
+
"dist/vendor/lp-v3/lp-v3-collect-protocol-reconcile.d.ts",
|
|
286
|
+
"dist/vendor/lp-v3/lp-v3-contract.js",
|
|
287
|
+
"dist/vendor/lp-v3/lp-v3-contract.d.ts",
|
|
288
|
+
"dist/vendor/lp-v3/lp-v3-evidence.js",
|
|
289
|
+
"dist/vendor/lp-v3/lp-v3-evidence.d.ts",
|
|
290
|
+
"dist/vendor/lp-v3/lp-v3-plan.js",
|
|
291
|
+
"dist/vendor/lp-v3/lp-v3-plan.d.ts",
|
|
292
|
+
"dist/vendor/lp-v3/types.js",
|
|
293
|
+
"dist/vendor/lp-v3/types.d.ts",
|
|
294
|
+
"dist/vendor/lp-v3/v4-math.js",
|
|
295
|
+
"dist/vendor/lp-v3/v4-math.d.ts",
|
|
296
|
+
"dist/execution-account-gas-quote.js",
|
|
297
|
+
"dist/execution-account-gas-quote.d.ts",
|
|
298
|
+
"dist/execution-account-gas-review.js",
|
|
299
|
+
"dist/execution-account-gas-review.d.ts",
|
|
300
|
+
"dist/execution-account-gas-runtime.js",
|
|
301
|
+
"dist/execution-account-gas-runtime.d.ts",
|
|
302
|
+
"dist/execution-account-gas-view.js",
|
|
303
|
+
"dist/execution-account-gas-view.d.ts",
|
|
304
|
+
"dist/execution-sponsored-gas-policy.js",
|
|
305
|
+
"dist/execution-sponsored-gas-policy.d.ts"
|
|
102
306
|
],
|
|
103
307
|
"scripts": {
|
|
104
308
|
"build": "tsc -p tsconfig.build.json",
|
|
@@ -111,9 +315,17 @@
|
|
|
111
315
|
"test": "node --import tsx --test \"test/**/*.test.ts\"",
|
|
112
316
|
"test:liveness": "node --import tsx --test --test-name-pattern=liveness test/execution-tools.test.ts test/execution-bridge.test.ts test/execution-polymarket.test.ts test/execution-hyperliquid.test.ts",
|
|
113
317
|
"test:mutation": "node --import tsx test/lifi-fee-mutation-proof.ts && node --import tsx test/lifi-bridge-mutation-proof.ts && node --import tsx test/polymarket-order-mutation-proof.ts && node --import tsx test/hyperliquid-order-mutation-proof.ts",
|
|
114
|
-
"
|
|
318
|
+
"delegation:journal": "tsx scripts/delegation-operation-journal.ts",
|
|
319
|
+
"verify": "npm run lp:check && npm run typecheck && npm run build && npm test",
|
|
115
320
|
"prepublishOnly": "npm run verify && npm run pack:audit",
|
|
116
|
-
"pack:audit": "node scripts/pack-audit.mjs"
|
|
321
|
+
"pack:audit": "node scripts/pack-audit.mjs",
|
|
322
|
+
"test:native-local": "node --import tsx scripts/test-native-yield-local.ts",
|
|
323
|
+
"test:native-account-local": "node --import tsx scripts/test-native-yield-account-local.ts",
|
|
324
|
+
"native:journal": "tsx scripts/native-yield-account-journal.ts",
|
|
325
|
+
"sponsored:journal": "tsx scripts/sponsored-account-journal.ts",
|
|
326
|
+
"native-userop:journal": "tsx scripts/native-yield-userop-journal.ts",
|
|
327
|
+
"lp-userop:journal": "tsx scripts/lp-userop-journal.ts",
|
|
328
|
+
"lp:check": "node scripts/check-lp-v3-library.mjs --check"
|
|
117
329
|
},
|
|
118
330
|
"engines": {
|
|
119
331
|
"node": ">=22",
|
|
@@ -122,7 +334,7 @@
|
|
|
122
334
|
"devEngines": {
|
|
123
335
|
"runtime": {
|
|
124
336
|
"name": "node",
|
|
125
|
-
"version": "22.
|
|
337
|
+
"version": "22.23.2",
|
|
126
338
|
"onFail": "warn"
|
|
127
339
|
}
|
|
128
340
|
},
|
|
@@ -190,10 +402,30 @@
|
|
|
190
402
|
"./adapter-cdp": {
|
|
191
403
|
"types": "./dist/adapter-cdp-index.d.ts",
|
|
192
404
|
"import": "./dist/adapter-cdp-index.js"
|
|
405
|
+
},
|
|
406
|
+
"./yield": {
|
|
407
|
+
"import": "./dist/hybrid-yield-index.js",
|
|
408
|
+
"types": "./dist/hybrid-yield-index.d.ts"
|
|
409
|
+
},
|
|
410
|
+
"./yield-account": {
|
|
411
|
+
"types": "./dist/native-yield-account-index.d.ts",
|
|
412
|
+
"import": "./dist/native-yield-account-index.js"
|
|
413
|
+
},
|
|
414
|
+
"./sponsored-account": {
|
|
415
|
+
"types": "./dist/execution-sponsored-index.d.ts",
|
|
416
|
+
"import": "./dist/execution-sponsored-index.js"
|
|
417
|
+
},
|
|
418
|
+
"./yield-userop-account": {
|
|
419
|
+
"types": "./dist/native-yield-userop-index.d.ts",
|
|
420
|
+
"import": "./dist/native-yield-userop-index.js"
|
|
421
|
+
},
|
|
422
|
+
"./lp-userop-account": {
|
|
423
|
+
"types": "./dist/lp-userop-index.d.ts",
|
|
424
|
+
"import": "./dist/lp-userop-index.js"
|
|
193
425
|
}
|
|
194
426
|
},
|
|
195
427
|
"optionalDependencies": {
|
|
196
428
|
"@coinbase/cdp-sdk": "1.54.0"
|
|
197
429
|
},
|
|
198
|
-
"publishGate": "0.1.0
|
|
430
|
+
"publishGate": "0.1.4 is a staged release candidate: reviewed Optimism swap construction/verification, hybrid/native yield library entries, fenced sponsored-account entry and shared journal schema v4. Publication requires explicit Founder authority; the recommended initial npm tag is next. otto-execute 0.1.4 deliberately retains the aged registry otto-intel-mcp 0.1.3 seam and refuses Optimism. A later consumer repin may use this version only after seven full days from its registry publication, followed by rebuild, SRI/vendor checks and verification. Publishing this package does not deploy or activate a service. The frozen 0.1.4 publication archives retain that reviewed schema-v4 candidate and do not contain the native and guarded LP UserOperation follow-ups now in source. These follow-ups add the fenced native and guarded LP UserOperation entries and explicit schema-v5/v6 operator rollouts; native version-2 records require explicit migration to schema 5 and separate native readiness, while LP version-3 records require explicit migration to schema 6 and separate LP readiness. Current-source startup preserves coherent existing schema 2, 3, 4, 5 and 6 journals without DDL, marker changes or claim repair; a truly empty database initializes schema 4 with all rails unready. Only an explicit existing-journal migration requires the separately approved old-worker drain and exact prior version/coverage. `prepublishOnly` = verify + scripts/pack-audit.mjs (packs the tarball and fails on any personal or secret content; never publish with --ignore-scripts). No source maps ship. Dependency note: @x402/axios + @x402/evm pinned 2.23.0 so the optional @coinbase/cdp-sdk peers resolve to one @x402/core without the root-only `overrides` (kept in lockstep for the Railway install). @x402/core >= 2.23.0 enables client spendControls by default ($1 per payment) \u2014 raise it before any tool price exceeds $1."
|
|
199
431
|
}
|