@rhinestone/sdk 1.0.0-alpha.5 → 1.0.0-alpha.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/execution/error.d.ts +2 -9
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +4 -13
- package/dist/src/execution/index.d.ts +2 -2
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +22 -27
- 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 -28
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -3
- package/dist/src/orchestrator/client.d.ts +1 -0
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +66 -55
- package/dist/src/orchestrator/consts.d.ts +3 -3
- package/dist/src/orchestrator/consts.d.ts.map +1 -1
- package/dist/src/orchestrator/consts.js +4 -4
- package/dist/src/types.d.ts +1 -2
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -14,14 +14,7 @@ declare class ExecutionError extends Error {
|
|
|
14
14
|
get errorType(): string;
|
|
15
15
|
get traceId(): string;
|
|
16
16
|
}
|
|
17
|
-
declare class
|
|
18
|
-
constructor(params?: {
|
|
19
|
-
context?: any;
|
|
20
|
-
errorType?: string;
|
|
21
|
-
traceId?: string;
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
declare class SourceTargetChainMismatchError extends ExecutionError {
|
|
17
|
+
declare class SourceChainsNotAvailableForUserOpFlowError extends ExecutionError {
|
|
25
18
|
constructor(params?: {
|
|
26
19
|
context?: any;
|
|
27
20
|
errorType?: string;
|
|
@@ -57,5 +50,5 @@ declare class IntentFailedError extends ExecutionError {
|
|
|
57
50
|
});
|
|
58
51
|
}
|
|
59
52
|
declare function isExecutionError(error: Error): error is ExecutionError;
|
|
60
|
-
export { isExecutionError, ExecutionError,
|
|
53
|
+
export { isExecutionError, ExecutionError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError, OrderPathRequiredForIntentsError, SessionChainRequiredError, IntentFailedError, };
|
|
61
54
|
//# 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;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;gBAErB,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;IAQD,IAAI,OAAO,WAEV;IAED,IAAI,OAAO,QAEV;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,OAAO,WAEV;CACF;AAED,cAAM,
|
|
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;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;gBAErB,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;K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";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IntentFailedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.UserOperationRequiredForSmartSessionsError = exports.
|
|
3
|
+
exports.IntentFailedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.UserOperationRequiredForSmartSessionsError = exports.SourceChainsNotAvailableForUserOpFlowError = exports.ExecutionError = void 0;
|
|
4
4
|
exports.isExecutionError = isExecutionError;
|
|
5
5
|
class ExecutionError extends Error {
|
|
6
6
|
_message;
|
|
@@ -28,24 +28,15 @@ class ExecutionError extends Error {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
exports.ExecutionError = ExecutionError;
|
|
31
|
-
class
|
|
31
|
+
class SourceChainsNotAvailableForUserOpFlowError extends ExecutionError {
|
|
32
32
|
constructor(params) {
|
|
33
33
|
super({
|
|
34
|
-
message: '
|
|
34
|
+
message: "Can't specify the source chains when using user operations",
|
|
35
35
|
...params,
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
exports.
|
|
40
|
-
class SourceTargetChainMismatchError extends ExecutionError {
|
|
41
|
-
constructor(params) {
|
|
42
|
-
super({
|
|
43
|
-
message: 'Source and target chain must be the same when using user operations',
|
|
44
|
-
...params,
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.SourceTargetChainMismatchError = SourceTargetChainMismatchError;
|
|
39
|
+
exports.SourceChainsNotAvailableForUserOpFlowError = SourceChainsNotAvailableForUserOpFlowError;
|
|
49
40
|
class UserOperationRequiredForSmartSessionsError extends ExecutionError {
|
|
50
41
|
constructor(params) {
|
|
51
42
|
super({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Address, type Chain } from 'viem';
|
|
2
2
|
import type { IntentOpStatus } from '../orchestrator';
|
|
3
3
|
import type { RhinestoneAccountConfig, Transaction } from '../types';
|
|
4
|
-
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError,
|
|
4
|
+
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError } from './error';
|
|
5
5
|
import type { IntentData, TransactionResult } from './utils';
|
|
6
6
|
declare function sendTransaction(config: RhinestoneAccountConfig, transaction: Transaction): Promise<TransactionResult>;
|
|
7
7
|
declare function waitForExecution(config: RhinestoneAccountConfig, result: TransactionResult, acceptsPreconfirmations: boolean): Promise<IntentOpStatus | {
|
|
@@ -19,6 +19,6 @@ declare function waitForExecution(config: RhinestoneAccountConfig, result: Trans
|
|
|
19
19
|
}>;
|
|
20
20
|
declare function getMaxSpendableAmount(config: RhinestoneAccountConfig, chain: Chain, tokenAddress: Address, gasUnits: bigint): Promise<bigint>;
|
|
21
21
|
declare function getPortfolio(config: RhinestoneAccountConfig, onTestnets: boolean): Promise<import("../orchestrator").Portfolio>;
|
|
22
|
-
export { sendTransaction, waitForExecution, getMaxSpendableAmount, getPortfolio, isExecutionError, IntentFailedError, ExecutionError,
|
|
22
|
+
export { sendTransaction, waitForExecution, getMaxSpendableAmount, getPortfolio, isExecutionError, IntentFailedError, ExecutionError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError, OrderPathRequiredForIntentsError, SessionChainRequiredError, };
|
|
23
23
|
export type { IntentData, TransactionResult };
|
|
24
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAmC,MAAM,MAAM,CAAA;AAKhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAQrD,OAAO,KAAK,EAEV,uBAAuB,EAGvB,WAAW,EACZ,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AE,iBAAiB,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.UserOperationRequiredForSmartSessionsError = exports.
|
|
3
|
+
exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.UserOperationRequiredForSmartSessionsError = exports.SourceChainsNotAvailableForUserOpFlowError = exports.ExecutionError = exports.IntentFailedError = exports.isExecutionError = void 0;
|
|
4
4
|
exports.sendTransaction = sendTransaction;
|
|
5
5
|
exports.waitForExecution = waitForExecution;
|
|
6
6
|
exports.getMaxSpendableAmount = getMaxSpendableAmount;
|
|
@@ -17,8 +17,7 @@ Object.defineProperty(exports, "IntentFailedError", { enumerable: true, get: fun
|
|
|
17
17
|
Object.defineProperty(exports, "isExecutionError", { enumerable: true, get: function () { return error_1.isExecutionError; } });
|
|
18
18
|
Object.defineProperty(exports, "OrderPathRequiredForIntentsError", { enumerable: true, get: function () { return error_1.OrderPathRequiredForIntentsError; } });
|
|
19
19
|
Object.defineProperty(exports, "SessionChainRequiredError", { enumerable: true, get: function () { return error_1.SessionChainRequiredError; } });
|
|
20
|
-
Object.defineProperty(exports, "
|
|
21
|
-
Object.defineProperty(exports, "SourceTargetChainMismatchError", { enumerable: true, get: function () { return error_1.SourceTargetChainMismatchError; } });
|
|
20
|
+
Object.defineProperty(exports, "SourceChainsNotAvailableForUserOpFlowError", { enumerable: true, get: function () { return error_1.SourceChainsNotAvailableForUserOpFlowError; } });
|
|
22
21
|
Object.defineProperty(exports, "UserOperationRequiredForSmartSessionsError", { enumerable: true, get: function () { return error_1.UserOperationRequiredForSmartSessionsError; } });
|
|
23
22
|
const smart_session_1 = require("./smart-session");
|
|
24
23
|
const utils_2 = require("./utils");
|
|
@@ -26,14 +25,14 @@ const POLLING_INTERVAL = 500;
|
|
|
26
25
|
async function sendTransaction(config, transaction) {
|
|
27
26
|
if ('chain' in transaction) {
|
|
28
27
|
// Same-chain transaction
|
|
29
|
-
return await sendTransactionInternal(config, transaction.chain, transaction.chain, transaction.calls, transaction.gasLimit, transaction.tokenRequests, transaction.signers);
|
|
28
|
+
return await sendTransactionInternal(config, [transaction.chain], transaction.chain, transaction.calls, transaction.gasLimit, transaction.tokenRequests, transaction.signers);
|
|
30
29
|
}
|
|
31
30
|
else {
|
|
32
31
|
// Cross-chain transaction
|
|
33
|
-
return await sendTransactionInternal(config, transaction.
|
|
32
|
+
return await sendTransactionInternal(config, transaction.sourceChains || [], transaction.targetChain, transaction.calls, transaction.gasLimit, transaction.tokenRequests, transaction.signers);
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
|
-
async function sendTransactionInternal(config,
|
|
35
|
+
async function sendTransactionInternal(config, sourceChains, targetChain, callInputs, gasLimit, initialTokenRequests, signers) {
|
|
37
36
|
const accountAddress = (0, accounts_1.getAddress)(config);
|
|
38
37
|
// Across requires passing some value to repay the solvers
|
|
39
38
|
const tokenRequests = !initialTokenRequests || initialTokenRequests.length === 0
|
|
@@ -47,37 +46,34 @@ async function sendTransactionInternal(config, sourceChain, targetChain, callInp
|
|
|
47
46
|
const asUserOp = signers?.type === 'guardians' || signers?.type === 'session';
|
|
48
47
|
// const asUserOp = true
|
|
49
48
|
if (asUserOp) {
|
|
50
|
-
if (!sourceChain) {
|
|
51
|
-
throw new error_1.SourceChainRequiredForSmartSessionsError();
|
|
52
|
-
}
|
|
53
49
|
const withSession = signers?.type === 'session' ? signers.session : null;
|
|
54
50
|
if (withSession) {
|
|
55
|
-
await (0, smart_session_1.enableSmartSession)(
|
|
51
|
+
await (0, smart_session_1.enableSmartSession)(targetChain, config, withSession);
|
|
56
52
|
}
|
|
57
53
|
// Smart sessions require a UserOp flow
|
|
58
|
-
return await sendTransactionAsUserOp(config,
|
|
54
|
+
return await sendTransactionAsUserOp(config, targetChain, callInputs, signers);
|
|
59
55
|
}
|
|
60
56
|
else {
|
|
61
|
-
return await sendTransactionAsIntent(config,
|
|
57
|
+
return await sendTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, accountAddress, signers);
|
|
62
58
|
}
|
|
63
59
|
}
|
|
64
|
-
async function sendTransactionAsUserOp(config,
|
|
60
|
+
async function sendTransactionAsUserOp(config, chain, callInputs, signers) {
|
|
65
61
|
// Make sure the account is deployed
|
|
66
|
-
await (0, accounts_1.deploy)(config,
|
|
62
|
+
await (0, accounts_1.deploy)(config, chain);
|
|
67
63
|
const withSession = signers?.type === 'session' ? signers.session : null;
|
|
68
64
|
const publicClient = (0, viem_1.createPublicClient)({
|
|
69
|
-
chain
|
|
70
|
-
transport: (0, utils_1.createTransport)(
|
|
65
|
+
chain,
|
|
66
|
+
transport: (0, utils_1.createTransport)(chain, config.provider),
|
|
71
67
|
});
|
|
72
|
-
const validatorAccount = await (0, utils_2.getValidatorAccount)(config, signers, publicClient,
|
|
68
|
+
const validatorAccount = await (0, utils_2.getValidatorAccount)(config, signers, publicClient, chain);
|
|
73
69
|
if (!validatorAccount) {
|
|
74
70
|
throw new Error('No validator account found');
|
|
75
71
|
}
|
|
76
72
|
const bundlerClient = (0, utils_1.getBundlerClient)(config, publicClient);
|
|
77
73
|
if (withSession) {
|
|
78
|
-
await (0, smart_session_1.enableSmartSession)(
|
|
74
|
+
await (0, smart_session_1.enableSmartSession)(chain, config, withSession);
|
|
79
75
|
}
|
|
80
|
-
const calls = (0, utils_2.parseCalls)(callInputs,
|
|
76
|
+
const calls = (0, utils_2.parseCalls)(callInputs, chain.id);
|
|
81
77
|
const hash = await bundlerClient.sendUserOperation({
|
|
82
78
|
account: validatorAccount,
|
|
83
79
|
calls,
|
|
@@ -85,17 +81,16 @@ async function sendTransactionAsUserOp(config, sourceChain, targetChain, callInp
|
|
|
85
81
|
return {
|
|
86
82
|
type: 'userop',
|
|
87
83
|
hash,
|
|
88
|
-
|
|
89
|
-
targetChain: targetChain.id,
|
|
84
|
+
chain: chain.id,
|
|
90
85
|
};
|
|
91
86
|
}
|
|
92
|
-
async function sendTransactionAsIntent(config,
|
|
93
|
-
const { intentRoute, hash: intentHash } = await (0, utils_2.prepareTransactionAsIntent)(config,
|
|
87
|
+
async function sendTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, accountAddress, signers) {
|
|
88
|
+
const { intentRoute, hash: intentHash } = await (0, utils_2.prepareTransactionAsIntent)(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, accountAddress);
|
|
94
89
|
if (!intentRoute) {
|
|
95
90
|
throw new error_1.OrderPathRequiredForIntentsError();
|
|
96
91
|
}
|
|
97
|
-
const signature = await (0, utils_2.signIntent)(config,
|
|
98
|
-
return await (0, utils_2.submitIntentInternal)(config,
|
|
92
|
+
const signature = await (0, utils_2.signIntent)(config, targetChain, intentHash, signers);
|
|
93
|
+
return await (0, utils_2.submitIntentInternal)(config, sourceChains, targetChain, intentRoute.intentOp, signature);
|
|
99
94
|
}
|
|
100
95
|
async function waitForExecution(config, result, acceptsPreconfirmations) {
|
|
101
96
|
const validStatuses = new Set([
|
|
@@ -120,9 +115,9 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
|
|
|
120
115
|
return intentStatus;
|
|
121
116
|
}
|
|
122
117
|
case 'userop': {
|
|
123
|
-
const targetChain = (0, registry_1.getChainById)(result.
|
|
118
|
+
const targetChain = (0, registry_1.getChainById)(result.chain);
|
|
124
119
|
if (!targetChain) {
|
|
125
|
-
throw new Error(`Unsupported chain ID: ${result.
|
|
120
|
+
throw new Error(`Unsupported chain ID: ${result.chain}`);
|
|
126
121
|
}
|
|
127
122
|
const publicClient = (0, viem_1.createPublicClient)({
|
|
128
123
|
chain: targetChain,
|
|
@@ -5,8 +5,7 @@ import type { Call, CallInput, RhinestoneAccountConfig, SignerSet, TokenRequest,
|
|
|
5
5
|
type TransactionResult = {
|
|
6
6
|
type: 'userop';
|
|
7
7
|
hash: Hex;
|
|
8
|
-
|
|
9
|
-
targetChain: number;
|
|
8
|
+
chain: number;
|
|
10
9
|
} | {
|
|
11
10
|
type: 'intent';
|
|
12
11
|
id: bigint;
|
|
@@ -33,10 +32,10 @@ interface SignedTransactionData extends PreparedTransactionData {
|
|
|
33
32
|
declare function prepareTransaction(config: RhinestoneAccountConfig, transaction: Transaction): Promise<PreparedTransactionData>;
|
|
34
33
|
declare function signTransaction(config: RhinestoneAccountConfig, preparedTransaction: PreparedTransactionData): Promise<SignedTransactionData>;
|
|
35
34
|
declare function submitTransaction(config: RhinestoneAccountConfig, signedTransaction: SignedTransactionData): Promise<TransactionResult>;
|
|
36
|
-
declare function prepareTransactionAsIntent(config: RhinestoneAccountConfig,
|
|
37
|
-
declare function signIntent(config: RhinestoneAccountConfig,
|
|
35
|
+
declare function prepareTransactionAsIntent(config: RhinestoneAccountConfig, sourceChains: Chain[] | undefined, targetChain: Chain, callInputs: CallInput[], gasLimit: bigint | undefined, tokenRequests: TokenRequest[], accountAddress: Address): Promise<IntentData>;
|
|
36
|
+
declare function signIntent(config: RhinestoneAccountConfig, targetChain: Chain, intentHash: Hex, signers?: SignerSet): Promise<`0x${string}`>;
|
|
38
37
|
declare function getOrchestratorByChain(chainId: number, apiKey: string): import("../orchestrator").Orchestrator;
|
|
39
|
-
declare function submitIntentInternal(config: RhinestoneAccountConfig,
|
|
38
|
+
declare function submitIntentInternal(config: RhinestoneAccountConfig, sourceChains: Chain[] | undefined, targetChain: Chain, intentOp: IntentOp, signature: Hex): Promise<TransactionResult>;
|
|
40
39
|
declare function getValidatorAccount(config: RhinestoneAccountConfig, 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>;
|
|
41
40
|
declare function parseCalls(calls: CallInput[], chainId: number): Call[];
|
|
42
41
|
export { prepareTransaction, signTransaction, submitTransaction, getOrchestratorByChain, signIntent, prepareTransactionAsIntent, submitIntentInternal, getValidatorAccount, parseCalls, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../execution/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,GAAG,EACR,KAAK,YAAY,EAGlB,MAAM,MAAM,CAAA;AACb,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAA;AAoBjC,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,WAAW,EAEjB,MAAM,iBAAiB,CAAA;AAMxB,OAAO,KAAK,EACV,IAAI,EACJ,SAAS,EACT,uBAAuB,EACvB,SAAS,EACT,YAAY,EACZ,WAAW,EACZ,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../execution/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,GAAG,EACR,KAAK,YAAY,EAGlB,MAAM,MAAM,CAAA;AACb,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAA;AAoBjC,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,WAAW,EAEjB,MAAM,iBAAiB,CAAA;AAMxB,OAAO,KAAK,EACV,IAAI,EACJ,SAAS,EACT,uBAAuB,EACvB,SAAS,EACT,YAAY,EACZ,WAAW,EACZ,MAAM,UAAU,CAAA;AAOjB,KAAK,iBAAiB,GAClB;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,GAAG,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;CACd,GACD;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAEL,UAAU,UAAU;IAClB,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,GAAG,C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AW,EAAE,KAAK,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,GAAG,8BAkBf;AAED,iBAAe,mBAAmB,CAChC,MAAM,EAAE,uBAAuB,EAC/B,OAAO,EAAE,SAAS,GAAG,SAAS,EAC9B,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,KAAK,yKA6Bb;AAiDD,iBAAS,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,CAM/D;AAED,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,GACX,CAAA;AACD,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,GACtB,CAAA"}
|
|
@@ -20,22 +20,19 @@ const consts_1 = require("../orchestrator/consts");
|
|
|
20
20
|
const registry_1 = require("../orchestrator/registry");
|
|
21
21
|
const error_1 = require("./error");
|
|
22
22
|
async function prepareTransaction(config, transaction) {
|
|
23
|
-
const {
|
|
23
|
+
const { sourceChains, targetChain, tokenRequests, signers } = getTransactionParams(transaction);
|
|
24
24
|
const accountAddress = (0, accounts_1.getAddress)(config);
|
|
25
25
|
let data;
|
|
26
26
|
const asUserOp = signers?.type === 'guardians' || signers?.type === 'session';
|
|
27
27
|
if (asUserOp) {
|
|
28
|
-
if (
|
|
29
|
-
throw new error_1.
|
|
30
|
-
}
|
|
31
|
-
if (sourceChain.id !== targetChain.id) {
|
|
32
|
-
throw new error_1.SourceTargetChainMismatchError();
|
|
28
|
+
if (sourceChains && sourceChains.length > 0) {
|
|
29
|
+
throw new error_1.SourceChainsNotAvailableForUserOpFlowError();
|
|
33
30
|
}
|
|
34
31
|
// Smart sessions require a UserOp flow
|
|
35
|
-
data = await prepareTransactionAsUserOp(config,
|
|
32
|
+
data = await prepareTransactionAsUserOp(config, targetChain, transaction.calls, signers);
|
|
36
33
|
}
|
|
37
34
|
else {
|
|
38
|
-
data = await prepareTransactionAsIntent(config,
|
|
35
|
+
data = await prepareTransactionAsIntent(config, sourceChains, targetChain, transaction.calls, transaction.gasLimit, tokenRequests, accountAddress);
|
|
39
36
|
}
|
|
40
37
|
return {
|
|
41
38
|
data,
|
|
@@ -43,12 +40,12 @@ async function prepareTransaction(config, transaction) {
|
|
|
43
40
|
};
|
|
44
41
|
}
|
|
45
42
|
async function signTransaction(config, preparedTransaction) {
|
|
46
|
-
const {
|
|
43
|
+
const { targetChain, signers } = getTransactionParams(preparedTransaction.transaction);
|
|
47
44
|
const data = preparedTransaction.data;
|
|
48
45
|
const asUserOp = data.type === 'userop';
|
|
49
46
|
let signature;
|
|
50
47
|
if (asUserOp) {
|
|
51
|
-
const chain =
|
|
48
|
+
const chain = targetChain;
|
|
52
49
|
const userOp = data.userOp;
|
|
53
50
|
if (!userOp) {
|
|
54
51
|
throw new error_1.UserOperationRequiredForSmartSessionsError();
|
|
@@ -57,7 +54,7 @@ async function signTransaction(config, preparedTransaction) {
|
|
|
57
54
|
signature = await signUserOp(config, chain, signers, userOp);
|
|
58
55
|
}
|
|
59
56
|
else {
|
|
60
|
-
signature = await signIntent(config,
|
|
57
|
+
signature = await signIntent(config, targetChain, data.hash, signers);
|
|
61
58
|
}
|
|
62
59
|
return {
|
|
63
60
|
data,
|
|
@@ -67,10 +64,10 @@ async function signTransaction(config, preparedTransaction) {
|
|
|
67
64
|
}
|
|
68
65
|
async function submitTransaction(config, signedTransaction) {
|
|
69
66
|
const { data, transaction, signature } = signedTransaction;
|
|
70
|
-
const {
|
|
67
|
+
const { sourceChains, targetChain } = getTransactionParams(transaction);
|
|
71
68
|
const asUserOp = data.type === 'userop';
|
|
72
69
|
if (asUserOp) {
|
|
73
|
-
const chain =
|
|
70
|
+
const chain = targetChain;
|
|
74
71
|
const userOp = data.userOp;
|
|
75
72
|
if (!userOp) {
|
|
76
73
|
throw new error_1.UserOperationRequiredForSmartSessionsError();
|
|
@@ -83,11 +80,11 @@ async function submitTransaction(config, signedTransaction) {
|
|
|
83
80
|
if (!intentOp) {
|
|
84
81
|
throw new error_1.OrderPathRequiredForIntentsError();
|
|
85
82
|
}
|
|
86
|
-
return await submitIntent(config,
|
|
83
|
+
return await submitIntent(config, sourceChains, targetChain, intentOp, signature);
|
|
87
84
|
}
|
|
88
85
|
}
|
|
89
86
|
function getTransactionParams(transaction) {
|
|
90
|
-
const
|
|
87
|
+
const sourceChains = 'chain' in transaction ? [transaction.chain] : transaction.sourceChains;
|
|
91
88
|
const targetChain = 'chain' in transaction ? transaction.chain : transaction.targetChain;
|
|
92
89
|
const initialTokenRequests = transaction.tokenRequests;
|
|
93
90
|
const signers = transaction.signers;
|
|
@@ -101,7 +98,7 @@ function getTransactionParams(transaction) {
|
|
|
101
98
|
]
|
|
102
99
|
: initialTokenRequests;
|
|
103
100
|
return {
|
|
104
|
-
|
|
101
|
+
sourceChains,
|
|
105
102
|
targetChain,
|
|
106
103
|
tokenRequests,
|
|
107
104
|
signers,
|
|
@@ -133,12 +130,12 @@ async function prepareTransactionAsUserOp(config, chain, callInputs, signers) {
|
|
|
133
130
|
}),
|
|
134
131
|
};
|
|
135
132
|
}
|
|
136
|
-
async function prepareTransactionAsIntent(config,
|
|
133
|
+
async function prepareTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, accountAddress) {
|
|
137
134
|
const initCode = (0, accounts_1.getInitCode)(config);
|
|
138
135
|
const calls = parseCalls(callInputs, targetChain.id);
|
|
139
|
-
const accountAccessList =
|
|
136
|
+
const accountAccessList = sourceChains && sourceChains.length > 0
|
|
140
137
|
? {
|
|
141
|
-
chainIds:
|
|
138
|
+
chainIds: sourceChains.map((chain) => chain.id),
|
|
142
139
|
}
|
|
143
140
|
: undefined;
|
|
144
141
|
const metaIntent = {
|
|
@@ -177,14 +174,14 @@ async function prepareTransactionAsIntent(config, sourceChain, targetChain, call
|
|
|
177
174
|
hash: intentHash,
|
|
178
175
|
};
|
|
179
176
|
}
|
|
180
|
-
async function signIntent(config,
|
|
177
|
+
async function signIntent(config, targetChain, intentHash, signers) {
|
|
181
178
|
const validator = getValidator(config, signers);
|
|
182
179
|
if (!validator) {
|
|
183
180
|
throw new Error('Validator not available');
|
|
184
181
|
}
|
|
185
182
|
const ownerValidator = (0, validators_1.getOwnerValidator)(config);
|
|
186
183
|
const isRoot = validator.address === ownerValidator.address;
|
|
187
|
-
const signature = await (0, accounts_1.getPackedSignature)(config, signers,
|
|
184
|
+
const signature = await (0, accounts_1.getPackedSignature)(config, signers, targetChain, {
|
|
188
185
|
address: validator.address,
|
|
189
186
|
isRoot,
|
|
190
187
|
}, intentHash);
|
|
@@ -241,20 +238,19 @@ async function submitUserOp(config, chain, userOp, signature) {
|
|
|
241
238
|
return {
|
|
242
239
|
type: 'userop',
|
|
243
240
|
hash,
|
|
244
|
-
|
|
245
|
-
targetChain: chain.id,
|
|
241
|
+
chain: chain.id,
|
|
246
242
|
};
|
|
247
243
|
}
|
|
248
|
-
async function submitIntent(config,
|
|
249
|
-
return submitIntentInternal(config,
|
|
244
|
+
async function submitIntent(config, sourceChains, targetChain, intentOp, signature) {
|
|
245
|
+
return submitIntentInternal(config, sourceChains, targetChain, intentOp, signature);
|
|
250
246
|
}
|
|
251
247
|
function getOrchestratorByChain(chainId, apiKey) {
|
|
252
248
|
const orchestratorUrl = (0, registry_1.isTestnet)(chainId)
|
|
253
|
-
? consts_1.
|
|
249
|
+
? consts_1.STAGING_ORCHESTRATOR_URL
|
|
254
250
|
: consts_1.PROD_ORCHESTRATOR_URL;
|
|
255
251
|
return (0, orchestrator_1.getOrchestrator)(apiKey, orchestratorUrl);
|
|
256
252
|
}
|
|
257
|
-
async function submitIntentInternal(config,
|
|
253
|
+
async function submitIntentInternal(config, sourceChains, targetChain, intentOp, signature) {
|
|
258
254
|
const signedIntentOp = {
|
|
259
255
|
...intentOp,
|
|
260
256
|
originSignatures: Array(intentOp.elements.length).fill(signature),
|
|
@@ -265,7 +261,7 @@ async function submitIntentInternal(config, sourceChain, targetChain, intentOp,
|
|
|
265
261
|
return {
|
|
266
262
|
type: 'intent',
|
|
267
263
|
id: BigInt(intentResults.result.id),
|
|
268
|
-
|
|
264
|
+
sourceChains: sourceChains?.map((chain) => chain.id),
|
|
269
265
|
targetChain: targetChain.id,
|
|
270
266
|
};
|
|
271
267
|
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { AccountError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAcc
|
|
|
4
4
|
import { createTransport } from './accounts/utils';
|
|
5
5
|
import { addOwner, changeMultiFactorThreshold, changeThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, removeOwner, removeSubValidator, setSubValidator, setUpRecovery, trustAttester } from './actions';
|
|
6
6
|
import type { TransactionResult } from './execution';
|
|
7
|
-
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError,
|
|
7
|
+
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError } from './execution';
|
|
8
8
|
import { type SessionDetails } from './execution/smart-session';
|
|
9
9
|
import { type IntentData, type PreparedTransactionData, type SignedTransactionData } from './execution/utils';
|
|
10
10
|
import { AuthenticationRequiredError, InsufficientBalanceError, type IntentCost, type IntentInput, IntentNotFoundError, type IntentOp, type IntentOpStatus, type IntentResult, type IntentRoute, InvalidApiKeyError, InvalidIntentSignatureError, isOrchestratorError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, type Portfolio, type SettlementSystem, type SignedIntentOp, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from './orchestrator';
|
|
@@ -35,6 +35,6 @@ interface RhinestoneAccount {
|
|
|
35
35
|
* @returns account
|
|
36
36
|
*/
|
|
37
37
|
declare function createRhinestoneAccount(config: RhinestoneAccountConfig): Promise<RhinestoneAccount>;
|
|
38
|
-
export { createRhinestoneAccount, createTransport, addOwner, changeMultiFactorThreshold, changeThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, removeOwner, removeSubValidator, setSubValidator, setUpRecovery, trustAttester, isAccountError, AccountError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, SignMessageNotSupportedByAccountError, Eip7702NotSupportedForAccountError, isExecutionError, IntentFailedError, ExecutionError,
|
|
38
|
+
export { createRhinestoneAccount, createTransport, addOwner, changeMultiFactorThreshold, changeThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, removeOwner, removeSubValidator, setSubValidator, setUpRecovery, trustAttester, isAccountError, AccountError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, SignMessageNotSupportedByAccountError, Eip7702NotSupportedForAccountError, isExecutionError, IntentFailedError, ExecutionError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError, OrderPathRequiredForIntentsError, SessionChainRequiredError, isOrchestratorError, AuthenticationRequiredError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, };
|
|
39
39
|
export type { RhinestoneAccount, Session, Call, IntentData, PreparedTransactionData, SignedTransactionData, TransactionResult, IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, SettlementSystem, SignedIntentOp, Portfolio, };
|
|
40
40
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EACL,YAAY,EAEZ,8BAA8B,EAC9B,kCAAkC,EAClC,wCAAwC,EACxC,4BAA4B,EAE5B,cAAc,EACd,kCAAkC,EAClC,qCAAqC,EACrC,4BAA4B,EAC7B,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,2BAA2B,EAC3B,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,aAAa,EACd,MAAM,WAAW,CAAA;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EACL,cAAc,EAGd,iBAAiB,EACjB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EACL,YAAY,EAEZ,8BAA8B,EAC9B,kCAAkC,EAClC,wCAAwC,EACxC,4BAA4B,EAE5B,cAAc,EACd,kCAAkC,EAClC,qCAAqC,EACrC,4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,OAAO,EAAE,CAAC,CAAA;CACpD;AAED;;;;;GAKG;AACH,iBAAe,uBAAuB,CACpC,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,iBAAiB,CAAC,CA+G5B;AAED,OAAO,EACL,uBAAuB,EACvB,eAAe,EAEf,QAAQ,EACR,0BAA0B,EAC1B,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,2BAA2B,EAC3B,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,aAAa,EAEb,cAAc,EACd,YAAY,EACZ,8BAA8B,EAC9B,wCAAwC,EACxC,4BAA4B,EAC5B,4BAA4B,EAC5B,kCAAkC,EAClC,qCAAqC,EACrC,kCAAkC,EAElC,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,0CAA0C,EAC1C,0CAA0C,EAC1C,gCAAgC,EAChC,yBAAyB,EAEzB,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,GACtB,CAAA;AACD,YAAY,EACV,iBAAiB,EACjB,OAAO,EACP,IAAI,EACJ,UAAU,EACV,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,SAAS,GACV,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.AuthenticationRequiredError = exports.isOrchestratorError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.UserOperationRequiredForSmartSessionsError = exports.
|
|
3
|
+
exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.AuthenticationRequiredError = exports.isOrchestratorError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.UserOperationRequiredForSmartSessionsError = exports.SourceChainsNotAvailableForUserOpFlowError = exports.ExecutionError = exports.IntentFailedError = exports.isExecutionError = exports.Eip7702NotSupportedForAccountError = exports.SignMessageNotSupportedByAccountError = exports.SigningNotSupportedForAccountError = exports.SmartSessionsNotEnabledError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.Eip7702AccountMustHaveEoaError = exports.AccountError = exports.isAccountError = exports.trustAttester = exports.setUpRecovery = exports.setSubValidator = exports.removeSubValidator = exports.removeOwner = exports.recover = exports.encodeSmartSessionSignature = exports.enablePasskeys = exports.enableMultiFactor = exports.enableEcdsa = exports.disablePasskeys = exports.disableMultiFactor = exports.disableEcdsa = exports.changeThreshold = exports.changeMultiFactorThreshold = exports.addOwner = exports.createTransport = void 0;
|
|
4
4
|
exports.createRhinestoneAccount = createRhinestoneAccount;
|
|
5
5
|
const accounts_1 = require("./accounts");
|
|
6
6
|
Object.defineProperty(exports, "AccountError", { enumerable: true, get: function () { return accounts_1.AccountError; } });
|
|
@@ -37,8 +37,7 @@ Object.defineProperty(exports, "IntentFailedError", { enumerable: true, get: fun
|
|
|
37
37
|
Object.defineProperty(exports, "isExecutionError", { enumerable: true, get: function () { return execution_1.isExecutionError; } });
|
|
38
38
|
Object.defineProperty(exports, "OrderPathRequiredForIntentsError", { enumerable: true, get: function () { return execution_1.OrderPathRequiredForIntentsError; } });
|
|
39
39
|
Object.defineProperty(exports, "SessionChainRequiredError", { enumerable: true, get: function () { return execution_1.SessionChainRequiredError; } });
|
|
40
|
-
Object.defineProperty(exports, "
|
|
41
|
-
Object.defineProperty(exports, "SourceTargetChainMismatchError", { enumerable: true, get: function () { return execution_1.SourceTargetChainMismatchError; } });
|
|
40
|
+
Object.defineProperty(exports, "SourceChainsNotAvailableForUserOpFlowError", { enumerable: true, get: function () { return execution_1.SourceChainsNotAvailableForUserOpFlowError; } });
|
|
42
41
|
Object.defineProperty(exports, "UserOperationRequiredForSmartSessionsError", { enumerable: true, get: function () { return execution_1.UserOperationRequiredForSmartSessionsError; } });
|
|
43
42
|
const smart_session_1 = require("./execution/smart-session");
|
|
44
43
|
const utils_2 = require("./execution/utils");
|
|
@@ -16,5 +16,6 @@ export declare class Orchestrator {
|
|
|
16
16
|
submitIntent(signedIntentOp: SignedIntentOp): Promise<IntentResult>;
|
|
17
17
|
getIntentOpStatus(intentId: bigint): Promise<IntentOpStatus>;
|
|
18
18
|
private parseError;
|
|
19
|
+
private parseErrorMessage;
|
|
19
20
|
}
|
|
20
21
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../orchestrator/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAuB,MAAM,MAAM,CAAA;AAexD,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,YAAY,EACZ,WAAW,EACX,SAAS,EAET,cAAc,EACf,MAAM,SAAS,CAAA;AAGhB,qBAAa,YAAY;IACvB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,MAAM,CAAQ;gBAEV,SAAS,EAAE,MAAM,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AAO,EAAE,MAAM,GAAG,OAAO,EAAE,CAAA;SAC7B,CAAA;KACF,GACA,OAAO,CAAC,SAAS,CAAC;IAmDf,iBAAiB,CACrB,WAAW,EAAE,OAAO,EACpB,kBAAkB,EAAE,MAAM,EAC1B,uBAAuB,EAAE,OAAO,EAChC,mBAAmB,EAAE,MAAM,GAC1B,OAAO,CAAC,MAAM,CAAC;IAyCZ,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IA0BtD,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAqBxD,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAqBnE,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAkBlE,OAAO,CAAC,UAAU;IA0ElB,OAAO,CAAC,iBAAiB;CAmD1B"}
|
|
@@ -186,7 +186,15 @@ class Orchestrator {
|
|
|
186
186
|
}
|
|
187
187
|
let context = {};
|
|
188
188
|
if (error.response.data) {
|
|
189
|
-
const { errors, traceId } = error.response.data;
|
|
189
|
+
const { errors, traceId, message } = error.response.data;
|
|
190
|
+
if (message) {
|
|
191
|
+
const mainErrorParams = {
|
|
192
|
+
context: { traceId },
|
|
193
|
+
errorType,
|
|
194
|
+
traceId,
|
|
195
|
+
};
|
|
196
|
+
this.parseErrorMessage(message, mainErrorParams);
|
|
197
|
+
}
|
|
190
198
|
for (const err of errors) {
|
|
191
199
|
let errorMessage = `Rhinestone Error: ${err.message}`;
|
|
192
200
|
if (errorType) {
|
|
@@ -207,60 +215,7 @@ class Orchestrator {
|
|
|
207
215
|
errorType,
|
|
208
216
|
traceId,
|
|
209
217
|
};
|
|
210
|
-
|
|
211
|
-
throw new error_1.InsufficientBalanceError(finalErrorParams);
|
|
212
|
-
}
|
|
213
|
-
else if (message === 'Unsupported chain id') {
|
|
214
|
-
throw new error_1.UnsupportedChainIdError(finalErrorParams);
|
|
215
|
-
}
|
|
216
|
-
else if (message.startsWith('Unsupported chain ')) {
|
|
217
|
-
const chainIdMatch = message.match(/Unsupported chain (\d+)/);
|
|
218
|
-
if (chainIdMatch) {
|
|
219
|
-
const chainId = parseInt(chainIdMatch[1], 10);
|
|
220
|
-
throw new error_1.UnsupportedChainError(chainId, finalErrorParams);
|
|
221
|
-
}
|
|
222
|
-
throw new error_1.UnsupportedChainIdError(finalErrorParams);
|
|
223
|
-
}
|
|
224
|
-
else if (message.includes('Unsupported token') &&
|
|
225
|
-
message.includes('for chain')) {
|
|
226
|
-
const tokenMatch = message.match(/Unsupported token (\w+) for chain (\d+)/);
|
|
227
|
-
if (tokenMatch) {
|
|
228
|
-
const tokenSymbol = tokenMatch[1];
|
|
229
|
-
const chainId = parseInt(tokenMatch[2], 10);
|
|
230
|
-
throw new error_1.UnsupportedTokenError(tokenSymbol, chainId, finalErrorParams);
|
|
231
|
-
}
|
|
232
|
-
throw new error_1.OrchestratorError({ message, ...finalErrorParams });
|
|
233
|
-
}
|
|
234
|
-
else if (message.includes('not supported on chain')) {
|
|
235
|
-
const tokenMatch = message.match(/Token (.+) not supported on chain (\d+)/);
|
|
236
|
-
if (tokenMatch) {
|
|
237
|
-
const tokenAddress = tokenMatch[1];
|
|
238
|
-
const chainId = parseInt(tokenMatch[2], 10);
|
|
239
|
-
throw new error_1.TokenNotSupportedError(tokenAddress, chainId, finalErrorParams);
|
|
240
|
-
}
|
|
241
|
-
throw new error_1.OrchestratorError({ message, ...finalErrorParams });
|
|
242
|
-
}
|
|
243
|
-
else if (message === 'Authentication is required') {
|
|
244
|
-
throw new error_1.AuthenticationRequiredError(finalErrorParams);
|
|
245
|
-
}
|
|
246
|
-
else if (message === 'Invalid API key') {
|
|
247
|
-
throw new error_1.InvalidApiKeyError(finalErrorParams);
|
|
248
|
-
}
|
|
249
|
-
else if (message === 'Invalid bundle signature') {
|
|
250
|
-
throw new error_1.InvalidIntentSignatureError(finalErrorParams);
|
|
251
|
-
}
|
|
252
|
-
else if (message === 'Only one target token amount can be unset') {
|
|
253
|
-
throw new error_1.OnlyOneTargetTokenAmountCanBeUnsetError(finalErrorParams);
|
|
254
|
-
}
|
|
255
|
-
else if (message === 'No Path Found') {
|
|
256
|
-
throw new error_1.NoPathFoundError(finalErrorParams);
|
|
257
|
-
}
|
|
258
|
-
else if (message === 'Order bundle not found') {
|
|
259
|
-
throw new error_1.IntentNotFoundError(finalErrorParams);
|
|
260
|
-
}
|
|
261
|
-
else {
|
|
262
|
-
throw new error_1.OrchestratorError({ message, ...finalErrorParams });
|
|
263
|
-
}
|
|
218
|
+
this.parseErrorMessage(message, finalErrorParams);
|
|
264
219
|
}
|
|
265
220
|
}
|
|
266
221
|
else {
|
|
@@ -268,5 +223,61 @@ class Orchestrator {
|
|
|
268
223
|
}
|
|
269
224
|
}
|
|
270
225
|
}
|
|
226
|
+
parseErrorMessage(message, errorParams) {
|
|
227
|
+
if (message === 'Insufficient balance') {
|
|
228
|
+
throw new error_1.InsufficientBalanceError(errorParams);
|
|
229
|
+
}
|
|
230
|
+
else if (message === 'Unsupported chain id') {
|
|
231
|
+
throw new error_1.UnsupportedChainIdError(errorParams);
|
|
232
|
+
}
|
|
233
|
+
else if (message.startsWith('Unsupported chain ')) {
|
|
234
|
+
const chainIdMatch = message.match(/Unsupported chain (\d+)/);
|
|
235
|
+
if (chainIdMatch) {
|
|
236
|
+
const chainId = parseInt(chainIdMatch[1], 10);
|
|
237
|
+
throw new error_1.UnsupportedChainError(chainId, errorParams);
|
|
238
|
+
}
|
|
239
|
+
throw new error_1.UnsupportedChainIdError(errorParams);
|
|
240
|
+
}
|
|
241
|
+
else if (message.includes('Unsupported token') &&
|
|
242
|
+
message.includes('for chain')) {
|
|
243
|
+
const tokenMatch = message.match(/Unsupported token (\w+) for chain (\d+)/);
|
|
244
|
+
if (tokenMatch) {
|
|
245
|
+
const tokenSymbol = tokenMatch[1];
|
|
246
|
+
const chainId = parseInt(tokenMatch[2], 10);
|
|
247
|
+
throw new error_1.UnsupportedTokenError(tokenSymbol, chainId, errorParams);
|
|
248
|
+
}
|
|
249
|
+
throw new error_1.OrchestratorError({ message, ...errorParams });
|
|
250
|
+
}
|
|
251
|
+
else if (message.includes('not supported on chain')) {
|
|
252
|
+
const tokenMatch = message.match(/Token (.+) not supported on chain (\d+)/);
|
|
253
|
+
if (tokenMatch) {
|
|
254
|
+
const tokenAddress = tokenMatch[1];
|
|
255
|
+
const chainId = parseInt(tokenMatch[2], 10);
|
|
256
|
+
throw new error_1.TokenNotSupportedError(tokenAddress, chainId, errorParams);
|
|
257
|
+
}
|
|
258
|
+
throw new error_1.OrchestratorError({ message, ...errorParams });
|
|
259
|
+
}
|
|
260
|
+
else if (message === 'Authentication is required') {
|
|
261
|
+
throw new error_1.AuthenticationRequiredError(errorParams);
|
|
262
|
+
}
|
|
263
|
+
else if (message === 'Invalid API key') {
|
|
264
|
+
throw new error_1.InvalidApiKeyError(errorParams);
|
|
265
|
+
}
|
|
266
|
+
else if (message === 'Invalid bundle signature') {
|
|
267
|
+
throw new error_1.InvalidIntentSignatureError(errorParams);
|
|
268
|
+
}
|
|
269
|
+
else if (message === 'Only one target token amount can be unset') {
|
|
270
|
+
throw new error_1.OnlyOneTargetTokenAmountCanBeUnsetError(errorParams);
|
|
271
|
+
}
|
|
272
|
+
else if (message === 'No Path Found') {
|
|
273
|
+
throw new error_1.NoPathFoundError(errorParams);
|
|
274
|
+
}
|
|
275
|
+
else if (message === 'Order bundle not found') {
|
|
276
|
+
throw new error_1.IntentNotFoundError(errorParams);
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
throw new error_1.OrchestratorError({ message, ...errorParams });
|
|
280
|
+
}
|
|
281
|
+
}
|
|
271
282
|
}
|
|
272
283
|
exports.Orchestrator = Orchestrator;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare const PROD_ORCHESTRATOR_URL = "https://
|
|
2
|
-
declare const
|
|
1
|
+
declare const PROD_ORCHESTRATOR_URL = "https://v1.orchestrator.rhinestone.dev";
|
|
2
|
+
declare const STAGING_ORCHESTRATOR_URL = "https://staging.v1.orchestrator.rhinestone.dev";
|
|
3
3
|
declare const RHINESTONE_SPOKE_POOL_ADDRESS = "0x000000000060f6e853447881951574cdd0663530";
|
|
4
|
-
export { PROD_ORCHESTRATOR_URL,
|
|
4
|
+
export { PROD_ORCHESTRATOR_URL, STAGING_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, };
|
|
5
5
|
//# sourceMappingURL=consts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../orchestrator/consts.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../orchestrator/consts.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,qBAAqB,2CAA2C,CAAA;AACtE,QAAA,MAAM,wBAAwB,mDACoB,CAAA;AAClD,QAAA,MAAM,6BAA6B,+CACW,CAAA;AAE9C,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,6BAA6B,GAC9B,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.
|
|
4
|
-
const PROD_ORCHESTRATOR_URL = 'https://
|
|
3
|
+
exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.STAGING_ORCHESTRATOR_URL = exports.PROD_ORCHESTRATOR_URL = void 0;
|
|
4
|
+
const PROD_ORCHESTRATOR_URL = 'https://v1.orchestrator.rhinestone.dev';
|
|
5
5
|
exports.PROD_ORCHESTRATOR_URL = PROD_ORCHESTRATOR_URL;
|
|
6
|
-
const
|
|
7
|
-
exports.
|
|
6
|
+
const STAGING_ORCHESTRATOR_URL = 'https://staging.v1.orchestrator.rhinestone.dev';
|
|
7
|
+
exports.STAGING_ORCHESTRATOR_URL = STAGING_ORCHESTRATOR_URL;
|
|
8
8
|
const RHINESTONE_SPOKE_POOL_ADDRESS = '0x000000000060f6e853447881951574cdd0663530';
|
|
9
9
|
exports.RHINESTONE_SPOKE_POOL_ADDRESS = RHINESTONE_SPOKE_POOL_ADDRESS;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -88,7 +88,6 @@ interface RhinestoneAccountConfig {
|
|
|
88
88
|
account?: AccountProviderConfig;
|
|
89
89
|
owners: OwnerSet;
|
|
90
90
|
rhinestoneApiKey: string;
|
|
91
|
-
deployerAccount?: Account;
|
|
92
91
|
sessions?: Session[];
|
|
93
92
|
recovery?: Recovery;
|
|
94
93
|
eoa?: Account;
|
|
@@ -152,7 +151,7 @@ interface SameChainTransaction extends BaseTransaction {
|
|
|
152
151
|
chain: Chain;
|
|
153
152
|
}
|
|
154
153
|
interface CrossChainTransaction extends BaseTransaction {
|
|
155
|
-
|
|
154
|
+
sourceChains?: Chain[];
|
|
156
155
|
targetChain: Chain;
|
|
157
156
|
}
|
|
158
157
|
type Transaction = SameChainTransaction | CrossChainTransaction;
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AAE5E,KAAK,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;AAE9C,UAAU,qBAAqB;IAC7B,IAAI,EAAE,WAAW,CAAA;CAClB;AAED,UAAU,sBAAsB;IAC9B,IAAI,EAAE,OAAO,CAAA;I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