@bananapus/nana-sdk-core 2.20.0 → 2.22.0
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/dist/cjs/bendystrawOperations.d.ts +4 -1
- package/dist/cjs/bendystrawOperations.d.ts.map +1 -1
- package/dist/cjs/bendystrawOperations.js +4 -1
- package/dist/cjs/bendystrawOperations.js.map +1 -1
- package/dist/cjs/jbcenter/ensureDeployed.d.ts +5 -0
- package/dist/cjs/jbcenter/ensureDeployed.d.ts.map +1 -1
- package/dist/cjs/jbcenter/ensureDeployed.js +13 -15
- package/dist/cjs/jbcenter/ensureDeployed.js.map +1 -1
- package/dist/cjs/jbcenter/rateLimit.d.ts +80 -0
- package/dist/cjs/jbcenter/rateLimit.d.ts.map +1 -0
- package/dist/cjs/jbcenter/rateLimit.js +158 -0
- package/dist/cjs/jbcenter/rateLimit.js.map +1 -0
- package/dist/cjs/jbcenter.d.ts +47 -5
- package/dist/cjs/jbcenter.d.ts.map +1 -1
- package/dist/cjs/jbcenter.js +57 -8
- package/dist/cjs/jbcenter.js.map +1 -1
- package/dist/cjs/pause.d.ts +6 -0
- package/dist/cjs/pause.d.ts.map +1 -0
- package/dist/cjs/pause.js +25 -0
- package/dist/cjs/pause.js.map +1 -0
- package/dist/cjs/review/relayr.d.ts +200 -0
- package/dist/cjs/review/relayr.d.ts.map +1 -1
- package/dist/cjs/review/relayr.js +260 -5
- package/dist/cjs/review/relayr.js.map +1 -1
- package/dist/cjs/safeService.d.ts +23 -9
- package/dist/cjs/safeService.d.ts.map +1 -1
- package/dist/cjs/safeService.js +77 -37
- package/dist/cjs/safeService.js.map +1 -1
- package/dist/esm/bendystrawOperations.d.ts +4 -1
- package/dist/esm/bendystrawOperations.d.ts.map +1 -1
- package/dist/esm/bendystrawOperations.js +4 -1
- package/dist/esm/bendystrawOperations.js.map +1 -1
- package/dist/esm/jbcenter/ensureDeployed.d.ts +5 -0
- package/dist/esm/jbcenter/ensureDeployed.d.ts.map +1 -1
- package/dist/esm/jbcenter/ensureDeployed.js +13 -15
- package/dist/esm/jbcenter/ensureDeployed.js.map +1 -1
- package/dist/esm/jbcenter/rateLimit.d.ts +80 -0
- package/dist/esm/jbcenter/rateLimit.d.ts.map +1 -0
- package/dist/esm/jbcenter/rateLimit.js +151 -0
- package/dist/esm/jbcenter/rateLimit.js.map +1 -0
- package/dist/esm/jbcenter.d.ts +47 -5
- package/dist/esm/jbcenter.d.ts.map +1 -1
- package/dist/esm/jbcenter.js +51 -7
- package/dist/esm/jbcenter.js.map +1 -1
- package/dist/esm/pause.d.ts +6 -0
- package/dist/esm/pause.d.ts.map +1 -0
- package/dist/esm/pause.js +22 -0
- package/dist/esm/pause.js.map +1 -0
- package/dist/esm/review/relayr.d.ts +200 -0
- package/dist/esm/review/relayr.d.ts.map +1 -1
- package/dist/esm/review/relayr.js +253 -6
- package/dist/esm/review/relayr.js.map +1 -1
- package/dist/esm/safeService.d.ts +23 -9
- package/dist/esm/safeService.d.ts.map +1 -1
- package/dist/esm/safeService.js +75 -35
- package/dist/esm/safeService.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Address, type Hex, type PublicClient, type TransactionReceipt } from "viem";
|
|
2
|
+
import { erc2771ForwarderAbi } from "../generated/juicebox.js";
|
|
2
3
|
/** Relayr's HTTP API. */
|
|
3
4
|
export declare const RELAYR_API = "https://api.relayr.ba5ed.com";
|
|
4
5
|
/**
|
|
@@ -448,5 +449,204 @@ export declare function verifyRelayrDestinations(clientFor: (chainId: number) =>
|
|
|
448
449
|
records: readonly RelayrTransactionRecord[];
|
|
449
450
|
account?: Address;
|
|
450
451
|
}): Promise<RelayrVerifiedDestination[]>;
|
|
452
|
+
/**
|
|
453
|
+
* The reads that classify signed forward requests at a canonical finalized
|
|
454
|
+
* block. Typed by the fields they read, so a PublicClient for any chain, with
|
|
455
|
+
* that chain's formatters, satisfies it.
|
|
456
|
+
*/
|
|
457
|
+
export type RelayrFinalizedClient = {
|
|
458
|
+
getBlock(args: {
|
|
459
|
+
blockTag: "finalized";
|
|
460
|
+
}): Promise<{
|
|
461
|
+
number: bigint | null;
|
|
462
|
+
hash: Hex | null;
|
|
463
|
+
timestamp: bigint;
|
|
464
|
+
}>;
|
|
465
|
+
getBlock(args: {
|
|
466
|
+
blockNumber: bigint;
|
|
467
|
+
}): Promise<{
|
|
468
|
+
hash: Hex | null;
|
|
469
|
+
}>;
|
|
470
|
+
readContract(args: {
|
|
471
|
+
address: Address;
|
|
472
|
+
abi: typeof erc2771ForwarderAbi;
|
|
473
|
+
functionName: "nonces";
|
|
474
|
+
args: readonly [Address];
|
|
475
|
+
blockNumber: bigint;
|
|
476
|
+
}): Promise<bigint>;
|
|
477
|
+
};
|
|
478
|
+
/**
|
|
479
|
+
* A signed forward request as these rules read it: its chain, its signer (the
|
|
480
|
+
* request's `from`, whose forwarder nonce it uses), its deadline in seconds,
|
|
481
|
+
* and the forwarder nonce it was signed with, when that was saved.
|
|
482
|
+
*/
|
|
483
|
+
export type RelayrSignedRequest = {
|
|
484
|
+
chainId: number;
|
|
485
|
+
signer: Address;
|
|
486
|
+
deadline: number | bigint;
|
|
487
|
+
nonce?: string | bigint;
|
|
488
|
+
};
|
|
489
|
+
/**
|
|
490
|
+
* One signed request at a canonical finalized block on its chain (ruling
|
|
491
|
+
* R114). It is dead once the forwarder's nonce for its signer moved past the
|
|
492
|
+
* nonce it was signed with (it, or another request at that nonce, may have
|
|
493
|
+
* run), or once its deadline is strictly earlier than that block's timestamp.
|
|
494
|
+
* `unused`: the nonce still equals the saved one. Anything unknown is live: a
|
|
495
|
+
* failed read, a node without a finalized block, a block no longer canonical,
|
|
496
|
+
* and a request saved without its nonce until its deadline passes.
|
|
497
|
+
*/
|
|
498
|
+
export type RelayrRequestState = {
|
|
499
|
+
live: true;
|
|
500
|
+
deadline: number;
|
|
501
|
+
} | {
|
|
502
|
+
live: false;
|
|
503
|
+
mayHaveRun: boolean;
|
|
504
|
+
unused: boolean;
|
|
505
|
+
};
|
|
506
|
+
/**
|
|
507
|
+
* What a set of requests allows together (ruling R114). While any one is live
|
|
508
|
+
* the set holds until `until`, the deadline of its last live request.
|
|
509
|
+
* `mayHaveRun` says whether a dead one's nonce moved or was never saved, and,
|
|
510
|
+
* once every one is dead, `unused` whether there is at least one and every
|
|
511
|
+
* nonce still equals the saved one.
|
|
512
|
+
*/
|
|
513
|
+
export type RelayrRequestsVerdict = {
|
|
514
|
+
live: true;
|
|
515
|
+
until: number;
|
|
516
|
+
mayHaveRun: boolean;
|
|
517
|
+
} | {
|
|
518
|
+
live: false;
|
|
519
|
+
mayHaveRun: boolean;
|
|
520
|
+
unused: boolean;
|
|
521
|
+
};
|
|
522
|
+
/**
|
|
523
|
+
* Why a session whose requests are all dead can be discarded (ruling R114):
|
|
524
|
+
*
|
|
525
|
+
* - `ran`: a request's nonce moved past the one it was signed with, or the
|
|
526
|
+
* session saved no nonces, so one may have run;
|
|
527
|
+
* - `changed`: none ran, and the action's recheck refuses its calls;
|
|
528
|
+
* - `expired`: none ran, and no recheck could run, as in an account view. The
|
|
529
|
+
* action itself still signs them again at their saved nonces.
|
|
530
|
+
*/
|
|
531
|
+
export type RelayrDiscardReason = "ran" | "changed" | "expired";
|
|
532
|
+
/**
|
|
533
|
+
* What a session whose bundle won't run as signed does next, from its
|
|
534
|
+
* requests' verdict (rulings R104 and R114). Discard ends only the session,
|
|
535
|
+
* never what the action saved.
|
|
536
|
+
*
|
|
537
|
+
* - `hold`: a request can still run and one may already have run. No new
|
|
538
|
+
* signature, no new quote and no Discard until `until`.
|
|
539
|
+
* - `refresh`: a request can still run and none moved (R114 (a)). Until
|
|
540
|
+
* `until`, the session may quote or pay its saved requests again while they
|
|
541
|
+
* still verify and the action's recheck passes, or sign each again at its
|
|
542
|
+
* saved nonce, in `nonces` (null when it saved none): the forwarder runs one
|
|
543
|
+
* request per nonce, so an old request and its refresh never both run. A
|
|
544
|
+
* signature at any other nonce waits until every request is dead.
|
|
545
|
+
* - `re-sign`: every request is dead and unused, and the recheck passed: sign
|
|
546
|
+
* the calls again at `nonces` (R104).
|
|
547
|
+
* - `discard`: every request is dead; Discard for `reason`. With `changed`,
|
|
548
|
+
* `error` is the recheck's refusal.
|
|
549
|
+
* - `reorg-hold`: every request is dead and none moved, but a finalized nonce
|
|
550
|
+
* is below a saved one (a reorg dropped an earlier forwarded transaction),
|
|
551
|
+
* or there are no saved nonces to sign at (`nonces` omitted or empty), or
|
|
552
|
+
* there were no requests. It holds until the nonce catches up.
|
|
553
|
+
* - `unchecked`: the recheck failed because the node could not answer (ruling
|
|
554
|
+
* R118): its cause chain holds a transport or JSON-RPC failure, or a revert
|
|
555
|
+
* without revert data, and no revert data. That decides nothing. Try again.
|
|
556
|
+
*
|
|
557
|
+
* `error` is never enumerable, so no JSON or log of an outcome shows it: an
|
|
558
|
+
* RPC error's URL can carry a key.
|
|
559
|
+
*/
|
|
560
|
+
export type RelayrSessionOutcome = {
|
|
561
|
+
kind: "hold";
|
|
562
|
+
until: number;
|
|
563
|
+
} | {
|
|
564
|
+
kind: "refresh";
|
|
565
|
+
until: number;
|
|
566
|
+
nonces: string[] | null;
|
|
567
|
+
} | {
|
|
568
|
+
kind: "re-sign";
|
|
569
|
+
nonces: string[];
|
|
570
|
+
} | {
|
|
571
|
+
kind: "discard";
|
|
572
|
+
reason: RelayrDiscardReason;
|
|
573
|
+
error?: unknown;
|
|
574
|
+
} | {
|
|
575
|
+
kind: "reorg-hold";
|
|
576
|
+
} | {
|
|
577
|
+
kind: "unchecked";
|
|
578
|
+
error: unknown;
|
|
579
|
+
};
|
|
580
|
+
/**
|
|
581
|
+
* `read` at the chain's finalized block, with that block's timestamp, once
|
|
582
|
+
* the block at its number still has the same hash after the read. Null while
|
|
583
|
+
* any of it cannot be read: a node without the finalized tag, an RPC error, a
|
|
584
|
+
* malformed block, or a block that is no longer canonical.
|
|
585
|
+
*/
|
|
586
|
+
export declare function atCanonicalFinalizedBlock<T>(client: Pick<RelayrFinalizedClient, "getBlock">, read: (blockNumber: bigint) => Promise<T>): Promise<{
|
|
587
|
+
value: T;
|
|
588
|
+
timestamp: bigint;
|
|
589
|
+
} | null>;
|
|
590
|
+
/**
|
|
591
|
+
* The requests a session published, each read from its entry (an `execute`
|
|
592
|
+
* on its chain's canonical forwarder, as {@link relayrForwardRequest} reads
|
|
593
|
+
* it), with the nonce it was signed with when `nonces` has one for every
|
|
594
|
+
* entry. Null when there are none, or one is not such a request: requests
|
|
595
|
+
* that can't be read can't be classified, so they never count as dead.
|
|
596
|
+
*/
|
|
597
|
+
export declare function relayrSignedRequests(entries: readonly Pick<RelayrEntry, "chain" | "target" | "data">[] | undefined, nonces?: readonly (string | bigint)[]): RelayrSignedRequest[] | null;
|
|
598
|
+
/**
|
|
599
|
+
* The one classification of signed forward requests (ruling R114): each at a
|
|
600
|
+
* canonical finalized block on its chain, read once per chain and signer with
|
|
601
|
+
* `clientFor(chainId)`. Never throws for a chain it cannot read: its requests
|
|
602
|
+
* are live.
|
|
603
|
+
*/
|
|
604
|
+
export declare function relayrRequestStates(clientFor: (chainId: number) => RelayrFinalizedClient | undefined, requests: readonly RelayrSignedRequest[]): Promise<RelayrRequestState[]>;
|
|
605
|
+
/**
|
|
606
|
+
* What `states` allow together. No states are neither run nor unused, so a
|
|
607
|
+
* session with none holds.
|
|
608
|
+
*/
|
|
609
|
+
export declare function relayrRequestsVerdict(states: readonly RelayrRequestState[]): RelayrRequestsVerdict;
|
|
610
|
+
/**
|
|
611
|
+
* Ruling R117: whether every request is dead at a canonical finalized block
|
|
612
|
+
* on its chain, anything unknown counting as live. A saved session reserves
|
|
613
|
+
* its signers' forwarder nonces on its chains exactly while one of its
|
|
614
|
+
* requests is live, never by a device clock or a quote's expiry. Requests that
|
|
615
|
+
* can't be classified (null) or none at all are never dead.
|
|
616
|
+
*/
|
|
617
|
+
export declare function relayrRequestsDead(clientFor: (chainId: number) => RelayrFinalizedClient | undefined, requests: readonly RelayrSignedRequest[] | null | undefined): Promise<boolean>;
|
|
618
|
+
/**
|
|
619
|
+
* Whether the chain's finalized block, still canonical, is past `deadline`
|
|
620
|
+
* (seconds, as a safe integer, decimal or 0x-hex digits, or a bigint): its
|
|
621
|
+
* timestamp is later. False while that is unknown, or the deadline can't be
|
|
622
|
+
* read.
|
|
623
|
+
*/
|
|
624
|
+
export declare function relayrDeadlinePassed(client: Pick<RelayrFinalizedClient, "getBlock">, deadline: number | string | bigint): Promise<boolean>;
|
|
625
|
+
/** Whether `value` is a {@link RelayrDiscardReason}, for a reason read back from storage. */
|
|
626
|
+
export declare function isRelayrDiscardReason(value: unknown): value is RelayrDiscardReason;
|
|
627
|
+
/**
|
|
628
|
+
* What a session does next from its requests' `verdict` (see
|
|
629
|
+
* {@link RelayrSessionOutcome}), which was classified before the action's own
|
|
630
|
+
* recheck, since a request that ran would make the recheck refuse.
|
|
631
|
+
*
|
|
632
|
+
* `nonces` must be the saved nonces of exactly the requests that were
|
|
633
|
+
* classified into `verdict`, in the same order: `refresh` and `re-sign` hand
|
|
634
|
+
* them back to sign at, and nothing here can check them against the verdict.
|
|
635
|
+
* Without them (omitted, empty or not a list), a session whose requests are
|
|
636
|
+
* all dead and unused holds as `reorg-hold`, and is neither discarded nor
|
|
637
|
+
* signed again.
|
|
638
|
+
*
|
|
639
|
+
* `recheck`, the action's proof that its calls still apply, resolves when
|
|
640
|
+
* they do and throws when they don't; a value it resolves with is never read.
|
|
641
|
+
* It runs only once every request is dead and unused. Without one, as in an
|
|
642
|
+
* account view, such a session can be discarded as `expired`. A recheck that
|
|
643
|
+
* fails because the node could not answer decides nothing. Known limit: a
|
|
644
|
+
* reorg that drops an earlier forwarded transaction can leave a finalized
|
|
645
|
+
* nonce below a saved one, and the session holds until the nonce catches up.
|
|
646
|
+
*/
|
|
647
|
+
export declare function relayrSessionOutcome(verdict: RelayrRequestsVerdict, { nonces, recheck, }?: {
|
|
648
|
+
nonces?: readonly string[] | null;
|
|
649
|
+
recheck?: () => Promise<void>;
|
|
650
|
+
}): Promise<RelayrSessionOutcome>;
|
|
451
651
|
export {};
|
|
452
652
|
//# sourceMappingURL=relayr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relayr.d.ts","sourceRoot":"","sources":["../../../src/review/relayr.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACxB,MAAM,MAAM,CAAC;AAed,yBAAyB;AACzB,eAAO,MAAM,UAAU,iCAAiC,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EACe,OAAO,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,uBAAuB,eAAe,CAAC;AAEpD,wDAAwD;AACxD,eAAO,MAAM,wBAAwB,EACqC,GAAG,CAAC;AAE9E,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,EACkB,OAAO,CAAC;AAE1D,oDAAoD;AACpD,eAAO,MAAM,kBAAkB,UAAW,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,iCAAiC,QAAe,CAAC;AAE9D,uDAAuD;AACvD,eAAO,MAAM,qBAAqB;;;;;;;;;;;EAQxB,CAAC;AAEX,2DAA2D;AAC3D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;CAUxB,CAAC;AA4BX,+EAA+E;AAC/E,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,4DAA4D;AAC5D,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,CAAC,WAAW,GAAG;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAC1D,kB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EAAE,UAAU,CAAC,EAC/C,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GACjC,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED,6FAA6F;AAC7F,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,mBAAmB,CAE9B;AA0DD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,qBAAqB,EAC9B,EACE,MAAM,EACN,OAAO,GACR,GAAE;IACD,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B,GACL,OAAO,CAAC,oBAAoB,CAAC,CAsB/B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { decodeFunctionData, encodeFunctionData, isAddress, keccak256, } from "viem";
|
|
1
|
+
import { ContractFunctionRevertedError, decodeFunctionData, encodeFunctionData, isAddress, keccak256, RpcError, RpcRequestError, } from "viem";
|
|
2
2
|
import { erc2771ForwarderAbi, jbContractAddress, } from "../generated/juicebox.js";
|
|
3
3
|
import { isBytes32, isHexBytes, uint256 } from "../untrusted.js";
|
|
4
4
|
import { simulateStateChangingTransaction } from "./simulation.js";
|
|
@@ -121,15 +121,19 @@ export class RelayrPaymentRetryError extends Error {
|
|
|
121
121
|
this.name = "RelayrPaymentRetryError";
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
/** `
|
|
125
|
-
function
|
|
126
|
-
Object.defineProperty(
|
|
127
|
-
value
|
|
124
|
+
/** `target` with `key` set to `value`, writable but never enumerable: an RPC error's URL can carry a key, and no JSON or log may show it. */
|
|
125
|
+
function withHidden(target, key, value) {
|
|
126
|
+
Object.defineProperty(target, key, {
|
|
127
|
+
value,
|
|
128
128
|
writable: true,
|
|
129
129
|
enumerable: false,
|
|
130
130
|
configurable: true,
|
|
131
131
|
});
|
|
132
|
-
return
|
|
132
|
+
return target;
|
|
133
|
+
}
|
|
134
|
+
/** `error` with `cause` set like a native error cause, but on ES2021 and never enumerable: an RPC error's URL can carry a key. */
|
|
135
|
+
function withCause(error, cause) {
|
|
136
|
+
return withHidden(error, "cause", cause);
|
|
133
137
|
}
|
|
134
138
|
function errorWithCause(message, cause) {
|
|
135
139
|
return withCause(new Error(message), cause);
|
|
@@ -959,4 +963,247 @@ export async function verifyRelayrDestinations(clientFor, { bindings, records, a
|
|
|
959
963
|
}
|
|
960
964
|
return verified;
|
|
961
965
|
}
|
|
966
|
+
/**
|
|
967
|
+
* `read` at the chain's finalized block, with that block's timestamp, once
|
|
968
|
+
* the block at its number still has the same hash after the read. Null while
|
|
969
|
+
* any of it cannot be read: a node without the finalized tag, an RPC error, a
|
|
970
|
+
* malformed block, or a block that is no longer canonical.
|
|
971
|
+
*/
|
|
972
|
+
export async function atCanonicalFinalizedBlock(client, read) {
|
|
973
|
+
try {
|
|
974
|
+
const { number, hash, timestamp } = await client.getBlock({
|
|
975
|
+
blockTag: "finalized",
|
|
976
|
+
});
|
|
977
|
+
if (typeof number !== "bigint" ||
|
|
978
|
+
!isBytes32(hash) ||
|
|
979
|
+
typeof timestamp !== "bigint") {
|
|
980
|
+
return null;
|
|
981
|
+
}
|
|
982
|
+
const value = await read(number);
|
|
983
|
+
const canonical = await client.getBlock({ blockNumber: number });
|
|
984
|
+
return canonical.hash === hash ? { value, timestamp } : null;
|
|
985
|
+
}
|
|
986
|
+
catch {
|
|
987
|
+
return null;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* The nonce the canonical forwarder on `chainId` expects next from `signer`
|
|
992
|
+
* at the chain's finalized block, still canonical, with that block's
|
|
993
|
+
* timestamp. Null while that cannot be read.
|
|
994
|
+
*/
|
|
995
|
+
async function finalizedForwarderNonce(clientFor, chainId, signer) {
|
|
996
|
+
const forwarder = forwarderOn(chainId);
|
|
997
|
+
if (!forwarder || !isAddressLike(signer))
|
|
998
|
+
return null;
|
|
999
|
+
let client;
|
|
1000
|
+
try {
|
|
1001
|
+
client = clientFor(chainId);
|
|
1002
|
+
}
|
|
1003
|
+
catch {
|
|
1004
|
+
return null;
|
|
1005
|
+
}
|
|
1006
|
+
if (!client)
|
|
1007
|
+
return null;
|
|
1008
|
+
const reader = client;
|
|
1009
|
+
const finalized = await atCanonicalFinalizedBlock(reader, (blockNumber) => reader.readContract({
|
|
1010
|
+
address: forwarder,
|
|
1011
|
+
abi: erc2771ForwarderAbi,
|
|
1012
|
+
functionName: "nonces",
|
|
1013
|
+
args: [signer],
|
|
1014
|
+
blockNumber,
|
|
1015
|
+
}));
|
|
1016
|
+
const nonce = finalized && uint256(finalized.value);
|
|
1017
|
+
return finalized && nonce !== null
|
|
1018
|
+
? { nonce, timestamp: finalized.timestamp }
|
|
1019
|
+
: null;
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* The requests a session published, each read from its entry (an `execute`
|
|
1023
|
+
* on its chain's canonical forwarder, as {@link relayrForwardRequest} reads
|
|
1024
|
+
* it), with the nonce it was signed with when `nonces` has one for every
|
|
1025
|
+
* entry. Null when there are none, or one is not such a request: requests
|
|
1026
|
+
* that can't be read can't be classified, so they never count as dead.
|
|
1027
|
+
*/
|
|
1028
|
+
export function relayrSignedRequests(entries, nonces) {
|
|
1029
|
+
const published = Array.isArray(entries) ? entries : [];
|
|
1030
|
+
const saved = Array.isArray(nonces) && nonces.length === published.length
|
|
1031
|
+
? nonces
|
|
1032
|
+
: undefined;
|
|
1033
|
+
const requests = published.flatMap((entry, index) => {
|
|
1034
|
+
const request = relayrForwardRequest(entry);
|
|
1035
|
+
return request
|
|
1036
|
+
? [
|
|
1037
|
+
{
|
|
1038
|
+
chainId: entry.chain,
|
|
1039
|
+
signer: request.from,
|
|
1040
|
+
deadline: request.deadline,
|
|
1041
|
+
...(saved ? { nonce: saved[index] } : {}),
|
|
1042
|
+
},
|
|
1043
|
+
]
|
|
1044
|
+
: [];
|
|
1045
|
+
});
|
|
1046
|
+
return published.length && requests.length === published.length
|
|
1047
|
+
? requests
|
|
1048
|
+
: null;
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* The one classification of signed forward requests (ruling R114): each at a
|
|
1052
|
+
* canonical finalized block on its chain, read once per chain and signer with
|
|
1053
|
+
* `clientFor(chainId)`. Never throws for a chain it cannot read: its requests
|
|
1054
|
+
* are live.
|
|
1055
|
+
*/
|
|
1056
|
+
export async function relayrRequestStates(clientFor, requests) {
|
|
1057
|
+
const finalized = new Map();
|
|
1058
|
+
return Promise.all(requests.map(async ({ chainId, signer, deadline, nonce, }) => {
|
|
1059
|
+
const key = `${chainId}:${String(signer).toLowerCase()}`;
|
|
1060
|
+
if (!finalized.has(key)) {
|
|
1061
|
+
finalized.set(key, finalizedForwarderNonce(clientFor, chainId, signer));
|
|
1062
|
+
}
|
|
1063
|
+
const block = await finalized.get(key);
|
|
1064
|
+
// A saved nonce that can't be read leaves the request unknown, and a
|
|
1065
|
+
// deadline that can't be read has not passed.
|
|
1066
|
+
const saved = nonce === undefined ? null : uint256(nonce);
|
|
1067
|
+
const end = uint256(deadline);
|
|
1068
|
+
if (block && (nonce === undefined || saved !== null)) {
|
|
1069
|
+
if (saved !== null && block.nonce > saved) {
|
|
1070
|
+
return { live: false, mayHaveRun: true, unused: false };
|
|
1071
|
+
}
|
|
1072
|
+
if (end !== null && end < block.timestamp) {
|
|
1073
|
+
return {
|
|
1074
|
+
live: false,
|
|
1075
|
+
mayHaveRun: saved === null,
|
|
1076
|
+
unused: block.nonce === saved,
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
return { live: true, deadline: Number(deadline) };
|
|
1081
|
+
}));
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* What `states` allow together. No states are neither run nor unused, so a
|
|
1085
|
+
* session with none holds.
|
|
1086
|
+
*/
|
|
1087
|
+
export function relayrRequestsVerdict(states) {
|
|
1088
|
+
const deadlines = states.flatMap((state) => state.live ? [state.deadline] : []);
|
|
1089
|
+
const mayHaveRun = states.some((state) => !state.live && state.mayHaveRun);
|
|
1090
|
+
if (deadlines.length) {
|
|
1091
|
+
return { live: true, until: Math.max(...deadlines), mayHaveRun };
|
|
1092
|
+
}
|
|
1093
|
+
return {
|
|
1094
|
+
live: false,
|
|
1095
|
+
mayHaveRun,
|
|
1096
|
+
unused: states.length > 0 && states.every((state) => !state.live && state.unused),
|
|
1097
|
+
};
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* Ruling R117: whether every request is dead at a canonical finalized block
|
|
1101
|
+
* on its chain, anything unknown counting as live. A saved session reserves
|
|
1102
|
+
* its signers' forwarder nonces on its chains exactly while one of its
|
|
1103
|
+
* requests is live, never by a device clock or a quote's expiry. Requests that
|
|
1104
|
+
* can't be classified (null) or none at all are never dead.
|
|
1105
|
+
*/
|
|
1106
|
+
export async function relayrRequestsDead(clientFor, requests) {
|
|
1107
|
+
return (Array.isArray(requests) &&
|
|
1108
|
+
requests.length > 0 &&
|
|
1109
|
+
!relayrRequestsVerdict(await relayrRequestStates(clientFor, requests)).live);
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* Whether the chain's finalized block, still canonical, is past `deadline`
|
|
1113
|
+
* (seconds, as a safe integer, decimal or 0x-hex digits, or a bigint): its
|
|
1114
|
+
* timestamp is later. False while that is unknown, or the deadline can't be
|
|
1115
|
+
* read.
|
|
1116
|
+
*/
|
|
1117
|
+
export async function relayrDeadlinePassed(client, deadline) {
|
|
1118
|
+
const finalized = await atCanonicalFinalizedBlock(client, async () => undefined);
|
|
1119
|
+
const end = uint256(deadline);
|
|
1120
|
+
return !!finalized && end !== null && finalized.timestamp > end;
|
|
1121
|
+
}
|
|
1122
|
+
/** Whether `value` is a {@link RelayrDiscardReason}, for a reason read back from storage. */
|
|
1123
|
+
export function isRelayrDiscardReason(value) {
|
|
1124
|
+
return value === "ran" || value === "changed" || value === "expired";
|
|
1125
|
+
}
|
|
1126
|
+
/** The transport failures that mean a recheck could not reach the chain. */
|
|
1127
|
+
const UNREACHED = ["HttpRequestError", "TimeoutError", "WebSocketRequestError"];
|
|
1128
|
+
/**
|
|
1129
|
+
* Revert data: whole bytes of hex, at least a 4-byte selector, bare or in
|
|
1130
|
+
* Nethermind's "Reverted 0x…" form.
|
|
1131
|
+
*/
|
|
1132
|
+
const REVERT_DATA = /^(?:Reverted )?0x(?:[0-9a-fA-F]{2}){4,}$/u;
|
|
1133
|
+
/**
|
|
1134
|
+
* Whether one error carries revert data, whatever its JSON-RPC code: in its
|
|
1135
|
+
* `data`, in a `data.data` a node nests there, or in the `raw` data of viem's
|
|
1136
|
+
* contract revert. Such an error is the chain answering.
|
|
1137
|
+
*/
|
|
1138
|
+
function revertedWithData(link) {
|
|
1139
|
+
const { raw, data } = link;
|
|
1140
|
+
const nested = data !== null && typeof data === "object"
|
|
1141
|
+
? data.data
|
|
1142
|
+
: undefined;
|
|
1143
|
+
return [raw, data, nested].some((value) => typeof value === "string" && REVERT_DATA.test(value));
|
|
1144
|
+
}
|
|
1145
|
+
/**
|
|
1146
|
+
* Ruling R118: the node could not answer the recheck, so it says nothing
|
|
1147
|
+
* about the project. Within the error's first eight links (its cause chain),
|
|
1148
|
+
* one is a transport failure (HTTP, timeout or WebSocket), a JSON-RPC failure
|
|
1149
|
+
* (viem's `RpcRequestError` or any `RpcError`, such as -32001, -32005 or
|
|
1150
|
+
* -32603), or a contract revert without revert data, as viem reads a bare
|
|
1151
|
+
* revert, transient or not; and no link carries revert data, which on any
|
|
1152
|
+
* code is the chain answering. An app's error that wraps such a failure as
|
|
1153
|
+
* its `cause` reads the same way.
|
|
1154
|
+
*/
|
|
1155
|
+
function recheckUnreached(error) {
|
|
1156
|
+
const links = [];
|
|
1157
|
+
for (let link = error; links.length < 8 && link instanceof Error; link = link.cause) {
|
|
1158
|
+
links.push(link);
|
|
1159
|
+
}
|
|
1160
|
+
return (!links.some(revertedWithData) &&
|
|
1161
|
+
links.some((link) => UNREACHED.includes(link.name) ||
|
|
1162
|
+
link instanceof RpcRequestError ||
|
|
1163
|
+
link instanceof RpcError ||
|
|
1164
|
+
link instanceof ContractFunctionRevertedError));
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* What a session does next from its requests' `verdict` (see
|
|
1168
|
+
* {@link RelayrSessionOutcome}), which was classified before the action's own
|
|
1169
|
+
* recheck, since a request that ran would make the recheck refuse.
|
|
1170
|
+
*
|
|
1171
|
+
* `nonces` must be the saved nonces of exactly the requests that were
|
|
1172
|
+
* classified into `verdict`, in the same order: `refresh` and `re-sign` hand
|
|
1173
|
+
* them back to sign at, and nothing here can check them against the verdict.
|
|
1174
|
+
* Without them (omitted, empty or not a list), a session whose requests are
|
|
1175
|
+
* all dead and unused holds as `reorg-hold`, and is neither discarded nor
|
|
1176
|
+
* signed again.
|
|
1177
|
+
*
|
|
1178
|
+
* `recheck`, the action's proof that its calls still apply, resolves when
|
|
1179
|
+
* they do and throws when they don't; a value it resolves with is never read.
|
|
1180
|
+
* It runs only once every request is dead and unused. Without one, as in an
|
|
1181
|
+
* account view, such a session can be discarded as `expired`. A recheck that
|
|
1182
|
+
* fails because the node could not answer decides nothing. Known limit: a
|
|
1183
|
+
* reorg that drops an earlier forwarded transaction can leave a finalized
|
|
1184
|
+
* nonce below a saved one, and the session holds until the nonce catches up.
|
|
1185
|
+
*/
|
|
1186
|
+
export async function relayrSessionOutcome(verdict, { nonces, recheck, } = {}) {
|
|
1187
|
+
const saved = Array.isArray(nonces) && nonces.length ? [...nonces] : null;
|
|
1188
|
+
if (verdict.live) {
|
|
1189
|
+
return verdict.mayHaveRun
|
|
1190
|
+
? { kind: "hold", until: verdict.until }
|
|
1191
|
+
: { kind: "refresh", until: verdict.until, nonces: saved };
|
|
1192
|
+
}
|
|
1193
|
+
if (verdict.mayHaveRun)
|
|
1194
|
+
return { kind: "discard", reason: "ran" };
|
|
1195
|
+
if (!verdict.unused || !saved)
|
|
1196
|
+
return { kind: "reorg-hold" };
|
|
1197
|
+
if (!recheck)
|
|
1198
|
+
return { kind: "discard", reason: "expired" };
|
|
1199
|
+
try {
|
|
1200
|
+
await recheck();
|
|
1201
|
+
}
|
|
1202
|
+
catch (error) {
|
|
1203
|
+
return recheckUnreached(error)
|
|
1204
|
+
? withHidden({ kind: "unchecked" }, "error", error)
|
|
1205
|
+
: withHidden({ kind: "discard", reason: "changed" }, "error", error);
|
|
1206
|
+
}
|
|
1207
|
+
return { kind: "re-sign", nonces: saved };
|
|
1208
|
+
}
|
|
962
1209
|
//# sourceMappingURL=relayr.js.map
|