@rhinestone/sdk 1.0.0-beta.39 → 1.0.0-beta.41
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/errors/index.d.ts +2 -2
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +16 -1
- package/dist/src/execution/compact.d.ts +2 -2
- package/dist/src/execution/compact.d.ts.map +1 -1
- package/dist/src/execution/compact.js +2 -2
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +2 -2
- package/dist/src/execution/multiChainOps.d.ts +40 -0
- package/dist/src/execution/multiChainOps.d.ts.map +1 -0
- package/dist/src/execution/multiChainOps.js +39 -0
- package/dist/src/execution/permit2.d.ts +2 -2
- package/dist/src/execution/permit2.d.ts.map +1 -1
- package/dist/src/execution/permit2.js +28 -19
- package/dist/src/execution/types.d.ts +2 -1
- package/dist/src/execution/types.d.ts.map +1 -1
- package/dist/src/execution/utils.d.ts +7 -3
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +73 -37
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +146 -53
- package/dist/src/orchestrator/error.d.ts +111 -1
- package/dist/src/orchestrator/error.d.ts.map +1 -1
- package/dist/src/orchestrator/error.js +128 -1
- package/dist/src/orchestrator/index.d.ts +2 -2
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +16 -1
- package/dist/src/orchestrator/types.d.ts +1 -1
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AccountConfigurationNotSupportedError, AccountError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError } from '../accounts';
|
|
2
2
|
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError } from '../execution';
|
|
3
|
-
import { AuthenticationRequiredError, InsufficientBalanceError, IntentNotFoundError, InvalidApiKeyError, InvalidIntentSignatureError, isOrchestratorError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from '../orchestrator';
|
|
4
|
-
export { isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, WalletClientNoConnectedAccountError, isExecutionError, ExecutionError, IntentFailedError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError, isOrchestratorError, AuthenticationRequiredError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, };
|
|
3
|
+
import { AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, IntentNotFoundError, InternalServerError, InvalidApiKeyError, InvalidIntentSignatureError, isAuthError, isOrchestratorError, isRateLimited, isRetryable, isValidationError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, RateLimitedError, ResourceNotFoundError, SchemaValidationError, ServiceUnavailableError, TokenNotSupportedError, UnauthorizedError, UnprocessableEntityError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from '../orchestrator';
|
|
4
|
+
export { isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, WalletClientNoConnectedAccountError, isExecutionError, ExecutionError, IntentFailedError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, InternalServerError, ResourceNotFoundError, RateLimitedError, SchemaValidationError, ServiceUnavailableError, UnprocessableEntityError, UnauthorizedError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, };
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,YAAY,EACZ,8BAA8B,EAC9B,kCAAkC,EAClC,wCAAwC,EACxC,4BAA4B,EAC5B,cAAc,EACd,kCAAkC,EAClC,4BAA4B,EAC5B,mCAAmC,EACpC,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC3B,mBAAmB,EACnB,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,qCAAqC,EACrC,8BAA8B,EAC9B,wCAAwC,EACxC,4BAA4B,EAC5B,4BAA4B,EAC5B,kCAAkC,EAClC,kCAAkC,EAClC,mCAAmC,EAEnC,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,gCAAgC,EAChC,yBAAyB,EACzB,uBAAuB,EAEvB,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"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,YAAY,EACZ,8BAA8B,EAC9B,kCAAkC,EAClC,wCAAwC,EACxC,4BAA4B,EAC5B,cAAc,EACd,kCAAkC,EAClC,4BAA4B,EAC5B,mCAAmC,EACpC,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC3B,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,qCAAqC,EACrC,8BAA8B,EAC9B,wCAAwC,EACxC,4BAA4B,EAC5B,4BAA4B,EAC5B,kCAAkC,EAClC,kCAAkC,EAClC,mCAAmC,EAEnC,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,gCAAgC,EAChC,yBAAyB,EACzB,uBAAuB,EAEvB,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,GACtB,CAAA"}
|
package/dist/src/errors/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.SignerNotSupportedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.IntentFailedError = exports.ExecutionError = exports.isExecutionError = exports.WalletClientNoConnectedAccountError = exports.Eip7702NotSupportedForAccountError = exports.SigningNotSupportedForAccountError = exports.SmartSessionsNotEnabledError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.Eip7702AccountMustHaveEoaError = exports.AccountConfigurationNotSupportedError = exports.AccountError = exports.isAccountError = void 0;
|
|
3
|
+
exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.UnauthorizedError = exports.UnprocessableEntityError = exports.ServiceUnavailableError = exports.SchemaValidationError = exports.RateLimitedError = exports.ResourceNotFoundError = exports.InternalServerError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.ForbiddenError = exports.ConflictError = exports.BodyParserError = exports.BadRequestError = exports.AuthenticationRequiredError = exports.isRateLimited = exports.isValidationError = exports.isAuthError = exports.isRetryable = exports.isOrchestratorError = exports.SignerNotSupportedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.IntentFailedError = exports.ExecutionError = exports.isExecutionError = exports.WalletClientNoConnectedAccountError = exports.Eip7702NotSupportedForAccountError = exports.SigningNotSupportedForAccountError = exports.SmartSessionsNotEnabledError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.Eip7702AccountMustHaveEoaError = exports.AccountConfigurationNotSupportedError = exports.AccountError = exports.isAccountError = void 0;
|
|
4
4
|
const accounts_1 = require("../accounts");
|
|
5
5
|
Object.defineProperty(exports, "AccountConfigurationNotSupportedError", { enumerable: true, get: function () { return accounts_1.AccountConfigurationNotSupportedError; } });
|
|
6
6
|
Object.defineProperty(exports, "AccountError", { enumerable: true, get: function () { return accounts_1.AccountError; } });
|
|
@@ -21,15 +21,30 @@ Object.defineProperty(exports, "SessionChainRequiredError", { enumerable: true,
|
|
|
21
21
|
Object.defineProperty(exports, "SignerNotSupportedError", { enumerable: true, get: function () { return execution_1.SignerNotSupportedError; } });
|
|
22
22
|
const orchestrator_1 = require("../orchestrator");
|
|
23
23
|
Object.defineProperty(exports, "AuthenticationRequiredError", { enumerable: true, get: function () { return orchestrator_1.AuthenticationRequiredError; } });
|
|
24
|
+
Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return orchestrator_1.BadRequestError; } });
|
|
25
|
+
Object.defineProperty(exports, "BodyParserError", { enumerable: true, get: function () { return orchestrator_1.BodyParserError; } });
|
|
26
|
+
Object.defineProperty(exports, "ConflictError", { enumerable: true, get: function () { return orchestrator_1.ConflictError; } });
|
|
27
|
+
Object.defineProperty(exports, "ForbiddenError", { enumerable: true, get: function () { return orchestrator_1.ForbiddenError; } });
|
|
24
28
|
Object.defineProperty(exports, "InsufficientBalanceError", { enumerable: true, get: function () { return orchestrator_1.InsufficientBalanceError; } });
|
|
25
29
|
Object.defineProperty(exports, "IntentNotFoundError", { enumerable: true, get: function () { return orchestrator_1.IntentNotFoundError; } });
|
|
30
|
+
Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return orchestrator_1.InternalServerError; } });
|
|
26
31
|
Object.defineProperty(exports, "InvalidApiKeyError", { enumerable: true, get: function () { return orchestrator_1.InvalidApiKeyError; } });
|
|
27
32
|
Object.defineProperty(exports, "InvalidIntentSignatureError", { enumerable: true, get: function () { return orchestrator_1.InvalidIntentSignatureError; } });
|
|
33
|
+
Object.defineProperty(exports, "isAuthError", { enumerable: true, get: function () { return orchestrator_1.isAuthError; } });
|
|
28
34
|
Object.defineProperty(exports, "isOrchestratorError", { enumerable: true, get: function () { return orchestrator_1.isOrchestratorError; } });
|
|
35
|
+
Object.defineProperty(exports, "isRateLimited", { enumerable: true, get: function () { return orchestrator_1.isRateLimited; } });
|
|
36
|
+
Object.defineProperty(exports, "isRetryable", { enumerable: true, get: function () { return orchestrator_1.isRetryable; } });
|
|
37
|
+
Object.defineProperty(exports, "isValidationError", { enumerable: true, get: function () { return orchestrator_1.isValidationError; } });
|
|
29
38
|
Object.defineProperty(exports, "NoPathFoundError", { enumerable: true, get: function () { return orchestrator_1.NoPathFoundError; } });
|
|
30
39
|
Object.defineProperty(exports, "OnlyOneTargetTokenAmountCanBeUnsetError", { enumerable: true, get: function () { return orchestrator_1.OnlyOneTargetTokenAmountCanBeUnsetError; } });
|
|
31
40
|
Object.defineProperty(exports, "OrchestratorError", { enumerable: true, get: function () { return orchestrator_1.OrchestratorError; } });
|
|
41
|
+
Object.defineProperty(exports, "RateLimitedError", { enumerable: true, get: function () { return orchestrator_1.RateLimitedError; } });
|
|
42
|
+
Object.defineProperty(exports, "ResourceNotFoundError", { enumerable: true, get: function () { return orchestrator_1.ResourceNotFoundError; } });
|
|
43
|
+
Object.defineProperty(exports, "SchemaValidationError", { enumerable: true, get: function () { return orchestrator_1.SchemaValidationError; } });
|
|
44
|
+
Object.defineProperty(exports, "ServiceUnavailableError", { enumerable: true, get: function () { return orchestrator_1.ServiceUnavailableError; } });
|
|
32
45
|
Object.defineProperty(exports, "TokenNotSupportedError", { enumerable: true, get: function () { return orchestrator_1.TokenNotSupportedError; } });
|
|
46
|
+
Object.defineProperty(exports, "UnauthorizedError", { enumerable: true, get: function () { return orchestrator_1.UnauthorizedError; } });
|
|
47
|
+
Object.defineProperty(exports, "UnprocessableEntityError", { enumerable: true, get: function () { return orchestrator_1.UnprocessableEntityError; } });
|
|
33
48
|
Object.defineProperty(exports, "UnsupportedChainError", { enumerable: true, get: function () { return orchestrator_1.UnsupportedChainError; } });
|
|
34
49
|
Object.defineProperty(exports, "UnsupportedChainIdError", { enumerable: true, get: function () { return orchestrator_1.UnsupportedChainIdError; } });
|
|
35
50
|
Object.defineProperty(exports, "UnsupportedTokenError", { enumerable: true, get: function () { return orchestrator_1.UnsupportedTokenError; } });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Hex } from 'viem';
|
|
2
|
-
import type { IntentOp } from '../orchestrator/types';
|
|
2
|
+
import type { IntentOp, IntentOpElement } from '../orchestrator/types';
|
|
3
3
|
declare const COMPACT_ADDRESS = "0x73d2dc0c21fca4ec1601895d50df7f5624f07d3f";
|
|
4
4
|
declare function getCompactTypedData(intentOp: IntentOp): {
|
|
5
5
|
readonly domain: {
|
|
@@ -146,6 +146,6 @@ declare function getCompactDigest(intentOp: IntentOp): Hex;
|
|
|
146
146
|
* @param intentOp The intent operation
|
|
147
147
|
* @returns The digest hash
|
|
148
148
|
*/
|
|
149
|
-
declare function getPermit2Digest(
|
|
149
|
+
declare function getPermit2Digest(element: IntentOpElement, nonce: bigint, expires: bigint): Hex;
|
|
150
150
|
export { COMPACT_ADDRESS, getCompactTypedData, getCompactDigest, getPermit2Digest, };
|
|
151
151
|
//# sourceMappingURL=compact.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compact.d.ts","sourceRoot":"","sources":["../../../execution/compact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAA0C,MAAM,MAAM,CAAA;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"compact.d.ts","sourceRoot":"","sources":["../../../execution/compact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAA0C,MAAM,MAAM,CAAA;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAGtE,QAAA,MAAM,eAAe,+CAA+C,CAAA;AA8CpE,iBAAS,mBAAmB,CAAC,QAAQ,EAAE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmD9C;AAED;;;;GAIG;AACH,iBAAS,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,GAAG,CAGjD;AAED;;;;GAIG;AACH,iBAAS,gBAAgB,CACvB,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GACd,GAAG,CAGL;AAED,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GACjB,CAAA"}
|
|
@@ -116,7 +116,7 @@ function getCompactDigest(intentOp) {
|
|
|
116
116
|
* @param intentOp The intent operation
|
|
117
117
|
* @returns The digest hash
|
|
118
118
|
*/
|
|
119
|
-
function getPermit2Digest(
|
|
120
|
-
const typedData = (0, permit2_1.getTypedData)(
|
|
119
|
+
function getPermit2Digest(element, nonce, expires) {
|
|
120
|
+
const typedData = (0, permit2_1.getTypedData)(element, nonce, expires);
|
|
121
121
|
return (0, viem_1.hashTypedData)(typedData);
|
|
122
122
|
}
|
|
@@ -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;AAY3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,uBAAuB,EACvB,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,WAAW,EACX,wBAAwB,EACzB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAerE,UAAU,iBAAiB;IACzB,IAAI,EAAE;QACJ,IAAI,EAAE,GAAG,GAAG,SAAS,CAAA;QACrB,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,MAAM,EAAE;QACN,IAAI,EAAE,GAAG,GAAG,SAAS,CAAA;QACrB,OAAO,EAAE,MAAM,CAAA;KAChB,EAAE,CAAA;CACJ;AAED,iBAAe,eAAe,CAC5B,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAE,WAA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CpB;AAyDD,iBAAe,gBAAgB,CAC7B,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,iBAAiB,GAAG,mBAAmB,EAC/C,uBAAuB,EAAE,OAAO,GAC/B,OAAO,CAAC,iBAAiB,GAAG,oBAAoB,CAAC,CAiDnD;AAED,iBAAe,qBAAqB,CAClC,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,OAAO,EACrB,QAAQ,EAAE,MAAM,EAChB,SAAS,GAAE,OAAe,GACzB,OAAO,CAAC,MAAM,CAAC,CAcjB;AAED,iBAAe,YAAY,CAAC,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,OAAO,gDASxE;AAED,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EAEZ,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,gCAAgC,EAChC,yBAAyB,EACzB,uBAAuB,GACxB,CAAA;AACD,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -99,11 +99,11 @@ async function sendTransactionAsIntent(config, sourceChains, targetChain, callIn
|
|
|
99
99
|
if (!intentRoute) {
|
|
100
100
|
throw new error_1.OrderPathRequiredForIntentsError();
|
|
101
101
|
}
|
|
102
|
-
const
|
|
102
|
+
const { originSignatures, destinationSignature } = await (0, utils_2.signIntent)(config, targetChain, intentRoute.intentOp, signers);
|
|
103
103
|
const authorizations = config.eoa
|
|
104
104
|
? await (0, utils_2.signAuthorizationsInternal)(config, intentRoute)
|
|
105
105
|
: [];
|
|
106
|
-
return await (0, utils_2.submitIntentInternal)(config, sourceChains, targetChain, intentRoute.intentOp,
|
|
106
|
+
return await (0, utils_2.submitIntentInternal)(config, sourceChains, targetChain, intentRoute.intentOp, originSignatures, destinationSignature, authorizations, dryRun);
|
|
107
107
|
}
|
|
108
108
|
async function waitForExecution(config, result, acceptsPreconfirmations) {
|
|
109
109
|
const validStatuses = new Set([
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Address, Hex } from 'viem';
|
|
2
|
+
import type { IntentOp } from '../orchestrator';
|
|
3
|
+
interface Op {
|
|
4
|
+
to: Address;
|
|
5
|
+
value: bigint;
|
|
6
|
+
data: Hex;
|
|
7
|
+
}
|
|
8
|
+
interface ChainOps {
|
|
9
|
+
chainId: bigint;
|
|
10
|
+
nonce: bigint;
|
|
11
|
+
ops: Op[];
|
|
12
|
+
}
|
|
13
|
+
declare function getTypedData(account: Address, intentExecutorAddress: Address, intentOp: IntentOp): {
|
|
14
|
+
domain: {
|
|
15
|
+
name: string;
|
|
16
|
+
version: string;
|
|
17
|
+
verifyingContract: `0x${string}`;
|
|
18
|
+
};
|
|
19
|
+
types: {
|
|
20
|
+
MultiChainOps: {
|
|
21
|
+
name: string;
|
|
22
|
+
type: string;
|
|
23
|
+
}[];
|
|
24
|
+
ChainOps: {
|
|
25
|
+
name: string;
|
|
26
|
+
type: string;
|
|
27
|
+
}[];
|
|
28
|
+
Op: {
|
|
29
|
+
name: string;
|
|
30
|
+
type: string;
|
|
31
|
+
}[];
|
|
32
|
+
};
|
|
33
|
+
primaryType: "MultiChainOps";
|
|
34
|
+
message: {
|
|
35
|
+
account: `0x${string}`;
|
|
36
|
+
ops: ChainOps[];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export { getTypedData };
|
|
40
|
+
//# sourceMappingURL=multiChainOps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiChainOps.d.ts","sourceRoot":"","sources":["../../../execution/multiChainOps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C,UAAU,EAAE;IACV,EAAE,EAAE,OAAO,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,GAAG,CAAA;CACV;AAED,UAAU,QAAQ;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,EAAE,EAAE,CAAA;CACV;AAED,iBAAS,YAAY,CACnB,OAAO,EAAE,OAAO,EAChB,qBAAqB,EAAE,OAAO,EAC9B,QAAQ,EAAE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;EAqCnB;AACD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTypedData = getTypedData;
|
|
4
|
+
function getTypedData(account, intentExecutorAddress, intentOp) {
|
|
5
|
+
const ops = intentOp.elements[0].mandate.destinationOps;
|
|
6
|
+
const chainOps = {
|
|
7
|
+
chainId: BigInt(intentOp.elements[0].chainId),
|
|
8
|
+
nonce: BigInt(intentOp.nonce),
|
|
9
|
+
ops,
|
|
10
|
+
};
|
|
11
|
+
return {
|
|
12
|
+
domain: {
|
|
13
|
+
name: 'IntentExecutor',
|
|
14
|
+
version: 'v0.0.1',
|
|
15
|
+
verifyingContract: intentExecutorAddress,
|
|
16
|
+
},
|
|
17
|
+
types: {
|
|
18
|
+
MultiChainOps: [
|
|
19
|
+
{ name: 'account', type: 'address' },
|
|
20
|
+
{ name: 'ops', type: 'ChainOps[]' },
|
|
21
|
+
],
|
|
22
|
+
ChainOps: [
|
|
23
|
+
{ name: 'chainId', type: 'uint256' },
|
|
24
|
+
{ name: 'nonce', type: 'uint256' },
|
|
25
|
+
{ name: 'ops', type: 'Op[]' },
|
|
26
|
+
],
|
|
27
|
+
Op: [
|
|
28
|
+
{ name: 'to', type: 'address' },
|
|
29
|
+
{ name: 'value', type: 'uint256' },
|
|
30
|
+
{ name: 'data', type: 'bytes' },
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
primaryType: 'MultiChainOps',
|
|
34
|
+
message: {
|
|
35
|
+
account,
|
|
36
|
+
ops: [chainOps],
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Address, type Chain } from 'viem';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IntentOpElement } from '../orchestrator/types';
|
|
3
3
|
import type { RhinestoneConfig } from '../types';
|
|
4
4
|
import type { BatchPermit2Result, MultiChainPermit2Config, MultiChainPermit2Result, TokenPermissions } from './types';
|
|
5
|
-
declare function getTypedData(
|
|
5
|
+
declare function getTypedData(element: IntentOpElement, nonce: bigint, expires: bigint): {
|
|
6
6
|
readonly domain: {
|
|
7
7
|
readonly name: "Permit2";
|
|
8
8
|
readonly chainId: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permit2.d.ts","sourceRoot":"","sources":["../../../execution/permit2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAIX,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"permit2.d.ts","sourceRoot":"","sources":["../../../execution/permit2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAIX,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAQhB,iBAAS,YAAY,CACnB,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8FhB;AAED,iBAAe,yBAAyB,CACtC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,GAAG,GAChB,OAAO,CAAC,MAAM,CAAC,CAyBjB;AAED,iBAAe,mBAAmB,CAChC,YAAY,EAAE,OAAO,EACrB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,MAAM,CAAC,CAuBjB;AAED;;;GAGG;AACH,iBAAS,iBAAiB,IAAI,OAAO,CAEpC;AAED;;;;;;;;;GASG;AACH,iBAAe,gBAAgB,CAC7B,OAAO,EAAE,uBAAuB,EAAE,GACjC,OAAO,CAAC,kBAAkB,CAAC,CAyE7B;AAED;;;;;;;;;;GAUG;AACH,iBAAe,qBAAqB,CAClC,OAAO,EAAE,uBAAuB,EAAE,EAClC,UAAU,CAAC,EAAE,CACX,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,uBAAuB,KAC7B,IAAI,GACR,OAAO,CAAC,kBAAkB,CAAC,CA8D7B;AAED,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EAEjB,gBAAgB,EAChB,qBAAqB,EAErB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,GACxB,CAAA"}
|
|
@@ -12,8 +12,7 @@ const PERMIT2_ADDRESS = '0x000000000022D473030F116dDEE9F6B43aC78BA3';
|
|
|
12
12
|
function toToken(id) {
|
|
13
13
|
return `0x${(id & ((1n << 160n) - 1n)).toString(16).padStart(40, '0')}`;
|
|
14
14
|
}
|
|
15
|
-
function getTypedData(
|
|
16
|
-
const element = intentOp.elements[0];
|
|
15
|
+
function getTypedData(element, nonce, expires) {
|
|
17
16
|
const tokens = element.idsAndAmounts.map(([id, amount]) => [
|
|
18
17
|
BigInt(id),
|
|
19
18
|
BigInt(amount),
|
|
@@ -30,7 +29,7 @@ function getTypedData(intentOp) {
|
|
|
30
29
|
const typedData = {
|
|
31
30
|
domain: {
|
|
32
31
|
name: 'Permit2',
|
|
33
|
-
chainId: Number(
|
|
32
|
+
chainId: Number(element.chainId),
|
|
34
33
|
verifyingContract: PERMIT2_ADDRESS,
|
|
35
34
|
},
|
|
36
35
|
types: {
|
|
@@ -73,8 +72,8 @@ function getTypedData(intentOp) {
|
|
|
73
72
|
message: {
|
|
74
73
|
permitted: tokenPermissions,
|
|
75
74
|
spender: spender,
|
|
76
|
-
nonce:
|
|
77
|
-
deadline:
|
|
75
|
+
nonce: nonce,
|
|
76
|
+
deadline: expires,
|
|
78
77
|
mandate: {
|
|
79
78
|
target: {
|
|
80
79
|
recipient: mandate.recipient,
|
|
@@ -171,16 +170,20 @@ async function signPermit2Batch(configs) {
|
|
|
171
170
|
// Process all signing operations in parallel
|
|
172
171
|
const signingPromises = configs.map(async (config) => {
|
|
173
172
|
try {
|
|
174
|
-
//
|
|
175
|
-
const typedData = getTypedData(config.intentOp);
|
|
176
|
-
// Sign with EOA account
|
|
173
|
+
// sign each element individually for this chain sequentially to preserve order
|
|
177
174
|
if (!config.eoaAccount.signTypedData) {
|
|
178
175
|
throw new Error('EOA account does not support typed data signing');
|
|
179
176
|
}
|
|
180
|
-
const
|
|
177
|
+
const originSignatures = [];
|
|
178
|
+
for (const element of config.intentOp.elements) {
|
|
179
|
+
const typedData = getTypedData(element, BigInt(config.intentOp.nonce), BigInt(config.intentOp.expires));
|
|
180
|
+
const sig = await config.eoaAccount.signTypedData(typedData);
|
|
181
|
+
originSignatures.push(sig);
|
|
182
|
+
}
|
|
181
183
|
const result = {
|
|
182
184
|
chainId: config.chain.id,
|
|
183
|
-
|
|
185
|
+
originSignatures,
|
|
186
|
+
destinationSignature: originSignatures[0] ?? '0x',
|
|
184
187
|
success: true,
|
|
185
188
|
};
|
|
186
189
|
successfulSignatures++;
|
|
@@ -189,7 +192,8 @@ async function signPermit2Batch(configs) {
|
|
|
189
192
|
catch (error) {
|
|
190
193
|
const result = {
|
|
191
194
|
chainId: config.chain.id,
|
|
192
|
-
|
|
195
|
+
originSignatures: [],
|
|
196
|
+
destinationSignature: '0x',
|
|
193
197
|
success: false,
|
|
194
198
|
error: error instanceof Error ? error : new Error(String(error)),
|
|
195
199
|
};
|
|
@@ -199,7 +203,6 @@ async function signPermit2Batch(configs) {
|
|
|
199
203
|
});
|
|
200
204
|
// Wait for all signing operations to complete
|
|
201
205
|
const signingResults = await Promise.allSettled(signingPromises);
|
|
202
|
-
// Process results
|
|
203
206
|
for (const result of signingResults) {
|
|
204
207
|
if (result.status === 'fulfilled') {
|
|
205
208
|
results.push(result.value);
|
|
@@ -209,7 +212,8 @@ async function signPermit2Batch(configs) {
|
|
|
209
212
|
failedSignatures++;
|
|
210
213
|
results.push({
|
|
211
214
|
chainId: 0,
|
|
212
|
-
|
|
215
|
+
originSignatures: [],
|
|
216
|
+
destinationSignature: '0x',
|
|
213
217
|
success: false,
|
|
214
218
|
error: result.reason,
|
|
215
219
|
});
|
|
@@ -242,16 +246,20 @@ async function signPermit2Sequential(configs, onProgress) {
|
|
|
242
246
|
for (let i = 0; i < configs.length; i++) {
|
|
243
247
|
const config = configs[i];
|
|
244
248
|
try {
|
|
245
|
-
//
|
|
246
|
-
const typedData = getTypedData(config.intentOp);
|
|
247
|
-
// Sign with EOA account
|
|
249
|
+
// sign each element for this chain sequentially to preserve order
|
|
248
250
|
if (!config.eoaAccount.signTypedData) {
|
|
249
251
|
throw new Error('EOA account does not support typed data signing');
|
|
250
252
|
}
|
|
251
|
-
const
|
|
253
|
+
const originSignatures = [];
|
|
254
|
+
for (const element of config.intentOp.elements) {
|
|
255
|
+
const typedData = getTypedData(element, BigInt(config.intentOp.nonce), BigInt(config.intentOp.expires));
|
|
256
|
+
const sig = await config.eoaAccount.signTypedData(typedData);
|
|
257
|
+
originSignatures.push(sig);
|
|
258
|
+
}
|
|
252
259
|
const result = {
|
|
253
260
|
chainId: config.chain.id,
|
|
254
|
-
|
|
261
|
+
originSignatures,
|
|
262
|
+
destinationSignature: originSignatures[0] ?? '0x',
|
|
255
263
|
success: true,
|
|
256
264
|
};
|
|
257
265
|
results.push(result);
|
|
@@ -262,7 +270,8 @@ async function signPermit2Sequential(configs, onProgress) {
|
|
|
262
270
|
catch (error) {
|
|
263
271
|
const result = {
|
|
264
272
|
chainId: config.chain.id,
|
|
265
|
-
|
|
273
|
+
originSignatures: [],
|
|
274
|
+
destinationSignature: '0x',
|
|
266
275
|
success: false,
|
|
267
276
|
error: error instanceof Error ? error : new Error(String(error)),
|
|
268
277
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../execution/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErD,UAAU,gBAAgB;IACxB,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,UAAU,uBAAuB;IAC/B,KAAK,EAAE,KAAK,CAAA;IACZ,QAAQ,EAAE,QAAQ,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED;;GAEG;AACH,UAAU,uBAAuB;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../execution/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErD,UAAU,gBAAgB;IACxB,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,UAAU,uBAAuB;IAC/B,KAAK,EAAE,KAAK,CAAA;IACZ,QAAQ,EAAE,QAAQ,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED;;GAEG;AACH,UAAU,uBAAuB;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,GAAG,EAAE,CAAA;IACvB,oBAAoB,EAAE,GAAG,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED;;GAEG;AACH,UAAU,kBAAkB;IAC1B,OAAO,EAAE,uBAAuB,EAAE,CAAA;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,OAAO,CAAA;CACvB;AAED,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,GACnB,CAAA"}
|
|
@@ -24,7 +24,8 @@ interface PreparedUserOperationData {
|
|
|
24
24
|
transaction: UserOperationTransaction;
|
|
25
25
|
}
|
|
26
26
|
interface SignedTransactionData extends PreparedTransactionData {
|
|
27
|
-
|
|
27
|
+
originSignatures: Hex[];
|
|
28
|
+
destinationSignature: Hex;
|
|
28
29
|
}
|
|
29
30
|
interface SignedUserOperationData extends PreparedUserOperationData {
|
|
30
31
|
signature: Hex;
|
|
@@ -42,9 +43,12 @@ declare function submitTransaction(config: RhinestoneConfig, signedTransaction:
|
|
|
42
43
|
declare function submitUserOperation(config: RhinestoneConfig, signedUserOperation: SignedUserOperationData): Promise<UserOperationResult>;
|
|
43
44
|
declare function getTokenRequests(sourceChains: Chain[], targetChain: Chain, initialTokenRequests: TokenRequest[] | undefined, settlementLayers: SettlementLayer[] | undefined): TokenRequest[];
|
|
44
45
|
declare function prepareTransactionAsIntent(config: RhinestoneConfig, sourceChains: Chain[] | undefined, targetChain: Chain, callInputs: CalldataInput[], gasLimit: bigint | undefined, tokenRequests: TokenRequest[], accountAddress: Address, isSponsored: boolean, eip7702InitSignature: Hex | undefined, settlementLayers: SettlementLayer[] | undefined, sourceAssets: SourceAssetInput | undefined, feeAsset: Address | TokenSymbol | undefined, lockFunds?: boolean): Promise<IntentRoute>;
|
|
45
|
-
declare function signIntent(config: RhinestoneConfig, targetChain: Chain, intentOp: IntentOp, signers?: SignerSet): Promise
|
|
46
|
+
declare function signIntent(config: RhinestoneConfig, targetChain: Chain, intentOp: IntentOp, signers?: SignerSet): Promise<{
|
|
47
|
+
originSignatures: any[];
|
|
48
|
+
destinationSignature: `0x${string}`;
|
|
49
|
+
}>;
|
|
46
50
|
declare function getOrchestratorByChain(chainId: number, apiKey: string | undefined, orchestratorUrl?: string): import("../orchestrator").Orchestrator;
|
|
47
|
-
declare function submitIntentInternal(config: RhinestoneConfig, sourceChains: Chain[] | undefined, targetChain: Chain, intentOp: IntentOp,
|
|
51
|
+
declare function submitIntentInternal(config: RhinestoneConfig, sourceChains: Chain[] | undefined, targetChain: Chain, intentOp: IntentOp, originSignatures: Hex[], destinationSignature: Hex, authorizations: SignedAuthorizationList, dryRun: boolean): Promise<TransactionResult>;
|
|
48
52
|
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>;
|
|
49
53
|
declare function parseCalls(calls: CalldataInput[], chainId: number): Call[];
|
|
50
54
|
export { prepareTransaction, signTransaction, signAuthorizations, signAuthorizationsInternal, signMessage, signTypedData, submitTransaction, prepareUserOperation, signUserOperation, submitUserOperation, getOrchestratorByChain, signIntent, prepareTransactionAsIntent, submitIntentInternal, getValidatorAccount, parseCalls, getTokenRequests, resolveCallInputs, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../execution/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAIV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAIR,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EAGf,MAAM,MAAM,CAAA;AACb,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../execution/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAIV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAIR,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EAGf,MAAM,MAAM,CAAA;AACb,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAA;AA4BjC,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,WAAW,EAEjB,MAAM,iBAAiB,CAAA;AAWxB,OAAO,KAAK,EAEV,eAAe,EAGhB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EACV,IAAI,EACJ,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,WAAW,EACX,wBAAwB,EACzB,MAAM,UAAU,CAAA;AAMjB,UAAU,mBAAmB;IAC3B,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,GAAG,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;CACd;AAED,UAAU,iBAAiB;IACzB,IAAI,EAAE,QAAQ,CAAA;IACd,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,WAAW,EAAE,MAAM,CAAA;CACpB;AA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CAAA"}
|
|
@@ -22,6 +22,7 @@ const viem_1 = require("viem");
|
|
|
22
22
|
const account_abstraction_1 = require("viem/account-abstraction");
|
|
23
23
|
const accounts_1 = require("../accounts");
|
|
24
24
|
const utils_1 = require("../accounts/utils");
|
|
25
|
+
const modules_1 = require("../modules");
|
|
25
26
|
const validators_1 = require("../modules/validators");
|
|
26
27
|
const core_1 = require("../modules/validators/core");
|
|
27
28
|
const orchestrator_1 = require("../orchestrator");
|
|
@@ -29,6 +30,7 @@ const consts_1 = require("../orchestrator/consts");
|
|
|
29
30
|
const registry_1 = require("../orchestrator/registry");
|
|
30
31
|
const compact_1 = require("./compact");
|
|
31
32
|
const error_1 = require("./error");
|
|
33
|
+
const multiChainOps_1 = require("./multiChainOps");
|
|
32
34
|
const permit2_1 = require("./permit2");
|
|
33
35
|
async function prepareTransaction(config, transaction) {
|
|
34
36
|
const { sourceChains, targetChain, tokenRequests, signers, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds, } = getTransactionParams(transaction);
|
|
@@ -75,11 +77,12 @@ async function resolveCallInputs(inputs, config, chain, accountAddress) {
|
|
|
75
77
|
async function signTransaction(config, preparedTransaction) {
|
|
76
78
|
const { targetChain, signers } = getTransactionParams(preparedTransaction.transaction);
|
|
77
79
|
const intentRoute = preparedTransaction.intentRoute;
|
|
78
|
-
const
|
|
80
|
+
const { originSignatures, destinationSignature } = await signIntent(config, targetChain, intentRoute.intentOp, signers);
|
|
79
81
|
return {
|
|
80
82
|
intentRoute,
|
|
81
83
|
transaction: preparedTransaction.transaction,
|
|
82
|
-
|
|
84
|
+
originSignatures,
|
|
85
|
+
destinationSignature,
|
|
83
86
|
};
|
|
84
87
|
}
|
|
85
88
|
async function signUserOperation(config, preparedUserOperation) {
|
|
@@ -159,10 +162,10 @@ async function signAuthorizationsInternal(config, data) {
|
|
|
159
162
|
return authorizations;
|
|
160
163
|
}
|
|
161
164
|
async function submitTransaction(config, signedTransaction, authorizations, dryRun = false) {
|
|
162
|
-
const { intentRoute, transaction,
|
|
165
|
+
const { intentRoute, transaction, originSignatures, destinationSignature } = signedTransaction;
|
|
163
166
|
const { sourceChains, targetChain } = getTransactionParams(transaction);
|
|
164
167
|
const intentOp = intentRoute.intentOp;
|
|
165
|
-
return await submitIntent(config, sourceChains, targetChain, intentOp,
|
|
168
|
+
return await submitIntent(config, sourceChains, targetChain, intentOp, originSignatures, destinationSignature, authorizations, dryRun);
|
|
166
169
|
}
|
|
167
170
|
async function submitUserOperation(config, signedUserOperation) {
|
|
168
171
|
const chain = signedUserOperation.transaction.chain;
|
|
@@ -287,26 +290,31 @@ async function prepareTransactionAsIntent(config, sourceChains, targetChain, cal
|
|
|
287
290
|
}
|
|
288
291
|
async function signIntent(config, targetChain, intentOp, signers) {
|
|
289
292
|
if (config.account?.type === 'eoa') {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
293
|
+
const originSignatures = [];
|
|
294
|
+
for (const element of intentOp.elements) {
|
|
295
|
+
let digest;
|
|
296
|
+
if (config.eoa?.signTypedData) {
|
|
297
|
+
const typedData = (0, permit2_1.getTypedData)(element, BigInt(intentOp.nonce), BigInt(intentOp.expires));
|
|
298
|
+
originSignatures.push(await config.eoa.signTypedData(typedData));
|
|
299
|
+
}
|
|
300
|
+
else if (config.eoa?.sign) {
|
|
301
|
+
digest = (0, compact_1.getPermit2Digest)(element, BigInt(intentOp.nonce), BigInt(intentOp.expires));
|
|
302
|
+
originSignatures.push(await config.eoa.sign({ hash: digest }));
|
|
303
|
+
}
|
|
304
|
+
else if (config.eoa?.signMessage) {
|
|
305
|
+
digest = (0, compact_1.getPermit2Digest)(element, BigInt(intentOp.nonce), BigInt(intentOp.expires));
|
|
306
|
+
originSignatures.push(await config.eoa.signMessage({
|
|
307
|
+
message: { raw: digest },
|
|
308
|
+
}));
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
throw new accounts_1.EoaSigningMethodNotConfiguredError('signTypedData, sign, or signMessage');
|
|
312
|
+
}
|
|
308
313
|
}
|
|
309
|
-
return
|
|
314
|
+
return {
|
|
315
|
+
originSignatures,
|
|
316
|
+
destinationSignature: originSignatures[0],
|
|
317
|
+
};
|
|
310
318
|
}
|
|
311
319
|
const validator = getValidator(config, signers);
|
|
312
320
|
if (!validator) {
|
|
@@ -314,19 +322,47 @@ async function signIntent(config, targetChain, intentOp, signers) {
|
|
|
314
322
|
}
|
|
315
323
|
const ownerValidator = (0, validators_1.getOwnerValidator)(config);
|
|
316
324
|
const isRoot = validator.address === ownerValidator.address;
|
|
317
|
-
const
|
|
318
|
-
return
|
|
325
|
+
const signatures = await getIntentSignature(config, intentOp, signers, targetChain, validator, isRoot);
|
|
326
|
+
return signatures;
|
|
319
327
|
}
|
|
320
328
|
async function getIntentSignature(config, intentOp, signers, targetChain, validator, isRoot) {
|
|
321
329
|
const withJitFlow = intentOp.elements.some((element) => element.mandate.qualifier.settlementContext?.usingJIT);
|
|
330
|
+
const withMultiChainOps = intentOp.elements.some((element) => element.mandate.qualifier.settlementContext.settlementLayer ===
|
|
331
|
+
'INTENT_EXECUTOR');
|
|
332
|
+
if (withMultiChainOps) {
|
|
333
|
+
const signature = await getMultiChainOpsSignature(config, intentOp, signers, targetChain, validator, isRoot);
|
|
334
|
+
return {
|
|
335
|
+
originSignatures: Array(intentOp.elements.length).fill(signature),
|
|
336
|
+
destinationSignature: signature,
|
|
337
|
+
};
|
|
338
|
+
}
|
|
322
339
|
if (withJitFlow) {
|
|
323
|
-
return await
|
|
340
|
+
return await getPermit2Signatures(config, intentOp, signers, targetChain, validator, isRoot);
|
|
324
341
|
}
|
|
325
|
-
|
|
342
|
+
const signature = await getCompactSignature(config, intentOp, signers, targetChain, validator, isRoot);
|
|
343
|
+
return {
|
|
344
|
+
originSignatures: Array(intentOp.elements.length).fill(signature),
|
|
345
|
+
destinationSignature: signature,
|
|
346
|
+
};
|
|
326
347
|
}
|
|
327
|
-
async function
|
|
328
|
-
const
|
|
329
|
-
|
|
348
|
+
async function getMultiChainOpsSignature(config, intentOp, signers, targetChain, validator, isRoot) {
|
|
349
|
+
const address = (0, accounts_1.getAddress)(config);
|
|
350
|
+
const intentExecutor = (0, modules_1.getIntentExecutor)(config);
|
|
351
|
+
const typedData = (0, multiChainOps_1.getTypedData)(address, intentExecutor.address, intentOp);
|
|
352
|
+
const signature = await signIntentTypedData(config, signers, targetChain, validator, isRoot, typedData);
|
|
353
|
+
return signature;
|
|
354
|
+
}
|
|
355
|
+
async function getPermit2Signatures(config, intentOp, signers, targetChain, validator, isRoot) {
|
|
356
|
+
const originSignatures = [];
|
|
357
|
+
for (const element of intentOp.elements) {
|
|
358
|
+
const typedData = (0, permit2_1.getTypedData)(element, BigInt(intentOp.nonce), BigInt(intentOp.expires));
|
|
359
|
+
const signature = await signIntentTypedData(config, signers, targetChain, validator, isRoot, typedData);
|
|
360
|
+
originSignatures.push(signature);
|
|
361
|
+
}
|
|
362
|
+
return {
|
|
363
|
+
originSignatures,
|
|
364
|
+
destinationSignature: originSignatures[0],
|
|
365
|
+
};
|
|
330
366
|
}
|
|
331
367
|
async function getCompactSignature(config, intentOp, signers, targetChain, validator, isRoot) {
|
|
332
368
|
const typedData = (0, compact_1.getCompactTypedData)(intentOp);
|
|
@@ -399,8 +435,8 @@ async function submitUserOp(config, chain, userOp, signature) {
|
|
|
399
435
|
chain: chain.id,
|
|
400
436
|
};
|
|
401
437
|
}
|
|
402
|
-
async function submitIntent(config, sourceChains, targetChain, intentOp,
|
|
403
|
-
return submitIntentInternal(config, sourceChains, targetChain, intentOp,
|
|
438
|
+
async function submitIntent(config, sourceChains, targetChain, intentOp, originSignatures, destinationSignature, authorizations, dryRun) {
|
|
439
|
+
return submitIntentInternal(config, sourceChains, targetChain, intentOp, originSignatures, destinationSignature, authorizations, dryRun);
|
|
404
440
|
}
|
|
405
441
|
function getOrchestratorByChain(chainId, apiKey, orchestratorUrl) {
|
|
406
442
|
if (orchestratorUrl) {
|
|
@@ -411,11 +447,11 @@ function getOrchestratorByChain(chainId, apiKey, orchestratorUrl) {
|
|
|
411
447
|
: consts_1.PROD_ORCHESTRATOR_URL;
|
|
412
448
|
return (0, orchestrator_1.getOrchestrator)(apiKey, defaultOrchestratorUrl);
|
|
413
449
|
}
|
|
414
|
-
function createSignedIntentOp(intentOp,
|
|
450
|
+
function createSignedIntentOp(intentOp, originSignatures, destinationSignature, authorizations) {
|
|
415
451
|
return {
|
|
416
452
|
...intentOp,
|
|
417
|
-
originSignatures
|
|
418
|
-
destinationSignature
|
|
453
|
+
originSignatures,
|
|
454
|
+
destinationSignature,
|
|
419
455
|
signedAuthorizations: authorizations.length > 0
|
|
420
456
|
? authorizations.map((authorization) => ({
|
|
421
457
|
chainId: authorization.chainId,
|
|
@@ -428,8 +464,8 @@ function createSignedIntentOp(intentOp, signature, authorizations) {
|
|
|
428
464
|
: undefined,
|
|
429
465
|
};
|
|
430
466
|
}
|
|
431
|
-
async function submitIntentInternal(config, sourceChains, targetChain, intentOp,
|
|
432
|
-
const signedIntentOp = createSignedIntentOp(intentOp,
|
|
467
|
+
async function submitIntentInternal(config, sourceChains, targetChain, intentOp, originSignatures, destinationSignature, authorizations, dryRun) {
|
|
468
|
+
const signedIntentOp = createSignedIntentOp(intentOp, originSignatures, destinationSignature, authorizations);
|
|
433
469
|
const orchestrator = getOrchestratorByChain(targetChain.id, config.apiKey, config.endpointUrl);
|
|
434
470
|
const intentResults = await orchestrator.submitIntent(signedIntentOp, dryRun);
|
|
435
471
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../orchestrator/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAe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