@rhinestone/sdk 0.7.10 → 0.8.0
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 → accounts}/index.d.ts +2 -2
- package/dist/accounts/index.d.ts.map +1 -0
- package/dist/{src/accounts → accounts}/index.js +55 -45
- package/dist/accounts/nexus.d.ts.map +1 -0
- package/dist/{src/accounts → accounts}/nexus.js +48 -42
- package/dist/accounts/safe.d.ts.map +1 -0
- package/dist/{src/accounts → accounts}/safe.js +35 -29
- package/dist/accounts/utils.d.ts.map +1 -0
- package/dist/{src/accounts → accounts}/utils.js +23 -19
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/{src/execution → execution}/index.js +66 -61
- package/dist/execution/smart-session.d.ts.map +1 -0
- package/dist/execution/smart-session.js +85 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/{src/index.js → index.js} +10 -8
- package/dist/modules/abi/smart-sessions.d.ts.map +1 -0
- package/dist/modules/common.d.ts.map +1 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/omni-account.d.ts.map +1 -0
- package/dist/modules/validators/core.d.ts.map +1 -0
- package/dist/modules/validators/index.d.ts.map +1 -0
- package/dist/modules/validators/smart-sessions.d.ts.map +1 -0
- package/dist/orchestrator/client.d.ts.map +1 -0
- package/dist/orchestrator/consts.d.ts.map +1 -0
- package/dist/orchestrator/error.d.ts.map +1 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/registry.d.ts.map +1 -0
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/orchestrator/utils.d.ts.map +1 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +13 -13
- package/dist/cjs/modules/abi/smart-sessions.d.ts.map +0 -1
- package/dist/cjs/modules/common.d.ts.map +0 -1
- package/dist/cjs/modules/index.d.ts.map +0 -1
- package/dist/cjs/modules/omni-account.d.ts.map +0 -1
- package/dist/cjs/modules/validators/core.d.ts.map +0 -1
- package/dist/cjs/modules/validators/index.d.ts.map +0 -1
- package/dist/cjs/modules/validators/smart-sessions.d.ts.map +0 -1
- package/dist/cjs/orchestrator/client.d.ts.map +0 -1
- package/dist/cjs/orchestrator/consts.d.ts.map +0 -1
- package/dist/cjs/orchestrator/error.d.ts.map +0 -1
- package/dist/cjs/orchestrator/index.d.ts.map +0 -1
- package/dist/cjs/orchestrator/registry.d.ts.map +0 -1
- package/dist/cjs/orchestrator/types.d.ts.map +0 -1
- package/dist/cjs/orchestrator/utils.d.ts.map +0 -1
- package/dist/cjs/types.d.ts.map +0 -1
- package/dist/src/accounts/index.d.ts.map +0 -1
- package/dist/src/accounts/nexus.d.ts.map +0 -1
- package/dist/src/accounts/safe.d.ts.map +0 -1
- package/dist/src/accounts/utils.d.ts.map +0 -1
- package/dist/src/execution/index.d.ts.map +0 -1
- package/dist/src/execution/smart-session.d.ts.map +0 -1
- package/dist/src/execution/smart-session.js +0 -81
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/modules/abi/smart-sessions.d.ts +0 -42
- package/dist/src/modules/abi/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/abi/smart-sessions.js +0 -128
- package/dist/src/modules/common.d.ts +0 -16
- package/dist/src/modules/common.d.ts.map +0 -1
- package/dist/src/modules/common.js +0 -5
- package/dist/src/modules/index.d.ts +0 -33
- package/dist/src/modules/index.d.ts.map +0 -1
- package/dist/src/modules/index.js +0 -146
- package/dist/src/modules/omni-account.d.ts +0 -9
- package/dist/src/modules/omni-account.d.ts.map +0 -1
- package/dist/src/modules/omni-account.js +0 -7
- package/dist/src/modules/validators/core.d.ts +0 -23
- package/dist/src/modules/validators/core.d.ts.map +0 -1
- package/dist/src/modules/validators/core.js +0 -112
- package/dist/src/modules/validators/index.d.ts +0 -4
- package/dist/src/modules/validators/index.d.ts.map +0 -1
- package/dist/src/modules/validators/index.js +0 -3
- package/dist/src/modules/validators/smart-sessions.d.ts +0 -29
- package/dist/src/modules/validators/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/validators/smart-sessions.js +0 -414
- package/dist/src/orchestrator/client.d.ts +0 -29
- package/dist/src/orchestrator/client.d.ts.map +0 -1
- package/dist/src/orchestrator/client.js +0 -243
- package/dist/src/orchestrator/consts.d.ts +0 -5
- package/dist/src/orchestrator/consts.d.ts.map +0 -1
- package/dist/src/orchestrator/consts.js +0 -4
- package/dist/src/orchestrator/error.d.ts +0 -18
- package/dist/src/orchestrator/error.d.ts.map +0 -1
- package/dist/src/orchestrator/error.js +0 -28
- package/dist/src/orchestrator/index.d.ts +0 -11
- package/dist/src/orchestrator/index.d.ts.map +0 -1
- package/dist/src/orchestrator/index.js +0 -10
- package/dist/src/orchestrator/registry.d.ts +0 -17
- package/dist/src/orchestrator/registry.d.ts.map +0 -1
- package/dist/src/orchestrator/registry.js +0 -344
- package/dist/src/orchestrator/types.d.ts +0 -222
- package/dist/src/orchestrator/types.d.ts.map +0 -1
- package/dist/src/orchestrator/types.js +0 -9
- package/dist/src/orchestrator/utils.d.ts +0 -29
- package/dist/src/orchestrator/utils.d.ts.map +0 -1
- package/dist/src/orchestrator/utils.js +0 -303
- package/dist/src/types.d.ts +0 -113
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -1
- package/dist/test/modules/validators/smart-sessions.test.d.ts +0 -2
- package/dist/test/modules/validators/smart-sessions.test.d.ts.map +0 -1
- package/dist/test/modules/validators/smart-sessions.test.js +0 -20
- /package/dist/{src/accounts → accounts}/nexus.d.ts +0 -0
- /package/dist/{src/accounts → accounts}/safe.d.ts +0 -0
- /package/dist/{src/accounts → accounts}/utils.d.ts +0 -0
- /package/dist/{src/execution → execution}/index.d.ts +0 -0
- /package/dist/{src/execution → execution}/smart-session.d.ts +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{cjs/modules → modules}/abi/smart-sessions.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/abi/smart-sessions.js +0 -0
- /package/dist/{cjs/modules → modules}/common.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/common.js +0 -0
- /package/dist/{cjs/modules → modules}/index.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/index.js +0 -0
- /package/dist/{cjs/modules → modules}/omni-account.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/omni-account.js +0 -0
- /package/dist/{cjs/modules → modules}/validators/core.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/validators/core.js +0 -0
- /package/dist/{cjs/modules → modules}/validators/index.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/validators/index.js +0 -0
- /package/dist/{cjs/modules → modules}/validators/smart-sessions.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/validators/smart-sessions.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/client.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/client.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/consts.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/consts.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/error.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/error.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/index.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/index.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/registry.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/registry.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/types.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/types.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/utils.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/utils.js +0 -0
- /package/dist/{cjs/types.d.ts → types.d.ts} +0 -0
- /package/dist/{cjs/types.js → types.js} +0 -0
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
import { encodeAbiParameters, keccak256, zeroAddress, } from 'viem';
|
|
2
|
-
import { arbitrum, arbitrumSepolia, base, baseSepolia, mainnet, optimism, optimismSepolia, polygon, polygonAmoy, sepolia, } from 'viem/chains';
|
|
3
|
-
function getWethAddress(chain) {
|
|
4
|
-
switch (chain.id) {
|
|
5
|
-
case mainnet.id: {
|
|
6
|
-
return '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2';
|
|
7
|
-
}
|
|
8
|
-
case sepolia.id: {
|
|
9
|
-
return '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14';
|
|
10
|
-
}
|
|
11
|
-
case base.id: {
|
|
12
|
-
return '0x4200000000000000000000000000000000000006';
|
|
13
|
-
}
|
|
14
|
-
case baseSepolia.id: {
|
|
15
|
-
return '0x4200000000000000000000000000000000000006';
|
|
16
|
-
}
|
|
17
|
-
case arbitrum.id: {
|
|
18
|
-
return '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1';
|
|
19
|
-
}
|
|
20
|
-
case arbitrumSepolia.id: {
|
|
21
|
-
return '0x980B62Da83eFf3D4576C647993b0c1D7faf17c73';
|
|
22
|
-
}
|
|
23
|
-
case optimism.id: {
|
|
24
|
-
return '0x4200000000000000000000000000000000000006';
|
|
25
|
-
}
|
|
26
|
-
case optimismSepolia.id: {
|
|
27
|
-
return '0x4200000000000000000000000000000000000006';
|
|
28
|
-
}
|
|
29
|
-
case polygon.id: {
|
|
30
|
-
return '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619';
|
|
31
|
-
}
|
|
32
|
-
case polygonAmoy.id: {
|
|
33
|
-
return '0x52eF3d68BaB452a294342DC3e5f464d7f610f72E';
|
|
34
|
-
}
|
|
35
|
-
default: {
|
|
36
|
-
throw new Error(`Unsupported chain ${chain.id}`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function getUsdcAddress(chain) {
|
|
41
|
-
switch (chain.id) {
|
|
42
|
-
case mainnet.id: {
|
|
43
|
-
return '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48';
|
|
44
|
-
}
|
|
45
|
-
case sepolia.id: {
|
|
46
|
-
return '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238';
|
|
47
|
-
}
|
|
48
|
-
case base.id: {
|
|
49
|
-
return '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';
|
|
50
|
-
}
|
|
51
|
-
case baseSepolia.id: {
|
|
52
|
-
return '0x036CbD53842c5426634e7929541eC2318f3dCF7e';
|
|
53
|
-
}
|
|
54
|
-
case arbitrum.id: {
|
|
55
|
-
return '0xaf88d065e77c8cC2239327C5EDb3A432268e5831';
|
|
56
|
-
}
|
|
57
|
-
case arbitrumSepolia.id: {
|
|
58
|
-
return '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d';
|
|
59
|
-
}
|
|
60
|
-
case optimism.id: {
|
|
61
|
-
return '0x0b2c639c533813f4aa9d7837caf62653d097ff85';
|
|
62
|
-
}
|
|
63
|
-
case optimismSepolia.id: {
|
|
64
|
-
return '0x5fd84259d66Cd46123540766Be93DFE6D43130D7';
|
|
65
|
-
}
|
|
66
|
-
case polygon.id: {
|
|
67
|
-
return '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359';
|
|
68
|
-
}
|
|
69
|
-
case polygonAmoy.id: {
|
|
70
|
-
return '0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582';
|
|
71
|
-
}
|
|
72
|
-
default: {
|
|
73
|
-
throw new Error(`Unsupported chain ${chain.id}`);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function getTokenRootBalanceSlot(chain, tokenAddress) {
|
|
78
|
-
switch (chain.id) {
|
|
79
|
-
case mainnet.id: {
|
|
80
|
-
// ETH
|
|
81
|
-
if (tokenAddress === zeroAddress) {
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
// USDC
|
|
85
|
-
if (tokenAddress === '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') {
|
|
86
|
-
return 9n;
|
|
87
|
-
}
|
|
88
|
-
// WETH
|
|
89
|
-
if (tokenAddress === '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2') {
|
|
90
|
-
return 3n;
|
|
91
|
-
}
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
case sepolia.id: {
|
|
95
|
-
// ETH
|
|
96
|
-
if (tokenAddress === zeroAddress) {
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
// USDC
|
|
100
|
-
if (tokenAddress === '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238') {
|
|
101
|
-
return 9n;
|
|
102
|
-
}
|
|
103
|
-
// WETH
|
|
104
|
-
if (tokenAddress === '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14') {
|
|
105
|
-
return 3n;
|
|
106
|
-
}
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
case base.id: {
|
|
110
|
-
// ETH
|
|
111
|
-
if (tokenAddress === zeroAddress) {
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
// USDC
|
|
115
|
-
if (tokenAddress === '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913') {
|
|
116
|
-
return 9n;
|
|
117
|
-
}
|
|
118
|
-
// WETH
|
|
119
|
-
if (tokenAddress === '0x4200000000000000000000000000000000000006') {
|
|
120
|
-
return 3n;
|
|
121
|
-
}
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
case baseSepolia.id: {
|
|
125
|
-
// ETH
|
|
126
|
-
if (tokenAddress === zeroAddress) {
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
// USDC
|
|
130
|
-
if (tokenAddress === '0x036CbD53842c5426634e7929541eC2318f3dCF7e') {
|
|
131
|
-
return 9n;
|
|
132
|
-
}
|
|
133
|
-
// WETH
|
|
134
|
-
if (tokenAddress === '0x4200000000000000000000000000000000000006') {
|
|
135
|
-
return 3n;
|
|
136
|
-
}
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
case arbitrum.id: {
|
|
140
|
-
// ETH
|
|
141
|
-
if (tokenAddress === zeroAddress) {
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
// USDC
|
|
145
|
-
if (tokenAddress === '0xaf88d065e77c8cC2239327C5EDb3A432268e5831') {
|
|
146
|
-
return 9n;
|
|
147
|
-
}
|
|
148
|
-
// WETH
|
|
149
|
-
if (tokenAddress === '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1') {
|
|
150
|
-
return 51n;
|
|
151
|
-
}
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
case arbitrumSepolia.id: {
|
|
155
|
-
// ETH
|
|
156
|
-
if (tokenAddress === zeroAddress) {
|
|
157
|
-
return null;
|
|
158
|
-
}
|
|
159
|
-
// USDC
|
|
160
|
-
if (tokenAddress === '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d') {
|
|
161
|
-
return 9n;
|
|
162
|
-
}
|
|
163
|
-
// WETH
|
|
164
|
-
if (tokenAddress === '0x980B62Da83eFf3D4576C647993b0c1D7faf17c73') {
|
|
165
|
-
return 51n;
|
|
166
|
-
}
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
case optimism.id: {
|
|
170
|
-
// ETH
|
|
171
|
-
if (tokenAddress === zeroAddress) {
|
|
172
|
-
return null;
|
|
173
|
-
}
|
|
174
|
-
// USDC
|
|
175
|
-
if (tokenAddress === '0x0b2c639c533813f4aa9d7837caf62653d097ff85') {
|
|
176
|
-
return 9n;
|
|
177
|
-
}
|
|
178
|
-
// WETH
|
|
179
|
-
if (tokenAddress === '0x4200000000000000000000000000000000000006') {
|
|
180
|
-
return 3n;
|
|
181
|
-
}
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
case optimismSepolia.id: {
|
|
185
|
-
// ETH
|
|
186
|
-
if (tokenAddress === zeroAddress) {
|
|
187
|
-
return null;
|
|
188
|
-
}
|
|
189
|
-
// USDC
|
|
190
|
-
if (tokenAddress === '0x5fd84259d66Cd46123540766Be93DFE6D43130D7') {
|
|
191
|
-
return 9n;
|
|
192
|
-
}
|
|
193
|
-
// WETH
|
|
194
|
-
if (tokenAddress === '0x4200000000000000000000000000000000000006') {
|
|
195
|
-
return 3n;
|
|
196
|
-
}
|
|
197
|
-
break;
|
|
198
|
-
}
|
|
199
|
-
case polygon.id: {
|
|
200
|
-
// USDC
|
|
201
|
-
if (tokenAddress === '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359') {
|
|
202
|
-
return 9n;
|
|
203
|
-
}
|
|
204
|
-
// WETH
|
|
205
|
-
if (tokenAddress === '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619') {
|
|
206
|
-
return 3n;
|
|
207
|
-
}
|
|
208
|
-
break;
|
|
209
|
-
}
|
|
210
|
-
case polygonAmoy.id: {
|
|
211
|
-
// USDC
|
|
212
|
-
if (tokenAddress === '0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582') {
|
|
213
|
-
return 9n;
|
|
214
|
-
}
|
|
215
|
-
// WETH
|
|
216
|
-
if (tokenAddress === '0x52eF3d68BaB452a294342DC3e5f464d7f610f72E') {
|
|
217
|
-
return 3n;
|
|
218
|
-
}
|
|
219
|
-
break;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
throw new Error(`Unsupported token address ${tokenAddress} for chain ${chain.id}`);
|
|
223
|
-
}
|
|
224
|
-
function getTokenBalanceSlot(tokenSymbol, chainId, accountAddress) {
|
|
225
|
-
const tokenAddress = getTokenAddress(tokenSymbol, chainId);
|
|
226
|
-
const chain = getChainById(chainId);
|
|
227
|
-
if (!chain) {
|
|
228
|
-
throw new Error(`Unsupported chain: ${chainId}`);
|
|
229
|
-
}
|
|
230
|
-
const rootBalanceSlot = getTokenRootBalanceSlot(chain, tokenAddress);
|
|
231
|
-
const balanceSlot = rootBalanceSlot
|
|
232
|
-
? keccak256(encodeAbiParameters([{ type: 'address' }, { type: 'uint256' }], [accountAddress, rootBalanceSlot]))
|
|
233
|
-
: '0x';
|
|
234
|
-
return balanceSlot;
|
|
235
|
-
}
|
|
236
|
-
function getHookAddress(_chainId) {
|
|
237
|
-
return '0x0000000000f6Ed8Be424d673c63eeFF8b9267420';
|
|
238
|
-
}
|
|
239
|
-
function getSameChainModuleAddress(_chainId) {
|
|
240
|
-
return '0x000000000043ff16d5776c7F0f65Ec485C17Ca04';
|
|
241
|
-
}
|
|
242
|
-
function getTargetModuleAddress(_chainId) {
|
|
243
|
-
return '0x0000000000E5a37279A001301A837a91b5de1D5E';
|
|
244
|
-
}
|
|
245
|
-
function getRhinestoneSpokePoolAddress(_chainId) {
|
|
246
|
-
return '0x000000000060f6e853447881951574CDd0663530';
|
|
247
|
-
}
|
|
248
|
-
function getTokenSymbol(tokenAddress, chainId) {
|
|
249
|
-
const knownSymbols = getKnownSymbols();
|
|
250
|
-
for (const symbol of knownSymbols) {
|
|
251
|
-
const address = getTokenAddress(symbol, chainId);
|
|
252
|
-
if (address.toLowerCase() === tokenAddress.toLowerCase()) {
|
|
253
|
-
return symbol;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
throw new Error(`Unsupported token address ${tokenAddress} for chain ${chainId}`);
|
|
257
|
-
}
|
|
258
|
-
function getTokenAddress(tokenSymbol, chainId) {
|
|
259
|
-
if (tokenSymbol === 'ETH') {
|
|
260
|
-
return zeroAddress;
|
|
261
|
-
}
|
|
262
|
-
const chain = getChainById(chainId);
|
|
263
|
-
if (!chain) {
|
|
264
|
-
throw new Error(`Unsupported chain ${chainId}`);
|
|
265
|
-
}
|
|
266
|
-
if (tokenSymbol === 'WETH') {
|
|
267
|
-
return getWethAddress(chain);
|
|
268
|
-
}
|
|
269
|
-
if (tokenSymbol === 'USDC') {
|
|
270
|
-
return getUsdcAddress(chain);
|
|
271
|
-
}
|
|
272
|
-
throw new Error(`Unsupported token symbol ${tokenSymbol}`);
|
|
273
|
-
}
|
|
274
|
-
function getChainById(chainId) {
|
|
275
|
-
const supportedChains = [
|
|
276
|
-
mainnet,
|
|
277
|
-
sepolia,
|
|
278
|
-
base,
|
|
279
|
-
baseSepolia,
|
|
280
|
-
arbitrum,
|
|
281
|
-
arbitrumSepolia,
|
|
282
|
-
optimism,
|
|
283
|
-
optimismSepolia,
|
|
284
|
-
polygon,
|
|
285
|
-
polygonAmoy,
|
|
286
|
-
];
|
|
287
|
-
for (const chain of supportedChains) {
|
|
288
|
-
if (chain.id === chainId) {
|
|
289
|
-
return chain;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
function isTestnet(chainId) {
|
|
294
|
-
const chain = getChainById(chainId);
|
|
295
|
-
if (!chain) {
|
|
296
|
-
throw new Error(`Chain not supported: ${chainId}`);
|
|
297
|
-
}
|
|
298
|
-
return chain.testnet ?? false;
|
|
299
|
-
}
|
|
300
|
-
function isTokenAddressSupported(address, chainId) {
|
|
301
|
-
const chain = getChainById(chainId);
|
|
302
|
-
if (!chain) {
|
|
303
|
-
throw new Error(`Chain not supported: ${chainId}`);
|
|
304
|
-
}
|
|
305
|
-
try {
|
|
306
|
-
getTokenSymbol(address, chainId);
|
|
307
|
-
return true;
|
|
308
|
-
}
|
|
309
|
-
catch {
|
|
310
|
-
return false;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
function getSupportedTokens(chainId) {
|
|
314
|
-
const chain = getChainById(chainId);
|
|
315
|
-
if (!chain) {
|
|
316
|
-
throw new Error(`Chain not supported: ${chainId}`);
|
|
317
|
-
}
|
|
318
|
-
const knownSymbols = getKnownSymbols();
|
|
319
|
-
return knownSymbols.map((symbol) => {
|
|
320
|
-
const decimals = getTokenDecimals(symbol);
|
|
321
|
-
const address = getTokenAddress(symbol, chainId);
|
|
322
|
-
return {
|
|
323
|
-
symbol,
|
|
324
|
-
address,
|
|
325
|
-
decimals,
|
|
326
|
-
balanceSlot: (accountAddress) => getTokenBalanceSlot(symbol, chainId, accountAddress),
|
|
327
|
-
};
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
function getKnownSymbols() {
|
|
331
|
-
return ['ETH', 'WETH', 'USDC'];
|
|
332
|
-
}
|
|
333
|
-
function getTokenDecimals(symbol) {
|
|
334
|
-
switch (symbol) {
|
|
335
|
-
case 'ETH':
|
|
336
|
-
case 'WETH':
|
|
337
|
-
return 18;
|
|
338
|
-
case 'USDC':
|
|
339
|
-
return 6;
|
|
340
|
-
default:
|
|
341
|
-
throw new Error(`Symbol not supported: ${symbol}`);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
export { getTokenSymbol, getTokenAddress, getTokenRootBalanceSlot, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getChainById, getSupportedTokens, isTestnet, isTokenAddressSupported, };
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex } from 'viem';
|
|
2
|
-
import type { UserOperation } from 'viem/account-abstraction';
|
|
3
|
-
import type { arbitrum, arbitrumSepolia, base, baseSepolia, mainnet, optimism, optimismSepolia, polygon, polygonAmoy, sepolia } from 'viem/chains';
|
|
4
|
-
type SupportedTestnet = typeof sepolia.id | typeof baseSepolia.id | typeof arbitrumSepolia.id | typeof optimismSepolia.id | typeof polygonAmoy.id;
|
|
5
|
-
type SupportedMainnet = typeof mainnet.id | typeof base.id | typeof arbitrum.id | typeof optimism.id | typeof polygon.id;
|
|
6
|
-
type SupportedChain = SupportedMainnet | SupportedTestnet;
|
|
7
|
-
type SupportedTokens = 'ETH' | 'WETH' | 'USDC';
|
|
8
|
-
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;
|
|
9
|
-
export type MappedChainTokenAccessList = {
|
|
10
|
-
chainTokens?: {
|
|
11
|
-
[chainId in SupportedChain]?: SupportedTokens[];
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export type UnmappedChainTokenAccessList = {
|
|
15
|
-
chainIds?: SupportedChain[];
|
|
16
|
-
tokens?: SupportedTokens[];
|
|
17
|
-
};
|
|
18
|
-
export type AccountAccessList = MappedChainTokenAccessList | UnmappedChainTokenAccessList;
|
|
19
|
-
type ClaimStatus = 'PENDING' | 'EXPIRED' | 'CLAIMED';
|
|
20
|
-
interface Claim {
|
|
21
|
-
depositId: bigint;
|
|
22
|
-
chainId: number;
|
|
23
|
-
status: ClaimStatus;
|
|
24
|
-
claimTimestamp?: number;
|
|
25
|
-
claimTransactionHash?: Hex;
|
|
26
|
-
}
|
|
27
|
-
interface Execution {
|
|
28
|
-
to: Address;
|
|
29
|
-
value: bigint;
|
|
30
|
-
data: Hex;
|
|
31
|
-
}
|
|
32
|
-
type SimulationResult = {
|
|
33
|
-
success: true;
|
|
34
|
-
} | {
|
|
35
|
-
success: false;
|
|
36
|
-
call: Execution;
|
|
37
|
-
details: {
|
|
38
|
-
message: string;
|
|
39
|
-
contractAddress: Address;
|
|
40
|
-
args: any[];
|
|
41
|
-
functionName: string;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
type PostOrderBundleResult = ({
|
|
45
|
-
bundleId: bigint;
|
|
46
|
-
status: typeof BUNDLE_STATUS_PENDING;
|
|
47
|
-
} | {
|
|
48
|
-
bundleId: bigint;
|
|
49
|
-
status: typeof BUNDLE_STATUS_FAILED;
|
|
50
|
-
error: SimulationResult;
|
|
51
|
-
})[];
|
|
52
|
-
interface BundleResult {
|
|
53
|
-
status: BundleStatus;
|
|
54
|
-
fillTimestamp?: number;
|
|
55
|
-
fillTransactionHash?: Hex;
|
|
56
|
-
claims: Claim[];
|
|
57
|
-
}
|
|
58
|
-
interface TokenTransfer {
|
|
59
|
-
tokenAddress: Address;
|
|
60
|
-
amount: bigint;
|
|
61
|
-
}
|
|
62
|
-
interface WithUserOp {
|
|
63
|
-
userOp: UserOperation;
|
|
64
|
-
targetExecutions?: never;
|
|
65
|
-
}
|
|
66
|
-
interface WithExecutions {
|
|
67
|
-
userOp?: never;
|
|
68
|
-
targetExecutions: Execution[];
|
|
69
|
-
}
|
|
70
|
-
interface WithoutOperation {
|
|
71
|
-
userOp?: never;
|
|
72
|
-
targetExecutions?: never;
|
|
73
|
-
}
|
|
74
|
-
type LockMode = 'HOOK' | 'COMPACT';
|
|
75
|
-
interface MetaIntentBase {
|
|
76
|
-
targetAccount: Address;
|
|
77
|
-
targetChainId: number;
|
|
78
|
-
targetGasUnits?: bigint;
|
|
79
|
-
tokenTransfers: TokenTransfer[];
|
|
80
|
-
accountAccessList?: {
|
|
81
|
-
chainId: number;
|
|
82
|
-
tokenAddress: Address;
|
|
83
|
-
}[];
|
|
84
|
-
lockMode?: LockMode;
|
|
85
|
-
omniLock?: boolean;
|
|
86
|
-
}
|
|
87
|
-
type OrderPath = {
|
|
88
|
-
orderBundle: MultiChainCompact;
|
|
89
|
-
injectedExecutions: Execution[];
|
|
90
|
-
intentCost: OrderCost;
|
|
91
|
-
}[];
|
|
92
|
-
type MetaIntentEmpty = MetaIntentBase & WithoutOperation;
|
|
93
|
-
type MetaIntentWithUserOp = MetaIntentBase & WithUserOp;
|
|
94
|
-
type MetaIntentWithExecutions = MetaIntentBase & WithExecutions;
|
|
95
|
-
type MetaIntent = MetaIntentEmpty | MetaIntentWithUserOp | MetaIntentWithExecutions;
|
|
96
|
-
type ChainExecution = Execution & {
|
|
97
|
-
chainId: number;
|
|
98
|
-
};
|
|
99
|
-
interface DepositEvent {
|
|
100
|
-
originClaimPayload: ChainExecution;
|
|
101
|
-
inputToken: Address;
|
|
102
|
-
outputToken: Address;
|
|
103
|
-
inputAmount: bigint;
|
|
104
|
-
outputAmount: bigint;
|
|
105
|
-
destinationChainId: number;
|
|
106
|
-
originChainId: number;
|
|
107
|
-
depositId: bigint;
|
|
108
|
-
quoteTimestamp: number;
|
|
109
|
-
fillDeadline: number;
|
|
110
|
-
exclusivityDeadline: number;
|
|
111
|
-
depositor: Address;
|
|
112
|
-
recipient: Address;
|
|
113
|
-
exclusiveRelayer: Address;
|
|
114
|
-
message: Hex;
|
|
115
|
-
}
|
|
116
|
-
interface BundleEvent {
|
|
117
|
-
bundleId: bigint;
|
|
118
|
-
type: string;
|
|
119
|
-
targetFillPayload: ChainExecution;
|
|
120
|
-
acrossDepositEvents: DepositEvent[];
|
|
121
|
-
}
|
|
122
|
-
interface Witness {
|
|
123
|
-
recipient: Address;
|
|
124
|
-
tokenOut: [bigint, bigint][];
|
|
125
|
-
depositId: bigint;
|
|
126
|
-
targetChain: bigint;
|
|
127
|
-
fillDeadline: number;
|
|
128
|
-
execs: Execution[];
|
|
129
|
-
userOpHash: Hex;
|
|
130
|
-
maxFeeBps: number;
|
|
131
|
-
}
|
|
132
|
-
interface Segment {
|
|
133
|
-
arbiter: Address;
|
|
134
|
-
chainId: bigint;
|
|
135
|
-
idsAndAmounts: [bigint, bigint][];
|
|
136
|
-
witness: Witness;
|
|
137
|
-
}
|
|
138
|
-
interface MultiChainCompact {
|
|
139
|
-
sponsor: Address;
|
|
140
|
-
nonce: bigint;
|
|
141
|
-
expires: bigint;
|
|
142
|
-
segments: Segment[];
|
|
143
|
-
}
|
|
144
|
-
interface SignedMultiChainCompact extends MultiChainCompact {
|
|
145
|
-
originSignatures: Hex[];
|
|
146
|
-
targetSignature: Hex;
|
|
147
|
-
}
|
|
148
|
-
interface UserTokenBalance {
|
|
149
|
-
tokenName: string;
|
|
150
|
-
tokenDecimals: number;
|
|
151
|
-
balance: bigint;
|
|
152
|
-
tokenChainBalance: {
|
|
153
|
-
chainId: number;
|
|
154
|
-
tokenAddress: Address;
|
|
155
|
-
balance: bigint;
|
|
156
|
-
}[];
|
|
157
|
-
}
|
|
158
|
-
interface UserChainBalances {
|
|
159
|
-
[chainId: number]: {
|
|
160
|
-
[tokenAddress: Address]: bigint;
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
interface OrderFeeInput {
|
|
164
|
-
targetChainId: number;
|
|
165
|
-
targetGasUnits?: bigint;
|
|
166
|
-
userOp?: {
|
|
167
|
-
callGasLimit: bigint;
|
|
168
|
-
verificationGasLimit: bigint;
|
|
169
|
-
preVerificationGas: bigint;
|
|
170
|
-
};
|
|
171
|
-
tokenTransfers: {
|
|
172
|
-
tokenAddress: Address;
|
|
173
|
-
amount?: bigint;
|
|
174
|
-
}[];
|
|
175
|
-
accountAccessList?: {
|
|
176
|
-
chainId: number;
|
|
177
|
-
tokenAddress: Address;
|
|
178
|
-
}[];
|
|
179
|
-
}
|
|
180
|
-
interface TokenFulfillmentStatus {
|
|
181
|
-
hasFulfilled: boolean;
|
|
182
|
-
tokenAddress: Address;
|
|
183
|
-
amountSpent: bigint;
|
|
184
|
-
targetAmount: bigint;
|
|
185
|
-
fee: bigint;
|
|
186
|
-
}
|
|
187
|
-
interface OrderCost {
|
|
188
|
-
hasFulfilledAll: true;
|
|
189
|
-
tokensSpent: UserChainBalances;
|
|
190
|
-
tokensReceived: TokenFulfillmentStatus[];
|
|
191
|
-
}
|
|
192
|
-
interface InsufficientBalanceResult {
|
|
193
|
-
hasFulfilledAll: false;
|
|
194
|
-
tokenShortfall: {
|
|
195
|
-
tokenAddress: Address;
|
|
196
|
-
targetAmount: bigint;
|
|
197
|
-
amountSpent: bigint;
|
|
198
|
-
fee: bigint;
|
|
199
|
-
tokenSymbol: string;
|
|
200
|
-
tokenDecimals: number;
|
|
201
|
-
}[];
|
|
202
|
-
totalTokenShortfallInUSD: bigint;
|
|
203
|
-
}
|
|
204
|
-
type OrderCostResult = OrderCost | InsufficientBalanceResult;
|
|
205
|
-
type TokenArrays6909 = readonly (readonly [bigint, bigint])[];
|
|
206
|
-
interface TokenConfig {
|
|
207
|
-
symbol: string;
|
|
208
|
-
address: Address;
|
|
209
|
-
decimals: number;
|
|
210
|
-
balanceSlot: (address: Address) => Hex;
|
|
211
|
-
}
|
|
212
|
-
declare const BUNDLE_STATUS_PENDING = "PENDING";
|
|
213
|
-
declare const BUNDLE_STATUS_FAILED = "FAILED";
|
|
214
|
-
declare const BUNDLE_STATUS_EXPIRED = "EXPIRED";
|
|
215
|
-
declare const BUNDLE_STATUS_PARTIALLY_COMPLETED = "PARTIALLY_COMPLETED";
|
|
216
|
-
declare const BUNDLE_STATUS_COMPLETED = "COMPLETED";
|
|
217
|
-
declare const BUNDLE_STATUS_FILLED = "FILLED";
|
|
218
|
-
declare const BUNDLE_STATUS_PRECONFIRMED = "PRECONFIRMED";
|
|
219
|
-
declare const BUNDLE_STATUS_UNKNOWN = "UNKNOWN";
|
|
220
|
-
export type { SupportedChain, BundleStatus, PostOrderBundleResult, MetaIntentEmpty, MetaIntentWithUserOp, MetaIntentWithExecutions, MetaIntent, TokenArrays6909, Execution, BundleResult, BundleEvent, Witness, Segment, MultiChainCompact, SignedMultiChainCompact, UserTokenBalance, OrderPath, UserChainBalances, OrderFeeInput, TokenFulfillmentStatus, OrderCost, InsufficientBalanceResult, OrderCostResult, TokenConfig, };
|
|
221
|
-
export { BUNDLE_STATUS_PENDING, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_PRECONFIRMED, BUNDLE_STATUS_UNKNOWN, };
|
|
222
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,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AAM,CAAC,CAAC,EAAE,CAAA;AAE7D,UAAU,WAAW;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,GAAG,CAAA;CACvC;AAED,QAAA,MAAM,qBAAqB,YAAY,CAAA;AACvC,QAAA,MAAM,oBAAoB,WAAW,CAAA;AACrC,QAAA,MAAM,qBAAqB,YAAY,CAAA;AACvC,QAAA,MAAM,iCAAiC,wBAAwB,CAAA;AAC/D,QAAA,MAAM,uBAAuB,cAAc,CAAA;AAC3C,QAAA,MAAM,oBAAoB,WAAW,CAAA;AACrC,QAAA,MAAM,0BAA0B,iBAAiB,CAAA;AACjD,QAAA,MAAM,qBAAqB,YAAY,CAAA;AAEvC,YAAY,EACV,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,UAAU,EACV,eAAe,EACf,SAAS,EACT,YAAY,EACZ,WAAW,EACX,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,SAAS,EACT,yBAAyB,EACzB,eAAe,EACf,WAAW,GACZ,CAAA;AACD,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,iCAAiC,EACjC,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,GACtB,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const BUNDLE_STATUS_PENDING = 'PENDING';
|
|
2
|
-
const BUNDLE_STATUS_FAILED = 'FAILED';
|
|
3
|
-
const BUNDLE_STATUS_EXPIRED = 'EXPIRED';
|
|
4
|
-
const BUNDLE_STATUS_PARTIALLY_COMPLETED = 'PARTIALLY_COMPLETED';
|
|
5
|
-
const BUNDLE_STATUS_COMPLETED = 'COMPLETED';
|
|
6
|
-
const BUNDLE_STATUS_FILLED = 'FILLED';
|
|
7
|
-
const BUNDLE_STATUS_PRECONFIRMED = 'PRECONFIRMED';
|
|
8
|
-
const BUNDLE_STATUS_UNKNOWN = 'UNKNOWN';
|
|
9
|
-
export { BUNDLE_STATUS_PENDING, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_PRECONFIRMED, BUNDLE_STATUS_UNKNOWN, };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type Hex } from 'viem';
|
|
2
|
-
import type { UserOperation } from 'viem/account-abstraction';
|
|
3
|
-
import { type BundleEvent, type Execution, type InsufficientBalanceResult, type MultiChainCompact, type OrderCost, type OrderCostResult, type UserChainBalances } from './types';
|
|
4
|
-
declare enum BundleStatusEnum {
|
|
5
|
-
PENDING = "PENDING",
|
|
6
|
-
EXPIRED = "EXPIRED",
|
|
7
|
-
PARTIALLY_COMPLETED = "PARTIALLY_COMPLETED",
|
|
8
|
-
PRECONFIRMED = "PRECONFIRMED",
|
|
9
|
-
COMPLETED = "COMPLETED",
|
|
10
|
-
FILLED = "FILLED",
|
|
11
|
-
FAILED = "FAILED",
|
|
12
|
-
UNKNOWN = "UNKNOWN"
|
|
13
|
-
}
|
|
14
|
-
declare function getEmptyUserOp(): UserOperation<'0.7'>;
|
|
15
|
-
declare function getOrderBundleHash(orderBundle: MultiChainCompact): Hex;
|
|
16
|
-
declare function convertBigIntFields(obj: any): any;
|
|
17
|
-
declare function parseCompactResponse(response: any): MultiChainCompact;
|
|
18
|
-
declare function parseUseChainBalances(response: any): UserChainBalances;
|
|
19
|
-
declare function parseOrderCost(response: any): OrderCost;
|
|
20
|
-
declare function parseInsufficientBalanceResult(response: any): InsufficientBalanceResult;
|
|
21
|
-
declare function parseOrderCostResult(response: any): OrderCostResult;
|
|
22
|
-
declare function parsePendingBundleEvent(response: any): BundleEvent;
|
|
23
|
-
declare function hashMultichainCompactWithoutDomainSeparator(multiChainCompact: MultiChainCompact): Hex;
|
|
24
|
-
declare function applyInjectedExecutions(orderPath: {
|
|
25
|
-
orderBundle: MultiChainCompact;
|
|
26
|
-
injectedExecutions: Execution[];
|
|
27
|
-
}): MultiChainCompact;
|
|
28
|
-
export { BundleStatusEnum, getEmptyUserOp, getOrderBundleHash, convertBigIntFields, parseCompactResponse, parsePendingBundleEvent, hashMultichainCompactWithoutDomainSeparator, parseUseChainBalances, parseOrderCost, parseInsufficientBalanceResult, parseOrderCostResult, applyInjectedExecutions, };
|
|
29
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../orchestrator/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,GAAG,EAIT,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAI7D,OAAO,EASL,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,eAAe,EAIpB,KAAK,iBAAiB,EAEvB,MAAM,SAAS,CAAA;AAWhB,aAAK,gBAAgB;IACnB,OAAO,YAAwB;IAC/B,OAAO,YAAwB;IAC/B,mBAAmB,wBAAoC;IACvD,YAAY,iBAA6B;IACzC,SAAS,cAA0B;IACnC,MAAM,WAAuB;IAC7B,MAAM,WAAuB;IAC7B,OAAO,YAAwB;CAChC;AAED,iBAAS,cAAc,IAAI,aAAa,CAAC,KAAK,CAAC,CAY9C;AAED,iBAAS,kBAAkB,CAAC,WAAW,EAAE,iBAAiB,GAAG,GAAG,CAM/D;AAED,iBAAS,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAwB1C;AAED,iBAAS,oBA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