@rhinestone/sdk 1.0.0-beta.38 → 1.0.0-beta.40
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/README.md +46 -8
- 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/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 +57 -45
- package/dist/src/orchestrator/client.d.ts +2 -0
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +219 -160
- 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/package.json +1 -2
package/README.md
CHANGED
|
@@ -26,12 +26,37 @@ bun install viem @rhinestone/sdk
|
|
|
26
26
|
|
|
27
27
|
You'll need a Rhinestone API key, as well as an existing account with some testnet ETH on the source chain.
|
|
28
28
|
|
|
29
|
+
### SDK Initialization
|
|
30
|
+
|
|
31
|
+
To initialize the SDK with your configuration:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { RhinestoneSDK } from '@rhinestone/sdk'
|
|
35
|
+
|
|
36
|
+
const sdk = new RhinestoneSDK({
|
|
37
|
+
apiKey: 'your-rhinestone-api-key',
|
|
38
|
+
// Optional: Provider configuration
|
|
39
|
+
provider: {
|
|
40
|
+
type: 'alchemy',
|
|
41
|
+
apiKey: 'your-alchemy-api-key',
|
|
42
|
+
},
|
|
43
|
+
// Optional: Bundler configuration
|
|
44
|
+
bundler: {
|
|
45
|
+
// the bundler settings
|
|
46
|
+
},
|
|
47
|
+
// Optional: Paymaster configuration
|
|
48
|
+
paymaster: {
|
|
49
|
+
// the paymaster settings
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
```
|
|
53
|
+
|
|
29
54
|
### Creating a Wallet
|
|
30
55
|
|
|
31
56
|
Let's create a smart account with a single owner:
|
|
32
57
|
|
|
33
58
|
```ts
|
|
34
|
-
import {
|
|
59
|
+
import { RhinestoneSDK } from '@rhinestone/sdk'
|
|
35
60
|
import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'
|
|
36
61
|
import { baseSepolia, arbitrumSepolia, optimismSepolia } from 'viem/chains'
|
|
37
62
|
import {
|
|
@@ -63,12 +88,17 @@ const privateKey = generatePrivateKey()
|
|
|
63
88
|
console.info(`Owner private key: ${privateKey}`)
|
|
64
89
|
const account = privateKeyToAccount(privateKey)
|
|
65
90
|
|
|
66
|
-
|
|
91
|
+
// Initialize the SDK
|
|
92
|
+
const sdk = new RhinestoneSDK({
|
|
93
|
+
apiKey: rhinestoneApiKey,
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
// Create the Rhinestone account
|
|
97
|
+
const rhinestoneAccount = await sdk.createAccount({
|
|
67
98
|
owners: {
|
|
68
99
|
type: 'ecdsa',
|
|
69
100
|
accounts: [account],
|
|
70
|
-
}
|
|
71
|
-
rhinestoneApiKey,
|
|
101
|
+
},
|
|
72
102
|
})
|
|
73
103
|
const address = await rhinestoneAccount.getAddress()
|
|
74
104
|
console.info(`Smart account address: ${address}`)
|
|
@@ -182,13 +212,21 @@ const session: Session = {
|
|
|
182
212
|
During account initialization, provide the session you've just created. Make sure to also provide a bundler configuration.
|
|
183
213
|
|
|
184
214
|
```ts
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
215
|
+
// Initialize the SDK with bundler configuration
|
|
216
|
+
const sdk = new RhinestoneSDK({
|
|
217
|
+
apiKey: rhinestoneApiKey,
|
|
188
218
|
bundler: {
|
|
189
|
-
//
|
|
219
|
+
// bundler configuration
|
|
190
220
|
},
|
|
191
221
|
})
|
|
222
|
+
|
|
223
|
+
const rhinestoneAccount = await sdk.createAccount({
|
|
224
|
+
owners: {
|
|
225
|
+
type: 'ecdsa',
|
|
226
|
+
accounts: [account],
|
|
227
|
+
},
|
|
228
|
+
sessions: [session],
|
|
229
|
+
})
|
|
192
230
|
```
|
|
193
231
|
|
|
194
232
|
When making a transaction, specify the `signers` object to sign it with the session key:
|
|
@@ -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,4BAA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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,OAA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AqB,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([
|
|
@@ -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":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AU,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,M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AuB,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,OAA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AED,iBAAe,mBAAmB,CAChC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,SAAS,GAAG,SAAS,EAC9B,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,KAAK,yKA6Bb;AAmDD,iBAAS,UAAU,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,CAMnE;AAgGD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,GAClB,CAAA;AACD,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACpB,CAAA"}
|
|
@@ -75,11 +75,12 @@ async function resolveCallInputs(inputs, config, chain, accountAddress) {
|
|
|
75
75
|
async function signTransaction(config, preparedTransaction) {
|
|
76
76
|
const { targetChain, signers } = getTransactionParams(preparedTransaction.transaction);
|
|
77
77
|
const intentRoute = preparedTransaction.intentRoute;
|
|
78
|
-
const
|
|
78
|
+
const { originSignatures, destinationSignature } = await signIntent(config, targetChain, intentRoute.intentOp, signers);
|
|
79
79
|
return {
|
|
80
80
|
intentRoute,
|
|
81
81
|
transaction: preparedTransaction.transaction,
|
|
82
|
-
|
|
82
|
+
originSignatures,
|
|
83
|
+
destinationSignature,
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
86
|
async function signUserOperation(config, preparedUserOperation) {
|
|
@@ -159,10 +160,10 @@ async function signAuthorizationsInternal(config, data) {
|
|
|
159
160
|
return authorizations;
|
|
160
161
|
}
|
|
161
162
|
async function submitTransaction(config, signedTransaction, authorizations, dryRun = false) {
|
|
162
|
-
const { intentRoute, transaction,
|
|
163
|
+
const { intentRoute, transaction, originSignatures, destinationSignature } = signedTransaction;
|
|
163
164
|
const { sourceChains, targetChain } = getTransactionParams(transaction);
|
|
164
165
|
const intentOp = intentRoute.intentOp;
|
|
165
|
-
return await submitIntent(config, sourceChains, targetChain, intentOp,
|
|
166
|
+
return await submitIntent(config, sourceChains, targetChain, intentOp, originSignatures, destinationSignature, authorizations, dryRun);
|
|
166
167
|
}
|
|
167
168
|
async function submitUserOperation(config, signedUserOperation) {
|
|
168
169
|
const chain = signedUserOperation.transaction.chain;
|
|
@@ -245,7 +246,7 @@ async function prepareTransactionAsUserOp(config, chain, callInputs, signers, ga
|
|
|
245
246
|
async function prepareTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, accountAddress, isSponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds) {
|
|
246
247
|
const calls = parseCalls(callInputs, targetChain.id);
|
|
247
248
|
const accountAccessList = createAccountAccessList(sourceChains, sourceAssets);
|
|
248
|
-
const { setupOps, delegations } = await getSetupOperationsAndDelegations(config,
|
|
249
|
+
const { setupOps, delegations } = await getSetupOperationsAndDelegations(config, accountAddress, eip7702InitSignature);
|
|
249
250
|
const getAccountType = (config) => {
|
|
250
251
|
if (config.account?.type === 'eoa') {
|
|
251
252
|
return 'EOA';
|
|
@@ -287,26 +288,31 @@ async function prepareTransactionAsIntent(config, sourceChains, targetChain, cal
|
|
|
287
288
|
}
|
|
288
289
|
async function signIntent(config, targetChain, intentOp, signers) {
|
|
289
290
|
if (config.account?.type === 'eoa') {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
291
|
+
const originSignatures = [];
|
|
292
|
+
for (const element of intentOp.elements) {
|
|
293
|
+
let digest;
|
|
294
|
+
if (config.eoa?.signTypedData) {
|
|
295
|
+
const typedData = (0, permit2_1.getTypedData)(element, BigInt(intentOp.nonce), BigInt(intentOp.expires));
|
|
296
|
+
originSignatures.push(await config.eoa.signTypedData(typedData));
|
|
297
|
+
}
|
|
298
|
+
else if (config.eoa?.sign) {
|
|
299
|
+
digest = (0, compact_1.getPermit2Digest)(element, BigInt(intentOp.nonce), BigInt(intentOp.expires));
|
|
300
|
+
originSignatures.push(await config.eoa.sign({ hash: digest }));
|
|
301
|
+
}
|
|
302
|
+
else if (config.eoa?.signMessage) {
|
|
303
|
+
digest = (0, compact_1.getPermit2Digest)(element, BigInt(intentOp.nonce), BigInt(intentOp.expires));
|
|
304
|
+
originSignatures.push(await config.eoa.signMessage({
|
|
305
|
+
message: { raw: digest },
|
|
306
|
+
}));
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
throw new accounts_1.EoaSigningMethodNotConfiguredError('signTypedData, sign, or signMessage');
|
|
310
|
+
}
|
|
308
311
|
}
|
|
309
|
-
return
|
|
312
|
+
return {
|
|
313
|
+
originSignatures,
|
|
314
|
+
destinationSignature: originSignatures[0],
|
|
315
|
+
};
|
|
310
316
|
}
|
|
311
317
|
const validator = getValidator(config, signers);
|
|
312
318
|
if (!validator) {
|
|
@@ -314,19 +320,31 @@ async function signIntent(config, targetChain, intentOp, signers) {
|
|
|
314
320
|
}
|
|
315
321
|
const ownerValidator = (0, validators_1.getOwnerValidator)(config);
|
|
316
322
|
const isRoot = validator.address === ownerValidator.address;
|
|
317
|
-
const
|
|
318
|
-
return
|
|
323
|
+
const signatures = await getIntentSignature(config, intentOp, signers, targetChain, validator, isRoot);
|
|
324
|
+
return signatures;
|
|
319
325
|
}
|
|
320
326
|
async function getIntentSignature(config, intentOp, signers, targetChain, validator, isRoot) {
|
|
321
327
|
const withJitFlow = intentOp.elements.some((element) => element.mandate.qualifier.settlementContext?.usingJIT);
|
|
322
328
|
if (withJitFlow) {
|
|
323
|
-
return await
|
|
329
|
+
return await getPermit2Signatures(config, intentOp, signers, targetChain, validator, isRoot);
|
|
324
330
|
}
|
|
325
|
-
|
|
331
|
+
const signature = await getCompactSignature(config, intentOp, signers, targetChain, validator, isRoot);
|
|
332
|
+
return {
|
|
333
|
+
originSignatures: Array(intentOp.elements.length).fill(signature),
|
|
334
|
+
destinationSignature: signature,
|
|
335
|
+
};
|
|
326
336
|
}
|
|
327
|
-
async function
|
|
328
|
-
const
|
|
329
|
-
|
|
337
|
+
async function getPermit2Signatures(config, intentOp, signers, targetChain, validator, isRoot) {
|
|
338
|
+
const originSignatures = [];
|
|
339
|
+
for (const element of intentOp.elements) {
|
|
340
|
+
const typedData = (0, permit2_1.getTypedData)(element, BigInt(intentOp.nonce), BigInt(intentOp.expires));
|
|
341
|
+
const signature = await signIntentTypedData(config, signers, targetChain, validator, isRoot, typedData);
|
|
342
|
+
originSignatures.push(signature);
|
|
343
|
+
}
|
|
344
|
+
return {
|
|
345
|
+
originSignatures,
|
|
346
|
+
destinationSignature: originSignatures[0],
|
|
347
|
+
};
|
|
330
348
|
}
|
|
331
349
|
async function getCompactSignature(config, intentOp, signers, targetChain, validator, isRoot) {
|
|
332
350
|
const typedData = (0, compact_1.getCompactTypedData)(intentOp);
|
|
@@ -399,8 +417,8 @@ async function submitUserOp(config, chain, userOp, signature) {
|
|
|
399
417
|
chain: chain.id,
|
|
400
418
|
};
|
|
401
419
|
}
|
|
402
|
-
async function submitIntent(config, sourceChains, targetChain, intentOp,
|
|
403
|
-
return submitIntentInternal(config, sourceChains, targetChain, intentOp,
|
|
420
|
+
async function submitIntent(config, sourceChains, targetChain, intentOp, originSignatures, destinationSignature, authorizations, dryRun) {
|
|
421
|
+
return submitIntentInternal(config, sourceChains, targetChain, intentOp, originSignatures, destinationSignature, authorizations, dryRun);
|
|
404
422
|
}
|
|
405
423
|
function getOrchestratorByChain(chainId, apiKey, orchestratorUrl) {
|
|
406
424
|
if (orchestratorUrl) {
|
|
@@ -411,11 +429,11 @@ function getOrchestratorByChain(chainId, apiKey, orchestratorUrl) {
|
|
|
411
429
|
: consts_1.PROD_ORCHESTRATOR_URL;
|
|
412
430
|
return (0, orchestrator_1.getOrchestrator)(apiKey, defaultOrchestratorUrl);
|
|
413
431
|
}
|
|
414
|
-
function createSignedIntentOp(intentOp,
|
|
432
|
+
function createSignedIntentOp(intentOp, originSignatures, destinationSignature, authorizations) {
|
|
415
433
|
return {
|
|
416
434
|
...intentOp,
|
|
417
|
-
originSignatures
|
|
418
|
-
destinationSignature
|
|
435
|
+
originSignatures,
|
|
436
|
+
destinationSignature,
|
|
419
437
|
signedAuthorizations: authorizations.length > 0
|
|
420
438
|
? authorizations.map((authorization) => ({
|
|
421
439
|
chainId: authorization.chainId,
|
|
@@ -428,8 +446,8 @@ function createSignedIntentOp(intentOp, signature, authorizations) {
|
|
|
428
446
|
: undefined,
|
|
429
447
|
};
|
|
430
448
|
}
|
|
431
|
-
async function submitIntentInternal(config, sourceChains, targetChain, intentOp,
|
|
432
|
-
const signedIntentOp = createSignedIntentOp(intentOp,
|
|
449
|
+
async function submitIntentInternal(config, sourceChains, targetChain, intentOp, originSignatures, destinationSignature, authorizations, dryRun) {
|
|
450
|
+
const signedIntentOp = createSignedIntentOp(intentOp, originSignatures, destinationSignature, authorizations);
|
|
433
451
|
const orchestrator = getOrchestratorByChain(targetChain.id, config.apiKey, config.endpointUrl);
|
|
434
452
|
const intentResults = await orchestrator.submitIntent(signedIntentOp, dryRun);
|
|
435
453
|
return {
|
|
@@ -516,7 +534,7 @@ function createAccountAccessList(sourceChains, sourceAssets) {
|
|
|
516
534
|
}
|
|
517
535
|
return { chainTokens: sourceAssets };
|
|
518
536
|
}
|
|
519
|
-
async function getSetupOperationsAndDelegations(config,
|
|
537
|
+
async function getSetupOperationsAndDelegations(config, accountAddress, eip7702InitSignature) {
|
|
520
538
|
const initCode = (0, accounts_1.getInitCode)(config);
|
|
521
539
|
if (config.account?.type === 'eoa') {
|
|
522
540
|
return {
|
|
@@ -544,12 +562,6 @@ async function getSetupOperationsAndDelegations(config, chain, accountAddress, e
|
|
|
544
562
|
};
|
|
545
563
|
}
|
|
546
564
|
else if (initCode) {
|
|
547
|
-
const isAccountDeployed = await (0, accounts_1.isDeployed)(config, chain);
|
|
548
|
-
if (isAccountDeployed) {
|
|
549
|
-
return {
|
|
550
|
-
setupOps: [],
|
|
551
|
-
};
|
|
552
|
-
}
|
|
553
565
|
// Contract account with init code
|
|
554
566
|
return {
|
|
555
567
|
setupOps: [
|
|
@@ -15,6 +15,8 @@ export declare class Orchestrator {
|
|
|
15
15
|
getIntentRoute(input: IntentInput): Promise<IntentRoute>;
|
|
16
16
|
submitIntent(signedIntentOpUnformatted: SignedIntentOp, dryRun: boolean): Promise<IntentResult>;
|
|
17
17
|
getIntentOpStatus(intentId: bigint): Promise<IntentOpStatus>;
|
|
18
|
+
private getHeaders;
|
|
19
|
+
private fetch;
|
|
18
20
|
private parseError;
|
|
19
21
|
private parseErrorMessage;
|
|
20
22
|
}
|