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,124 @@
|
|
|
1
|
+
import { decodeEventLog, parseAbi } from 'viem';
|
|
2
|
+
import { canonicalJson, commitment, deepFreeze, LP_V3_BASE as B } from './lp-v3-contract.js';
|
|
3
|
+
import { LP_V3_COLLECT_GUARD_ABI } from './lp-v3-atomic-contract.js';
|
|
4
|
+
import { LP_V3_COLLECT_PROTOCOL_NO_AUTHORITY as NO_AUTHORITY, lpV3CollectProtocolReconcileInputSchema, } from './lp-v3-collect-protocol-contract.js';
|
|
5
|
+
import { protocolClock, requireProtocol as need, validateLpV3CollectProtocol } from './lp-v3-collect-protocol-plan.js';
|
|
6
|
+
const ZERO = '0x0000000000000000000000000000000000000000';
|
|
7
|
+
const NPM = parseAbi([
|
|
8
|
+
'event Approval(address indexed owner,address indexed approved,uint256 indexed tokenId)',
|
|
9
|
+
'event Transfer(address indexed from,address indexed to,uint256 indexed tokenId)',
|
|
10
|
+
'event Collect(uint256 indexed tokenId,address recipient,uint256 amount0,uint256 amount1)',
|
|
11
|
+
]);
|
|
12
|
+
const TOKEN = parseAbi([
|
|
13
|
+
'event Approval(address indexed owner,address indexed spender,uint256 value)',
|
|
14
|
+
'event Transfer(address indexed from,address indexed to,uint256 value)',
|
|
15
|
+
]);
|
|
16
|
+
const same = (a, b) => canonicalJson(a) === canonicalJson(b);
|
|
17
|
+
const decodeNpm = (l) => decodeEventLog({ abi: NPM, topics: l.topics, data: l.data, strict: true });
|
|
18
|
+
const decodeToken = (l) => decodeEventLog({ abi: TOKEN, topics: l.topics, data: l.data, strict: true });
|
|
19
|
+
/** Protocol accounting only. Raw inputs, including UserOp status and the window,
|
|
20
|
+
* cannot prove transport, finality, account authority or release a durable claim.
|
|
21
|
+
* The host authenticates the entire receipt and derives the COMPLETE operation
|
|
22
|
+
* slice before calling this helper; both supplied boundary indices are exclusive.
|
|
23
|
+
*/
|
|
24
|
+
export function reconcileLpV3CollectProtocol(input, policy, options = {}) {
|
|
25
|
+
try {
|
|
26
|
+
const { plan, independentIntent: intent, baseline: before, check, evidence } = lpV3CollectProtocolReconcileInputSchema.parse(input);
|
|
27
|
+
const now = protocolClock(options), { binding: b, post, logs } = evidence;
|
|
28
|
+
need(same(check, validateLpV3CollectProtocol(plan, intent, before, policy, { now: () => check.checkedAt })), 'LP_PROTOCOL_CHECK_MISMATCH');
|
|
29
|
+
need(evidence.planCommitment === plan.planCommitment && b.account === intent.account, 'LP_PROTOCOL_OPERATION_BINDING');
|
|
30
|
+
// Chain causality uses the canonical baseline, not the host check wall clock:
|
|
31
|
+
// a valid next block can retain sequencer timestamp lag within the read budget.
|
|
32
|
+
need(post.observedAt <= now && now - post.observedAt <= 30 && post.blockTimestamp <= post.observedAt
|
|
33
|
+
&& b.blockTimestamp > before.blockTimestamp && b.blockTimestamp <= now
|
|
34
|
+
&& BigInt(b.blockNumber) > BigInt(before.blockNumber), 'LP_PROTOCOL_SETTLEMENT_TIME');
|
|
35
|
+
// A reverted expired call is reconcilable; only successful collection must
|
|
36
|
+
// satisfy the original in-contract deadline.
|
|
37
|
+
need(evidence.status === 'reverted' || b.blockTimestamp <= intent.deadline, 'LP_PROTOCOL_LATE_COLLECTION');
|
|
38
|
+
need(post.blockNumber === b.blockNumber && post.blockHash === b.blockHash && post.blockTimestamp === b.blockTimestamp, 'LP_PROTOCOL_POST_BLOCK');
|
|
39
|
+
need(b.windowStartLogIndex < b.userOpEventLogIndex && logs.length === b.userOpEventLogIndex - b.windowStartLogIndex - 1, 'LP_PROTOCOL_INCOMPLETE_OPERATION_WINDOW');
|
|
40
|
+
for (const [i, l] of logs.entries())
|
|
41
|
+
need(l.logIndex === b.windowStartLogIndex + i + 1
|
|
42
|
+
&& l.transactionHash === b.transactionHash && l.transactionIndex === b.transactionIndex
|
|
43
|
+
&& l.blockNumber === b.blockNumber && l.blockHash === b.blockHash, 'LP_PROTOCOL_LOG_BINDING_OR_ORDER');
|
|
44
|
+
const p = post.position;
|
|
45
|
+
need(post.account === intent.account && post.accountCode === before.accountCode && post.accountCodeHash === before.accountCodeHash
|
|
46
|
+
&& post.pool === intent.pool && post.factoryPool === intent.pool && post.fee === intent.fee && post.tickSpacing === before.tickSpacing
|
|
47
|
+
&& p.tokenId === intent.tokenId && p.owner === intent.account && p.approved === ZERO
|
|
48
|
+
&& p.token0 === intent.token0 && p.token1 === intent.token1 && p.fee === intent.fee
|
|
49
|
+
&& p.tickLower === intent.tickLower && p.tickUpper === intent.tickUpper && p.liquidity === before.position.liquidity
|
|
50
|
+
&& post.allowances.every(v => v === '0'), 'LP_PROTOCOL_POST_IDENTITY_OR_APPROVAL');
|
|
51
|
+
need(same(post.guard, before.guard), 'LP_PROTOCOL_GUARD_POST_STATE');
|
|
52
|
+
const npmLogs = logs.filter(l => l.address === B.manager), guards = logs.filter(l => l.address === plan.guardDeployment.address);
|
|
53
|
+
const received = [0n, 0n];
|
|
54
|
+
if (evidence.status === 'reverted') {
|
|
55
|
+
need(npmLogs.length === 0 && guards.length === 0 && same(p, before.position), 'LP_PROTOCOL_REVERT_ROLLBACK_UNPROVEN');
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
const npm = npmLogs.map(decodeNpm);
|
|
59
|
+
need(same(npm.map(e => e.eventName), ['Approval', 'Collect', 'Approval', 'Transfer']) && guards.length === 1, 'LP_PROTOCOL_COLLECTION_EVENT_SEQUENCE');
|
|
60
|
+
for (const [i, e] of npm.entries()) {
|
|
61
|
+
need(e.args.tokenId.toString() === intent.tokenId, 'LP_PROTOCOL_EVENT_NFT');
|
|
62
|
+
if (e.eventName === 'Approval')
|
|
63
|
+
need(e.args.owner.toLowerCase() === intent.account
|
|
64
|
+
&& e.args.approved.toLowerCase() === (i === 0 ? plan.guardDeployment.address : ZERO), 'LP_PROTOCOL_APPROVAL_SEQUENCE');
|
|
65
|
+
if (e.eventName === 'Transfer')
|
|
66
|
+
need(e.args.from.toLowerCase() === intent.account && e.args.to.toLowerCase() === intent.account, 'LP_PROTOCOL_OWNER_SELF_TRANSFER');
|
|
67
|
+
}
|
|
68
|
+
const collect = npm[1], guardLog = guards[0];
|
|
69
|
+
need(collect.eventName === 'Collect' && collect.args.recipient.toLowerCase() === intent.account
|
|
70
|
+
&& guardLog.logIndex > npmLogs[3].logIndex, 'LP_PROTOCOL_COLLECTION_RECIPIENT');
|
|
71
|
+
const g = decodeEventLog({ abi: LP_V3_COLLECT_GUARD_ABI, topics: guardLog.topics, data: guardLog.data, strict: true });
|
|
72
|
+
need(g.eventName === 'Collected' && g.args.owner.toLowerCase() === intent.account && g.args.pool.toLowerCase() === intent.pool
|
|
73
|
+
&& g.args.tokenId.toString() === intent.tokenId, 'LP_PROTOCOL_GUARD_EVENT_BINDING');
|
|
74
|
+
received[0] = g.args.amount0;
|
|
75
|
+
received[1] = g.args.amount1;
|
|
76
|
+
const owed = [collect.args.amount0, collect.args.amount1];
|
|
77
|
+
for (const i of [0, 1]) {
|
|
78
|
+
need(received[i] >= BigInt(intent.amountMin[i]) && received[i] <= BigInt(intent.amountMax[i])
|
|
79
|
+
&& owed[i] >= received[i] && owed[i] <= BigInt(intent.amountMax[i]), 'LP_PROTOCOL_COLLECTION_AMOUNTS');
|
|
80
|
+
const remaining = BigInt(before.position.tokensOwed[i]) - owed[i];
|
|
81
|
+
need(before.position.liquidity === '0' ? remaining >= 0n && BigInt(p.tokensOwed[i]) === remaining
|
|
82
|
+
: BigInt(p.tokensOwed[i]) >= (remaining > 0n ? remaining : 0n), 'LP_PROTOCOL_OWED_BALANCE');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const transfers = [0n, 0n];
|
|
86
|
+
for (const l of logs) {
|
|
87
|
+
const i = l.address === B.token0 ? 0 : l.address === B.token1 ? 1 : null;
|
|
88
|
+
if (i === null)
|
|
89
|
+
continue;
|
|
90
|
+
const e = decodeToken(l);
|
|
91
|
+
// Unrelated token movements can occur in this whole operation window.
|
|
92
|
+
// Any owner/guard approval or extra owner/guard flow is ambiguous and held.
|
|
93
|
+
if (e.eventName === 'Approval') {
|
|
94
|
+
need(![intent.account, plan.guardDeployment.address].includes(e.args.owner.toLowerCase()), 'LP_PROTOCOL_EXTRA_TOKEN_APPROVAL');
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const from = e.args.from.toLowerCase(), to = e.args.to.toLowerCase();
|
|
98
|
+
need(from !== plan.guardDeployment.address && to !== plan.guardDeployment.address, 'LP_PROTOCOL_GUARD_TOKEN_FLOW');
|
|
99
|
+
if (from !== intent.account && to !== intent.account)
|
|
100
|
+
continue;
|
|
101
|
+
need(evidence.status === 'success' && from === intent.pool && to === intent.account
|
|
102
|
+
&& l.logIndex > npmLogs[0].logIndex && l.logIndex < npmLogs[1].logIndex, 'LP_PROTOCOL_EXTRA_OWNER_TOKEN_FLOW');
|
|
103
|
+
transfers[i] += e.args.value;
|
|
104
|
+
}
|
|
105
|
+
need(same(transfers.map(String), received.map(String)), 'LP_PROTOCOL_TOKEN_RECEIPTS_MISMATCH');
|
|
106
|
+
// Block-end owner balances may include another UserOp, incoming transfers or
|
|
107
|
+
// token gas charges. They are observations, not an LP proceeds delta proof.
|
|
108
|
+
const body = { ...NO_AUTHORITY, status: 'PROTOCOL_ACCOUNTED',
|
|
109
|
+
outcome: evidence.status === 'success' ? 'collected' : 'reverted',
|
|
110
|
+
planCommitment: plan.planCommitment, baselineCommitment: check.baselineCommitment,
|
|
111
|
+
effectsCommitment: commitment({ binding: b, status: evidence.status, logs }), postObservationCommitment: commitment(post),
|
|
112
|
+
userOpHash: b.userOpHash, transactionHash: b.transactionHash, blockHash: b.blockHash, blockNumber: b.blockNumber,
|
|
113
|
+
owner: intent.account, tokenId: intent.tokenId, collectedRaw: received.map(String), liquidityDelta: '0',
|
|
114
|
+
nftTokenApprovalCleared: true, erc20AllowancesCleared: true,
|
|
115
|
+
accountingBasis: 'guard-call-and-operation-logs', ownerBalancesAtBlock: post.balances,
|
|
116
|
+
profitClassification: 'UNKNOWN', distributableProfitRaw: null };
|
|
117
|
+
return deepFreeze({ ...body, accountingCommitment: commitment(body) });
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
const reason = error instanceof Error && /^LP_PROTOCOL_[A-Z_]+$/.test(error.message) ? error.message : 'LP_PROTOCOL_MALFORMED_OR_UNSUPPORTED_EVIDENCE';
|
|
121
|
+
return deepFreeze({ ...NO_AUTHORITY, status: 'HELD', settlement: 'UNKNOWN', reason });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=lp-v3-collect-protocol-reconcile.js.map
|
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const LP_V3_BASE: Readonly<{
|
|
3
|
+
readonly chainId: 8453;
|
|
4
|
+
readonly factory: "0x33128a8fc17869897dce68ed026d694621f6fdfd";
|
|
5
|
+
readonly manager: "0x03a520b32c04bf3beef7beb72e919cf822ed34f1";
|
|
6
|
+
readonly token0: "0x4200000000000000000000000000000000000006";
|
|
7
|
+
readonly token1: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913";
|
|
8
|
+
readonly factoryCodeHash: `0x${string}`;
|
|
9
|
+
readonly managerCodeHash: `0x${string}`;
|
|
10
|
+
readonly token0CodeHash: `0x${string}`;
|
|
11
|
+
readonly token1CodeHash: `0x${string}`;
|
|
12
|
+
readonly usdcImplementationSlot: `0x${string}`;
|
|
13
|
+
readonly usdcImplementation: "0x2ce6311ddae708829bc0784c967b7d77d19fd779";
|
|
14
|
+
readonly usdcImplementationCodeHash: `0x${string}`;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const lpAddress: z.ZodString;
|
|
17
|
+
export declare const lpHash: z.ZodString;
|
|
18
|
+
export declare const lpUint: (bits?: number) => z.ZodString;
|
|
19
|
+
export declare const lpV3IntentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
20
|
+
action: z.ZodLiteral<"mint">;
|
|
21
|
+
amountDesired: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
22
|
+
amountMin: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
23
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
24
|
+
protocol: z.ZodLiteral<"uniswap-v3">;
|
|
25
|
+
chainId: z.ZodLiteral<8453>;
|
|
26
|
+
operationId: z.ZodString;
|
|
27
|
+
account: z.ZodString;
|
|
28
|
+
recipient: z.ZodString;
|
|
29
|
+
manager: z.ZodLiteral<"0x03a520b32c04bf3beef7beb72e919cf822ed34f1">;
|
|
30
|
+
factory: z.ZodLiteral<"0x33128a8fc17869897dce68ed026d694621f6fdfd">;
|
|
31
|
+
pool: z.ZodString;
|
|
32
|
+
token0: z.ZodLiteral<"0x4200000000000000000000000000000000000006">;
|
|
33
|
+
token1: z.ZodLiteral<"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913">;
|
|
34
|
+
fee: z.ZodUnion<readonly [z.ZodLiteral<100>, z.ZodLiteral<500>, z.ZodLiteral<3000>, z.ZodLiteral<10000>]>;
|
|
35
|
+
tickLower: z.ZodNumber;
|
|
36
|
+
tickUpper: z.ZodNumber;
|
|
37
|
+
deadline: z.ZodNumber;
|
|
38
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
39
|
+
action: z.ZodLiteral<"increase">;
|
|
40
|
+
tokenId: z.ZodString;
|
|
41
|
+
amountDesired: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
42
|
+
amountMin: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
43
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
44
|
+
protocol: z.ZodLiteral<"uniswap-v3">;
|
|
45
|
+
chainId: z.ZodLiteral<8453>;
|
|
46
|
+
operationId: z.ZodString;
|
|
47
|
+
account: z.ZodString;
|
|
48
|
+
recipient: z.ZodString;
|
|
49
|
+
manager: z.ZodLiteral<"0x03a520b32c04bf3beef7beb72e919cf822ed34f1">;
|
|
50
|
+
factory: z.ZodLiteral<"0x33128a8fc17869897dce68ed026d694621f6fdfd">;
|
|
51
|
+
pool: z.ZodString;
|
|
52
|
+
token0: z.ZodLiteral<"0x4200000000000000000000000000000000000006">;
|
|
53
|
+
token1: z.ZodLiteral<"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913">;
|
|
54
|
+
fee: z.ZodUnion<readonly [z.ZodLiteral<100>, z.ZodLiteral<500>, z.ZodLiteral<3000>, z.ZodLiteral<10000>]>;
|
|
55
|
+
tickLower: z.ZodNumber;
|
|
56
|
+
tickUpper: z.ZodNumber;
|
|
57
|
+
deadline: z.ZodNumber;
|
|
58
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
59
|
+
action: z.ZodLiteral<"decrease">;
|
|
60
|
+
tokenId: z.ZodString;
|
|
61
|
+
liquidity: z.ZodString;
|
|
62
|
+
amountMin: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
63
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
64
|
+
protocol: z.ZodLiteral<"uniswap-v3">;
|
|
65
|
+
chainId: z.ZodLiteral<8453>;
|
|
66
|
+
operationId: z.ZodString;
|
|
67
|
+
account: z.ZodString;
|
|
68
|
+
recipient: z.ZodString;
|
|
69
|
+
manager: z.ZodLiteral<"0x03a520b32c04bf3beef7beb72e919cf822ed34f1">;
|
|
70
|
+
factory: z.ZodLiteral<"0x33128a8fc17869897dce68ed026d694621f6fdfd">;
|
|
71
|
+
pool: z.ZodString;
|
|
72
|
+
token0: z.ZodLiteral<"0x4200000000000000000000000000000000000006">;
|
|
73
|
+
token1: z.ZodLiteral<"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913">;
|
|
74
|
+
fee: z.ZodUnion<readonly [z.ZodLiteral<100>, z.ZodLiteral<500>, z.ZodLiteral<3000>, z.ZodLiteral<10000>]>;
|
|
75
|
+
tickLower: z.ZodNumber;
|
|
76
|
+
tickUpper: z.ZodNumber;
|
|
77
|
+
deadline: z.ZodNumber;
|
|
78
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
79
|
+
action: z.ZodLiteral<"collect">;
|
|
80
|
+
tokenId: z.ZodString;
|
|
81
|
+
amountMax: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
82
|
+
amountMin: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
83
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
84
|
+
protocol: z.ZodLiteral<"uniswap-v3">;
|
|
85
|
+
chainId: z.ZodLiteral<8453>;
|
|
86
|
+
operationId: z.ZodString;
|
|
87
|
+
account: z.ZodString;
|
|
88
|
+
recipient: z.ZodString;
|
|
89
|
+
manager: z.ZodLiteral<"0x03a520b32c04bf3beef7beb72e919cf822ed34f1">;
|
|
90
|
+
factory: z.ZodLiteral<"0x33128a8fc17869897dce68ed026d694621f6fdfd">;
|
|
91
|
+
pool: z.ZodString;
|
|
92
|
+
token0: z.ZodLiteral<"0x4200000000000000000000000000000000000006">;
|
|
93
|
+
token1: z.ZodLiteral<"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913">;
|
|
94
|
+
fee: z.ZodUnion<readonly [z.ZodLiteral<100>, z.ZodLiteral<500>, z.ZodLiteral<3000>, z.ZodLiteral<10000>]>;
|
|
95
|
+
tickLower: z.ZodNumber;
|
|
96
|
+
tickUpper: z.ZodNumber;
|
|
97
|
+
deadline: z.ZodNumber;
|
|
98
|
+
}, z.core.$strict>], "action">;
|
|
99
|
+
export type LpV3Intent = z.infer<typeof lpV3IntentSchema>;
|
|
100
|
+
export declare const lpV3PositionSchema: z.ZodObject<{
|
|
101
|
+
tokenId: z.ZodString;
|
|
102
|
+
owner: z.ZodString;
|
|
103
|
+
token0: z.ZodString;
|
|
104
|
+
token1: z.ZodString;
|
|
105
|
+
fee: z.ZodNumber;
|
|
106
|
+
tickLower: z.ZodNumber;
|
|
107
|
+
tickUpper: z.ZodNumber;
|
|
108
|
+
liquidity: z.ZodString;
|
|
109
|
+
tokensOwed: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
110
|
+
}, z.core.$strict>;
|
|
111
|
+
export type LpV3Position = z.infer<typeof lpV3PositionSchema>;
|
|
112
|
+
export declare const lpV3ChainEvidenceSchema: z.ZodObject<{
|
|
113
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
114
|
+
chainId: z.ZodLiteral<8453>;
|
|
115
|
+
blockNumber: z.ZodString;
|
|
116
|
+
blockHash: z.ZodString;
|
|
117
|
+
blockTimestamp: z.ZodNumber;
|
|
118
|
+
observedAt: z.ZodNumber;
|
|
119
|
+
canonical: z.ZodLiteral<true>;
|
|
120
|
+
account: z.ZodString;
|
|
121
|
+
accountCode: z.ZodLiteral<"0x">;
|
|
122
|
+
balances: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
123
|
+
allowances: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
124
|
+
manager: z.ZodLiteral<"0x03a520b32c04bf3beef7beb72e919cf822ed34f1">;
|
|
125
|
+
managerFactory: z.ZodLiteral<"0x33128a8fc17869897dce68ed026d694621f6fdfd">;
|
|
126
|
+
factory: z.ZodLiteral<"0x33128a8fc17869897dce68ed026d694621f6fdfd">;
|
|
127
|
+
factoryPool: z.ZodString;
|
|
128
|
+
factoryCodeHash: z.ZodLiteral<`0x${string}`>;
|
|
129
|
+
managerCodeHash: z.ZodLiteral<`0x${string}`>;
|
|
130
|
+
token0CodeHash: z.ZodLiteral<`0x${string}`>;
|
|
131
|
+
token1CodeHash: z.ZodLiteral<`0x${string}`>;
|
|
132
|
+
usdcImplementation: z.ZodLiteral<"0x2ce6311ddae708829bc0784c967b7d77d19fd779">;
|
|
133
|
+
usdcImplementationCodeHash: z.ZodLiteral<`0x${string}`>;
|
|
134
|
+
usdcPaused: z.ZodLiteral<false>;
|
|
135
|
+
accountBlacklisted: z.ZodLiteral<false>;
|
|
136
|
+
managerBlacklisted: z.ZodLiteral<false>;
|
|
137
|
+
pool: z.ZodString;
|
|
138
|
+
poolFactory: z.ZodLiteral<"0x33128a8fc17869897dce68ed026d694621f6fdfd">;
|
|
139
|
+
token0: z.ZodLiteral<"0x4200000000000000000000000000000000000006">;
|
|
140
|
+
token1: z.ZodLiteral<"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913">;
|
|
141
|
+
fee: z.ZodNumber;
|
|
142
|
+
tickSpacing: z.ZodNumber;
|
|
143
|
+
tick: z.ZodNumber;
|
|
144
|
+
sqrtPriceX96: z.ZodString;
|
|
145
|
+
unlocked: z.ZodLiteral<true>;
|
|
146
|
+
position: z.ZodNullable<z.ZodObject<{
|
|
147
|
+
tokenId: z.ZodString;
|
|
148
|
+
owner: z.ZodString;
|
|
149
|
+
token0: z.ZodString;
|
|
150
|
+
token1: z.ZodString;
|
|
151
|
+
fee: z.ZodNumber;
|
|
152
|
+
tickLower: z.ZodNumber;
|
|
153
|
+
tickUpper: z.ZodNumber;
|
|
154
|
+
liquidity: z.ZodString;
|
|
155
|
+
tokensOwed: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
156
|
+
}, z.core.$strict>>;
|
|
157
|
+
}, z.core.$strict>;
|
|
158
|
+
export type LpV3ChainEvidence = z.infer<typeof lpV3ChainEvidenceSchema>;
|
|
159
|
+
export declare const lpV3CallSchema: z.ZodObject<{
|
|
160
|
+
step: z.ZodEnum<{
|
|
161
|
+
approve: "approve";
|
|
162
|
+
mutation: "mutation";
|
|
163
|
+
cleanup: "cleanup";
|
|
164
|
+
}>;
|
|
165
|
+
tokenIndex: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
|
|
166
|
+
chainId: z.ZodLiteral<8453>;
|
|
167
|
+
from: z.ZodString;
|
|
168
|
+
to: z.ZodString;
|
|
169
|
+
value: z.ZodLiteral<"0">;
|
|
170
|
+
data: z.ZodString;
|
|
171
|
+
}, z.core.$strict>;
|
|
172
|
+
export type LpV3Call = z.infer<typeof lpV3CallSchema>;
|
|
173
|
+
export declare const lpV3SigningSupportSchema: z.ZodEnum<{
|
|
174
|
+
HOST_GATES_REQUIRED: "HOST_GATES_REQUIRED";
|
|
175
|
+
BLOCKED_ATOMIC_NFT_OWNER_GUARD: "BLOCKED_ATOMIC_NFT_OWNER_GUARD";
|
|
176
|
+
BLOCKED_ATOMIC_COLLECTION_GUARD: "BLOCKED_ATOMIC_COLLECTION_GUARD";
|
|
177
|
+
}>;
|
|
178
|
+
export declare const lpV3PreparedPlanSchema: z.ZodObject<{
|
|
179
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
180
|
+
kind: z.ZodLiteral<"lp-v3">;
|
|
181
|
+
intent: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
182
|
+
action: z.ZodLiteral<"mint">;
|
|
183
|
+
amountDesired: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
184
|
+
amountMin: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
185
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
186
|
+
protocol: z.ZodLiteral<"uniswap-v3">;
|
|
187
|
+
chainId: z.ZodLiteral<8453>;
|
|
188
|
+
operationId: z.ZodString;
|
|
189
|
+
account: z.ZodString;
|
|
190
|
+
recipient: z.ZodString;
|
|
191
|
+
manager: z.ZodLiteral<"0x03a520b32c04bf3beef7beb72e919cf822ed34f1">;
|
|
192
|
+
factory: z.ZodLiteral<"0x33128a8fc17869897dce68ed026d694621f6fdfd">;
|
|
193
|
+
pool: z.ZodString;
|
|
194
|
+
token0: z.ZodLiteral<"0x4200000000000000000000000000000000000006">;
|
|
195
|
+
token1: z.ZodLiteral<"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913">;
|
|
196
|
+
fee: z.ZodUnion<readonly [z.ZodLiteral<100>, z.ZodLiteral<500>, z.ZodLiteral<3000>, z.ZodLiteral<10000>]>;
|
|
197
|
+
tickLower: z.ZodNumber;
|
|
198
|
+
tickUpper: z.ZodNumber;
|
|
199
|
+
deadline: z.ZodNumber;
|
|
200
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
201
|
+
action: z.ZodLiteral<"increase">;
|
|
202
|
+
tokenId: z.ZodString;
|
|
203
|
+
amountDesired: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
204
|
+
amountMin: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
205
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
206
|
+
protocol: z.ZodLiteral<"uniswap-v3">;
|
|
207
|
+
chainId: z.ZodLiteral<8453>;
|
|
208
|
+
operationId: z.ZodString;
|
|
209
|
+
account: z.ZodString;
|
|
210
|
+
recipient: z.ZodString;
|
|
211
|
+
manager: z.ZodLiteral<"0x03a520b32c04bf3beef7beb72e919cf822ed34f1">;
|
|
212
|
+
factory: z.ZodLiteral<"0x33128a8fc17869897dce68ed026d694621f6fdfd">;
|
|
213
|
+
pool: z.ZodString;
|
|
214
|
+
token0: z.ZodLiteral<"0x4200000000000000000000000000000000000006">;
|
|
215
|
+
token1: z.ZodLiteral<"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913">;
|
|
216
|
+
fee: z.ZodUnion<readonly [z.ZodLiteral<100>, z.ZodLiteral<500>, z.ZodLiteral<3000>, z.ZodLiteral<10000>]>;
|
|
217
|
+
tickLower: z.ZodNumber;
|
|
218
|
+
tickUpper: z.ZodNumber;
|
|
219
|
+
deadline: z.ZodNumber;
|
|
220
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
221
|
+
action: z.ZodLiteral<"decrease">;
|
|
222
|
+
tokenId: z.ZodString;
|
|
223
|
+
liquidity: z.ZodString;
|
|
224
|
+
amountMin: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
225
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
226
|
+
protocol: z.ZodLiteral<"uniswap-v3">;
|
|
227
|
+
chainId: z.ZodLiteral<8453>;
|
|
228
|
+
operationId: z.ZodString;
|
|
229
|
+
account: z.ZodString;
|
|
230
|
+
recipient: z.ZodString;
|
|
231
|
+
manager: z.ZodLiteral<"0x03a520b32c04bf3beef7beb72e919cf822ed34f1">;
|
|
232
|
+
factory: z.ZodLiteral<"0x33128a8fc17869897dce68ed026d694621f6fdfd">;
|
|
233
|
+
pool: z.ZodString;
|
|
234
|
+
token0: z.ZodLiteral<"0x4200000000000000000000000000000000000006">;
|
|
235
|
+
token1: z.ZodLiteral<"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913">;
|
|
236
|
+
fee: z.ZodUnion<readonly [z.ZodLiteral<100>, z.ZodLiteral<500>, z.ZodLiteral<3000>, z.ZodLiteral<10000>]>;
|
|
237
|
+
tickLower: z.ZodNumber;
|
|
238
|
+
tickUpper: z.ZodNumber;
|
|
239
|
+
deadline: z.ZodNumber;
|
|
240
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
241
|
+
action: z.ZodLiteral<"collect">;
|
|
242
|
+
tokenId: z.ZodString;
|
|
243
|
+
amountMax: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
244
|
+
amountMin: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
245
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
246
|
+
protocol: z.ZodLiteral<"uniswap-v3">;
|
|
247
|
+
chainId: z.ZodLiteral<8453>;
|
|
248
|
+
operationId: z.ZodString;
|
|
249
|
+
account: z.ZodString;
|
|
250
|
+
recipient: z.ZodString;
|
|
251
|
+
manager: z.ZodLiteral<"0x03a520b32c04bf3beef7beb72e919cf822ed34f1">;
|
|
252
|
+
factory: z.ZodLiteral<"0x33128a8fc17869897dce68ed026d694621f6fdfd">;
|
|
253
|
+
pool: z.ZodString;
|
|
254
|
+
token0: z.ZodLiteral<"0x4200000000000000000000000000000000000006">;
|
|
255
|
+
token1: z.ZodLiteral<"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913">;
|
|
256
|
+
fee: z.ZodUnion<readonly [z.ZodLiteral<100>, z.ZodLiteral<500>, z.ZodLiteral<3000>, z.ZodLiteral<10000>]>;
|
|
257
|
+
tickLower: z.ZodNumber;
|
|
258
|
+
tickUpper: z.ZodNumber;
|
|
259
|
+
deadline: z.ZodNumber;
|
|
260
|
+
}, z.core.$strict>], "action">;
|
|
261
|
+
signingSupport: z.ZodEnum<{
|
|
262
|
+
HOST_GATES_REQUIRED: "HOST_GATES_REQUIRED";
|
|
263
|
+
BLOCKED_ATOMIC_NFT_OWNER_GUARD: "BLOCKED_ATOMIC_NFT_OWNER_GUARD";
|
|
264
|
+
BLOCKED_ATOMIC_COLLECTION_GUARD: "BLOCKED_ATOMIC_COLLECTION_GUARD";
|
|
265
|
+
}>;
|
|
266
|
+
intentCommitment: z.ZodString;
|
|
267
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
268
|
+
step: z.ZodEnum<{
|
|
269
|
+
approve: "approve";
|
|
270
|
+
mutation: "mutation";
|
|
271
|
+
cleanup: "cleanup";
|
|
272
|
+
}>;
|
|
273
|
+
tokenIndex: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
|
|
274
|
+
chainId: z.ZodLiteral<8453>;
|
|
275
|
+
from: z.ZodString;
|
|
276
|
+
to: z.ZodString;
|
|
277
|
+
value: z.ZodLiteral<"0">;
|
|
278
|
+
data: z.ZodString;
|
|
279
|
+
}, z.core.$strict>>;
|
|
280
|
+
preparedBlock: z.ZodObject<{
|
|
281
|
+
number: z.ZodString;
|
|
282
|
+
hash: z.ZodString;
|
|
283
|
+
}, z.core.$strict>;
|
|
284
|
+
planCommitment: z.ZodString;
|
|
285
|
+
}, z.core.$strict>;
|
|
286
|
+
export type LpV3PreparedPlan = z.infer<typeof lpV3PreparedPlanSchema>;
|
|
287
|
+
export declare const LP_V3_NPM_ABI: readonly [{
|
|
288
|
+
readonly name: "mint";
|
|
289
|
+
readonly type: "function";
|
|
290
|
+
readonly stateMutability: "payable";
|
|
291
|
+
readonly inputs: readonly [{
|
|
292
|
+
readonly type: "tuple";
|
|
293
|
+
readonly components: readonly [{
|
|
294
|
+
readonly type: "address";
|
|
295
|
+
readonly name: "token0";
|
|
296
|
+
}, {
|
|
297
|
+
readonly type: "address";
|
|
298
|
+
readonly name: "token1";
|
|
299
|
+
}, {
|
|
300
|
+
readonly type: "uint24";
|
|
301
|
+
readonly name: "fee";
|
|
302
|
+
}, {
|
|
303
|
+
readonly type: "int24";
|
|
304
|
+
readonly name: "tickLower";
|
|
305
|
+
}, {
|
|
306
|
+
readonly type: "int24";
|
|
307
|
+
readonly name: "tickUpper";
|
|
308
|
+
}, {
|
|
309
|
+
readonly type: "uint256";
|
|
310
|
+
readonly name: "amount0Desired";
|
|
311
|
+
}, {
|
|
312
|
+
readonly type: "uint256";
|
|
313
|
+
readonly name: "amount1Desired";
|
|
314
|
+
}, {
|
|
315
|
+
readonly type: "uint256";
|
|
316
|
+
readonly name: "amount0Min";
|
|
317
|
+
}, {
|
|
318
|
+
readonly type: "uint256";
|
|
319
|
+
readonly name: "amount1Min";
|
|
320
|
+
}, {
|
|
321
|
+
readonly type: "address";
|
|
322
|
+
readonly name: "recipient";
|
|
323
|
+
}, {
|
|
324
|
+
readonly type: "uint256";
|
|
325
|
+
readonly name: "deadline";
|
|
326
|
+
}];
|
|
327
|
+
readonly name: "params";
|
|
328
|
+
}];
|
|
329
|
+
readonly outputs: readonly [{
|
|
330
|
+
readonly type: "uint256";
|
|
331
|
+
readonly name: "tokenId";
|
|
332
|
+
}, {
|
|
333
|
+
readonly type: "uint128";
|
|
334
|
+
readonly name: "liquidity";
|
|
335
|
+
}, {
|
|
336
|
+
readonly type: "uint256";
|
|
337
|
+
readonly name: "amount0";
|
|
338
|
+
}, {
|
|
339
|
+
readonly type: "uint256";
|
|
340
|
+
readonly name: "amount1";
|
|
341
|
+
}];
|
|
342
|
+
}, {
|
|
343
|
+
readonly name: "increaseLiquidity";
|
|
344
|
+
readonly type: "function";
|
|
345
|
+
readonly stateMutability: "payable";
|
|
346
|
+
readonly inputs: readonly [{
|
|
347
|
+
readonly type: "tuple";
|
|
348
|
+
readonly components: readonly [{
|
|
349
|
+
readonly type: "uint256";
|
|
350
|
+
readonly name: "tokenId";
|
|
351
|
+
}, {
|
|
352
|
+
readonly type: "uint256";
|
|
353
|
+
readonly name: "amount0Desired";
|
|
354
|
+
}, {
|
|
355
|
+
readonly type: "uint256";
|
|
356
|
+
readonly name: "amount1Desired";
|
|
357
|
+
}, {
|
|
358
|
+
readonly type: "uint256";
|
|
359
|
+
readonly name: "amount0Min";
|
|
360
|
+
}, {
|
|
361
|
+
readonly type: "uint256";
|
|
362
|
+
readonly name: "amount1Min";
|
|
363
|
+
}, {
|
|
364
|
+
readonly type: "uint256";
|
|
365
|
+
readonly name: "deadline";
|
|
366
|
+
}];
|
|
367
|
+
readonly name: "params";
|
|
368
|
+
}];
|
|
369
|
+
readonly outputs: readonly [{
|
|
370
|
+
readonly type: "uint128";
|
|
371
|
+
readonly name: "liquidity";
|
|
372
|
+
}, {
|
|
373
|
+
readonly type: "uint256";
|
|
374
|
+
readonly name: "amount0";
|
|
375
|
+
}, {
|
|
376
|
+
readonly type: "uint256";
|
|
377
|
+
readonly name: "amount1";
|
|
378
|
+
}];
|
|
379
|
+
}, {
|
|
380
|
+
readonly name: "decreaseLiquidity";
|
|
381
|
+
readonly type: "function";
|
|
382
|
+
readonly stateMutability: "payable";
|
|
383
|
+
readonly inputs: readonly [{
|
|
384
|
+
readonly type: "tuple";
|
|
385
|
+
readonly components: readonly [{
|
|
386
|
+
readonly type: "uint256";
|
|
387
|
+
readonly name: "tokenId";
|
|
388
|
+
}, {
|
|
389
|
+
readonly type: "uint128";
|
|
390
|
+
readonly name: "liquidity";
|
|
391
|
+
}, {
|
|
392
|
+
readonly type: "uint256";
|
|
393
|
+
readonly name: "amount0Min";
|
|
394
|
+
}, {
|
|
395
|
+
readonly type: "uint256";
|
|
396
|
+
readonly name: "amount1Min";
|
|
397
|
+
}, {
|
|
398
|
+
readonly type: "uint256";
|
|
399
|
+
readonly name: "deadline";
|
|
400
|
+
}];
|
|
401
|
+
readonly name: "params";
|
|
402
|
+
}];
|
|
403
|
+
readonly outputs: readonly [{
|
|
404
|
+
readonly type: "uint256";
|
|
405
|
+
readonly name: "amount0";
|
|
406
|
+
}, {
|
|
407
|
+
readonly type: "uint256";
|
|
408
|
+
readonly name: "amount1";
|
|
409
|
+
}];
|
|
410
|
+
}, {
|
|
411
|
+
readonly name: "collect";
|
|
412
|
+
readonly type: "function";
|
|
413
|
+
readonly stateMutability: "payable";
|
|
414
|
+
readonly inputs: readonly [{
|
|
415
|
+
readonly type: "tuple";
|
|
416
|
+
readonly components: readonly [{
|
|
417
|
+
readonly type: "uint256";
|
|
418
|
+
readonly name: "tokenId";
|
|
419
|
+
}, {
|
|
420
|
+
readonly type: "address";
|
|
421
|
+
readonly name: "recipient";
|
|
422
|
+
}, {
|
|
423
|
+
readonly type: "uint128";
|
|
424
|
+
readonly name: "amount0Max";
|
|
425
|
+
}, {
|
|
426
|
+
readonly type: "uint128";
|
|
427
|
+
readonly name: "amount1Max";
|
|
428
|
+
}];
|
|
429
|
+
readonly name: "params";
|
|
430
|
+
}];
|
|
431
|
+
readonly outputs: readonly [{
|
|
432
|
+
readonly type: "uint256";
|
|
433
|
+
readonly name: "amount0";
|
|
434
|
+
}, {
|
|
435
|
+
readonly type: "uint256";
|
|
436
|
+
readonly name: "amount1";
|
|
437
|
+
}];
|
|
438
|
+
}, {
|
|
439
|
+
readonly name: "IncreaseLiquidity";
|
|
440
|
+
readonly type: "event";
|
|
441
|
+
readonly inputs: readonly [{
|
|
442
|
+
readonly type: "uint256";
|
|
443
|
+
readonly name: "tokenId";
|
|
444
|
+
readonly indexed: true;
|
|
445
|
+
}, {
|
|
446
|
+
readonly type: "uint128";
|
|
447
|
+
readonly name: "liquidity";
|
|
448
|
+
}, {
|
|
449
|
+
readonly type: "uint256";
|
|
450
|
+
readonly name: "amount0";
|
|
451
|
+
}, {
|
|
452
|
+
readonly type: "uint256";
|
|
453
|
+
readonly name: "amount1";
|
|
454
|
+
}];
|
|
455
|
+
}, {
|
|
456
|
+
readonly name: "DecreaseLiquidity";
|
|
457
|
+
readonly type: "event";
|
|
458
|
+
readonly inputs: readonly [{
|
|
459
|
+
readonly type: "uint256";
|
|
460
|
+
readonly name: "tokenId";
|
|
461
|
+
readonly indexed: true;
|
|
462
|
+
}, {
|
|
463
|
+
readonly type: "uint128";
|
|
464
|
+
readonly name: "liquidity";
|
|
465
|
+
}, {
|
|
466
|
+
readonly type: "uint256";
|
|
467
|
+
readonly name: "amount0";
|
|
468
|
+
}, {
|
|
469
|
+
readonly type: "uint256";
|
|
470
|
+
readonly name: "amount1";
|
|
471
|
+
}];
|
|
472
|
+
}, {
|
|
473
|
+
readonly name: "Collect";
|
|
474
|
+
readonly type: "event";
|
|
475
|
+
readonly inputs: readonly [{
|
|
476
|
+
readonly type: "uint256";
|
|
477
|
+
readonly name: "tokenId";
|
|
478
|
+
readonly indexed: true;
|
|
479
|
+
}, {
|
|
480
|
+
readonly type: "address";
|
|
481
|
+
readonly name: "recipient";
|
|
482
|
+
}, {
|
|
483
|
+
readonly type: "uint256";
|
|
484
|
+
readonly name: "amount0";
|
|
485
|
+
}, {
|
|
486
|
+
readonly type: "uint256";
|
|
487
|
+
readonly name: "amount1";
|
|
488
|
+
}];
|
|
489
|
+
}, {
|
|
490
|
+
readonly name: "Transfer";
|
|
491
|
+
readonly type: "event";
|
|
492
|
+
readonly inputs: readonly [{
|
|
493
|
+
readonly type: "address";
|
|
494
|
+
readonly name: "from";
|
|
495
|
+
readonly indexed: true;
|
|
496
|
+
}, {
|
|
497
|
+
readonly type: "address";
|
|
498
|
+
readonly name: "to";
|
|
499
|
+
readonly indexed: true;
|
|
500
|
+
}, {
|
|
501
|
+
readonly type: "uint256";
|
|
502
|
+
readonly name: "tokenId";
|
|
503
|
+
readonly indexed: true;
|
|
504
|
+
}];
|
|
505
|
+
}];
|
|
506
|
+
export declare const LP_V3_ERC20_ABI: readonly [{
|
|
507
|
+
readonly name: "approve";
|
|
508
|
+
readonly type: "function";
|
|
509
|
+
readonly stateMutability: "nonpayable";
|
|
510
|
+
readonly inputs: readonly [{
|
|
511
|
+
readonly type: "address";
|
|
512
|
+
readonly name: "spender";
|
|
513
|
+
}, {
|
|
514
|
+
readonly type: "uint256";
|
|
515
|
+
readonly name: "amount";
|
|
516
|
+
}];
|
|
517
|
+
readonly outputs: readonly [{
|
|
518
|
+
readonly type: "bool";
|
|
519
|
+
}];
|
|
520
|
+
}, {
|
|
521
|
+
readonly name: "Transfer";
|
|
522
|
+
readonly type: "event";
|
|
523
|
+
readonly inputs: readonly [{
|
|
524
|
+
readonly type: "address";
|
|
525
|
+
readonly name: "from";
|
|
526
|
+
readonly indexed: true;
|
|
527
|
+
}, {
|
|
528
|
+
readonly type: "address";
|
|
529
|
+
readonly name: "to";
|
|
530
|
+
readonly indexed: true;
|
|
531
|
+
}, {
|
|
532
|
+
readonly type: "uint256";
|
|
533
|
+
readonly name: "value";
|
|
534
|
+
}];
|
|
535
|
+
}];
|
|
536
|
+
export declare function canonicalJson(value: unknown): string;
|
|
537
|
+
export declare const commitment: (value: unknown) => `0x${string}`;
|
|
538
|
+
export declare function deepFreeze<T>(value: T): T;
|