otto-intel-mcp 0.1.3 → 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 +74 -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 +32 -4
- package/dist/adapter/cdp-signer.js +128 -37
- package/dist/adapter-cdp-index.d.ts +1 -1
- 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 +6 -6
- package/dist/execution-delegated-definition.js +1 -1
- package/dist/execution-delegation-admin-definition.d.ts +12 -11
- package/dist/execution-delegation-admin-definition.js +6 -5
- package/dist/execution-delegation-admin.d.ts +5 -5
- package/dist/execution-delegation-admin.js +157 -49
- package/dist/execution-delegation-cap-store.d.ts +22 -5
- package/dist/execution-delegation-cap-store.js +74 -7
- 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 +1 -2
- package/dist/execution-delegation-policy.js +13 -24
- package/dist/execution-delegation.d.ts +16 -0
- package/dist/execution-delegation.js +221 -26
- package/dist/execution-errors.d.ts +1 -1
- package/dist/execution-errors.js +27 -3
- package/dist/execution-index.d.ts +4 -0
- package/dist/execution-index.js +4 -0
- 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 +8 -5
- package/dist/execution-registration.js +106 -3
- 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 +9 -0
- package/dist/execution-tools.js +14 -0
- 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/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 +10 -10
- package/dist/tool-definitions.d.ts +3 -1
- package/dist/tool-definitions.js +54 -1
- 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 +65 -14
- package/dist/yield-deposit-definition.js +6 -4
- package/dist/yield-deposit.js +8 -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 +62 -11
- package/dist/yield-withdraw-definition.js +3 -1
- package/dist/yield-withdraw.d.ts +0 -10
- package/dist/yield-withdraw.js +2 -0
- package/package.json +215 -7
|
@@ -32,8 +32,9 @@
|
|
|
32
32
|
* gate's own minimum safe model —
|
|
33
33
|
*
|
|
34
34
|
* reserved ──confirm──▶ confirmed_active ──┬──▶ superseded (a later confirm won)
|
|
35
|
-
* │ ├──▶ revoked (the person
|
|
36
|
-
*
|
|
35
|
+
* │ ├──▶ revoked (the person pressed Stop)
|
|
36
|
+
* ├──mismatch──▶ refused/unconfirmed └──▶ (expiry passes)
|
|
37
|
+
* └──10 min──▶ expired
|
|
37
38
|
*
|
|
38
39
|
* — and made ONE thing authoritative: `readActive`. A reserved row authorises NOTHING; the send gate
|
|
39
40
|
* reads the confirmed-active record and requires its expiry to equal the live grant's.
|
|
@@ -121,6 +122,13 @@ export declare const DELEGATION_MINT_ENABLED_ENV: "DELEGATION_MINT_ENABLED";
|
|
|
121
122
|
export declare function resolveDelegationMintEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
122
123
|
/** The one sentence every paused surface says. No security narration: it is an update, and it is short. */
|
|
123
124
|
export declare const DELEGATION_MINT_PAUSED_MESSAGE: "Delegation is paused for a few minutes while we update it";
|
|
125
|
+
/** New Model B trading grants are retired. Status, confirm, revoke and exits remain available. */
|
|
126
|
+
export declare const DELEGATION_TRADE_MINT_RETIRED_MESSAGE: "Otto no longer creates new Model B trading permissions. Existing permissions remain visible and revocable; use your wallet to sign new actions.";
|
|
127
|
+
/** The Model B reserve may run only when both the global and trade-specific gates allow it. */
|
|
128
|
+
export declare function effectiveTradeMintEnabled(switches: {
|
|
129
|
+
readonly mintEnabled: boolean;
|
|
130
|
+
readonly tradeMintEnabled: boolean;
|
|
131
|
+
}): boolean;
|
|
124
132
|
/**
|
|
125
133
|
* The shape a mint key must have: what `createDelegation({ idempotencyKey })` accepts, bounded so it
|
|
126
134
|
* cannot be used as a path or a smuggling channel. A UUID satisfies it.
|
|
@@ -233,16 +241,21 @@ export interface DelegationCapStop {
|
|
|
233
241
|
export declare class DelegationCapExpiryUnavailableError extends Error {
|
|
234
242
|
constructor(steps: number);
|
|
235
243
|
}
|
|
244
|
+
export type DelegationCapHandoffAuthority = Pick<DelegationCapRecord, 'userId' | 'mintKey' | 'expiresAt' | 'perSwapCapUsd' | 'requiredVersion' | 'revokeGeneration'>;
|
|
236
245
|
export interface DelegationCapStore {
|
|
237
246
|
/** False when no durable path is configured, or the database could not be opened. Sends refuse while false. */
|
|
238
247
|
readonly available: boolean;
|
|
239
248
|
readonly unavailableReason?: string;
|
|
249
|
+
/** Current durable Stop generation, sampled before the cross-kind mint claim is acquired. */
|
|
250
|
+
readRevokeGeneration(userId: string): Promise<number>;
|
|
240
251
|
/**
|
|
241
252
|
* Reserve the first whole second at or BEFORE `latestExpiresAt` that no reservation for this user
|
|
242
253
|
* occupies, and record the cap against it. Idempotent per mint key. THROWS when the store cannot be
|
|
243
254
|
* written; `DelegationCapExpiryUnavailableError` when the ladder is exhausted.
|
|
244
255
|
*/
|
|
245
|
-
reserve(userId: string, mintKey: string, latestExpiresAt: string, perSwapCapUsd: number, nowMs: number
|
|
256
|
+
reserve(userId: string, mintKey: string, latestExpiresAt: string, perSwapCapUsd: number, nowMs: number,
|
|
257
|
+
/** Generation sampled before the mint claim. Omission preserves direct-store test compatibility. */
|
|
258
|
+
expectedRevokeGeneration?: number): Promise<DelegationCapReservation>;
|
|
246
259
|
/** The reservation this mint key holds, with its state as of `nowMs` (the window applied). */
|
|
247
260
|
readReservation(userId: string, mintKey: string, nowMs: number): Promise<DelegationCapRecord | undefined>;
|
|
248
261
|
/**
|
|
@@ -257,6 +270,10 @@ export interface DelegationCapStore {
|
|
|
257
270
|
* reservation unable to authorise anything. THROWS when the store cannot be read.
|
|
258
271
|
*/
|
|
259
272
|
readActive(userId: string, nowMs: number): Promise<DelegationCapRecord | undefined>;
|
|
273
|
+
/** Optional for legacy callers; sponsored sends require it. Hold the cap writer lock from current
|
|
274
|
+
* authority comparison through synchronous request invocation, then release without awaiting I/O.
|
|
275
|
+
* The clock is sampled AFTER lock acquisition, so waiting cannot revive an expired grant. */
|
|
276
|
+
withCurrentActiveCap?<T>(expected: DelegationCapHandoffAuthority, now: () => number, start: () => T): T;
|
|
260
277
|
/**
|
|
261
278
|
* Mark the confirmed-active record for this user REVOKED, but only when it is the grant at
|
|
262
279
|
* `expiresAt`. Per-grant by construction: a revoke aimed at a permission that is no longer the live
|
|
@@ -295,8 +312,8 @@ export interface DelegationCapStore {
|
|
|
295
312
|
*
|
|
296
313
|
* It takes NO expiry, deliberately. A Stop means "Otto acts under nothing for me": the record that is
|
|
297
314
|
* live goes, whatever tab pressed the button and whatever grant Coinbase happens to hold — exactly what
|
|
298
|
-
* the CDP-side revoke that follows it does. `revoke` above
|
|
299
|
-
*
|
|
315
|
+
* the CDP-side revoke that follows it does. `revoke` above remains as a narrowly scoped per-grant store
|
|
316
|
+
* primitive; confirm refusals do not call it or CDP's user-wide revoke.
|
|
300
317
|
*
|
|
301
318
|
* Answers the generation now in force and the instant of the record it revoked, if any.
|
|
302
319
|
*/
|
|
@@ -32,8 +32,9 @@
|
|
|
32
32
|
* gate's own minimum safe model —
|
|
33
33
|
*
|
|
34
34
|
* reserved ──confirm──▶ confirmed_active ──┬──▶ superseded (a later confirm won)
|
|
35
|
-
* │ ├──▶ revoked (the person
|
|
36
|
-
*
|
|
35
|
+
* │ ├──▶ revoked (the person pressed Stop)
|
|
36
|
+
* ├──mismatch──▶ refused/unconfirmed └──▶ (expiry passes)
|
|
37
|
+
* └──10 min──▶ expired
|
|
37
38
|
*
|
|
38
39
|
* — and made ONE thing authoritative: `readActive`. A reserved row authorises NOTHING; the send gate
|
|
39
40
|
* reads the confirmed-active record and requires its expiry to equal the live grant's.
|
|
@@ -128,6 +129,12 @@ export function resolveDelegationMintEnabled(env = process.env) {
|
|
|
128
129
|
}
|
|
129
130
|
/** The one sentence every paused surface says. No security narration: it is an update, and it is short. */
|
|
130
131
|
export const DELEGATION_MINT_PAUSED_MESSAGE = 'Delegation is paused for a few minutes while we update it';
|
|
132
|
+
/** New Model B trading grants are retired. Status, confirm, revoke and exits remain available. */
|
|
133
|
+
export const DELEGATION_TRADE_MINT_RETIRED_MESSAGE = 'Otto no longer creates new Model B trading permissions. Existing permissions remain visible and revocable; use your wallet to sign new actions.';
|
|
134
|
+
/** The Model B reserve may run only when both the global and trade-specific gates allow it. */
|
|
135
|
+
export function effectiveTradeMintEnabled(switches) {
|
|
136
|
+
return switches.mintEnabled === true && switches.tradeMintEnabled === true;
|
|
137
|
+
}
|
|
131
138
|
/**
|
|
132
139
|
* The shape a mint key must have: what `createDelegation({ idempotencyKey })` accepts, bounded so it
|
|
133
140
|
* cannot be used as a path or a smuggling channel. A UUID satisfies it.
|
|
@@ -187,6 +194,15 @@ export class DelegationCapExpiryUnavailableError extends Error {
|
|
|
187
194
|
this.name = 'DelegationCapExpiryUnavailableError';
|
|
188
195
|
}
|
|
189
196
|
}
|
|
197
|
+
function assertCapHandoff(record, generation, expected, nowMs) {
|
|
198
|
+
if (!Number.isSafeInteger(nowMs) || nowMs < 0 || !record || record.state !== 'confirmed_active' ||
|
|
199
|
+
record.userId !== expected.userId || record.mintKey !== expected.mintKey ||
|
|
200
|
+
record.requiredVersion !== MODEL_B_CAP_RULESET_VERSION || record.requiredVersion !== expected.requiredVersion ||
|
|
201
|
+
record.perSwapCapUsd !== expected.perSwapCapUsd || record.revokeGeneration !== generation ||
|
|
202
|
+
generation !== expected.revokeGeneration || Date.parse(record.expiresAt) !== Date.parse(expected.expiresAt) ||
|
|
203
|
+
Date.parse(record.expiresAt) <= nowMs)
|
|
204
|
+
throw new Error('SPONSOR_STOP_OR_CAP_CHANGED');
|
|
205
|
+
}
|
|
190
206
|
/* ------------------------------------------------------------------ *
|
|
191
207
|
* Paths and pure helpers.
|
|
192
208
|
* ------------------------------------------------------------------ */
|
|
@@ -477,6 +493,15 @@ class SqliteDelegationCapStore {
|
|
|
477
493
|
return Promise.reject(error);
|
|
478
494
|
}
|
|
479
495
|
}
|
|
496
|
+
readRevokeGeneration(userId) {
|
|
497
|
+
try {
|
|
498
|
+
assertIdentifiers(userId);
|
|
499
|
+
return Promise.resolve(this.#readGeneration(userId));
|
|
500
|
+
}
|
|
501
|
+
catch (error) {
|
|
502
|
+
return Promise.reject(error);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
480
505
|
stop(userId, nowMs) {
|
|
481
506
|
try {
|
|
482
507
|
assertIdentifiers(userId);
|
|
@@ -508,9 +533,12 @@ class SqliteDelegationCapStore {
|
|
|
508
533
|
throw new CorruptCapRecordError('active_grants');
|
|
509
534
|
return { mintKey: row.mint_key, expiresAtMs };
|
|
510
535
|
}
|
|
511
|
-
reserve(userId, mintKey, latestExpiresAt, perSwapCapUsd, nowMs) {
|
|
536
|
+
reserve(userId, mintKey, latestExpiresAt, perSwapCapUsd, nowMs, expectedRevokeGeneration) {
|
|
512
537
|
try {
|
|
513
538
|
assertIdentifiers(userId, mintKey);
|
|
539
|
+
if (expectedRevokeGeneration !== undefined &&
|
|
540
|
+
(!Number.isSafeInteger(expectedRevokeGeneration) || expectedRevokeGeneration < 0))
|
|
541
|
+
throw new Error('invalid expected revoke generation');
|
|
514
542
|
const latestMs = Date.parse(latestExpiresAt);
|
|
515
543
|
if (!Number.isFinite(latestMs))
|
|
516
544
|
throw new Error('the requested expiry is not a parseable instant');
|
|
@@ -535,7 +563,10 @@ class SqliteDelegationCapStore {
|
|
|
535
563
|
// The generation in force RIGHT NOW, read inside the same transaction: a Stop that lands
|
|
536
564
|
// after this reservation is written is what cancels it, and one that landed before is
|
|
537
565
|
// already reflected here.
|
|
538
|
-
|
|
566
|
+
// The admin path samples before taking the cross-kind claim. Persist that earlier generation
|
|
567
|
+
// even if Stop commits before this separate database transaction: confirm then classifies the
|
|
568
|
+
// row as cancelled, and an idempotent same-key retry cannot revive it under a newer generation.
|
|
569
|
+
const generation = expectedRevokeGeneration ?? this.#readGeneration(userId);
|
|
539
570
|
const insert = this.db.prepare(`INSERT INTO reservations
|
|
540
571
|
(user_id, mint_key, expires_at_ms, requested_expires_at_ms, cap_usd, required_version, state, reserved_at_ms, revoke_generation)
|
|
541
572
|
VALUES (?, ?, ?, ?, ?, ?, 'reserved', ?, ?)
|
|
@@ -613,7 +644,7 @@ class SqliteDelegationCapStore {
|
|
|
613
644
|
}
|
|
614
645
|
/**
|
|
615
646
|
* 🔴 A SETTLED RECORD IS NEVER BROUGHT BACK. `superseded` (a later confirmation won) and
|
|
616
|
-
* `revoked` (the person
|
|
647
|
+
* `revoked` (the person pressed Stop) are terminal: promoting either would resurrect a
|
|
617
648
|
* permission that was deliberately replaced or taken away. `expired` and `legacy` are their
|
|
618
649
|
* own answers because the remedy differs — nothing was ever confirmed, so the person mints
|
|
619
650
|
* again.
|
|
@@ -684,6 +715,27 @@ class SqliteDelegationCapStore {
|
|
|
684
715
|
return Promise.reject(error);
|
|
685
716
|
}
|
|
686
717
|
}
|
|
718
|
+
withCurrentActiveCap(expected, now, start) {
|
|
719
|
+
assertIdentifiers(expected.userId, expected.mintKey);
|
|
720
|
+
let pending;
|
|
721
|
+
try {
|
|
722
|
+
return this.#transact(() => {
|
|
723
|
+
const pointer = this.#readActiveRow(expected.userId);
|
|
724
|
+
const record = pointer ? this.#readByMintKey(expected.userId, pointer.mintKey) : undefined;
|
|
725
|
+
if (pointer && (!record || Date.parse(record.expiresAt) !== pointer.expiresAtMs))
|
|
726
|
+
throw new Error('SPONSOR_STOP_OR_CAP_CHANGED');
|
|
727
|
+
assertCapHandoff(record, this.#readGeneration(expected.userId), expected, now());
|
|
728
|
+
pending = start();
|
|
729
|
+
return pending;
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
catch (error) {
|
|
733
|
+
// A failed commit cannot retract an already invoked network request.
|
|
734
|
+
if (pending !== undefined)
|
|
735
|
+
void Promise.resolve(pending).catch(() => undefined);
|
|
736
|
+
throw error;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
687
739
|
readActive(userId, nowMs) {
|
|
688
740
|
try {
|
|
689
741
|
assertIdentifiers(userId);
|
|
@@ -862,6 +914,7 @@ export function unavailableDelegationCapStore(reason) {
|
|
|
862
914
|
return Object.freeze({
|
|
863
915
|
available: false,
|
|
864
916
|
unavailableReason: reason,
|
|
917
|
+
readRevokeGeneration: dead,
|
|
865
918
|
reserve: dead,
|
|
866
919
|
readReservation: dead,
|
|
867
920
|
confirm: dead,
|
|
@@ -960,7 +1013,16 @@ export function inMemoryDelegationCapStore(seed = []) {
|
|
|
960
1013
|
};
|
|
961
1014
|
const store = {
|
|
962
1015
|
available: true,
|
|
963
|
-
|
|
1016
|
+
readRevokeGeneration(userId) {
|
|
1017
|
+
try {
|
|
1018
|
+
assertIdentifiers(userId);
|
|
1019
|
+
}
|
|
1020
|
+
catch (error) {
|
|
1021
|
+
return Promise.reject(error);
|
|
1022
|
+
}
|
|
1023
|
+
return Promise.resolve(generations.get(userId) ?? 0);
|
|
1024
|
+
},
|
|
1025
|
+
reserve(userId, mintKey, latestExpiresAt, perSwapCapUsd, nowMs, expectedRevokeGeneration) {
|
|
964
1026
|
try {
|
|
965
1027
|
assertIdentifiers(userId, mintKey);
|
|
966
1028
|
}
|
|
@@ -983,7 +1045,7 @@ export function inMemoryDelegationCapStore(seed = []) {
|
|
|
983
1045
|
requestedExpiresAt: new Date(chosen + MINT_EXPIRY_FILLER_MS).toISOString(),
|
|
984
1046
|
perSwapCapUsd,
|
|
985
1047
|
requiredVersion: MODEL_B_CAP_RULESET_VERSION,
|
|
986
|
-
revokeGeneration: generations.get(userId) ?? 0,
|
|
1048
|
+
revokeGeneration: expectedRevokeGeneration ?? generations.get(userId) ?? 0,
|
|
987
1049
|
state: 'reserved',
|
|
988
1050
|
reservedAt: new Date(nowMs).toISOString(),
|
|
989
1051
|
});
|
|
@@ -1032,6 +1094,11 @@ export function inMemoryDelegationCapStore(seed = []) {
|
|
|
1032
1094
|
active.set(userId, confirmed);
|
|
1033
1095
|
return Promise.resolve({ outcome: 'confirmed', record: confirmed });
|
|
1034
1096
|
},
|
|
1097
|
+
withCurrentActiveCap(expected, now, start) {
|
|
1098
|
+
assertIdentifiers(expected.userId, expected.mintKey);
|
|
1099
|
+
assertCapHandoff(active.get(expected.userId), generations.get(expected.userId) ?? 0, expected, now());
|
|
1100
|
+
return start();
|
|
1101
|
+
},
|
|
1035
1102
|
readActive(userId, nowMs) {
|
|
1036
1103
|
const record = active.get(userId);
|
|
1037
1104
|
if (!record || record.state !== 'confirmed_active')
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const DELEGATION_EXIT_TOOL_NAME: "otto_delegation_exit";
|
|
3
|
+
export declare const DELEGATION_EXIT_CHAIN_ID: 8453;
|
|
4
|
+
export declare const DELEGATION_EXIT_USDC: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
5
|
+
export declare const DELEGATION_EXIT_STATES: readonly ["preparing", "signing", "signed", "submitted", "unknown", "confirmed", "reverted", "replaced", "canceled"];
|
|
6
|
+
export declare const DELEGATION_EXIT_INPUT_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
|
+
phase: z.ZodLiteral<"prepare">;
|
|
8
|
+
accessToken: z.ZodString;
|
|
9
|
+
account: z.ZodString;
|
|
10
|
+
destination: z.ZodString;
|
|
11
|
+
amountAtomic: z.ZodString;
|
|
12
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
13
|
+
phase: z.ZodLiteral<"resume">;
|
|
14
|
+
accessToken: z.ZodString;
|
|
15
|
+
operationId: z.ZodString;
|
|
16
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
17
|
+
phase: z.ZodLiteral<"submit">;
|
|
18
|
+
accessToken: z.ZodString;
|
|
19
|
+
operationId: z.ZodString;
|
|
20
|
+
epoch: z.ZodNumber;
|
|
21
|
+
ownerToken: z.ZodString;
|
|
22
|
+
signedTransaction: z.ZodString;
|
|
23
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
24
|
+
phase: z.ZodLiteral<"status">;
|
|
25
|
+
accessToken: z.ZodString;
|
|
26
|
+
operationId: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
28
|
+
phase: z.ZodLiteral<"reconcile">;
|
|
29
|
+
accessToken: z.ZodString;
|
|
30
|
+
operationId: z.ZodString;
|
|
31
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
32
|
+
phase: z.ZodLiteral<"retry_same">;
|
|
33
|
+
accessToken: z.ZodString;
|
|
34
|
+
operationId: z.ZodString;
|
|
35
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
36
|
+
phase: z.ZodLiteral<"cancel">;
|
|
37
|
+
accessToken: z.ZodString;
|
|
38
|
+
operationId: z.ZodString;
|
|
39
|
+
epoch: z.ZodNumber;
|
|
40
|
+
ownerToken: z.ZodString;
|
|
41
|
+
}, z.core.$strict>], "phase">;
|
|
42
|
+
export declare const DELEGATION_EXIT_TRANSACTION_SCHEMA: z.ZodObject<{
|
|
43
|
+
type: z.ZodLiteral<"eip1559">;
|
|
44
|
+
chain_id: z.ZodLiteral<8453>;
|
|
45
|
+
nonce: z.ZodString;
|
|
46
|
+
from: z.ZodString;
|
|
47
|
+
to: z.ZodLiteral<"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913">;
|
|
48
|
+
value: z.ZodLiteral<"0">;
|
|
49
|
+
data: z.ZodString;
|
|
50
|
+
gas: z.ZodString;
|
|
51
|
+
max_fee_per_gas: z.ZodString;
|
|
52
|
+
max_priority_fee_per_gas: z.ZodString;
|
|
53
|
+
sign_idempotency_key: z.ZodString;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
export declare const DELEGATION_EXIT_RECORD_RESULT_SCHEMA: z.ZodObject<{
|
|
56
|
+
phase: z.ZodEnum<{
|
|
57
|
+
status: "status";
|
|
58
|
+
prepare: "prepare";
|
|
59
|
+
resume: "resume";
|
|
60
|
+
submit: "submit";
|
|
61
|
+
reconcile: "reconcile";
|
|
62
|
+
retry_same: "retry_same";
|
|
63
|
+
cancel: "cancel";
|
|
64
|
+
}>;
|
|
65
|
+
has_exit: z.ZodLiteral<true>;
|
|
66
|
+
user_id: z.ZodString;
|
|
67
|
+
operation_id: z.ZodString;
|
|
68
|
+
state: z.ZodEnum<{
|
|
69
|
+
unknown: "unknown";
|
|
70
|
+
confirmed: "confirmed";
|
|
71
|
+
reverted: "reverted";
|
|
72
|
+
submitted: "submitted";
|
|
73
|
+
signing: "signing";
|
|
74
|
+
preparing: "preparing";
|
|
75
|
+
signed: "signed";
|
|
76
|
+
replaced: "replaced";
|
|
77
|
+
canceled: "canceled";
|
|
78
|
+
}>;
|
|
79
|
+
epoch: z.ZodNumber;
|
|
80
|
+
account: z.ZodString;
|
|
81
|
+
destination: z.ZodString;
|
|
82
|
+
amount_atomic: z.ZodString;
|
|
83
|
+
created_at: z.ZodString;
|
|
84
|
+
updated_at: z.ZodString;
|
|
85
|
+
lease_expires_at: z.ZodOptional<z.ZodString>;
|
|
86
|
+
owner_token: z.ZodOptional<z.ZodString>;
|
|
87
|
+
transaction: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
type: z.ZodLiteral<"eip1559">;
|
|
89
|
+
chain_id: z.ZodLiteral<8453>;
|
|
90
|
+
nonce: z.ZodString;
|
|
91
|
+
from: z.ZodString;
|
|
92
|
+
to: z.ZodLiteral<"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913">;
|
|
93
|
+
value: z.ZodLiteral<"0">;
|
|
94
|
+
data: z.ZodString;
|
|
95
|
+
gas: z.ZodString;
|
|
96
|
+
max_fee_per_gas: z.ZodString;
|
|
97
|
+
max_priority_fee_per_gas: z.ZodString;
|
|
98
|
+
sign_idempotency_key: z.ZodString;
|
|
99
|
+
}, z.core.$strict>>;
|
|
100
|
+
transaction_hash: z.ZodOptional<z.ZodString>;
|
|
101
|
+
broadcast_attempts: z.ZodNumber;
|
|
102
|
+
receipt: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
transaction_hash: z.ZodString;
|
|
104
|
+
block_number: z.ZodString;
|
|
105
|
+
block_hash: z.ZodString;
|
|
106
|
+
status: z.ZodEnum<{
|
|
107
|
+
success: "success";
|
|
108
|
+
reverted: "reverted";
|
|
109
|
+
}>;
|
|
110
|
+
}, z.core.$strict>>;
|
|
111
|
+
replacement: z.ZodOptional<z.ZodObject<{
|
|
112
|
+
transaction_hash: z.ZodString;
|
|
113
|
+
block_number: z.ZodString;
|
|
114
|
+
block_hash: z.ZodString;
|
|
115
|
+
finalized_head_block_number: z.ZodString;
|
|
116
|
+
finalized_head_block_hash: z.ZodString;
|
|
117
|
+
finalized_nonce: z.ZodString;
|
|
118
|
+
}, z.core.$strict>>;
|
|
119
|
+
}, z.core.$strict>;
|
|
120
|
+
export declare const DELEGATION_EXIT_NONE_RESULT_SCHEMA: z.ZodObject<{
|
|
121
|
+
phase: z.ZodLiteral<"status">;
|
|
122
|
+
user_id: z.ZodString;
|
|
123
|
+
has_exit: z.ZodLiteral<false>;
|
|
124
|
+
}, z.core.$strict>;
|
|
125
|
+
/** `status` without an operationId returns this explicit idle variant when no exit exists. */
|
|
126
|
+
export declare const DELEGATION_EXIT_RESULT_SCHEMA: z.ZodUnion<readonly [z.ZodObject<{
|
|
127
|
+
phase: z.ZodEnum<{
|
|
128
|
+
status: "status";
|
|
129
|
+
prepare: "prepare";
|
|
130
|
+
resume: "resume";
|
|
131
|
+
submit: "submit";
|
|
132
|
+
reconcile: "reconcile";
|
|
133
|
+
retry_same: "retry_same";
|
|
134
|
+
cancel: "cancel";
|
|
135
|
+
}>;
|
|
136
|
+
has_exit: z.ZodLiteral<true>;
|
|
137
|
+
user_id: z.ZodString;
|
|
138
|
+
operation_id: z.ZodString;
|
|
139
|
+
state: z.ZodEnum<{
|
|
140
|
+
unknown: "unknown";
|
|
141
|
+
confirmed: "confirmed";
|
|
142
|
+
reverted: "reverted";
|
|
143
|
+
submitted: "submitted";
|
|
144
|
+
signing: "signing";
|
|
145
|
+
preparing: "preparing";
|
|
146
|
+
signed: "signed";
|
|
147
|
+
replaced: "replaced";
|
|
148
|
+
canceled: "canceled";
|
|
149
|
+
}>;
|
|
150
|
+
epoch: z.ZodNumber;
|
|
151
|
+
account: z.ZodString;
|
|
152
|
+
destination: z.ZodString;
|
|
153
|
+
amount_atomic: z.ZodString;
|
|
154
|
+
created_at: z.ZodString;
|
|
155
|
+
updated_at: z.ZodString;
|
|
156
|
+
lease_expires_at: z.ZodOptional<z.ZodString>;
|
|
157
|
+
owner_token: z.ZodOptional<z.ZodString>;
|
|
158
|
+
transaction: z.ZodOptional<z.ZodObject<{
|
|
159
|
+
type: z.ZodLiteral<"eip1559">;
|
|
160
|
+
chain_id: z.ZodLiteral<8453>;
|
|
161
|
+
nonce: z.ZodString;
|
|
162
|
+
from: z.ZodString;
|
|
163
|
+
to: z.ZodLiteral<"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913">;
|
|
164
|
+
value: z.ZodLiteral<"0">;
|
|
165
|
+
data: z.ZodString;
|
|
166
|
+
gas: z.ZodString;
|
|
167
|
+
max_fee_per_gas: z.ZodString;
|
|
168
|
+
max_priority_fee_per_gas: z.ZodString;
|
|
169
|
+
sign_idempotency_key: z.ZodString;
|
|
170
|
+
}, z.core.$strict>>;
|
|
171
|
+
transaction_hash: z.ZodOptional<z.ZodString>;
|
|
172
|
+
broadcast_attempts: z.ZodNumber;
|
|
173
|
+
receipt: z.ZodOptional<z.ZodObject<{
|
|
174
|
+
transaction_hash: z.ZodString;
|
|
175
|
+
block_number: z.ZodString;
|
|
176
|
+
block_hash: z.ZodString;
|
|
177
|
+
status: z.ZodEnum<{
|
|
178
|
+
success: "success";
|
|
179
|
+
reverted: "reverted";
|
|
180
|
+
}>;
|
|
181
|
+
}, z.core.$strict>>;
|
|
182
|
+
replacement: z.ZodOptional<z.ZodObject<{
|
|
183
|
+
transaction_hash: z.ZodString;
|
|
184
|
+
block_number: z.ZodString;
|
|
185
|
+
block_hash: z.ZodString;
|
|
186
|
+
finalized_head_block_number: z.ZodString;
|
|
187
|
+
finalized_head_block_hash: z.ZodString;
|
|
188
|
+
finalized_nonce: z.ZodString;
|
|
189
|
+
}, z.core.$strict>>;
|
|
190
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
191
|
+
phase: z.ZodLiteral<"status">;
|
|
192
|
+
user_id: z.ZodString;
|
|
193
|
+
has_exit: z.ZodLiteral<false>;
|
|
194
|
+
}, z.core.$strict>]>;
|
|
195
|
+
export type DelegationExitInput = z.infer<typeof DELEGATION_EXIT_INPUT_SCHEMA>;
|
|
196
|
+
export type DelegationExitResult = z.infer<typeof DELEGATION_EXIT_RESULT_SCHEMA>;
|
|
197
|
+
export declare const DELEGATION_EXIT_TOOL_DEFINITION: Readonly<{
|
|
198
|
+
name: "otto_delegation_exit";
|
|
199
|
+
title: "Prepare, submit, and recover an exact Base USDC exit";
|
|
200
|
+
description: "Move an authenticated CDP end user's own Base USDC only through a server-held durable reservation. prepare returns one exact EIP-1559 transaction for client-side signing; the client must never broadcast it. submit validates and durably records the signed bytes and computed hash before the server broadcasts. status is read-only and cross-device. reconcile proves a canonical receipt without broadcasting, or returns the exact finalized sender+nonce replacement proof when another transaction consumed the reserved nonce. retry_same is explicit and can broadcast only the already-stored byte-identical transaction after reconciling first. cancel is accepted only before signed bytes were recorded. The caller presents Otto's delegation secret in x-otto-delegation-auth; user identity is always derived from accessToken.";
|
|
201
|
+
inputSchema: z.ZodObject<{}, z.core.$loose>;
|
|
202
|
+
strictInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
203
|
+
phase: z.ZodLiteral<"prepare">;
|
|
204
|
+
accessToken: z.ZodString;
|
|
205
|
+
account: z.ZodString;
|
|
206
|
+
destination: z.ZodString;
|
|
207
|
+
amountAtomic: z.ZodString;
|
|
208
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
209
|
+
phase: z.ZodLiteral<"resume">;
|
|
210
|
+
accessToken: z.ZodString;
|
|
211
|
+
operationId: z.ZodString;
|
|
212
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
213
|
+
phase: z.ZodLiteral<"submit">;
|
|
214
|
+
accessToken: z.ZodString;
|
|
215
|
+
operationId: z.ZodString;
|
|
216
|
+
epoch: z.ZodNumber;
|
|
217
|
+
ownerToken: z.ZodString;
|
|
218
|
+
signedTransaction: z.ZodString;
|
|
219
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
220
|
+
phase: z.ZodLiteral<"status">;
|
|
221
|
+
accessToken: z.ZodString;
|
|
222
|
+
operationId: z.ZodOptional<z.ZodString>;
|
|
223
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
224
|
+
phase: z.ZodLiteral<"reconcile">;
|
|
225
|
+
accessToken: z.ZodString;
|
|
226
|
+
operationId: z.ZodString;
|
|
227
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
228
|
+
phase: z.ZodLiteral<"retry_same">;
|
|
229
|
+
accessToken: z.ZodString;
|
|
230
|
+
operationId: z.ZodString;
|
|
231
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
232
|
+
phase: z.ZodLiteral<"cancel">;
|
|
233
|
+
accessToken: z.ZodString;
|
|
234
|
+
operationId: z.ZodString;
|
|
235
|
+
epoch: z.ZodNumber;
|
|
236
|
+
ownerToken: z.ZodString;
|
|
237
|
+
}, z.core.$strict>], "phase">;
|
|
238
|
+
outputSchema: z.ZodObject<{
|
|
239
|
+
operation_id: z.ZodOptional<z.ZodString>;
|
|
240
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
241
|
+
unknown: "unknown";
|
|
242
|
+
confirmed: "confirmed";
|
|
243
|
+
reverted: "reverted";
|
|
244
|
+
submitted: "submitted";
|
|
245
|
+
signing: "signing";
|
|
246
|
+
preparing: "preparing";
|
|
247
|
+
signed: "signed";
|
|
248
|
+
replaced: "replaced";
|
|
249
|
+
canceled: "canceled";
|
|
250
|
+
}>>;
|
|
251
|
+
epoch: z.ZodOptional<z.ZodNumber>;
|
|
252
|
+
account: z.ZodOptional<z.ZodString>;
|
|
253
|
+
destination: z.ZodOptional<z.ZodString>;
|
|
254
|
+
amount_atomic: z.ZodOptional<z.ZodString>;
|
|
255
|
+
created_at: z.ZodOptional<z.ZodString>;
|
|
256
|
+
updated_at: z.ZodOptional<z.ZodString>;
|
|
257
|
+
lease_expires_at: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
258
|
+
owner_token: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
259
|
+
transaction: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
260
|
+
type: z.ZodLiteral<"eip1559">;
|
|
261
|
+
chain_id: z.ZodLiteral<8453>;
|
|
262
|
+
nonce: z.ZodString;
|
|
263
|
+
from: z.ZodString;
|
|
264
|
+
to: z.ZodLiteral<"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913">;
|
|
265
|
+
value: z.ZodLiteral<"0">;
|
|
266
|
+
data: z.ZodString;
|
|
267
|
+
gas: z.ZodString;
|
|
268
|
+
max_fee_per_gas: z.ZodString;
|
|
269
|
+
max_priority_fee_per_gas: z.ZodString;
|
|
270
|
+
sign_idempotency_key: z.ZodString;
|
|
271
|
+
}, z.core.$strict>>>;
|
|
272
|
+
transaction_hash: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
273
|
+
broadcast_attempts: z.ZodOptional<z.ZodNumber>;
|
|
274
|
+
receipt: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
275
|
+
transaction_hash: z.ZodString;
|
|
276
|
+
block_number: z.ZodString;
|
|
277
|
+
block_hash: z.ZodString;
|
|
278
|
+
status: z.ZodEnum<{
|
|
279
|
+
success: "success";
|
|
280
|
+
reverted: "reverted";
|
|
281
|
+
}>;
|
|
282
|
+
}, z.core.$strict>>>;
|
|
283
|
+
replacement: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
284
|
+
transaction_hash: z.ZodString;
|
|
285
|
+
block_number: z.ZodString;
|
|
286
|
+
block_hash: z.ZodString;
|
|
287
|
+
finalized_head_block_number: z.ZodString;
|
|
288
|
+
finalized_head_block_hash: z.ZodString;
|
|
289
|
+
finalized_nonce: z.ZodString;
|
|
290
|
+
}, z.core.$strict>>>;
|
|
291
|
+
phase: z.ZodEnum<{
|
|
292
|
+
status: "status";
|
|
293
|
+
prepare: "prepare";
|
|
294
|
+
resume: "resume";
|
|
295
|
+
submit: "submit";
|
|
296
|
+
reconcile: "reconcile";
|
|
297
|
+
retry_same: "retry_same";
|
|
298
|
+
cancel: "cancel";
|
|
299
|
+
}>;
|
|
300
|
+
user_id: z.ZodString;
|
|
301
|
+
has_exit: z.ZodBoolean;
|
|
302
|
+
}, z.core.$strict>;
|
|
303
|
+
annotations: Readonly<{
|
|
304
|
+
readOnlyHint: false;
|
|
305
|
+
destructiveHint: true;
|
|
306
|
+
idempotentHint: false;
|
|
307
|
+
openWorldHint: true;
|
|
308
|
+
}>;
|
|
309
|
+
}>;
|