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.
Files changed (239) hide show
  1. package/README.md +76 -18
  2. package/dist/account-userop-policy-definition.d.ts +14 -0
  3. package/dist/account-userop-policy-definition.js +12 -0
  4. package/dist/account-userop-policy-relation.d.ts +371 -0
  5. package/dist/account-userop-policy-relation.js +87 -0
  6. package/dist/adapter/cdp-signer.d.ts +76 -9
  7. package/dist/adapter/cdp-signer.js +274 -33
  8. package/dist/adapter/evm-call-failure.d.ts +29 -0
  9. package/dist/adapter/evm-call-failure.js +109 -0
  10. package/dist/adapter/refusal.d.ts +1 -1
  11. package/dist/adapter/refusal.js +13 -0
  12. package/dist/adapter/route-simulator.d.ts +91 -0
  13. package/dist/adapter/route-simulator.js +143 -0
  14. package/dist/adapter-cdp-index.d.ts +1 -1
  15. package/dist/executable-equities.d.ts +55 -0
  16. package/dist/executable-equities.js +116 -0
  17. package/dist/executable-yield-markets.d.ts +261 -0
  18. package/dist/executable-yield-markets.js +154 -0
  19. package/dist/execution-account-gas-quote.d.ts +141 -0
  20. package/dist/execution-account-gas-quote.js +443 -0
  21. package/dist/execution-account-gas-review.d.ts +123 -0
  22. package/dist/execution-account-gas-review.js +104 -0
  23. package/dist/execution-account-gas-runtime.d.ts +33 -0
  24. package/dist/execution-account-gas-runtime.js +131 -0
  25. package/dist/execution-account-gas-view.d.ts +936 -0
  26. package/dist/execution-account-gas-view.js +56 -0
  27. package/dist/execution-config.d.ts +3 -0
  28. package/dist/execution-config.js +4 -0
  29. package/dist/execution-delegated-definition.d.ts +7 -6
  30. package/dist/execution-delegated-definition.js +13 -2
  31. package/dist/execution-delegation-admin-definition.d.ts +127 -5
  32. package/dist/execution-delegation-admin-definition.js +155 -5
  33. package/dist/execution-delegation-admin.d.ts +48 -2
  34. package/dist/execution-delegation-admin.js +422 -12
  35. package/dist/execution-delegation-cap-store.d.ts +386 -0
  36. package/dist/execution-delegation-cap-store.js +1150 -0
  37. package/dist/execution-delegation-exit-definition.d.ts +309 -0
  38. package/dist/execution-delegation-exit-definition.js +204 -0
  39. package/dist/execution-delegation-exit-store.d.ts +114 -0
  40. package/dist/execution-delegation-exit-store.js +671 -0
  41. package/dist/execution-delegation-exit.d.ts +4 -0
  42. package/dist/execution-delegation-exit.js +614 -0
  43. package/dist/execution-delegation-finality.d.ts +22 -0
  44. package/dist/execution-delegation-finality.js +90 -0
  45. package/dist/execution-delegation-operation-store.d.ts +129 -0
  46. package/dist/execution-delegation-operation-store.js +1107 -0
  47. package/dist/execution-delegation-operations-definition.d.ts +282 -0
  48. package/dist/execution-delegation-operations-definition.js +117 -0
  49. package/dist/execution-delegation-operations.d.ts +6 -0
  50. package/dist/execution-delegation-operations.js +282 -0
  51. package/dist/execution-delegation-policy.d.ts +154 -8
  52. package/dist/execution-delegation-policy.js +273 -40
  53. package/dist/execution-delegation.d.ts +51 -0
  54. package/dist/execution-delegation.js +441 -31
  55. package/dist/execution-errors.d.ts +1 -1
  56. package/dist/execution-errors.js +122 -0
  57. package/dist/execution-index.d.ts +7 -2
  58. package/dist/execution-index.js +7 -2
  59. package/dist/execution-journal-schema.d.ts +96 -0
  60. package/dist/execution-journal-schema.js +368 -0
  61. package/dist/execution-journal-tables.d.ts +14 -0
  62. package/dist/execution-journal-tables.js +227 -0
  63. package/dist/execution-policy-compatibility.d.ts +34 -0
  64. package/dist/execution-policy-compatibility.js +76 -0
  65. package/dist/execution-registration.d.ts +54 -2
  66. package/dist/execution-registration.js +151 -5
  67. package/dist/execution-sponsored-account-profile.d.ts +32 -0
  68. package/dist/execution-sponsored-account-profile.js +59 -0
  69. package/dist/execution-sponsored-account.d.ts +1519 -0
  70. package/dist/execution-sponsored-account.js +222 -0
  71. package/dist/execution-sponsored-definition.d.ts +1713 -0
  72. package/dist/execution-sponsored-definition.js +185 -0
  73. package/dist/execution-sponsored-gas-policy.d.ts +27 -0
  74. package/dist/execution-sponsored-gas-policy.js +110 -0
  75. package/dist/execution-sponsored-hosted.d.ts +3 -0
  76. package/dist/execution-sponsored-hosted.js +71 -0
  77. package/dist/execution-sponsored-index.d.ts +1322 -0
  78. package/dist/execution-sponsored-index.js +102 -0
  79. package/dist/execution-sponsored-mcp-definition.d.ts +1662 -0
  80. package/dist/execution-sponsored-mcp-definition.js +94 -0
  81. package/dist/execution-sponsored-receipt.d.ts +47 -0
  82. package/dist/execution-sponsored-receipt.js +74 -0
  83. package/dist/execution-sponsored-registration.d.ts +14 -0
  84. package/dist/execution-sponsored-registration.js +77 -0
  85. package/dist/execution-sponsored-runtime.d.ts +84 -0
  86. package/dist/execution-sponsored-runtime.js +149 -0
  87. package/dist/execution-sponsored-settlement.d.ts +15 -0
  88. package/dist/execution-sponsored-settlement.js +88 -0
  89. package/dist/execution-sponsored-store.d.ts +67 -0
  90. package/dist/execution-sponsored-store.js +517 -0
  91. package/dist/execution-sponsored-transport.d.ts +90 -0
  92. package/dist/execution-sponsored-transport.js +180 -0
  93. package/dist/execution-tool-definitions.d.ts +21 -21
  94. package/dist/execution-tool-definitions.js +0 -7
  95. package/dist/execution-tools.d.ts +53 -1
  96. package/dist/execution-tools.js +171 -13
  97. package/dist/execution-worker-guard.d.ts +28 -0
  98. package/dist/execution-worker-guard.js +124 -0
  99. package/dist/hybrid-yield-index.d.ts +10 -0
  100. package/dist/hybrid-yield-index.js +11 -0
  101. package/dist/hybrid-yield-markets.d.ts +96 -0
  102. package/dist/hybrid-yield-markets.js +124 -0
  103. package/dist/hybrid-yield.d.ts +411 -0
  104. package/dist/hybrid-yield.js +155 -0
  105. package/dist/hyperliquid-order-builder.js +4 -0
  106. package/dist/lifi-execution-client.d.ts +6 -0
  107. package/dist/lifi-execution-client.js +3 -0
  108. package/dist/lp-userop-account.d.ts +461 -0
  109. package/dist/lp-userop-account.js +417 -0
  110. package/dist/lp-userop-authority.d.ts +49 -0
  111. package/dist/lp-userop-authority.js +211 -0
  112. package/dist/lp-userop-definition.d.ts +233 -0
  113. package/dist/lp-userop-definition.js +85 -0
  114. package/dist/lp-userop-hosted.d.ts +3 -0
  115. package/dist/lp-userop-hosted.js +73 -0
  116. package/dist/lp-userop-index.d.ts +1569 -0
  117. package/dist/lp-userop-index.js +112 -0
  118. package/dist/lp-userop-mcp-definition.d.ts +1220 -0
  119. package/dist/lp-userop-mcp-definition.js +46 -0
  120. package/dist/lp-userop-operation.d.ts +1230 -0
  121. package/dist/lp-userop-operation.js +140 -0
  122. package/dist/lp-userop-registration.d.ts +14 -0
  123. package/dist/lp-userop-registration.js +70 -0
  124. package/dist/lp-userop-settlement.d.ts +89 -0
  125. package/dist/lp-userop-settlement.js +184 -0
  126. package/dist/lp-userop.d.ts +643 -0
  127. package/dist/lp-userop.js +343 -0
  128. package/dist/native-yield-account-definition.d.ts +1192 -0
  129. package/dist/native-yield-account-definition.js +232 -0
  130. package/dist/native-yield-account-gas.d.ts +58 -0
  131. package/dist/native-yield-account-gas.js +228 -0
  132. package/dist/native-yield-account-index.d.ts +23 -0
  133. package/dist/native-yield-account-index.js +28 -0
  134. package/dist/native-yield-account-policy.d.ts +168 -0
  135. package/dist/native-yield-account-policy.js +525 -0
  136. package/dist/native-yield-account-rpc.d.ts +8 -0
  137. package/dist/native-yield-account-rpc.js +128 -0
  138. package/dist/native-yield-account-runtime.d.ts +71 -0
  139. package/dist/native-yield-account-runtime.js +125 -0
  140. package/dist/native-yield-account-store.d.ts +40 -0
  141. package/dist/native-yield-account-store.js +307 -0
  142. package/dist/native-yield-account.d.ts +662 -0
  143. package/dist/native-yield-account.js +371 -0
  144. package/dist/native-yield-consent-store.d.ts +20 -0
  145. package/dist/native-yield-consent-store.js +317 -0
  146. package/dist/native-yield-definition.d.ts +288 -0
  147. package/dist/native-yield-definition.js +105 -0
  148. package/dist/native-yield-reader.d.ts +4 -0
  149. package/dist/native-yield-reader.js +137 -0
  150. package/dist/native-yield-settlement.d.ts +48 -0
  151. package/dist/native-yield-settlement.js +167 -0
  152. package/dist/native-yield-simulation.d.ts +18 -0
  153. package/dist/native-yield-simulation.js +45 -0
  154. package/dist/native-yield-userop-account.d.ts +675 -0
  155. package/dist/native-yield-userop-account.js +357 -0
  156. package/dist/native-yield-userop-authority.d.ts +214 -0
  157. package/dist/native-yield-userop-authority.js +296 -0
  158. package/dist/native-yield-userop-definition.d.ts +331 -0
  159. package/dist/native-yield-userop-definition.js +105 -0
  160. package/dist/native-yield-userop-hosted.d.ts +3 -0
  161. package/dist/native-yield-userop-hosted.js +71 -0
  162. package/dist/native-yield-userop-index.d.ts +1522 -0
  163. package/dist/native-yield-userop-index.js +142 -0
  164. package/dist/native-yield-userop-mcp-definition.d.ts +1356 -0
  165. package/dist/native-yield-userop-mcp-definition.js +50 -0
  166. package/dist/native-yield-userop-operation.d.ts +845 -0
  167. package/dist/native-yield-userop-operation.js +127 -0
  168. package/dist/native-yield-userop-policy.d.ts +23 -0
  169. package/dist/native-yield-userop-policy.js +25 -0
  170. package/dist/native-yield-userop-registration.d.ts +17 -0
  171. package/dist/native-yield-userop-registration.js +76 -0
  172. package/dist/native-yield-userop-settlement.d.ts +8 -0
  173. package/dist/native-yield-userop-settlement.js +79 -0
  174. package/dist/native-yield-userop-simulation.d.ts +18 -0
  175. package/dist/native-yield-userop-simulation.js +34 -0
  176. package/dist/native-yield-userop.d.ts +35 -0
  177. package/dist/native-yield-userop.js +156 -0
  178. package/dist/native-yield-verify.d.ts +30 -0
  179. package/dist/native-yield-verify.js +141 -0
  180. package/dist/native-yield.d.ts +17 -0
  181. package/dist/native-yield.js +119 -0
  182. package/dist/stdio-main.js +0 -0
  183. package/dist/stock-buy-definition.d.ts +338 -0
  184. package/dist/stock-buy-definition.js +127 -0
  185. package/dist/stock-buy-oracle.d.ts +8 -0
  186. package/dist/stock-buy-oracle.js +22 -0
  187. package/dist/stock-buy.d.ts +17 -0
  188. package/dist/stock-buy.js +164 -0
  189. package/dist/tool-definitions.d.ts +3 -1
  190. package/dist/tool-definitions.js +55 -2
  191. package/dist/vendor/lp-v3/lp-v3-atomic-contract.d.ts +445 -0
  192. package/dist/vendor/lp-v3/lp-v3-atomic-contract.js +90 -0
  193. package/dist/vendor/lp-v3/lp-v3-atomic-evidence.d.ts +14 -0
  194. package/dist/vendor/lp-v3/lp-v3-atomic-evidence.js +82 -0
  195. package/dist/vendor/lp-v3/lp-v3-atomic-index.d.ts +80 -0
  196. package/dist/vendor/lp-v3/lp-v3-atomic-index.js +19 -0
  197. package/dist/vendor/lp-v3/lp-v3-atomic-plan.d.ts +43 -0
  198. package/dist/vendor/lp-v3/lp-v3-atomic-plan.js +112 -0
  199. package/dist/vendor/lp-v3/lp-v3-atomic-read-contract.d.ts +312 -0
  200. package/dist/vendor/lp-v3/lp-v3-atomic-read-contract.js +41 -0
  201. package/dist/vendor/lp-v3/lp-v3-atomic-read-index.d.ts +3 -0
  202. package/dist/vendor/lp-v3/lp-v3-atomic-read-index.js +3 -0
  203. package/dist/vendor/lp-v3/lp-v3-atomic-read-rpc.d.ts +49 -0
  204. package/dist/vendor/lp-v3/lp-v3-atomic-read-rpc.js +88 -0
  205. package/dist/vendor/lp-v3/lp-v3-atomic-read.d.ts +17 -0
  206. package/dist/vendor/lp-v3/lp-v3-atomic-read.js +232 -0
  207. package/dist/vendor/lp-v3/lp-v3-atomic-settlement.d.ts +105 -0
  208. package/dist/vendor/lp-v3/lp-v3-atomic-settlement.js +162 -0
  209. package/dist/vendor/lp-v3/lp-v3-collect-protocol-contract.d.ts +606 -0
  210. package/dist/vendor/lp-v3/lp-v3-collect-protocol-contract.js +59 -0
  211. package/dist/vendor/lp-v3/lp-v3-collect-protocol-index.d.ts +168 -0
  212. package/dist/vendor/lp-v3/lp-v3-collect-protocol-index.js +23 -0
  213. package/dist/vendor/lp-v3/lp-v3-collect-protocol-observation.d.ts +32 -0
  214. package/dist/vendor/lp-v3/lp-v3-collect-protocol-observation.js +228 -0
  215. package/dist/vendor/lp-v3/lp-v3-collect-protocol-plan.d.ts +11 -0
  216. package/dist/vendor/lp-v3/lp-v3-collect-protocol-plan.js +91 -0
  217. package/dist/vendor/lp-v3/lp-v3-collect-protocol-reconcile.d.ts +9 -0
  218. package/dist/vendor/lp-v3/lp-v3-collect-protocol-reconcile.js +124 -0
  219. package/dist/vendor/lp-v3/lp-v3-contract.d.ts +538 -0
  220. package/dist/vendor/lp-v3/lp-v3-contract.js +137 -0
  221. package/dist/vendor/lp-v3/lp-v3-evidence.d.ts +25 -0
  222. package/dist/vendor/lp-v3/lp-v3-evidence.js +168 -0
  223. package/dist/vendor/lp-v3/lp-v3-plan.d.ts +22 -0
  224. package/dist/vendor/lp-v3/lp-v3-plan.js +135 -0
  225. package/dist/vendor/lp-v3/types.d.ts +131 -0
  226. package/dist/vendor/lp-v3/types.js +6 -0
  227. package/dist/vendor/lp-v3/v4-math.d.ts +18 -0
  228. package/dist/vendor/lp-v3/v4-math.js +90 -0
  229. package/dist/yield-deposit-definition.d.ts +374 -0
  230. package/dist/yield-deposit-definition.js +123 -0
  231. package/dist/yield-deposit.d.ts +16 -0
  232. package/dist/yield-deposit.js +149 -0
  233. package/dist/yield-route-semantics.d.ts +27 -0
  234. package/dist/yield-route-semantics.js +71 -0
  235. package/dist/yield-withdraw-definition.d.ts +357 -0
  236. package/dist/yield-withdraw-definition.js +90 -0
  237. package/dist/yield-withdraw.d.ts +11 -0
  238. package/dist/yield-withdraw.js +122 -0
  239. package/package.json +239 -7
@@ -0,0 +1,88 @@
1
+ import { decodeEventLog, keccak256, parseAbi } from 'viem';
2
+ import { sponsoredPlan, sponsoredOutputToken } from './execution-sponsored-definition.js';
3
+ import { DEFAULT_OTTO_LIFI_FEE_RECIPIENT } from './execution-config.js';
4
+ const ABI = parseAbi([
5
+ 'event UserOperationEvent(bytes32 indexed userOpHash,address indexed sender,address indexed paymaster,uint256 nonce,bool success,uint256 actualGasCost,uint256 actualGasUsed)',
6
+ 'event BeforeExecution()',
7
+ 'event Transfer(address indexed from,address indexed to,uint256 value)',
8
+ 'function allowance(address owner,address spender) view returns(uint256)',
9
+ ]);
10
+ function fail() { throw new Error('SPONSOR_SETTLEMENT_UNCONFIRMED'); }
11
+ /** Isolate execution logs belonging to this UserOp, excluding every other operation in its bundle. */
12
+ export function sponsoredOperationLogs(receipt, entryPoint, userOpHash) {
13
+ let start = -1, end = -1;
14
+ for (const [index, log] of receipt.logs.entries()) {
15
+ if (log.address.toLowerCase() !== entryPoint.toLowerCase())
16
+ continue;
17
+ let decoded;
18
+ try {
19
+ decoded = decodeEventLog({ abi: ABI, data: log.data, topics: log.topics, strict: true });
20
+ }
21
+ catch {
22
+ continue;
23
+ }
24
+ if (decoded.eventName === 'UserOperationEvent') {
25
+ if (decoded.args.userOpHash.toLowerCase() === userOpHash.toLowerCase()) {
26
+ if (end !== -1)
27
+ return fail();
28
+ end = index;
29
+ }
30
+ else if (end === -1)
31
+ start = index;
32
+ }
33
+ else if (decoded.eventName === 'BeforeExecution' && end === -1)
34
+ start = index;
35
+ }
36
+ if (start === -1 || end <= start)
37
+ return fail();
38
+ return receipt.logs.slice(start + 1, end);
39
+ }
40
+ export async function readSponsoredSwapSettlement(operation, confirmed, client) {
41
+ const plan = sponsoredPlan(operation.context), terms = operation.context.activation.chains.find(c => c.chainId === operation.context.chainId);
42
+ const output = sponsoredOutputToken(operation.context.activation, operation.context.chainId, plan.outputToken);
43
+ const receipt = await client.getTransactionReceipt({ hash: confirmed.transactionHash });
44
+ if (receipt.transactionHash !== confirmed.transactionHash || receipt.blockHash !== confirmed.blockHash ||
45
+ receipt.blockNumber.toString() !== confirmed.blockNumber)
46
+ return fail();
47
+ let inputDebited = 0n, outputReceived = 0n, ottoFeeReceived = 0n;
48
+ const owner = operation.context.account.toLowerCase();
49
+ for (const log of sponsoredOperationLogs(receipt, terms.entryPoint, confirmed.userOpHash)) {
50
+ if (log.removed || log.transactionHash !== receipt.transactionHash || log.blockHash !== receipt.blockHash || log.blockNumber !== receipt.blockNumber)
51
+ return fail();
52
+ let transfer;
53
+ try {
54
+ transfer = decodeEventLog({ abi: ABI, data: log.data, topics: log.topics, strict: true });
55
+ }
56
+ catch {
57
+ continue;
58
+ }
59
+ if (transfer.eventName !== 'Transfer')
60
+ continue;
61
+ const { from, to, value } = transfer.args;
62
+ if (log.address.toLowerCase() === plan.token.toLowerCase()) {
63
+ if (from.toLowerCase() === owner)
64
+ inputDebited += value;
65
+ if (to.toLowerCase() === owner)
66
+ inputDebited -= value;
67
+ if (to.toLowerCase() === DEFAULT_OTTO_LIFI_FEE_RECIPIENT.toLowerCase())
68
+ ottoFeeReceived += value;
69
+ }
70
+ if (log.address.toLowerCase() === plan.outputToken.toLowerCase()) {
71
+ if (to.toLowerCase() === owner)
72
+ outputReceived += value;
73
+ if (from.toLowerCase() === owner)
74
+ outputReceived -= value;
75
+ }
76
+ }
77
+ const allowance = await client.readContract({ address: plan.token, abi: ABI, functionName: 'allowance',
78
+ args: [operation.context.account, plan.spender], blockNumber: receipt.blockNumber });
79
+ const outputCode = await client.getCode({ address: output.address, blockNumber: receipt.blockNumber });
80
+ if (inputDebited !== plan.gross || outputReceived < plan.minAmountOut || ottoFeeReceived < plan.ottoFee || allowance !== 0n ||
81
+ !outputCode || outputCode === '0x' || keccak256(outputCode).toLowerCase() !== output.codeHash.toLowerCase() ||
82
+ await client.getChainId() !== operation.context.chainId || (await client.getBlock({ blockNumber: receipt.blockNumber })).hash !== receipt.blockHash)
83
+ return fail();
84
+ return { inputToken: plan.token, outputToken: plan.outputToken, inputDebited: inputDebited.toString(),
85
+ outputReceived: outputReceived.toString(), ottoFeeReceived: ottoFeeReceived.toString(), allowanceAfter: '0',
86
+ userOpHash: confirmed.userOpHash, transactionHash: confirmed.transactionHash };
87
+ }
88
+ //# sourceMappingURL=execution-sponsored-settlement.js.map
@@ -0,0 +1,67 @@
1
+ import { type AccountGasFailure } from './execution-account-gas-view.js';
2
+ import { type AccountGasReview } from './execution-account-gas-review.js';
3
+ import { type ExecutionJournalDatabase } from './execution-journal-schema.js';
4
+ import { type SponsoredOperation, type SponsoredAuthority } from './execution-sponsored-definition.js';
5
+ import { type PreparedSponsoredRequest, type SponsoredAcknowledgement } from './execution-sponsored-transport.js';
6
+ import type { ConfirmedSponsoredReceipt } from './execution-sponsored-receipt.js';
7
+ import { type NativeUserOpOperation } from './native-yield-userop-operation.js';
8
+ import { type LpUserOpOperation } from './lp-userop-operation.js';
9
+ import { type LpUserOpSubmitEvidence } from './lp-userop.js';
10
+ type SponsoredRecord = SponsoredOperation | NativeUserOpOperation | LpUserOpOperation;
11
+ declare const handoffProofBrand: unique symbol;
12
+ /** Process-local evidence of a committed stamp whose provider start has not been invoked. */
13
+ export interface SponsoredHandoffProof {
14
+ readonly [handoffProofBrand]: true;
15
+ }
16
+ export declare function validateSponsoredOperation(raw: unknown): SponsoredOperation;
17
+ export declare class SponsoredOperationStore<T extends SponsoredRecord = SponsoredOperation> {
18
+ readonly db: ExecutionJournalDatabase;
19
+ private readonly now;
20
+ private readonly kind;
21
+ private readonly handoffProofs;
22
+ constructor(db: ExecutionJournalDatabase, now?: () => number, kind?: 'swap' | 'native-yield-userop' | 'lp-collect-userop');
23
+ /** Typed view of the SAME connection, table, transaction, cross-rail claim and gas budget. */
24
+ forNativeYieldUserOp(): SponsoredOperationStore<NativeUserOpOperation>;
25
+ forLpV3CollectUserOp(): SponsoredOperationStore<LpUserOpOperation>;
26
+ private narrow;
27
+ journalStatus(): import("./execution-journal-schema.js").ExecutionJournalStatus;
28
+ assertReadyForNewOperations(): void;
29
+ transaction<T>(fn: () => T): T;
30
+ private decode;
31
+ private all;
32
+ private assertContextBudgetAvailable;
33
+ /** Also checks reviews admitted before another user's proven provider-cap breach. */
34
+ assertBudgetAvailable(userId: string, operationId: string): void;
35
+ /** Linearize a transport handoff with every durable gas-cap breach. The callback starts
36
+ * fetch synchronously and returns its promise; this transaction never awaits the network. */
37
+ handoff<T>(userId: string, operationId: string, start: () => Promise<T>): Promise<T>;
38
+ private requireClaim;
39
+ read(userId: string, operationId: string): T;
40
+ private save;
41
+ create(raw: T['context']): T;
42
+ /** Re-price only an unconsumed review or an exact, terminal proof that no request started.
43
+ * The same operation ID remains the recovery identity; changed gas terms require new consent. */
44
+ reviewGas(userId: string, operationId: string, expectedReviewCommitment: string, raw: AccountGasReview): T;
45
+ recordGasReviewFailure(userId: string, operationId: string, failure: AccountGasFailure): T;
46
+ begin(userId: string, operationId: string, reviewCommitment: string, authority: SponsoredAuthority): T;
47
+ prepare(userId: string, operationId: string, request: PreparedSponsoredRequest): T;
48
+ /** Write the final independent submit baseline once, before the durable attempted stamp and fetch. */
49
+ recordLpVerification(userId: string, operationId: string, raw: LpUserOpSubmitEvidence): T;
50
+ attempted(userId: string, operationId: string): T;
51
+ /** Only a successfully committed standalone stamp can mint this one-use process proof.
52
+ * Losing it on crash/restart deliberately leaves the original attempted claim unresolved. */
53
+ attemptedWithProof(userId: string, operationId: string): SponsoredHandoffProof;
54
+ private uninvokedHandoff;
55
+ /** Called under handoff's writer lock immediately BEFORE the actual provider callback.
56
+ * A synchronous callback throw is therefore ambiguous and can never release the claim. */
57
+ consumeHandoffProof(proof: SponsoredHandoffProof): void;
58
+ /** Same-process, exact-row non-invocation is the sole exception to retaining a stamped claim. */
59
+ failUninvokedHandoff(proof: SponsoredHandoffProof): T;
60
+ acknowledged(userId: string, operationId: string, result: SponsoredAcknowledgement): T;
61
+ failBeforeHandoff(userId: string, operationId: string): T;
62
+ recordGasCapBreach(userId: string, operationId: string, receipt: ConfirmedSponsoredReceipt): T;
63
+ finish(userId: string, operationId: string, receipt: ConfirmedSponsoredReceipt, settlement?: unknown): T;
64
+ }
65
+ /** Does not initialize or migrate: the coordinated offline rollout must already have installed v4. */
66
+ export declare function openSponsoredOperationStore(root: string, now?: () => number): Promise<SponsoredOperationStore>;
67
+ export {};