@bananapus/nana-sdk-core 2.12.1 → 2.13.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 +38 -0
- package/dist/cjs/bendystrawOperations.d.ts.map +1 -0
- package/dist/cjs/bendystrawOperations.js +212 -0
- package/dist/cjs/bendystrawOperations.js.map +1 -0
- package/dist/cjs/generated/juicebox.d.ts +44 -10
- package/dist/cjs/generated/juicebox.d.ts.map +1 -1
- package/dist/cjs/generated/juicebox.js +37 -10
- package/dist/cjs/generated/juicebox.js.map +1 -1
- package/dist/cjs/review/contractWrite.d.ts +38 -0
- package/dist/cjs/review/contractWrite.d.ts.map +1 -0
- package/dist/cjs/review/contractWrite.js +57 -0
- package/dist/cjs/review/contractWrite.js.map +1 -0
- package/dist/cjs/review/gas.d.ts +28 -0
- package/dist/cjs/review/gas.d.ts.map +1 -0
- package/dist/cjs/review/gas.js +40 -0
- package/dist/cjs/review/gas.js.map +1 -0
- package/dist/cjs/review/index.d.ts +4 -0
- package/dist/cjs/review/index.d.ts.map +1 -0
- package/dist/cjs/review/index.js +20 -0
- package/dist/cjs/review/index.js.map +1 -0
- package/dist/cjs/review/transactionReview.d.ts +81 -0
- package/dist/cjs/review/transactionReview.d.ts.map +1 -0
- package/dist/cjs/review/transactionReview.js +203 -0
- package/dist/cjs/review/transactionReview.js.map +1 -0
- package/dist/cjs/safeService.d.ts +36 -0
- package/dist/cjs/safeService.d.ts.map +1 -0
- package/dist/cjs/safeService.js +142 -0
- package/dist/cjs/safeService.js.map +1 -0
- package/dist/cjs/utils/bendystraw.d.ts +15 -0
- package/dist/cjs/utils/bendystraw.d.ts.map +1 -1
- package/dist/cjs/utils/bendystraw.js +54 -0
- package/dist/cjs/utils/bendystraw.js.map +1 -1
- package/dist/cjs/v6/feeBuyback.d.ts +43 -0
- package/dist/cjs/v6/feeBuyback.d.ts.map +1 -0
- package/dist/cjs/v6/feeBuyback.js +306 -0
- package/dist/cjs/v6/feeBuyback.js.map +1 -0
- package/dist/esm/bendystrawOperations.d.ts +38 -0
- package/dist/esm/bendystrawOperations.d.ts.map +1 -0
- package/dist/esm/bendystrawOperations.js +206 -0
- package/dist/esm/bendystrawOperations.js.map +1 -0
- package/dist/esm/generated/juicebox.d.ts +44 -10
- package/dist/esm/generated/juicebox.d.ts.map +1 -1
- package/dist/esm/generated/juicebox.js +37 -10
- package/dist/esm/generated/juicebox.js.map +1 -1
- package/dist/esm/review/contractWrite.d.ts +38 -0
- package/dist/esm/review/contractWrite.d.ts.map +1 -0
- package/dist/esm/review/contractWrite.js +54 -0
- package/dist/esm/review/contractWrite.js.map +1 -0
- package/dist/esm/review/gas.d.ts +28 -0
- package/dist/esm/review/gas.d.ts.map +1 -0
- package/dist/esm/review/gas.js +36 -0
- package/dist/esm/review/gas.js.map +1 -0
- package/dist/esm/review/index.d.ts +4 -0
- package/dist/esm/review/index.d.ts.map +1 -0
- package/dist/esm/review/index.js +4 -0
- package/dist/esm/review/index.js.map +1 -0
- package/dist/esm/review/transactionReview.d.ts +81 -0
- package/dist/esm/review/transactionReview.d.ts.map +1 -0
- package/dist/esm/review/transactionReview.js +192 -0
- package/dist/esm/review/transactionReview.js.map +1 -0
- package/dist/esm/safeService.d.ts +36 -0
- package/dist/esm/safeService.d.ts.map +1 -0
- package/dist/esm/safeService.js +135 -0
- package/dist/esm/safeService.js.map +1 -0
- package/dist/esm/utils/bendystraw.d.ts +15 -0
- package/dist/esm/utils/bendystraw.d.ts.map +1 -1
- package/dist/esm/utils/bendystraw.js +53 -0
- package/dist/esm/utils/bendystraw.js.map +1 -1
- package/dist/esm/v6/feeBuyback.d.ts +43 -0
- package/dist/esm/v6/feeBuyback.d.ts.map +1 -0
- package/dist/esm/v6/feeBuyback.js +299 -0
- package/dist/esm/v6/feeBuyback.js.map +1 -0
- package/package.json +30 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type Address } from "viem";
|
|
2
|
+
export type ReviewedWritePhase = "review" | "simulating" | "signing";
|
|
3
|
+
export type ReviewedContractWriteOptions<TRequest extends {
|
|
4
|
+
chainId: number;
|
|
5
|
+
}, TSimulated, THash> = {
|
|
6
|
+
request: TRequest;
|
|
7
|
+
expectedAccount: Address | undefined;
|
|
8
|
+
review: (request: TRequest) => Promise<unknown>;
|
|
9
|
+
switchChain: (chainId: number) => Promise<unknown>;
|
|
10
|
+
currentAccount: () => Address | undefined;
|
|
11
|
+
simulate: (request: TRequest) => Promise<TSimulated>;
|
|
12
|
+
reverify?: (request: TRequest) => Promise<unknown>;
|
|
13
|
+
/** Persist recovery intent after simulation, before a wallet can broadcast. */
|
|
14
|
+
beforeWrite?: () => unknown | Promise<unknown>;
|
|
15
|
+
/** The persisted intent was rejected by a final gate before write was invoked. */
|
|
16
|
+
onBeforeWriteAborted?: () => unknown | Promise<unknown>;
|
|
17
|
+
/** Clear that intent only when the wallet explicitly rejects the write. */
|
|
18
|
+
onWriteRejected?: () => unknown | Promise<unknown>;
|
|
19
|
+
write: (simulated: TSimulated) => Promise<THash>;
|
|
20
|
+
onPhase?: (phase: ReviewedWritePhase) => void;
|
|
21
|
+
accountChangedError?: string;
|
|
22
|
+
/**
|
|
23
|
+
* An app-specific gate run before anything else, such as refusing writes while
|
|
24
|
+
* the app is impersonating another account. It throws to stop the write.
|
|
25
|
+
*/
|
|
26
|
+
guard?: () => void;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Shared review-to-wallet boundary for direct contract writes.
|
|
30
|
+
*
|
|
31
|
+
* The exact request object accepted by review is also handed to simulation,
|
|
32
|
+
* and only the simulation result reaches the wallet writer. Account identity
|
|
33
|
+
* is checked after a chain switch and again immediately before signing.
|
|
34
|
+
*/
|
|
35
|
+
export declare function submitReviewedContractWrite<TRequest extends {
|
|
36
|
+
chainId: number;
|
|
37
|
+
}, TSimulated, THash>({ request, expectedAccount, review, switchChain, currentAccount, simulate, reverify, beforeWrite, onBeforeWriteAborted, onWriteRejected, write, onPhase, accountChangedError, guard, }: ReviewedContractWriteOptions<TRequest, TSimulated, THash>): Promise<THash>;
|
|
38
|
+
//# sourceMappingURL=contractWrite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contractWrite.d.ts","sourceRoot":"","sources":["../../../src/review/contractWrite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAEzE,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC;AAErE,MAAM,MAAM,4BAA4B,CACtC,QAAQ,SAAS;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EACpC,UAAU,EACV,KAAK,IACH;IACF,OAAO,EAAE,QAAQ,CAAC;IAClB,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,MAAM,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACnD,cAAc,EAAE,MAAM,OAAO,GAAG,SAAS,CAAC;IAC1C,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACnD,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/C,kFAAkF;IAClF,oBAAoB,CAAC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxD,2EAA2E;IAC3E,eAAe,CAAC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACnD,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC;IACjD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC9C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,2BAA2B,CAC/C,QAAQ,SAAS;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EACpC,UAAU,EACV,KAAK,EACL,EACA,OAAO,EACP,eAAe,EACf,MAAM,EACN,WAAW,EACX,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,oBAAoB,EACpB,eAAe,EACf,KAAK,EACL,OAAO,EACP,mBAAgF,EAChF,KAAK,GACN,EAAE,4BAA4B,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CA+C5E"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.submitReviewedContractWrite = submitReviewedContractWrite;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* Shared review-to-wallet boundary for direct contract writes.
|
|
7
|
+
*
|
|
8
|
+
* The exact request object accepted by review is also handed to simulation,
|
|
9
|
+
* and only the simulation result reaches the wallet writer. Account identity
|
|
10
|
+
* is checked after a chain switch and again immediately before signing.
|
|
11
|
+
*/
|
|
12
|
+
async function submitReviewedContractWrite({ request, expectedAccount, review, switchChain, currentAccount, simulate, reverify, beforeWrite, onBeforeWriteAborted, onWriteRejected, write, onPhase, accountChangedError = "Connected account changed. Review the transaction again.", guard, }) {
|
|
13
|
+
guard?.();
|
|
14
|
+
if (!expectedAccount)
|
|
15
|
+
throw new Error("Connect a wallet first.");
|
|
16
|
+
onPhase?.("review");
|
|
17
|
+
await review(request);
|
|
18
|
+
onPhase?.("simulating");
|
|
19
|
+
await switchChain(request.chainId);
|
|
20
|
+
assertExpectedAccount(currentAccount(), expectedAccount, accountChangedError);
|
|
21
|
+
await reverify?.(request);
|
|
22
|
+
assertExpectedAccount(currentAccount(), expectedAccount, accountChangedError);
|
|
23
|
+
const simulated = await simulate(request);
|
|
24
|
+
assertExpectedAccount(currentAccount(), expectedAccount, accountChangedError);
|
|
25
|
+
if (beforeWrite) {
|
|
26
|
+
await beforeWrite();
|
|
27
|
+
try {
|
|
28
|
+
assertExpectedAccount(currentAccount(), expectedAccount, accountChangedError);
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
// This is strictly before the wallet writer is invoked. An ambiguous
|
|
32
|
+
// write error must never reach this cleanup path.
|
|
33
|
+
await onBeforeWriteAborted?.();
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
onPhase?.("signing");
|
|
38
|
+
try {
|
|
39
|
+
return await write(simulated);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
// The same-looking error from review/simulation never reaches this catch.
|
|
43
|
+
// An RPC timeout or ambiguous submission must preserve the recovery lock.
|
|
44
|
+
const rejected = error instanceof viem_1.UserRejectedRequestError ||
|
|
45
|
+
(error instanceof viem_1.BaseError &&
|
|
46
|
+
error.walk((cause) => cause instanceof viem_1.UserRejectedRequestError) instanceof viem_1.UserRejectedRequestError);
|
|
47
|
+
if (rejected)
|
|
48
|
+
await onWriteRejected?.();
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function assertExpectedAccount(current, expected, message) {
|
|
53
|
+
if (!current || current.toLowerCase() !== expected.toLowerCase()) {
|
|
54
|
+
throw new Error(message);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=contractWrite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contractWrite.js","sourceRoot":"","sources":["../../../src/review/contractWrite.ts"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AAC,CAAC;IACrB,IAAI,CAAC;QACH,OAAO,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,0EAA0E;QAC1E,0EAA0E;QAC1E,MAAM,QAAQ,GACZ,KAAK,YAAY,+BAAwB;YACzC,CAAC,KAAK,YAAY,gBAAS;gBACzB,KAAK,CAAC,IAAI,CACR,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,YAAY,+BAAwB,CACrD,YAAY,+BAAwB,CAAC,CAAC;QAC3C,IAAI,QAAQ;YAAE,MAAM,eAAe,EAAE,EAAE,CAAC;QACxC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,qBAAqB,CAC5B,OAA4B,EAC5B,QAAiB,EACjB,OAAe;IAEf,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;QACjE,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Address, Hex, PublicClient } from "viem";
|
|
2
|
+
/**
|
|
3
|
+
* Wallet gas limits are deliberately twice the latest RPC estimate.
|
|
4
|
+
*
|
|
5
|
+
* Some Juicebox terminal calls catch a failed internal fee payment and keep
|
|
6
|
+
* going. An RPC can therefore return an estimate for that cheaper recovery
|
|
7
|
+
* path even though the intended fee route needs more gas. Unused gas is not
|
|
8
|
+
* spent, so a 2x limit is a cheap guard against that under-estimation.
|
|
9
|
+
*/
|
|
10
|
+
export declare function gasWithHeadroom(estimate: bigint): bigint;
|
|
11
|
+
/**
|
|
12
|
+
* The gas limit to send for a call that carries a reviewed cap.
|
|
13
|
+
*
|
|
14
|
+
* A cap bounds an `eth_call` against a target-controlled contract; it is not
|
|
15
|
+
* what the call costs. Wallets reject a transaction whose `gas * maxFeePerGas`
|
|
16
|
+
* exceeds the balance, so sending the cap itself turns a 1M-gas mainnet cap
|
|
17
|
+
* into a ~0.003 ETH balance requirement for a call that burns a tenth of that.
|
|
18
|
+
*
|
|
19
|
+
* Measurement stays bounded by the cap, and the cap survives when the node
|
|
20
|
+
* cannot measure.
|
|
21
|
+
*/
|
|
22
|
+
export declare function gasWithinCap(client: PublicClient, tx: {
|
|
23
|
+
account: Address;
|
|
24
|
+
to: Address;
|
|
25
|
+
data: Hex;
|
|
26
|
+
value?: bigint;
|
|
27
|
+
}, cap?: bigint): Promise<bigint | undefined>;
|
|
28
|
+
//# sourceMappingURL=gas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gas.d.ts","sourceRoot":"","sources":["../../../src/review/gas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEvD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,YAAY,EACpB,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EAChE,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAW7B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gasWithHeadroom = gasWithHeadroom;
|
|
4
|
+
exports.gasWithinCap = gasWithinCap;
|
|
5
|
+
/**
|
|
6
|
+
* Wallet gas limits are deliberately twice the latest RPC estimate.
|
|
7
|
+
*
|
|
8
|
+
* Some Juicebox terminal calls catch a failed internal fee payment and keep
|
|
9
|
+
* going. An RPC can therefore return an estimate for that cheaper recovery
|
|
10
|
+
* path even though the intended fee route needs more gas. Unused gas is not
|
|
11
|
+
* spent, so a 2x limit is a cheap guard against that under-estimation.
|
|
12
|
+
*/
|
|
13
|
+
function gasWithHeadroom(estimate) {
|
|
14
|
+
return estimate * 2n;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The gas limit to send for a call that carries a reviewed cap.
|
|
18
|
+
*
|
|
19
|
+
* A cap bounds an `eth_call` against a target-controlled contract; it is not
|
|
20
|
+
* what the call costs. Wallets reject a transaction whose `gas * maxFeePerGas`
|
|
21
|
+
* exceeds the balance, so sending the cap itself turns a 1M-gas mainnet cap
|
|
22
|
+
* into a ~0.003 ETH balance requirement for a call that burns a tenth of that.
|
|
23
|
+
*
|
|
24
|
+
* Measurement stays bounded by the cap, and the cap survives when the node
|
|
25
|
+
* cannot measure.
|
|
26
|
+
*/
|
|
27
|
+
async function gasWithinCap(client, tx, cap) {
|
|
28
|
+
try {
|
|
29
|
+
const estimate = await client.estimateGas({
|
|
30
|
+
...tx,
|
|
31
|
+
...(cap === undefined ? {} : { gas: cap }),
|
|
32
|
+
});
|
|
33
|
+
const measured = gasWithHeadroom(estimate);
|
|
34
|
+
return cap !== undefined && cap < measured ? cap : measured;
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return cap;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=gas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gas.js","sourceRoot":"","sources":["../../../src/review/gas.ts"],"names":[],"mappings":";;AAUA,0CAEC;AAaD,oCAeC;AAtCD;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,QAAgB;IAC9C,OAAO,QAAQ,GAAG,EAAE,CAAC;AACvB,CAAC;AAED;;;;;;;;;;GAUG;AACI,KAAK,UAAU,YAAY,CAChC,MAAoB,EACpB,EAAgE,EAChE,GAAY;IAEZ,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC;YACxC,GAAG,EAAE;YACL,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;SAC3C,CAAC,CAAC;QACH,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;QAC3C,OAAO,GAAG,KAAK,SAAS,IAAI,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC9D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC;IACb,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/review/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./contractWrite.js"), exports);
|
|
18
|
+
__exportStar(require("./gas.js"), exports);
|
|
19
|
+
__exportStar(require("./transactionReview.js"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/review/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,2CAAyB;AACzB,yDAAuC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type Abi, type Address, type Hex } from "viem";
|
|
2
|
+
/**
|
|
3
|
+
* How review prompts name a chain and link its explorer. Apps pass their own
|
|
4
|
+
* chain display, which also keeps a chain table out of the review bundle.
|
|
5
|
+
*/
|
|
6
|
+
export type TransactionReviewDisplay = {
|
|
7
|
+
chainName: (chainId: number) => string;
|
|
8
|
+
explorerOrigin: (chainId: number) => string | null;
|
|
9
|
+
};
|
|
10
|
+
export type TransactionReviewCall = {
|
|
11
|
+
chainId: number;
|
|
12
|
+
to: Address;
|
|
13
|
+
data: Hex;
|
|
14
|
+
value?: bigint;
|
|
15
|
+
from?: Address;
|
|
16
|
+
abi?: Abi;
|
|
17
|
+
functionName?: string;
|
|
18
|
+
args?: readonly unknown[];
|
|
19
|
+
/** Plain-language action shown above the decoded call. */
|
|
20
|
+
label?: string;
|
|
21
|
+
/** Optional known contract name. The full address is always shown too. */
|
|
22
|
+
contractName?: string;
|
|
23
|
+
/** The calls a batching destination (MultiSend) makes in order, decoded by the caller. */
|
|
24
|
+
calls?: readonly TransactionReviewCall[];
|
|
25
|
+
};
|
|
26
|
+
export type TransactionReviewRequest = {
|
|
27
|
+
calls: readonly TransactionReviewCall[];
|
|
28
|
+
title?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
confirmLabel?: string;
|
|
31
|
+
/** Distinguishes a wallet transaction from an authorization which a relayer/Safe will submit. */
|
|
32
|
+
kind?: "transaction" | "authorization";
|
|
33
|
+
/** Exact typed data committed by a Safe/relayer signature, when applicable. */
|
|
34
|
+
authorization?: unknown;
|
|
35
|
+
};
|
|
36
|
+
export type ContractTransactionReviewCall = {
|
|
37
|
+
chainId: number;
|
|
38
|
+
address: Address;
|
|
39
|
+
abi: Abi;
|
|
40
|
+
functionName: string;
|
|
41
|
+
args?: readonly unknown[];
|
|
42
|
+
value?: bigint;
|
|
43
|
+
account?: Address;
|
|
44
|
+
};
|
|
45
|
+
export type TransactionReviewOptions = Omit<TransactionReviewRequest, "calls"> & {
|
|
46
|
+
label?: string;
|
|
47
|
+
contractName?: string;
|
|
48
|
+
};
|
|
49
|
+
type TransactionReviewHandler = (request: TransactionReviewRequest) => Promise<boolean>;
|
|
50
|
+
export type FundingChainOption = {
|
|
51
|
+
chainId: number;
|
|
52
|
+
/** The chain name and quoted funding cost shown to the user. */
|
|
53
|
+
label: string;
|
|
54
|
+
};
|
|
55
|
+
type FundingChainSelectionHandler = (options: readonly FundingChainOption[]) => Promise<number | null>;
|
|
56
|
+
export declare function registerFundingChainSelectionHandler(handler: FundingChainSelectionHandler): () => void;
|
|
57
|
+
/** Funding always requires an explicit choice, even with one quoted option. */
|
|
58
|
+
export declare function requireFundingChainSelection(options: readonly FundingChainOption[]): Promise<number>;
|
|
59
|
+
/**
|
|
60
|
+
* The provider registers the only UI capable of approving a transaction.
|
|
61
|
+
* Keeping the entry point in a small client module lets non-React wallet
|
|
62
|
+
* helpers (Safe and Relayr) use the same mandatory review queue.
|
|
63
|
+
*/
|
|
64
|
+
export declare function registerTransactionReviewHandler(handler: TransactionReviewHandler): () => void;
|
|
65
|
+
export declare function requestContractTransactionReview(call: ContractTransactionReviewCall, options?: TransactionReviewOptions): Promise<boolean>;
|
|
66
|
+
export declare function requireTransactionReview(request: TransactionReviewRequest): Promise<void>;
|
|
67
|
+
export declare function requireContractTransactionReview(call: ContractTransactionReviewCall, options?: TransactionReviewOptions): Promise<void>;
|
|
68
|
+
export declare function transactionReviewJson(request: TransactionReviewRequest): string;
|
|
69
|
+
/**
|
|
70
|
+
* The post-transaction counterpart of the review prompt: a mined tx the user
|
|
71
|
+
* wants explained (or diagnosed) from explorer evidence. Points at Etherscan's
|
|
72
|
+
* transaction-debugger skill when the reader's agent has it, and degrades to
|
|
73
|
+
* the explorer page when it doesn't.
|
|
74
|
+
*/
|
|
75
|
+
export declare function buildTransactionDebugPrompt(calls: {
|
|
76
|
+
chainId: number;
|
|
77
|
+
txHash: string;
|
|
78
|
+
}[], { chainName: displayChainName, explorerOrigin }: TransactionReviewDisplay): string;
|
|
79
|
+
export declare function buildTransactionReviewPrompt(request: TransactionReviewRequest, { explorerOrigin }: Pick<TransactionReviewDisplay, "explorerOrigin">): string;
|
|
80
|
+
export {};
|
|
81
|
+
//# sourceMappingURL=transactionReview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactionReview.d.ts","sourceRoot":"","sources":["../../../src/review/transactionReview.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,GAAG,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAE5E;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC1B,0D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IAAI,CAAC,CAAC;AAI5B,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,4BAA4B,GACpC,MAAM,IAAI,CAMZ;AAED,+EAA+E;AAC/E,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,OAAO,CAAC,MAAM,CAAC,CAkCjB;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,wBAAwB,GAChC,MAAM,IAAI,CAMZ;AA0CD,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,6BAA6B,EACnC,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CAqBlB;AASD,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CAIf;AAED,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,6BAA6B,EACnC,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,IAAI,CAAC,CAIf;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,wBAAwB,GAChC,MAAM,CAmBR;AAMD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,EAC5C,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,EAAE,wBAAwB,GACxE,MAAM,CAoBR;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,wBAAwB,EACjC,EAAE,cAAc,EAAE,EAAE,IAAI,CAAC,wBAAwB,EAAE,gBAAgB,CAAC,GACnE,MAAM,CAiER"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.registerFundingChainSelectionHandler = registerFundingChainSelectionHandler;
|
|
5
|
+
exports.requireFundingChainSelection = requireFundingChainSelection;
|
|
6
|
+
exports.registerTransactionReviewHandler = registerTransactionReviewHandler;
|
|
7
|
+
exports.requestContractTransactionReview = requestContractTransactionReview;
|
|
8
|
+
exports.requireTransactionReview = requireTransactionReview;
|
|
9
|
+
exports.requireContractTransactionReview = requireContractTransactionReview;
|
|
10
|
+
exports.transactionReviewJson = transactionReviewJson;
|
|
11
|
+
exports.buildTransactionDebugPrompt = buildTransactionDebugPrompt;
|
|
12
|
+
exports.buildTransactionReviewPrompt = buildTransactionReviewPrompt;
|
|
13
|
+
const viem_1 = require("viem");
|
|
14
|
+
const transactionReviewHandlers = [];
|
|
15
|
+
const fundingChainSelectionHandlers = [];
|
|
16
|
+
function registerFundingChainSelectionHandler(handler) {
|
|
17
|
+
fundingChainSelectionHandlers.push(handler);
|
|
18
|
+
return () => {
|
|
19
|
+
const index = fundingChainSelectionHandlers.lastIndexOf(handler);
|
|
20
|
+
if (index >= 0)
|
|
21
|
+
fundingChainSelectionHandlers.splice(index, 1);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Funding always requires an explicit choice, even with one quoted option. */
|
|
25
|
+
async function requireFundingChainSelection(options) {
|
|
26
|
+
const snapshot = options.map((option) => ({ ...option }));
|
|
27
|
+
const chainIds = new Set(snapshot.map((option) => option.chainId));
|
|
28
|
+
if (!snapshot.length ||
|
|
29
|
+
chainIds.size !== snapshot.length ||
|
|
30
|
+
snapshot.some((option) => !Number.isSafeInteger(option.chainId) ||
|
|
31
|
+
option.chainId <= 0 ||
|
|
32
|
+
!option.label.trim())) {
|
|
33
|
+
throw new Error("No valid funding chain choices are available. Request a new quote.");
|
|
34
|
+
}
|
|
35
|
+
const handler = fundingChainSelectionHandlers[fundingChainSelectionHandlers.length - 1];
|
|
36
|
+
if (!handler) {
|
|
37
|
+
throw new Error("Funding chain selection is unavailable. Reload the page before continuing.");
|
|
38
|
+
}
|
|
39
|
+
const selected = await handler(snapshot);
|
|
40
|
+
if (selected === null) {
|
|
41
|
+
throw new Error("Funding chain selection cancelled. Nothing was sent.");
|
|
42
|
+
}
|
|
43
|
+
if (!chainIds.has(selected)) {
|
|
44
|
+
throw new Error("The selected funding chain is not available in this quote.");
|
|
45
|
+
}
|
|
46
|
+
return selected;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The provider registers the only UI capable of approving a transaction.
|
|
50
|
+
* Keeping the entry point in a small client module lets non-React wallet
|
|
51
|
+
* helpers (Safe and Relayr) use the same mandatory review queue.
|
|
52
|
+
*/
|
|
53
|
+
function registerTransactionReviewHandler(handler) {
|
|
54
|
+
transactionReviewHandlers.push(handler);
|
|
55
|
+
return () => {
|
|
56
|
+
const index = transactionReviewHandlers.lastIndexOf(handler);
|
|
57
|
+
if (index >= 0)
|
|
58
|
+
transactionReviewHandlers.splice(index, 1);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
async function requestTransactionReview(request) {
|
|
62
|
+
if (!request.calls.length && !request.authorization) {
|
|
63
|
+
throw new Error("There is no transaction to review.");
|
|
64
|
+
}
|
|
65
|
+
const transactionReviewHandler = transactionReviewHandlers[transactionReviewHandlers.length - 1];
|
|
66
|
+
if (!transactionReviewHandler) {
|
|
67
|
+
throw new Error("Transaction review is unavailable. Reload the page before continuing.");
|
|
68
|
+
}
|
|
69
|
+
return transactionReviewHandler(request);
|
|
70
|
+
}
|
|
71
|
+
/** Encode once for review using the same ABI/function/args passed to wagmi. */
|
|
72
|
+
function contractCallForReview(call, options = {}) {
|
|
73
|
+
const data = (0, viem_1.encodeFunctionData)({
|
|
74
|
+
abi: call.abi,
|
|
75
|
+
functionName: call.functionName,
|
|
76
|
+
args: call.args,
|
|
77
|
+
});
|
|
78
|
+
return {
|
|
79
|
+
chainId: call.chainId,
|
|
80
|
+
to: call.address,
|
|
81
|
+
data,
|
|
82
|
+
value: call.value,
|
|
83
|
+
from: call.account,
|
|
84
|
+
abi: call.abi,
|
|
85
|
+
functionName: call.functionName,
|
|
86
|
+
args: call.args,
|
|
87
|
+
label: options.label,
|
|
88
|
+
contractName: options.contractName,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function requestContractTransactionReview(call, options = {}) {
|
|
92
|
+
const { label, contractName, ...requestOptions } = options;
|
|
93
|
+
const reviewed = contractCallForReview(call, { label, contractName });
|
|
94
|
+
return requestTransactionReview({
|
|
95
|
+
...requestOptions,
|
|
96
|
+
calls: [reviewed],
|
|
97
|
+
}).then((approved) => {
|
|
98
|
+
if (!approved)
|
|
99
|
+
return false;
|
|
100
|
+
const current = contractCallForReview(call, { label, contractName });
|
|
101
|
+
if (current.chainId !== reviewed.chainId ||
|
|
102
|
+
current.to.toLowerCase() !== reviewed.to.toLowerCase() ||
|
|
103
|
+
(current.value ?? 0n) !== (reviewed.value ?? 0n) ||
|
|
104
|
+
current.data !== reviewed.data) {
|
|
105
|
+
throw new Error("Transaction data changed after review. Nothing was sent; review it again.");
|
|
106
|
+
}
|
|
107
|
+
return true;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
class TransactionReviewCancelledError extends Error {
|
|
111
|
+
constructor() {
|
|
112
|
+
super("Review closed. Nothing was sent.");
|
|
113
|
+
this.name = "TransactionReviewCancelledError";
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
async function requireTransactionReview(request) {
|
|
117
|
+
if (!(await requestTransactionReview(request))) {
|
|
118
|
+
throw new TransactionReviewCancelledError();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async function requireContractTransactionReview(call, options = {}) {
|
|
122
|
+
if (!(await requestContractTransactionReview(call, options))) {
|
|
123
|
+
throw new TransactionReviewCancelledError();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function transactionReviewJson(request) {
|
|
127
|
+
const transactions = request.calls.map((call) => ({
|
|
128
|
+
chainId: call.chainId,
|
|
129
|
+
from: call.from,
|
|
130
|
+
to: call.to,
|
|
131
|
+
value: `0x${(call.value ?? 0n).toString(16)}`,
|
|
132
|
+
data: call.data,
|
|
133
|
+
}));
|
|
134
|
+
const calls = transactions.length === 1 ? transactions[0] : { transactions };
|
|
135
|
+
const payload = request.authorization
|
|
136
|
+
? transactions.length > 0
|
|
137
|
+
? { authorization: request.authorization, resultingCall: calls }
|
|
138
|
+
: { authorization: request.authorization }
|
|
139
|
+
: calls;
|
|
140
|
+
return JSON.stringify(payload, (_, value) => (typeof value === "bigint" ? value.toString() : value), 2);
|
|
141
|
+
}
|
|
142
|
+
/** A website/-style prompt which keeps the exact reviewed RPC call intact. */
|
|
143
|
+
const ETHERSCAN_SKILL_LINE = "If your agent has Etherscan's skills installed (`npx skills add etherscan/skills`), run `etherscan-contract-review` on each target address to pull its verified source, proxy roles, and privileged controls before decoding. Otherwise work from the explorer pages.";
|
|
144
|
+
/**
|
|
145
|
+
* The post-transaction counterpart of the review prompt: a mined tx the user
|
|
146
|
+
* wants explained (or diagnosed) from explorer evidence. Points at Etherscan's
|
|
147
|
+
* transaction-debugger skill when the reader's agent has it, and degrades to
|
|
148
|
+
* the explorer page when it doesn't.
|
|
149
|
+
*/
|
|
150
|
+
function buildTransactionDebugPrompt(calls, { chainName: displayChainName, explorerOrigin }) {
|
|
151
|
+
const lines = [
|
|
152
|
+
"A Juicebox V6 transaction (the nana V6 / revnet V6 protocol release, not an older Juicebox version) was mined. Explain what happened in it and whether it did what a Juicebox user would expect.",
|
|
153
|
+
"",
|
|
154
|
+
];
|
|
155
|
+
calls.forEach((call) => {
|
|
156
|
+
const explorer = explorerOrigin(call.chainId);
|
|
157
|
+
lines.push(`- ${displayChainName(call.chainId)} (chain ${call.chainId}): ${explorer ? `${explorer}/tx/${call.txHash}` : call.txHash}`);
|
|
158
|
+
});
|
|
159
|
+
lines.push("", "If your agent has Etherscan's skills installed (`npx skills add etherscan/skills`), use `etherscan-transaction-debugger` in security mode on each hash. Otherwise work from the explorer page: receipt status, decoded input, event logs, and internal transactions.", "", "Verify contract source only against the Juicebox V6 repositories: https://github.com/Bananapus/version-6 (repositories ending in `-v6`; same-named repositories without that suffix are older versions).", "", "Report the decoded method and arguments, every native and token movement with its recipient, every permission, ownership, or ruleset change, and, if it reverted, the narrowest root cause the evidence supports. Mark each claim observed, derived, or inferred. Never invent a function name, amount, or revert reason. End with one line: what the transaction did in plain English, and anything that looks wrong.");
|
|
160
|
+
return lines.join("\n");
|
|
161
|
+
}
|
|
162
|
+
function buildTransactionReviewPrompt(request, { explorerOrigin }) {
|
|
163
|
+
const lines = [
|
|
164
|
+
"I'm about to authorize a blockchain transaction in the Juicebox V6 app (the nana V6 / revnet V6 protocol release, not an older Juicebox version). Act as a careful security reviewer. Independently verify the payload against the deployed contracts and V6 source, confirm it matches my intent, and give a go/no-go. Assume the UI could be spoofed; trust the onchain call and verified V6 source over the page.",
|
|
165
|
+
"",
|
|
166
|
+
"Exact app-controlled transaction payload:",
|
|
167
|
+
"```json",
|
|
168
|
+
transactionReviewJson(request),
|
|
169
|
+
"```",
|
|
170
|
+
"",
|
|
171
|
+
];
|
|
172
|
+
if (typeof window !== "undefined") {
|
|
173
|
+
lines.push("Audit the app build I am using:");
|
|
174
|
+
lines.push(`- Page: ${window.location.href}`);
|
|
175
|
+
lines.push("- Confirm this page builds exactly the destination, native value, and calldata above, with no hidden or substituted call.");
|
|
176
|
+
lines.push("");
|
|
177
|
+
}
|
|
178
|
+
lines.push("Verify the contracts and protocol version:");
|
|
179
|
+
lines.push("- Juicebox V6 ecosystem source: https://github.com/Bananapus/version-6");
|
|
180
|
+
lines.push("- Use only V6 repositories (normally ending in `-v6`); same-named repositories without that suffix may be older and incompatible.");
|
|
181
|
+
lines.push(`- ${ETHERSCAN_SKILL_LINE}`);
|
|
182
|
+
request.calls.forEach((call, index) => {
|
|
183
|
+
// Apps pass their one explorer registry; a second copy once drifted on OP mainnet.
|
|
184
|
+
const explorer = explorerOrigin(call.chainId);
|
|
185
|
+
const prefix = request.calls.length > 1 ? `Transaction ${index + 1}` : "Target";
|
|
186
|
+
lines.push(explorer
|
|
187
|
+
? `- ${prefix} onchain: ${explorer}/address/${call.to}`
|
|
188
|
+
: `- ${prefix}: chain ${call.chainId}, address ${call.to}`);
|
|
189
|
+
});
|
|
190
|
+
lines.push("");
|
|
191
|
+
lines.push("Check specifically:");
|
|
192
|
+
lines.push("1. Decode the calldata selector and every argument. Explain in plain English what state, permissions, ownership, tokens, or funds can change.");
|
|
193
|
+
lines.push("2. Verify the chain ID, `to` address, native `value`, and calldata exactly. Flag any unexpected non-zero value or unknown target.");
|
|
194
|
+
lines.push("3. Identify every beneficiary, recipient, spender, operator, owner, hook, terminal, and permission-bearing address in the decoded arguments.");
|
|
195
|
+
lines.push("4. Warn about unlimited approvals, arbitrary-call capability, delegatecalls, ownership transfers, permission grants, upgradeability, or drain paths.");
|
|
196
|
+
lines.push("5. For multiple chains, confirm the intended change is consistent and that no extra chain or call was added.");
|
|
197
|
+
lines.push("");
|
|
198
|
+
lines.push("Before your verdict, quiz me with 2–4 short plain-English questions about what I expect to happen (what changes, who receives or controls what, how much value moves, and on which chain). Wait for my answers, compare them with the decoded payload, and flag every mismatch.");
|
|
199
|
+
lines.push("");
|
|
200
|
+
lines.push("End with one verdict: SAFE TO SIGN / DO NOT SIGN / NEEDS MORE INFO, followed by the most important reasons. If the target is not a recognizable verified Juicebox V6 deployment, say so explicitly.");
|
|
201
|
+
return lines.join("\n");
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=transactionReview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactionReview.js","sourceRoot":"","sources":["../../../src/review/transactionReview.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AA6Eb,oFAQC;AAGD,oEAoCC;AAOD,4EAQC;AA0CD,4EAwBC;AASD,4DAMC;AAED,4EAOC;AAED,sDAqBC;AAYD,kEAuBC;AAED,oEAoEC;AAnWD,+BAA4E;AA6D5E,MAAM,yBAAyB,GAA+B,EAAE,CAAC;AAYjE,MAAM,6BAA6B,GAAmC,EAAE,CAAC;AAEzE,SAAgB,oCAAoC,CACl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CAAC;IACf,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IAClC,KAAK,CAAC,IAAI,CACR,+IAA+I,CAChJ,CAAC;IACF,KAAK,CAAC,IAAI,CACR,mIAAmI,CACpI,CAAC;IACF,KAAK,CAAC,IAAI,CACR,8IAA8I,CAC/I,CAAC;IACF,KAAK,CAAC,IAAI,CACR,sJAAsJ,CACvJ,CAAC;IACF,KAAK,CAAC,IAAI,CACR,8GAA8G,CAC/G,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CACR,iRAAiR,CAClR,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CACR,qMAAqM,CACtM,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Address, Hex } from "viem";
|
|
2
|
+
/**
|
|
3
|
+
* Safe's per-chain app URL prefix. Wider than {@link SAFE_SERVICE_PREFIX}:
|
|
4
|
+
* Safe app links work on chains without a hosted transaction service.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SAFE_PREFIX: Partial<Record<number, string>>;
|
|
7
|
+
/**
|
|
8
|
+
* Chains with a HOSTED Safe Transaction Service — a smaller set than the
|
|
9
|
+
* chains Safe app links work on: `api.safe.global/tx-service/{opsepolia,
|
|
10
|
+
* arb1-sep}` both 404, while `basesep` is live. Probed against
|
|
11
|
+
* `/api/v1/about/`. This split from {@link SAFE_PREFIX} is DELIBERATE:
|
|
12
|
+
* conflating the two maps is what made service calls fire at chains with
|
|
13
|
+
* none. Every tx-service URL must come from here, never from `SAFE_PREFIX`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const SAFE_SERVICE_PREFIX: Partial<Record<number, string>>;
|
|
16
|
+
/** The Safe Transaction Service base URL for a chain, honoring the
|
|
17
|
+
* `jb-safe-tx-base` localStorage override; null when the chain has none. */
|
|
18
|
+
export declare function safeServiceBase(chainId: number): string | null;
|
|
19
|
+
export declare const SAFE_NONCE_GUIDANCE = "On Safe\u2019s confirmation screen, Nonce defaults to the next available value. Open its dropdown to see queued nonces and replace one if desired.";
|
|
20
|
+
/** The unix deadline for a swap/liquidity transaction proposed now. */
|
|
21
|
+
export declare function swapDeadline(isSafe: boolean, nowMs?: number): bigint;
|
|
22
|
+
export declare function safeQueueUrl(chainId: number, safe: Address): string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Resolve a Safe proposal identifier to its actual onchain execution hash.
|
|
25
|
+
* A safeTxHash is not a transaction hash and must never be receipt-polled.
|
|
26
|
+
*
|
|
27
|
+
* The polling URL comes from {@link safeServiceBase} (the hosted-service
|
|
28
|
+
* map), NOT `SAFE_PREFIX`: OP Sepolia and Arbitrum Sepolia have Safe app
|
|
29
|
+
* URLs but no hosted transaction service, and polling a nonexistent service
|
|
30
|
+
* left every Safe write there pending forever.
|
|
31
|
+
*/
|
|
32
|
+
export declare function waitForSafeExecutionHash(chainId: number, safeTxHash: Hex, options?: {
|
|
33
|
+
pollingIntervalMs?: number;
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
}): Promise<Hex>;
|
|
36
|
+
//# sourceMappingURL=safeService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safeService.d.ts","sourceRoot":"","sources":["../../src/safeService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASvD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAO/D,CAAC;AAEF;6EAC6E;AAC7E,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAW9D;AAED,eAAO,MAAM,mBAAmB,uJACiH,CAAC;AAUlJ,uEAAuE;AACvE,wBAAgB,YAAY,CAC1B,MAAM,EAAE,OAAO,EACf,KAAK,GAAE,MAAmB,GACzB,MAAM,CAKR;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAK1E;AAWD;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,GAAG,EACf,OAAO,GAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAO,GACjE,OAAO,CAAC,GAAG,CAAC,CAiEd"}
|