@charterlabs/rhinestone-sdk 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +13 -9
- package/dist/src/accounts/kernel.js +3 -3
- package/dist/src/accounts/kernel.test.js +2 -2
- package/dist/src/accounts/nexus.js +7 -7
- package/dist/src/accounts/nexus.test.js +4 -4
- package/dist/src/accounts/passport.js +2 -2
- package/dist/src/accounts/safe.js +3 -3
- package/dist/src/accounts/startale.js +2 -2
- package/dist/src/accounts/startale.test.js +2 -2
- package/dist/src/actions/ecdsa.test.js +2 -2
- package/dist/src/actions/passkeys.test.js +2 -2
- package/dist/src/actions/recovery.test.js +2 -2
- package/dist/src/execution/error.d.ts +8 -1
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +10 -1
- package/dist/src/execution/index.d.ts +2 -1
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +20 -14
- package/dist/src/execution/singleChainOps.d.ts +39 -2
- package/dist/src/execution/singleChainOps.d.ts.map +1 -1
- package/dist/src/execution/singleChainOps.js +51 -4
- package/dist/src/execution/utils.d.ts +3 -4
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +16 -17
- package/dist/src/execution/utils.test.d.ts +2 -0
- package/dist/src/execution/utils.test.d.ts.map +1 -0
- package/dist/src/execution/utils.test.js +49 -0
- package/dist/src/index.d.ts +5 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +12 -6
- package/dist/src/modules/index.d.ts +2 -2
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +5 -1
- package/dist/src/modules/read.d.ts +2 -1
- package/dist/src/modules/read.d.ts.map +1 -1
- package/dist/src/modules/read.js +52 -0
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +2 -0
- package/dist/src/orchestrator/consts.d.ts +2 -2
- package/dist/src/orchestrator/consts.d.ts.map +1 -1
- package/dist/src/orchestrator/consts.js +3 -3
- package/dist/src/orchestrator/index.d.ts +2 -2
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/types.d.ts +47 -1
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/types.d.ts +4 -3
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +17 -2
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTypedData = getTypedData;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
|
-
|
|
5
|
+
// TODO: Remove after migration
|
|
6
|
+
function getTypedDataLegacy(account, intentExecutorAddress, destinationChainId, destinationOps, nonce) {
|
|
6
7
|
return {
|
|
7
8
|
domain: {
|
|
8
9
|
name: 'IntentExecutor',
|
|
9
10
|
version: 'v0.0.1',
|
|
10
|
-
chainId: Number(
|
|
11
|
+
chainId: Number(destinationChainId),
|
|
11
12
|
verifyingContract: intentExecutorAddress,
|
|
12
13
|
},
|
|
13
14
|
types: {
|
|
@@ -35,8 +36,7 @@ function getTypedData(account, intentExecutorAddress, element, nonce) {
|
|
|
35
36
|
message: {
|
|
36
37
|
account,
|
|
37
38
|
nonce,
|
|
38
|
-
op:
|
|
39
|
-
// todo
|
|
39
|
+
op: destinationOps,
|
|
40
40
|
gasRefund: {
|
|
41
41
|
token: viem_1.zeroAddress,
|
|
42
42
|
exchangeRate: 0n,
|
|
@@ -44,3 +44,50 @@ function getTypedData(account, intentExecutorAddress, element, nonce) {
|
|
|
44
44
|
},
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
+
function getTypedDataWithGasRefund(account, intentExecutorAddress, destinationChainId, destinationOps, nonce, gasRefund) {
|
|
48
|
+
return {
|
|
49
|
+
domain: {
|
|
50
|
+
name: 'IntentExecutor',
|
|
51
|
+
version: 'v0.0.1',
|
|
52
|
+
chainId: Number(destinationChainId),
|
|
53
|
+
verifyingContract: intentExecutorAddress,
|
|
54
|
+
},
|
|
55
|
+
types: {
|
|
56
|
+
SingleChainOps: [
|
|
57
|
+
{ name: 'account', type: 'address' },
|
|
58
|
+
{ name: 'nonce', type: 'uint256' },
|
|
59
|
+
{ name: 'op', type: 'Op' },
|
|
60
|
+
{ name: 'gasRefund', type: 'GasRefund' },
|
|
61
|
+
],
|
|
62
|
+
Op: [
|
|
63
|
+
{ name: 'vt', type: 'bytes32' },
|
|
64
|
+
{ name: 'ops', type: 'Ops[]' },
|
|
65
|
+
],
|
|
66
|
+
GasRefund: [
|
|
67
|
+
{ name: 'token', type: 'address' },
|
|
68
|
+
{ name: 'exchangeRate', type: 'uint256' },
|
|
69
|
+
{ name: 'overhead', type: 'uint256' },
|
|
70
|
+
],
|
|
71
|
+
Ops: [
|
|
72
|
+
{ name: 'to', type: 'address' },
|
|
73
|
+
{ name: 'value', type: 'uint256' },
|
|
74
|
+
{ name: 'data', type: 'bytes' },
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
primaryType: 'SingleChainOps',
|
|
78
|
+
message: {
|
|
79
|
+
account,
|
|
80
|
+
nonce,
|
|
81
|
+
op: destinationOps,
|
|
82
|
+
gasRefund,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function getTypedData(account, intentExecutorAddress, element, nonce) {
|
|
87
|
+
const { destinationChainId, destinationOps } = element.mandate;
|
|
88
|
+
const gasRefund = element.mandate.qualifier.settlementContext.gasRefund;
|
|
89
|
+
if (gasRefund) {
|
|
90
|
+
return getTypedDataWithGasRefund(account, intentExecutorAddress, destinationChainId, destinationOps, nonce, gasRefund);
|
|
91
|
+
}
|
|
92
|
+
return getTypedDataLegacy(account, intentExecutorAddress, destinationChainId, destinationOps, nonce);
|
|
93
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Address, type Chain, type HashTypedDataParameters, type Hex, type PublicClient, type SignableMessage, type SignedAuthorization, type SignedAuthorizationList, type TypedData, type TypedDataDefinition } from 'viem';
|
|
2
2
|
import { type UserOperation } from 'viem/account-abstraction';
|
|
3
3
|
import { type IntentOp, type IntentRoute } from '../orchestrator';
|
|
4
|
-
import { type OriginSignature, type SettlementLayer } from '../orchestrator/types';
|
|
4
|
+
import { type AuxiliaryFunds, type OriginSignature, type SettlementLayer } from '../orchestrator/types';
|
|
5
5
|
import type { Call, CalldataInput, CallInput, RhinestoneAccountConfig, RhinestoneConfig, SignerSet, SourceAssetInput, Sponsorship, TokenRequest, TokenSymbol, Transaction, UserOperationTransaction } from '../types';
|
|
6
6
|
interface UserOperationResult {
|
|
7
7
|
type: 'userop';
|
|
@@ -68,7 +68,7 @@ declare function getIntentAccount(config: RhinestoneConfig, eip7702InitSignature
|
|
|
68
68
|
};
|
|
69
69
|
} | undefined;
|
|
70
70
|
};
|
|
71
|
-
declare function prepareTransactionAsIntent(config: RhinestoneConfig, sourceChains: Chain[] | undefined, targetChain: Chain, callInputs: CalldataInput[], gasLimit: bigint | undefined, tokenRequests: TokenRequest[], recipientInput: RhinestoneAccountConfig | Address | undefined, sponsored: Sponsorship | undefined, eip7702InitSignature: Hex | undefined, settlementLayers: SettlementLayer[] | undefined, sourceAssets: SourceAssetInput | undefined, feeAsset: Address | TokenSymbol | undefined, lockFunds: boolean | undefined, account: {
|
|
71
|
+
declare function prepareTransactionAsIntent(config: RhinestoneConfig, sourceChains: Chain[] | undefined, targetChain: Chain, callInputs: CalldataInput[], gasLimit: bigint | undefined, tokenRequests: TokenRequest[], recipientInput: RhinestoneAccountConfig | Address | undefined, sponsored: Sponsorship | undefined, eip7702InitSignature: Hex | undefined, settlementLayers: SettlementLayer[] | undefined, sourceAssets: SourceAssetInput | undefined, feeAsset: Address | TokenSymbol | undefined, lockFunds: boolean | undefined, auxiliaryFunds: AuxiliaryFunds | undefined, account: {
|
|
72
72
|
setupOps?: {
|
|
73
73
|
to: Address;
|
|
74
74
|
data: Hex;
|
|
@@ -78,10 +78,9 @@ declare function signIntent(config: RhinestoneConfig, intentOp: IntentOp, target
|
|
|
78
78
|
originSignatures: OriginSignature[];
|
|
79
79
|
destinationSignature: `0x${string}`;
|
|
80
80
|
}>;
|
|
81
|
-
declare function getOrchestratorByChain(chainId: number, apiKey: string | undefined, orchestratorUrl?: string): import("../orchestrator").Orchestrator;
|
|
82
81
|
declare function submitIntentInternal(config: RhinestoneConfig, sourceChains: Chain[] | undefined, targetChain: Chain, intentOp: IntentOp, originSignatures: OriginSignature[], destinationSignature: Hex, targetExecutionSignature: Hex | undefined, authorizations: SignedAuthorizationList, dryRun: boolean): Promise<TransactionResult>;
|
|
83
82
|
declare function getValidatorAccount(config: RhinestoneConfig, signers: SignerSet | undefined, publicClient: PublicClient, chain: Chain): Promise<import("viem/account-abstraction").SmartAccount<import("viem/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">> | null | undefined>;
|
|
84
83
|
declare function parseCalls(calls: CalldataInput[], chainId: number): Call[];
|
|
85
|
-
export { prepareTransaction, getTransactionMessages, signTransaction, signAuthorizations, signAuthorizationsInternal, signMessage, signTypedData, submitTransaction, prepareUserOperation, signUserOperation, submitUserOperation,
|
|
84
|
+
export { prepareTransaction, getTransactionMessages, signTransaction, signAuthorizations, signAuthorizationsInternal, signMessage, signTypedData, submitTransaction, prepareUserOperation, signUserOperation, submitUserOperation, signIntent, prepareTransactionAsIntent, submitIntentInternal, getValidatorAccount, parseCalls, getTokenRequests, resolveCallInputs, getIntentAccount, getTargetExecutionSignature, };
|
|
86
85
|
export type { IntentRoute, TransactionResult, PreparedTransactionData, PreparedUserOperationData, SignedTransactionData, SignedUserOperationData, UserOperationResult, };
|
|
87
86
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../execution/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK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AAK,EAClB,OAAO,CAAC,EAAE,SAAS,EACnB,eAAe,CAAC,EAAE,OAAO;;;GA+E1B;AAgSD,iBAAe,oBAAoB,CACjC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,KAAK,EAAE,GAAG,SAAS,EACjC,WAAW,EAAE,KAAK,EAClB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,eAAe,EAAE,EACnC,oBAAoB,EAAE,GAAG,EACzB,wBAAwB,EAAE,GAAG,GAAG,SAAS,EACzC,cAAc,EAAE,uBAAuB,EACvC,MAAM,EAAE,OAAO,8BAiBhB;AAED,iBAAe,mBAAmB,CAChC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,SAAS,GAAG,SAAS,EAC9B,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,KAAK,yKAoBb;AAiDD,iBAAS,UAAU,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,CAMnE;AAyHD,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,2BAA2B,GAC5B,CAAA;AACD,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACpB,CAAA"}
|
|
@@ -11,7 +11,6 @@ exports.submitTransaction = submitTransaction;
|
|
|
11
11
|
exports.prepareUserOperation = prepareUserOperation;
|
|
12
12
|
exports.signUserOperation = signUserOperation;
|
|
13
13
|
exports.submitUserOperation = submitUserOperation;
|
|
14
|
-
exports.getOrchestratorByChain = getOrchestratorByChain;
|
|
15
14
|
exports.signIntent = signIntent;
|
|
16
15
|
exports.prepareTransactionAsIntent = prepareTransactionAsIntent;
|
|
17
16
|
exports.submitIntentInternal = submitIntentInternal;
|
|
@@ -30,7 +29,6 @@ const modules_1 = require("../modules");
|
|
|
30
29
|
const validators_1 = require("../modules/validators");
|
|
31
30
|
const core_1 = require("../modules/validators/core");
|
|
32
31
|
const orchestrator_1 = require("../orchestrator");
|
|
33
|
-
const consts_1 = require("../orchestrator/consts");
|
|
34
32
|
const registry_1 = require("../orchestrator/registry");
|
|
35
33
|
const types_1 = require("../orchestrator/types");
|
|
36
34
|
const compact_1 = require("./compact");
|
|
@@ -38,13 +36,13 @@ const error_1 = require("./error");
|
|
|
38
36
|
const permit2_1 = require("./permit2");
|
|
39
37
|
const singleChainOps_1 = require("./singleChainOps");
|
|
40
38
|
async function prepareTransaction(config, transaction) {
|
|
41
|
-
const { sourceChains, targetChain, tokenRequests, signers, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds, account, recipient, } = getTransactionParams(transaction);
|
|
39
|
+
const { sourceChains, targetChain, tokenRequests, signers, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds, auxiliaryFunds, account, recipient, } = getTransactionParams(transaction);
|
|
42
40
|
const accountAddress = (0, accounts_1.getAddress)(config);
|
|
43
41
|
const isUserOpSigner = signers?.type === 'guardians';
|
|
44
42
|
if (isUserOpSigner) {
|
|
45
43
|
throw new error_1.SignerNotSupportedError();
|
|
46
44
|
}
|
|
47
|
-
const intentRoute = await prepareTransactionAsIntent(config, sourceChains, targetChain, await resolveCallInputs(transaction.calls, config, targetChain, accountAddress), transaction.gasLimit, tokenRequests, recipient, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds, account, signers);
|
|
45
|
+
const intentRoute = await prepareTransactionAsIntent(config, sourceChains, targetChain, await resolveCallInputs(transaction.calls, config, targetChain, accountAddress), transaction.gasLimit, tokenRequests, recipient, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds, auxiliaryFunds, account, signers);
|
|
48
46
|
return {
|
|
49
47
|
intentRoute,
|
|
50
48
|
transaction,
|
|
@@ -261,6 +259,7 @@ function getTransactionParams(transaction) {
|
|
|
261
259
|
const sourceAssets = transaction.sourceAssets;
|
|
262
260
|
const feeAsset = transaction.feeAsset;
|
|
263
261
|
const lockFunds = transaction.lockFunds;
|
|
262
|
+
const auxiliaryFunds = transaction.auxiliaryFunds;
|
|
264
263
|
const account = transaction.experimental_accountOverride;
|
|
265
264
|
const recipient = transaction.recipient;
|
|
266
265
|
const tokenRequests = getTokenRequests(sourceChains || [], targetChain, initialTokenRequests, settlementLayers);
|
|
@@ -276,6 +275,7 @@ function getTransactionParams(transaction) {
|
|
|
276
275
|
sourceAssets,
|
|
277
276
|
feeAsset,
|
|
278
277
|
lockFunds,
|
|
278
|
+
auxiliaryFunds,
|
|
279
279
|
account,
|
|
280
280
|
recipient,
|
|
281
281
|
};
|
|
@@ -345,7 +345,7 @@ function getIntentAccount(config, eip7702InitSignature, account) {
|
|
|
345
345
|
delegations,
|
|
346
346
|
};
|
|
347
347
|
}
|
|
348
|
-
async function prepareTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipientInput, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds, account, signers) {
|
|
348
|
+
async function prepareTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipientInput, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds, auxiliaryFunds, account, signers) {
|
|
349
349
|
const calls = parseCalls(callInputs, targetChain.id);
|
|
350
350
|
const accountAccessList = createAccountAccessList(sourceChains, sourceAssets);
|
|
351
351
|
function getRecipient(recipient) {
|
|
@@ -397,9 +397,10 @@ async function prepareTransactionAsIntent(config, sourceChains, targetChain, cal
|
|
|
397
397
|
: undefined,
|
|
398
398
|
settlementLayers,
|
|
399
399
|
signatureMode,
|
|
400
|
+
auxiliaryFunds,
|
|
400
401
|
},
|
|
401
402
|
};
|
|
402
|
-
const orchestrator =
|
|
403
|
+
const orchestrator = (0, orchestrator_1.getOrchestrator)(config.apiKey, config.endpointUrl);
|
|
403
404
|
const intentRoute = await orchestrator.getIntentRoute(metaIntent);
|
|
404
405
|
return intentRoute;
|
|
405
406
|
}
|
|
@@ -597,15 +598,6 @@ async function submitUserOp(config, chain, userOp, signature) {
|
|
|
597
598
|
async function submitIntent(config, sourceChains, targetChain, intentOp, originSignatures, destinationSignature, targetExecutionSignature, authorizations, dryRun) {
|
|
598
599
|
return submitIntentInternal(config, sourceChains, targetChain, intentOp, originSignatures, destinationSignature, targetExecutionSignature, authorizations, dryRun);
|
|
599
600
|
}
|
|
600
|
-
function getOrchestratorByChain(chainId, apiKey, orchestratorUrl) {
|
|
601
|
-
if (orchestratorUrl) {
|
|
602
|
-
return (0, orchestrator_1.getOrchestrator)(apiKey, orchestratorUrl);
|
|
603
|
-
}
|
|
604
|
-
const defaultOrchestratorUrl = (0, registry_1.isTestnet)(chainId)
|
|
605
|
-
? consts_1.STAGING_ORCHESTRATOR_URL
|
|
606
|
-
: consts_1.PROD_ORCHESTRATOR_URL;
|
|
607
|
-
return (0, orchestrator_1.getOrchestrator)(apiKey, defaultOrchestratorUrl);
|
|
608
|
-
}
|
|
609
601
|
function createSignedIntentOp(intentOp, originSignatures, destinationSignature, targetExecutionSignature, authorizations) {
|
|
610
602
|
return {
|
|
611
603
|
...intentOp,
|
|
@@ -626,7 +618,7 @@ function createSignedIntentOp(intentOp, originSignatures, destinationSignature,
|
|
|
626
618
|
}
|
|
627
619
|
async function submitIntentInternal(config, sourceChains, targetChain, intentOp, originSignatures, destinationSignature, targetExecutionSignature, authorizations, dryRun) {
|
|
628
620
|
const signedIntentOp = createSignedIntentOp(intentOp, originSignatures, destinationSignature, targetExecutionSignature, authorizations);
|
|
629
|
-
const orchestrator =
|
|
621
|
+
const orchestrator = (0, orchestrator_1.getOrchestrator)(config.apiKey, config.endpointUrl);
|
|
630
622
|
const intentResults = await orchestrator.submitIntent(signedIntentOp, dryRun);
|
|
631
623
|
return {
|
|
632
624
|
type: 'intent',
|
|
@@ -728,7 +720,7 @@ function getSetupOperationsAndDelegations(config, accountAddress, eip7702InitSig
|
|
|
728
720
|
else if ((0, accounts_1.is7702)(config)) {
|
|
729
721
|
// EIP-7702 initialization is only needed for EOA accounts
|
|
730
722
|
if (!eip7702InitSignature || eip7702InitSignature === '0x') {
|
|
731
|
-
throw new
|
|
723
|
+
throw new error_1.Eip7702InitSignatureRequiredError();
|
|
732
724
|
}
|
|
733
725
|
const { initData: eip7702InitData, contract: eip7702Contract } = (0, accounts_1.getEip7702InitCall)(config, eip7702InitSignature);
|
|
734
726
|
return {
|
|
@@ -749,6 +741,13 @@ function getSetupOperationsAndDelegations(config, accountAddress, eip7702InitSig
|
|
|
749
741
|
const to = 'factory' in initCode ? initCode.factory : undefined;
|
|
750
742
|
const data = 'factory' in initCode ? initCode.factoryData : undefined;
|
|
751
743
|
if (!to || !data) {
|
|
744
|
+
// Check if it's a migrated account with address-only initData
|
|
745
|
+
if (config.initData && !('factory' in config.initData)) {
|
|
746
|
+
// Assume the account is already deployed
|
|
747
|
+
return {
|
|
748
|
+
setupOps: [],
|
|
749
|
+
};
|
|
750
|
+
}
|
|
752
751
|
throw new accounts_1.FactoryArgsNotAvailableError();
|
|
753
752
|
}
|
|
754
753
|
// Contract account with init code
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../../execution/utils.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const viem_1 = require("viem");
|
|
4
|
+
const chains_1 = require("viem/chains");
|
|
5
|
+
const vitest_1 = require("vitest");
|
|
6
|
+
const consts_1 = require("../../test/consts");
|
|
7
|
+
const utils_1 = require("./utils");
|
|
8
|
+
const mockGetIntentRoute = vitest_1.vi.fn();
|
|
9
|
+
vitest_1.vi.mock('../orchestrator', () => ({
|
|
10
|
+
getOrchestrator: () => ({
|
|
11
|
+
getIntentRoute: mockGetIntentRoute,
|
|
12
|
+
}),
|
|
13
|
+
}));
|
|
14
|
+
(0, vitest_1.describe)('prepareTransactionAsIntent', () => {
|
|
15
|
+
(0, vitest_1.beforeEach)(() => {
|
|
16
|
+
mockGetIntentRoute.mockReset();
|
|
17
|
+
});
|
|
18
|
+
(0, vitest_1.test)('includes auxiliaryFunds in options when provided', async () => {
|
|
19
|
+
const auxiliaryFunds = {
|
|
20
|
+
[chains_1.arbitrum.id]: {
|
|
21
|
+
'0xaf88d065e77c8cC2239327C5EDb3A432268e5831': 500000000n,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
mockGetIntentRoute.mockResolvedValue({
|
|
25
|
+
intentOp: {},
|
|
26
|
+
intentCost: {},
|
|
27
|
+
});
|
|
28
|
+
await (0, utils_1.prepareTransactionAsIntent)({
|
|
29
|
+
owners: { type: 'ecdsa', accounts: [consts_1.accountA], threshold: 1 },
|
|
30
|
+
apiKey: 'test',
|
|
31
|
+
}, [chains_1.arbitrum], chains_1.base, [], undefined, [{ address: viem_1.zeroAddress, amount: 1n }], undefined, false, undefined, undefined, undefined, undefined, undefined, auxiliaryFunds, undefined, undefined);
|
|
32
|
+
(0, vitest_1.expect)(mockGetIntentRoute).toHaveBeenCalledOnce();
|
|
33
|
+
const intentInput = mockGetIntentRoute.mock.calls[0][0];
|
|
34
|
+
(0, vitest_1.expect)(intentInput.options.auxiliaryFunds).toEqual(auxiliaryFunds);
|
|
35
|
+
});
|
|
36
|
+
(0, vitest_1.test)('does not include auxiliaryFunds in options when not provided', async () => {
|
|
37
|
+
mockGetIntentRoute.mockResolvedValue({
|
|
38
|
+
intentOp: {},
|
|
39
|
+
intentCost: {},
|
|
40
|
+
});
|
|
41
|
+
await (0, utils_1.prepareTransactionAsIntent)({
|
|
42
|
+
owners: { type: 'ecdsa', accounts: [consts_1.accountA], threshold: 1 },
|
|
43
|
+
apiKey: 'test',
|
|
44
|
+
}, [chains_1.arbitrum], chains_1.base, [], undefined, [{ address: viem_1.zeroAddress, amount: 1n }], undefined, false, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
45
|
+
(0, vitest_1.expect)(mockGetIntentRoute).toHaveBeenCalledOnce();
|
|
46
|
+
const intentInput = mockGetIntentRoute.mock.calls[0][0];
|
|
47
|
+
(0, vitest_1.expect)(intentInput.options.auxiliaryFunds).toBeUndefined();
|
|
48
|
+
});
|
|
49
|
+
});
|
package/dist/src/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { type TransactionResult, type TransactionStatus, type UserOperationResul
|
|
|
7
7
|
import { type BatchPermit2Result, checkERC20AllowanceDirect, getPermit2Address, type MultiChainPermit2Config, type MultiChainPermit2Result, signPermit2Batch, signPermit2Sequential } from './execution/permit2';
|
|
8
8
|
import { type IntentRoute, type PreparedTransactionData, type PreparedUserOperationData, type SignedTransactionData, type SignedUserOperationData } from './execution/utils';
|
|
9
9
|
import { type SessionDetails } from './modules/validators/smart-sessions';
|
|
10
|
-
import { type ApprovalRequired, getAllSupportedChainsAndTokens, getSupportedTokens, getTokenAddress, getTokenDecimals, type IntentInput, type IntentOp, type IntentOpStatus, type Portfolio, type SettlementLayer, type SignedIntentOp, type SplitIntentsInput, type SplitIntentsResult, type TokenRequirements, type WrapRequired } from './orchestrator';
|
|
10
|
+
import { type ApprovalRequired, type AuxiliaryFunds, getAllSupportedChainsAndTokens, getSupportedTokens, getTokenAddress, getTokenDecimals, type IntentInput, type IntentOp, type IntentOpStatus, type Portfolio, type SettlementLayer, type SignedIntentOp, type SplitIntentsInput, type SplitIntentsResult, type TokenRequirements, type WrapRequired } from './orchestrator';
|
|
11
11
|
import type { AccountProviderConfig, AccountType, BundlerConfig, Call, CallInput, MultiFactorValidatorConfig, OwnableValidatorConfig, OwnerSet, PaymasterConfig, Policy, ProviderConfig, Recovery, RhinestoneAccountConfig, RhinestoneConfig, RhinestoneSDKConfig, Session, SignerSet, TokenRequest, TokenSymbol, Transaction, UniversalActionPolicyParamCondition, UserOperationTransaction, WebauthnValidatorConfig } from './types';
|
|
12
12
|
interface RhinestoneAccount {
|
|
13
13
|
config: RhinestoneAccountConfig;
|
|
@@ -50,6 +50,7 @@ interface RhinestoneAccount {
|
|
|
50
50
|
threshold: number;
|
|
51
51
|
} | null>;
|
|
52
52
|
getValidators: (chain: Chain) => Promise<Address[]>;
|
|
53
|
+
getExecutors: (chain: Chain) => Promise<Address[]>;
|
|
53
54
|
checkERC20Allowance: (tokenAddress: Address, chain: Chain) => Promise<bigint>;
|
|
54
55
|
}
|
|
55
56
|
/**
|
|
@@ -60,13 +61,13 @@ interface RhinestoneAccount {
|
|
|
60
61
|
*/
|
|
61
62
|
declare function createRhinestoneAccount(config: RhinestoneConfig): Promise<RhinestoneAccount>;
|
|
62
63
|
declare class RhinestoneSDK {
|
|
63
|
-
private apiKey
|
|
64
|
+
private apiKey;
|
|
64
65
|
private endpointUrl?;
|
|
65
66
|
private provider?;
|
|
66
67
|
private bundler?;
|
|
67
68
|
private paymaster?;
|
|
68
69
|
private useDevContracts?;
|
|
69
|
-
constructor(options
|
|
70
|
+
constructor(options: RhinestoneSDKConfig);
|
|
70
71
|
createAccount(config: RhinestoneAccountConfig): Promise<RhinestoneAccount>;
|
|
71
72
|
getIntentStatus(intentId: bigint): Promise<TransactionStatus & {
|
|
72
73
|
status: IntentOpStatus["status"];
|
|
@@ -74,7 +75,7 @@ declare class RhinestoneSDK {
|
|
|
74
75
|
splitIntents(input: SplitIntentsInput): Promise<SplitIntentsResult>;
|
|
75
76
|
}
|
|
76
77
|
export { RhinestoneSDK, createRhinestoneAccount, deployAccountsForOwners, walletClientToAccount, wrapParaAccount, getSupportedTokens, getTokenAddress, getTokenDecimals, getAllSupportedChainsAndTokens, deployStandaloneWithEoaInternal as deployStandaloneWithEoa, checkERC20AllowanceDirect, getPermit2Address, signPermit2Batch, signPermit2Sequential, };
|
|
77
|
-
export type { RhinestoneAccount, AccountType, RhinestoneAccountConfig, AccountProviderConfig, ProviderConfig, BundlerConfig, PaymasterConfig, Transaction, TokenSymbol, CallInput, Call, TokenRequest, OwnerSet, OwnableValidatorConfig, WebauthnValidatorConfig, MultiFactorValidatorConfig, SignerSet, Session, Recovery, Policy, UniversalActionPolicyParamCondition, PreparedTransactionData, SignedTransactionData, TransactionResult, PreparedUserOperationData, SignedUserOperationData, UserOperationResult, IntentInput, IntentOp, IntentOpStatus, IntentRoute, SettlementLayer, SignedIntentOp, SplitIntentsInput, SplitIntentsResult, Portfolio, TokenRequirements, WrapRequired, ApprovalRequired, MultiChainPermit2Config, MultiChainPermit2Result, BatchPermit2Result, };
|
|
78
|
+
export type { RhinestoneAccount, AccountType, RhinestoneAccountConfig, AccountProviderConfig, ProviderConfig, BundlerConfig, PaymasterConfig, Transaction, TokenSymbol, CallInput, Call, TokenRequest, OwnerSet, OwnableValidatorConfig, WebauthnValidatorConfig, MultiFactorValidatorConfig, SignerSet, Session, Recovery, Policy, UniversalActionPolicyParamCondition, PreparedTransactionData, SignedTransactionData, TransactionResult, PreparedUserOperationData, SignedUserOperationData, UserOperationResult, AuxiliaryFunds, IntentInput, IntentOp, IntentOpStatus, IntentRoute, SettlementLayer, SignedIntentOp, SplitIntentsInput, SplitIntentsResult, Portfolio, TokenRequirements, WrapRequired, ApprovalRequired, MultiChainPermit2Config, MultiChainPermit2Result, BatchPermit2Result, };
|
|
78
79
|
export { generateCredentialId, getCredentialIds, hasCredentialById, hasCredential, addCredential, removeCredential, setThreshold, getCredentialInfo, getThreshold, getCredentials, WEBAUTHN_VALIDATOR_ABI, } from './modules/validators/webauthn-contract';
|
|
79
80
|
export { getOrchestrator } from './orchestrator';
|
|
80
81
|
//# 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,EACV,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,GAAG,EACH,eAAe,EACf,uBAAuB,EACvB,SAAS,EACT,mBAAmB,EACnB,OAAO,EACR,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EAWL,uBAAuB,IAAI,+BAA+B,EAC3D,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAEzB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,KAAK,kBAAkB,EACvB,yBAAyB,EAEzB,iBAAiB,EACjB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAG9B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAQ7B,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,GAAG,EACH,eAAe,EACf,uBAAuB,EACvB,SAAS,EACT,mBAAmB,EACnB,OAAO,EACR,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EAWL,uBAAuB,IAAI,+BAA+B,EAC3D,MAAM,YAAY,CAAA;AACnB,OAAO,E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,eAAe,EACf,gBAAgB,EAChB,8BAA8B,EAE9B,+BAA+B,IAAI,uBAAuB,EAE1D,yBAAyB,EACzB,iBAAiB,EAEjB,gBAAgB,EAChB,qBAAqB,GACtB,CAAA;AACD,YAAY,EACV,iBAAiB,EACjB,WAAW,EACX,uBAAuB,EACvB,qBAAqB,EACrB,cAAc,EACd,aAAa,EACb,eAAe,EACf,WAAW,EACX,WAAW,EACX,SAAS,EACT,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,SAAS,EACT,OAAO,EACP,QAAQ,EACR,MAAM,EACN,mCAAmC,EACnC,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,QAAQ,EACR,cAAc,EACd,WAAW,EACX,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAEhB,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,GACnB,CAAA;AAGD,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,sBAAsB,GACvB,MAAM,wCAAwC,CAAA;AAG/C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -233,6 +233,11 @@ async function createRhinestoneAccount(config) {
|
|
|
233
233
|
const account = getAddress();
|
|
234
234
|
return (0, modules_1.getValidators)(accountType, account, chain, config.provider);
|
|
235
235
|
}
|
|
236
|
+
function getExecutors(chain) {
|
|
237
|
+
const accountType = (0, accounts_1.getAccountProvider)(config).type;
|
|
238
|
+
const account = getAddress();
|
|
239
|
+
return (0, modules_1.getExecutors)(accountType, account, chain, config.provider);
|
|
240
|
+
}
|
|
236
241
|
function experimental_getSessionDetails(sessions) {
|
|
237
242
|
const account = getAddress();
|
|
238
243
|
return (0, modules_1.getSessionDetails)(account, sessions, config.useDevContracts);
|
|
@@ -280,6 +285,7 @@ async function createRhinestoneAccount(config) {
|
|
|
280
285
|
getPortfolio,
|
|
281
286
|
getOwners,
|
|
282
287
|
getValidators,
|
|
288
|
+
getExecutors,
|
|
283
289
|
experimental_getSessionDetails,
|
|
284
290
|
experimental_isSessionEnabled,
|
|
285
291
|
experimental_signEnableSession,
|
|
@@ -295,12 +301,12 @@ class RhinestoneSDK {
|
|
|
295
301
|
paymaster;
|
|
296
302
|
useDevContracts;
|
|
297
303
|
constructor(options) {
|
|
298
|
-
this.apiKey = options
|
|
299
|
-
this.endpointUrl = options
|
|
300
|
-
this.provider = options
|
|
301
|
-
this.bundler = options
|
|
302
|
-
this.paymaster = options
|
|
303
|
-
this.useDevContracts = options
|
|
304
|
+
this.apiKey = options.apiKey;
|
|
305
|
+
this.endpointUrl = options.endpointUrl;
|
|
306
|
+
this.provider = options.provider;
|
|
307
|
+
this.bundler = options.bundler;
|
|
308
|
+
this.paymaster = options.paymaster;
|
|
309
|
+
this.useDevContracts = options.useDevContracts;
|
|
304
310
|
}
|
|
305
311
|
createAccount(config) {
|
|
306
312
|
const rhinestoneConfig = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type Chain } from 'viem';
|
|
2
2
|
import type { RhinestoneConfig } from '../types';
|
|
3
3
|
import { type ModeleSetup, type Module } from './common';
|
|
4
|
-
import { getOwners, getValidators } from './read';
|
|
4
|
+
import { getExecutors, getOwners, getValidators } from './read';
|
|
5
5
|
import { getOwnerValidator } from './validators';
|
|
6
6
|
import { getSessionDetails, signEnableSession } from './validators/smart-sessions';
|
|
7
7
|
declare function getSetup(config: RhinestoneConfig): ModeleSetup;
|
|
8
8
|
declare function getIntentExecutor(config: RhinestoneConfig): Module;
|
|
9
9
|
declare function isRip7212SupportedNetwork(chain: Chain): boolean;
|
|
10
|
-
export { getSetup, getOwnerValidator, getOwners, getIntentExecutor, getValidators, isRip7212SupportedNetwork, getSessionDetails, signEnableSession, };
|
|
10
|
+
export { getSetup, getOwnerValidator, getOwners, getExecutors, getIntentExecutor, getValidators, isRip7212SupportedNetwork, getSessionDetails, signEnableSession, };
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,KAAK,EAAuB,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,KAAK,EAAuB,MAAM,MAAM,CAAA;AAcpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAKhD,OAAO,EAQL,KAAK,WAAW,EAChB,KAAK,MAAM,EACZ,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAA4B,MAAM,cAAc,CAAA;AAE1E,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,6BAA6B,CAAA;AAKpC,iBAAS,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,WAAW,CA0EvD;AAED,iBAAS,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAY3D;AAED,iBAAS,yBAAyB,CAAC,KAAK,EAAE,KAAK,WAc9C;AAED,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,GAClB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.signEnableSession = exports.getSessionDetails = exports.getValidators = exports.getOwners = exports.getOwnerValidator = void 0;
|
|
3
|
+
exports.signEnableSession = exports.getSessionDetails = exports.getValidators = exports.getExecutors = exports.getOwners = exports.getOwnerValidator = void 0;
|
|
4
4
|
exports.getSetup = getSetup;
|
|
5
5
|
exports.getIntentExecutor = getIntentExecutor;
|
|
6
6
|
exports.isRip7212SupportedNetwork = isRip7212SupportedNetwork;
|
|
@@ -9,6 +9,7 @@ const chains_1 = require("viem/chains");
|
|
|
9
9
|
const chain_abstraction_1 = require("./chain-abstraction");
|
|
10
10
|
const common_1 = require("./common");
|
|
11
11
|
const read_1 = require("./read");
|
|
12
|
+
Object.defineProperty(exports, "getExecutors", { enumerable: true, get: function () { return read_1.getExecutors; } });
|
|
12
13
|
Object.defineProperty(exports, "getOwners", { enumerable: true, get: function () { return read_1.getOwners; } });
|
|
13
14
|
Object.defineProperty(exports, "getValidators", { enumerable: true, get: function () { return read_1.getValidators; } });
|
|
14
15
|
const validators_1 = require("./validators");
|
|
@@ -85,6 +86,8 @@ function getIntentExecutor(config) {
|
|
|
85
86
|
}
|
|
86
87
|
function isRip7212SupportedNetwork(chain) {
|
|
87
88
|
const supportedChains = [
|
|
89
|
+
chains_1.mainnet,
|
|
90
|
+
chains_1.sepolia,
|
|
88
91
|
chains_1.optimism,
|
|
89
92
|
chains_1.optimismSepolia,
|
|
90
93
|
chains_1.polygon,
|
|
@@ -92,6 +95,7 @@ function isRip7212SupportedNetwork(chain) {
|
|
|
92
95
|
chains_1.baseSepolia,
|
|
93
96
|
chains_1.arbitrum,
|
|
94
97
|
chains_1.arbitrumSepolia,
|
|
98
|
+
chains_1.soneium,
|
|
95
99
|
];
|
|
96
100
|
return supportedChains.includes(chain);
|
|
97
101
|
}
|
|
@@ -5,5 +5,6 @@ declare function getOwners(account: Address, chain: Chain, provider?: ProviderCo
|
|
|
5
5
|
accounts: Address[];
|
|
6
6
|
threshold: number;
|
|
7
7
|
} | null>;
|
|
8
|
-
|
|
8
|
+
declare function getExecutors(accountType: AccountType, account: Address, chain: Chain, provider?: ProviderConfig): Promise<Address[]>;
|
|
9
|
+
export { getValidators, getExecutors, getOwners };
|
|
9
10
|
//# sourceMappingURL=read.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../modules/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAsB,MAAM,MAAM,CAAA;AAEnE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG3D,iBAAe,aAAa,CAC1B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,cAAc,GACxB,OAAO,CAAC,OAAO,EAAE,CAAC,CAkDpB;AAED,iBAAe,SAAS,CACtB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,cAAc,GACxB,OAAO,CAAC;IACT,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB,GAAG,IAAI,CAAC,CAkER;AAED,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../modules/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAsB,MAAM,MAAM,CAAA;AAEnE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG3D,iBAAe,aAAa,CAC1B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,cAAc,GACxB,OAAO,CAAC,OAAO,EAAE,CAAC,CAkDpB;AAED,iBAAe,SAAS,CACtB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,cAAc,GACxB,OAAO,CAAC;IACT,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB,GAAG,IAAI,CAAC,CAkER;AAED,iBAAe,YAAY,CACzB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,cAAc,GACxB,OAAO,CAAC,OAAO,EAAE,CAAC,CAkDpB;AAED,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,CAAA"}
|
package/dist/src/modules/read.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getValidators = getValidators;
|
|
4
|
+
exports.getExecutors = getExecutors;
|
|
4
5
|
exports.getOwners = getOwners;
|
|
5
6
|
const viem_1 = require("viem");
|
|
6
7
|
const utils_1 = require("../accounts/utils");
|
|
@@ -123,3 +124,54 @@ async function getOwners(account, chain, provider) {
|
|
|
123
124
|
threshold: thresholdResult.result,
|
|
124
125
|
};
|
|
125
126
|
}
|
|
127
|
+
async function getExecutors(accountType, account, chain, provider) {
|
|
128
|
+
const publicClient = (0, viem_1.createPublicClient)({
|
|
129
|
+
chain,
|
|
130
|
+
transport: (0, utils_1.createTransport)(chain, provider),
|
|
131
|
+
});
|
|
132
|
+
switch (accountType) {
|
|
133
|
+
case 'safe':
|
|
134
|
+
case 'startale':
|
|
135
|
+
case 'nexus':
|
|
136
|
+
case 'passport': {
|
|
137
|
+
const executors = await publicClient.readContract({
|
|
138
|
+
abi: [
|
|
139
|
+
{
|
|
140
|
+
name: 'getExecutorsPaginated',
|
|
141
|
+
type: 'function',
|
|
142
|
+
inputs: [
|
|
143
|
+
{
|
|
144
|
+
name: 'cursor',
|
|
145
|
+
type: 'address',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'size',
|
|
149
|
+
type: 'uint256',
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
outputs: [
|
|
153
|
+
{
|
|
154
|
+
name: 'array',
|
|
155
|
+
type: 'address[]',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'next',
|
|
159
|
+
type: 'address',
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
functionName: 'getExecutorsPaginated',
|
|
165
|
+
address: account,
|
|
166
|
+
args: ['0x0000000000000000000000000000000000000001', 100n],
|
|
167
|
+
});
|
|
168
|
+
return executors[0];
|
|
169
|
+
}
|
|
170
|
+
case 'eoa': {
|
|
171
|
+
return [];
|
|
172
|
+
}
|
|
173
|
+
case 'kernel': {
|
|
174
|
+
throw new Error('Kernel not supported');
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../orchestrator/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../orchestrator/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AA2BnC,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,YAAY,EACZ,WAAW,EACX,SAAS,EAET,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,SAAS,CAAA;AAchB,qBAAa,YAAY;IACvB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,MAAM,CAAC,CAAQ;gBAEX,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAKxC,YAAY,CAChB,WAAW,EAAE,OAAO,EACpB,MAAM,CAAC,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;QACnB,MAAM,CAAC,EAAE;YACP,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,CAAA;SAC7B,CAAA;KACF,GACA,OAAO,CAAC,SAAS,CAAC;IA+Cf,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAQxD,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAwDnE,YAAY,CAChB,yBAAyB,EAAE,cAAc,EACzC,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,YAAY,CAAC;IAgBlB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IASlE,OAAO,CAAC,UAAU;YAWJ,KAAK;IA4BnB,OAAO,CAAC,UAAU;IA6GlB,OAAO,CAAC,iBAAiB;CAmG1B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Orchestrator = void 0;
|
|
4
|
+
const consts_1 = require("./consts");
|
|
4
5
|
const error_1 = require("./error");
|
|
5
6
|
const utils_1 = require("./utils");
|
|
6
7
|
function parseTokenAmountsRecord(record) {
|
|
@@ -123,6 +124,7 @@ class Orchestrator {
|
|
|
123
124
|
getHeaders() {
|
|
124
125
|
const headers = {
|
|
125
126
|
'Content-Type': 'application/json',
|
|
127
|
+
'x-sdk-version': consts_1.SDK_VERSION,
|
|
126
128
|
};
|
|
127
129
|
if (this.apiKey) {
|
|
128
130
|
headers['x-api-key'] = this.apiKey;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const PROD_ORCHESTRATOR_URL = "https://v1.orchestrator.rhinestone.dev";
|
|
2
|
-
declare const STAGING_ORCHESTRATOR_URL = "https://staging.v1.orchestrator.rhinestone.dev";
|
|
3
2
|
declare const RHINESTONE_SPOKE_POOL_ADDRESS = "0x000000000060f6e853447881951574cdd0663530";
|
|
4
|
-
|
|
3
|
+
declare const SDK_VERSION = "1.2.12";
|
|
4
|
+
export { PROD_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, SDK_VERSION };
|
|
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,2CAA2C,CAAA;AACtE,QAAA,MAAM,
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../orchestrator/consts.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,qBAAqB,2CAA2C,CAAA;AACtE,QAAA,MAAM,6BAA6B,+CACW,CAAA;AAE9C,QAAA,MAAM,WAAW,WAAW,CAAA;AAE5B,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SDK_VERSION = exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.PROD_ORCHESTRATOR_URL = void 0;
|
|
4
4
|
const PROD_ORCHESTRATOR_URL = 'https://v1.orchestrator.rhinestone.dev';
|
|
5
5
|
exports.PROD_ORCHESTRATOR_URL = PROD_ORCHESTRATOR_URL;
|
|
6
|
-
const STAGING_ORCHESTRATOR_URL = 'https://staging.v1.orchestrator.rhinestone.dev';
|
|
7
|
-
exports.STAGING_ORCHESTRATOR_URL = STAGING_ORCHESTRATOR_URL;
|
|
8
6
|
const RHINESTONE_SPOKE_POOL_ADDRESS = '0x000000000060f6e853447881951574cdd0663530';
|
|
9
7
|
exports.RHINESTONE_SPOKE_POOL_ADDRESS = RHINESTONE_SPOKE_POOL_ADDRESS;
|
|
8
|
+
const SDK_VERSION = '1.2.12';
|
|
9
|
+
exports.SDK_VERSION = SDK_VERSION;
|
|
@@ -2,9 +2,9 @@ import { Orchestrator } from './client';
|
|
|
2
2
|
import { RHINESTONE_SPOKE_POOL_ADDRESS } from './consts';
|
|
3
3
|
import { AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, InsufficientLiquidityError, IntentNotFoundError, InternalServerError, InvalidApiKeyError, InvalidIntentSignatureError, isAuthError, isOrchestratorError, isRateLimited, isRetryable, isValidationError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, RateLimitedError, ResourceNotFoundError, SchemaValidationError, ServiceUnavailableError, SimulationFailedError, TokenNotSupportedError, UnauthorizedError, UnprocessableEntityError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from './error';
|
|
4
4
|
import { getAllSupportedChainsAndTokens, getSupportedTokens, getTokenAddress, getTokenDecimals, getTokenSymbol, getWethAddress, isTokenAddressSupported } from './registry';
|
|
5
|
-
import type { ApprovalRequired, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, Portfolio, SettlementLayer, SignedIntentOp, SplitIntentsInput, SplitIntentsResult, SupportedChain, TokenConfig, TokenRequirements, WrapRequired } from './types';
|
|
5
|
+
import type { ApprovalRequired, AuxiliaryFunds, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, Portfolio, SettlementLayer, SignedIntentOp, SplitIntentsInput, SplitIntentsResult, SupportedChain, TokenConfig, TokenRequirements, WrapRequired } from './types';
|
|
6
6
|
import { INTENT_STATUS_CLAIMED, INTENT_STATUS_COMPLETED, INTENT_STATUS_EXPIRED, INTENT_STATUS_FAILED, INTENT_STATUS_FILLED, INTENT_STATUS_PENDING, INTENT_STATUS_PRECONFIRMED } from './types';
|
|
7
7
|
declare function getOrchestrator(apiKey?: string, orchestratorUrl?: string): Orchestrator;
|
|
8
|
-
export type { IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, SettlementLayer, SignedIntentOp, SplitIntentsInput, SplitIntentsResult, SupportedChain, TokenConfig, Portfolio, TokenRequirements, WrapRequired, ApprovalRequired, };
|
|
8
|
+
export type { AuxiliaryFunds, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, SettlementLayer, SignedIntentOp, SplitIntentsInput, SplitIntentsResult, SupportedChain, TokenConfig, Portfolio, TokenRequirements, WrapRequired, ApprovalRequired, };
|
|
9
9
|
export { INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_CLAIMED, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, InsufficientLiquidityError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, InternalServerError, ResourceNotFoundError, RateLimitedError, SchemaValidationError, ServiceUnavailableError, SimulationFailedError, UnprocessableEntityError, UnauthorizedError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getOrchestrator, getWethAddress, getTokenSymbol, getTokenAddress, getTokenDecimals, getSupportedTokens, getAllSupportedChainsAndTokens, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, isTokenAddressSupported, };
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|