@rhinestone/sdk 1.0.0-alpha.2 → 1.0.0-alpha.21
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/custom.d.ts +18 -0
- package/dist/src/accounts/custom.d.ts.map +1 -0
- package/dist/src/accounts/custom.js +121 -0
- package/dist/src/accounts/custom.test.d.ts +2 -0
- package/dist/src/accounts/custom.test.d.ts.map +1 -0
- package/dist/src/accounts/custom.test.js +64 -0
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/error.js +2 -0
- package/dist/src/accounts/index.d.ts +22 -13
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +192 -186
- package/dist/src/accounts/index.test.js +3 -3
- package/dist/src/accounts/json-rpc/index.d.ts +5 -0
- package/dist/src/accounts/json-rpc/index.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/index.js +16 -0
- package/dist/src/accounts/json-rpc/index.test.d.ts +2 -0
- package/dist/src/accounts/json-rpc/index.test.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/index.test.js +16 -0
- package/dist/src/accounts/json-rpc/providers.d.ts +4 -0
- package/dist/src/accounts/json-rpc/providers.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/providers.js +14 -0
- package/dist/src/accounts/json-rpc/providers.test.d.ts +2 -0
- package/dist/src/accounts/json-rpc/providers.test.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/providers.test.js +15 -0
- package/dist/src/accounts/kernel.d.ts +9 -10
- package/dist/src/accounts/kernel.d.ts.map +1 -1
- package/dist/src/accounts/kernel.js +3 -14
- package/dist/src/accounts/kernel.test.js +10 -15
- package/dist/src/accounts/nexus.d.ts +14 -13
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +121 -93
- package/dist/src/accounts/nexus.test.js +13 -14
- package/dist/src/accounts/safe.d.ts +5 -7
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +25 -35
- package/dist/src/accounts/safe.test.js +9 -10
- package/dist/src/accounts/signing/common.d.ts +27 -0
- package/dist/src/accounts/signing/common.d.ts.map +1 -0
- package/dist/src/accounts/signing/common.js +142 -0
- package/dist/src/accounts/signing/message.d.ts +5 -0
- package/dist/src/accounts/signing/message.d.ts.map +1 -0
- package/dist/src/accounts/signing/message.js +47 -0
- package/dist/src/accounts/signing/passkeys.d.ts +29 -0
- package/dist/src/accounts/signing/passkeys.d.ts.map +1 -0
- package/dist/src/accounts/signing/passkeys.js +90 -0
- package/dist/src/accounts/signing/passkeys.test.d.ts +2 -0
- package/dist/src/accounts/signing/passkeys.test.d.ts.map +1 -0
- package/dist/src/accounts/signing/passkeys.test.js +73 -0
- package/dist/src/accounts/signing/typedData.d.ts +5 -0
- package/dist/src/accounts/signing/typedData.d.ts.map +1 -0
- package/dist/src/accounts/signing/typedData.js +35 -0
- package/dist/src/accounts/startale.d.ts +20 -0
- package/dist/src/accounts/startale.d.ts.map +1 -0
- package/dist/src/accounts/startale.js +100 -0
- package/dist/src/accounts/startale.test.d.ts +2 -0
- package/dist/src/accounts/startale.test.d.ts.map +1 -0
- package/dist/src/accounts/startale.test.js +96 -0
- package/dist/src/accounts/utils.d.ts +2 -1
- package/dist/src/accounts/utils.d.ts.map +1 -1
- package/dist/src/accounts/utils.js +7 -0
- package/dist/src/actions/index.d.ts +145 -7
- package/dist/src/actions/index.d.ts.map +1 -1
- package/dist/src/actions/index.js +373 -23
- package/dist/src/actions/index.test.js +35 -17
- package/dist/src/actions/smart-session.d.ts +8 -2
- package/dist/src/actions/smart-session.d.ts.map +1 -1
- package/dist/src/actions/smart-session.js +6 -0
- package/dist/src/execution/compact.d.ts +130 -3
- package/dist/src/execution/compact.d.ts.map +1 -1
- package/dist/src/execution/compact.js +94 -1
- package/dist/src/execution/error.d.ts +2 -9
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +4 -13
- package/dist/src/execution/index.d.ts +3 -4
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +35 -80
- package/dist/src/execution/smart-session.d.ts +1 -1
- package/dist/src/execution/smart-session.d.ts.map +1 -1
- package/dist/src/execution/smart-session.js +12 -17
- package/dist/src/execution/utils.d.ts +19 -14
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +222 -97
- package/dist/src/index.d.ts +17 -15
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +108 -21
- package/dist/src/modules/index.d.ts +3 -22
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +5 -65
- package/dist/src/modules/index.test.js +3 -17
- package/dist/src/modules/omni-account.d.ts +2 -4
- package/dist/src/modules/omni-account.d.ts.map +1 -1
- package/dist/src/modules/omni-account.js +4 -8
- package/dist/src/modules/read.d.ts +5 -6
- package/dist/src/modules/read.d.ts.map +1 -1
- package/dist/src/modules/read.js +7 -37
- package/dist/src/modules/validators/core.d.ts +8 -8
- package/dist/src/modules/validators/core.d.ts.map +1 -1
- package/dist/src/modules/validators/core.js +126 -42
- package/dist/src/modules/validators/core.test.js +7 -7
- package/dist/src/modules/validators/smart-sessions.d.ts +3 -3
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.js +10 -9
- package/dist/src/modules/validators/smart-sessions.test.js +4 -4
- package/dist/src/orchestrator/client.d.ts +5 -3
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +159 -95
- package/dist/src/orchestrator/consts.d.ts +3 -2
- package/dist/src/orchestrator/consts.d.ts.map +1 -1
- package/dist/src/orchestrator/consts.js +4 -2
- package/dist/src/orchestrator/index.d.ts +3 -4
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +1 -9
- package/dist/src/orchestrator/registry.d.ts +10 -13
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +75 -395
- package/dist/src/orchestrator/registry.test.d.ts.map +1 -0
- package/dist/src/orchestrator/registry.test.js +137 -0
- package/dist/src/orchestrator/types.d.ts +78 -16
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/orchestrator/utils.d.ts +1 -3
- package/dist/src/orchestrator/utils.d.ts.map +1 -1
- package/dist/src/orchestrator/utils.js +0 -102
- package/dist/src/types.d.ts +69 -26
- package/dist/src/types.d.ts.map +1 -1
- package/dist/test/consts.d.ts +2 -2
- package/dist/test/consts.d.ts.map +1 -1
- package/package.json +2 -1
- package/dist/src/actions/registry.d.ts +0 -7
- package/dist/src/actions/registry.d.ts.map +0 -1
- package/dist/src/actions/registry.js +0 -7
- package/dist/src/actions/registry.test.d.ts.map +0 -1
- package/dist/src/actions/registry.test.js +0 -25
- package/dist/src/modules/registry.d.ts +0 -13
- package/dist/src/modules/registry.d.ts.map +0 -1
- package/dist/src/modules/registry.js +0 -67
- /package/dist/src/{actions → orchestrator}/registry.test.d.ts +0 -0
|
@@ -52,9 +52,18 @@ class Orchestrator {
|
|
|
52
52
|
throw new Error('Failed to get portfolio');
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
async getMaxTokenAmount(userAddress, destinationChainId, destinationTokenAddress, destinationGasUnits) {
|
|
55
|
+
async getMaxTokenAmount(userAddress, destinationChainId, destinationTokenAddress, destinationGasUnits, sponsored) {
|
|
56
56
|
const intentCost = await this.getIntentCost({
|
|
57
|
-
account:
|
|
57
|
+
account: {
|
|
58
|
+
address: userAddress,
|
|
59
|
+
accountType: 'ERC7579',
|
|
60
|
+
setupOps: [
|
|
61
|
+
{
|
|
62
|
+
to: viem_1.zeroAddress,
|
|
63
|
+
data: '0x',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
58
67
|
destinationExecutions: [],
|
|
59
68
|
destinationChainId,
|
|
60
69
|
destinationGasUnits,
|
|
@@ -63,8 +72,13 @@ class Orchestrator {
|
|
|
63
72
|
tokenAddress: destinationTokenAddress,
|
|
64
73
|
},
|
|
65
74
|
],
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
options: {
|
|
76
|
+
topupCompact: false,
|
|
77
|
+
sponsorSettings: {
|
|
78
|
+
gasSponsored: sponsored,
|
|
79
|
+
bridgeFeesSponsored: sponsored,
|
|
80
|
+
swapFeesSponsored: sponsored,
|
|
81
|
+
},
|
|
68
82
|
},
|
|
69
83
|
});
|
|
70
84
|
if (!intentCost.hasFulfilledAll) {
|
|
@@ -79,50 +93,89 @@ class Orchestrator {
|
|
|
79
93
|
if (tokenAmount < 0n) {
|
|
80
94
|
throw new Error(`Balance not available. Make sure the account is deployed`);
|
|
81
95
|
}
|
|
82
|
-
|
|
96
|
+
// `sponsorSettings` is not taken into account in the API response for now
|
|
97
|
+
// As a workaround, we use the `amountSpent` if the transaction is sponsored
|
|
98
|
+
return sponsored
|
|
99
|
+
? tokenReceived.amountSpent
|
|
100
|
+
: tokenReceived.destinationAmount;
|
|
83
101
|
}
|
|
84
102
|
async getIntentCost(input) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
...input,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
103
|
+
try {
|
|
104
|
+
const response = await axios_1.default.post(`${this.serverUrl}/intents/cost`, {
|
|
105
|
+
...(0, utils_1.convertBigIntFields)(input),
|
|
106
|
+
}, {
|
|
107
|
+
headers: {
|
|
108
|
+
'x-api-key': this.apiKey,
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
return response.data;
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
this.parseError(error);
|
|
115
|
+
throw new Error('Failed to get intent cost');
|
|
116
|
+
}
|
|
98
117
|
}
|
|
99
118
|
async getIntentRoute(input) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
119
|
+
try {
|
|
120
|
+
const response = await axios_1.default.post(`${this.serverUrl}/intents/route`, {
|
|
121
|
+
...(0, utils_1.convertBigIntFields)(input),
|
|
122
|
+
}, {
|
|
123
|
+
headers: {
|
|
124
|
+
'x-api-key': this.apiKey,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
return response.data;
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
this.parseError(error);
|
|
131
|
+
throw new Error('Failed to get intent route');
|
|
132
|
+
}
|
|
108
133
|
}
|
|
109
134
|
async submitIntent(signedIntentOp) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
135
|
+
try {
|
|
136
|
+
const response = await axios_1.default.post(`${this.serverUrl}/intent-operations`, {
|
|
137
|
+
signedIntentOp: (0, utils_1.convertBigIntFields)(signedIntentOp),
|
|
138
|
+
}, {
|
|
139
|
+
headers: {
|
|
140
|
+
'x-api-key': this.apiKey,
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
return response.data;
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
this.parseError(error);
|
|
147
|
+
throw new Error('Failed to submit intent');
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
async simulateIntent(signedIntentOp) {
|
|
151
|
+
try {
|
|
152
|
+
const response = await axios_1.default.post(`${this.serverUrl}/intent-operations/simulate`, {
|
|
153
|
+
signedIntentOp: (0, utils_1.convertBigIntFields)(signedIntentOp),
|
|
154
|
+
}, {
|
|
155
|
+
headers: {
|
|
156
|
+
'x-api-key': this.apiKey,
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
return response.data;
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
this.parseError(error);
|
|
163
|
+
throw new Error('Failed to simulate intent');
|
|
164
|
+
}
|
|
118
165
|
}
|
|
119
166
|
async getIntentOpStatus(intentId) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
167
|
+
try {
|
|
168
|
+
const response = await axios_1.default.get(`${this.serverUrl}/intent-operation/${intentId.toString()}/status`, {
|
|
169
|
+
headers: {
|
|
170
|
+
'x-api-key': this.apiKey,
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
return response.data;
|
|
174
|
+
}
|
|
175
|
+
catch (error) {
|
|
176
|
+
this.parseError(error);
|
|
177
|
+
throw new Error('Failed to get intent op status');
|
|
178
|
+
}
|
|
126
179
|
}
|
|
127
180
|
parseError(error) {
|
|
128
181
|
if (error.response) {
|
|
@@ -156,7 +209,15 @@ class Orchestrator {
|
|
|
156
209
|
}
|
|
157
210
|
let context = {};
|
|
158
211
|
if (error.response.data) {
|
|
159
|
-
const { errors, traceId } = error.response.data;
|
|
212
|
+
const { errors, traceId, message } = error.response.data;
|
|
213
|
+
if (message) {
|
|
214
|
+
const mainErrorParams = {
|
|
215
|
+
context: { traceId },
|
|
216
|
+
errorType,
|
|
217
|
+
traceId,
|
|
218
|
+
};
|
|
219
|
+
this.parseErrorMessage(message, mainErrorParams);
|
|
220
|
+
}
|
|
160
221
|
for (const err of errors) {
|
|
161
222
|
let errorMessage = `Rhinestone Error: ${err.message}`;
|
|
162
223
|
if (errorType) {
|
|
@@ -177,60 +238,7 @@ class Orchestrator {
|
|
|
177
238
|
errorType,
|
|
178
239
|
traceId,
|
|
179
240
|
};
|
|
180
|
-
|
|
181
|
-
throw new error_1.InsufficientBalanceError(finalErrorParams);
|
|
182
|
-
}
|
|
183
|
-
else if (message === 'Unsupported chain id') {
|
|
184
|
-
throw new error_1.UnsupportedChainIdError(finalErrorParams);
|
|
185
|
-
}
|
|
186
|
-
else if (message.startsWith('Unsupported chain ')) {
|
|
187
|
-
const chainIdMatch = message.match(/Unsupported chain (\d+)/);
|
|
188
|
-
if (chainIdMatch) {
|
|
189
|
-
const chainId = parseInt(chainIdMatch[1], 10);
|
|
190
|
-
throw new error_1.UnsupportedChainError(chainId, finalErrorParams);
|
|
191
|
-
}
|
|
192
|
-
throw new error_1.UnsupportedChainIdError(finalErrorParams);
|
|
193
|
-
}
|
|
194
|
-
else if (message.includes('Unsupported token') &&
|
|
195
|
-
message.includes('for chain')) {
|
|
196
|
-
const tokenMatch = message.match(/Unsupported token (\w+) for chain (\d+)/);
|
|
197
|
-
if (tokenMatch) {
|
|
198
|
-
const tokenSymbol = tokenMatch[1];
|
|
199
|
-
const chainId = parseInt(tokenMatch[2], 10);
|
|
200
|
-
throw new error_1.UnsupportedTokenError(tokenSymbol, chainId, finalErrorParams);
|
|
201
|
-
}
|
|
202
|
-
throw new error_1.OrchestratorError({ message, ...finalErrorParams });
|
|
203
|
-
}
|
|
204
|
-
else if (message.includes('not supported on chain')) {
|
|
205
|
-
const tokenMatch = message.match(/Token (.+) not supported on chain (\d+)/);
|
|
206
|
-
if (tokenMatch) {
|
|
207
|
-
const tokenAddress = tokenMatch[1];
|
|
208
|
-
const chainId = parseInt(tokenMatch[2], 10);
|
|
209
|
-
throw new error_1.TokenNotSupportedError(tokenAddress, chainId, finalErrorParams);
|
|
210
|
-
}
|
|
211
|
-
throw new error_1.OrchestratorError({ message, ...finalErrorParams });
|
|
212
|
-
}
|
|
213
|
-
else if (message === 'Authentication is required') {
|
|
214
|
-
throw new error_1.AuthenticationRequiredError(finalErrorParams);
|
|
215
|
-
}
|
|
216
|
-
else if (message === 'Invalid API key') {
|
|
217
|
-
throw new error_1.InvalidApiKeyError(finalErrorParams);
|
|
218
|
-
}
|
|
219
|
-
else if (message === 'Invalid bundle signature') {
|
|
220
|
-
throw new error_1.InvalidIntentSignatureError(finalErrorParams);
|
|
221
|
-
}
|
|
222
|
-
else if (message === 'Only one target token amount can be unset') {
|
|
223
|
-
throw new error_1.OnlyOneTargetTokenAmountCanBeUnsetError(finalErrorParams);
|
|
224
|
-
}
|
|
225
|
-
else if (message === 'No Path Found') {
|
|
226
|
-
throw new error_1.NoPathFoundError(finalErrorParams);
|
|
227
|
-
}
|
|
228
|
-
else if (message === 'Order bundle not found') {
|
|
229
|
-
throw new error_1.IntentNotFoundError(finalErrorParams);
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
throw new error_1.OrchestratorError({ message, ...finalErrorParams });
|
|
233
|
-
}
|
|
241
|
+
this.parseErrorMessage(message, finalErrorParams);
|
|
234
242
|
}
|
|
235
243
|
}
|
|
236
244
|
else {
|
|
@@ -238,5 +246,61 @@ class Orchestrator {
|
|
|
238
246
|
}
|
|
239
247
|
}
|
|
240
248
|
}
|
|
249
|
+
parseErrorMessage(message, errorParams) {
|
|
250
|
+
if (message === 'Insufficient balance') {
|
|
251
|
+
throw new error_1.InsufficientBalanceError(errorParams);
|
|
252
|
+
}
|
|
253
|
+
else if (message === 'Unsupported chain id') {
|
|
254
|
+
throw new error_1.UnsupportedChainIdError(errorParams);
|
|
255
|
+
}
|
|
256
|
+
else if (message.startsWith('Unsupported chain ')) {
|
|
257
|
+
const chainIdMatch = message.match(/Unsupported chain (\d+)/);
|
|
258
|
+
if (chainIdMatch) {
|
|
259
|
+
const chainId = parseInt(chainIdMatch[1], 10);
|
|
260
|
+
throw new error_1.UnsupportedChainError(chainId, errorParams);
|
|
261
|
+
}
|
|
262
|
+
throw new error_1.UnsupportedChainIdError(errorParams);
|
|
263
|
+
}
|
|
264
|
+
else if (message.includes('Unsupported token') &&
|
|
265
|
+
message.includes('for chain')) {
|
|
266
|
+
const tokenMatch = message.match(/Unsupported token (\w+) for chain (\d+)/);
|
|
267
|
+
if (tokenMatch) {
|
|
268
|
+
const tokenSymbol = tokenMatch[1];
|
|
269
|
+
const chainId = parseInt(tokenMatch[2], 10);
|
|
270
|
+
throw new error_1.UnsupportedTokenError(tokenSymbol, chainId, errorParams);
|
|
271
|
+
}
|
|
272
|
+
throw new error_1.OrchestratorError({ message, ...errorParams });
|
|
273
|
+
}
|
|
274
|
+
else if (message.includes('not supported on chain')) {
|
|
275
|
+
const tokenMatch = message.match(/Token (.+) not supported on chain (\d+)/);
|
|
276
|
+
if (tokenMatch) {
|
|
277
|
+
const tokenAddress = tokenMatch[1];
|
|
278
|
+
const chainId = parseInt(tokenMatch[2], 10);
|
|
279
|
+
throw new error_1.TokenNotSupportedError(tokenAddress, chainId, errorParams);
|
|
280
|
+
}
|
|
281
|
+
throw new error_1.OrchestratorError({ message, ...errorParams });
|
|
282
|
+
}
|
|
283
|
+
else if (message === 'Authentication is required') {
|
|
284
|
+
throw new error_1.AuthenticationRequiredError(errorParams);
|
|
285
|
+
}
|
|
286
|
+
else if (message === 'Invalid API key') {
|
|
287
|
+
throw new error_1.InvalidApiKeyError(errorParams);
|
|
288
|
+
}
|
|
289
|
+
else if (message === 'Invalid bundle signature') {
|
|
290
|
+
throw new error_1.InvalidIntentSignatureError(errorParams);
|
|
291
|
+
}
|
|
292
|
+
else if (message === 'Only one target token amount can be unset') {
|
|
293
|
+
throw new error_1.OnlyOneTargetTokenAmountCanBeUnsetError(errorParams);
|
|
294
|
+
}
|
|
295
|
+
else if (message === 'No Path Found') {
|
|
296
|
+
throw new error_1.NoPathFoundError(errorParams);
|
|
297
|
+
}
|
|
298
|
+
else if (message === 'Order bundle not found') {
|
|
299
|
+
throw new error_1.IntentNotFoundError(errorParams);
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
throw new error_1.OrchestratorError({ message, ...errorParams });
|
|
303
|
+
}
|
|
304
|
+
}
|
|
241
305
|
}
|
|
242
306
|
exports.Orchestrator = Orchestrator;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
declare const PROD_ORCHESTRATOR_URL = "https://
|
|
1
|
+
declare const PROD_ORCHESTRATOR_URL = "https://v1.orchestrator.rhinestone.dev";
|
|
2
|
+
declare const STAGING_ORCHESTRATOR_URL = "https://staging.v1.orchestrator.rhinestone.dev";
|
|
2
3
|
declare const DEV_ORCHESTRATOR_URL = "https://dev.v1.orchestrator.rhinestone.dev";
|
|
3
4
|
declare const RHINESTONE_SPOKE_POOL_ADDRESS = "0x000000000060f6e853447881951574cdd0663530";
|
|
4
|
-
export { PROD_ORCHESTRATOR_URL, DEV_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, };
|
|
5
|
+
export { PROD_ORCHESTRATOR_URL, STAGING_ORCHESTRATOR_URL, DEV_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, };
|
|
5
6
|
//# 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
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../orchestrator/consts.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,qBAAqB,2CAA2C,CAAA;AACtE,QAAA,MAAM,wBAAwB,mDACoB,CAAA;AAClD,QAAA,MAAM,oBAAoB,+CAA+C,CAAA;AACzE,QAAA,MAAM,6BAA6B,+CACW,CAAA;AAE9C,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,6BAA6B,GAC9B,CAAA"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.DEV_ORCHESTRATOR_URL = exports.PROD_ORCHESTRATOR_URL = void 0;
|
|
4
|
-
const PROD_ORCHESTRATOR_URL = 'https://
|
|
3
|
+
exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.DEV_ORCHESTRATOR_URL = exports.STAGING_ORCHESTRATOR_URL = exports.PROD_ORCHESTRATOR_URL = void 0;
|
|
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;
|
|
6
8
|
const DEV_ORCHESTRATOR_URL = 'https://dev.v1.orchestrator.rhinestone.dev';
|
|
7
9
|
exports.DEV_ORCHESTRATOR_URL = DEV_ORCHESTRATOR_URL;
|
|
8
10
|
const RHINESTONE_SPOKE_POOL_ADDRESS = '0x000000000060f6e853447881951574cdd0663530';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Orchestrator } from './client';
|
|
2
2
|
import { RHINESTONE_SPOKE_POOL_ADDRESS } from './consts';
|
|
3
3
|
import { AuthenticationRequiredError, InsufficientBalanceError, IntentNotFoundError, InvalidApiKeyError, InvalidIntentSignatureError, isOrchestratorError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from './error';
|
|
4
|
-
import {
|
|
4
|
+
import { getSupportedTokens, getTokenAddress, getTokenSymbol, getWethAddress, isTokenAddressSupported } from './registry';
|
|
5
5
|
import type { IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, Portfolio, SettlementSystem, SignedIntentOp, SupportedChain, TokenConfig } from './types';
|
|
6
6
|
import { INTENT_STATUS_COMPLETED, INTENT_STATUS_EXPIRED, INTENT_STATUS_FAILED, INTENT_STATUS_FILLED, INTENT_STATUS_PARTIALLY_COMPLETED, INTENT_STATUS_PENDING, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_UNKNOWN } from './types';
|
|
7
|
-
|
|
8
|
-
declare function getOrchestrator(apiKey: string, orchestratorUrl?: string): Orchestrator;
|
|
7
|
+
declare function getOrchestrator(apiKey?: string, orchestratorUrl?: string): Orchestrator;
|
|
9
8
|
export type { IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, SettlementSystem, SignedIntentOp, SupportedChain, TokenConfig, Portfolio, };
|
|
10
|
-
export { INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_PARTIALLY_COMPLETED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, AuthenticationRequiredError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getOrchestrator,
|
|
9
|
+
export { INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_PARTIALLY_COMPLETED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, AuthenticationRequiredError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getOrchestrator, getWethAddress, getTokenSymbol, getTokenAddress, getSupportedTokens, isOrchestratorError, isTokenAddressSupported, };
|
|
11
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAyB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC3B,mBAAmB,EACnB,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAyB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC3B,mBAAmB,EACnB,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,cAAc,EACd,uBAAuB,EACxB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,WAAW,EACZ,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,iCAAiC,EACjC,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAEhB,iBAAS,eAAe,CACtB,MAAM,CAAC,EAAE,MAAM,EACf,eAAe,CAAC,EAAE,MAAM,GACvB,YAAY,CAEd;AAED,YAAY,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,WAAW,EACX,SAAS,GACV,CAAA;AACD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,iCAAiC,EACjC,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,6BAA6B,EAC7B,YAAY,EACZ,2BAA2B,EAC3B,wBAAwB,EACxB,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,GACxB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTokenAddressSupported = exports.isOrchestratorError = exports.getSupportedTokens = exports.getTokenAddress = exports.
|
|
3
|
+
exports.isTokenAddressSupported = exports.isOrchestratorError = exports.getSupportedTokens = exports.getTokenAddress = exports.getTokenSymbol = exports.getWethAddress = exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.AuthenticationRequiredError = exports.Orchestrator = exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.INTENT_STATUS_UNKNOWN = exports.INTENT_STATUS_PRECONFIRMED = exports.INTENT_STATUS_FAILED = exports.INTENT_STATUS_FILLED = exports.INTENT_STATUS_COMPLETED = exports.INTENT_STATUS_PARTIALLY_COMPLETED = exports.INTENT_STATUS_EXPIRED = exports.INTENT_STATUS_PENDING = void 0;
|
|
4
4
|
exports.getOrchestrator = getOrchestrator;
|
|
5
5
|
const client_1 = require("./client");
|
|
6
6
|
Object.defineProperty(exports, "Orchestrator", { enumerable: true, get: function () { return client_1.Orchestrator; } });
|
|
@@ -21,14 +21,8 @@ Object.defineProperty(exports, "UnsupportedChainError", { enumerable: true, get:
|
|
|
21
21
|
Object.defineProperty(exports, "UnsupportedChainIdError", { enumerable: true, get: function () { return error_1.UnsupportedChainIdError; } });
|
|
22
22
|
Object.defineProperty(exports, "UnsupportedTokenError", { enumerable: true, get: function () { return error_1.UnsupportedTokenError; } });
|
|
23
23
|
const registry_1 = require("./registry");
|
|
24
|
-
Object.defineProperty(exports, "getHookAddress", { enumerable: true, get: function () { return registry_1.getHookAddress; } });
|
|
25
|
-
Object.defineProperty(exports, "getRhinestoneSpokePoolAddress", { enumerable: true, get: function () { return registry_1.getRhinestoneSpokePoolAddress; } });
|
|
26
|
-
Object.defineProperty(exports, "getSameChainModuleAddress", { enumerable: true, get: function () { return registry_1.getSameChainModuleAddress; } });
|
|
27
24
|
Object.defineProperty(exports, "getSupportedTokens", { enumerable: true, get: function () { return registry_1.getSupportedTokens; } });
|
|
28
|
-
Object.defineProperty(exports, "getTargetModuleAddress", { enumerable: true, get: function () { return registry_1.getTargetModuleAddress; } });
|
|
29
25
|
Object.defineProperty(exports, "getTokenAddress", { enumerable: true, get: function () { return registry_1.getTokenAddress; } });
|
|
30
|
-
Object.defineProperty(exports, "getTokenBalanceSlot", { enumerable: true, get: function () { return registry_1.getTokenBalanceSlot; } });
|
|
31
|
-
Object.defineProperty(exports, "getTokenRootBalanceSlot", { enumerable: true, get: function () { return registry_1.getTokenRootBalanceSlot; } });
|
|
32
26
|
Object.defineProperty(exports, "getTokenSymbol", { enumerable: true, get: function () { return registry_1.getTokenSymbol; } });
|
|
33
27
|
Object.defineProperty(exports, "getWethAddress", { enumerable: true, get: function () { return registry_1.getWethAddress; } });
|
|
34
28
|
Object.defineProperty(exports, "isTokenAddressSupported", { enumerable: true, get: function () { return registry_1.isTokenAddressSupported; } });
|
|
@@ -41,8 +35,6 @@ Object.defineProperty(exports, "INTENT_STATUS_PARTIALLY_COMPLETED", { enumerable
|
|
|
41
35
|
Object.defineProperty(exports, "INTENT_STATUS_PENDING", { enumerable: true, get: function () { return types_1.INTENT_STATUS_PENDING; } });
|
|
42
36
|
Object.defineProperty(exports, "INTENT_STATUS_PRECONFIRMED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_PRECONFIRMED; } });
|
|
43
37
|
Object.defineProperty(exports, "INTENT_STATUS_UNKNOWN", { enumerable: true, get: function () { return types_1.INTENT_STATUS_UNKNOWN; } });
|
|
44
|
-
const utils_1 = require("./utils");
|
|
45
|
-
Object.defineProperty(exports, "getIntentOpHash", { enumerable: true, get: function () { return utils_1.getIntentOpHash; } });
|
|
46
38
|
function getOrchestrator(apiKey, orchestratorUrl) {
|
|
47
39
|
return new client_1.Orchestrator(orchestratorUrl ?? consts_1.PROD_ORCHESTRATOR_URL, apiKey);
|
|
48
40
|
}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import { type Address, type Chain
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
declare function
|
|
5
|
-
declare function
|
|
6
|
-
declare function getHookAddress(_chainId?: number): Address;
|
|
7
|
-
declare function getSameChainModuleAddress(_chainId?: number): Address;
|
|
8
|
-
declare function getTargetModuleAddress(_chainId?: number): Address;
|
|
9
|
-
declare function getRhinestoneSpokePoolAddress(_chainId?: number): Address;
|
|
1
|
+
import { type Address, type Chain } from 'viem';
|
|
2
|
+
import type { TokenSymbol } from '../types';
|
|
3
|
+
import type { TokenConfig } from './types';
|
|
4
|
+
declare function getSupportedChainIds(): number[];
|
|
5
|
+
declare function getWethAddress(chain: Chain): Address;
|
|
10
6
|
declare function getTokenSymbol(tokenAddress: Address, chainId: number): string;
|
|
11
|
-
declare function getTokenAddress(tokenSymbol:
|
|
12
|
-
declare function getChainById(chainId: number): Chain
|
|
7
|
+
declare function getTokenAddress(tokenSymbol: TokenSymbol, chainId: number): Address;
|
|
8
|
+
declare function getChainById(chainId: number): Chain;
|
|
13
9
|
declare function isTestnet(chainId: number): boolean;
|
|
14
10
|
declare function isTokenAddressSupported(address: Address, chainId: number): boolean;
|
|
15
11
|
declare function getSupportedTokens(chainId: number): TokenConfig[];
|
|
16
12
|
declare function getDefaultAccountAccessList(onTestnets?: boolean): {
|
|
17
|
-
chainIds:
|
|
13
|
+
chainIds: number[];
|
|
18
14
|
};
|
|
19
|
-
|
|
15
|
+
declare function resolveTokenAddress(token: TokenSymbol | Address, chainId: number): Address;
|
|
16
|
+
export { getTokenSymbol, getTokenAddress, getWethAddress, getChainById, getSupportedTokens, getSupportedChainIds, isTestnet, isTokenAddressSupported, getDefaultAccountAccessList, resolveTokenAddress, };
|
|
20
17
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAA0B,MAAM,MAAM,CAAA;AAcvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,KAAK,EAAkB,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1D,iBAAS,oBAAoB,IAAI,MAAM,EAAE,CAExC;AAMD,iBAAS,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAY7C;AAED,iBAAS,cAAc,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAiBtE;AAED,iBAAS,eAAe,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAsB3E;AAOD,iBAAS,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAmB5C;AAED,iBAAS,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAG3C;AAED,iBAAS,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAS3E;AAED,iBAAS,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE,CAO1D;AAED,iBAAS,2BAA2B,CAAC,UAAU,CAAC,EAAE,OAAO;;EAaxD;AAED,iBAAS,mBAAmB,CAC1B,KAAK,EAAE,WAAW,GAAG,OAAO,EAC5B,OAAO,EAAE,MAAM,GACd,OAAO,CAKT;AAED,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,uBAAuB,EACvB,2BAA2B,EAC3B,mBAAmB,GACpB,CAAA"}
|