@jimmygu/sfa-sdk-test 1.0.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.
@@ -0,0 +1,1043 @@
1
+ import { ethers } from 'ethers';
2
+ import * as _solana_web3_js from '@solana/web3.js';
3
+ import { Connection, PublicKey } from '@solana/web3.js';
4
+
5
+ type ApiRequestOptions = {
6
+ readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
7
+ readonly url: string;
8
+ readonly path?: Record<string, any>;
9
+ readonly cookies?: Record<string, any>;
10
+ readonly headers?: Record<string, any>;
11
+ readonly query?: Record<string, any>;
12
+ readonly formData?: Record<string, any>;
13
+ readonly body?: any;
14
+ readonly mediaType?: string;
15
+ readonly responseHeader?: string;
16
+ readonly errors?: Record<number, string>;
17
+ };
18
+
19
+ type ApiResult = {
20
+ readonly url: string;
21
+ readonly ok: boolean;
22
+ readonly status: number;
23
+ readonly statusText: string;
24
+ readonly body: any;
25
+ };
26
+
27
+ declare class ApiError extends Error {
28
+ readonly url: string;
29
+ readonly status: number;
30
+ readonly statusText: string;
31
+ readonly body: any;
32
+ readonly request: ApiRequestOptions;
33
+ constructor(request: ApiRequestOptions, response: ApiResult, message: string);
34
+ }
35
+
36
+ declare class CancelError extends Error {
37
+ constructor(message: string);
38
+ get isCancelled(): boolean;
39
+ }
40
+ interface OnCancel {
41
+ readonly isResolved: boolean;
42
+ readonly isRejected: boolean;
43
+ readonly isCancelled: boolean;
44
+ (cancelHandler: () => void): void;
45
+ }
46
+ declare class CancelablePromise<T> implements Promise<T> {
47
+ #private;
48
+ constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void);
49
+ get [Symbol.toStringTag](): string;
50
+ then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
51
+ catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
52
+ finally(onFinally?: (() => void) | null): Promise<T>;
53
+ cancel(): void;
54
+ get isCancelled(): boolean;
55
+ }
56
+
57
+ type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
58
+ type Headers = Record<string, string>;
59
+ type OpenAPIConfig = {
60
+ BASE: string;
61
+ VERSION: string;
62
+ WITH_CREDENTIALS: boolean;
63
+ CREDENTIALS: 'include' | 'omit' | 'same-origin';
64
+ TOKEN?: string | Resolver<string> | undefined;
65
+ USERNAME?: string | Resolver<string> | undefined;
66
+ PASSWORD?: string | Resolver<string> | undefined;
67
+ HEADERS?: Headers | Resolver<Headers> | undefined;
68
+ ENCODE_PATH?: ((path: string) => string) | undefined;
69
+ };
70
+ declare const OpenAPI: OpenAPIConfig;
71
+
72
+ type AppFee = {
73
+ /**
74
+ * Account ID within Intents to which this fee will be transferred
75
+ */
76
+ recipient: string;
77
+ /**
78
+ * Fee for this recipient as part of amountIn in basis points (1/100th of a percent), e.g. 100 for 1% fee
79
+ */
80
+ fee: number;
81
+ };
82
+
83
+ type BadRequestResponse = {
84
+ message: string;
85
+ };
86
+
87
+ type Quote = {
88
+ /**
89
+ * The deposit address on the chain of `originAsset` when `depositType` is `ORIGIN_CHAIN`.
90
+ *
91
+ * The deposit address inside NEAR Intents (the verifier smart contract) when `depositType` is `INTENTS`.
92
+ */
93
+ depositAddress?: string;
94
+ /**
95
+ * Some of the deposit addresses **REQUIRE** to also include the `memo` for the deposit to be processed
96
+ */
97
+ depositMemo?: string;
98
+ /**
99
+ * Amount of the origin asset
100
+ */
101
+ amountIn: string;
102
+ /**
103
+ * Amount of the origin asset in readable format
104
+ */
105
+ amountInFormatted: string;
106
+ /**
107
+ * Amount of the origin assets equivalent in USD
108
+ */
109
+ amountInUsd: string;
110
+ /**
111
+ * Minimum amount of the origin asset that will be used for the swap
112
+ */
113
+ minAmountIn: string;
114
+ /**
115
+ * Amount of the destination asset
116
+ */
117
+ amountOut: string;
118
+ /**
119
+ * Amount of the destination asset in readable format
120
+ */
121
+ amountOutFormatted: string;
122
+ /**
123
+ * Amount of the destination asset equivalent in USD
124
+ */
125
+ amountOutUsd: string;
126
+ /**
127
+ * Minimum output amount after slippage is applied
128
+ */
129
+ minAmountOut: string;
130
+ /**
131
+ * Time when the deposit address becomes inactive and funds may be lost
132
+ */
133
+ deadline?: string;
134
+ /**
135
+ * Time when the deposit address becomes cold, causing swap processing to take longer
136
+ */
137
+ timeWhenInactive?: string;
138
+ /**
139
+ * Estimated time in seconds for the swap to be executed after the deposit transaction is confirmed
140
+ */
141
+ timeEstimate: number;
142
+ /**
143
+ * EVM address of a transfer recipient in a virtual chain
144
+ */
145
+ virtualChainRecipient?: string;
146
+ /**
147
+ * EVM address of a refund recipient in a virtual chain
148
+ */
149
+ virtualChainRefundRecipient?: string;
150
+ };
151
+
152
+ type QuoteRequest = {
153
+ /**
154
+ * Flag indicating whether this is a dry run request.
155
+ * If `true`, the response will **NOT** contain the following fields:
156
+ * - `depositAddress`
157
+ * - `timeWhenInactive`
158
+ * - `deadline`
159
+ */
160
+ dry: boolean;
161
+ /**
162
+ * What deposit address mode you will get in the response, most chain supports only `SIMPLE` and some(for example `stellar`) only `MEMO`:
163
+ * - `SIMPLE` - usual deposit with only deposit address.
164
+ * - `MEMO` - some chains will **REQUIRE** the `memo` together with `depositAddress` for swap to work.
165
+ */
166
+ depositMode?: QuoteRequest.depositMode;
167
+ /**
168
+ * How to interpret `amount` when performing the swap:
169
+ * - `EXACT_INPUT` - requests the output amount for an exact input.
170
+ * - `EXACT_OUTPUT` - requests the input amount for an exact output. The `refundTo` address always receives any excess tokens after the swap is complete.
171
+ * - `FLEX_INPUT` - a flexible input amount that allows for partial deposits and variable amounts.
172
+ */
173
+ swapType: QuoteRequest.swapType;
174
+ /**
175
+ * Slippage tolerance for the swap. This value is in basis points (1/100th of a percent), e.g. 100 for 1% slippage.
176
+ */
177
+ slippageTolerance: number;
178
+ /**
179
+ * ID of the origin asset.
180
+ */
181
+ originAsset: string;
182
+ /**
183
+ * Type of deposit address:
184
+ * - `ORIGIN_CHAIN` - deposit address on the origin chain.
185
+ * - `INTENTS` - the account ID within NEAR Intents to which you should transfer assets.
186
+ */
187
+ depositType: QuoteRequest.depositType;
188
+ /**
189
+ * ID of the destination asset.
190
+ */
191
+ destinationAsset: string;
192
+ /**
193
+ * Amount to swap as the base amount. It is interpreted as the input or output amount based on the `swapType` flag and is specified in the smallest unit of the currency (e.g., wei for ETH).
194
+ */
195
+ amount: string;
196
+ /**
197
+ * Address used for refunds.
198
+ */
199
+ refundTo: string;
200
+ /**
201
+ * Type of refund address:
202
+ * - `ORIGIN_CHAIN` - assets are refunded to the `refundTo` address on the origin chain.
203
+ * - `INTENTS` - assets are refunded to the `refundTo` Intents account.
204
+ */
205
+ refundType: QuoteRequest.refundType;
206
+ /**
207
+ * Recipient address. The format must match `recipientType`.
208
+ */
209
+ recipient: string;
210
+ /**
211
+ * EVM address of a transfer recipient in a virtual chain
212
+ */
213
+ virtualChainRecipient?: string;
214
+ /**
215
+ * EVM address of a refund recipient in a virtual chain
216
+ */
217
+ virtualChainRefundRecipient?: string;
218
+ /**
219
+ * Type of recipient address:
220
+ * - `DESTINATION_CHAIN` - assets are transferred to the chain of `destinationAsset`.
221
+ * - `INTENTS` - assets are transferred to an account inside Intents
222
+ */
223
+ recipientType: QuoteRequest.recipientType;
224
+ /**
225
+ * Timestamp in ISO format that identifies when the user refund begins if the swap isn't completed by then. It must exceed the time required for the deposit transaction to be mined. For example, Bitcoin may require around one hour depending on the fees paid.
226
+ */
227
+ deadline: string;
228
+ /**
229
+ * Referral identifier (lowercase only). It will be reflected in the on-chain data and displayed on public analytics platforms.
230
+ */
231
+ referral?: string;
232
+ /**
233
+ * Time in milliseconds the user is willing to wait for a quote from the relay.
234
+ */
235
+ quoteWaitingTimeMs?: number;
236
+ /**
237
+ * List of recipients and their fees
238
+ */
239
+ appFees?: Array<AppFee>;
240
+ };
241
+ declare namespace QuoteRequest {
242
+ /**
243
+ * What deposit address mode you will get in the response, most chain supports only `SIMPLE` and some(for example `stellar`) only `MEMO`:
244
+ * - `SIMPLE` - usual deposit with only deposit address.
245
+ * - `MEMO` - some chains will **REQUIRE** the `memo` together with `depositAddress` for swap to work.
246
+ */
247
+ enum depositMode {
248
+ SIMPLE = "SIMPLE",
249
+ MEMO = "MEMO"
250
+ }
251
+ /**
252
+ * How to interpret `amount` when performing the swap:
253
+ * - `EXACT_INPUT` - requests the output amount for an exact input.
254
+ * - `EXACT_OUTPUT` - requests the input amount for an exact output. The `refundTo` address always receives any excess tokens after the swap is complete.
255
+ * - `FLEX_INPUT` - a flexible input amount that allows for partial deposits and variable amounts.
256
+ */
257
+ enum swapType {
258
+ EXACT_INPUT = "EXACT_INPUT",
259
+ EXACT_OUTPUT = "EXACT_OUTPUT",
260
+ FLEX_INPUT = "FLEX_INPUT"
261
+ }
262
+ /**
263
+ * Type of deposit address:
264
+ * - `ORIGIN_CHAIN` - deposit address on the origin chain.
265
+ * - `INTENTS` - the account ID within NEAR Intents to which you should transfer assets.
266
+ */
267
+ enum depositType {
268
+ ORIGIN_CHAIN = "ORIGIN_CHAIN",
269
+ INTENTS = "INTENTS"
270
+ }
271
+ /**
272
+ * Type of refund address:
273
+ * - `ORIGIN_CHAIN` - assets are refunded to the `refundTo` address on the origin chain.
274
+ * - `INTENTS` - assets are refunded to the `refundTo` Intents account.
275
+ */
276
+ enum refundType {
277
+ ORIGIN_CHAIN = "ORIGIN_CHAIN",
278
+ INTENTS = "INTENTS"
279
+ }
280
+ /**
281
+ * Type of recipient address:
282
+ * - `DESTINATION_CHAIN` - assets are transferred to the chain of `destinationAsset`.
283
+ * - `INTENTS` - assets are transferred to an account inside Intents
284
+ */
285
+ enum recipientType {
286
+ DESTINATION_CHAIN = "DESTINATION_CHAIN",
287
+ INTENTS = "INTENTS"
288
+ }
289
+ }
290
+
291
+ type QuoteResponse = {
292
+ /**
293
+ * Timestamp in ISO format that was used to derive the deposit address
294
+ */
295
+ timestamp: string;
296
+ /**
297
+ * Signature of the StableFlow service confirming the quote for the specific deposit address. Must be saved on the client side (along with the whole quote) in order to resolve any disputes or mistakes.
298
+ */
299
+ signature: string;
300
+ /**
301
+ * User request
302
+ */
303
+ quoteRequest: QuoteRequest;
304
+ /**
305
+ * Response containing the deposit address for sending the `amount` of `originAsset` and the expected output amount.
306
+ */
307
+ quote: Quote;
308
+ };
309
+
310
+ type TransactionDetails = {
311
+ /**
312
+ * Transaction hash
313
+ */
314
+ hash: string;
315
+ /**
316
+ * Explorer URL for the transaction
317
+ */
318
+ explorerUrl: string;
319
+ };
320
+
321
+ type SwapDetails = {
322
+ /**
323
+ * All intent hashes that took part in this swap
324
+ */
325
+ intentHashes: Array<string>;
326
+ /**
327
+ * All NEAR transactions executed for this swap
328
+ */
329
+ nearTxHashes: Array<string>;
330
+ /**
331
+ * Exact amount of `originToken` after the trade was settled
332
+ */
333
+ amountIn?: string;
334
+ /**
335
+ * Exact amount of `originToken` in readable format after the trade was settled
336
+ */
337
+ amountInFormatted?: string;
338
+ /**
339
+ * Exact amount of `originToken` equivalent in USD
340
+ */
341
+ amountInUsd?: string;
342
+ /**
343
+ * Exact amount of `destinationToken` after the trade was settled
344
+ */
345
+ amountOut?: string;
346
+ /**
347
+ * Exact amount of `destinationToken` in readable format after the trade was settled
348
+ */
349
+ amountOutFormatted?: string;
350
+ /**
351
+ * Exact amount of `destinationToken` equivalent in USD
352
+ */
353
+ amountOutUsd?: string;
354
+ /**
355
+ * Actual slippage
356
+ */
357
+ slippage?: number;
358
+ /**
359
+ * Hashes and explorer URLs for all transactions on the origin chain
360
+ */
361
+ originChainTxHashes: Array<TransactionDetails>;
362
+ /**
363
+ * Hashes and explorer URLs for all transactions on the destination chain
364
+ */
365
+ destinationChainTxHashes: Array<TransactionDetails>;
366
+ /**
367
+ * Amount of `originAsset` transferred to `refundTo`
368
+ */
369
+ refundedAmount?: string;
370
+ /**
371
+ * Refunded amount in readable format
372
+ */
373
+ refundedAmountFormatted?: string;
374
+ /**
375
+ * Refunded amount equivalent in USD
376
+ */
377
+ refundedAmountUsd?: string;
378
+ };
379
+
380
+ type GetExecutionStatusResponse = {
381
+ /**
382
+ * Quote response from the original request
383
+ */
384
+ quoteResponse: QuoteResponse;
385
+ status: GetExecutionStatusResponse.status;
386
+ /**
387
+ * Last time the state was updated
388
+ */
389
+ updatedAt: string;
390
+ /**
391
+ * Details of actual swaps and withdrawals
392
+ */
393
+ swapDetails: SwapDetails;
394
+ };
395
+ declare namespace GetExecutionStatusResponse {
396
+ enum status {
397
+ KNOWN_DEPOSIT_TX = "KNOWN_DEPOSIT_TX",
398
+ PENDING_DEPOSIT = "PENDING_DEPOSIT",
399
+ INCOMPLETE_DEPOSIT = "INCOMPLETE_DEPOSIT",
400
+ PROCESSING = "PROCESSING",
401
+ SUCCESS = "SUCCESS",
402
+ REFUNDED = "REFUNDED",
403
+ FAILED = "FAILED"
404
+ }
405
+ }
406
+
407
+ type SubmitDepositTxRequest = {
408
+ /**
409
+ * Transaction hash of your deposit
410
+ */
411
+ txHash: string;
412
+ /**
413
+ * Deposit address for the quote
414
+ */
415
+ depositAddress: string;
416
+ };
417
+
418
+ type SubmitDepositTxResponse = {
419
+ /**
420
+ * Quote response from the original request
421
+ */
422
+ quoteResponse: QuoteResponse;
423
+ status: SubmitDepositTxResponse.status;
424
+ /**
425
+ * Last time the state was updated
426
+ */
427
+ updatedAt: string;
428
+ /**
429
+ * Details of actual swaps and withdrawals
430
+ */
431
+ swapDetails: SwapDetails;
432
+ };
433
+ declare namespace SubmitDepositTxResponse {
434
+ enum status {
435
+ KNOWN_DEPOSIT_TX = "KNOWN_DEPOSIT_TX",
436
+ PENDING_DEPOSIT = "PENDING_DEPOSIT",
437
+ INCOMPLETE_DEPOSIT = "INCOMPLETE_DEPOSIT",
438
+ PROCESSING = "PROCESSING",
439
+ SUCCESS = "SUCCESS",
440
+ REFUNDED = "REFUNDED",
441
+ FAILED = "FAILED"
442
+ }
443
+ }
444
+
445
+ type TokenResponse = {
446
+ /**
447
+ * Unique asset identifier
448
+ */
449
+ assetId: string;
450
+ /**
451
+ * Number of decimals for the token
452
+ */
453
+ decimals: number;
454
+ /**
455
+ * Blockchain associated with the token
456
+ */
457
+ blockchain: TokenResponse.blockchain;
458
+ /**
459
+ * Token symbol (e.g. BTC, ETH)
460
+ */
461
+ symbol: string;
462
+ /**
463
+ * Current price of the token in USD
464
+ */
465
+ price: number;
466
+ /**
467
+ * Date when the token price was last updated
468
+ */
469
+ priceUpdatedAt: string;
470
+ /**
471
+ * Contract address of the token
472
+ */
473
+ contractAddress?: string;
474
+ };
475
+ declare namespace TokenResponse {
476
+ /**
477
+ * Blockchain associated with the token
478
+ */
479
+ enum blockchain {
480
+ NEAR = "near",
481
+ ETH = "eth",
482
+ BASE = "base",
483
+ ARB = "arb",
484
+ BTC = "btc",
485
+ SOL = "sol",
486
+ TON = "ton",
487
+ DOGE = "doge",
488
+ XRP = "xrp",
489
+ ZEC = "zec",
490
+ GNOSIS = "gnosis",
491
+ BERA = "bera",
492
+ BSC = "bsc",
493
+ POL = "pol",
494
+ TRON = "tron",
495
+ SUI = "sui",
496
+ OP = "op",
497
+ AVAX = "avax",
498
+ CARDANO = "cardano"
499
+ }
500
+ }
501
+
502
+ type ServiceType = "oneclick" | "usdt0" | "cctp";
503
+ declare const Service: {
504
+ readonly OneClick: "oneclick";
505
+ readonly Usdt0: "usdt0";
506
+ readonly CCTP: "cctp";
507
+ };
508
+
509
+ type ChainType = "near" | "sol" | "evm" | "tron" | "aptos";
510
+
511
+ interface ChainConfig {
512
+ chainName: string;
513
+ blockchain: string;
514
+ chainIcon: string;
515
+ chainIconGray: string;
516
+ chainType: ChainType;
517
+ chainId?: number;
518
+ blockExplorerUrl: string;
519
+ primaryColor: string;
520
+ nativeToken: {
521
+ symbol: string;
522
+ decimals: number;
523
+ };
524
+ rpcUrls: string[];
525
+ }
526
+
527
+ interface TokenConfig extends ChainConfig {
528
+ name: string;
529
+ symbol: string;
530
+ decimals: number;
531
+ icon: string;
532
+ assetId: string;
533
+ contractAddress: string;
534
+ services: ServiceType[];
535
+ }
536
+
537
+ declare enum SendType {
538
+ SEND = "SEND",
539
+ TRANSFER = "TRANSFER"
540
+ }
541
+
542
+ interface WalletConfig {
543
+ transfer(params: {
544
+ originAsset: string;
545
+ depositAddress: string;
546
+ amount: string;
547
+ }): Promise<string>;
548
+ getBalance(token: TokenConfig, account: string): Promise<string>;
549
+ balanceOf(token: TokenConfig, account: string): Promise<string>;
550
+ allowance?(params: {
551
+ contractAddress: string;
552
+ spender: string;
553
+ address: string;
554
+ amountWei: string | number | BigInt;
555
+ }): Promise<{
556
+ allowance: string;
557
+ needApprove: boolean;
558
+ }>;
559
+ approve?(params: {
560
+ contractAddress: string;
561
+ spender: string;
562
+ amountWei: string | number | BigInt;
563
+ isApproveMax?: boolean;
564
+ }): Promise<boolean>;
565
+ quote(type: ServiceType, params: {}): Promise<{
566
+ needApprove?: boolean;
567
+ approveSpender?: string;
568
+ sendParam?: any;
569
+ quoteParam: any;
570
+ fees?: Record<string, string>;
571
+ totalFeesUsd?: string;
572
+ estimateSourceGas?: BigInt;
573
+ estimateSourceGasUsd?: string;
574
+ estimateTime?: number;
575
+ outputAmount?: string;
576
+ }>;
577
+ send(type: SendType, params: any): Promise<string>;
578
+ }
579
+
580
+ declare enum TransactionStatus {
581
+ Pending = "pending",
582
+ Success = "success",
583
+ Failed = "failed"
584
+ }
585
+
586
+ interface GetAllQuoteParams {
587
+ singleService?: ServiceType;
588
+ dry?: boolean;
589
+ prices: Record<string, string>;
590
+ fromToken: TokenConfig;
591
+ toToken: TokenConfig;
592
+ wallet: WalletConfig;
593
+ recipient: string;
594
+ refundTo: string;
595
+ amountWei: string;
596
+ slippageTolerance: number;
597
+ minInputAmount?: string;
598
+ oneclickParams?: {
599
+ appFees?: {
600
+ recipient: string;
601
+ fee: number;
602
+ }[];
603
+ swapType?: "EXACT_INPUT" | "EXACT_OUTPUT";
604
+ };
605
+ }
606
+ /**
607
+ * StableFlow AI Service
608
+ * Main service class for interacting with the StableFlow AI API
609
+ */
610
+ declare class SFA {
611
+ /**
612
+ * Get supported tokens
613
+ * Retrieves a list of tokens currently supported by the StableFlow AI API for asset swaps.
614
+ *
615
+ * Each token entry includes its blockchain, contract address (if available), price in USD, and other metadata such as symbol and decimals.
616
+ * @returns TokenResponse
617
+ * @throws ApiError
618
+ * @deprecated Please use the import { tokens } from 'stableflow-ai-sdk';
619
+ */
620
+ static getTokens(): CancelablePromise<Array<TokenResponse>>;
621
+ /**
622
+ * Request a swap quote
623
+ * Generates a swap quote based on input parameters such as the assets, amount, slippage tolerance, and recipient/refund information.
624
+ *
625
+ * Returns pricing details, estimated time, and a unique **deposit address** to which tokens must be transferred to initiate the swap.
626
+ *
627
+ * You can set the `dry` parameter to `true` to simulate the quote request **without generating a deposit address** or initiating the swap process. This is useful for previewing swap parameters or validating input data without committing to an actual swap.
628
+ *
629
+ * This endpoint is the first required step in the swap process.
630
+ * @param requestBody
631
+ * @returns QuoteResponse
632
+ * @throws ApiError
633
+ * @deprecated Please use the getAllQuote
634
+ */
635
+ static getQuote(requestBody: QuoteRequest): CancelablePromise<QuoteResponse>;
636
+ /**
637
+ * Check swap execution status
638
+ * Retrieves the current status of a swap using the unique deposit address from the quote, if quote response included deposit memo, it is required as well.
639
+ *
640
+ * The response includes the state of the swap (e.g., pending, processing, success, refunded) and any associated swap and transaction details.
641
+ * @param depositAddress
642
+ * @param depositMemo
643
+ * @returns GetExecutionStatusResponse
644
+ * @throws ApiError
645
+ * @deprecated Please use the getStatus
646
+ */
647
+ static getExecutionStatus(depositAddress: string, depositMemo?: string): CancelablePromise<GetExecutionStatusResponse>;
648
+ /**
649
+ * Submit deposit transaction hash
650
+ * Optionally notifies the StableFlow AI service that a deposit has been sent to the specified address, using the blockchain transaction hash.
651
+ * Only for Oneclick project
652
+ *
653
+ * This step can speed up swap processing by allowing the system to preemptively verify the deposit.
654
+ * @param requestBody
655
+ * @returns SubmitDepositTxResponse
656
+ * @throws ApiError
657
+ * @deprecated the send method will submit the tx hash automatically
658
+ */
659
+ static submitDepositTx: (requestBody: SubmitDepositTxRequest) => CancelablePromise<SubmitDepositTxResponse>;
660
+ /**
661
+ * Get quotes from all available bridge services
662
+ * Retrieves quotes from all supported bridge services (OneClick, CCTP, USDT0) in parallel.
663
+ * Returns an array of quotes with their corresponding service types, allowing users to compare and select the best route.
664
+ *
665
+ * @param params Parameters for quote request including wallet, tokens, amount, etc.
666
+ * @returns Promise resolving to an array of quote results with service type information
667
+ * @throws Error if all bridge services fail or if required parameters are missing
668
+ */
669
+ static getAllQuote(params: GetAllQuoteParams): Promise<Array<{
670
+ serviceType: ServiceType;
671
+ quote?: any;
672
+ error?: string;
673
+ }>>;
674
+ /**
675
+ * Send transaction for the selected bridge route
676
+ * Executes the transaction using the specified bridge service based on the service type.
677
+ *
678
+ * @param serviceType The type of bridge service to use (oneclick, cctp, or usdt0)
679
+ * @param params Parameters for sending the transaction including wallet, tokens, deposit address, etc.
680
+ * @returns Promise resolving to the transaction hash or signature
681
+ * @throws Error if the service type is invalid or if the transaction fails
682
+ */
683
+ static send(serviceType: ServiceType, params: {
684
+ wallet: any;
685
+ quote: any;
686
+ }): Promise<string>;
687
+ /**
688
+ * Get transaction status for the selected bridge route
689
+ * Queries the transaction status from the specified bridge service.
690
+ *
691
+ * @param serviceType The type of bridge service used (oneclick, cctp, or usdt0)
692
+ * @param params Parameters for querying status including deposit address, transaction hash, etc.
693
+ * @returns Promise resolving to the transaction status response
694
+ * @throws Error if the service type is invalid or if the status query fails
695
+ */
696
+ static getStatus(serviceType: ServiceType, params: {
697
+ depositAddress?: string;
698
+ hash?: string;
699
+ }): Promise<{
700
+ status: TransactionStatus;
701
+ toChainTxHash?: string;
702
+ }>;
703
+ }
704
+
705
+ declare class EVMWallet {
706
+ provider: any;
707
+ signer: any;
708
+ constructor(_provider: any, _signer?: any);
709
+ transfer(data: {
710
+ originAsset: string;
711
+ depositAddress: string;
712
+ amount: string;
713
+ }): Promise<any>;
714
+ getBalance(token: any, account: string): Promise<any>;
715
+ balanceOf(token: any, account: string): Promise<any>;
716
+ /**
717
+ * Estimate gas limit for transfer transaction
718
+ * @param data Transfer data
719
+ * @returns Gas limit estimate, gas price, and estimated gas cost
720
+ */
721
+ estimateTransferGas(data: {
722
+ originAsset: string;
723
+ depositAddress: string;
724
+ amount: string;
725
+ }): Promise<{
726
+ gasLimit: bigint;
727
+ gasPrice: bigint;
728
+ estimateGas: bigint;
729
+ }>;
730
+ getContract(params: any): ethers.Contract;
731
+ allowance(params: any): Promise<{
732
+ contract: ethers.Contract;
733
+ allowance: string;
734
+ needApprove: boolean;
735
+ }>;
736
+ approve(params: any): Promise<boolean>;
737
+ getEstimateGas(params: any): Promise<{
738
+ gasPrice: any;
739
+ usd: string;
740
+ wei: bigint;
741
+ amount: string;
742
+ }>;
743
+ quoteOFT(params: any): Promise<any>;
744
+ sendTransaction(params: any): Promise<any>;
745
+ /**
746
+ * Unified quote method that routes to specific quote methods based on type
747
+ * @param type Service type from ServiceType
748
+ * @param params Parameters for the quote
749
+ */
750
+ quote(type: ServiceType, params: any): Promise<any>;
751
+ /**
752
+ * Unified send method that routes to specific send methods based on type
753
+ * @param type Send type from SendType enum
754
+ * @param params Parameters for the send transaction
755
+ */
756
+ send(type: SendType, params: any): Promise<any>;
757
+ quoteCCTP(params: any): Promise<any>;
758
+ quoteOneClickProxy(params: any): Promise<any>;
759
+ signTypedData(params: any): Promise<any>;
760
+ }
761
+
762
+ declare class HyperliquidService {
763
+ quote(params: HyperliquidQuoteParams): Promise<{
764
+ quote: any;
765
+ error: string | null;
766
+ }>;
767
+ transfer(params: HyperliquidTransferParams): Promise<string>;
768
+ deposit(params: HyperliquidDepositParams): Promise<void>;
769
+ getStatus(params: HyperliquidGetStatusParams): Promise<void>;
770
+ protected generatePermit(params: HyperliquidGeneratePermitParams): Promise<{
771
+ deadline: string;
772
+ owner: string;
773
+ r: string;
774
+ s: string;
775
+ spender: string;
776
+ token: string;
777
+ v: 28 | 27;
778
+ value: string;
779
+ }>;
780
+ }
781
+ declare const Hyperliquid: HyperliquidService;
782
+ declare const HyperliquidFromTokens: TokenConfig[];
783
+ declare const HyperliuquidToToken: TokenConfig;
784
+ interface HyperliquidQuoteParams {
785
+ slippageTolerance: number;
786
+ refundTo: string;
787
+ recipient: string;
788
+ wallet: WalletConfig;
789
+ fromToken: TokenConfig;
790
+ prices: Record<string, string>;
791
+ amountWei: string;
792
+ dry?: boolean;
793
+ oneclickParams?: {
794
+ appFees?: {
795
+ recipient: string;
796
+ fee: number;
797
+ }[];
798
+ };
799
+ }
800
+ interface HyperliquidTransferParams {
801
+ wallet: WalletConfig;
802
+ evmWallet: EVMWallet;
803
+ evmWalletAddress: string;
804
+ quote: any;
805
+ }
806
+ interface HyperliquidGeneratePermitParams {
807
+ address: string;
808
+ evmWallet: EVMWallet;
809
+ amountWei: string;
810
+ }
811
+ interface HyperliquidDepositParams extends HyperliquidTransferParams {
812
+ txhash: string;
813
+ }
814
+ interface HyperliquidGetStatusParams {
815
+ }
816
+
817
+ declare const tokens: TokenConfig[];
818
+ declare const usdtTokens: TokenConfig[];
819
+ declare const usdcTokens: TokenConfig[];
820
+
821
+ declare const usdtChains: Record<string, TokenConfig>;
822
+
823
+ declare const usdcChains: Record<string, TokenConfig>;
824
+
825
+ declare class NearWallet {
826
+ private selector;
827
+ private rpcUrl;
828
+ constructor(_selector: any);
829
+ private query;
830
+ transfer(data: {
831
+ originAsset: string;
832
+ depositAddress: string;
833
+ amount: string;
834
+ }): Promise<any>;
835
+ getBalance(token: any, _account: string): Promise<any>;
836
+ balanceOf(token: any, account: string): Promise<any>;
837
+ /**
838
+ * Get native NEAR balance
839
+ * @param account Account ID
840
+ * @returns NEAR balance in yoctoNEAR (smallest unit)
841
+ */
842
+ getNearBalance(account: string): Promise<string>;
843
+ /**
844
+ * Estimate gas limit for transfer transaction
845
+ * @param data Transfer data
846
+ * @returns Gas limit estimate, gas price, and estimated gas cost
847
+ */
848
+ estimateTransferGas(data: {
849
+ originAsset: string;
850
+ depositAddress: string;
851
+ amount: string;
852
+ }): Promise<{
853
+ gasLimit: bigint;
854
+ gasPrice: bigint;
855
+ estimateGas: bigint;
856
+ }>;
857
+ checkTransactionStatus(txHash: string): Promise<void>;
858
+ quoteOneClickProxy(params: any): Promise<any>;
859
+ sendTransaction(params: any): Promise<any>;
860
+ /**
861
+ * Unified quote method that routes to specific quote methods based on type
862
+ * @param type Service type from ServiceType
863
+ * @param params Parameters for the quote
864
+ */
865
+ quote(type: ServiceType, params: any): Promise<any>;
866
+ /**
867
+ * Unified send method that routes to specific send methods based on type
868
+ * @param type Send type from SendType enum
869
+ * @param params Parameters for the send transaction
870
+ */
871
+ send(type: SendType, params: any): Promise<any>;
872
+ }
873
+
874
+ declare class SolanaWallet {
875
+ connection: Connection;
876
+ private publicKey;
877
+ private signTransaction;
878
+ private signer;
879
+ constructor(options: {
880
+ publicKey: PublicKey | null;
881
+ signer: any;
882
+ });
883
+ transferSOL(to: string, amount: string): Promise<string>;
884
+ transferToken(tokenMint: string, to: string, amount: string): Promise<string>;
885
+ transfer(data: {
886
+ originAsset: string;
887
+ depositAddress: string;
888
+ amount: string;
889
+ }): Promise<string>;
890
+ getSOLBalance(account: string): Promise<number>;
891
+ getTokenBalance(tokenMint: string, account: string): Promise<bigint | 0>;
892
+ getBalance(token: any, account: string): Promise<number | bigint>;
893
+ balanceOf(token: any, account: string): Promise<number | bigint>;
894
+ /**
895
+ * Estimate gas limit for transfer transaction
896
+ * @param data Transfer data
897
+ * @returns Gas limit estimate, gas price, and estimated gas cost
898
+ */
899
+ estimateTransferGas(data: {
900
+ originAsset: string;
901
+ depositAddress: string;
902
+ amount: string;
903
+ }): Promise<{
904
+ gasLimit: bigint;
905
+ gasPrice: bigint;
906
+ estimateGas: bigint;
907
+ }>;
908
+ checkTransactionStatus(signature: string): Promise<boolean>;
909
+ simulateIx(ix: any): Promise<_solana_web3_js.SimulatedTransactionResponse>;
910
+ sendTransaction(params: any): Promise<string>;
911
+ /**
912
+ * Unified quote method that routes to specific quote methods based on type
913
+ * @param type Service type from ServiceType
914
+ * @param params Parameters for the quote
915
+ */
916
+ quote(type: ServiceType, params: any): Promise<any>;
917
+ /**
918
+ * Unified send method that routes to specific send methods based on type
919
+ * @param type Send type from SendType enum
920
+ * @param params Parameters for the send transaction
921
+ */
922
+ send(type: SendType, params: any): Promise<string>;
923
+ quoteOneClickProxy(params: any): Promise<any>;
924
+ quoteCCTP(params: any): Promise<any>;
925
+ quoteOFT(params: any): Promise<any>;
926
+ createAssociatedTokenAddress(params: any): Promise<PublicKey>;
927
+ }
928
+
929
+ declare class TronWallet {
930
+ private signAndSendTransaction;
931
+ private address;
932
+ private tronWeb;
933
+ constructor(options: any);
934
+ waitForTronWeb(): Promise<unknown>;
935
+ transfer(data: {
936
+ originAsset: string;
937
+ depositAddress: string;
938
+ amount: string;
939
+ }): Promise<any>;
940
+ transferTRX(to: string, amount: string): Promise<any>;
941
+ transferToken(contractAddress: string, to: string, amount: string): Promise<any>;
942
+ getBalance(token: any, account: string): Promise<any>;
943
+ getTRXBalance(account: string): Promise<any>;
944
+ getTokenBalance(contractAddress: string, account: string): Promise<any>;
945
+ balanceOf(token: any, account: string): Promise<any>;
946
+ /**
947
+ * Estimate gas limit for transfer transaction
948
+ * @param data Transfer data
949
+ * @returns Gas limit estimate (bandwidth or energy), gas price, and estimated gas cost
950
+ */
951
+ estimateTransferGas(data: {
952
+ originAsset: string;
953
+ depositAddress: string;
954
+ amount: string;
955
+ }): Promise<{
956
+ gasLimit: bigint;
957
+ gasPrice: bigint;
958
+ estimateGas: bigint;
959
+ }>;
960
+ checkTransactionStatus(txHash: string): Promise<boolean>;
961
+ getTransactionResult(txHash: string): Promise<any>;
962
+ allowance(params: any): Promise<{
963
+ contract: any;
964
+ allowance: string;
965
+ needApprove: boolean;
966
+ }>;
967
+ approve(params: any): Promise<any>;
968
+ getEnergyPrice(): Promise<any>;
969
+ toBytes32(addr: string): string;
970
+ quoteOFT(params: any): Promise<any>;
971
+ sendTransaction(params: any): Promise<any>;
972
+ /**
973
+ * Unified quote method that routes to specific quote methods based on type
974
+ * @param type Service type from ServiceType
975
+ * @param params Parameters for the quote
976
+ */
977
+ quote(type: ServiceType, params: any): Promise<any>;
978
+ /**
979
+ * Unified send method that routes to specific send methods based on type
980
+ * @param type Send type from SendType enum
981
+ * @param params Parameters for the send transaction
982
+ */
983
+ send(type: SendType, params: any): Promise<any>;
984
+ quoteOneClickProxy(params: any): Promise<any>;
985
+ getAccountResources(params: any): Promise<any>;
986
+ }
987
+
988
+ declare class AptosWallet {
989
+ connection: any;
990
+ private account;
991
+ private aptos;
992
+ private signAndSubmitTransaction;
993
+ constructor(options: {
994
+ account: any | null;
995
+ signAndSubmitTransaction: any;
996
+ });
997
+ transferAPT(to: string, amount: string): Promise<string>;
998
+ transferToken(contractAddress: string, to: string, amount: string): Promise<string>;
999
+ transfer(data: {
1000
+ originAsset: string;
1001
+ depositAddress: string;
1002
+ amount: string;
1003
+ }): Promise<string>;
1004
+ getAPTBalance(account: string): Promise<string>;
1005
+ getTokenBalance(contractAddress: string, account: string): Promise<string>;
1006
+ getBalance(token: any, account: string): Promise<string>;
1007
+ balanceOf(token: any, account: string): Promise<string>;
1008
+ /**
1009
+ * Estimate gas limit for transfer transaction
1010
+ * @param data Transfer data
1011
+ * @returns Gas limit estimate, gas price, and estimated gas cost
1012
+ */
1013
+ estimateTransferGas(data: {
1014
+ originAsset: string;
1015
+ depositAddress: string;
1016
+ amount: string;
1017
+ }): Promise<{
1018
+ gasLimit: bigint;
1019
+ gasPrice: bigint;
1020
+ estimateGas: bigint;
1021
+ }>;
1022
+ checkTransactionStatus(signature: string): Promise<boolean>;
1023
+ quoteOneClickProxy(params: any): Promise<any>;
1024
+ sendTransaction(params: any): Promise<any>;
1025
+ /**
1026
+ * Unified quote method that routes to specific quote methods based on type
1027
+ * @param type Service type from ServiceType
1028
+ * @param params Parameters for the quote
1029
+ */
1030
+ quote(type: ServiceType, params: any): Promise<any>;
1031
+ /**
1032
+ * Unified send method that routes to specific send methods based on type
1033
+ * @param type Send type from SendTypeSENDm
1034
+ * @param params Parameters for the send transaction
1035
+ */
1036
+ send(type: SendType, params: any): Promise<any>;
1037
+ }
1038
+
1039
+ declare const NetworkRpcUrlsMap: Record<string, string[]>;
1040
+ declare const getRpcUrls: (blockchain: string) => string[];
1041
+ declare const setRpcUrls: (urls: Record<string, string[]>) => Record<string, string[]>;
1042
+
1043
+ export { ApiError, type AppFee, AptosWallet, type BadRequestResponse, CancelError, CancelablePromise, EVMWallet, type GetAllQuoteParams, GetExecutionStatusResponse, Hyperliquid, type HyperliquidDepositParams, HyperliquidFromTokens, type HyperliquidGetStatusParams, type HyperliquidQuoteParams, type HyperliquidTransferParams, HyperliuquidToToken, NearWallet, NetworkRpcUrlsMap, OpenAPI, type OpenAPIConfig, type Quote, QuoteRequest, type QuoteResponse, SFA, Service, type ServiceType, SolanaWallet, type SubmitDepositTxRequest, SubmitDepositTxResponse, type SwapDetails, type TokenConfig, TokenResponse, type TransactionDetails, TransactionStatus, TronWallet, getRpcUrls, setRpcUrls, tokens, usdcChains, usdcTokens, usdtChains, usdtTokens };