@sodax/sdk 0.0.1-rc.3 → 0.0.1-rc.4
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/constants.d.ts.map +1 -1
- package/dist/constants.js +50 -8
- package/dist/constants.js.map +1 -1
- package/dist/services/moneyMarket/MoneyMarketService.d.ts +262 -60
- package/dist/services/moneyMarket/MoneyMarketService.d.ts.map +1 -1
- package/dist/services/moneyMarket/MoneyMarketService.js +262 -60
- package/dist/services/moneyMarket/MoneyMarketService.js.map +1 -1
- package/dist/services/solver/SolverService.d.ts +137 -38
- package/dist/services/solver/SolverService.d.ts.map +1 -1
- package/dist/services/solver/SolverService.js +137 -37
- package/dist/services/solver/SolverService.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type EvmHubProvider, type IntentRelayRequest, type PacketData, type RelayErrorCode, type SpokeProvider, type WaitUntilIntentExecutedPayload } from '../../index.js';
|
|
2
2
|
import type { FeeAmount, HttpUrl, IntentErrorResponse, IntentExecutionRequest, IntentExecutionResponse, IntentQuoteRequest, IntentQuoteResponse, IntentRelayChainId, IntentStatusRequest, IntentStatusResponse, PartnerFee, Result, SolverConfigParams, TxReturnType } from '../../types.js';
|
|
3
|
-
import type
|
|
4
|
-
import { type SpokeChainId } from '@sodax/types';
|
|
3
|
+
import { type SpokeChainId, type Address, type Hex, type EvmRawTransactionReceipt, type Hash } from '@sodax/types';
|
|
5
4
|
export type CreateIntentParams = {
|
|
6
5
|
inputToken: string;
|
|
7
6
|
outputToken: string;
|
|
@@ -77,25 +76,33 @@ export declare class SolverService {
|
|
|
77
76
|
* @returns {Promise<Result<IntentQuoteResponse, IntentErrorResponse>>} The intent quote response
|
|
78
77
|
*
|
|
79
78
|
* @example
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* "
|
|
83
|
-
* "
|
|
84
|
-
* "
|
|
85
|
-
* "token_dst_blockchain_id":"42161",
|
|
79
|
+
* const payload = {
|
|
80
|
+
* "token_src":"0x2170Ed0880ac9A755fd29B2688956BD959F933F8", // BSC ETH token address
|
|
81
|
+
* "token_dst":"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", // ARB WBTC token address
|
|
82
|
+
* "token_src_blockchain_id":"0x38.bsc",
|
|
83
|
+
* "token_dst_blockchain_id":"0xa4b1.arbitrum",
|
|
86
84
|
* "amount":1000000000000000n,
|
|
87
85
|
* "quote_type": "exact_input"
|
|
88
86
|
* } satisfies IntentQuoteRequest
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
87
|
+
*
|
|
88
|
+
* const response = await solverService.getQuote(payload);
|
|
89
|
+
*
|
|
90
|
+
* if (response.ok) {
|
|
91
|
+
* const quotedAmount = response.value.quoted_amount;
|
|
92
|
+
* console.log('Quoted amount:', quotedAmount);
|
|
93
|
+
* } else {
|
|
94
|
+
* console.error('Quote failed:', response.error);
|
|
95
|
+
* }
|
|
93
96
|
*/
|
|
94
97
|
getQuote(payload: IntentQuoteRequest): Promise<Result<IntentQuoteResponse, IntentErrorResponse>>;
|
|
95
98
|
/**
|
|
96
99
|
* Get the fee for a given input amount
|
|
97
100
|
* @param {bigint} inputAmount - The amount of input tokens
|
|
98
101
|
* @returns {Promise<bigint>} The fee amount (denominated in input tokens)
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* const fee: bigint = await solverService.getFee(1000000000000000n);
|
|
105
|
+
* console.log('Fee:', fee);
|
|
99
106
|
*/
|
|
100
107
|
getFee(inputAmount: bigint): Promise<bigint>;
|
|
101
108
|
/**
|
|
@@ -104,38 +111,39 @@ export declare class SolverService {
|
|
|
104
111
|
* @returns {Promise<Result<IntentStatusResponse, IntentErrorResponse>>} The intent status response
|
|
105
112
|
*
|
|
106
113
|
* @example
|
|
107
|
-
*
|
|
108
|
-
* {
|
|
114
|
+
* const intentStatusRequest = {
|
|
109
115
|
* "intentHash": "a0dd7652-b360-4123-ab2d-78cfbcd20c6b"
|
|
110
|
-
* }
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
116
|
+
* } satisfies IntentStatusRequest
|
|
117
|
+
*
|
|
118
|
+
* const response = await solverService.getStatus(intentStatusRequest);
|
|
119
|
+
*
|
|
120
|
+
* if (response.ok) {
|
|
121
|
+
* const { status, intent_hash } = response.value;
|
|
122
|
+
* console.log('Status:', status);
|
|
123
|
+
* console.log('Intent hash:', intent_hash);
|
|
124
|
+
* } else {
|
|
125
|
+
* // handle error
|
|
115
126
|
* }
|
|
116
127
|
*/
|
|
117
128
|
getStatus(intentStatusRequest: IntentStatusRequest): Promise<Result<IntentStatusResponse, IntentErrorResponse>>;
|
|
118
129
|
/**
|
|
119
|
-
* Post execution of intent order to Solver API
|
|
130
|
+
* Post execution of intent order transaction executed on hub chain to Solver API
|
|
120
131
|
* @param {IntentExecutionRequest} intentExecutionRequest - The intent execution request
|
|
121
132
|
* @returns {Promise<Result<IntentExecutionResponse, IntentErrorResponse>>} The intent execution response
|
|
122
133
|
*
|
|
123
134
|
* @example
|
|
124
|
-
*
|
|
125
|
-
* {
|
|
135
|
+
* const intentExecutionRequest = {
|
|
126
136
|
* "intent_tx_hash": "0xba3dce19347264db32ced212ff1a2036f20d9d2c7493d06af15027970be061af",
|
|
127
|
-
*
|
|
128
|
-
*
|
|
137
|
+
* } satisfies IntentExecutionRequest
|
|
138
|
+
*
|
|
139
|
+
* const response = await solverService.postExecution(intentExecutionRequest);
|
|
129
140
|
*
|
|
130
|
-
*
|
|
131
|
-
* {
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* "task_id":"a0dd7652-b360-4123-ab2d-78cfbcd20c6b"
|
|
137
|
-
* }
|
|
138
|
-
* }
|
|
141
|
+
* if (response.ok) {
|
|
142
|
+
* const { answer, intent_hash } = response.value;
|
|
143
|
+
* console.log('Answer:', answer);
|
|
144
|
+
* console.log('Intent hash:', intent_hash);
|
|
145
|
+
* } else {
|
|
146
|
+
* // handle error
|
|
139
147
|
* }
|
|
140
148
|
*/
|
|
141
149
|
postExecution(intentExecutionRequest: IntentExecutionRequest): Promise<Result<IntentExecutionResponse, IntentErrorResponse>>;
|
|
@@ -143,8 +151,35 @@ export declare class SolverService {
|
|
|
143
151
|
* Creates an intent and submits it to the Solver API and Relayer API
|
|
144
152
|
* @param {CreateIntentParams} payload - The intent to create
|
|
145
153
|
* @param {ISpokeProvider} spokeProvider - The spoke provider
|
|
146
|
-
* @param {number} timeout - The timeout in milliseconds for the transaction. Default is
|
|
147
|
-
* @returns {Promise<Result<IntentExecutionResponse,
|
|
154
|
+
* @param {number} timeout - The timeout in milliseconds for the transaction. Default is 60 seconds.
|
|
155
|
+
* @returns {Promise<Result<[IntentExecutionResponse, Intent, PacketData], IntentSubmitError<IntentSubmitErrorCode>>>} The intent execution response, intent, and packet data
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* const payload = {
|
|
159
|
+
* "inputToken": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", // BSC ETH token address
|
|
160
|
+
* "outputToken": "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", // ARB WBTC token address
|
|
161
|
+
* "inputAmount": 1000000000000000n, // The amount of input tokens
|
|
162
|
+
* "minOutputAmount": 900000000000000n, // min amount you are expecting to receive
|
|
163
|
+
* "deadline": 0n, // Optional timestamp after which intent expires (0 = no deadline)
|
|
164
|
+
* "allowPartialFill": false, // Whether the intent can be partially filled
|
|
165
|
+
* "srcChain": "0x38.bsc", // Chain ID where input tokens originate
|
|
166
|
+
* "dstChain": "0xa4b1.arbitrum", // Chain ID where output tokens should be delivered
|
|
167
|
+
* "srcAddress": "0x..", // Source address in bytes (original address on spoke chain)
|
|
168
|
+
* "dstAddress": "0x...", // Destination address in bytes (original address on spoke chain)
|
|
169
|
+
* "solver": "0x..", // Optional specific solver address (address(0) = any solver)
|
|
170
|
+
* "data": "0x..", // Additional arbitrary data
|
|
171
|
+
* } satisfies CreateIntentParams;
|
|
172
|
+
*
|
|
173
|
+
* const createAndSubmitIntentResult = await solverService.createAndSubmitIntent(payload, spokeProvider);
|
|
174
|
+
*
|
|
175
|
+
* if (createAndSubmitIntentResult.ok) {
|
|
176
|
+
* const [intentExecutionResponse, intent, packetData] = createAndSubmitIntentResult.value;
|
|
177
|
+
* console.log('Intent execution response:', intentExecutionResponse);
|
|
178
|
+
* console.log('Intent:', intent);
|
|
179
|
+
* console.log('Packet data:', packetData);
|
|
180
|
+
* } else {
|
|
181
|
+
* // handle error
|
|
182
|
+
* }
|
|
148
183
|
*/
|
|
149
184
|
createAndSubmitIntent<S extends SpokeProvider>(payload: CreateIntentParams, spokeProvider: S, fee?: PartnerFee, timeout?: number): Promise<Result<[IntentExecutionResponse, Intent, PacketData], IntentSubmitError<IntentSubmitErrorCode>>>;
|
|
150
185
|
/**
|
|
@@ -152,14 +187,55 @@ export declare class SolverService {
|
|
|
152
187
|
* @param {CreateIntentParams} params - The intent to create
|
|
153
188
|
* @param {SpokeProvider} spokeProvider - The spoke provider
|
|
154
189
|
* @return {Promise<Result<boolean>>} - valid = true, invalid = false
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* const payload = {
|
|
193
|
+
* "inputToken": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", // BSC ETH token address
|
|
194
|
+
* "outputToken": "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", // ARB WBTC token address
|
|
195
|
+
* "inputAmount": 1000000000000000n, // The amount of input tokens
|
|
196
|
+
* "minOutputAmount": 900000000000000n, // min amount you are expecting to receive
|
|
197
|
+
* "deadline": 0n, // Optional timestamp after which intent expires (0 = no deadline)
|
|
198
|
+
* "allowPartialFill": false, // Whether the intent can be partially filled
|
|
199
|
+
* "srcChain": "0x38.bsc", // Chain ID where input tokens originate
|
|
200
|
+
* "dstChain": "0xa4b1.arbitrum", // Chain ID where output tokens should be delivered
|
|
201
|
+
* "srcAddress": "0x..", // Source address in bytes (original address on spoke chain)
|
|
202
|
+
* "dstAddress": "0x...", // Destination address in bytes (original address on spoke chain)
|
|
203
|
+
* "solver": "0x..", // Optional specific solver address (address(0) = any solver)
|
|
204
|
+
* "data": "0x..", // Additional arbitrary data
|
|
205
|
+
* } satisfies CreateIntentParams;
|
|
206
|
+
*
|
|
207
|
+
* const isAllowanceValid = await solverService.isAllowanceValid(payload, spokeProvider);
|
|
208
|
+
*
|
|
209
|
+
* if (!allowanceValid.ok) {
|
|
210
|
+
* // Handle error
|
|
211
|
+
* }
|
|
212
|
+
*
|
|
213
|
+
* if (!allowanceValid.value) {
|
|
214
|
+
* // Need to approve
|
|
215
|
+
* }
|
|
155
216
|
*/
|
|
156
217
|
isAllowanceValid<S extends SpokeProvider>(params: CreateIntentParams, spokeProvider: S): Promise<Result<boolean>>;
|
|
157
218
|
/**
|
|
158
|
-
* Approve
|
|
219
|
+
* Approve amount spending (currently required for EVM only)
|
|
159
220
|
* @param token - ERC20 token address
|
|
160
221
|
* @param amount - Amount to approve
|
|
161
|
-
* @param
|
|
222
|
+
* @param spender - Spender address
|
|
162
223
|
* @param spokeProvider - Spoke provider
|
|
224
|
+
* @returns {Promise<Result<EvmRawTransactionReceipt>>} - Returns the transaction receipt
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* const approveResult = await approve(
|
|
228
|
+
* '0x...', // ERC20 token address
|
|
229
|
+
* 1000n, // Amount to approve (in token decimals)
|
|
230
|
+
* '0x...', // Spender address (usually the asset manager contract: spokeProvider.chainConfig.addresses.assetManager)
|
|
231
|
+
* spokeProvider
|
|
232
|
+
* );
|
|
233
|
+
*
|
|
234
|
+
* if (!approveResult.ok) {
|
|
235
|
+
* // Handle error
|
|
236
|
+
* }
|
|
237
|
+
*
|
|
238
|
+
* const txReceipt = approveResult.value;
|
|
163
239
|
*/
|
|
164
240
|
approve<S extends SpokeProvider>(token: Address, amount: bigint, address: Address, spokeProvider: S): Promise<Result<EvmRawTransactionReceipt>>;
|
|
165
241
|
/**
|
|
@@ -169,7 +245,30 @@ export declare class SolverService {
|
|
|
169
245
|
* @param {SpokeProvider} spokeProvider - The spoke provider
|
|
170
246
|
* @param {boolean} raw - Whether to return the raw transaction
|
|
171
247
|
* @param {PartnerFee} fee - The fee to apply to the intent
|
|
172
|
-
* @returns {Promise<[TxReturnType<
|
|
248
|
+
* @returns {Promise<Result<[TxReturnType<S, R>, Intent & FeeAmount], IntentSubmitError<'CREATION_FAILED'>>>} The encoded contract call
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* const payload = {
|
|
252
|
+
* "inputToken": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", // BSC ETH token address
|
|
253
|
+
* "outputToken": "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", // ARB WBTC token address
|
|
254
|
+
* "inputAmount": 1000000000000000n, // The amount of input tokens
|
|
255
|
+
* "minOutputAmount": 900000000000000n, // min amount you are expecting to receive
|
|
256
|
+
* "deadline": 0n, // Optional timestamp after which intent expires (0 = no deadline)
|
|
257
|
+
* "allowPartialFill": false, // Whether the intent can be partially filled
|
|
258
|
+
* "srcChain": "0x38.bsc", // Chain ID where input tokens originate
|
|
259
|
+
* "dstChain": "0xa4b1.arbitrum", // Chain ID where output tokens should be delivered
|
|
260
|
+
* "srcAddress": "0x..", // Source address in bytes (original address on spoke chain)
|
|
261
|
+
* "dstAddress": "0x...", // Destination address in bytes (original address on spoke chain)
|
|
262
|
+
* "solver": "0x..", // Optional specific solver address (address(0) = any solver)
|
|
263
|
+
* "data": "0x..", // Additional arbitrary data
|
|
264
|
+
* } satisfies CreateIntentParams;
|
|
265
|
+
*
|
|
266
|
+
* const createIntentResult = await solverService.createIntent(payload, spokeProvider);
|
|
267
|
+
*
|
|
268
|
+
* if (createIntentResult.ok) {
|
|
269
|
+
* const [txResult, intent] = createIntentResult.value;
|
|
270
|
+
* console.log('Intent:', intent);
|
|
271
|
+
*
|
|
173
272
|
*/
|
|
174
273
|
createIntent<S extends SpokeProvider, R extends boolean = false>(params: CreateIntentParams, spokeProvider: S, fee?: PartnerFee, raw?: R): Promise<Result<[TxReturnType<S, R>, Intent & FeeAmount], IntentSubmitError<'CREATION_FAILED'>>>;
|
|
175
274
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolverService.d.ts","sourceRoot":"","sources":["../../../src/services/solver/SolverService.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,cAAc,EAEnB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EAElB,KAAK,8BAA8B,EAWpC,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAEV,SAAS,EAET,OAAO,EACP,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,UAAU,EACV,MAAM,EACN,kBAAkB,EAElB,YAAY,EACb,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"SolverService.d.ts","sourceRoot":"","sources":["../../../src/services/solver/SolverService.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,cAAc,EAEnB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EAElB,KAAK,8BAA8B,EAWpC,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAEV,SAAS,EAET,OAAO,EACP,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,UAAU,EACV,MAAM,EACN,kBAAkB,EAElB,YAAY,EACb,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,GAAG,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EAAE,CAAC,SAAS,OAAO,GAAG,KAAK,EAC1E,MAAM,EAAE,kBAAkB,EAC1B,aAAa,EAAE,CAAC,EAChB,GAAG,CAAC,EAAE,UAAU,EAChB,GAAG,CAAC,EAAE,CAAC,GACN,OAAO,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,CAAC;IA6DlG;;;;;;OAMG;IACU,YAAY,CAAC,CAAC,SAAS,aAAa,EAAE,CAAC,SAAS,OAAO,GAAG,KAAK,EAC1E,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,CAAC,EAChB,GAAG,CAAC,EAAE,CAAC,GACN,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAmB9B;;;;OAIG;IACI,SAAS,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;IAI/C;;;;OAIG;IACI,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG1C"}
|
|
@@ -3,7 +3,7 @@ import { DEFAULT_RELAYER_API_ENDPOINT, DEFAULT_RELAY_TX_TIMEOUT, Erc20Service, E
|
|
|
3
3
|
import { EvmWalletAbstraction } from '../hub/EvmWalletAbstraction.js';
|
|
4
4
|
import { EvmSolverService } from './EvmSolverService.js';
|
|
5
5
|
import { SolverApiService } from './SolverApiService.js';
|
|
6
|
-
import { SONIC_MAINNET_CHAIN_ID } from '@sodax/types';
|
|
6
|
+
import { SONIC_MAINNET_CHAIN_ID, } from '@sodax/types';
|
|
7
7
|
// Data types for arbitrary data
|
|
8
8
|
export var IntentDataType;
|
|
9
9
|
(function (IntentDataType) {
|
|
@@ -43,19 +43,23 @@ export class SolverService {
|
|
|
43
43
|
* @returns {Promise<Result<IntentQuoteResponse, IntentErrorResponse>>} The intent quote response
|
|
44
44
|
*
|
|
45
45
|
* @example
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* "
|
|
49
|
-
* "
|
|
50
|
-
* "
|
|
51
|
-
* "token_dst_blockchain_id":"42161",
|
|
46
|
+
* const payload = {
|
|
47
|
+
* "token_src":"0x2170Ed0880ac9A755fd29B2688956BD959F933F8", // BSC ETH token address
|
|
48
|
+
* "token_dst":"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", // ARB WBTC token address
|
|
49
|
+
* "token_src_blockchain_id":"0x38.bsc",
|
|
50
|
+
* "token_dst_blockchain_id":"0xa4b1.arbitrum",
|
|
52
51
|
* "amount":1000000000000000n,
|
|
53
52
|
* "quote_type": "exact_input"
|
|
54
53
|
* } satisfies IntentQuoteRequest
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
54
|
+
*
|
|
55
|
+
* const response = await solverService.getQuote(payload);
|
|
56
|
+
*
|
|
57
|
+
* if (response.ok) {
|
|
58
|
+
* const quotedAmount = response.value.quoted_amount;
|
|
59
|
+
* console.log('Quoted amount:', quotedAmount);
|
|
60
|
+
* } else {
|
|
61
|
+
* console.error('Quote failed:', response.error);
|
|
62
|
+
* }
|
|
59
63
|
*/
|
|
60
64
|
async getQuote(payload) {
|
|
61
65
|
return SolverApiService.getQuote(payload, this.config);
|
|
@@ -64,6 +68,10 @@ export class SolverService {
|
|
|
64
68
|
* Get the fee for a given input amount
|
|
65
69
|
* @param {bigint} inputAmount - The amount of input tokens
|
|
66
70
|
* @returns {Promise<bigint>} The fee amount (denominated in input tokens)
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* const fee: bigint = await solverService.getFee(1000000000000000n);
|
|
74
|
+
* console.log('Fee:', fee);
|
|
67
75
|
*/
|
|
68
76
|
async getFee(inputAmount) {
|
|
69
77
|
if (!this.config.partnerFee) {
|
|
@@ -77,40 +85,41 @@ export class SolverService {
|
|
|
77
85
|
* @returns {Promise<Result<IntentStatusResponse, IntentErrorResponse>>} The intent status response
|
|
78
86
|
*
|
|
79
87
|
* @example
|
|
80
|
-
*
|
|
81
|
-
* {
|
|
88
|
+
* const intentStatusRequest = {
|
|
82
89
|
* "intentHash": "a0dd7652-b360-4123-ab2d-78cfbcd20c6b"
|
|
83
|
-
* }
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
90
|
+
* } satisfies IntentStatusRequest
|
|
91
|
+
*
|
|
92
|
+
* const response = await solverService.getStatus(intentStatusRequest);
|
|
93
|
+
*
|
|
94
|
+
* if (response.ok) {
|
|
95
|
+
* const { status, intent_hash } = response.value;
|
|
96
|
+
* console.log('Status:', status);
|
|
97
|
+
* console.log('Intent hash:', intent_hash);
|
|
98
|
+
* } else {
|
|
99
|
+
* // handle error
|
|
88
100
|
* }
|
|
89
101
|
*/
|
|
90
102
|
async getStatus(intentStatusRequest) {
|
|
91
103
|
return SolverApiService.getStatus(intentStatusRequest, this.config);
|
|
92
104
|
}
|
|
93
105
|
/**
|
|
94
|
-
* Post execution of intent order to Solver API
|
|
106
|
+
* Post execution of intent order transaction executed on hub chain to Solver API
|
|
95
107
|
* @param {IntentExecutionRequest} intentExecutionRequest - The intent execution request
|
|
96
108
|
* @returns {Promise<Result<IntentExecutionResponse, IntentErrorResponse>>} The intent execution response
|
|
97
109
|
*
|
|
98
110
|
* @example
|
|
99
|
-
*
|
|
100
|
-
* {
|
|
111
|
+
* const intentExecutionRequest = {
|
|
101
112
|
* "intent_tx_hash": "0xba3dce19347264db32ced212ff1a2036f20d9d2c7493d06af15027970be061af",
|
|
102
|
-
*
|
|
103
|
-
*
|
|
113
|
+
* } satisfies IntentExecutionRequest
|
|
114
|
+
*
|
|
115
|
+
* const response = await solverService.postExecution(intentExecutionRequest);
|
|
104
116
|
*
|
|
105
|
-
*
|
|
106
|
-
* {
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* "task_id":"a0dd7652-b360-4123-ab2d-78cfbcd20c6b"
|
|
112
|
-
* }
|
|
113
|
-
* }
|
|
117
|
+
* if (response.ok) {
|
|
118
|
+
* const { answer, intent_hash } = response.value;
|
|
119
|
+
* console.log('Answer:', answer);
|
|
120
|
+
* console.log('Intent hash:', intent_hash);
|
|
121
|
+
* } else {
|
|
122
|
+
* // handle error
|
|
114
123
|
* }
|
|
115
124
|
*/
|
|
116
125
|
async postExecution(intentExecutionRequest) {
|
|
@@ -120,8 +129,35 @@ export class SolverService {
|
|
|
120
129
|
* Creates an intent and submits it to the Solver API and Relayer API
|
|
121
130
|
* @param {CreateIntentParams} payload - The intent to create
|
|
122
131
|
* @param {ISpokeProvider} spokeProvider - The spoke provider
|
|
123
|
-
* @param {number} timeout - The timeout in milliseconds for the transaction. Default is
|
|
124
|
-
* @returns {Promise<Result<IntentExecutionResponse,
|
|
132
|
+
* @param {number} timeout - The timeout in milliseconds for the transaction. Default is 60 seconds.
|
|
133
|
+
* @returns {Promise<Result<[IntentExecutionResponse, Intent, PacketData], IntentSubmitError<IntentSubmitErrorCode>>>} The intent execution response, intent, and packet data
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* const payload = {
|
|
137
|
+
* "inputToken": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", // BSC ETH token address
|
|
138
|
+
* "outputToken": "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", // ARB WBTC token address
|
|
139
|
+
* "inputAmount": 1000000000000000n, // The amount of input tokens
|
|
140
|
+
* "minOutputAmount": 900000000000000n, // min amount you are expecting to receive
|
|
141
|
+
* "deadline": 0n, // Optional timestamp after which intent expires (0 = no deadline)
|
|
142
|
+
* "allowPartialFill": false, // Whether the intent can be partially filled
|
|
143
|
+
* "srcChain": "0x38.bsc", // Chain ID where input tokens originate
|
|
144
|
+
* "dstChain": "0xa4b1.arbitrum", // Chain ID where output tokens should be delivered
|
|
145
|
+
* "srcAddress": "0x..", // Source address in bytes (original address on spoke chain)
|
|
146
|
+
* "dstAddress": "0x...", // Destination address in bytes (original address on spoke chain)
|
|
147
|
+
* "solver": "0x..", // Optional specific solver address (address(0) = any solver)
|
|
148
|
+
* "data": "0x..", // Additional arbitrary data
|
|
149
|
+
* } satisfies CreateIntentParams;
|
|
150
|
+
*
|
|
151
|
+
* const createAndSubmitIntentResult = await solverService.createAndSubmitIntent(payload, spokeProvider);
|
|
152
|
+
*
|
|
153
|
+
* if (createAndSubmitIntentResult.ok) {
|
|
154
|
+
* const [intentExecutionResponse, intent, packetData] = createAndSubmitIntentResult.value;
|
|
155
|
+
* console.log('Intent execution response:', intentExecutionResponse);
|
|
156
|
+
* console.log('Intent:', intent);
|
|
157
|
+
* console.log('Packet data:', packetData);
|
|
158
|
+
* } else {
|
|
159
|
+
* // handle error
|
|
160
|
+
* }
|
|
125
161
|
*/
|
|
126
162
|
async createAndSubmitIntent(payload, spokeProvider, fee, timeout = DEFAULT_RELAY_TX_TIMEOUT) {
|
|
127
163
|
try {
|
|
@@ -201,6 +237,32 @@ export class SolverService {
|
|
|
201
237
|
* @param {CreateIntentParams} params - The intent to create
|
|
202
238
|
* @param {SpokeProvider} spokeProvider - The spoke provider
|
|
203
239
|
* @return {Promise<Result<boolean>>} - valid = true, invalid = false
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* const payload = {
|
|
243
|
+
* "inputToken": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", // BSC ETH token address
|
|
244
|
+
* "outputToken": "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", // ARB WBTC token address
|
|
245
|
+
* "inputAmount": 1000000000000000n, // The amount of input tokens
|
|
246
|
+
* "minOutputAmount": 900000000000000n, // min amount you are expecting to receive
|
|
247
|
+
* "deadline": 0n, // Optional timestamp after which intent expires (0 = no deadline)
|
|
248
|
+
* "allowPartialFill": false, // Whether the intent can be partially filled
|
|
249
|
+
* "srcChain": "0x38.bsc", // Chain ID where input tokens originate
|
|
250
|
+
* "dstChain": "0xa4b1.arbitrum", // Chain ID where output tokens should be delivered
|
|
251
|
+
* "srcAddress": "0x..", // Source address in bytes (original address on spoke chain)
|
|
252
|
+
* "dstAddress": "0x...", // Destination address in bytes (original address on spoke chain)
|
|
253
|
+
* "solver": "0x..", // Optional specific solver address (address(0) = any solver)
|
|
254
|
+
* "data": "0x..", // Additional arbitrary data
|
|
255
|
+
* } satisfies CreateIntentParams;
|
|
256
|
+
*
|
|
257
|
+
* const isAllowanceValid = await solverService.isAllowanceValid(payload, spokeProvider);
|
|
258
|
+
*
|
|
259
|
+
* if (!allowanceValid.ok) {
|
|
260
|
+
* // Handle error
|
|
261
|
+
* }
|
|
262
|
+
*
|
|
263
|
+
* if (!allowanceValid.value) {
|
|
264
|
+
* // Need to approve
|
|
265
|
+
* }
|
|
204
266
|
*/
|
|
205
267
|
async isAllowanceValid(params, spokeProvider) {
|
|
206
268
|
try {
|
|
@@ -221,11 +283,26 @@ export class SolverService {
|
|
|
221
283
|
}
|
|
222
284
|
}
|
|
223
285
|
/**
|
|
224
|
-
* Approve
|
|
286
|
+
* Approve amount spending (currently required for EVM only)
|
|
225
287
|
* @param token - ERC20 token address
|
|
226
288
|
* @param amount - Amount to approve
|
|
227
|
-
* @param
|
|
289
|
+
* @param spender - Spender address
|
|
228
290
|
* @param spokeProvider - Spoke provider
|
|
291
|
+
* @returns {Promise<Result<EvmRawTransactionReceipt>>} - Returns the transaction receipt
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* const approveResult = await approve(
|
|
295
|
+
* '0x...', // ERC20 token address
|
|
296
|
+
* 1000n, // Amount to approve (in token decimals)
|
|
297
|
+
* '0x...', // Spender address (usually the asset manager contract: spokeProvider.chainConfig.addresses.assetManager)
|
|
298
|
+
* spokeProvider
|
|
299
|
+
* );
|
|
300
|
+
*
|
|
301
|
+
* if (!approveResult.ok) {
|
|
302
|
+
* // Handle error
|
|
303
|
+
* }
|
|
304
|
+
*
|
|
305
|
+
* const txReceipt = approveResult.value;
|
|
229
306
|
*/
|
|
230
307
|
async approve(token, amount, address, spokeProvider) {
|
|
231
308
|
try {
|
|
@@ -251,7 +328,30 @@ export class SolverService {
|
|
|
251
328
|
* @param {SpokeProvider} spokeProvider - The spoke provider
|
|
252
329
|
* @param {boolean} raw - Whether to return the raw transaction
|
|
253
330
|
* @param {PartnerFee} fee - The fee to apply to the intent
|
|
254
|
-
* @returns {Promise<[TxReturnType<
|
|
331
|
+
* @returns {Promise<Result<[TxReturnType<S, R>, Intent & FeeAmount], IntentSubmitError<'CREATION_FAILED'>>>} The encoded contract call
|
|
332
|
+
*
|
|
333
|
+
* @example
|
|
334
|
+
* const payload = {
|
|
335
|
+
* "inputToken": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", // BSC ETH token address
|
|
336
|
+
* "outputToken": "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", // ARB WBTC token address
|
|
337
|
+
* "inputAmount": 1000000000000000n, // The amount of input tokens
|
|
338
|
+
* "minOutputAmount": 900000000000000n, // min amount you are expecting to receive
|
|
339
|
+
* "deadline": 0n, // Optional timestamp after which intent expires (0 = no deadline)
|
|
340
|
+
* "allowPartialFill": false, // Whether the intent can be partially filled
|
|
341
|
+
* "srcChain": "0x38.bsc", // Chain ID where input tokens originate
|
|
342
|
+
* "dstChain": "0xa4b1.arbitrum", // Chain ID where output tokens should be delivered
|
|
343
|
+
* "srcAddress": "0x..", // Source address in bytes (original address on spoke chain)
|
|
344
|
+
* "dstAddress": "0x...", // Destination address in bytes (original address on spoke chain)
|
|
345
|
+
* "solver": "0x..", // Optional specific solver address (address(0) = any solver)
|
|
346
|
+
* "data": "0x..", // Additional arbitrary data
|
|
347
|
+
* } satisfies CreateIntentParams;
|
|
348
|
+
*
|
|
349
|
+
* const createIntentResult = await solverService.createIntent(payload, spokeProvider);
|
|
350
|
+
*
|
|
351
|
+
* if (createIntentResult.ok) {
|
|
352
|
+
* const [txResult, intent] = createIntentResult.value;
|
|
353
|
+
* console.log('Intent:', intent);
|
|
354
|
+
*
|
|
255
355
|
*/
|
|
256
356
|
async createIntent(params, spokeProvider, fee, raw) {
|
|
257
357
|
invariant(isValidOriginalAssetAddress(params.srcChain, params.inputToken), `Unsupported spoke chain token (params.srcChain): ${params.srcChain}, params.inputToken): ${params.inputToken}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolverService.js","sourceRoot":"","sources":["../../../src/services/solver/SolverService.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,YAAY,EAEZ,gBAAgB,EAKhB,YAAY,EAEZ,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"SolverService.js","sourceRoot":"","sources":["../../../src/services/solver/SolverService.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,YAAY,EAEZ,gBAAgB,EAKhB,YAAY,EAEZ,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAoBxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACL,sBAAsB,GAMvB,MAAM,cAAc,CAAC;AAkCtB,gCAAgC;AAChC,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,iDAAO,CAAA;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