@rhinestone/sdk 0.9.0 → 0.10.1
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 +4 -3
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +8 -0
- package/dist/src/execution/index.d.ts +5 -15
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +10 -139
- package/dist/src/execution/utils.d.ts +66 -0
- package/dist/src/execution/utils.d.ts.map +1 -0
- package/dist/src/execution/utils.js +308 -0
- package/dist/src/index.d.ts +8 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +17 -0
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +82 -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
|
@@ -6,22 +6,23 @@ declare function getDeployArgs(config: RhinestoneAccountConfig): {
|
|
|
6
6
|
salt: `0x${string}`;
|
|
7
7
|
hashedInitcode: `0x${string}`;
|
|
8
8
|
implementation: `0x${string}`;
|
|
9
|
-
initializationCallData:
|
|
9
|
+
initializationCallData: null;
|
|
10
10
|
} | {
|
|
11
11
|
factory: `0x${string}`;
|
|
12
12
|
factoryData: `0x${string}`;
|
|
13
13
|
salt: `0x${string}`;
|
|
14
14
|
hashedInitcode: `0x${string}`;
|
|
15
15
|
implementation: `0x${string}`;
|
|
16
|
-
initializationCallData:
|
|
16
|
+
initializationCallData: `0x${string}`;
|
|
17
17
|
};
|
|
18
18
|
declare function getAddress(config: RhinestoneAccountConfig): `0x${string}`;
|
|
19
19
|
declare function isDeployed(chain: Chain, config: RhinestoneAccountConfig): Promise<boolean>;
|
|
20
|
+
declare function deploy(config: RhinestoneAccountConfig, chain: Chain, session?: Session): Promise<void>;
|
|
20
21
|
declare function deploySource(chain: Chain, config: RhinestoneAccountConfig): Promise<void>;
|
|
21
22
|
declare function deployTarget(chain: Chain, config: RhinestoneAccountConfig, asUserOp: boolean): Promise<void>;
|
|
22
23
|
declare function getBundleInitCode(config: RhinestoneAccountConfig): `0x${string}` | undefined;
|
|
23
24
|
declare function getSmartAccount(config: RhinestoneAccountConfig, client: PublicClient, chain: Chain): Promise<import("viem/account-abstraction").SmartAccount<import("viem/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">>>;
|
|
24
25
|
declare function getSmartSessionSmartAccount(config: RhinestoneAccountConfig, client: PublicClient, chain: Chain, session: Session): Promise<import("viem/account-abstraction").SmartAccount<import("viem/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">>>;
|
|
25
26
|
declare function sign(validators: OwnerSet, chain: Chain, hash: Hex): Promise<`0x${string}`>;
|
|
26
|
-
export { getDeployArgs, getBundleInitCode, getAddress, isDeployed, deploySource, deployTarget, getSmartAccount, getSmartSessionSmartAccount, sign, };
|
|
27
|
+
export { getDeployArgs, getBundleInitCode, getAddress, isDeployed, deploy, deploySource, deployTarget, getSmartAccount, getSmartSessionSmartAccount, sign, };
|
|
27
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,KAAK,EAKV,KAAK,GAAG,EAGR,KAAK,YAAY,EAIlB,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,KAAK,EAKV,KAAK,GAAG,EAGR,KAAK,YAAY,EAIlB,MAAM,MAAM,CAAA;AAWb,OAAO,KAAK,EAEV,QAAQ,EACR,uBAAuB,EACvB,OAAO,EACR,MAAM,UAAU,CAAA;AAiBjB,iBAAS,aAAa,CAAC,MAAM,EAAE,uBAAuB;;;;;;;;;;;;;;EAUrD;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,uBAAuB,iBAgBlD;AAED,iBAAe,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,uBAAuB,oBAiBtE;AAED,iBAAe,MAAM,CACnB,MAAM,EAAE,uBAAuB,EAC/B,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,OAAO,iBAMlB;AAED,iBAAe,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,uBAAuB,iBAMxE;AAED,iBAAe,YAAY,CACzB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,uBAAuB,EAC/B,QAAQ,EAAE,OAAO,iBASlB;AAUD,iBAAS,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,6BAUzD;AAgID,iBAAe,eAAe,CAC5B,MAAM,EAAE,uBAAuB,EAC/B,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,KAAK,sJA0Bb;AAED,iBAAe,2BAA2B,CACxC,MAAM,EAAE,uBAAuB,EAC/B,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,sJA8BjB;AAED,iBAAe,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,0BAYhE;AAgED,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,2BAA2B,EAC3B,IAAI,GACL,CAAA"}
|
|
@@ -4,12 +4,14 @@ exports.getDeployArgs = getDeployArgs;
|
|
|
4
4
|
exports.getBundleInitCode = getBundleInitCode;
|
|
5
5
|
exports.getAddress = getAddress;
|
|
6
6
|
exports.isDeployed = isDeployed;
|
|
7
|
+
exports.deploy = deploy;
|
|
7
8
|
exports.deploySource = deploySource;
|
|
8
9
|
exports.deployTarget = deployTarget;
|
|
9
10
|
exports.getSmartAccount = getSmartAccount;
|
|
10
11
|
exports.getSmartSessionSmartAccount = getSmartSessionSmartAccount;
|
|
11
12
|
exports.sign = sign;
|
|
12
13
|
const viem_1 = require("viem");
|
|
14
|
+
const smart_session_1 = require("../execution/smart-session");
|
|
13
15
|
const modules_1 = require("../modules");
|
|
14
16
|
const validators_1 = require("../modules/validators");
|
|
15
17
|
const nexus_1 = require("./nexus");
|
|
@@ -56,6 +58,12 @@ async function isDeployed(chain, config) {
|
|
|
56
58
|
}
|
|
57
59
|
return (0, viem_1.size)(code) > 0;
|
|
58
60
|
}
|
|
61
|
+
async function deploy(config, chain, session) {
|
|
62
|
+
await deploySource(chain, config);
|
|
63
|
+
if (session) {
|
|
64
|
+
await (0, smart_session_1.enableSmartSession)(chain, config, session);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
59
67
|
async function deploySource(chain, config) {
|
|
60
68
|
if (is7702(config)) {
|
|
61
69
|
return deploy7702Self(chain, config);
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import { type Address, type Chain
|
|
1
|
+
import { type Address, type Chain } from 'viem';
|
|
2
2
|
import type { BundleResult } from '../orchestrator';
|
|
3
3
|
import type { RhinestoneAccountConfig, Transaction } from '../types';
|
|
4
|
-
type TransactionResult
|
|
5
|
-
type: 'userop';
|
|
6
|
-
hash: Hex;
|
|
7
|
-
sourceChain: number;
|
|
8
|
-
targetChain: number;
|
|
9
|
-
} | {
|
|
10
|
-
type: 'bundle';
|
|
11
|
-
id: bigint;
|
|
12
|
-
sourceChain?: number;
|
|
13
|
-
targetChain: number;
|
|
14
|
-
};
|
|
4
|
+
import type { BundleData, TransactionResult } from './utils';
|
|
15
5
|
declare function sendTransaction(config: RhinestoneAccountConfig, transaction: Transaction): Promise<TransactionResult>;
|
|
16
|
-
declare function waitForExecution(config: RhinestoneAccountConfig, result: TransactionResult, acceptsPreconfirmations: boolean): Promise<
|
|
6
|
+
declare function waitForExecution(config: RhinestoneAccountConfig, result: TransactionResult, acceptsPreconfirmations: boolean): Promise<{
|
|
17
7
|
actualGasCost: bigint;
|
|
18
8
|
actualGasUsed: bigint;
|
|
19
9
|
entryPoint: Address;
|
|
@@ -25,9 +15,9 @@ declare function waitForExecution(config: RhinestoneAccountConfig, result: Trans
|
|
|
25
15
|
sender: Address;
|
|
26
16
|
success: boolean;
|
|
27
17
|
userOpHash: import("viem").Hash;
|
|
28
|
-
}>;
|
|
18
|
+
} | BundleResult>;
|
|
29
19
|
declare function getMaxSpendableAmount(config: RhinestoneAccountConfig, chain: Chain, tokenAddress: Address, gasUnits: bigint): Promise<bigint>;
|
|
30
20
|
declare function getPortfolio(config: RhinestoneAccountConfig, onTestnets: boolean): Promise<import("../orchestrator").UserTokenBalance[]>;
|
|
31
21
|
export { sendTransaction, waitForExecution, getMaxSpendableAmount, getPortfolio, };
|
|
32
|
-
export type { TransactionResult };
|
|
22
|
+
export type { BundleData, TransactionResult };
|
|
33
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAIX,MAAM,MAAM,CAAA;AAYb,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAYnD,OAAO,KAAK,EAEV,uBAAuB,EAIvB,WAAW,EACZ,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAa5D,iBAAe,eAAe,CAC5B,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAE,WAAW,8BAyBzB;AA0KD,iBAAe,gBAAgB,CAC7B,MAAM,EAAE,uBAAuB,EAC/B,MAAM,EAAE,iBAAiB,EACzB,uBAAuB,EAAE,OAAO;;;;;;;;;;;;kBAwCjC;AAED,iBAAe,qBAAqB,CAClC,MAAM,EAAE,uBAAuB,EAC/B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,OAAO,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CASjB;AAED,iBAAe,YAAY,CACzB,MAAM,EAAE,uBAAuB,EAC/B,UAAU,EAAE,OAAO,yDAMpB;AAED,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,GACb,CAAA;AACD,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -5,16 +5,13 @@ exports.waitForExecution = waitForExecution;
|
|
|
5
5
|
exports.getMaxSpendableAmount = getMaxSpendableAmount;
|
|
6
6
|
exports.getPortfolio = getPortfolio;
|
|
7
7
|
const viem_1 = require("viem");
|
|
8
|
-
const account_abstraction_1 = require("viem/account-abstraction");
|
|
9
8
|
const chains_1 = require("viem/chains");
|
|
10
9
|
const accounts_1 = require("../accounts");
|
|
11
10
|
const utils_1 = require("../accounts/utils");
|
|
12
|
-
const modules_1 = require("../modules");
|
|
13
|
-
const validators_1 = require("../modules/validators");
|
|
14
11
|
const orchestrator_1 = require("../orchestrator");
|
|
15
|
-
const consts_1 = require("../orchestrator/consts");
|
|
16
12
|
const registry_1 = require("../orchestrator/registry");
|
|
17
13
|
const smart_session_1 = require("./smart-session");
|
|
14
|
+
const utils_2 = require("./utils");
|
|
18
15
|
const POLLING_INTERVAL = 500;
|
|
19
16
|
async function sendTransaction(config, transaction) {
|
|
20
17
|
if ('chain' in transaction) {
|
|
@@ -63,12 +60,6 @@ async function sendTransactionAsUserOp(config, sourceChain, targetChain, calls,
|
|
|
63
60
|
});
|
|
64
61
|
const sessionAccount = await (0, accounts_1.getSmartSessionSmartAccount)(config, publicClient, sourceChain, withSession);
|
|
65
62
|
const bundlerClient = (0, utils_1.getBundlerClient)(config, publicClient);
|
|
66
|
-
const targetPublicClient = (0, viem_1.createPublicClient)({
|
|
67
|
-
chain: targetChain,
|
|
68
|
-
transport: (0, viem_1.http)(),
|
|
69
|
-
});
|
|
70
|
-
const targetSessionAccount = await (0, accounts_1.getSmartSessionSmartAccount)(config, targetPublicClient, targetChain, withSession);
|
|
71
|
-
const targetBundlerClient = (0, utils_1.getBundlerClient)(config, targetPublicClient);
|
|
72
63
|
if (sourceChain.id === targetChain.id) {
|
|
73
64
|
await (0, smart_session_1.enableSmartSession)(targetChain, config, withSession);
|
|
74
65
|
const hash = await bundlerClient.sendUserOperation({
|
|
@@ -82,132 +73,18 @@ async function sendTransactionAsUserOp(config, sourceChain, targetChain, calls,
|
|
|
82
73
|
targetChain: targetChain.id,
|
|
83
74
|
};
|
|
84
75
|
}
|
|
85
|
-
const
|
|
86
|
-
? {
|
|
87
|
-
chainIds: [sourceChain.id],
|
|
88
|
-
}
|
|
89
|
-
: (0, registry_1.getDefaultAccountAccessList)();
|
|
90
|
-
const metaIntent = {
|
|
91
|
-
targetChainId: targetChain.id,
|
|
92
|
-
tokenTransfers: tokenRequests.map((tokenRequest) => ({
|
|
93
|
-
tokenAddress: tokenRequest.address,
|
|
94
|
-
amount: tokenRequest.amount,
|
|
95
|
-
})),
|
|
96
|
-
targetAccount: accountAddress,
|
|
97
|
-
targetGasUnits: gasLimit,
|
|
98
|
-
userOp: (0, orchestrator_1.getEmptyUserOp)(),
|
|
99
|
-
accountAccessList,
|
|
100
|
-
};
|
|
101
|
-
const orchestrator = getOrchestratorByChain(targetChain.id, config.rhinestoneApiKey);
|
|
102
|
-
const orderPath = await orchestrator.getOrderPath(metaIntent, accountAddress);
|
|
76
|
+
const orderPath = await (0, utils_2.getUserOpOrderPath)(sourceChain, targetChain, tokenRequests, accountAddress, gasLimit, config.rhinestoneApiKey);
|
|
103
77
|
// Deploy the account on the target chain
|
|
104
78
|
await (0, accounts_1.deployTarget)(targetChain, config, true);
|
|
105
79
|
await (0, smart_session_1.enableSmartSession)(targetChain, config, withSession);
|
|
106
|
-
const userOp = await
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
stateOverride: [
|
|
110
|
-
...tokenRequests.map((request) => {
|
|
111
|
-
const rootBalanceSlot = (0, orchestrator_1.getTokenRootBalanceSlot)(targetChain, request.address);
|
|
112
|
-
const balanceSlot = rootBalanceSlot
|
|
113
|
-
? (0, viem_1.keccak256)((0, viem_1.encodeAbiParameters)([{ type: 'address' }, { type: 'uint256' }], [accountAddress, rootBalanceSlot]))
|
|
114
|
-
: '0x';
|
|
115
|
-
return {
|
|
116
|
-
address: request.address,
|
|
117
|
-
stateDiff: [
|
|
118
|
-
{
|
|
119
|
-
slot: balanceSlot,
|
|
120
|
-
value: (0, viem_1.pad)((0, viem_1.toHex)(request.amount)),
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
};
|
|
124
|
-
}),
|
|
125
|
-
],
|
|
126
|
-
});
|
|
127
|
-
userOp.signature = await targetSessionAccount.signUserOperation(userOp);
|
|
128
|
-
const userOpHash = (0, account_abstraction_1.getUserOperationHash)({
|
|
129
|
-
userOperation: userOp,
|
|
130
|
-
chainId: targetChain.id,
|
|
131
|
-
entryPointAddress: account_abstraction_1.entryPoint07Address,
|
|
132
|
-
entryPointVersion: '0.7',
|
|
133
|
-
});
|
|
134
|
-
orderPath[0].orderBundle.segments[0].witness.userOpHash = userOpHash;
|
|
135
|
-
const { hash, appDomainSeparator, contentsType, structHash } = await (0, smart_session_1.hashErc7739)(sourceChain, orderPath, accountAddress);
|
|
136
|
-
const signature = await (0, accounts_1.sign)(withSession.owners, targetChain, hash);
|
|
137
|
-
const sessionSignature = (0, smart_session_1.getSessionSignature)(signature, appDomainSeparator, structHash, contentsType, withSession);
|
|
138
|
-
const smartSessionValidator = (0, validators_1.getSmartSessionValidator)(config);
|
|
139
|
-
if (!smartSessionValidator) {
|
|
140
|
-
throw new Error('Smart session validator not available');
|
|
141
|
-
}
|
|
142
|
-
const packedSig = (0, viem_1.encodePacked)(['address', 'bytes'], [smartSessionValidator.address, sessionSignature]);
|
|
143
|
-
const signedOrderBundle = {
|
|
144
|
-
...orderPath[0].orderBundle,
|
|
145
|
-
originSignatures: Array(orderPath[0].orderBundle.segments.length).fill(packedSig),
|
|
146
|
-
targetSignature: packedSig,
|
|
147
|
-
};
|
|
148
|
-
const bundleResults = await orchestrator.postSignedOrderBundle([
|
|
149
|
-
{
|
|
150
|
-
signedOrderBundle,
|
|
151
|
-
userOp,
|
|
152
|
-
},
|
|
153
|
-
]);
|
|
154
|
-
return {
|
|
155
|
-
type: 'bundle',
|
|
156
|
-
id: bundleResults[0].bundleId,
|
|
157
|
-
sourceChain: sourceChain.id,
|
|
158
|
-
targetChain: targetChain.id,
|
|
159
|
-
};
|
|
80
|
+
const userOp = await (0, utils_2.getUserOp)(config, targetChain, withSession, orderPath, calls, tokenRequests, accountAddress);
|
|
81
|
+
const sessionSignature = await (0, utils_2.signUserOp)(config, sourceChain, targetChain, accountAddress, withSession, userOp, orderPath);
|
|
82
|
+
return await (0, utils_2.submitUserOp)(config, sourceChain, targetChain, userOp, orderPath, sessionSignature);
|
|
160
83
|
}
|
|
161
84
|
async function sendTransactionAsIntent(config, sourceChain, targetChain, calls, gasLimit, tokenRequests, accountAddress) {
|
|
162
|
-
const
|
|
163
|
-
? {
|
|
164
|
-
chainIds: [sourceChain.id],
|
|
165
|
-
}
|
|
166
|
-
: (0, registry_1.getDefaultAccountAccessList)();
|
|
167
|
-
const metaIntent = {
|
|
168
|
-
targetChainId: targetChain.id,
|
|
169
|
-
tokenTransfers: tokenRequests.map((tokenRequest) => ({
|
|
170
|
-
tokenAddress: tokenRequest.address,
|
|
171
|
-
amount: tokenRequest.amount,
|
|
172
|
-
})),
|
|
173
|
-
targetAccount: accountAddress,
|
|
174
|
-
targetExecutions: calls.map((call) => ({
|
|
175
|
-
value: call.value ?? 0n,
|
|
176
|
-
to: call.to,
|
|
177
|
-
data: call.data ?? '0x',
|
|
178
|
-
})),
|
|
179
|
-
targetGasUnits: gasLimit,
|
|
180
|
-
accountAccessList,
|
|
181
|
-
};
|
|
182
|
-
const orchestrator = getOrchestratorByChain(targetChain.id, config.rhinestoneApiKey);
|
|
183
|
-
const orderPath = await orchestrator.getOrderPath(metaIntent, accountAddress);
|
|
184
|
-
orderPath[0].orderBundle.segments[0].witness.execs = [
|
|
185
|
-
...orderPath[0].injectedExecutions,
|
|
186
|
-
...metaIntent.targetExecutions,
|
|
187
|
-
];
|
|
188
|
-
const orderBundleHash = (0, orchestrator_1.getOrderBundleHash)(orderPath[0].orderBundle);
|
|
85
|
+
const { orderPath, hash: orderBundleHash } = await (0, utils_2.prepareTransactionAsIntent)(config, sourceChain, targetChain, calls, gasLimit, tokenRequests, accountAddress);
|
|
189
86
|
const bundleSignature = await (0, accounts_1.sign)(config.owners, sourceChain || targetChain, orderBundleHash);
|
|
190
|
-
|
|
191
|
-
const packedSig = (0, viem_1.encodePacked)(['address', 'bytes'], [validatorModule.address, bundleSignature]);
|
|
192
|
-
const signedOrderBundle = {
|
|
193
|
-
...orderPath[0].orderBundle,
|
|
194
|
-
originSignatures: Array(orderPath[0].orderBundle.segments.length).fill(packedSig),
|
|
195
|
-
targetSignature: packedSig,
|
|
196
|
-
};
|
|
197
|
-
await (0, accounts_1.deployTarget)(targetChain, config, false);
|
|
198
|
-
const initCode = (0, accounts_1.getBundleInitCode)(config);
|
|
199
|
-
const bundleResults = await orchestrator.postSignedOrderBundle([
|
|
200
|
-
{
|
|
201
|
-
signedOrderBundle,
|
|
202
|
-
initCode,
|
|
203
|
-
},
|
|
204
|
-
]);
|
|
205
|
-
return {
|
|
206
|
-
type: 'bundle',
|
|
207
|
-
id: bundleResults[0].bundleId,
|
|
208
|
-
sourceChain: sourceChain?.id,
|
|
209
|
-
targetChain: targetChain.id,
|
|
210
|
-
};
|
|
87
|
+
return await (0, utils_2.submitIntentInternal)(config, sourceChain, targetChain, orderPath, bundleSignature, true);
|
|
211
88
|
}
|
|
212
89
|
async function waitForExecution(config, result, acceptsPreconfirmations) {
|
|
213
90
|
const validStatuses = new Set([
|
|
@@ -222,7 +99,7 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
|
|
|
222
99
|
case 'bundle': {
|
|
223
100
|
let bundleResult = null;
|
|
224
101
|
while (bundleResult === null || !validStatuses.has(bundleResult.status)) {
|
|
225
|
-
const orchestrator = getOrchestratorByChain(result.targetChain, config.rhinestoneApiKey);
|
|
102
|
+
const orchestrator = (0, utils_2.getOrchestratorByChain)(result.targetChain, config.rhinestoneApiKey);
|
|
226
103
|
bundleResult = await orchestrator.getBundleStatus(result.id);
|
|
227
104
|
await new Promise((resolve) => setTimeout(resolve, POLLING_INTERVAL));
|
|
228
105
|
}
|
|
@@ -247,18 +124,12 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
|
|
|
247
124
|
}
|
|
248
125
|
async function getMaxSpendableAmount(config, chain, tokenAddress, gasUnits) {
|
|
249
126
|
const address = (0, accounts_1.getAddress)(config);
|
|
250
|
-
const orchestrator = getOrchestratorByChain(chain.id, config.rhinestoneApiKey);
|
|
127
|
+
const orchestrator = (0, utils_2.getOrchestratorByChain)(chain.id, config.rhinestoneApiKey);
|
|
251
128
|
return orchestrator.getMaxTokenAmount(address, chain.id, tokenAddress, gasUnits);
|
|
252
129
|
}
|
|
253
130
|
async function getPortfolio(config, onTestnets) {
|
|
254
131
|
const address = (0, accounts_1.getAddress)(config);
|
|
255
132
|
const chainId = onTestnets ? chains_1.sepolia.id : chains_1.mainnet.id;
|
|
256
|
-
const orchestrator = getOrchestratorByChain(chainId, config.rhinestoneApiKey);
|
|
133
|
+
const orchestrator = (0, utils_2.getOrchestratorByChain)(chainId, config.rhinestoneApiKey);
|
|
257
134
|
return orchestrator.getPortfolio(address, (0, registry_1.getDefaultAccountAccessList)());
|
|
258
135
|
}
|
|
259
|
-
function getOrchestratorByChain(chainId, apiKey) {
|
|
260
|
-
const orchestratorUrl = (0, registry_1.isTestnet)(chainId)
|
|
261
|
-
? consts_1.DEV_ORCHESTRATOR_URL
|
|
262
|
-
: consts_1.PROD_ORCHESTRATOR_URL;
|
|
263
|
-
return (0, orchestrator_1.getOrchestrator)(apiKey, orchestratorUrl);
|
|
264
|
-
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Address, Chain, Hex } from 'viem';
|
|
2
|
+
import { UserOperation } from 'viem/account-abstraction';
|
|
3
|
+
import { OrderPath } from '../orchestrator/types';
|
|
4
|
+
import { Call, RhinestoneAccountConfig, Session, TokenRequest, Transaction } from '../types';
|
|
5
|
+
type TransactionResult = {
|
|
6
|
+
type: 'userop';
|
|
7
|
+
hash: Hex;
|
|
8
|
+
sourceChain: number;
|
|
9
|
+
targetChain: number;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'bundle';
|
|
12
|
+
id: bigint;
|
|
13
|
+
sourceChain?: number;
|
|
14
|
+
targetChain: number;
|
|
15
|
+
};
|
|
16
|
+
interface BundleData {
|
|
17
|
+
hash: Hex;
|
|
18
|
+
orderPath: OrderPath;
|
|
19
|
+
userOp?: UserOperation;
|
|
20
|
+
}
|
|
21
|
+
interface PreparedTransactionData {
|
|
22
|
+
bundleData: BundleData;
|
|
23
|
+
transaction: Transaction;
|
|
24
|
+
}
|
|
25
|
+
interface SignedTransactionData extends PreparedTransactionData {
|
|
26
|
+
signature: Hex;
|
|
27
|
+
}
|
|
28
|
+
declare function prepareTransaction(config: RhinestoneAccountConfig, transaction: Transaction): Promise<PreparedTransactionData>;
|
|
29
|
+
declare function signTransaction(config: RhinestoneAccountConfig, preparedTransaction: PreparedTransactionData): Promise<SignedTransactionData>;
|
|
30
|
+
declare function submitTransaction(config: RhinestoneAccountConfig, signedTransaction: SignedTransactionData): Promise<TransactionResult>;
|
|
31
|
+
declare function prepareTransactionAsIntent(config: RhinestoneAccountConfig, sourceChain: Chain | undefined, targetChain: Chain, calls: Call[], gasLimit: bigint | undefined, tokenRequests: TokenRequest[], accountAddress: Address): Promise<BundleData>;
|
|
32
|
+
declare function signUserOp(config: RhinestoneAccountConfig, sourceChain: Chain, targetChain: Chain, accountAddress: Address, withSession: Session, userOp: UserOperation, orderPath: OrderPath): Promise<`0x${string}`>;
|
|
33
|
+
declare function submitUserOp(config: RhinestoneAccountConfig, sourceChain: Chain, targetChain: Chain, userOp: UserOperation, orderPath: OrderPath, sessionSignature: Hex): Promise<TransactionResult>;
|
|
34
|
+
declare function getOrchestratorByChain(chainId: number, apiKey: string): import("../orchestrator").Orchestrator;
|
|
35
|
+
declare function getUserOpOrderPath(sourceChain: Chain, targetChain: Chain, tokenRequests: TokenRequest[], accountAddress: Address, gasLimit: bigint | undefined, rhinestoneApiKey: string): Promise<OrderPath>;
|
|
36
|
+
declare function getUserOp(config: RhinestoneAccountConfig, targetChain: Chain, withSession: Session, orderPath: OrderPath, calls: Call[], tokenRequests: TokenRequest[], accountAddress: Address): Promise<{
|
|
37
|
+
readonly account: import("viem/account-abstraction").SmartAccount<import("viem/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">>;
|
|
38
|
+
readonly stateOverride: {
|
|
39
|
+
address: `0x${string}`;
|
|
40
|
+
stateDiff: {
|
|
41
|
+
slot: `0x${string}`;
|
|
42
|
+
value: `0x${string}`;
|
|
43
|
+
}[];
|
|
44
|
+
}[];
|
|
45
|
+
callData: Hex;
|
|
46
|
+
paymasterAndData: undefined;
|
|
47
|
+
sender: UserOperation["sender"];
|
|
48
|
+
authorization: UserOperation["authorization"];
|
|
49
|
+
factory: UserOperation["factory"];
|
|
50
|
+
factoryData: UserOperation["factoryData"];
|
|
51
|
+
nonce: UserOperation["nonce"];
|
|
52
|
+
maxFeePerGas: UserOperation["maxFeePerGas"];
|
|
53
|
+
maxPriorityFeePerGas: UserOperation["maxPriorityFeePerGas"];
|
|
54
|
+
callGasLimit: UserOperation["callGasLimit"];
|
|
55
|
+
preVerificationGas: UserOperation["preVerificationGas"];
|
|
56
|
+
verificationGasLimit: UserOperation["verificationGasLimit"];
|
|
57
|
+
paymasterPostOpGasLimit: UserOperation["paymasterPostOpGasLimit"];
|
|
58
|
+
paymasterVerificationGasLimit: UserOperation["paymasterVerificationGasLimit"];
|
|
59
|
+
paymaster: UserOperation["paymaster"];
|
|
60
|
+
paymasterData: UserOperation["paymasterData"];
|
|
61
|
+
signature: UserOperation["signature"];
|
|
62
|
+
}>;
|
|
63
|
+
declare function submitIntentInternal(config: RhinestoneAccountConfig, sourceChain: Chain | undefined, targetChain: Chain, orderPath: OrderPath, bundleSignature: Hex, deploy: boolean): Promise<TransactionResult>;
|
|
64
|
+
export { prepareTransaction, signTransaction, submitTransaction, getOrchestratorByChain, getUserOpOrderPath, getUserOp, signUserOp, submitUserOp, prepareTransactionAsIntent, submitIntentInternal, };
|
|
65
|
+
export type { BundleData, TransactionResult, PreparedTransactionData, SignedTransactionData, };
|
|
66
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../execution/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,EAIL,GAAG,EAMJ,MAAM,MAAM,CAAA;AACb,OAAO,EAGL,aAAa,EACd,MAAM,0BAA0B,CAAA;AA2BjC,OAAO,EAEL,SAAS,EAGV,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,IAAI,EACJ,uBAAuB,EACvB,OAAO,EACP,YAAY,EACZ,WAAW,EACZ,MAAM,UAAU,CAAA;AAIjB,KAAK,iBAAiB,GAClB;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,GAAG,CAAA;IACT,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;CACpB,GACD;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAEL,UAAU,UAAU;IAClB,IAAI,EAAE,GA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sB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,0CAK9D;AAED,iBAAe,kBAAkB,CAC/B,WAAW,EAAE,KAAK,EAClB,WAAW,EAAE,KAAK,EAClB,aAAa,EAAE,YAAY,EAAE,EAC7B,cAAc,EAAE,OAAO,EACvB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,gBAAgB,EAAE,MAAM,sBAuBzB;AAED,iBAAe,SAAS,CACtB,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAE,KAAK,EAClB,WAAW,EAAE,OAAO,EACpB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,IAAI,EAAE,EACb,aAAa,EAAE,YAAY,EAAE,EAC7B,cAAc,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CxB;AAED,iBAAe,oBAAoB,CACjC,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAE,KAAK,GAAG,SAAS,EAC9B,WAAW,EAAE,KAAK,EAClB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,GAAG,EACpB,MAAM,EAAE,OAAO,8BAkChB;AAED,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,0BAA0B,EAC1B,oBAAoB,GACrB,CAAA;AACD,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,GACtB,CAAA"}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prepareTransaction = prepareTransaction;
|
|
4
|
+
exports.signTransaction = signTransaction;
|
|
5
|
+
exports.submitTransaction = submitTransaction;
|
|
6
|
+
exports.getOrchestratorByChain = getOrchestratorByChain;
|
|
7
|
+
exports.getUserOpOrderPath = getUserOpOrderPath;
|
|
8
|
+
exports.getUserOp = getUserOp;
|
|
9
|
+
exports.signUserOp = signUserOp;
|
|
10
|
+
exports.submitUserOp = submitUserOp;
|
|
11
|
+
exports.prepareTransactionAsIntent = prepareTransactionAsIntent;
|
|
12
|
+
exports.submitIntentInternal = submitIntentInternal;
|
|
13
|
+
const viem_1 = require("viem");
|
|
14
|
+
const account_abstraction_1 = require("viem/account-abstraction");
|
|
15
|
+
const accounts_1 = require("../accounts");
|
|
16
|
+
const utils_1 = require("../accounts/utils");
|
|
17
|
+
const validators_1 = require("../modules/validators");
|
|
18
|
+
const orchestrator_1 = require("../orchestrator");
|
|
19
|
+
const consts_1 = require("../orchestrator/consts");
|
|
20
|
+
const registry_1 = require("../orchestrator/registry");
|
|
21
|
+
const smart_session_1 = require("./smart-session");
|
|
22
|
+
async function prepareTransaction(config, transaction) {
|
|
23
|
+
const { sourceChain, targetChain, tokenRequests, withSession } = getTransactionParams(transaction);
|
|
24
|
+
const accountAddress = (0, accounts_1.getAddress)(config);
|
|
25
|
+
let bundleData;
|
|
26
|
+
if (withSession) {
|
|
27
|
+
if (!sourceChain) {
|
|
28
|
+
throw new Error(`Specifying source chain is required when using smart sessions`);
|
|
29
|
+
}
|
|
30
|
+
// Smart sessions require a UserOp flow
|
|
31
|
+
bundleData = await prepareTransactionAsUserOp(config, sourceChain, targetChain, transaction.calls, transaction.gasLimit, tokenRequests, accountAddress, withSession);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
bundleData = await prepareTransactionAsIntent(config, sourceChain, targetChain, transaction.calls, transaction.gasLimit, tokenRequests, accountAddress);
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
bundleData,
|
|
38
|
+
transaction,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async function signTransaction(config, preparedTransaction) {
|
|
42
|
+
const { sourceChain, targetChain, withSession } = getTransactionParams(preparedTransaction.transaction);
|
|
43
|
+
const bundleData = preparedTransaction.bundleData;
|
|
44
|
+
const accountAddress = (0, accounts_1.getAddress)(config);
|
|
45
|
+
let signature;
|
|
46
|
+
if (withSession) {
|
|
47
|
+
if (!sourceChain) {
|
|
48
|
+
throw new Error(`Specifying source chain is required when using smart sessions`);
|
|
49
|
+
}
|
|
50
|
+
const userOp = bundleData.userOp;
|
|
51
|
+
if (!userOp) {
|
|
52
|
+
throw new Error(`User operation is required when using smart sessions`);
|
|
53
|
+
}
|
|
54
|
+
// Smart sessions require a UserOp flow
|
|
55
|
+
signature = await signUserOp(config, sourceChain, targetChain, accountAddress, withSession, userOp, bundleData.orderPath);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
signature = await signIntent(config, sourceChain, targetChain, bundleData.hash);
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
bundleData,
|
|
62
|
+
transaction: preparedTransaction.transaction,
|
|
63
|
+
signature,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
async function submitTransaction(config, signedTransaction) {
|
|
67
|
+
const { bundleData, transaction, signature } = signedTransaction;
|
|
68
|
+
const { sourceChain, targetChain, withSession } = getTransactionParams(transaction);
|
|
69
|
+
if (withSession) {
|
|
70
|
+
if (!sourceChain) {
|
|
71
|
+
throw new Error(`Specifying source chain is required when using smart sessions`);
|
|
72
|
+
}
|
|
73
|
+
const userOp = bundleData.userOp;
|
|
74
|
+
if (!userOp) {
|
|
75
|
+
throw new Error(`User operation is required when using smart sessions`);
|
|
76
|
+
}
|
|
77
|
+
// Smart sessions require a UserOp flow
|
|
78
|
+
return await submitUserOp(config, sourceChain, targetChain, userOp, bundleData.orderPath, signature);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
return await submitIntent(config, sourceChain, targetChain, bundleData.orderPath, signature);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function getTransactionParams(transaction) {
|
|
85
|
+
const sourceChain = 'chain' in transaction ? transaction.chain : transaction.sourceChain;
|
|
86
|
+
const targetChain = 'chain' in transaction ? transaction.chain : transaction.targetChain;
|
|
87
|
+
const initialTokenRequests = transaction.tokenRequests;
|
|
88
|
+
const withSession = transaction.signers?.type === 'session' ? transaction.signers.session : null;
|
|
89
|
+
// Across requires passing some value to repay the solvers
|
|
90
|
+
const tokenRequests = initialTokenRequests.length === 0
|
|
91
|
+
? [
|
|
92
|
+
{
|
|
93
|
+
address: viem_1.zeroAddress,
|
|
94
|
+
amount: 1n,
|
|
95
|
+
},
|
|
96
|
+
]
|
|
97
|
+
: initialTokenRequests;
|
|
98
|
+
return {
|
|
99
|
+
sourceChain,
|
|
100
|
+
targetChain,
|
|
101
|
+
tokenRequests,
|
|
102
|
+
withSession,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
async function prepareTransactionAsUserOp(config, sourceChain, targetChain, calls, gasLimit, tokenRequests, accountAddress, withSession) {
|
|
106
|
+
if (sourceChain.id === targetChain.id) {
|
|
107
|
+
throw new Error('Source and target chains cannot be the same when using user operations');
|
|
108
|
+
}
|
|
109
|
+
const orderPath = await getUserOpOrderPath(sourceChain, targetChain, tokenRequests, accountAddress, gasLimit, config.rhinestoneApiKey);
|
|
110
|
+
const userOp = await getUserOp(config, targetChain, withSession, orderPath, calls, tokenRequests, accountAddress);
|
|
111
|
+
const hash = (0, account_abstraction_1.getUserOperationHash)({
|
|
112
|
+
userOperation: userOp,
|
|
113
|
+
entryPointAddress: account_abstraction_1.entryPoint07Address,
|
|
114
|
+
entryPointVersion: '0.7',
|
|
115
|
+
chainId: targetChain.id,
|
|
116
|
+
});
|
|
117
|
+
return {
|
|
118
|
+
orderPath,
|
|
119
|
+
userOp,
|
|
120
|
+
hash,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
async function prepareTransactionAsIntent(config, sourceChain, targetChain, calls, gasLimit, tokenRequests, accountAddress) {
|
|
124
|
+
const accountAccessList = sourceChain
|
|
125
|
+
? {
|
|
126
|
+
chainIds: [sourceChain.id],
|
|
127
|
+
}
|
|
128
|
+
: (0, registry_1.getDefaultAccountAccessList)();
|
|
129
|
+
const metaIntent = {
|
|
130
|
+
targetChainId: targetChain.id,
|
|
131
|
+
tokenTransfers: tokenRequests.map((tokenRequest) => ({
|
|
132
|
+
tokenAddress: tokenRequest.address,
|
|
133
|
+
amount: tokenRequest.amount,
|
|
134
|
+
})),
|
|
135
|
+
targetAccount: accountAddress,
|
|
136
|
+
targetExecutions: calls.map((call) => ({
|
|
137
|
+
value: call.value ?? 0n,
|
|
138
|
+
to: call.to,
|
|
139
|
+
data: call.data ?? '0x',
|
|
140
|
+
})),
|
|
141
|
+
targetGasUnits: gasLimit,
|
|
142
|
+
accountAccessList,
|
|
143
|
+
};
|
|
144
|
+
const orchestrator = getOrchestratorByChain(targetChain.id, config.rhinestoneApiKey);
|
|
145
|
+
const orderPath = await orchestrator.getOrderPath(metaIntent, accountAddress);
|
|
146
|
+
orderPath[0].orderBundle.segments[0].witness.execs = [
|
|
147
|
+
...orderPath[0].injectedExecutions,
|
|
148
|
+
...metaIntent.targetExecutions,
|
|
149
|
+
];
|
|
150
|
+
const orderBundleHash = (0, orchestrator_1.getOrderBundleHash)(orderPath[0].orderBundle);
|
|
151
|
+
return {
|
|
152
|
+
orderPath,
|
|
153
|
+
hash: orderBundleHash,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
async function signIntent(config, sourceChain, targetChain, bundleHash) {
|
|
157
|
+
const signature = await (0, accounts_1.sign)(config.owners, sourceChain || targetChain, bundleHash);
|
|
158
|
+
return signature;
|
|
159
|
+
}
|
|
160
|
+
async function signUserOp(config, sourceChain, targetChain, accountAddress, withSession, userOp, orderPath) {
|
|
161
|
+
const targetPublicClient = (0, viem_1.createPublicClient)({
|
|
162
|
+
chain: targetChain,
|
|
163
|
+
transport: (0, viem_1.http)(),
|
|
164
|
+
});
|
|
165
|
+
const targetSessionAccount = await (0, accounts_1.getSmartSessionSmartAccount)(config, targetPublicClient, targetChain, withSession);
|
|
166
|
+
userOp.signature = await targetSessionAccount.signUserOperation(userOp);
|
|
167
|
+
const userOpHash = (0, account_abstraction_1.getUserOperationHash)({
|
|
168
|
+
userOperation: userOp,
|
|
169
|
+
chainId: targetChain.id,
|
|
170
|
+
entryPointAddress: account_abstraction_1.entryPoint07Address,
|
|
171
|
+
entryPointVersion: '0.7',
|
|
172
|
+
});
|
|
173
|
+
orderPath[0].orderBundle.segments[0].witness.userOpHash = userOpHash;
|
|
174
|
+
const { hash, appDomainSeparator, contentsType, structHash } = await (0, smart_session_1.hashErc7739)(sourceChain, orderPath, accountAddress);
|
|
175
|
+
const signature = await (0, accounts_1.sign)(withSession.owners, targetChain, hash);
|
|
176
|
+
const sessionSignature = (0, smart_session_1.getSessionSignature)(signature, appDomainSeparator, structHash, contentsType, withSession);
|
|
177
|
+
return sessionSignature;
|
|
178
|
+
}
|
|
179
|
+
async function submitUserOp(config, sourceChain, targetChain, userOp, orderPath, sessionSignature) {
|
|
180
|
+
const smartSessionValidator = (0, validators_1.getSmartSessionValidator)(config);
|
|
181
|
+
if (!smartSessionValidator) {
|
|
182
|
+
throw new Error('Smart session validator not available');
|
|
183
|
+
}
|
|
184
|
+
const packedSig = (0, viem_1.encodePacked)(['address', 'bytes'], [smartSessionValidator.address, sessionSignature]);
|
|
185
|
+
const signedOrderBundle = {
|
|
186
|
+
...orderPath[0].orderBundle,
|
|
187
|
+
originSignatures: Array(orderPath[0].orderBundle.segments.length).fill(packedSig),
|
|
188
|
+
targetSignature: packedSig,
|
|
189
|
+
};
|
|
190
|
+
const orchestrator = getOrchestratorByChain(targetChain.id, config.rhinestoneApiKey);
|
|
191
|
+
const bundleResults = await orchestrator.postSignedOrderBundle([
|
|
192
|
+
{
|
|
193
|
+
signedOrderBundle,
|
|
194
|
+
userOp,
|
|
195
|
+
},
|
|
196
|
+
]);
|
|
197
|
+
return {
|
|
198
|
+
type: 'bundle',
|
|
199
|
+
id: bundleResults[0].bundleId,
|
|
200
|
+
sourceChain: sourceChain.id,
|
|
201
|
+
targetChain: targetChain.id,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
async function submitIntent(config, sourceChain, targetChain, orderPath, bundleSignature) {
|
|
205
|
+
const validatorModule = (0, validators_1.getOwnerValidator)(config);
|
|
206
|
+
const packedSig = (0, viem_1.encodePacked)(['address', 'bytes'], [validatorModule.address, bundleSignature]);
|
|
207
|
+
const signedOrderBundle = {
|
|
208
|
+
...orderPath[0].orderBundle,
|
|
209
|
+
originSignatures: Array(orderPath[0].orderBundle.segments.length).fill(packedSig),
|
|
210
|
+
targetSignature: packedSig,
|
|
211
|
+
};
|
|
212
|
+
const initCode = (0, accounts_1.getBundleInitCode)(config);
|
|
213
|
+
const orchestrator = getOrchestratorByChain(targetChain.id, config.rhinestoneApiKey);
|
|
214
|
+
const bundleResults = await orchestrator.postSignedOrderBundle([
|
|
215
|
+
{
|
|
216
|
+
signedOrderBundle,
|
|
217
|
+
initCode,
|
|
218
|
+
},
|
|
219
|
+
]);
|
|
220
|
+
return {
|
|
221
|
+
type: 'bundle',
|
|
222
|
+
id: bundleResults[0].bundleId,
|
|
223
|
+
sourceChain: sourceChain?.id,
|
|
224
|
+
targetChain: targetChain.id,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function getOrchestratorByChain(chainId, apiKey) {
|
|
228
|
+
const orchestratorUrl = (0, registry_1.isTestnet)(chainId)
|
|
229
|
+
? consts_1.DEV_ORCHESTRATOR_URL
|
|
230
|
+
: consts_1.PROD_ORCHESTRATOR_URL;
|
|
231
|
+
return (0, orchestrator_1.getOrchestrator)(apiKey, orchestratorUrl);
|
|
232
|
+
}
|
|
233
|
+
async function getUserOpOrderPath(sourceChain, targetChain, tokenRequests, accountAddress, gasLimit, rhinestoneApiKey) {
|
|
234
|
+
const accountAccessList = sourceChain
|
|
235
|
+
? {
|
|
236
|
+
chainIds: [sourceChain.id],
|
|
237
|
+
}
|
|
238
|
+
: (0, registry_1.getDefaultAccountAccessList)();
|
|
239
|
+
const metaIntent = {
|
|
240
|
+
targetChainId: targetChain.id,
|
|
241
|
+
tokenTransfers: tokenRequests.map((tokenRequest) => ({
|
|
242
|
+
tokenAddress: tokenRequest.address,
|
|
243
|
+
amount: tokenRequest.amount,
|
|
244
|
+
})),
|
|
245
|
+
targetAccount: accountAddress,
|
|
246
|
+
targetGasUnits: gasLimit,
|
|
247
|
+
userOp: (0, orchestrator_1.getEmptyUserOp)(),
|
|
248
|
+
accountAccessList,
|
|
249
|
+
};
|
|
250
|
+
const orchestrator = getOrchestratorByChain(targetChain.id, rhinestoneApiKey);
|
|
251
|
+
const orderPath = await orchestrator.getOrderPath(metaIntent, accountAddress);
|
|
252
|
+
return orderPath;
|
|
253
|
+
}
|
|
254
|
+
async function getUserOp(config, targetChain, withSession, orderPath, calls, tokenRequests, accountAddress) {
|
|
255
|
+
const targetPublicClient = (0, viem_1.createPublicClient)({
|
|
256
|
+
chain: targetChain,
|
|
257
|
+
transport: (0, viem_1.http)(),
|
|
258
|
+
});
|
|
259
|
+
const targetSessionAccount = await (0, accounts_1.getSmartSessionSmartAccount)(config, targetPublicClient, targetChain, withSession);
|
|
260
|
+
const targetBundlerClient = (0, utils_1.getBundlerClient)(config, targetPublicClient);
|
|
261
|
+
return await targetBundlerClient.prepareUserOperation({
|
|
262
|
+
account: targetSessionAccount,
|
|
263
|
+
calls: [...orderPath[0].injectedExecutions, ...calls],
|
|
264
|
+
stateOverride: [
|
|
265
|
+
...tokenRequests.map((request) => {
|
|
266
|
+
const rootBalanceSlot = (0, registry_1.getTokenRootBalanceSlot)(targetChain, request.address);
|
|
267
|
+
const balanceSlot = rootBalanceSlot
|
|
268
|
+
? (0, viem_1.keccak256)((0, viem_1.encodeAbiParameters)([{ type: 'address' }, { type: 'uint256' }], [accountAddress, rootBalanceSlot]))
|
|
269
|
+
: '0x';
|
|
270
|
+
return {
|
|
271
|
+
address: request.address,
|
|
272
|
+
stateDiff: [
|
|
273
|
+
{
|
|
274
|
+
slot: balanceSlot,
|
|
275
|
+
value: (0, viem_1.pad)((0, viem_1.toHex)(request.amount)),
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
};
|
|
279
|
+
}),
|
|
280
|
+
],
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
async function submitIntentInternal(config, sourceChain, targetChain, orderPath, bundleSignature, deploy) {
|
|
284
|
+
const validatorModule = (0, validators_1.getOwnerValidator)(config);
|
|
285
|
+
const packedSig = (0, viem_1.encodePacked)(['address', 'bytes'], [validatorModule.address, bundleSignature]);
|
|
286
|
+
const signedOrderBundle = {
|
|
287
|
+
...orderPath[0].orderBundle,
|
|
288
|
+
originSignatures: Array(orderPath[0].orderBundle.segments.length).fill(packedSig),
|
|
289
|
+
targetSignature: packedSig,
|
|
290
|
+
};
|
|
291
|
+
if (deploy) {
|
|
292
|
+
await (0, accounts_1.deployTarget)(targetChain, config, false);
|
|
293
|
+
}
|
|
294
|
+
const initCode = (0, accounts_1.getBundleInitCode)(config);
|
|
295
|
+
const orchestrator = getOrchestratorByChain(targetChain.id, config.rhinestoneApiKey);
|
|
296
|
+
const bundleResults = await orchestrator.postSignedOrderBundle([
|
|
297
|
+
{
|
|
298
|
+
signedOrderBundle,
|
|
299
|
+
initCode,
|
|
300
|
+
},
|
|
301
|
+
]);
|
|
302
|
+
return {
|
|
303
|
+
type: 'bundle',
|
|
304
|
+
id: bundleResults[0].bundleId,
|
|
305
|
+
sourceChain: sourceChain?.id,
|
|
306
|
+
targetChain: targetChain.id,
|
|
307
|
+
};
|
|
308
|
+
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Address, Chain } from 'viem';
|
|
2
2
|
import type { TransactionResult } from './execution';
|
|
3
|
+
import { BundleData, PreparedTransactionData, SignedTransactionData } from './execution/utils';
|
|
3
4
|
import type { BundleStatus, MetaIntent, MultiChainCompact, PostOrderBundleResult, SignedMultiChainCompact } from './orchestrator';
|
|
4
5
|
import type { Call, Execution, RhinestoneAccountConfig, Session, Transaction } from './types';
|
|
5
6
|
/**
|
|
@@ -10,8 +11,12 @@ import type { Call, Execution, RhinestoneAccountConfig, Session, Transaction } f
|
|
|
10
11
|
*/
|
|
11
12
|
declare function createRhinestoneAccount(config: RhinestoneAccountConfig): Promise<{
|
|
12
13
|
config: RhinestoneAccountConfig;
|
|
14
|
+
deploy: (chain: Chain, session?: Session) => Promise<void>;
|
|
15
|
+
prepareTransaction: (transaction: Transaction) => Promise<PreparedTransactionData>;
|
|
16
|
+
signTransaction: (preparedTransaction: PreparedTransactionData) => Promise<SignedTransactionData>;
|
|
17
|
+
submitTransaction: (signedTransaction: SignedTransactionData) => Promise<TransactionResult>;
|
|
13
18
|
sendTransaction: (transaction: Transaction) => Promise<TransactionResult>;
|
|
14
|
-
waitForExecution: (result: TransactionResult, acceptsPreconfirmations?: boolean) => Promise<
|
|
19
|
+
waitForExecution: (result: TransactionResult, acceptsPreconfirmations?: boolean) => Promise<{
|
|
15
20
|
actualGasCost: bigint;
|
|
16
21
|
actualGasUsed: bigint;
|
|
17
22
|
entryPoint: Address;
|
|
@@ -23,11 +28,11 @@ declare function createRhinestoneAccount(config: RhinestoneAccountConfig): Promi
|
|
|
23
28
|
sender: Address;
|
|
24
29
|
success: boolean;
|
|
25
30
|
userOpHash: import("viem").Hash;
|
|
26
|
-
}>;
|
|
31
|
+
} | import("./orchestrator").BundleResult>;
|
|
27
32
|
getAddress: () => `0x${string}`;
|
|
28
33
|
getPortfolio: (onTestnets?: boolean) => Promise<import("./orchestrator").UserTokenBalance[]>;
|
|
29
34
|
getMaxSpendableAmount: (chain: Chain, tokenAddress: Address, gasUnits: bigint) => Promise<bigint>;
|
|
30
35
|
}>;
|
|
31
36
|
export { createRhinestoneAccount };
|
|
32
|
-
export type { BundleStatus, Session, Call, Execution, MetaIntent, MultiChainCompact, PostOrderBundleResult, SignedMultiChainCompact, };
|
|
37
|
+
export type { BundleStatus, Session, Call, Execution, MetaIntent, MultiChainCompact, PostOrderBundleResult, SignedMultiChainCompact, BundleData, PreparedTransactionData, SignedTransactionData, TransactionResult, };
|
|
33
38
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAK1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAOpD,OAAO,EACL,UAAU,EACV,uBAAuB,EAEvB,qBAAqB,EAGtB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EACV,IAAI,EACJ,SAAS,EACT,uBAAuB,EACvB,OAAO,EACP,WAAW,EACZ,MAAM,SAAS,CAAA;AAEhB;;;;;GAKG;AACH,iBAAe,uBAAuB,CAAC,MAAM,EAAE,uBAAuB;;oBAC7C,KAAK,YAAY,OAAO;sCAIN,WAAW;2CAIN,uBAAuB;2CAIvB,qBAAqB;mCAS7B,WAAW;+BAWvC,iBAAiB;;;;;;;;;;;;;;;mCA+BlB,KAAK,gBACE,OAAO,YACX,MAAM;GAiBnB;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAA;AAClC,YAAY,EACV,YAAY,EACZ,OAAO,EACP,IAAI,EACJ,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,UAAU,EACV,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,GAClB,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createRhinestoneAccount = createRhinestoneAccount;
|
|
4
4
|
const accounts_1 = require("./accounts");
|
|
5
5
|
const execution_1 = require("./execution");
|
|
6
|
+
const utils_1 = require("./execution/utils");
|
|
6
7
|
/**
|
|
7
8
|
* Initialize a Rhinestone account
|
|
8
9
|
* Note: accounts are deployed onchain only when the first transaction is sent.
|
|
@@ -10,6 +11,18 @@ const execution_1 = require("./execution");
|
|
|
10
11
|
* @returns account
|
|
11
12
|
*/
|
|
12
13
|
async function createRhinestoneAccount(config) {
|
|
14
|
+
function deploy(chain, session) {
|
|
15
|
+
return (0, accounts_1.deploy)(config, chain, session);
|
|
16
|
+
}
|
|
17
|
+
function prepareTransaction(transaction) {
|
|
18
|
+
return (0, utils_1.prepareTransaction)(config, transaction);
|
|
19
|
+
}
|
|
20
|
+
function signTransaction(preparedTransaction) {
|
|
21
|
+
return (0, utils_1.signTransaction)(config, preparedTransaction);
|
|
22
|
+
}
|
|
23
|
+
function submitTransaction(signedTransaction) {
|
|
24
|
+
return (0, utils_1.submitTransaction)(config, signedTransaction);
|
|
25
|
+
}
|
|
13
26
|
/**
|
|
14
27
|
* Sign and send a transaction
|
|
15
28
|
* @param transaction Transaction to send
|
|
@@ -54,6 +67,10 @@ async function createRhinestoneAccount(config) {
|
|
|
54
67
|
}
|
|
55
68
|
return {
|
|
56
69
|
config,
|
|
70
|
+
deploy,
|
|
71
|
+
prepareTransaction,
|
|
72
|
+
signTransaction,
|
|
73
|
+
submitTransaction,
|
|
57
74
|
sendTransaction,
|
|
58
75
|
waitForExecution,
|
|
59
76
|
getAddress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,GAAG,EAGT,MAAM,MAAM,CAAA;AAcb,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC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AW,EAAE,CAkB1D;AAmBD,iBAAS,2BAA2B;;EAInC;AAED,OAAO,EACL,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,uBAAuB,EACvB,2BAA2B,GAC5B,CAAA"}
|
|
@@ -90,6 +90,43 @@ function getUsdcAddress(chain) {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
function getUsdtAddress(chain) {
|
|
94
|
+
switch (chain.id) {
|
|
95
|
+
case chains_1.mainnet.id: {
|
|
96
|
+
return '0xdAC17F958D2ee523a2206206994597C13D831ec7';
|
|
97
|
+
}
|
|
98
|
+
case chains_1.sepolia.id: {
|
|
99
|
+
return '0xaA8E23Fb1079EA71e0a56f48a2aA51851D8433D0';
|
|
100
|
+
}
|
|
101
|
+
case chains_1.base.id: {
|
|
102
|
+
return '0x2d1aDB45Bb1d7D2556c6558aDb76CFD4F9F4ed16';
|
|
103
|
+
}
|
|
104
|
+
case chains_1.baseSepolia.id: {
|
|
105
|
+
return '0xd7e9C75C6C05FdE929cAc19bb887892de78819B7';
|
|
106
|
+
}
|
|
107
|
+
case chains_1.arbitrum.id: {
|
|
108
|
+
return '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9';
|
|
109
|
+
}
|
|
110
|
+
case chains_1.arbitrumSepolia.id: {
|
|
111
|
+
return '0xe5B6C29411B3Ad31c3613Bba0145293fC9957256';
|
|
112
|
+
}
|
|
113
|
+
case chains_1.optimism.id: {
|
|
114
|
+
return '0x94b008aa00579c1307b0ef2c499ad98a8ce58e58';
|
|
115
|
+
}
|
|
116
|
+
case chains_1.optimismSepolia.id: {
|
|
117
|
+
return '0x4bA3A5ab2EC0C9C45F153374fbcb05a1526c4a01';
|
|
118
|
+
}
|
|
119
|
+
case chains_1.polygon.id: {
|
|
120
|
+
return '0xc2132D05D31c914a87C6611C10748AEb04B58e8F';
|
|
121
|
+
}
|
|
122
|
+
case chains_1.polygonAmoy.id: {
|
|
123
|
+
return '0x079862edc450F5f3A6f3A358757eFfF0139A059f';
|
|
124
|
+
}
|
|
125
|
+
default: {
|
|
126
|
+
throw new Error(`Unsupported chain ${chain.id}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
93
130
|
function getTokenRootBalanceSlot(chain, tokenAddress) {
|
|
94
131
|
switch (chain.id) {
|
|
95
132
|
case chains_1.mainnet.id: {
|
|
@@ -105,6 +142,10 @@ function getTokenRootBalanceSlot(chain, tokenAddress) {
|
|
|
105
142
|
if (tokenAddress === '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2') {
|
|
106
143
|
return 3n;
|
|
107
144
|
}
|
|
145
|
+
// USDT
|
|
146
|
+
if (tokenAddress === '0xdAC17F958D2ee523a2206206994597C13D831ec7') {
|
|
147
|
+
return 2n;
|
|
148
|
+
}
|
|
108
149
|
break;
|
|
109
150
|
}
|
|
110
151
|
case chains_1.sepolia.id: {
|
|
@@ -120,6 +161,10 @@ function getTokenRootBalanceSlot(chain, tokenAddress) {
|
|
|
120
161
|
if (tokenAddress === '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14') {
|
|
121
162
|
return 3n;
|
|
122
163
|
}
|
|
164
|
+
// USDT
|
|
165
|
+
if (tokenAddress === '0xaA8E23Fb1079EA71e0a56f48a2aA51851D8433D0') {
|
|
166
|
+
return 0n;
|
|
167
|
+
}
|
|
123
168
|
break;
|
|
124
169
|
}
|
|
125
170
|
case chains_1.base.id: {
|
|
@@ -135,6 +180,10 @@ function getTokenRootBalanceSlot(chain, tokenAddress) {
|
|
|
135
180
|
if (tokenAddress === '0x4200000000000000000000000000000000000006') {
|
|
136
181
|
return 3n;
|
|
137
182
|
}
|
|
183
|
+
// USDT
|
|
184
|
+
if (tokenAddress === '0x2d1aDB45Bb1d7D2556c6558aDb76CFD4F9F4ed16') {
|
|
185
|
+
return 0n;
|
|
186
|
+
}
|
|
138
187
|
break;
|
|
139
188
|
}
|
|
140
189
|
case chains_1.baseSepolia.id: {
|
|
@@ -150,6 +199,10 @@ function getTokenRootBalanceSlot(chain, tokenAddress) {
|
|
|
150
199
|
if (tokenAddress === '0x4200000000000000000000000000000000000006') {
|
|
151
200
|
return 3n;
|
|
152
201
|
}
|
|
202
|
+
// USDT
|
|
203
|
+
if (tokenAddress === '0xd7e9C75C6C05FdE929cAc19bb887892de78819B7') {
|
|
204
|
+
return 0n;
|
|
205
|
+
}
|
|
153
206
|
break;
|
|
154
207
|
}
|
|
155
208
|
case chains_1.arbitrum.id: {
|
|
@@ -165,6 +218,10 @@ function getTokenRootBalanceSlot(chain, tokenAddress) {
|
|
|
165
218
|
if (tokenAddress === '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1') {
|
|
166
219
|
return 51n;
|
|
167
220
|
}
|
|
221
|
+
// USDT
|
|
222
|
+
if (tokenAddress === '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9') {
|
|
223
|
+
return 51n;
|
|
224
|
+
}
|
|
168
225
|
break;
|
|
169
226
|
}
|
|
170
227
|
case chains_1.arbitrumSepolia.id: {
|
|
@@ -180,6 +237,10 @@ function getTokenRootBalanceSlot(chain, tokenAddress) {
|
|
|
180
237
|
if (tokenAddress === '0x980B62Da83eFf3D4576C647993b0c1D7faf17c73') {
|
|
181
238
|
return 51n;
|
|
182
239
|
}
|
|
240
|
+
// USDT
|
|
241
|
+
if (tokenAddress === '0xe5B6C29411B3Ad31c3613Bba0145293fC9957256') {
|
|
242
|
+
return 51n;
|
|
243
|
+
}
|
|
183
244
|
break;
|
|
184
245
|
}
|
|
185
246
|
case chains_1.optimism.id: {
|
|
@@ -195,6 +256,10 @@ function getTokenRootBalanceSlot(chain, tokenAddress) {
|
|
|
195
256
|
if (tokenAddress === '0x4200000000000000000000000000000000000006') {
|
|
196
257
|
return 3n;
|
|
197
258
|
}
|
|
259
|
+
// USDT
|
|
260
|
+
if (tokenAddress === '0x94b008aa00579c1307b0ef2c499ad98a8ce58e58') {
|
|
261
|
+
return 0n;
|
|
262
|
+
}
|
|
198
263
|
break;
|
|
199
264
|
}
|
|
200
265
|
case chains_1.optimismSepolia.id: {
|
|
@@ -210,6 +275,10 @@ function getTokenRootBalanceSlot(chain, tokenAddress) {
|
|
|
210
275
|
if (tokenAddress === '0x4200000000000000000000000000000000000006') {
|
|
211
276
|
return 3n;
|
|
212
277
|
}
|
|
278
|
+
// USDT
|
|
279
|
+
if (tokenAddress === '0x4bA3A5ab2EC0C9C45F153374fbcb05a1526c4a01') {
|
|
280
|
+
return 0n;
|
|
281
|
+
}
|
|
213
282
|
break;
|
|
214
283
|
}
|
|
215
284
|
case chains_1.polygon.id: {
|
|
@@ -221,6 +290,10 @@ function getTokenRootBalanceSlot(chain, tokenAddress) {
|
|
|
221
290
|
if (tokenAddress === '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619') {
|
|
222
291
|
return 3n;
|
|
223
292
|
}
|
|
293
|
+
// USDT
|
|
294
|
+
if (tokenAddress === '0xc2132D05D31c914a87C6611C10748AEb04B58e8F') {
|
|
295
|
+
return 0n;
|
|
296
|
+
}
|
|
224
297
|
break;
|
|
225
298
|
}
|
|
226
299
|
case chains_1.polygonAmoy.id: {
|
|
@@ -232,6 +305,10 @@ function getTokenRootBalanceSlot(chain, tokenAddress) {
|
|
|
232
305
|
if (tokenAddress === '0x52eF3d68BaB452a294342DC3e5f464d7f610f72E') {
|
|
233
306
|
return 3n;
|
|
234
307
|
}
|
|
308
|
+
// USDT
|
|
309
|
+
if (tokenAddress === '0x079862edc450F5f3A6f3A358757eFfF0139A059f') {
|
|
310
|
+
return 0n;
|
|
311
|
+
}
|
|
235
312
|
break;
|
|
236
313
|
}
|
|
237
314
|
}
|
|
@@ -288,6 +365,9 @@ function getTokenAddress(tokenSymbol, chainId) {
|
|
|
288
365
|
if (tokenSymbol === 'USDC') {
|
|
289
366
|
return getUsdcAddress(chain);
|
|
290
367
|
}
|
|
368
|
+
if (tokenSymbol === 'USDT') {
|
|
369
|
+
return getUsdtAddress(chain);
|
|
370
|
+
}
|
|
291
371
|
throw new Error(`Unsupported token symbol ${tokenSymbol}`);
|
|
292
372
|
}
|
|
293
373
|
function getChainById(chainId) {
|
|
@@ -347,7 +427,7 @@ function getSupportedTokens(chainId) {
|
|
|
347
427
|
});
|
|
348
428
|
}
|
|
349
429
|
function getKnownSymbols() {
|
|
350
|
-
return ['ETH', 'WETH', 'USDC'];
|
|
430
|
+
return ['ETH', 'WETH', 'USDC', 'USDT'];
|
|
351
431
|
}
|
|
352
432
|
function getTokenDecimals(symbol) {
|
|
353
433
|
switch (symbol) {
|
|
@@ -355,6 +435,7 @@ function getTokenDecimals(symbol) {
|
|
|
355
435
|
case 'WETH':
|
|
356
436
|
return 18;
|
|
357
437
|
case 'USDC':
|
|
438
|
+
case 'USDT':
|
|
358
439
|
return 6;
|
|
359
440
|
default:
|
|
360
441
|
throw new Error(`Symbol not supported: ${symbol}`);
|
|
@@ -6,7 +6,7 @@ type SupportedMainnet = typeof mainnet.id | typeof base.id | typeof arbitrum.id
|
|
|
6
6
|
type SupportedOPStackMainnet = typeof optimism.id | typeof base.id;
|
|
7
7
|
type SupportedOPStackTestnet = typeof optimismSepolia.id | typeof baseSepolia.id;
|
|
8
8
|
type SupportedChain = SupportedMainnet | SupportedTestnet;
|
|
9
|
-
type SupportedTokenSymbol = 'ETH' | 'WETH' | 'USDC';
|
|
9
|
+
type SupportedTokenSymbol = 'ETH' | 'WETH' | 'USDC' | 'USDT';
|
|
10
10
|
type SupportedToken = SupportedTokenSymbol | Address;
|
|
11
11
|
type BundleStatus = typeof BUNDLE_STATUS_PENDING | typeof BUNDLE_STATUS_EXPIRED | typeof BUNDLE_STATUS_PARTIALLY_COMPLETED | typeof BUNDLE_STATUS_COMPLETED | typeof BUNDLE_STATUS_FILLED | typeof BUNDLE_STATUS_PRECONFIRMED | typeof BUNDLE_STATUS_FAILED | typeof BUNDLE_STATUS_UNKNOWN;
|
|
12
12
|
type AccountAccessListLegacy = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../orchestrator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,OAAO,EACR,MAAM,aAAa,CAAA;AAEpB,KAAK,gBAAgB,GACjB,OAAO,OAAO,CAAC,EAAE,GACjB,OAAO,WAAW,CAAC,EAAE,GACrB,OAAO,eAAe,CAAC,EAAE,GACzB,OAAO,eAAe,CAAC,EAAE,GACzB,OAAO,WAAW,CAAC,EAAE,CAAA;AACzB,KAAK,gBAAgB,GACjB,OAAO,OAAO,CAAC,EAAE,GACjB,OAAO,IAAI,CAAC,EAAE,GACd,OAAO,QAAQ,CAAC,EAAE,GAClB,OAAO,QAAQ,CAAC,EAAE,GAClB,OAAO,OAAO,CAAC,EAAE,CAAA;AACrB,KAAK,uBAAuB,GAAG,OAAO,QAAQ,CAAC,EAAE,GAAG,OAAO,IAAI,CAAC,EAAE,CAAA;AAClE,KAAK,uBAAuB,GAAG,OAAO,eAAe,CAAC,EAAE,GAAG,OAAO,WAAW,CAAC,EAAE,CAAA;AAChF,KAAK,cAAc,GAAG,gBAAgB,GAAG,gBAAgB,CAAA;AACzD,KAAK,oBAAoB,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../orchestrator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,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