@bananapus/nana-sdk-core 3.5.2 → 5.0.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/bin/wallet-check.mjs +495 -0
- package/dist/cjs/actions/suckerPairs.d.ts +5 -3
- package/dist/cjs/actions/suckerPairs.d.ts.map +1 -1
- package/dist/cjs/actions/suckerPairs.js +6 -26
- package/dist/cjs/actions/suckerPairs.js.map +1 -1
- package/dist/cjs/pause.d.ts +2 -0
- package/dist/cjs/pause.d.ts.map +1 -1
- package/dist/cjs/pause.js +17 -0
- package/dist/cjs/pause.js.map +1 -1
- package/dist/cjs/review/confirm.d.ts +56 -0
- package/dist/cjs/review/confirm.d.ts.map +1 -0
- package/dist/cjs/review/confirm.js +99 -0
- package/dist/cjs/review/confirm.js.map +1 -0
- package/dist/cjs/review/contractWrite.d.ts +5 -3
- package/dist/cjs/review/contractWrite.d.ts.map +1 -1
- package/dist/cjs/review/contractWrite.js +10 -8
- package/dist/cjs/review/contractWrite.js.map +1 -1
- package/dist/cjs/review/decode.d.ts +19 -1
- package/dist/cjs/review/decode.d.ts.map +1 -1
- package/dist/cjs/review/decode.js +30 -11
- package/dist/cjs/review/decode.js.map +1 -1
- package/dist/cjs/review/decodeCall.d.ts +21 -0
- package/dist/cjs/review/decodeCall.d.ts.map +1 -0
- package/dist/cjs/review/decodeCall.js +183 -0
- package/dist/cjs/review/decodeCall.js.map +1 -0
- package/dist/cjs/review/heldWrite.d.ts +4 -0
- package/dist/cjs/review/heldWrite.d.ts.map +1 -1
- package/dist/cjs/review/heldWrite.js +35 -31
- package/dist/cjs/review/heldWrite.js.map +1 -1
- package/dist/cjs/review/index.d.ts +12 -1
- package/dist/cjs/review/index.d.ts.map +1 -1
- package/dist/cjs/review/index.js +29 -1
- package/dist/cjs/review/index.js.map +1 -1
- package/dist/cjs/review/intents.d.ts +10 -0
- package/dist/cjs/review/intents.d.ts.map +1 -1
- package/dist/cjs/review/intents.js +13 -0
- package/dist/cjs/review/intents.js.map +1 -1
- package/dist/cjs/review/lineError.d.ts +72 -0
- package/dist/cjs/review/lineError.d.ts.map +1 -0
- package/dist/cjs/review/lineError.js +76 -0
- package/dist/cjs/review/lineError.js.map +1 -0
- package/dist/cjs/review/messages.d.ts +15 -3
- package/dist/cjs/review/messages.d.ts.map +1 -1
- package/dist/cjs/review/messages.js +16 -4
- package/dist/cjs/review/messages.js.map +1 -1
- package/dist/cjs/review/model.d.ts +149 -0
- package/dist/cjs/review/model.d.ts.map +1 -0
- package/dist/cjs/review/model.js +750 -0
- package/dist/cjs/review/model.js.map +1 -0
- package/dist/cjs/review/plan.d.ts +61 -0
- package/dist/cjs/review/plan.d.ts.map +1 -0
- package/dist/cjs/review/plan.js +143 -0
- package/dist/cjs/review/plan.js.map +1 -0
- package/dist/cjs/review/react/index.d.ts +1 -0
- package/dist/cjs/review/react/index.d.ts.map +1 -1
- package/dist/cjs/review/react/index.js +1 -0
- package/dist/cjs/review/react/index.js.map +1 -1
- package/dist/cjs/review/react/useHeldSend.js +3 -4
- package/dist/cjs/review/react/useHeldSend.js.map +1 -1
- package/dist/cjs/review/react/useHeldWrite.d.ts.map +1 -1
- package/dist/cjs/review/react/useHeldWrite.js +2 -1
- package/dist/cjs/review/react/useHeldWrite.js.map +1 -1
- package/dist/cjs/review/react/useReviewedRun.d.ts +122 -0
- package/dist/cjs/review/react/useReviewedRun.d.ts.map +1 -0
- package/dist/cjs/review/react/useReviewedRun.js +443 -0
- package/dist/cjs/review/react/useReviewedRun.js.map +1 -0
- package/dist/cjs/review/receipt.d.ts +37 -1
- package/dist/cjs/review/receipt.d.ts.map +1 -1
- package/dist/cjs/review/receipt.js +76 -3
- package/dist/cjs/review/receipt.js.map +1 -1
- package/dist/cjs/review/relayr.d.ts +13 -4
- package/dist/cjs/review/relayr.d.ts.map +1 -1
- package/dist/cjs/review/relayr.js +52 -8
- package/dist/cjs/review/relayr.js.map +1 -1
- package/dist/cjs/review/relayrSend.d.ts +106 -0
- package/dist/cjs/review/relayrSend.d.ts.map +1 -0
- package/dist/cjs/review/relayrSend.js +795 -0
- package/dist/cjs/review/relayrSend.js.map +1 -0
- package/dist/cjs/review/reviewQueue.d.ts +10 -9
- package/dist/cjs/review/reviewQueue.d.ts.map +1 -1
- package/dist/cjs/review/reviewQueue.js +19 -29
- package/dist/cjs/review/reviewQueue.js.map +1 -1
- package/dist/cjs/review/reviewRequests.d.ts +86 -0
- package/dist/cjs/review/reviewRequests.d.ts.map +1 -0
- package/dist/cjs/review/reviewRequests.js +266 -0
- package/dist/cjs/review/reviewRequests.js.map +1 -0
- package/dist/cjs/review/safeRelayr.d.ts +3 -1
- package/dist/cjs/review/safeRelayr.d.ts.map +1 -1
- package/dist/cjs/review/safeRelayr.js +9 -9
- package/dist/cjs/review/safeRelayr.js.map +1 -1
- package/dist/cjs/review/safeSend.d.ts +69 -0
- package/dist/cjs/review/safeSend.d.ts.map +1 -0
- package/dist/cjs/review/safeSend.js +306 -0
- package/dist/cjs/review/safeSend.js.map +1 -0
- package/dist/cjs/review/send.d.ts +272 -0
- package/dist/cjs/review/send.d.ts.map +1 -0
- package/dist/cjs/review/send.js +1163 -0
- package/dist/cjs/review/send.js.map +1 -0
- package/dist/cjs/review/sequence.d.ts +77 -0
- package/dist/cjs/review/sequence.d.ts.map +1 -0
- package/dist/cjs/review/sequence.js +232 -0
- package/dist/cjs/review/sequence.js.map +1 -0
- package/dist/cjs/review/sign.d.ts +111 -0
- package/dist/cjs/review/sign.d.ts.map +1 -0
- package/dist/cjs/review/sign.js +378 -0
- package/dist/cjs/review/sign.js.map +1 -0
- package/dist/cjs/review/simulation.d.ts +41 -2
- package/dist/cjs/review/simulation.d.ts.map +1 -1
- package/dist/cjs/review/simulation.js +99 -29
- package/dist/cjs/review/simulation.js.map +1 -1
- package/dist/cjs/review/transaction-message.d.ts +13 -0
- package/dist/cjs/review/transaction-message.d.ts.map +1 -1
- package/dist/cjs/review/transaction-message.js +25 -0
- package/dist/cjs/review/transaction-message.js.map +1 -1
- package/dist/cjs/review/transactionReview.d.ts +27 -19
- package/dist/cjs/review/transactionReview.d.ts.map +1 -1
- package/dist/cjs/review/transactionReview.js +22 -63
- package/dist/cjs/review/transactionReview.js.map +1 -1
- package/dist/cjs/review/wallet.d.ts +98 -0
- package/dist/cjs/review/wallet.d.ts.map +1 -0
- package/dist/cjs/review/wallet.js +234 -0
- package/dist/cjs/review/wallet.js.map +1 -0
- package/dist/cjs/review/writeHold.d.ts +138 -13
- package/dist/cjs/review/writeHold.d.ts.map +1 -1
- package/dist/cjs/review/writeHold.js +98 -18
- package/dist/cjs/review/writeHold.js.map +1 -1
- package/dist/cjs/review/writeRecovery.d.ts +17 -1
- package/dist/cjs/review/writeRecovery.d.ts.map +1 -1
- package/dist/cjs/review/writeRecovery.js +146 -45
- package/dist/cjs/review/writeRecovery.js.map +1 -1
- package/dist/cjs/safeService.d.ts +27 -4
- package/dist/cjs/safeService.d.ts.map +1 -1
- package/dist/cjs/safeService.js +120 -3
- package/dist/cjs/safeService.js.map +1 -1
- package/dist/cjs/testing.d.ts +24 -0
- package/dist/cjs/testing.d.ts.map +1 -1
- package/dist/cjs/testing.js +26 -1
- package/dist/cjs/testing.js.map +1 -1
- package/dist/cjs/v6/defifa.d.ts.map +1 -1
- package/dist/cjs/v6/defifa.js +24 -23
- package/dist/cjs/v6/defifa.js.map +1 -1
- package/dist/cjs/v6/executionErrors.d.ts.map +1 -1
- package/dist/cjs/v6/executionErrors.js +3 -2
- package/dist/cjs/v6/executionErrors.js.map +1 -1
- package/dist/cjs/v6/pay.d.ts +25 -8
- package/dist/cjs/v6/pay.d.ts.map +1 -1
- package/dist/cjs/v6/pay.js +117 -23
- package/dist/cjs/v6/pay.js.map +1 -1
- package/dist/cjs/v6/suckers.d.ts +30 -0
- package/dist/cjs/v6/suckers.d.ts.map +1 -1
- package/dist/cjs/v6/suckers.js +69 -5
- package/dist/cjs/v6/suckers.js.map +1 -1
- package/dist/esm/actions/suckerPairs.d.ts +5 -3
- package/dist/esm/actions/suckerPairs.d.ts.map +1 -1
- package/dist/esm/actions/suckerPairs.js +7 -27
- package/dist/esm/actions/suckerPairs.js.map +1 -1
- package/dist/esm/pause.d.ts +2 -0
- package/dist/esm/pause.d.ts.map +1 -1
- package/dist/esm/pause.js +16 -0
- package/dist/esm/pause.js.map +1 -1
- package/dist/esm/review/confirm.d.ts +56 -0
- package/dist/esm/review/confirm.d.ts.map +1 -0
- package/dist/esm/review/confirm.js +93 -0
- package/dist/esm/review/confirm.js.map +1 -0
- package/dist/esm/review/contractWrite.d.ts +5 -3
- package/dist/esm/review/contractWrite.d.ts.map +1 -1
- package/dist/esm/review/contractWrite.js +10 -8
- package/dist/esm/review/contractWrite.js.map +1 -1
- package/dist/esm/review/decode.d.ts +19 -1
- package/dist/esm/review/decode.d.ts.map +1 -1
- package/dist/esm/review/decode.js +29 -14
- package/dist/esm/review/decode.js.map +1 -1
- package/dist/esm/review/decodeCall.d.ts +21 -0
- package/dist/esm/review/decodeCall.d.ts.map +1 -0
- package/dist/esm/review/decodeCall.js +180 -0
- package/dist/esm/review/decodeCall.js.map +1 -0
- package/dist/esm/review/heldWrite.d.ts +4 -0
- package/dist/esm/review/heldWrite.d.ts.map +1 -1
- package/dist/esm/review/heldWrite.js +34 -30
- package/dist/esm/review/heldWrite.js.map +1 -1
- package/dist/esm/review/index.d.ts +12 -1
- package/dist/esm/review/index.d.ts.map +1 -1
- package/dist/esm/review/index.js +12 -1
- package/dist/esm/review/index.js.map +1 -1
- package/dist/esm/review/intents.d.ts +10 -0
- package/dist/esm/review/intents.d.ts.map +1 -1
- package/dist/esm/review/intents.js +12 -0
- package/dist/esm/review/intents.js.map +1 -1
- package/dist/esm/review/lineError.d.ts +72 -0
- package/dist/esm/review/lineError.d.ts.map +1 -0
- package/dist/esm/review/lineError.js +68 -0
- package/dist/esm/review/lineError.js.map +1 -0
- package/dist/esm/review/messages.d.ts +15 -3
- package/dist/esm/review/messages.d.ts.map +1 -1
- package/dist/esm/review/messages.js +15 -3
- package/dist/esm/review/messages.js.map +1 -1
- package/dist/esm/review/model.d.ts +149 -0
- package/dist/esm/review/model.d.ts.map +1 -0
- package/dist/esm/review/model.js +746 -0
- package/dist/esm/review/model.js.map +1 -0
- package/dist/esm/review/plan.d.ts +61 -0
- package/dist/esm/review/plan.d.ts.map +1 -0
- package/dist/esm/review/plan.js +136 -0
- package/dist/esm/review/plan.js.map +1 -0
- package/dist/esm/review/react/index.d.ts +1 -0
- package/dist/esm/review/react/index.d.ts.map +1 -1
- package/dist/esm/review/react/index.js +1 -0
- package/dist/esm/review/react/index.js.map +1 -1
- package/dist/esm/review/react/useHeldSend.js +3 -4
- package/dist/esm/review/react/useHeldSend.js.map +1 -1
- package/dist/esm/review/react/useHeldWrite.d.ts.map +1 -1
- package/dist/esm/review/react/useHeldWrite.js +2 -1
- package/dist/esm/review/react/useHeldWrite.js.map +1 -1
- package/dist/esm/review/react/useReviewedRun.d.ts +122 -0
- package/dist/esm/review/react/useReviewedRun.d.ts.map +1 -0
- package/dist/esm/review/react/useReviewedRun.js +439 -0
- package/dist/esm/review/react/useReviewedRun.js.map +1 -0
- package/dist/esm/review/receipt.d.ts +37 -1
- package/dist/esm/review/receipt.d.ts.map +1 -1
- package/dist/esm/review/receipt.js +72 -2
- package/dist/esm/review/receipt.js.map +1 -1
- package/dist/esm/review/relayr.d.ts +13 -4
- package/dist/esm/review/relayr.d.ts.map +1 -1
- package/dist/esm/review/relayr.js +51 -8
- package/dist/esm/review/relayr.js.map +1 -1
- package/dist/esm/review/relayrSend.d.ts +106 -0
- package/dist/esm/review/relayrSend.d.ts.map +1 -0
- package/dist/esm/review/relayrSend.js +787 -0
- package/dist/esm/review/relayrSend.js.map +1 -0
- package/dist/esm/review/reviewQueue.d.ts +10 -9
- package/dist/esm/review/reviewQueue.d.ts.map +1 -1
- package/dist/esm/review/reviewQueue.js +17 -26
- package/dist/esm/review/reviewQueue.js.map +1 -1
- package/dist/esm/review/reviewRequests.d.ts +86 -0
- package/dist/esm/review/reviewRequests.d.ts.map +1 -0
- package/dist/esm/review/reviewRequests.js +263 -0
- package/dist/esm/review/reviewRequests.js.map +1 -0
- package/dist/esm/review/safeRelayr.d.ts +3 -1
- package/dist/esm/review/safeRelayr.d.ts.map +1 -1
- package/dist/esm/review/safeRelayr.js +9 -9
- package/dist/esm/review/safeRelayr.js.map +1 -1
- package/dist/esm/review/safeSend.d.ts +69 -0
- package/dist/esm/review/safeSend.d.ts.map +1 -0
- package/dist/esm/review/safeSend.js +301 -0
- package/dist/esm/review/safeSend.js.map +1 -0
- package/dist/esm/review/send.d.ts +272 -0
- package/dist/esm/review/send.d.ts.map +1 -0
- package/dist/esm/review/send.js +1156 -0
- package/dist/esm/review/send.js.map +1 -0
- package/dist/esm/review/sequence.d.ts +77 -0
- package/dist/esm/review/sequence.d.ts.map +1 -0
- package/dist/esm/review/sequence.js +223 -0
- package/dist/esm/review/sequence.js.map +1 -0
- package/dist/esm/review/sign.d.ts +111 -0
- package/dist/esm/review/sign.d.ts.map +1 -0
- package/dist/esm/review/sign.js +372 -0
- package/dist/esm/review/sign.js.map +1 -0
- package/dist/esm/review/simulation.d.ts +41 -2
- package/dist/esm/review/simulation.d.ts.map +1 -1
- package/dist/esm/review/simulation.js +95 -29
- package/dist/esm/review/simulation.js.map +1 -1
- package/dist/esm/review/transaction-message.d.ts +13 -0
- package/dist/esm/review/transaction-message.d.ts.map +1 -1
- package/dist/esm/review/transaction-message.js +23 -0
- package/dist/esm/review/transaction-message.js.map +1 -1
- package/dist/esm/review/transactionReview.d.ts +27 -19
- package/dist/esm/review/transactionReview.d.ts.map +1 -1
- package/dist/esm/review/transactionReview.js +19 -56
- package/dist/esm/review/transactionReview.js.map +1 -1
- package/dist/esm/review/wallet.d.ts +98 -0
- package/dist/esm/review/wallet.d.ts.map +1 -0
- package/dist/esm/review/wallet.js +227 -0
- package/dist/esm/review/wallet.js.map +1 -0
- package/dist/esm/review/writeHold.d.ts +138 -13
- package/dist/esm/review/writeHold.d.ts.map +1 -1
- package/dist/esm/review/writeHold.js +96 -19
- package/dist/esm/review/writeHold.js.map +1 -1
- package/dist/esm/review/writeRecovery.d.ts +17 -1
- package/dist/esm/review/writeRecovery.d.ts.map +1 -1
- package/dist/esm/review/writeRecovery.js +149 -48
- package/dist/esm/review/writeRecovery.js.map +1 -1
- package/dist/esm/safeService.d.ts +27 -4
- package/dist/esm/safeService.d.ts.map +1 -1
- package/dist/esm/safeService.js +119 -4
- package/dist/esm/safeService.js.map +1 -1
- package/dist/esm/testing.d.ts +24 -0
- package/dist/esm/testing.d.ts.map +1 -1
- package/dist/esm/testing.js +23 -1
- package/dist/esm/testing.js.map +1 -1
- package/dist/esm/v6/defifa.d.ts.map +1 -1
- package/dist/esm/v6/defifa.js +24 -23
- package/dist/esm/v6/defifa.js.map +1 -1
- package/dist/esm/v6/executionErrors.d.ts.map +1 -1
- package/dist/esm/v6/executionErrors.js +3 -2
- package/dist/esm/v6/executionErrors.js.map +1 -1
- package/dist/esm/v6/pay.d.ts +25 -8
- package/dist/esm/v6/pay.d.ts.map +1 -1
- package/dist/esm/v6/pay.js +115 -22
- package/dist/esm/v6/pay.js.map +1 -1
- package/dist/esm/v6/suckers.d.ts +30 -0
- package/dist/esm/v6/suckers.d.ts.map +1 -1
- package/dist/esm/v6/suckers.js +67 -5
- package/dist/esm/v6/suckers.js.map +1 -1
- package/package.json +11 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Hex, TransactionReceipt } from "viem";
|
|
2
|
+
import type { ReviewedCall } from "./send.js";
|
|
3
|
+
/**
|
|
4
|
+
* An error with its own one-line message, which `errorLine` shows: the
|
|
5
|
+
* SDK's, or a site's own refusal (thrown from `reverify`, `assertWriteState`
|
|
6
|
+
* or `beforeWallet`, say). Any other error's text never reaches the UI.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ReviewLineError extends Error {
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* An SDK error shown by its fixed `line`, never its text (which can quote a
|
|
12
|
+
* service). The line lives on the error's class, so it loads with the code
|
|
13
|
+
* that throws it.
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class ReviewFixedLineError extends Error {
|
|
16
|
+
abstract readonly line: string;
|
|
17
|
+
/** Its class's mark, which `errorLine` reads: the SDK's ESM and CommonJS copies each have their own class. */
|
|
18
|
+
get reviewFixedLine(): true;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A step's transaction was mined and reverted: nothing of it to resume, and
|
|
22
|
+
* the action can be reviewed again. `receipt` is the mined receipt, so a
|
|
23
|
+
* site can close its own record of the attempt.
|
|
24
|
+
*/
|
|
25
|
+
export declare class ReviewedCallRevertedError extends ReviewLineError {
|
|
26
|
+
/** The step's index in the whole action. */
|
|
27
|
+
readonly step: number;
|
|
28
|
+
readonly hash: Hex;
|
|
29
|
+
readonly receipt: TransactionReceipt;
|
|
30
|
+
readonly name = "ReviewedCallRevertedError";
|
|
31
|
+
constructor(
|
|
32
|
+
/** The step's index in the whole action. */
|
|
33
|
+
step: number, hash: Hex, receipt: TransactionReceipt);
|
|
34
|
+
}
|
|
35
|
+
/** A wallet adapter's refusal before it called the wallet: proven unsent, so its step is released. */
|
|
36
|
+
export declare class WalletNotInvokedError extends ReviewLineError {
|
|
37
|
+
readonly name = "WalletNotInvokedError";
|
|
38
|
+
}
|
|
39
|
+
/** A step mined whose receipt its hold has not verified yet: it stays held until the hold settles it. */
|
|
40
|
+
export declare class ReviewedReceiptUnverifiedError extends ReviewLineError {
|
|
41
|
+
readonly step: number;
|
|
42
|
+
readonly hash: Hex;
|
|
43
|
+
/**
|
|
44
|
+
* The step's call and its hold reservation, which `completeReviewedStep`
|
|
45
|
+
* reads, the hashes of the steps completed before it, and the run's
|
|
46
|
+
* signatures when it signed any.
|
|
47
|
+
*/
|
|
48
|
+
readonly held?: {
|
|
49
|
+
call: ReviewedCall;
|
|
50
|
+
reservation: string | undefined;
|
|
51
|
+
hashes?: Hex[];
|
|
52
|
+
signatures?: Hex[];
|
|
53
|
+
} | undefined;
|
|
54
|
+
readonly name = "ReviewedReceiptUnverifiedError";
|
|
55
|
+
constructor(step: number, hash: Hex, line?: string,
|
|
56
|
+
/**
|
|
57
|
+
* The step's call and its hold reservation, which `completeReviewedStep`
|
|
58
|
+
* reads, the hashes of the steps completed before it, and the run's
|
|
59
|
+
* signatures when it signed any.
|
|
60
|
+
*/
|
|
61
|
+
held?: {
|
|
62
|
+
call: ReviewedCall;
|
|
63
|
+
reservation: string | undefined;
|
|
64
|
+
hashes?: Hex[];
|
|
65
|
+
signatures?: Hex[];
|
|
66
|
+
} | undefined,
|
|
67
|
+
/** What ended the run before the hold verified the step: a read that failed, say. */
|
|
68
|
+
options?: {
|
|
69
|
+
cause?: unknown;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=lineError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineError.d.ts","sourceRoot":"","sources":["../../../src/review/lineError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG9C;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,KAAK;CAAG;AAE7C;;;;GAIG;AACH,8BAAsB,oBAAqB,SAAQ,KAAK;IACtD,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAE/B,8GAA8G;IAC9G,IAAI,eAAe,IAAI,IAAI,CAE1B;CACF;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,eAAe;IAI1D,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,GAAG;IAClB,QAAQ,CAAC,OAAO,EAAE,kBAAkB;IANtC,QAAQ,CAAC,IAAI,+BAA+B;;IAG1C,4CAA4C;IACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,kBAAkB;CAIvC;AAED,sGAAsG;AACtG,qBAAa,qBAAsB,SAAQ,eAAe;IACxD,QAAQ,CAAC,IAAI,2BAA2B;CACzC;AAED,yGAAyG;AACzG,qBAAa,8BAA+B,SAAQ,eAAe;IAI/D,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,GAAG;IAElB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE;QACd,IAAI,EAAE,YAAY,CAAC;QACnB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;QAChC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;QACf,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC;KACpB;IAhBH,QAAQ,CAAC,IAAI,oCAAoC;gBAGtC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,GAAG,EAClB,IAAI,GAAE,MAA6B;IACnC;;;;OAIG;IACM,IAAI,CAAC,EAAE;QACd,IAAI,EAAE,YAAY,CAAC;QACnB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;QAChC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;QACf,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC;KACpB,YAAA;IACD,qFAAqF;IACrF,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAO;CAWpC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { HELD_CONFIRMING_LINE, WRITE_HOLD_REVERTED_LINE } from "./messages.js";
|
|
2
|
+
/**
|
|
3
|
+
* An error with its own one-line message, which `errorLine` shows: the
|
|
4
|
+
* SDK's, or a site's own refusal (thrown from `reverify`, `assertWriteState`
|
|
5
|
+
* or `beforeWallet`, say). Any other error's text never reaches the UI.
|
|
6
|
+
*/
|
|
7
|
+
export class ReviewLineError extends Error {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* An SDK error shown by its fixed `line`, never its text (which can quote a
|
|
11
|
+
* service). The line lives on the error's class, so it loads with the code
|
|
12
|
+
* that throws it.
|
|
13
|
+
*/
|
|
14
|
+
export class ReviewFixedLineError extends Error {
|
|
15
|
+
/** Its class's mark, which `errorLine` reads: the SDK's ESM and CommonJS copies each have their own class. */
|
|
16
|
+
get reviewFixedLine() {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A step's transaction was mined and reverted: nothing of it to resume, and
|
|
22
|
+
* the action can be reviewed again. `receipt` is the mined receipt, so a
|
|
23
|
+
* site can close its own record of the attempt.
|
|
24
|
+
*/
|
|
25
|
+
export class ReviewedCallRevertedError extends ReviewLineError {
|
|
26
|
+
constructor(
|
|
27
|
+
/** The step's index in the whole action. */
|
|
28
|
+
step, hash, receipt) {
|
|
29
|
+
super(WRITE_HOLD_REVERTED_LINE);
|
|
30
|
+
this.step = step;
|
|
31
|
+
this.hash = hash;
|
|
32
|
+
this.receipt = receipt;
|
|
33
|
+
this.name = "ReviewedCallRevertedError";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** A wallet adapter's refusal before it called the wallet: proven unsent, so its step is released. */
|
|
37
|
+
export class WalletNotInvokedError extends ReviewLineError {
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments);
|
|
40
|
+
this.name = "WalletNotInvokedError";
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** A step mined whose receipt its hold has not verified yet: it stays held until the hold settles it. */
|
|
44
|
+
export class ReviewedReceiptUnverifiedError extends ReviewLineError {
|
|
45
|
+
constructor(step, hash, line = HELD_CONFIRMING_LINE,
|
|
46
|
+
/**
|
|
47
|
+
* The step's call and its hold reservation, which `completeReviewedStep`
|
|
48
|
+
* reads, the hashes of the steps completed before it, and the run's
|
|
49
|
+
* signatures when it signed any.
|
|
50
|
+
*/
|
|
51
|
+
held,
|
|
52
|
+
/** What ended the run before the hold verified the step: a read that failed, say. */
|
|
53
|
+
options = {}) {
|
|
54
|
+
super(line);
|
|
55
|
+
this.step = step;
|
|
56
|
+
this.hash = hash;
|
|
57
|
+
this.held = held;
|
|
58
|
+
this.name = "ReviewedReceiptUnverifiedError";
|
|
59
|
+
// Not enumerable, like a native cause: serializing leaves out an RPC error and its URL.
|
|
60
|
+
Object.defineProperty(this, "cause", {
|
|
61
|
+
value: options.cause,
|
|
62
|
+
writable: true,
|
|
63
|
+
enumerable: false,
|
|
64
|
+
configurable: true,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=lineError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineError.js","sourceRoot":"","sources":["../../../src/review/lineError.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAE/E;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;CAAG;AAE7C;;;;GAIG;AACH,MAAM,OAAgB,oBAAqB,SAAQ,KAAK;IAGtD,8GAA8G;IAC9G,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,yBAA0B,SAAQ,eAAe;IAG5D;IACE,4CAA4C;IACnC,IAAY,EACZ,IAAS,EACT,OAA2B;QAEpC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAJvB,SAAI,GAAJ,IAAI,CAAQ;QACZ,SAAI,GAAJ,IAAI,CAAK;QACT,YAAO,GAAP,OAAO,CAAoB;QAN7B,SAAI,GAAG,2BAA2B,CAAC;IAS5C,CAAC;CACF;AAED,sGAAsG;AACtG,MAAM,OAAO,qBAAsB,SAAQ,eAAe;IAA1D;;QACW,SAAI,GAAG,uBAAuB,CAAC;IAC1C,CAAC;CAAA;AAED,yGAAyG;AACzG,MAAM,OAAO,8BAA+B,SAAQ,eAAe;IAGjE,YACW,IAAY,EACZ,IAAS,EAClB,OAAe,oBAAoB;IACnC;;;;OAIG;IACM,IAKR;IACD,qFAAqF;IACrF,UAA+B,EAAE;QAEjC,KAAK,CAAC,IAAI,CAAC,CAAC;QAjBH,SAAI,GAAJ,IAAI,CAAQ;QACZ,SAAI,GAAJ,IAAI,CAAK;QAOT,SAAI,GAAJ,IAAI,CAKZ;QAhBM,SAAI,GAAG,gCAAgC,CAAC;QAqB/C,wFAAwF;QACxF,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE;YACnC,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,IAAI;SACnB,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -45,6 +45,10 @@ export declare const WRITE_HOLD_IN_TAB_LINE = "This browser can't remember pendi
|
|
|
45
45
|
export declare const WRITE_HOLD_PENDING_LINE = "Still pending in your wallet. Speed it up or cancel it there.";
|
|
46
46
|
/** A write that reverted onchain, held until its block is shown canonical (a Safe failure, until final) so a retry can't double it. */
|
|
47
47
|
export declare const WRITE_HOLD_REVERTED_LINE = "This transaction failed onchain. You can try again in a few minutes.";
|
|
48
|
+
/** A Safe execution whose transaction landed while the Safe's own result is not proven yet. */
|
|
49
|
+
export declare const WRITE_HOLD_SAFE_UNCONFIRMED_LINE = "This transaction landed, but the Safe's own result is not confirmed yet. Check the Safe before trying again.";
|
|
50
|
+
/** A Safe execution whose transaction landed while the Safe's own call failed (ExecutionFailure). */
|
|
51
|
+
export declare const WRITE_HOLD_CALL_FAILED_LINE = "The Safe ran this transaction, but its call failed, so nothing changed. Review it and try again.";
|
|
48
52
|
/** A held write the chain can't check (saved with no nonce to look at). The exit is offered. */
|
|
49
53
|
export declare const WRITE_HOLD_UNCHECKED_LINE = "This transaction can't be checked onchain. Check your wallet before sending again.";
|
|
50
54
|
/** A send stopped before the wallet because the account's nonce couldn't be read. */
|
|
@@ -58,7 +62,7 @@ export declare const WRITE_HOLD_LOOKS_DONE_LINE = "This looks done. Check your w
|
|
|
58
62
|
/** A held Safe write whose follower ended without proof. The exit is offered. */
|
|
59
63
|
export declare const WRITE_HOLD_SAFE_UNPROVEN_LINE = "This Safe transaction couldn't be confirmed here. Check your Safe, then send again.";
|
|
60
64
|
/** A held write whose transaction is mined but whose result can't be read yet. No exit yet. */
|
|
61
|
-
export declare const WRITE_HOLD_MINED_LINE = "Your transaction is onchain, but its result can't be read yet.";
|
|
65
|
+
export declare const WRITE_HOLD_MINED_LINE = "Your transaction is onchain, but its result can't be read yet. Check your wallet before sending again.";
|
|
62
66
|
/** A send whose review went stale because another window's attempt of the same write ended meanwhile. */
|
|
63
67
|
export declare const WRITE_HOLD_STALE_REVIEW_LINE = "This was just sent from another window. Review it again to send another.";
|
|
64
68
|
/** The one line while a sent write, direct or through a Safe, is being confirmed. */
|
|
@@ -76,13 +80,13 @@ export declare const HELD_FAILED_LINE = "This transaction failed onchain. Review
|
|
|
76
80
|
/** A held write settled with success on authenticated evidence. */
|
|
77
81
|
export declare const HELD_SUCCESS_LINE = "Your transaction went through.";
|
|
78
82
|
/** A held Safe proposal proven expired before it ran. */
|
|
79
|
-
export declare const HELD_EXPIRED_LINE = "Your Safe proposal expired before it ran.";
|
|
83
|
+
export declare const HELD_EXPIRED_LINE = "Your Safe proposal expired before it ran. Propose it again.";
|
|
80
84
|
/** A success the hold settled while the user was away: shown until they say to send again. */
|
|
81
85
|
export declare const HELD_AWAY_SUCCESS_LINE = "This went through while you were away.";
|
|
82
86
|
/** The one action on a success settled while away: acknowledge it, then send. */
|
|
83
87
|
export declare const HELD_SEND_AGAIN_LABEL = "Send it again";
|
|
84
88
|
/** A saved attempt that can't be shown here: absence of evidence is never permission to send. */
|
|
85
|
-
export declare const SAVED_ATTEMPT_CHECK_LINE = "This transaction may already be in your wallet
|
|
89
|
+
export declare const SAVED_ATTEMPT_CHECK_LINE = "This transaction may already be in your wallet. Check your wallet before sending again.";
|
|
86
90
|
/** The warning under it. */
|
|
87
91
|
export declare const SAVED_ATTEMPT_CHECK_WARNING = "Check your wallet and the explorer first. Continuing can send it twice.";
|
|
88
92
|
/** The one check action's label: "I checked it. Review it again." or the flow's next step ("Create again"). */
|
|
@@ -93,5 +97,13 @@ export declare const SAVED_ATTEMPT_TAB_ONLY_LINE = "This applies to this tab onl
|
|
|
93
97
|
export declare const SAVED_ATTEMPT_UNREADABLE_LINE = "This browser can't read its saved transactions. Check your wallet before sending again.";
|
|
94
98
|
/** The warned exit's label, offered only after a check action found storage unreadable. */
|
|
95
99
|
export declare const SAVED_ATTEMPT_CONTINUE_ANYWAY_LABEL = "I checked my wallet. Continue anyway";
|
|
100
|
+
/** The refusal when the connected account is not the one an action was built for. */
|
|
101
|
+
export declare const REVIEWED_ACCOUNT_CHANGED_LINE = "The connected account changed. Review again.";
|
|
102
|
+
/** The refusal when the app's send engine loader fails: a failed chunk load stays cached until a reload. */
|
|
103
|
+
export declare const REVIEWED_ENGINE_LOAD_LINE = "This page could not load the review. Nothing was sent; reload the page and try again.";
|
|
104
|
+
/** The refusal after a review whose simulation found the action would revert; the review showed why. */
|
|
105
|
+
export declare const REVIEWED_SIMULATION_FAILED_LINE = "This transaction would fail onchain. Nothing was sent; the review shows why.";
|
|
106
|
+
/** The same refusal when the revert's reason could not be read. */
|
|
107
|
+
export declare const REVIEWED_SIMULATION_UNEXPLAINED_LINE = "This transaction would fail onchain. Nothing was sent; check the amounts and try again.";
|
|
96
108
|
export {};
|
|
97
109
|
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/review/messages.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,4FAA4F;AAC5F,KAAK,aAAa,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EA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E,eAAO,MAAM,iBAAiB,mCAAmC,CAAC;AAElE,yDAAyD;AACzD,eAAO,MAAM,iBAAiB,gEACiC,CAAC;AAEhE,8FAA8F;AAC9F,eAAO,MAAM,sBAAsB,2CAA2C,CAAC;AAE/E,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AAErD,iGAAiG;AACjG,eAAO,MAAM,wBAAwB,4FACsD,CAAC;AAE5F,4BAA4B;AAC5B,eAAO,MAAM,2BAA2B,4EACmC,CAAC;AAE5E,+GAA+G;AAC/G,wBAAgB,cAAc,CAAC,IAAI,SAAoB,GAAG,MAAM,CAE/D;AAED,0EAA0E;AAC1E,eAAO,MAAM,2BAA2B,mCAAmC,CAAC;AAE5E,8EAA8E;AAC9E,eAAO,MAAM,6BAA6B,4FACiD,CAAC;AAE5F,2FAA2F;AAC3F,eAAO,MAAM,mCAAmC,yCACR,CAAC;AAEzC,qFAAqF;AACrF,eAAO,MAAM,6BAA6B,iDACM,CAAC;AAEjD,4GAA4G;AAC5G,eAAO,MAAM,yBAAyB,0FACmD,CAAC;AAE1F,wGAAwG;AACxG,eAAO,MAAM,+BAA+B,iFACoC,CAAC;AAEjF,mEAAmE;AACnE,eAAO,MAAM,oCAAoC,4FAC0C,CAAC"}
|
|
@@ -51,6 +51,10 @@ export const WRITE_HOLD_IN_TAB_LINE = "This browser can't remember pending trans
|
|
|
51
51
|
export const WRITE_HOLD_PENDING_LINE = "Still pending in your wallet. Speed it up or cancel it there.";
|
|
52
52
|
/** A write that reverted onchain, held until its block is shown canonical (a Safe failure, until final) so a retry can't double it. */
|
|
53
53
|
export const WRITE_HOLD_REVERTED_LINE = "This transaction failed onchain. You can try again in a few minutes.";
|
|
54
|
+
/** A Safe execution whose transaction landed while the Safe's own result is not proven yet. */
|
|
55
|
+
export const WRITE_HOLD_SAFE_UNCONFIRMED_LINE = "This transaction landed, but the Safe's own result is not confirmed yet. Check the Safe before trying again.";
|
|
56
|
+
/** A Safe execution whose transaction landed while the Safe's own call failed (ExecutionFailure). */
|
|
57
|
+
export const WRITE_HOLD_CALL_FAILED_LINE = "The Safe ran this transaction, but its call failed, so nothing changed. Review it and try again.";
|
|
54
58
|
/** A held write the chain can't check (saved with no nonce to look at). The exit is offered. */
|
|
55
59
|
export const WRITE_HOLD_UNCHECKED_LINE = "This transaction can't be checked onchain. Check your wallet before sending again.";
|
|
56
60
|
/** A send stopped before the wallet because the account's nonce couldn't be read. */
|
|
@@ -64,7 +68,7 @@ export const WRITE_HOLD_LOOKS_DONE_LINE = "This looks done. Check your wallet, t
|
|
|
64
68
|
/** A held Safe write whose follower ended without proof. The exit is offered. */
|
|
65
69
|
export const WRITE_HOLD_SAFE_UNPROVEN_LINE = "This Safe transaction couldn't be confirmed here. Check your Safe, then send again.";
|
|
66
70
|
/** A held write whose transaction is mined but whose result can't be read yet. No exit yet. */
|
|
67
|
-
export const WRITE_HOLD_MINED_LINE = "Your transaction is onchain, but its result can't be read yet.";
|
|
71
|
+
export const WRITE_HOLD_MINED_LINE = "Your transaction is onchain, but its result can't be read yet. Check your wallet before sending again.";
|
|
68
72
|
/** A send whose review went stale because another window's attempt of the same write ended meanwhile. */
|
|
69
73
|
export const WRITE_HOLD_STALE_REVIEW_LINE = "This was just sent from another window. Review it again to send another.";
|
|
70
74
|
/** The one line while a sent write, direct or through a Safe, is being confirmed. */
|
|
@@ -82,13 +86,13 @@ export const HELD_FAILED_LINE = "This transaction failed onchain. Review it and
|
|
|
82
86
|
/** A held write settled with success on authenticated evidence. */
|
|
83
87
|
export const HELD_SUCCESS_LINE = "Your transaction went through.";
|
|
84
88
|
/** A held Safe proposal proven expired before it ran. */
|
|
85
|
-
export const HELD_EXPIRED_LINE = "Your Safe proposal expired before it ran.";
|
|
89
|
+
export const HELD_EXPIRED_LINE = "Your Safe proposal expired before it ran. Propose it again.";
|
|
86
90
|
/** A success the hold settled while the user was away: shown until they say to send again. */
|
|
87
91
|
export const HELD_AWAY_SUCCESS_LINE = "This went through while you were away.";
|
|
88
92
|
/** The one action on a success settled while away: acknowledge it, then send. */
|
|
89
93
|
export const HELD_SEND_AGAIN_LABEL = "Send it again";
|
|
90
94
|
/** A saved attempt that can't be shown here: absence of evidence is never permission to send. */
|
|
91
|
-
export const SAVED_ATTEMPT_CHECK_LINE = "This transaction may already be in your wallet
|
|
95
|
+
export const SAVED_ATTEMPT_CHECK_LINE = "This transaction may already be in your wallet. Check your wallet before sending again.";
|
|
92
96
|
/** The warning under it. */
|
|
93
97
|
export const SAVED_ATTEMPT_CHECK_WARNING = "Check your wallet and the explorer first. Continuing can send it twice.";
|
|
94
98
|
/** The one check action's label: "I checked it. Review it again." or the flow's next step ("Create again"). */
|
|
@@ -101,4 +105,12 @@ export const SAVED_ATTEMPT_TAB_ONLY_LINE = "This applies to this tab only.";
|
|
|
101
105
|
export const SAVED_ATTEMPT_UNREADABLE_LINE = "This browser can't read its saved transactions. Check your wallet before sending again.";
|
|
102
106
|
/** The warned exit's label, offered only after a check action found storage unreadable. */
|
|
103
107
|
export const SAVED_ATTEMPT_CONTINUE_ANYWAY_LABEL = "I checked my wallet. Continue anyway";
|
|
108
|
+
/** The refusal when the connected account is not the one an action was built for. */
|
|
109
|
+
export const REVIEWED_ACCOUNT_CHANGED_LINE = "The connected account changed. Review again.";
|
|
110
|
+
/** The refusal when the app's send engine loader fails: a failed chunk load stays cached until a reload. */
|
|
111
|
+
export const REVIEWED_ENGINE_LOAD_LINE = "This page could not load the review. Nothing was sent; reload the page and try again.";
|
|
112
|
+
/** The refusal after a review whose simulation found the action would revert; the review showed why. */
|
|
113
|
+
export const REVIEWED_SIMULATION_FAILED_LINE = "This transaction would fail onchain. Nothing was sent; the review shows why.";
|
|
114
|
+
/** The same refusal when the revert's reason could not be read. */
|
|
115
|
+
export const REVIEWED_SIMULATION_UNEXPLAINED_LINE = "This transaction would fail onchain. Nothing was sent; check the amounts and try again.";
|
|
104
116
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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oC,GAC/C,yFAAyF,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { type Address, type Hex, type PublicClient } from "viem";
|
|
2
|
+
import { type PrettyStep, type V4PlanStep } from "./decode.js";
|
|
3
|
+
import { type TransactionReviewRequest, type TransactionReviewSignature } from "./transactionReview.js";
|
|
4
|
+
/** A row the site shows above the calls, marked as the site's own summary. */
|
|
5
|
+
export type ReviewContextRow = {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
/** Further lines of the value, shown under it in order (each signer, say). */
|
|
9
|
+
lines?: readonly string[];
|
|
10
|
+
/** A short note under the row, such as what the action leaves to do. */
|
|
11
|
+
note?: string;
|
|
12
|
+
strong?: boolean;
|
|
13
|
+
mono?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type ReviewWarningCode = "safe-gas-nonzero" | "delegatecall" | "abi-unavailable" | "unknown-contract" | "unlimited-approval" | "owner-action" | "permission-grant" | "decimals-unknown" | "possible-token-id" | "simulation-failed" | "simulation-unavailable" | "unreadable";
|
|
16
|
+
export type ReviewWarning = {
|
|
17
|
+
code: ReviewWarningCode;
|
|
18
|
+
text: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* One ABI value. `text` is {@link readableValue}'s output. A tuple's
|
|
22
|
+
* `children` are its components, by name; an array's are its elements, named
|
|
23
|
+
* `[0]`, `[1]`, …. Any other value has none.
|
|
24
|
+
*/
|
|
25
|
+
export type ReviewValue = {
|
|
26
|
+
name: string;
|
|
27
|
+
type: string;
|
|
28
|
+
text: string;
|
|
29
|
+
children: ReviewValue[] | null;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* One ABI input of a decoded call. `text` is {@link readableValue}'s output,
|
|
33
|
+
* except where the review states it more precisely (a Safe `operation`, a
|
|
34
|
+
* Universal Router deadline). A decoder's readable view rides along in
|
|
35
|
+
* `steps`, `v4Plan` or `nested`; a Universal Router `execute` plan rides on
|
|
36
|
+
* its `commands` argument.
|
|
37
|
+
*/
|
|
38
|
+
export type ReviewArgument = ReviewValue & {
|
|
39
|
+
steps: PrettyStep[] | null;
|
|
40
|
+
v4Plan: V4PlanStep[] | null;
|
|
41
|
+
nested: ReviewCallModel[] | null;
|
|
42
|
+
};
|
|
43
|
+
/** An address the call gives a part, read from the argument's name. */
|
|
44
|
+
export type ReviewRole = {
|
|
45
|
+
role: "spender" | "recipient" | "beneficiary" | "owner" | "operator";
|
|
46
|
+
address: Address;
|
|
47
|
+
name: string | null;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* An amount of a token the call moves or approves, in base units. `decimals`
|
|
51
|
+
* and `symbol` are null until known: native ETH and USDC are known at once,
|
|
52
|
+
* any other token after {@link enrichReviewModel} reads it.
|
|
53
|
+
*/
|
|
54
|
+
export type ReviewTokenAmount = {
|
|
55
|
+
token: Address | "native";
|
|
56
|
+
amount: bigint;
|
|
57
|
+
decimals: number | null;
|
|
58
|
+
symbol: string | null;
|
|
59
|
+
};
|
|
60
|
+
export type ReviewCallModel = {
|
|
61
|
+
chainId: number;
|
|
62
|
+
from: Address | null;
|
|
63
|
+
to: Address;
|
|
64
|
+
contractName: string | null;
|
|
65
|
+
value: bigint;
|
|
66
|
+
valueText: string;
|
|
67
|
+
gas: bigint | null;
|
|
68
|
+
safeTxGas: bigint | null;
|
|
69
|
+
label: string | null;
|
|
70
|
+
functionName: string | null;
|
|
71
|
+
/** The exact calldata, bound by the model's id like every call field. */
|
|
72
|
+
data: Hex;
|
|
73
|
+
selector: Hex;
|
|
74
|
+
byteLength: number;
|
|
75
|
+
/** Null when the ABI is unavailable or the arguments don't encode to the calldata. */
|
|
76
|
+
args: ReviewArgument[] | null;
|
|
77
|
+
/** The calls a batching destination makes, in order. A MultiSend's show in its `transactions` argument instead. */
|
|
78
|
+
calls: ReviewCallModel[] | null;
|
|
79
|
+
roles: ReviewRole[];
|
|
80
|
+
tokenAmounts: ReviewTokenAmount[];
|
|
81
|
+
/** The NFT an ERC-721 `approve` or `transferFrom` names: its last argument is a token ID, not an amount. */
|
|
82
|
+
nft: {
|
|
83
|
+
token: Address;
|
|
84
|
+
tokenId: bigint;
|
|
85
|
+
} | null;
|
|
86
|
+
warnings: ReviewWarning[];
|
|
87
|
+
};
|
|
88
|
+
/** One signature the action asks for, as the review shows it. */
|
|
89
|
+
export type ReviewSignatureModel = {
|
|
90
|
+
kind: TransactionReviewSignature["kind"];
|
|
91
|
+
chainId: number;
|
|
92
|
+
/** A copy of the exact EIP-712 typed data signed; null for a message. */
|
|
93
|
+
typedData: unknown | null;
|
|
94
|
+
/** The exact text signed; null for typed data. */
|
|
95
|
+
message: string | null;
|
|
96
|
+
/** The calls the signature lets someone run, decoded. */
|
|
97
|
+
calls: ReviewCallModel[];
|
|
98
|
+
/** What it authorizes, in rows (Permit2's token, amount, spender and expiry). */
|
|
99
|
+
steps: PrettyStep[];
|
|
100
|
+
};
|
|
101
|
+
export type ReviewModel = {
|
|
102
|
+
/**
|
|
103
|
+
* keccak256 of the canonical JSON of the binding fields only: kind, each
|
|
104
|
+
* call's chainId, from, to, value, gas, safeTxGas, data and any
|
|
105
|
+
* adoptIgnoringArgs (and the same for
|
|
106
|
+
* the decoded calls it shows inside), authorization, message, context, and
|
|
107
|
+
* each signature's kind, chain, typed data, text and calls. Enrichment,
|
|
108
|
+
* warnings and simulation are excluded and may change after mint.
|
|
109
|
+
*/
|
|
110
|
+
id: Hex;
|
|
111
|
+
/** "message" is an authorization signed as a plain message rather than typed data. */
|
|
112
|
+
kind: "transaction" | "authorization" | "message";
|
|
113
|
+
title: string | null;
|
|
114
|
+
description: string;
|
|
115
|
+
confirmLabel: string | null;
|
|
116
|
+
/** The site's summary rows, in the order given, shown first. */
|
|
117
|
+
context: ReviewContextRow[];
|
|
118
|
+
calls: ReviewCallModel[];
|
|
119
|
+
/** A copy of the exact typed data (or message envelope) a signature commits to. */
|
|
120
|
+
authorization: unknown | null;
|
|
121
|
+
/** The exact personal_sign text, when the action signs one message. */
|
|
122
|
+
message: string | null;
|
|
123
|
+
/** The signatures the action asks for, signed after confirm and before any call is sent. */
|
|
124
|
+
signatures: ReviewSignatureModel[];
|
|
125
|
+
/** {@link transactionReviewJson} of the request. */
|
|
126
|
+
rawJson: string;
|
|
127
|
+
warnings: ReviewWarning[];
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* The plain-data review of a request: what every client's review dialog
|
|
131
|
+
* shows, decoded once. `context` is display only and never feeds `calls`.
|
|
132
|
+
* It never throws: a request it can't read or bind exactly gets a model with
|
|
133
|
+
* an `unreadable` warning, showing what it can read, and an id that matches
|
|
134
|
+
* no other model. Core's own prompts refuse such a model: it confirms nothing.
|
|
135
|
+
*/
|
|
136
|
+
export declare function buildReviewModel(request: TransactionReviewRequest): ReviewModel;
|
|
137
|
+
type TokenReader = Pick<PublicClient, "readContract">;
|
|
138
|
+
/**
|
|
139
|
+
* The model with each token's decimals and symbol read from the token, once
|
|
140
|
+
* per token per chain. A failed read leaves them null, never zero, and keeps
|
|
141
|
+
* the `decimals-unknown` warning. A call ERC-721 shares, to an unknown
|
|
142
|
+
* contract, also asks the contract whether it is ERC-721: a yes shows the
|
|
143
|
+
* number as the NFT's token ID; a no, or decimals it answers, clears
|
|
144
|
+
* `possible-token-id`; no answer keeps it. The id is unchanged: the reads
|
|
145
|
+
* only explain the calls already bound.
|
|
146
|
+
*/
|
|
147
|
+
export declare function enrichReviewModel(model: ReviewModel, clientFor: (chainId: number) => TokenReader | undefined): Promise<ReviewModel>;
|
|
148
|
+
export {};
|
|
149
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/review/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AAGd,OAAO,EAgBL,KAAK,UAAU,EACf,KAAK,UAAU,EAChB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