@charterlabs/rhinestone-sdk 0.3.4 → 0.3.6
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/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +7 -7
- package/dist/src/actions/ecdsa.test.js +2 -2
- package/dist/src/actions/passkeys.test.js +2 -2
- package/dist/src/actions/recovery.test.js +2 -2
- package/dist/src/execution/error.d.ts +8 -1
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +10 -1
- package/dist/src/execution/index.d.ts +2 -1
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +21 -15
- package/dist/src/execution/singleChainOps.d.ts +6 -42
- package/dist/src/execution/singleChainOps.d.ts.map +1 -1
- package/dist/src/execution/singleChainOps.js +3 -52
- package/dist/src/execution/utils.d.ts +4 -5
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +24 -40
- package/dist/src/execution/utils.test.d.ts +2 -0
- package/dist/src/execution/utils.test.d.ts.map +1 -0
- package/dist/src/execution/utils.test.js +49 -0
- package/dist/src/index.d.ts +5 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +12 -6
- package/dist/src/modules/index.d.ts +2 -2
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +5 -1
- package/dist/src/modules/read.d.ts +2 -1
- package/dist/src/modules/read.d.ts.map +1 -1
- package/dist/src/modules/read.js +52 -0
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +2 -0
- package/dist/src/orchestrator/consts.d.ts +2 -2
- package/dist/src/orchestrator/consts.d.ts.map +1 -1
- package/dist/src/orchestrator/consts.js +3 -3
- package/dist/src/orchestrator/index.d.ts +2 -2
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/types.d.ts +41 -1
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/types.d.ts +4 -3
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +17 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAMV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAER,KAAK,YAAY,EAEjB,KAAK,SAAS,EAGf,MAAM,MAAM,CAAA;AAUb,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAG/C,OAAO,KAAK,EACV,qBAAqB,EACrB,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACV,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,qCAAqC,EACrC,YAAY,EACZ,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,8BAA8B,EAC9B,kCAAkC,EAClC,2BAA2B,EAC3B,wCAAwC,EACxC,4BAA4B,EAC5B,cAAc,EACd,mCAAmC,EACnC,wBAAwB,EACxB,kCAAkC,EAClC,4BAA4B,EAC5B,mCAAmC,EACpC,MAAM,SAAS,CAAA;AAkDhB,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,SAAS,CAAA;AA8ChB,iBAAS,WAAW,CAAC,MAAM,EAAE,gBAAgB;;;;;cAkB5C;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,gBAAgB;;;;;cAkB9C;AAED,iBAAe,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,0BAsB1D;AAED,iBAAS,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,GAAG;;;EAenE;AAED,iBAAS,eAAe,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK;;;;;;EA0B9D;AAED,iBAAS,0BAA0B,CACjC,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,MAAM,GACb,IAAI,EAAE,CAiCR;AAED,i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BAA8B,EAC9B,kCAAkC,EAClC,8BAA8B,EAC9B,kCAAkC,EAClC,2BAA2B,EAC3B,wCAAwC,EACxC,4BAA4B,EAC5B,mCAAmC,EACnC,wBAAwB,EACxB,kCAAkC,EAClC,4BAA4B,EAC5B,mCAAmC,GACpC,CAAA"}
|
|
@@ -411,17 +411,17 @@ async function isDeployed(config, chain) {
|
|
|
411
411
|
return (0, viem_1.size)(code) > 0;
|
|
412
412
|
}
|
|
413
413
|
async function deploy(config, chain, params) {
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
throw new error_1.FactoryArgsNotAvailableError();
|
|
414
|
+
const deployed = await isDeployed(config, chain);
|
|
415
|
+
if (deployed) {
|
|
416
|
+
return false;
|
|
418
417
|
}
|
|
418
|
+
const account = getAccountProvider(config);
|
|
419
419
|
if (account.type === 'eoa') {
|
|
420
420
|
return false;
|
|
421
421
|
}
|
|
422
|
-
const
|
|
423
|
-
if (
|
|
424
|
-
|
|
422
|
+
const deployArgs = getDeployArgs(config);
|
|
423
|
+
if (!deployArgs) {
|
|
424
|
+
throw new error_1.FactoryArgsNotAvailableError();
|
|
425
425
|
}
|
|
426
426
|
const intentExecutorInstalled = 'intentExecutorInstalled' in deployArgs
|
|
427
427
|
? deployArgs.intentExecutorInstalled
|
|
@@ -12,7 +12,7 @@ const MOCK_OWNER_C = '0xb31e76f19defe76edc4b7eceeb4b0a2d6ddaca39';
|
|
|
12
12
|
const accountAddress = '0x36C03e7D593F7B2C6b06fC18B5f4E9a4A29C99b0';
|
|
13
13
|
(0, vitest_1.describe)('ECDSA Actions', () => {
|
|
14
14
|
(0, vitest_1.describe)('Install Ownable Validator', async () => {
|
|
15
|
-
const rhinestone = new index_1.RhinestoneSDK();
|
|
15
|
+
const rhinestone = new index_1.RhinestoneSDK({ apiKey: 'test' });
|
|
16
16
|
const rhinestoneAccount = await rhinestone.createAccount({
|
|
17
17
|
owners: {
|
|
18
18
|
type: 'ecdsa',
|
|
@@ -51,7 +51,7 @@ const accountAddress = '0x36C03e7D593F7B2C6b06fC18B5f4E9a4A29C99b0';
|
|
|
51
51
|
});
|
|
52
52
|
});
|
|
53
53
|
(0, vitest_1.describe)('Uninstall Ownable Validator', async () => {
|
|
54
|
-
const rhinestone = new index_1.RhinestoneSDK();
|
|
54
|
+
const rhinestone = new index_1.RhinestoneSDK({ apiKey: 'test' });
|
|
55
55
|
const rhinestoneAccount = await rhinestone.createAccount({
|
|
56
56
|
owners: {
|
|
57
57
|
type: 'ecdsa',
|
|
@@ -9,7 +9,7 @@ const passkeys_1 = require("./passkeys");
|
|
|
9
9
|
const accountAddress = '0x36C03e7D593F7B2C6b06fC18B5f4E9a4A29C99b0';
|
|
10
10
|
(0, vitest_1.describe)('Passkeys Actions', () => {
|
|
11
11
|
(0, vitest_1.describe)('Install WebAuthn Validator', async () => {
|
|
12
|
-
const rhinestone = new index_1.RhinestoneSDK();
|
|
12
|
+
const rhinestone = new index_1.RhinestoneSDK({ apiKey: 'test' });
|
|
13
13
|
const rhinestoneAccount = await rhinestone.createAccount({
|
|
14
14
|
owners: {
|
|
15
15
|
type: 'ecdsa',
|
|
@@ -33,7 +33,7 @@ const accountAddress = '0x36C03e7D593F7B2C6b06fC18B5f4E9a4A29C99b0';
|
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
35
|
(0, vitest_1.describe)('Uninstall WebAuthn Validator', async () => {
|
|
36
|
-
const rhinestone = new index_1.RhinestoneSDK();
|
|
36
|
+
const rhinestone = new index_1.RhinestoneSDK({ apiKey: 'test' });
|
|
37
37
|
const rhinestoneAccount = await rhinestone.createAccount({
|
|
38
38
|
owners: {
|
|
39
39
|
type: 'ecdsa',
|
|
@@ -19,7 +19,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
19
19
|
});
|
|
20
20
|
(0, vitest_1.describe)('Recovery Actions', () => {
|
|
21
21
|
(0, vitest_1.describe)('Set Up Recovery', async () => {
|
|
22
|
-
const rhinestone = new index_1.RhinestoneSDK();
|
|
22
|
+
const rhinestone = new index_1.RhinestoneSDK({ apiKey: 'test' });
|
|
23
23
|
const rhinestoneAccount = await rhinestone.createAccount({
|
|
24
24
|
owners: {
|
|
25
25
|
type: 'ecdsa',
|
|
@@ -48,7 +48,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
(0, vitest_1.describe)('Recover', () => {
|
|
51
|
-
const rhinestone = new index_1.RhinestoneSDK();
|
|
51
|
+
const rhinestone = new index_1.RhinestoneSDK({ apiKey: 'test' });
|
|
52
52
|
const accountPromise = rhinestone.createAccount({
|
|
53
53
|
owners: {
|
|
54
54
|
type: 'ecdsa',
|
|
@@ -50,6 +50,13 @@ declare class IntentStatusTimeoutError extends ExecutionError {
|
|
|
50
50
|
traceId?: string;
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
+
declare class Eip7702InitSignatureRequiredError extends ExecutionError {
|
|
54
|
+
constructor(params?: {
|
|
55
|
+
context?: any;
|
|
56
|
+
errorType?: string;
|
|
57
|
+
traceId?: string;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
53
60
|
declare function isExecutionError(error: Error): error is ExecutionError;
|
|
54
|
-
export { isExecutionError, ExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, IntentFailedError, IntentStatusTimeoutError, SignerNotSupportedError, };
|
|
61
|
+
export { isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, OrderPathRequiredForIntentsError, SessionChainRequiredError, IntentFailedError, IntentStatusTimeoutError, SignerNotSupportedError, };
|
|
55
62
|
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../execution/error.ts"],"names":[],"mappings":"AAAA,cAAM,cAAe,SAAQ,KAAK;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAK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B,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAOF;AAED,cAAM,iBAAkB,SAAQ,cAAc;gBAChC,MAAM,CAAC,EAAE;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAMF;AAED,cAAM,wBAAyB,SAAQ,cAAc;gBACvC,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAMF;AAED,cAAM,iCAAkC,SAAQ,cAAc;gBAChD,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAOF;AAED,iBAAS,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,cAAc,CAE/D;AAED,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,iCAAiC,EACjC,gCAAgC,EAChC,yBAAyB,EACzB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,GACxB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SignerNotSupportedError = exports.IntentStatusTimeoutError = exports.IntentFailedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.ExecutionError = void 0;
|
|
3
|
+
exports.SignerNotSupportedError = exports.IntentStatusTimeoutError = exports.IntentFailedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.Eip7702InitSignatureRequiredError = exports.ExecutionError = void 0;
|
|
4
4
|
exports.isExecutionError = isExecutionError;
|
|
5
5
|
class ExecutionError extends Error {
|
|
6
6
|
_message;
|
|
@@ -73,6 +73,15 @@ class IntentStatusTimeoutError extends ExecutionError {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
exports.IntentStatusTimeoutError = IntentStatusTimeoutError;
|
|
76
|
+
class Eip7702InitSignatureRequiredError extends ExecutionError {
|
|
77
|
+
constructor(params) {
|
|
78
|
+
super({
|
|
79
|
+
message: 'EIP-7702 initialization signature is required for 7702 accounts. This signature is needed during transaction preparation, even if your account is already deployed on all chains. Use `getEip7702InitSignature()` to generate it.',
|
|
80
|
+
...params,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.Eip7702InitSignatureRequiredError = Eip7702InitSignatureRequiredError;
|
|
76
85
|
function isExecutionError(error) {
|
|
77
86
|
return error instanceof ExecutionError;
|
|
78
87
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Address, type Chain, type Hex } from 'viem';
|
|
2
2
|
import type { UserOperationReceipt } from 'viem/_types/account-abstraction';
|
|
3
|
-
import type
|
|
3
|
+
import { type IntentOpStatus, type SplitIntentsInput } from '../orchestrator';
|
|
4
4
|
import type { SettlementLayer } from '../orchestrator/types';
|
|
5
5
|
import type { CalldataInput, CallInput, RhinestoneAccountConfig, RhinestoneConfig, SignerSet, SourceAssetInput, Sponsorship, TokenRequest, TokenSymbol, Transaction, UserOperationTransaction } from '../types';
|
|
6
6
|
import { ExecutionError, IntentFailedError, IntentStatusTimeoutError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError } from './error';
|
|
@@ -24,6 +24,7 @@ declare function sendTransactionInternal(config: RhinestoneConfig, sourceChains:
|
|
|
24
24
|
recipient?: RhinestoneAccountConfig | Address;
|
|
25
25
|
signers?: SignerSet;
|
|
26
26
|
sponsored?: Sponsorship;
|
|
27
|
+
eip7702InitSignature?: Hex;
|
|
27
28
|
settlementLayers?: SettlementLayer[];
|
|
28
29
|
sourceAssets?: SourceAssetInput;
|
|
29
30
|
lockFunds?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAsB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAA;AAC7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAsB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAA;AAC7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAG3E,OAAO,EAML,KAAK,cAAc,EAGnB,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAA;AAMxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,uBAAuB,EACvB,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,WAAW,EACX,wBAAwB,EACzB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,wBAAwB,EACxB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAoBrE,UAAU,iBAAiB;IACzB,IAAI,EAAE;QACJ,IAAI,EAAE,GAAG,GAAG,SAAS,CAAA;QACrB,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,MAAM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E,UAAU,EAAE,OAAO,gDAYxE;AAED,iBAAe,eAAe,CAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,QAAQ,EAAE,MAAM,GACf,OAAO,CACR,iBAAiB,GAAG;IAClB,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;CACjC,CACF,CAcA;AAED,iBAAe,YAAY,CACzB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,KAAK,EAAE,iBAAiB,yDAIzB;AAED,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,YAAY,EAEZ,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,wBAAwB,EACxB,gCAAgC,EAChC,yBAAyB,EACzB,uBAAuB,GACxB,CAAA;AACD,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -10,7 +10,6 @@ exports.getPortfolio = getPortfolio;
|
|
|
10
10
|
exports.getIntentStatus = getIntentStatus;
|
|
11
11
|
exports.splitIntents = splitIntents;
|
|
12
12
|
const viem_1 = require("viem");
|
|
13
|
-
const chains_1 = require("viem/chains");
|
|
14
13
|
const accounts_1 = require("../accounts");
|
|
15
14
|
const utils_1 = require("../accounts/utils");
|
|
16
15
|
const orchestrator_1 = require("../orchestrator");
|
|
@@ -33,7 +32,7 @@ const POLL_ERROR_BACKOFF_MAX_MS = 10000;
|
|
|
33
32
|
async function sendTransaction(config, transaction) {
|
|
34
33
|
const sourceChains = 'chain' in transaction ? [transaction.chain] : transaction.sourceChains;
|
|
35
34
|
const targetChain = 'chain' in transaction ? transaction.chain : transaction.targetChain;
|
|
36
|
-
const { calls, gasLimit, tokenRequests, recipient, signers, sponsored, settlementLayers, sourceAssets, feeAsset, } = transaction;
|
|
35
|
+
const { calls, gasLimit, tokenRequests, recipient, signers, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, } = transaction;
|
|
37
36
|
const isUserOpSigner = signers?.type === 'guardians';
|
|
38
37
|
if (isUserOpSigner) {
|
|
39
38
|
throw new error_1.SignerNotSupportedError();
|
|
@@ -45,6 +44,7 @@ async function sendTransaction(config, transaction) {
|
|
|
45
44
|
recipient,
|
|
46
45
|
signers,
|
|
47
46
|
sponsored,
|
|
47
|
+
eip7702InitSignature,
|
|
48
48
|
settlementLayers,
|
|
49
49
|
sourceAssets,
|
|
50
50
|
feeAsset,
|
|
@@ -58,14 +58,14 @@ async function sendUserOperation(config, transaction) {
|
|
|
58
58
|
async function sendTransactionInternal(config, sourceChains, targetChain, options) {
|
|
59
59
|
const accountAddress = (0, accounts_1.getAddress)(config);
|
|
60
60
|
const resolvedCalls = await (0, utils_2.resolveCallInputs)(options.callInputs, config, targetChain, accountAddress);
|
|
61
|
-
const tokenRequests = (0, utils_2.getTokenRequests)(
|
|
61
|
+
const tokenRequests = (0, utils_2.getTokenRequests)(targetChain, options.initialTokenRequests);
|
|
62
62
|
const sendAsUserOp = options.signers?.type === 'guardians' ||
|
|
63
63
|
options.signers?.type === 'experimental_session';
|
|
64
64
|
if (sendAsUserOp) {
|
|
65
65
|
throw new error_1.SignerNotSupportedError();
|
|
66
66
|
}
|
|
67
67
|
else {
|
|
68
|
-
return await sendTransactionAsIntent(config, sourceChains, targetChain, resolvedCalls, options.gasLimit, tokenRequests, options.recipient, options.signers, options.sponsored, options.settlementLayers, options.sourceAssets, options.feeAsset, options.lockFunds);
|
|
68
|
+
return await sendTransactionAsIntent(config, sourceChains, targetChain, resolvedCalls, options.gasLimit, tokenRequests, options.recipient, options.signers, options.sponsored, options.eip7702InitSignature, options.settlementLayers, options.sourceAssets, options.feeAsset, options.lockFunds);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
async function sendUserOperationInternal(config, chain, callInputs, signers) {
|
|
@@ -91,8 +91,8 @@ async function sendUserOperationInternal(config, chain, callInputs, signers) {
|
|
|
91
91
|
chain: chain.id,
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
async function sendTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipient, signers, sponsored, settlementLayers, sourceAssets, feeAsset, lockFunds) {
|
|
95
|
-
const intentRoute = await (0, utils_2.prepareTransactionAsIntent)(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipient, sponsored ?? false,
|
|
94
|
+
async function sendTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipient, signers, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds) {
|
|
95
|
+
const intentRoute = await (0, utils_2.prepareTransactionAsIntent)(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipient, sponsored ?? false, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds, undefined, undefined, signers);
|
|
96
96
|
if (!intentRoute) {
|
|
97
97
|
throw new error_1.OrderPathRequiredForIntentsError();
|
|
98
98
|
}
|
|
@@ -127,7 +127,7 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
|
|
|
127
127
|
},
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
const orchestrator = (0,
|
|
130
|
+
const orchestrator = (0, orchestrator_1.getOrchestrator)(config.apiKey, config.endpointUrl);
|
|
131
131
|
try {
|
|
132
132
|
intentStatus = await orchestrator.getIntentOpStatus(result.id);
|
|
133
133
|
// reset error backoff on success
|
|
@@ -206,20 +206,26 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
|
|
|
206
206
|
}
|
|
207
207
|
async function getPortfolio(config, onTestnets) {
|
|
208
208
|
const address = (0, accounts_1.getAddress)(config);
|
|
209
|
-
const
|
|
210
|
-
const
|
|
211
|
-
|
|
209
|
+
const orchestrator = (0, orchestrator_1.getOrchestrator)(config.apiKey, config.endpointUrl);
|
|
210
|
+
const supportedChainIds = (0, registry_1.getSupportedChainIds)();
|
|
211
|
+
const filteredChainIds = supportedChainIds.filter((id) => {
|
|
212
|
+
try {
|
|
213
|
+
return (0, registry_1.isTestnet)(id) === onTestnets;
|
|
214
|
+
}
|
|
215
|
+
catch {
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
return orchestrator.getPortfolio(address, { chainIds: filteredChainIds });
|
|
212
220
|
}
|
|
213
221
|
async function getIntentStatus(apiKey, endpointUrl, intentId) {
|
|
214
|
-
const
|
|
215
|
-
const chainId = environment === 4n ? chains_1.base.id : chains_1.baseSepolia.id;
|
|
216
|
-
const orchestrator = (0, utils_2.getOrchestratorByChain)(chainId, apiKey, endpointUrl);
|
|
222
|
+
const orchestrator = (0, orchestrator_1.getOrchestrator)(apiKey, endpointUrl);
|
|
217
223
|
const internalStatus = await orchestrator.getIntentOpStatus(intentId);
|
|
218
224
|
return {
|
|
219
225
|
status: internalStatus.status,
|
|
220
226
|
fill: {
|
|
221
227
|
hash: internalStatus.fillTransactionHash,
|
|
222
|
-
chainId:
|
|
228
|
+
chainId: internalStatus.destinationChainId,
|
|
223
229
|
},
|
|
224
230
|
claims: internalStatus.claims.map((claim) => ({
|
|
225
231
|
hash: claim.claimTransactionHash,
|
|
@@ -228,6 +234,6 @@ async function getIntentStatus(apiKey, endpointUrl, intentId) {
|
|
|
228
234
|
};
|
|
229
235
|
}
|
|
230
236
|
async function splitIntents(apiKey, endpointUrl, input) {
|
|
231
|
-
const orchestrator = (0,
|
|
237
|
+
const orchestrator = (0, orchestrator_1.getOrchestrator)(apiKey, endpointUrl);
|
|
232
238
|
return orchestrator.splitIntents(input);
|
|
233
239
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { IntentOpElement
|
|
3
|
-
interface GasRefund {
|
|
4
|
-
token: Address;
|
|
5
|
-
exchangeRate: bigint;
|
|
6
|
-
overhead: bigint;
|
|
7
|
-
}
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
import type { IntentOpElement } from '../orchestrator/types';
|
|
8
3
|
declare function getTypedData(account: Address, intentExecutorAddress: Address, element: IntentOpElement, nonce: bigint): {
|
|
9
4
|
domain: {
|
|
10
5
|
name: string;
|
|
@@ -34,43 +29,12 @@ declare function getTypedData(account: Address, intentExecutorAddress: Address,
|
|
|
34
29
|
message: {
|
|
35
30
|
account: `0x${string}`;
|
|
36
31
|
nonce: bigint;
|
|
37
|
-
op: Op;
|
|
32
|
+
op: import("../orchestrator/types").Op;
|
|
38
33
|
gasRefund: {
|
|
39
|
-
token:
|
|
34
|
+
token: Address;
|
|
40
35
|
exchangeRate: bigint;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} | {
|
|
44
|
-
domain: {
|
|
45
|
-
name: string;
|
|
46
|
-
version: string;
|
|
47
|
-
chainId: number;
|
|
48
|
-
verifyingContract: `0x${string}`;
|
|
49
|
-
};
|
|
50
|
-
types: {
|
|
51
|
-
SingleChainOps: {
|
|
52
|
-
name: string;
|
|
53
|
-
type: string;
|
|
54
|
-
}[];
|
|
55
|
-
Op: {
|
|
56
|
-
name: string;
|
|
57
|
-
type: string;
|
|
58
|
-
}[];
|
|
59
|
-
GasRefund: {
|
|
60
|
-
name: string;
|
|
61
|
-
type: string;
|
|
62
|
-
}[];
|
|
63
|
-
Ops: {
|
|
64
|
-
name: string;
|
|
65
|
-
type: string;
|
|
66
|
-
}[];
|
|
67
|
-
};
|
|
68
|
-
primaryType: "SingleChainOps";
|
|
69
|
-
message: {
|
|
70
|
-
account: `0x${string}`;
|
|
71
|
-
nonce: bigint;
|
|
72
|
-
op: Op;
|
|
73
|
-
gasRefund: GasRefund;
|
|
36
|
+
overhead: bigint;
|
|
37
|
+
} | undefined;
|
|
74
38
|
};
|
|
75
39
|
};
|
|
76
40
|
export { getTypedData };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"singleChainOps.d.ts","sourceRoot":"","sources":["../../../execution/singleChainOps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"singleChainOps.d.ts","sourceRoot":"","sources":["../../../execution/singleChainOps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE5D,iBAAS,YAAY,CACnB,OAAO,EAAE,OAAO,EAChB,qBAAqB,EAAE,OAAO,EAC9B,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0Cd;AAED,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,50 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTypedData = getTypedData;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return {
|
|
8
|
-
domain: {
|
|
9
|
-
name: 'IntentExecutor',
|
|
10
|
-
version: 'v0.0.1',
|
|
11
|
-
chainId: Number(destinationChainId),
|
|
12
|
-
verifyingContract: intentExecutorAddress,
|
|
13
|
-
},
|
|
14
|
-
types: {
|
|
15
|
-
SingleChainOps: [
|
|
16
|
-
{ name: 'account', type: 'address' },
|
|
17
|
-
{ name: 'nonce', type: 'uint256' },
|
|
18
|
-
{ name: 'op', type: 'Op' },
|
|
19
|
-
{ name: 'gasRefund', type: 'GasRefund' },
|
|
20
|
-
],
|
|
21
|
-
Op: [
|
|
22
|
-
{ name: 'vt', type: 'bytes32' },
|
|
23
|
-
{ name: 'ops', type: 'Ops[]' },
|
|
24
|
-
],
|
|
25
|
-
GasRefund: [
|
|
26
|
-
{ name: 'token', type: 'address' },
|
|
27
|
-
{ name: 'exchangeRate', type: 'uint256' },
|
|
28
|
-
],
|
|
29
|
-
Ops: [
|
|
30
|
-
{ name: 'to', type: 'address' },
|
|
31
|
-
{ name: 'value', type: 'uint256' },
|
|
32
|
-
{ name: 'data', type: 'bytes' },
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
primaryType: 'SingleChainOps',
|
|
36
|
-
message: {
|
|
37
|
-
account,
|
|
38
|
-
nonce,
|
|
39
|
-
op: destinationOps,
|
|
40
|
-
gasRefund: {
|
|
41
|
-
token: viem_1.zeroAddress,
|
|
42
|
-
exchangeRate: 0n,
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function getTypedDataWithGasRefund(account, intentExecutorAddress, destinationChainId, destinationOps, nonce, gasRefund) {
|
|
4
|
+
function getTypedData(account, intentExecutorAddress, element, nonce) {
|
|
5
|
+
const { destinationChainId, destinationOps } = element.mandate;
|
|
6
|
+
const gasRefund = element.mandate.qualifier.settlementContext.gasRefund;
|
|
48
7
|
return {
|
|
49
8
|
domain: {
|
|
50
9
|
name: 'IntentExecutor',
|
|
@@ -83,11 +42,3 @@ function getTypedDataWithGasRefund(account, intentExecutorAddress, destinationCh
|
|
|
83
42
|
},
|
|
84
43
|
};
|
|
85
44
|
}
|
|
86
|
-
function getTypedData(account, intentExecutorAddress, element, nonce) {
|
|
87
|
-
const { destinationChainId, destinationOps } = element.mandate;
|
|
88
|
-
const gasRefund = element.mandate.qualifier.settlementContext.gasRefund;
|
|
89
|
-
if (gasRefund) {
|
|
90
|
-
return getTypedDataWithGasRefund(account, intentExecutorAddress, destinationChainId, destinationOps, nonce, gasRefund);
|
|
91
|
-
}
|
|
92
|
-
return getTypedDataLegacy(account, intentExecutorAddress, destinationChainId, destinationOps, nonce);
|
|
93
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Address, type Chain, type HashTypedDataParameters, type Hex, type PublicClient, type SignableMessage, type SignedAuthorization, type SignedAuthorizationList, type TypedData, type TypedDataDefinition } from 'viem';
|
|
2
2
|
import { type UserOperation } from 'viem/account-abstraction';
|
|
3
3
|
import { type IntentOp, type IntentRoute } from '../orchestrator';
|
|
4
|
-
import { type OriginSignature, type SettlementLayer } from '../orchestrator/types';
|
|
4
|
+
import { type AuxiliaryFunds, type OriginSignature, type SettlementLayer } from '../orchestrator/types';
|
|
5
5
|
import type { Call, CalldataInput, CallInput, RhinestoneAccountConfig, RhinestoneConfig, SignerSet, SourceAssetInput, Sponsorship, TokenRequest, TokenSymbol, Transaction, UserOperationTransaction } from '../types';
|
|
6
6
|
interface UserOperationResult {
|
|
7
7
|
type: 'userop';
|
|
@@ -49,7 +49,7 @@ declare function signTypedData<typedData extends TypedData | Record<string, unkn
|
|
|
49
49
|
declare function signAuthorizationsInternal(config: RhinestoneConfig, data: IntentRoute | UserOperation): Promise<SignedAuthorization[]>;
|
|
50
50
|
declare function submitTransaction(config: RhinestoneConfig, signedTransaction: SignedTransactionData, authorizations: SignedAuthorizationList, dryRun?: boolean): Promise<TransactionResult>;
|
|
51
51
|
declare function submitUserOperation(config: RhinestoneConfig, signedUserOperation: SignedUserOperationData): Promise<UserOperationResult>;
|
|
52
|
-
declare function getTokenRequests(
|
|
52
|
+
declare function getTokenRequests(targetChain: Chain, initialTokenRequests: TokenRequest[] | undefined): TokenRequest[];
|
|
53
53
|
declare function getIntentAccount(config: RhinestoneConfig, eip7702InitSignature: Hex | undefined, account: {
|
|
54
54
|
setupOps?: {
|
|
55
55
|
to: Address;
|
|
@@ -68,7 +68,7 @@ declare function getIntentAccount(config: RhinestoneConfig, eip7702InitSignature
|
|
|
68
68
|
};
|
|
69
69
|
} | undefined;
|
|
70
70
|
};
|
|
71
|
-
declare function prepareTransactionAsIntent(config: RhinestoneConfig, sourceChains: Chain[] | undefined, targetChain: Chain, callInputs: CalldataInput[], gasLimit: bigint | undefined, tokenRequests: TokenRequest[], recipientInput: RhinestoneAccountConfig | Address | undefined, sponsored: Sponsorship | undefined, eip7702InitSignature: Hex | undefined, settlementLayers: SettlementLayer[] | undefined, sourceAssets: SourceAssetInput | undefined, feeAsset: Address | TokenSymbol | undefined, lockFunds: boolean | undefined, account: {
|
|
71
|
+
declare function prepareTransactionAsIntent(config: RhinestoneConfig, sourceChains: Chain[] | undefined, targetChain: Chain, callInputs: CalldataInput[], gasLimit: bigint | undefined, tokenRequests: TokenRequest[], recipientInput: RhinestoneAccountConfig | Address | undefined, sponsored: Sponsorship | undefined, eip7702InitSignature: Hex | undefined, settlementLayers: SettlementLayer[] | undefined, sourceAssets: SourceAssetInput | undefined, feeAsset: Address | TokenSymbol | undefined, lockFunds: boolean | undefined, auxiliaryFunds: AuxiliaryFunds | undefined, account: {
|
|
72
72
|
setupOps?: {
|
|
73
73
|
to: Address;
|
|
74
74
|
data: Hex;
|
|
@@ -78,10 +78,9 @@ declare function signIntent(config: RhinestoneConfig, intentOp: IntentOp, target
|
|
|
78
78
|
originSignatures: OriginSignature[];
|
|
79
79
|
destinationSignature: `0x${string}`;
|
|
80
80
|
}>;
|
|
81
|
-
declare function getOrchestratorByChain(chainId: number, apiKey: string | undefined, orchestratorUrl?: string): import("../orchestrator").Orchestrator;
|
|
82
81
|
declare function submitIntentInternal(config: RhinestoneConfig, sourceChains: Chain[] | undefined, targetChain: Chain, intentOp: IntentOp, originSignatures: OriginSignature[], destinationSignature: Hex, targetExecutionSignature: Hex | undefined, authorizations: SignedAuthorizationList, dryRun: boolean): Promise<TransactionResult>;
|
|
83
82
|
declare function getValidatorAccount(config: RhinestoneConfig, signers: SignerSet | undefined, publicClient: PublicClient, chain: Chain): Promise<import("viem/account-abstraction").SmartAccount<import("viem/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">> | null | undefined>;
|
|
84
83
|
declare function parseCalls(calls: CalldataInput[], chainId: number): Call[];
|
|
85
|
-
export { prepareTransaction, getTransactionMessages, signTransaction, signAuthorizations, signAuthorizationsInternal, signMessage, signTypedData, submitTransaction, prepareUserOperation, signUserOperation, submitUserOperation,
|
|
84
|
+
export { prepareTransaction, getTransactionMessages, signTransaction, signAuthorizations, signAuthorizationsInternal, signMessage, signTypedData, submitTransaction, prepareUserOperation, signUserOperation, submitUserOperation, signIntent, prepareTransactionAsIntent, submitIntentInternal, getValidatorAccount, parseCalls, getTokenRequests, resolveCallInputs, getIntentAccount, getTargetExecutionSignature, };
|
|
86
85
|
export type { IntentRoute, TransactionResult, PreparedTransactionData, PreparedUserOperationData, SignedTransactionData, SignedUserOperationData, UserOperationResult, };
|
|
87
86
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../execution/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAKV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAIR,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EACd,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../execution/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAKV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAIR,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EACd,KAAK,mBAAmB,EAGzB,MAAM,MAAM,CAAA;AACb,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAA;AAoCjC,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,WAAW,EAEjB,MAAM,iBAAiB,CAAA;AAMxB,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,eAAe,EACpB,KAAK,eAAe,EAIrB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAEV,IAAI,EACJ,aAAa,EACb,SAAS,EAET,uBAAuB,EACvB,gBAAgB,EAChB,SAAS,EAET,gBAAgB,EAChB,WAA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