@sodax/sdk 0.0.1-rc.10 → 0.0.1-rc.12
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/README.md +10 -10
- package/dist/index.cjs +2109 -477
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +845 -106
- package/dist/index.d.ts +845 -106
- package/dist/index.mjs +2089 -477
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address, Hex, PublicClient, HttpTransport, Hash, GetLogsReturnType, TransactionReceipt, WalletClient, CustomTransport, Chain, Account } from 'viem';
|
|
2
|
-
import { ICWWalletProvider, IInjectiveWalletProvider, CWExecuteResponse, SpokeChainId, Hex as Hex$1, IEvmWalletProvider, Address as Address$1, Token, HubAddress, Hash as Hash$1, IIconWalletProvider, ISolanaWalletProvider, SolanaBase58PublicKey, IStellarWalletProvider, ISuiWalletProvider, ChainType, CosmosNetworkEnv, CWRawTransaction, EvmRawTransaction, StellarRawTransaction, HubChainId, EvmRawTransactionReceipt, ChainId, OriginalAssetAddress } from '@sodax/types';
|
|
2
|
+
import { ICWWalletProvider, IInjectiveWalletProvider, CWExecuteResponse, SpokeChainId, Hex as Hex$1, IEvmWalletProvider, Address as Address$1, Token, HubAddress, Hash as Hash$1, IconEoaAddress, IIconWalletProvider, ISolanaWalletProvider, SolanaBase58PublicKey, IStellarWalletProvider, ISuiWalletProvider, ChainType, CosmosNetworkEnv, CWRawTransaction, EvmRawTransaction, StellarRawTransaction, HubChainId, ICON_MAINNET_CHAIN_ID, EvmRawTransactionReceipt, ChainId, OriginalAssetAddress } from '@sodax/types';
|
|
3
3
|
export * from '@sodax/types';
|
|
4
4
|
import { Transaction, TransactionResult } from '@mysten/sui/transactions';
|
|
5
5
|
import { IconService } from 'icon-sdk-js';
|
|
@@ -4398,10 +4398,44 @@ type MoneyMarketRepayParams = {
|
|
|
4398
4398
|
action: 'repay';
|
|
4399
4399
|
};
|
|
4400
4400
|
type MoneyMarketParams = MoneyMarketSupplyParams | MoneyMarketBorrowParams | MoneyMarketWithdrawParams | MoneyMarketRepayParams;
|
|
4401
|
-
type
|
|
4402
|
-
type
|
|
4403
|
-
|
|
4401
|
+
type MoneyMarketUnknownErrorCode = 'SUPPLY_UNKNOWN_ERROR' | 'BORROW_UNKNOWN_ERROR' | 'WITHDRAW_UNKNOWN_ERROR' | 'REPAY_UNKNOWN_ERROR';
|
|
4402
|
+
type GetMoneyMarketParams<T extends MoneyMarketUnknownErrorCode> = T extends 'SUPPLY_UNKNOWN_ERROR' ? MoneyMarketSupplyParams : T extends 'BORROW_UNKNOWN_ERROR' ? MoneyMarketBorrowParams : T extends 'WITHDRAW_UNKNOWN_ERROR' ? MoneyMarketWithdrawParams : T extends 'REPAY_UNKNOWN_ERROR' ? MoneyMarketRepayParams : never;
|
|
4403
|
+
type MoneyMarketErrorCode = MoneyMarketUnknownErrorCode | RelayErrorCode | 'CREATE_SUPPLY_INTENT_FAILED' | 'CREATE_BORROW_INTENT_FAILED' | 'CREATE_WITHDRAW_INTENT_FAILED' | 'CREATE_REPAY_INTENT_FAILED';
|
|
4404
|
+
type MoneyMarketUnknownError<T extends MoneyMarketUnknownErrorCode> = {
|
|
4404
4405
|
error: unknown;
|
|
4406
|
+
payload: GetMoneyMarketParams<T>;
|
|
4407
|
+
};
|
|
4408
|
+
type MoneyMarketSubmitTxFailedError = {
|
|
4409
|
+
error: RelayError;
|
|
4410
|
+
payload: SpokeTxHash;
|
|
4411
|
+
};
|
|
4412
|
+
type MoneyMarketSupplyFailedError = {
|
|
4413
|
+
error: unknown;
|
|
4414
|
+
payload: MoneyMarketSupplyParams;
|
|
4415
|
+
};
|
|
4416
|
+
type MoneyMarketBorrowFailedError = {
|
|
4417
|
+
error: unknown;
|
|
4418
|
+
payload: MoneyMarketBorrowParams;
|
|
4419
|
+
};
|
|
4420
|
+
type MoneyMarketWithdrawFailedError = {
|
|
4421
|
+
error: unknown;
|
|
4422
|
+
payload: MoneyMarketWithdrawParams;
|
|
4423
|
+
};
|
|
4424
|
+
type MoneyMarketRepayFailedError = {
|
|
4425
|
+
error: unknown;
|
|
4426
|
+
payload: MoneyMarketRepayParams;
|
|
4427
|
+
};
|
|
4428
|
+
type GetMoneyMarketError<T extends MoneyMarketErrorCode> = T extends 'SUBMIT_TX_FAILED' ? MoneyMarketSubmitTxFailedError : T extends 'RELAY_TIMEOUT' ? MoneyMarketSubmitTxFailedError : T extends 'CREATE_SUPPLY_INTENT_FAILED' ? MoneyMarketSupplyFailedError : T extends 'CREATE_BORROW_INTENT_FAILED' ? MoneyMarketBorrowFailedError : T extends 'CREATE_WITHDRAW_INTENT_FAILED' ? MoneyMarketWithdrawFailedError : T extends 'CREATE_REPAY_INTENT_FAILED' ? MoneyMarketRepayFailedError : T extends MoneyMarketUnknownErrorCode ? MoneyMarketUnknownError<T> : never;
|
|
4429
|
+
type MoneyMarketError<T extends MoneyMarketErrorCode> = {
|
|
4430
|
+
code: T;
|
|
4431
|
+
data: GetMoneyMarketError<T>;
|
|
4432
|
+
};
|
|
4433
|
+
type MoneyMarketExtraData = {
|
|
4434
|
+
address: Hex;
|
|
4435
|
+
payload: Hex;
|
|
4436
|
+
};
|
|
4437
|
+
type MoneyMarketOptionalExtraData = {
|
|
4438
|
+
data?: MoneyMarketExtraData;
|
|
4405
4439
|
};
|
|
4406
4440
|
declare class MoneyMarketService {
|
|
4407
4441
|
readonly config: MoneyMarketServiceConfig;
|
|
@@ -4462,10 +4496,10 @@ declare class MoneyMarketService {
|
|
|
4462
4496
|
* @param params - The parameters for the supply transaction.
|
|
4463
4497
|
* @param spokeProvider - The spoke provider.
|
|
4464
4498
|
* @param timeout - The timeout in milliseconds for the transaction. Default is 60 seconds.
|
|
4465
|
-
* @returns {Promise<Result<[
|
|
4499
|
+
* @returns {Promise<Result<[SpokeTxHash, HubTxHash], MoneyMarketError>>} - Returns the transaction result and the hub transaction hash or error
|
|
4466
4500
|
*
|
|
4467
4501
|
* @example
|
|
4468
|
-
* const result = await moneyMarketService.
|
|
4502
|
+
* const result = await moneyMarketService.supply(
|
|
4469
4503
|
* {
|
|
4470
4504
|
* token: '0x...', // Address of the token (spoke chain address) to supply
|
|
4471
4505
|
* amount: 1000n, // Amount to supply (in token decimals)
|
|
@@ -4484,9 +4518,12 @@ declare class MoneyMarketService {
|
|
|
4484
4518
|
* ] = result.value;
|
|
4485
4519
|
* console.log('Supply transaction hashes:', { spokeTxHash, hubTxHash });
|
|
4486
4520
|
*/
|
|
4487
|
-
|
|
4521
|
+
supply<S extends SpokeProvider>(params: MoneyMarketSupplyParams, spokeProvider: S, timeout?: number): Promise<Result<[
|
|
4522
|
+
SpokeTxHash,
|
|
4523
|
+
HubTxHash
|
|
4524
|
+
], MoneyMarketError<'CREATE_SUPPLY_INTENT_FAILED' | 'SUPPLY_UNKNOWN_ERROR' | RelayErrorCode>>>;
|
|
4488
4525
|
/**
|
|
4489
|
-
*
|
|
4526
|
+
* Create supply intent only (without submitting to Solver API)
|
|
4490
4527
|
* NOTE: This method does not submit the intent to the Solver API, it only executes the transaction on the spoke chain
|
|
4491
4528
|
* In order to successfully supply tokens, you need to:
|
|
4492
4529
|
* 1. Check if the allowance is sufficient
|
|
@@ -4501,7 +4538,7 @@ declare class MoneyMarketService {
|
|
|
4501
4538
|
*
|
|
4502
4539
|
* @example
|
|
4503
4540
|
* const moneyMarketService = new MoneyMarketService(config);
|
|
4504
|
-
* const result = await moneyMarketService.
|
|
4541
|
+
* const result = await moneyMarketService.createSupplyIntent(
|
|
4505
4542
|
* {
|
|
4506
4543
|
* token: "0x123...", // token address
|
|
4507
4544
|
* amount: 1000000000000000000n // 1 token in wei
|
|
@@ -4517,16 +4554,16 @@ declare class MoneyMarketService {
|
|
|
4517
4554
|
* console.error('Supply failed:', result.error);
|
|
4518
4555
|
* }
|
|
4519
4556
|
*/
|
|
4520
|
-
|
|
4557
|
+
createSupplyIntent<S extends SpokeProvider = SpokeProvider, R extends boolean = false>(params: MoneyMarketSupplyParams, spokeProvider: S, raw?: R): Promise<Result<TxReturnType<S, R>, MoneyMarketError<'CREATE_SUPPLY_INTENT_FAILED'>> & MoneyMarketOptionalExtraData>;
|
|
4521
4558
|
/**
|
|
4522
4559
|
* Borrow tokens from the money market pool, relay the transaction to the hub and submit the intent to the Solver API
|
|
4523
4560
|
* @param params - The parameters for the borrow transaction.
|
|
4524
4561
|
* @param spokeProvider - The spoke provider.
|
|
4525
4562
|
* @param timeout - The timeout in milliseconds for the transaction. Default is 60 seconds.
|
|
4526
|
-
* @returns {Promise<Result<[
|
|
4563
|
+
* @returns {Promise<Result<[SpokeTxHash, HubTxHash], MoneyMarketError>>} - Returns the transaction result and the hub transaction hash or error
|
|
4527
4564
|
*
|
|
4528
4565
|
* @example
|
|
4529
|
-
* const result = await moneyMarketService.
|
|
4566
|
+
* const result = await moneyMarketService.borrow(
|
|
4530
4567
|
* {
|
|
4531
4568
|
* token: '0x...', // Address of the token (spoke chain address) to borrow
|
|
4532
4569
|
* amount: 1000n, // Amount to borrow (in token decimals)
|
|
@@ -4545,9 +4582,12 @@ declare class MoneyMarketService {
|
|
|
4545
4582
|
* ] = result.value;
|
|
4546
4583
|
* console.log('Borrow transaction hashes:', { spokeTxHash, hubTxHash });
|
|
4547
4584
|
*/
|
|
4548
|
-
|
|
4585
|
+
borrow<S extends SpokeProvider>(params: MoneyMarketBorrowParams, spokeProvider: S, timeout?: number): Promise<Result<[
|
|
4586
|
+
SpokeTxHash,
|
|
4587
|
+
HubTxHash
|
|
4588
|
+
], MoneyMarketError<'CREATE_BORROW_INTENT_FAILED' | 'BORROW_UNKNOWN_ERROR' | RelayErrorCode>>>;
|
|
4549
4589
|
/**
|
|
4550
|
-
*
|
|
4590
|
+
* Create borrow intent only (without submitting to Solver API)
|
|
4551
4591
|
* NOTE: This method does not submit the intent to the Solver API, it only executes the transaction on the spoke chain
|
|
4552
4592
|
* In order to successfully borrow tokens, you need to:
|
|
4553
4593
|
* 1. Execute the borrow transaction on the spoke chain
|
|
@@ -4560,13 +4600,13 @@ declare class MoneyMarketService {
|
|
|
4560
4600
|
*
|
|
4561
4601
|
* @example
|
|
4562
4602
|
* const moneyMarketService = new MoneyMarketService(config);
|
|
4563
|
-
* const result = await moneyMarketService.
|
|
4603
|
+
* const result = await moneyMarketService.createBorrowIntent(
|
|
4564
4604
|
* {
|
|
4565
4605
|
* token: "0x123...", // token address
|
|
4566
4606
|
* amount: 1000000000000000000n // 1 token in wei
|
|
4567
4607
|
* },
|
|
4568
4608
|
* spokeProvider,
|
|
4569
|
-
* raw // Optional: true = return the raw transaction data, false =
|
|
4609
|
+
* raw // Optional: true = return the raw transaction data, false = execute and return the transaction hash (default: false)
|
|
4570
4610
|
* );
|
|
4571
4611
|
*
|
|
4572
4612
|
* if (result.ok) {
|
|
@@ -4576,17 +4616,17 @@ declare class MoneyMarketService {
|
|
|
4576
4616
|
* console.error('Borrow failed:', result.error);
|
|
4577
4617
|
* }
|
|
4578
4618
|
*/
|
|
4579
|
-
|
|
4619
|
+
createBorrowIntent<S extends SpokeProvider = SpokeProvider, R extends boolean = false>(params: MoneyMarketBorrowParams, spokeProvider: S, raw?: R): Promise<Result<TxReturnType<S, R>, MoneyMarketError<'CREATE_BORROW_INTENT_FAILED'>> & MoneyMarketOptionalExtraData>;
|
|
4580
4620
|
/**
|
|
4581
4621
|
* Withdraw tokens from the money market pool, relay the transaction to the hub and submit the intent to the Solver API
|
|
4582
4622
|
*
|
|
4583
4623
|
* @param params - The parameters for the withdraw transaction.
|
|
4584
4624
|
* @param spokeProvider - The spoke provider.
|
|
4585
4625
|
* @param timeout - The timeout in milliseconds for the transaction. Default is 60 seconds.
|
|
4586
|
-
* @returns {Promise<Result<[
|
|
4626
|
+
* @returns {Promise<Result<[SpokeTxHash, HubTxHash], MoneyMarketError>>} - Returns the spoke and hub transaction hashes or error
|
|
4587
4627
|
*
|
|
4588
4628
|
* @example
|
|
4589
|
-
* const result = await moneyMarketService.
|
|
4629
|
+
* const result = await moneyMarketService.withdraw(
|
|
4590
4630
|
* {
|
|
4591
4631
|
* token: '0x...', // Address of the token (spoke chain address) to withdraw
|
|
4592
4632
|
* amount: 1000n, // Amount to withdraw (in token decimals)
|
|
@@ -4605,9 +4645,12 @@ declare class MoneyMarketService {
|
|
|
4605
4645
|
* ] = result.value;
|
|
4606
4646
|
* console.log('Withdraw transaction hashes:', { spokeTxHash, hubTxHash });
|
|
4607
4647
|
*/
|
|
4608
|
-
|
|
4648
|
+
withdraw<S extends SpokeProvider>(params: MoneyMarketWithdrawParams, spokeProvider: S, timeout?: number): Promise<Result<[
|
|
4649
|
+
SpokeTxHash,
|
|
4650
|
+
HubTxHash
|
|
4651
|
+
], MoneyMarketError<'CREATE_WITHDRAW_INTENT_FAILED' | 'WITHDRAW_UNKNOWN_ERROR' | RelayErrorCode>>>;
|
|
4609
4652
|
/**
|
|
4610
|
-
*
|
|
4653
|
+
* Create withdraw intent only (without submitting to Solver API)
|
|
4611
4654
|
* NOTE: This method does not submit the intent to the Solver API, it only executes the transaction on the spoke chain
|
|
4612
4655
|
* In order to successfully withdraw tokens, you need to:
|
|
4613
4656
|
* 1. Execute the withdraw transaction on the spoke chain
|
|
@@ -4620,7 +4663,7 @@ declare class MoneyMarketService {
|
|
|
4620
4663
|
*
|
|
4621
4664
|
* @example
|
|
4622
4665
|
* const moneyMarketService = new MoneyMarketService(config);
|
|
4623
|
-
* const result = await moneyMarketService.
|
|
4666
|
+
* const result = await moneyMarketService.createWithdrawIntent(
|
|
4624
4667
|
* {
|
|
4625
4668
|
* token: "0x123...", // token address
|
|
4626
4669
|
* amount: 1000000000000000000n // 1 token in wei
|
|
@@ -4636,17 +4679,17 @@ declare class MoneyMarketService {
|
|
|
4636
4679
|
* console.error('Withdraw failed:', result.error);
|
|
4637
4680
|
* }
|
|
4638
4681
|
*/
|
|
4639
|
-
|
|
4682
|
+
createWithdrawIntent<S extends SpokeProvider = SpokeProvider, R extends boolean = false>(params: MoneyMarketWithdrawParams, spokeProvider: S, raw?: R): Promise<Result<TxReturnType<S, R>, MoneyMarketError<'CREATE_WITHDRAW_INTENT_FAILED'>> & MoneyMarketOptionalExtraData>;
|
|
4640
4683
|
/**
|
|
4641
4684
|
* Repay tokens to the money market pool, relay the transaction to the hub and submit the intent to the Solver API
|
|
4642
4685
|
*
|
|
4643
4686
|
* @param params - The parameters for the repay transaction.
|
|
4644
4687
|
* @param spokeProvider - The spoke provider.
|
|
4645
4688
|
* @param timeout - The timeout in milliseconds for the transaction. Default is 60 seconds.
|
|
4646
|
-
* @returns {Promise<Result<[
|
|
4689
|
+
* @returns {Promise<Result<[SpokeTxHash, HubTxHash], MoneyMarketError>>} - Returns the spoke and hub transaction hashes or error
|
|
4647
4690
|
*
|
|
4648
4691
|
* @example
|
|
4649
|
-
* const result = await moneyMarketService.
|
|
4692
|
+
* const result = await moneyMarketService.repay(
|
|
4650
4693
|
* {
|
|
4651
4694
|
* token: '0x...', // Address of the token (spoke chain address) to repay
|
|
4652
4695
|
* amount: 1000n, // Amount to repay (in token decimals)
|
|
@@ -4665,9 +4708,12 @@ declare class MoneyMarketService {
|
|
|
4665
4708
|
* ] = result.value;
|
|
4666
4709
|
* console.log('Repay transaction hashes:', { spokeTxHash, hubTxHash });
|
|
4667
4710
|
*/
|
|
4668
|
-
|
|
4711
|
+
repay<S extends SpokeProvider>(params: MoneyMarketRepayParams, spokeProvider: S, timeout?: number): Promise<Result<[
|
|
4712
|
+
SpokeTxHash,
|
|
4713
|
+
HubTxHash
|
|
4714
|
+
], MoneyMarketError<'CREATE_REPAY_INTENT_FAILED' | 'REPAY_UNKNOWN_ERROR' | RelayErrorCode>>>;
|
|
4669
4715
|
/**
|
|
4670
|
-
*
|
|
4716
|
+
* Create repay intent only (without submitting to Solver API)
|
|
4671
4717
|
* NOTE: This method does not submit the intent to the Solver API, it only executes the transaction on the spoke chain
|
|
4672
4718
|
* In order to successfully repay tokens, you need to:
|
|
4673
4719
|
* 1. Check if the allowance is sufficient
|
|
@@ -4682,7 +4728,7 @@ declare class MoneyMarketService {
|
|
|
4682
4728
|
*
|
|
4683
4729
|
* @example
|
|
4684
4730
|
* const moneyMarketService = new MoneyMarketService(config);
|
|
4685
|
-
* const result = await moneyMarketService.
|
|
4731
|
+
* const result = await moneyMarketService.createRepayIntent(
|
|
4686
4732
|
* {
|
|
4687
4733
|
* token: "0x123...", // token address
|
|
4688
4734
|
* amount: 1000000000000000000n // 1 token in wei
|
|
@@ -4698,7 +4744,7 @@ declare class MoneyMarketService {
|
|
|
4698
4744
|
* console.error('Repay failed:', result.error);
|
|
4699
4745
|
* }
|
|
4700
4746
|
*/
|
|
4701
|
-
|
|
4747
|
+
createRepayIntent<S extends SpokeProvider = SpokeProvider, R extends boolean = false>(params: MoneyMarketRepayParams, spokeProvider: S, raw?: R): Promise<Result<TxReturnType<S, R>, MoneyMarketError<'CREATE_REPAY_INTENT_FAILED'>> & MoneyMarketOptionalExtraData>;
|
|
4702
4748
|
/**
|
|
4703
4749
|
* Build transaction data for supplying to the money market pool
|
|
4704
4750
|
* @param token - The address of the token on spoke chain
|
|
@@ -4707,7 +4753,7 @@ declare class MoneyMarketService {
|
|
|
4707
4753
|
* @param spokeChainId - The chain ID of the spoke chain
|
|
4708
4754
|
* @returns {Hex} The transaction data.
|
|
4709
4755
|
*/
|
|
4710
|
-
|
|
4756
|
+
buildSupplyData(token: string, to: Address$1, amount: bigint, spokeChainId: SpokeChainId): Hex;
|
|
4711
4757
|
/**
|
|
4712
4758
|
* Build transaction data for borrowing from the money market pool
|
|
4713
4759
|
* @param from - The user wallet address on the hub chain
|
|
@@ -4717,7 +4763,7 @@ declare class MoneyMarketService {
|
|
|
4717
4763
|
* @param spokeChainId - The chain ID of the spoke chain
|
|
4718
4764
|
* @returns {Hex} The transaction data.
|
|
4719
4765
|
*/
|
|
4720
|
-
|
|
4766
|
+
buildBorrowData(from: Address$1, to: Address$1 | Hex, token: string, amount: bigint, spokeChainId: SpokeChainId): Hex;
|
|
4721
4767
|
/**
|
|
4722
4768
|
* Build transaction data for withdrawing from the money market pool
|
|
4723
4769
|
* @param from - The user wallet address on the hub chain
|
|
@@ -4727,7 +4773,7 @@ declare class MoneyMarketService {
|
|
|
4727
4773
|
* @param spokeChainId - The chain ID of the spoke chain
|
|
4728
4774
|
* @returns {Hex} The transaction data.
|
|
4729
4775
|
*/
|
|
4730
|
-
|
|
4776
|
+
buildWithdrawData(from: Address$1, to: Address$1, token: string, amount: bigint, spokeChainId: SpokeChainId): Hex;
|
|
4731
4777
|
/**
|
|
4732
4778
|
* Build transaction data for repaying to the money market pool
|
|
4733
4779
|
* @param token - The address of the token to repay
|
|
@@ -4736,7 +4782,7 @@ declare class MoneyMarketService {
|
|
|
4736
4782
|
* @param spokeChainId - The chain ID of the spoke chain
|
|
4737
4783
|
* @returns {Hex} The transaction data.
|
|
4738
4784
|
*/
|
|
4739
|
-
|
|
4785
|
+
buildRepayData(token: string, to: Address$1, amount: bigint, spokeChainId: SpokeChainId): Hex;
|
|
4740
4786
|
/**
|
|
4741
4787
|
* Get the list of all reserves in the pool
|
|
4742
4788
|
* @param uiPoolDataProvider - The address of the UI Pool Data Provider
|
|
@@ -5074,7 +5120,7 @@ declare class SonicSpokeService {
|
|
|
5074
5120
|
*/
|
|
5075
5121
|
static isBorrowApproved(from: Address, borrowInfo: BorrowInfo, spokeProvider: SonicSpokeProvider, spender?: HubAddress): Promise<Result<boolean>>;
|
|
5076
5122
|
static approveBorrow<R extends boolean = false>(from: Address, borrowInfo: BorrowInfo, spokeProvider: SonicSpokeProvider, raw?: R): PromiseEvmTxReturnType<R>;
|
|
5077
|
-
static
|
|
5123
|
+
static buildWithdrawData(from: Address, withdrawInfo: WithdrawInfo, amount: bigint, spokeProvider: SonicSpokeProvider, moneyMarketService: MoneyMarketService): Promise<Hex$1>;
|
|
5078
5124
|
}
|
|
5079
5125
|
|
|
5080
5126
|
type CreateIntentParams = {
|
|
@@ -5086,8 +5132,8 @@ type CreateIntentParams = {
|
|
|
5086
5132
|
allowPartialFill: boolean;
|
|
5087
5133
|
srcChain: SpokeChainId;
|
|
5088
5134
|
dstChain: SpokeChainId;
|
|
5089
|
-
srcAddress:
|
|
5090
|
-
dstAddress:
|
|
5135
|
+
srcAddress: string;
|
|
5136
|
+
dstAddress: string;
|
|
5091
5137
|
solver: Address$1;
|
|
5092
5138
|
data: Hex$1;
|
|
5093
5139
|
};
|
|
@@ -5130,17 +5176,17 @@ type IntentCreationFailedErrorData = {
|
|
|
5130
5176
|
};
|
|
5131
5177
|
type IntentSubmitTxFailedErrorData = {
|
|
5132
5178
|
payload: IntentRelayRequest<'submit'>;
|
|
5133
|
-
|
|
5179
|
+
error: unknown;
|
|
5134
5180
|
};
|
|
5135
5181
|
type IntentWaitUntilIntentExecutedFailedErrorData = {
|
|
5136
5182
|
payload: WaitUntilIntentExecutedPayload;
|
|
5137
5183
|
error: unknown;
|
|
5138
5184
|
};
|
|
5139
|
-
type
|
|
5140
|
-
type
|
|
5141
|
-
type
|
|
5185
|
+
type IntentErrorCode = RelayErrorCode | 'UNKNOWN' | 'CREATION_FAILED' | 'POST_EXECUTION_FAILED';
|
|
5186
|
+
type IntentErrorData<T extends IntentErrorCode> = T extends 'RELAY_TIMEOUT' ? IntentWaitUntilIntentExecutedFailedErrorData : T extends 'CREATION_FAILED' ? IntentCreationFailedErrorData : T extends 'SUBMIT_TX_FAILED' ? IntentSubmitTxFailedErrorData : T extends 'POST_EXECUTION_FAILED' ? SolverErrorResponse : T extends 'UNKNOWN' ? IntentCreationFailedErrorData : never;
|
|
5187
|
+
type IntentError<T extends IntentErrorCode = IntentErrorCode> = {
|
|
5142
5188
|
code: T;
|
|
5143
|
-
data:
|
|
5189
|
+
data: IntentErrorData<T>;
|
|
5144
5190
|
};
|
|
5145
5191
|
declare class SolverService {
|
|
5146
5192
|
private readonly config;
|
|
@@ -5148,8 +5194,8 @@ declare class SolverService {
|
|
|
5148
5194
|
constructor(config: SolverConfigParams | undefined, hubProvider: EvmHubProvider, relayerApiEndpoint?: HttpUrl);
|
|
5149
5195
|
/**
|
|
5150
5196
|
* Request a quote from the solver API
|
|
5151
|
-
* @param {
|
|
5152
|
-
* @returns {Promise<Result<
|
|
5197
|
+
* @param {SolverIntentQuoteRequest} payload - The solver intent quote request
|
|
5198
|
+
* @returns {Promise<Result<SolverIntentQuoteResponse, SolverErrorResponse>>} The intent quote response
|
|
5153
5199
|
*
|
|
5154
5200
|
* @example
|
|
5155
5201
|
* const payload = {
|
|
@@ -5159,7 +5205,7 @@ declare class SolverService {
|
|
|
5159
5205
|
* "token_dst_blockchain_id":"0xa4b1.arbitrum",
|
|
5160
5206
|
* "amount":1000000000000000n,
|
|
5161
5207
|
* "quote_type": "exact_input"
|
|
5162
|
-
* } satisfies
|
|
5208
|
+
* } satisfies SolverIntentQuoteRequest
|
|
5163
5209
|
*
|
|
5164
5210
|
* const response = await solverService.getQuote(payload);
|
|
5165
5211
|
*
|
|
@@ -5170,7 +5216,7 @@ declare class SolverService {
|
|
|
5170
5216
|
* console.error('Quote failed:', response.error);
|
|
5171
5217
|
* }
|
|
5172
5218
|
*/
|
|
5173
|
-
getQuote(payload:
|
|
5219
|
+
getQuote(payload: SolverIntentQuoteRequest): Promise<Result<SolverIntentQuoteResponse, SolverErrorResponse>>;
|
|
5174
5220
|
/**
|
|
5175
5221
|
* Get the fee for a given input amount
|
|
5176
5222
|
* @param {bigint} inputAmount - The amount of input tokens
|
|
@@ -5183,15 +5229,16 @@ declare class SolverService {
|
|
|
5183
5229
|
getFee(inputAmount: bigint): Promise<bigint>;
|
|
5184
5230
|
/**
|
|
5185
5231
|
* Get the status of an intent from Solver API
|
|
5186
|
-
*
|
|
5187
|
-
* @
|
|
5232
|
+
* NOTE: intentHash should be retrieved from relay packet dst_tx_hash property (see createAndSubmitIntent)
|
|
5233
|
+
* @param {SolverIntentStatusRequest} request - The intent status request
|
|
5234
|
+
* @returns {Promise<Result<SolverIntentStatusResponse, SolverErrorResponse>>} The solver intent status response
|
|
5188
5235
|
*
|
|
5189
5236
|
* @example
|
|
5190
|
-
* const
|
|
5191
|
-
* "
|
|
5192
|
-
* } satisfies
|
|
5237
|
+
* const request = {
|
|
5238
|
+
* "intent_tx_hash": "a0dd7652-b360-4123-ab2d-78cfbcd20c6b" // destination tx hash from relay packet
|
|
5239
|
+
* } satisfies SolverIntentStatusRequest
|
|
5193
5240
|
*
|
|
5194
|
-
* const response = await solverService.getStatus(
|
|
5241
|
+
* const response = await solverService.getStatus(request);
|
|
5195
5242
|
*
|
|
5196
5243
|
* if (response.ok) {
|
|
5197
5244
|
* const { status, intent_hash } = response.value;
|
|
@@ -5201,18 +5248,18 @@ declare class SolverService {
|
|
|
5201
5248
|
* // handle error
|
|
5202
5249
|
* }
|
|
5203
5250
|
*/
|
|
5204
|
-
getStatus(
|
|
5251
|
+
getStatus(request: SolverIntentStatusRequest): Promise<Result<SolverIntentStatusResponse, SolverErrorResponse>>;
|
|
5205
5252
|
/**
|
|
5206
5253
|
* Post execution of intent order transaction executed on hub chain to Solver API
|
|
5207
|
-
* @param {
|
|
5208
|
-
* @returns {Promise<Result<
|
|
5254
|
+
* @param {SolverExecutionRequest} request - The intent execution request
|
|
5255
|
+
* @returns {Promise<Result<SolverExecutionResponse, SolverErrorResponse>>} The intent execution response
|
|
5209
5256
|
*
|
|
5210
5257
|
* @example
|
|
5211
|
-
* const
|
|
5258
|
+
* const request = {
|
|
5212
5259
|
* "intent_tx_hash": "0xba3dce19347264db32ced212ff1a2036f20d9d2c7493d06af15027970be061af",
|
|
5213
|
-
* } satisfies
|
|
5260
|
+
* } satisfies SolverExecutionRequest
|
|
5214
5261
|
*
|
|
5215
|
-
* const response = await solverService.postExecution(
|
|
5262
|
+
* const response = await solverService.postExecution(request);
|
|
5216
5263
|
*
|
|
5217
5264
|
* if (response.ok) {
|
|
5218
5265
|
* const { answer, intent_hash } = response.value;
|
|
@@ -5222,13 +5269,73 @@ declare class SolverService {
|
|
|
5222
5269
|
* // handle error
|
|
5223
5270
|
* }
|
|
5224
5271
|
*/
|
|
5225
|
-
postExecution(
|
|
5272
|
+
postExecution(request: SolverExecutionRequest): Promise<Result<SolverExecutionResponse, SolverErrorResponse>>;
|
|
5273
|
+
/**
|
|
5274
|
+
* Submit intent transaction to the relayer API
|
|
5275
|
+
* @param {IntentRelayRequest<'submit'>} submitPayload - The intent relay request
|
|
5276
|
+
* @returns {Promise<Result<GetRelayResponse<'submit'>, IntentError<'SUBMIT_TX_FAILED'>>>} The intent relay response
|
|
5277
|
+
*
|
|
5278
|
+
* @example
|
|
5279
|
+
* const submitPayload = {
|
|
5280
|
+
* "action": "submit",
|
|
5281
|
+
* "params": {
|
|
5282
|
+
* "chain_id": "0x38.bsc",
|
|
5283
|
+
* "tx_hash": "0xba3dce19347264db32ced212ff1a2036f20d9d2c7493d06af15027970be061af",
|
|
5284
|
+
* },
|
|
5285
|
+
* } satisfies IntentRelayRequest<'submit'>;
|
|
5286
|
+
*
|
|
5287
|
+
* const submitResult = await solverService.submitIntent(submitPayload);
|
|
5288
|
+
*
|
|
5289
|
+
* if (submitResult.ok) {
|
|
5290
|
+
* const { success, message } = submitResult.value;
|
|
5291
|
+
* console.log('Success:', success);
|
|
5292
|
+
* console.log('Message:', message);
|
|
5293
|
+
* } else {
|
|
5294
|
+
* // handle error
|
|
5295
|
+
* }
|
|
5296
|
+
*/
|
|
5297
|
+
submitIntent(submitPayload: IntentRelayRequest<'submit'>): Promise<Result<GetRelayResponse<'submit'>, IntentError<'SUBMIT_TX_FAILED'>>>;
|
|
5298
|
+
/**
|
|
5299
|
+
* Swap is a syntatic sugar for createAndSubmitIntent that creates an intent and submits it to the Solver API and Relayer API
|
|
5300
|
+
* @param {CreateIntentParams} payload - The intent to create
|
|
5301
|
+
* @param {ISpokeProvider} spokeProvider - The spoke provider
|
|
5302
|
+
* @param {number} timeout - The timeout in milliseconds for the transaction. Default is 60 seconds.
|
|
5303
|
+
* @returns {Promise<Result<[SolverExecutionResponse, Intent, PacketData], IntentError<IntentErrorCode>>>} The solver execution response, intent, and packet data
|
|
5304
|
+
*
|
|
5305
|
+
* @example
|
|
5306
|
+
* const payload = {
|
|
5307
|
+
* "inputToken": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", // BSC ETH token address
|
|
5308
|
+
* "outputToken": "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", // ARB WBTC token address
|
|
5309
|
+
* "inputAmount": 1000000000000000n, // The amount of input tokens
|
|
5310
|
+
* "minOutputAmount": 900000000000000n, // min amount you are expecting to receive
|
|
5311
|
+
* "deadline": 0n, // Optional timestamp after which intent expires (0 = no deadline)
|
|
5312
|
+
* "allowPartialFill": false, // Whether the intent can be partially filled
|
|
5313
|
+
* "srcChain": "0x38.bsc", // Chain ID where input tokens originate
|
|
5314
|
+
* "dstChain": "0xa4b1.arbitrum", // Chain ID where output tokens should be delivered
|
|
5315
|
+
* "srcAddress": "0x..", // Source address (original address on spoke chain)
|
|
5316
|
+
* "dstAddress": "0x...", // Destination address (original address on spoke chain)
|
|
5317
|
+
* "solver": "0x..", // Optional specific solver address (address(0) = any solver)
|
|
5318
|
+
* "data": "0x..", // Additional arbitrary data
|
|
5319
|
+
* } satisfies CreateIntentParams;
|
|
5320
|
+
*
|
|
5321
|
+
* const swapResult = await solverService.swap(payload, spokeProvider);
|
|
5322
|
+
*
|
|
5323
|
+
* if (swapResult.ok) {
|
|
5324
|
+
* const [solverExecutionResponse, intent, packetData] = swapResult.value;
|
|
5325
|
+
* console.log('Intent execution response:', solverExecutionResponse);
|
|
5326
|
+
* console.log('Intent:', intent);
|
|
5327
|
+
* console.log('Packet data:', packetData);
|
|
5328
|
+
* } else {
|
|
5329
|
+
* // handle error
|
|
5330
|
+
* }
|
|
5331
|
+
*/
|
|
5332
|
+
swap<S extends SpokeProvider>(payload: CreateIntentParams, spokeProvider: S, fee?: PartnerFee, timeout?: number): Promise<Result<[SolverExecutionResponse, Intent, PacketData], IntentError<IntentErrorCode>>>;
|
|
5226
5333
|
/**
|
|
5227
5334
|
* Creates an intent and submits it to the Solver API and Relayer API
|
|
5228
5335
|
* @param {CreateIntentParams} payload - The intent to create
|
|
5229
5336
|
* @param {ISpokeProvider} spokeProvider - The spoke provider
|
|
5230
5337
|
* @param {number} timeout - The timeout in milliseconds for the transaction. Default is 60 seconds.
|
|
5231
|
-
* @returns {Promise<Result<[
|
|
5338
|
+
* @returns {Promise<Result<[SolverExecutionResponse, Intent, PacketData], IntentError<IntentErrorCode>>>} The solver execution response, intent, and packet data
|
|
5232
5339
|
*
|
|
5233
5340
|
* @example
|
|
5234
5341
|
* const payload = {
|
|
@@ -5240,8 +5347,8 @@ declare class SolverService {
|
|
|
5240
5347
|
* "allowPartialFill": false, // Whether the intent can be partially filled
|
|
5241
5348
|
* "srcChain": "0x38.bsc", // Chain ID where input tokens originate
|
|
5242
5349
|
* "dstChain": "0xa4b1.arbitrum", // Chain ID where output tokens should be delivered
|
|
5243
|
-
* "srcAddress": "0x..", // Source address
|
|
5244
|
-
* "dstAddress": "0x...", // Destination address
|
|
5350
|
+
* "srcAddress": "0x..", // Source address (original address on spoke chain)
|
|
5351
|
+
* "dstAddress": "0x...", // Destination address (original address on spoke chain)
|
|
5245
5352
|
* "solver": "0x..", // Optional specific solver address (address(0) = any solver)
|
|
5246
5353
|
* "data": "0x..", // Additional arbitrary data
|
|
5247
5354
|
* } satisfies CreateIntentParams;
|
|
@@ -5249,15 +5356,15 @@ declare class SolverService {
|
|
|
5249
5356
|
* const createAndSubmitIntentResult = await solverService.createAndSubmitIntent(payload, spokeProvider);
|
|
5250
5357
|
*
|
|
5251
5358
|
* if (createAndSubmitIntentResult.ok) {
|
|
5252
|
-
* const [
|
|
5253
|
-
* console.log('Intent execution response:',
|
|
5359
|
+
* const [solverExecutionResponse, intent, packetData] = createAndSubmitIntentResult.value;
|
|
5360
|
+
* console.log('Intent execution response:', solverExecutionResponse);
|
|
5254
5361
|
* console.log('Intent:', intent);
|
|
5255
5362
|
* console.log('Packet data:', packetData);
|
|
5256
5363
|
* } else {
|
|
5257
5364
|
* // handle error
|
|
5258
5365
|
* }
|
|
5259
5366
|
*/
|
|
5260
|
-
createAndSubmitIntent<S extends SpokeProvider>(payload: CreateIntentParams, spokeProvider: S, fee?: PartnerFee, timeout?: number): Promise<Result<[
|
|
5367
|
+
createAndSubmitIntent<S extends SpokeProvider>(payload: CreateIntentParams, spokeProvider: S, fee?: PartnerFee, timeout?: number): Promise<Result<[SolverExecutionResponse, Intent, PacketData], IntentError<IntentErrorCode>>>;
|
|
5261
5368
|
/**
|
|
5262
5369
|
* Check whether assetManager contract is allowed to move the given payload amount
|
|
5263
5370
|
* @param {CreateIntentParams} params - The intent to create
|
|
@@ -5274,8 +5381,8 @@ declare class SolverService {
|
|
|
5274
5381
|
* "allowPartialFill": false, // Whether the intent can be partially filled
|
|
5275
5382
|
* "srcChain": "0x38.bsc", // Chain ID where input tokens originate
|
|
5276
5383
|
* "dstChain": "0xa4b1.arbitrum", // Chain ID where output tokens should be delivered
|
|
5277
|
-
* "srcAddress": "0x..", // Source address
|
|
5278
|
-
* "dstAddress": "0x...", // Destination address
|
|
5384
|
+
* "srcAddress": "0x..", // Source address (original address on spoke chain)
|
|
5385
|
+
* "dstAddress": "0x...", // Destination address (original address on spoke chain)
|
|
5279
5386
|
* "solver": "0x..", // Optional specific solver address (address(0) = any solver)
|
|
5280
5387
|
* "data": "0x..", // Additional arbitrary data
|
|
5281
5388
|
* } satisfies CreateIntentParams;
|
|
@@ -5315,15 +5422,15 @@ declare class SolverService {
|
|
|
5315
5422
|
*
|
|
5316
5423
|
* const txReceipt = approveResult.value;
|
|
5317
5424
|
*/
|
|
5318
|
-
approve<S extends SpokeProvider, R extends boolean = false>(token: Address$1, amount: bigint,
|
|
5425
|
+
approve<S extends SpokeProvider, R extends boolean = false>(token: Address$1, amount: bigint, spokeProvider: S, raw?: R): Promise<Result<TxReturnType<S, R>>>;
|
|
5319
5426
|
/**
|
|
5320
5427
|
* Creates an intent by handling token approval and intent creation
|
|
5321
5428
|
* NOTE: This method does not submit the intent to the Solver API
|
|
5322
|
-
* @param {CreateIntentParams} params - The intent to create
|
|
5429
|
+
* @param {Omit<CreateIntentParams, 'srcAddress'>} params - The intent to create
|
|
5323
5430
|
* @param {SpokeProvider} spokeProvider - The spoke provider
|
|
5324
5431
|
* @param {boolean} raw - Whether to return the raw transaction
|
|
5325
5432
|
* @param {PartnerFee} fee - The fee to apply to the intent
|
|
5326
|
-
* @returns {Promise<Result<[TxReturnType<S, R>, Intent & FeeAmount],
|
|
5433
|
+
* @returns {Promise<Result<[TxReturnType<S, R>, Intent & FeeAmount], IntentError<'CREATION_FAILED'>>>} The encoded contract call
|
|
5327
5434
|
*
|
|
5328
5435
|
* @example
|
|
5329
5436
|
* const payload = {
|
|
@@ -5335,8 +5442,8 @@ declare class SolverService {
|
|
|
5335
5442
|
* "allowPartialFill": false, // Whether the intent can be partially filled
|
|
5336
5443
|
* "srcChain": "0x38.bsc", // Chain ID where input tokens originate
|
|
5337
5444
|
* "dstChain": "0xa4b1.arbitrum", // Chain ID where output tokens should be delivered
|
|
5338
|
-
* "srcAddress": "0x..", // Source address
|
|
5339
|
-
* "dstAddress": "0x...", // Destination address
|
|
5445
|
+
* "srcAddress": "0x..", // Source address (original address on spoke chain)
|
|
5446
|
+
* "dstAddress": "0x...", // Destination address (original address on spoke chain)
|
|
5340
5447
|
* "solver": "0x..", // Optional specific solver address (address(0) = any solver)
|
|
5341
5448
|
* "data": "0x..", // Additional arbitrary data
|
|
5342
5449
|
* } satisfies CreateIntentParams;
|
|
@@ -5348,7 +5455,7 @@ declare class SolverService {
|
|
|
5348
5455
|
* console.log('Intent:', intent);
|
|
5349
5456
|
*
|
|
5350
5457
|
*/
|
|
5351
|
-
createIntent<S extends SpokeProvider, R extends boolean = false>(params: CreateIntentParams, spokeProvider: S, fee?: PartnerFee, raw?: R): Promise<Result<[TxReturnType<S, R>, Intent & FeeAmount],
|
|
5458
|
+
createIntent<S extends SpokeProvider, R extends boolean = false>(params: CreateIntentParams, spokeProvider: S, fee?: PartnerFee, raw?: R): Promise<Result<[TxReturnType<S, R>, Intent & FeeAmount, Hex$1], IntentError<'CREATION_FAILED'>>>;
|
|
5352
5459
|
/**
|
|
5353
5460
|
* Cancels an intent
|
|
5354
5461
|
* @param {Intent} intent - The intent to cancel
|
|
@@ -5356,7 +5463,7 @@ declare class SolverService {
|
|
|
5356
5463
|
* @param {boolean} raw - Whether to return the raw transaction
|
|
5357
5464
|
* @returns {Promise<TxReturnType<T, R>>} The encoded contract call
|
|
5358
5465
|
*/
|
|
5359
|
-
cancelIntent<
|
|
5466
|
+
cancelIntent<S extends SpokeProvider, R extends boolean = false>(intent: Intent, spokeProvider: S, raw?: R): Promise<Result<TxReturnType<S, R>>>;
|
|
5360
5467
|
/**
|
|
5361
5468
|
* Gets an intent from a transaction hash (on Hub chain)
|
|
5362
5469
|
* @param {Hash} txHash - The transaction hash on Hub chain
|
|
@@ -5386,7 +5493,7 @@ type RelayAction = 'submit' | 'get_transaction_packets' | 'get_packet';
|
|
|
5386
5493
|
* executed - has confirmed transaction-hash
|
|
5387
5494
|
*/
|
|
5388
5495
|
type RelayTxStatus = 'pending' | 'validating' | 'executing' | 'executed';
|
|
5389
|
-
type RelayErrorCode = '
|
|
5496
|
+
type RelayErrorCode = 'SUBMIT_TX_FAILED' | 'RELAY_TIMEOUT';
|
|
5390
5497
|
type RelayError = {
|
|
5391
5498
|
code: RelayErrorCode;
|
|
5392
5499
|
error: unknown;
|
|
@@ -5394,6 +5501,10 @@ type RelayError = {
|
|
|
5394
5501
|
type SubmitTxParams = {
|
|
5395
5502
|
chain_id: string;
|
|
5396
5503
|
tx_hash: string;
|
|
5504
|
+
data?: {
|
|
5505
|
+
address: Hex;
|
|
5506
|
+
payload: Hex;
|
|
5507
|
+
};
|
|
5397
5508
|
};
|
|
5398
5509
|
type GetTransactionPacketsParams = {
|
|
5399
5510
|
chain_id: string;
|
|
@@ -5469,15 +5580,21 @@ declare function getTransactionPackets(payload: IntentRelayRequest<'get_transact
|
|
|
5469
5580
|
* @returns The response from the intent relay service.
|
|
5470
5581
|
*/
|
|
5471
5582
|
declare function getPacket(payload: IntentRelayRequest<'get_packet'>, apiUrl: HttpUrl): Promise<GetRelayResponse<'get_packet'>>;
|
|
5472
|
-
declare function waitUntilIntentExecuted(payload: WaitUntilIntentExecutedPayload): Promise<Result<PacketData,
|
|
5583
|
+
declare function waitUntilIntentExecuted(payload: WaitUntilIntentExecutedPayload): Promise<Result<PacketData, IntentError<'RELAY_TIMEOUT'>>>;
|
|
5473
5584
|
/**
|
|
5474
5585
|
* Submit the transaction to the Solver API and wait for it to be executed
|
|
5475
5586
|
* @param spokeTxHash - The transaction hash to submit.
|
|
5587
|
+
* @param data - The additional data to submit when relaying the transaction on Solana. Due to Solana's 1232 byte transaction
|
|
5588
|
+
* size limit, Solana transactions are split: the on-chain tx contains only a verification hash, while the full
|
|
5589
|
+
* data is submitted off-chain via the relayer. Contains the to address on Hub chain and instruction data.
|
|
5476
5590
|
* @param spokeProvider - The spoke provider.
|
|
5477
5591
|
* @param timeout - The timeout in milliseconds for the transaction. Default is 20 seconds.
|
|
5478
5592
|
* @returns The transaction hash.
|
|
5479
5593
|
*/
|
|
5480
|
-
declare function relayTxAndWaitPacket<S extends SpokeProvider>(spokeTxHash:
|
|
5594
|
+
declare function relayTxAndWaitPacket<S extends SpokeProvider>(spokeTxHash: string, data: {
|
|
5595
|
+
address: Hex;
|
|
5596
|
+
payload: Hex;
|
|
5597
|
+
} | undefined, spokeProvider: S, relayerApiEndpoint: HttpUrl, timeout?: number): Promise<Result<PacketData, RelayError>>;
|
|
5481
5598
|
|
|
5482
5599
|
declare const IntentCreatedEventAbi: {
|
|
5483
5600
|
readonly type: "event";
|
|
@@ -5601,6 +5718,260 @@ declare class EvmSolverService {
|
|
|
5601
5718
|
static encodeCancelIntent(intent: Intent, intentsContract: Address): EvmContractCall;
|
|
5602
5719
|
}
|
|
5603
5720
|
|
|
5721
|
+
type IcxMigrateParams = {
|
|
5722
|
+
icx: IcxTokenType;
|
|
5723
|
+
amount: bigint;
|
|
5724
|
+
to: Address;
|
|
5725
|
+
action: 'migrate';
|
|
5726
|
+
};
|
|
5727
|
+
type IcxCreateRevertMigrationParams = {
|
|
5728
|
+
amount: bigint;
|
|
5729
|
+
to: IconEoaAddress;
|
|
5730
|
+
action: 'revert';
|
|
5731
|
+
};
|
|
5732
|
+
type IcxRevertMigrationParams = {
|
|
5733
|
+
wICX: IconAddress;
|
|
5734
|
+
amount: bigint;
|
|
5735
|
+
userWallet: Address;
|
|
5736
|
+
to: Hex;
|
|
5737
|
+
};
|
|
5738
|
+
/**
|
|
5739
|
+
* Service for handling ICX migration operations on the hub chain.
|
|
5740
|
+
* Provides functionality to migrate wICX tokens from ICON to the hub chain.
|
|
5741
|
+
*/
|
|
5742
|
+
declare class IcxMigrationService {
|
|
5743
|
+
private readonly hubProvider;
|
|
5744
|
+
constructor(hubProvider: EvmHubProvider);
|
|
5745
|
+
/**
|
|
5746
|
+
* Retrieves the available amount of SODA tokens in the ICX migration contract.
|
|
5747
|
+
* This represents the amount of tokens available for migration.
|
|
5748
|
+
*
|
|
5749
|
+
* @returns The available balance of SODA tokens in the migration contract
|
|
5750
|
+
*/
|
|
5751
|
+
getAvailableAmount(): Promise<bigint>;
|
|
5752
|
+
/**
|
|
5753
|
+
* Generates transaction data for migrating wICX tokens from ICON to the hub chain.
|
|
5754
|
+
* This method creates the necessary contract calls to:
|
|
5755
|
+
* 1. Approve the migration contract to spend the wICX tokens
|
|
5756
|
+
* 2. Execute the migration swap
|
|
5757
|
+
*
|
|
5758
|
+
* @param params - The migration parameters including token address, amount, and recipient
|
|
5759
|
+
* @returns Encoded transaction data for the migration operation
|
|
5760
|
+
* @throws Will throw an error if the hub asset configuration is not found
|
|
5761
|
+
*/
|
|
5762
|
+
migrateData(params: IcxMigrateParams): Hex;
|
|
5763
|
+
/**
|
|
5764
|
+
* Generates transaction data for migrating back tokens to the ICON chain.
|
|
5765
|
+
* @param params - The migration parameters including token address, amount, and recipient
|
|
5766
|
+
* @returns Encoded transaction data for the migration operation
|
|
5767
|
+
* @throws Will throw an error if the hub asset configuration is not found
|
|
5768
|
+
*/
|
|
5769
|
+
revertMigration(params: IcxRevertMigrationParams): Hex;
|
|
5770
|
+
/**
|
|
5771
|
+
* Encodes a migration transaction for the ICX swap contract.
|
|
5772
|
+
* This creates the contract call data for swapping wICX tokens to SODA tokens.
|
|
5773
|
+
*
|
|
5774
|
+
* @param amount - The amount of wICX tokens to migrate
|
|
5775
|
+
* @param to - The address that will receive the migrated SODA tokens
|
|
5776
|
+
* @returns The encoded contract call for the migration operation
|
|
5777
|
+
*/
|
|
5778
|
+
encodeMigrate(amount: bigint, to: Address): EvmContractCall;
|
|
5779
|
+
/**
|
|
5780
|
+
* Encodes a revert migration transaction for the ICX swap contract.
|
|
5781
|
+
* This creates the contract call data for swapping SODA tokens to wICX tokens.
|
|
5782
|
+
*
|
|
5783
|
+
* @param amount - The amount of wICX tokens to migrate
|
|
5784
|
+
* @param to - The address that will receive the migrated SODA tokens
|
|
5785
|
+
* @returns The encoded contract call for the migration operation
|
|
5786
|
+
*/
|
|
5787
|
+
encodeRevertMigration(amount: bigint, to: Address): EvmContractCall;
|
|
5788
|
+
}
|
|
5789
|
+
|
|
5790
|
+
type GetMigrationFailedPayload<T extends MigrationErrorCode> = T extends 'CREATE_MIGRATION_INTENT_FAILED' ? IcxMigrateParams : T extends 'CREATE_REVERT_MIGRATION_INTENT_FAILED' ? IcxCreateRevertMigrationParams : T extends 'REVERT_MIGRATION_FAILED' ? IcxCreateRevertMigrationParams : T extends 'MIGRATION_FAILED' ? IcxMigrateParams : never;
|
|
5791
|
+
type MigrationFailedErrorData<T extends MigrationErrorCode> = {
|
|
5792
|
+
payload: GetMigrationFailedPayload<T>;
|
|
5793
|
+
error: unknown;
|
|
5794
|
+
};
|
|
5795
|
+
type MigrationErrorCode = 'MIGRATION_FAILED' | 'CREATE_MIGRATION_INTENT_FAILED' | 'CREATE_REVERT_MIGRATION_INTENT_FAILED' | 'REVERT_MIGRATION_FAILED';
|
|
5796
|
+
type MigrationErrorData<T extends MigrationErrorCode> = T extends 'CREATE_MIGRATION_INTENT_FAILED' ? MigrationFailedErrorData<T> : T extends 'CREATE_REVERT_MIGRATION_INTENT_FAILED' ? MigrationFailedErrorData<T> : T extends 'REVERT_MIGRATION_FAILED' ? MigrationFailedErrorData<T> : T extends 'MIGRATION_FAILED' ? MigrationFailedErrorData<T> : never;
|
|
5797
|
+
type MigrationError<T extends MigrationErrorCode> = {
|
|
5798
|
+
code: T;
|
|
5799
|
+
data: MigrationErrorData<T>;
|
|
5800
|
+
};
|
|
5801
|
+
type MigrationAction = 'migrate' | 'revert';
|
|
5802
|
+
type MigrationParams = Prettify<{
|
|
5803
|
+
token: 'ICX';
|
|
5804
|
+
} & IcxMigrateParams>;
|
|
5805
|
+
type MigrationTokens = 'ICX';
|
|
5806
|
+
type GetMigrateParams<T extends MigrationTokens> = T extends 'ICX' ? IcxMigrateParams : never;
|
|
5807
|
+
type GetRevertMigrationParams<T extends MigrationTokens> = T extends 'ICX' ? IcxCreateRevertMigrationParams : never;
|
|
5808
|
+
declare class MigrationService {
|
|
5809
|
+
private readonly icxMigration;
|
|
5810
|
+
private readonly hubProvider;
|
|
5811
|
+
private readonly config;
|
|
5812
|
+
constructor(hubProvider: EvmHubProvider, config?: MigrationServiceConfig);
|
|
5813
|
+
migrateData(params: IcxMigrateParams): Promise<Hex$1>;
|
|
5814
|
+
/**
|
|
5815
|
+
* Checks if the allowance is valid for the migration transaction.
|
|
5816
|
+
* @param params - The parameters for the migration transaction.
|
|
5817
|
+
* @param spokeProvider - The spoke provider.
|
|
5818
|
+
* @returns {Promise<Result<boolean>>} - Returns the result of the allowance check or error
|
|
5819
|
+
*
|
|
5820
|
+
* @example
|
|
5821
|
+
* const result = await migrationService.isAllowanceValid(
|
|
5822
|
+
* {
|
|
5823
|
+
* token: 'ICX', // Token to migrate
|
|
5824
|
+
* icx: 'cx...', // Address of the ICX or wICX token to migrate
|
|
5825
|
+
* amount: 1000n, // Amount to migrate (in ICX decimals, usually 18)
|
|
5826
|
+
* to: '0x...', // Address to receive the migrated SODA tokens
|
|
5827
|
+
* action: 'migrate', // Action to perform (migrate or revert)
|
|
5828
|
+
* },
|
|
5829
|
+
* spokeProvider, // IconSpokeProvider instance
|
|
5830
|
+
* );
|
|
5831
|
+
*
|
|
5832
|
+
*/
|
|
5833
|
+
isAllowanceValid<S extends SpokeProvider>(params: MigrationParams | IcxCreateRevertMigrationParams, spokeProvider: S): Promise<Result<boolean>>;
|
|
5834
|
+
/**
|
|
5835
|
+
* Approves the amount spending for the revert migration transaction.
|
|
5836
|
+
* @param params - The parameters for the revert migration transaction.
|
|
5837
|
+
* @param spokeProvider - The spoke provider.
|
|
5838
|
+
* @param raw - Whether to return the raw transaction hash instead of the transaction receipt
|
|
5839
|
+
* @returns {Promise<Result<TxReturnType<S, R>>>} - Returns the raw transaction payload or transaction hash
|
|
5840
|
+
*
|
|
5841
|
+
* @example
|
|
5842
|
+
* const result = await migrationService.approve(
|
|
5843
|
+
* {
|
|
5844
|
+
* amount: 1000n, // Amount of SODA tokens to revert
|
|
5845
|
+
* to: 'hx...', // Icon Address to receive the reverted SODA tokens as ICX
|
|
5846
|
+
* action: 'revert',
|
|
5847
|
+
* },
|
|
5848
|
+
* spokeProvider, // SonicSpokeProvider instance
|
|
5849
|
+
* true // Optional raw flag to return the raw transaction hash instead of the transaction receipt
|
|
5850
|
+
* );
|
|
5851
|
+
*
|
|
5852
|
+
*/
|
|
5853
|
+
approve<S extends SpokeProvider, R extends boolean = false>(params: IcxCreateRevertMigrationParams, spokeProvider: S, raw?: R): Promise<Result<TxReturnType<S, R>>>;
|
|
5854
|
+
/**
|
|
5855
|
+
* Creates a migration intent and submits (relays) it to the hub chain.
|
|
5856
|
+
* @param params - The parameters for the migration transaction.
|
|
5857
|
+
* @param spokeProvider - The spoke provider.
|
|
5858
|
+
* @param timeout - The timeout in milliseconds for the transaction. Default is 60 seconds.
|
|
5859
|
+
* @returns {Promise<Result<[Hex, Hex], MigrationError<'MIGRATION_FAILED'> | MigrationError<'CREATE_MIGRATION_INTENT_FAILED'> | RelayError>>}
|
|
5860
|
+
* Returns a Result containing a tuple of [spokeTxHash, hubTxHash] if successful,
|
|
5861
|
+
* or an error describing why the migration or relay failed.
|
|
5862
|
+
*
|
|
5863
|
+
* @example
|
|
5864
|
+
* const result = await migrationService.createAndSubmitMigrateIntent(
|
|
5865
|
+
* {
|
|
5866
|
+
* token: 'ICX', // Token to migrate
|
|
5867
|
+
* icx: 'cx...', // Address of the ICX or wICX token to migrate
|
|
5868
|
+
* amount: 1000n, // Amount to migrate (in ICX decimals, usually 18)
|
|
5869
|
+
* to: '0x...', // Address to receive the migrated SODA tokens
|
|
5870
|
+
* action: 'migrate',
|
|
5871
|
+
* },
|
|
5872
|
+
* spokeProvider, // IconSpokeProvider instance
|
|
5873
|
+
* 30000 // Optional timeout in milliseconds (default: 60000, i.e. 60 seconds)
|
|
5874
|
+
* );
|
|
5875
|
+
*
|
|
5876
|
+
* if (!result.ok) {
|
|
5877
|
+
* // Handle error
|
|
5878
|
+
* }
|
|
5879
|
+
*
|
|
5880
|
+
* const [
|
|
5881
|
+
* spokeTxHash, // transaction hash on the spoke chain
|
|
5882
|
+
* hubTxHash, // transaction hash on the hub chain (i.e. the transaction that was relayed to the hub)
|
|
5883
|
+
* ] = result.value;
|
|
5884
|
+
* console.log('Migration transaction hashes:', { spokeTxHash, hubTxHash });
|
|
5885
|
+
*/
|
|
5886
|
+
createAndSubmitMigrateIntent(params: MigrationParams, spokeProvider: IconSpokeProvider, timeout?: number): Promise<Result<[
|
|
5887
|
+
Hex$1,
|
|
5888
|
+
Hex$1
|
|
5889
|
+
], MigrationError<'MIGRATION_FAILED'> | MigrationError<'CREATE_MIGRATION_INTENT_FAILED'> | RelayError>>;
|
|
5890
|
+
/**
|
|
5891
|
+
* Creates a revert migration (SODA to ICX) intent and submits (relays) it to the spoke chain.
|
|
5892
|
+
* @param params - The parameters for the revert migration transaction.
|
|
5893
|
+
* @param spokeProvider - The SonicSpokeProvider instance.
|
|
5894
|
+
* @param timeout - The timeout in milliseconds for the transaction. Default is 60 seconds.
|
|
5895
|
+
*
|
|
5896
|
+
* @returns {Promise<Result<[Hex, Hex], MigrationError<'REVERT_MIGRATION_FAILED'> | MigrationError<'CREATE_REVERT_MIGRATION_INTENT_FAILED'> | RelayError>>}
|
|
5897
|
+
* Returns a Result containing a tuple of [hubTxHash, spokeTxHash] if successful,
|
|
5898
|
+
* or an error describing why the revert migration or relay failed.
|
|
5899
|
+
*
|
|
5900
|
+
*
|
|
5901
|
+
* @example
|
|
5902
|
+
* const result = await migrationService.createAndSubmitRevertMigrationIntent(
|
|
5903
|
+
* {
|
|
5904
|
+
* amount: 1000n, // Amount of SODA tokens to revert
|
|
5905
|
+
* to: 'hx...', // Icon Address to receive the reverted SODA tokens as ICX
|
|
5906
|
+
* action: 'revert',
|
|
5907
|
+
* },
|
|
5908
|
+
* spokeProvider, // SonicSpokeProvider instance
|
|
5909
|
+
* 30000 // Optional timeout in milliseconds (default: 60000, i.e. 60 seconds)
|
|
5910
|
+
* );
|
|
5911
|
+
*
|
|
5912
|
+
* if (!result.ok) {
|
|
5913
|
+
* // Handle error
|
|
5914
|
+
* }
|
|
5915
|
+
*
|
|
5916
|
+
* const [
|
|
5917
|
+
* hubTxHash, // transaction hash on the hub chain
|
|
5918
|
+
* spokeTxHash, // transaction hash on the spoke chain (i.e. the transaction that was relayed to the spoke)
|
|
5919
|
+
* ] = result.value;
|
|
5920
|
+
* console.log('Revert migration transaction hashes:', { hubTxHash, spokeTxHash });
|
|
5921
|
+
*/
|
|
5922
|
+
createAndSubmitRevertMigrationIntent(params: IcxCreateRevertMigrationParams, spokeProvider: SonicSpokeProvider, timeout?: number): Promise<Result<[
|
|
5923
|
+
Hex$1,
|
|
5924
|
+
Hex$1
|
|
5925
|
+
], MigrationError<'REVERT_MIGRATION_FAILED'> | MigrationError<'CREATE_REVERT_MIGRATION_INTENT_FAILED'> | RelayError>>;
|
|
5926
|
+
/**
|
|
5927
|
+
* Migrates ICX or wICX tokens from ICON to the hub chain.
|
|
5928
|
+
* This function handles the migration of ICX or wICX tokens to SODA tokens on the hub chain.
|
|
5929
|
+
* Note: This function does not relay the transaction to the spoke chain.
|
|
5930
|
+
* You should call the `isAllowanceValid` function before calling this function to check if the allowance is valid.
|
|
5931
|
+
* You should call the `relayTxAndWaitPacket` function after calling this function to relay the transaction to the spoke chain.
|
|
5932
|
+
*
|
|
5933
|
+
* @param {MigrationParams} params - The parameters for the migration transaction.
|
|
5934
|
+
* @param {IconSpokeProvider} spokeProvider - The spoke provider.
|
|
5935
|
+
* @param {boolean} raw - Whether to return the raw transaction hash instead of the transaction receipt
|
|
5936
|
+
* @returns {Promise<Result<TxReturnType<IconSpokeProvider, R>, MigrationError<'CREATE_MIGRATION_INTENT_FAILED'>>>} - Returns the raw transaction payload or transaction hash
|
|
5937
|
+
*
|
|
5938
|
+
* @example
|
|
5939
|
+
* const result = await migrationService.createMigrateIntent(
|
|
5940
|
+
* {
|
|
5941
|
+
* icx: 'cx...', // Address of the ICX or wICX token to migrate
|
|
5942
|
+
* amount: 1000n, // Amount to migrate (in ICX decimals, usually 18)
|
|
5943
|
+
* to: '0x...', // Address to receive the migrated SODA tokens
|
|
5944
|
+
* },
|
|
5945
|
+
* spokeProvider, // IconSpokeProvider instance
|
|
5946
|
+
* true // Optional raw flag to return the raw transaction hash instead of the transaction receipt
|
|
5947
|
+
* );
|
|
5948
|
+
*
|
|
5949
|
+
* if (!result.ok) {
|
|
5950
|
+
* // Handle error
|
|
5951
|
+
* }
|
|
5952
|
+
*/
|
|
5953
|
+
createMigrateIntent<R extends boolean = false>(params: MigrationParams, spokeProvider: IconSpokeProvider, raw?: boolean): Promise<Result<TxReturnType<IconSpokeProvider, R>, MigrationError<'CREATE_MIGRATION_INTENT_FAILED'>>>;
|
|
5954
|
+
/**
|
|
5955
|
+
* Creates a revert migration intent transaction on the hub chain.
|
|
5956
|
+
* Note: This function does not relay the transaction to the spoke chain.
|
|
5957
|
+
* You should call the `isAllowanceValid` function before calling this function to check if the allowance is valid.
|
|
5958
|
+
* You should call the `relayTxAndWaitPacket` function after calling this function to relay the transaction to the spoke chain.
|
|
5959
|
+
* @param {IcxCreateRevertMigrationParams} - The parameters for the revert migration transaction.
|
|
5960
|
+
* @param {SonicSpokeProvider} spokeProvider - The spoke provider.
|
|
5961
|
+
* @param {boolean} raw - Whether to return the raw transaction hash instead of the transaction receipt
|
|
5962
|
+
* @returns {Promise<Result<TxReturnType<SonicSpokeProvider, R>, MigrationError<'CREATE_REVERT_MIGRATION_INTENT_FAILED'>>>} - Returns the transaction hash or error
|
|
5963
|
+
*
|
|
5964
|
+
* @example
|
|
5965
|
+
* const result = await migrationService.createRevertMigrationIntent(
|
|
5966
|
+
* {
|
|
5967
|
+
* amount: 1000n, // Amount of SODA tokens to revert
|
|
5968
|
+
* to: 'hx...', // Icon Address to receive the reverted SODA tokens as ICX
|
|
5969
|
+
* action: 'revert',
|
|
5970
|
+
* },
|
|
5971
|
+
*/
|
|
5972
|
+
createRevertMigrationIntent<R extends boolean = false>(params: IcxCreateRevertMigrationParams, spokeProvider: SonicSpokeProvider, raw?: R): Promise<Result<TxReturnType<SonicSpokeProvider, R>, MigrationError<'CREATE_REVERT_MIGRATION_INTENT_FAILED'>>>;
|
|
5973
|
+
}
|
|
5974
|
+
|
|
5604
5975
|
type CWSpokeDepositParams = {
|
|
5605
5976
|
from: string;
|
|
5606
5977
|
to?: HubAddress;
|
|
@@ -5638,15 +6009,28 @@ type SolanaSpokeDepositParams = {
|
|
|
5638
6009
|
data: Hex;
|
|
5639
6010
|
};
|
|
5640
6011
|
|
|
6012
|
+
type StellarRpcConfig = {
|
|
6013
|
+
horizonRpcUrl?: HttpUrl;
|
|
6014
|
+
sorobanRpcUrl?: HttpUrl;
|
|
6015
|
+
};
|
|
5641
6016
|
declare class StellarSpokeProvider implements ISpokeProvider {
|
|
5642
6017
|
private readonly server;
|
|
6018
|
+
private readonly sorobanServer;
|
|
5643
6019
|
private readonly contract;
|
|
5644
6020
|
readonly chainConfig: StellarSpokeChainConfig;
|
|
5645
6021
|
readonly walletProvider: IStellarWalletProvider;
|
|
5646
|
-
constructor(walletProvider: IStellarWalletProvider,
|
|
6022
|
+
constructor(walletProvider: IStellarWalletProvider, config: StellarSpokeChainConfig, rpcConfig?: StellarRpcConfig);
|
|
5647
6023
|
getBalance(tokenAddress: string): Promise<number>;
|
|
6024
|
+
private buildPriorityStellarTransaction;
|
|
6025
|
+
private handleSendTransactionError;
|
|
6026
|
+
private signAndSendTransaction;
|
|
6027
|
+
private waitForTransaction;
|
|
6028
|
+
private submitOrRestoreAndRetry;
|
|
6029
|
+
private handleSimulationRestore;
|
|
5648
6030
|
deposit<R extends boolean = false>(token: string, amount: string, recipient: Uint8Array, data: Uint8Array, raw?: R): PromiseStellarTxReturnType<R>;
|
|
5649
6031
|
sendMessage<R extends boolean = false>(dst_chain_id: string, dst_address: Uint8Array, payload: Uint8Array, raw?: R): PromiseStellarTxReturnType<R>;
|
|
6032
|
+
private buildDepositCall;
|
|
6033
|
+
private buildSendMessageCall;
|
|
5650
6034
|
static getAddressBCSBytes(stellaraddress: string): Hex;
|
|
5651
6035
|
static getTsWalletBytes(stellaraddress: string): Hex;
|
|
5652
6036
|
}
|
|
@@ -5742,6 +6126,8 @@ type EvmHubChainConfig = BaseHubChainConfig<'EVM'> & {
|
|
|
5742
6126
|
assetManager: Address$1;
|
|
5743
6127
|
hubWallet: Address$1;
|
|
5744
6128
|
xTokenManager: Address$1;
|
|
6129
|
+
icxMigration: Address$1;
|
|
6130
|
+
sodaToken: Address$1;
|
|
5745
6131
|
};
|
|
5746
6132
|
nativeToken: Address$1;
|
|
5747
6133
|
};
|
|
@@ -5757,6 +6143,7 @@ type MoneyMarketConfig = {
|
|
|
5757
6143
|
};
|
|
5758
6144
|
type MoneyMarketServiceConfig = Prettify<MoneyMarketConfig & PartnerFeeConfig & RelayerApiConfig>;
|
|
5759
6145
|
type SolverServiceConfig = Prettify<SolverConfig & PartnerFeeConfig & RelayerApiConfig>;
|
|
6146
|
+
type MigrationServiceConfig = Prettify<RelayerApiConfig>;
|
|
5760
6147
|
type MoneyMarketConfigParams = Prettify<MoneyMarketConfig & Optional<PartnerFeeConfig, 'partnerFee'>> | Optional<PartnerFeeConfig, 'partnerFee'>;
|
|
5761
6148
|
type Default = {
|
|
5762
6149
|
default: boolean;
|
|
@@ -5810,13 +6197,15 @@ type StellarSpokeChainConfig = BaseSpokeChainConfig<'STELLAR'> & {
|
|
|
5810
6197
|
rateLimit: string;
|
|
5811
6198
|
testToken: string;
|
|
5812
6199
|
};
|
|
5813
|
-
|
|
6200
|
+
horizonRpcUrl: HttpUrl;
|
|
6201
|
+
sorobanRpcUrl: HttpUrl;
|
|
5814
6202
|
};
|
|
5815
6203
|
type IconSpokeChainConfig = BaseSpokeChainConfig<'ICON'> & {
|
|
5816
6204
|
addresses: {
|
|
5817
6205
|
assetManager: IconAddress;
|
|
5818
6206
|
connection: IconAddress;
|
|
5819
6207
|
rateLimit: IconAddress;
|
|
6208
|
+
wICX: `cx${string}`;
|
|
5820
6209
|
};
|
|
5821
6210
|
nid: Hex$1;
|
|
5822
6211
|
};
|
|
@@ -5900,6 +6289,7 @@ type FeeAmount = {
|
|
|
5900
6289
|
};
|
|
5901
6290
|
type EvmTxReturnType<T extends boolean> = T extends true ? TransactionReceipt : Hex$1;
|
|
5902
6291
|
type IconAddress = `hx${string}` | `cx${string}`;
|
|
6292
|
+
type IcxTokenType = (typeof spokeChainConfig)[typeof ICON_MAINNET_CHAIN_ID]['addresses']['wICX'] | (typeof spokeChainConfig)[typeof ICON_MAINNET_CHAIN_ID]['nativeToken'];
|
|
5903
6293
|
type Result<T, E = Error | unknown> = {
|
|
5904
6294
|
ok: true;
|
|
5905
6295
|
value: T;
|
|
@@ -5918,7 +6308,7 @@ type SolverConfig = {
|
|
|
5918
6308
|
};
|
|
5919
6309
|
type SolverConfigParams = Prettify<SolverConfig & Optional<PartnerFeeConfig, 'partnerFee'>> | Optional<PartnerFeeConfig, 'partnerFee'>;
|
|
5920
6310
|
type QuoteType = 'exact_input' | 'exact_output';
|
|
5921
|
-
type
|
|
6311
|
+
type SolverIntentQuoteRequest = {
|
|
5922
6312
|
token_src: string;
|
|
5923
6313
|
token_src_blockchain_id: SpokeChainId;
|
|
5924
6314
|
token_dst: string;
|
|
@@ -5926,40 +6316,40 @@ type IntentQuoteRequest = {
|
|
|
5926
6316
|
amount: bigint;
|
|
5927
6317
|
quote_type: QuoteType;
|
|
5928
6318
|
};
|
|
5929
|
-
type
|
|
6319
|
+
type SolverIntentQuoteResponseRaw = {
|
|
5930
6320
|
quoted_amount: string;
|
|
5931
6321
|
};
|
|
5932
|
-
type
|
|
6322
|
+
type SolverIntentQuoteResponse = {
|
|
5933
6323
|
quoted_amount: bigint;
|
|
5934
6324
|
};
|
|
5935
|
-
type
|
|
6325
|
+
type SolverErrorResponse = {
|
|
5936
6326
|
detail: {
|
|
5937
|
-
code:
|
|
6327
|
+
code: SolverIntentErrorCode;
|
|
5938
6328
|
message: string;
|
|
5939
6329
|
};
|
|
5940
6330
|
};
|
|
5941
|
-
type
|
|
6331
|
+
type SolverExecutionRequest = {
|
|
5942
6332
|
intent_tx_hash: Hex$1;
|
|
5943
6333
|
};
|
|
5944
|
-
type
|
|
6334
|
+
type SolverExecutionResponse = {
|
|
5945
6335
|
answer: 'OK';
|
|
5946
6336
|
intent_hash: Hex$1;
|
|
5947
6337
|
};
|
|
5948
|
-
type
|
|
6338
|
+
type SolverIntentStatusRequest = {
|
|
5949
6339
|
intent_tx_hash: Hex$1;
|
|
5950
6340
|
};
|
|
5951
|
-
type
|
|
5952
|
-
status:
|
|
6341
|
+
type SolverIntentStatusResponse = {
|
|
6342
|
+
status: SolverIntentStatusCode;
|
|
5953
6343
|
fill_tx_hash?: string;
|
|
5954
6344
|
};
|
|
5955
|
-
declare enum
|
|
6345
|
+
declare enum SolverIntentStatusCode {
|
|
5956
6346
|
NOT_FOUND = -1,
|
|
5957
6347
|
NOT_STARTED_YET = 1,// It's in the task pool, but not started yet
|
|
5958
6348
|
STARTED_NOT_FINISHED = 2,
|
|
5959
6349
|
SOLVED = 3,
|
|
5960
6350
|
FAILED = 4
|
|
5961
6351
|
}
|
|
5962
|
-
declare enum
|
|
6352
|
+
declare enum SolverIntentErrorCode {
|
|
5963
6353
|
NO_PATH_FOUND = -4,// No path to swap Token X to Token Y
|
|
5964
6354
|
NO_PRIVATE_LIQUIDITY = -5,// Path found, but we have no private liquidity on the dest chain
|
|
5965
6355
|
NOT_ENOUGH_PRIVATE_LIQUIDITY = -8,// Path found, but not enough private liquidity on the dst chain
|
|
@@ -6008,7 +6398,7 @@ type SuiRawTransaction = {
|
|
|
6008
6398
|
};
|
|
6009
6399
|
type EvmReturnType<Raw extends boolean> = Raw extends true ? EvmRawTransaction : Hex$1;
|
|
6010
6400
|
type SolanaReturnType<Raw extends boolean> = Raw extends true ? SolanaRawTransaction : Hex$1;
|
|
6011
|
-
type StellarReturnType<Raw extends boolean> = Raw extends true ? StellarRawTransaction :
|
|
6401
|
+
type StellarReturnType<Raw extends boolean> = Raw extends true ? StellarRawTransaction : string;
|
|
6012
6402
|
type IconReturnType<Raw extends boolean> = Raw extends true ? IconRawTransaction : Hex$1;
|
|
6013
6403
|
type SuiReturnType<Raw extends boolean> = Raw extends true ? SuiRawTransaction : Hex$1;
|
|
6014
6404
|
type CWReturnType<Raw extends boolean> = Raw extends true ? CWRawTransaction : Hex$1;
|
|
@@ -6032,6 +6422,8 @@ type Prettify<T> = {
|
|
|
6032
6422
|
type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
6033
6423
|
type ExtractKeys<T> = T extends unknown ? keyof T : never;
|
|
6034
6424
|
type SpokeTokenSymbols = ExtractKeys<(typeof spokeChainConfig)[SpokeChainId]['supportedTokens']>;
|
|
6425
|
+
type SpokeTxHash = string;
|
|
6426
|
+
type HubTxHash = string;
|
|
6035
6427
|
|
|
6036
6428
|
declare function getIconAddressBytes(address: string): Hex;
|
|
6037
6429
|
|
|
@@ -6122,6 +6514,7 @@ declare function requestJsonRpc(rawTransaction: unknown, id?: number): Promise<R
|
|
|
6122
6514
|
type SodaxConfig = {
|
|
6123
6515
|
solver?: SolverConfigParams;
|
|
6124
6516
|
moneyMarket?: MoneyMarketConfigParams;
|
|
6517
|
+
migration?: MigrationServiceConfig;
|
|
6125
6518
|
hubProviderConfig?: EvmHubProviderConfig;
|
|
6126
6519
|
relayerApiEndpoint?: HttpUrl;
|
|
6127
6520
|
};
|
|
@@ -6134,6 +6527,7 @@ declare class Sodax {
|
|
|
6134
6527
|
readonly config?: SodaxConfig;
|
|
6135
6528
|
readonly solver: SolverService;
|
|
6136
6529
|
readonly moneyMarket: MoneyMarketService;
|
|
6530
|
+
readonly migration: MigrationService;
|
|
6137
6531
|
private readonly hubProvider;
|
|
6138
6532
|
private readonly relayerApiEndpoint;
|
|
6139
6533
|
constructor(config?: SodaxConfig);
|
|
@@ -6173,6 +6567,8 @@ declare const DEFAULT_RETRY_DELAY_MS = 2000;
|
|
|
6173
6567
|
declare const ICON_TX_RESULT_WAIT_MAX_RETRY = 10;
|
|
6174
6568
|
declare const MAX_UINT256: bigint;
|
|
6175
6569
|
declare const FEE_PERCENTAGE_SCALE = 10000n;
|
|
6570
|
+
declare const STELLAR_PRIORITY_FEE = "10000";
|
|
6571
|
+
declare const STELLAR_DEFAULT_TX_TIMEOUT_SECONDS = 100;
|
|
6176
6572
|
declare const VAULT_TOKEN_DECIMALS = 18;
|
|
6177
6573
|
declare const INTENT_RELAY_CHAIN_IDS: {
|
|
6178
6574
|
readonly AVAX: 6n;
|
|
@@ -6238,6 +6634,12 @@ declare const spokeChainConfig: {
|
|
|
6238
6634
|
readonly decimals: 18;
|
|
6239
6635
|
readonly address: "0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38";
|
|
6240
6636
|
};
|
|
6637
|
+
readonly SODA: {
|
|
6638
|
+
readonly symbol: "SODA";
|
|
6639
|
+
readonly name: "SODAX";
|
|
6640
|
+
readonly decimals: 18;
|
|
6641
|
+
readonly address: "0x7c7d53EEcda37a87ce0D5bf8E0b24512A48dC963";
|
|
6642
|
+
};
|
|
6241
6643
|
};
|
|
6242
6644
|
};
|
|
6243
6645
|
readonly solana: {
|
|
@@ -6276,8 +6678,8 @@ declare const spokeChainConfig: {
|
|
|
6276
6678
|
};
|
|
6277
6679
|
};
|
|
6278
6680
|
readonly gasPrice: "500000";
|
|
6279
|
-
readonly rpcUrl: "https://
|
|
6280
|
-
readonly wsUrl: "https://
|
|
6681
|
+
readonly rpcUrl: "https://solana-mainnet.g.alchemy.com/v2/i3q5fE3cYSFBE4Lcg1kS5";
|
|
6682
|
+
readonly wsUrl: "https://solana-mainnet.g.alchemy.com/v2/i3q5fE3cYSFBE4Lcg1kS5";
|
|
6281
6683
|
readonly walletAddress: "";
|
|
6282
6684
|
};
|
|
6283
6685
|
readonly "0xa86a.avax": {
|
|
@@ -6371,12 +6773,6 @@ declare const spokeChainConfig: {
|
|
|
6371
6773
|
readonly decimals: 18;
|
|
6372
6774
|
readonly address: "0xA256dd181C3f6E5eC68C6869f5D50a712d47212e";
|
|
6373
6775
|
};
|
|
6374
|
-
readonly WETH: {
|
|
6375
|
-
readonly symbol: "WETH";
|
|
6376
|
-
readonly name: "Wrapped Ether";
|
|
6377
|
-
readonly decimals: 18;
|
|
6378
|
-
readonly address: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1";
|
|
6379
|
-
};
|
|
6380
6776
|
readonly wstETH: {
|
|
6381
6777
|
readonly symbol: "wstETH";
|
|
6382
6778
|
readonly name: "Wrapped stETH";
|
|
@@ -6668,9 +7064,10 @@ declare const spokeChainConfig: {
|
|
|
6668
7064
|
};
|
|
6669
7065
|
readonly nativeToken: "CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA";
|
|
6670
7066
|
readonly bnUSD: "CD6YBFFWMU2UJHX2NGRJ7RN76IJVTCC7MRA46DUBXNB7E6W7H7JRJ2CX";
|
|
6671
|
-
readonly
|
|
7067
|
+
readonly horizonRpcUrl: "https://horizon.stellar.org";
|
|
7068
|
+
readonly sorobanRpcUrl: "https://rpc.ankr.com/stellar_soroban";
|
|
6672
7069
|
readonly chain: {
|
|
6673
|
-
readonly name: "
|
|
7070
|
+
readonly name: "Stellar";
|
|
6674
7071
|
readonly id: "stellar";
|
|
6675
7072
|
readonly type: "STELLAR";
|
|
6676
7073
|
};
|
|
@@ -6702,6 +7099,42 @@ declare const spokeChainConfig: {
|
|
|
6702
7099
|
readonly decimals: 6;
|
|
6703
7100
|
readonly address: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC";
|
|
6704
7101
|
};
|
|
7102
|
+
readonly afSUI: {
|
|
7103
|
+
readonly symbol: "afSUI";
|
|
7104
|
+
readonly name: "Aftermath Staked Sui";
|
|
7105
|
+
readonly decimals: 9;
|
|
7106
|
+
readonly address: "0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc::afsui::AFSUI";
|
|
7107
|
+
};
|
|
7108
|
+
readonly mSUI: {
|
|
7109
|
+
readonly symbol: "mSUI";
|
|
7110
|
+
readonly name: "Mirai Staked SUI";
|
|
7111
|
+
readonly decimals: 9;
|
|
7112
|
+
readonly address: "0x922d15d7f55c13fd790f6e54397470ec592caa2b508df292a2e8553f3d3b274f::msui::MSUI";
|
|
7113
|
+
};
|
|
7114
|
+
readonly haSUI: {
|
|
7115
|
+
readonly symbol: "haSUI";
|
|
7116
|
+
readonly name: "haSUI";
|
|
7117
|
+
readonly decimals: 9;
|
|
7118
|
+
readonly address: "0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d::hasui::HASUI";
|
|
7119
|
+
};
|
|
7120
|
+
readonly vSUI: {
|
|
7121
|
+
readonly symbol: "vSUI";
|
|
7122
|
+
readonly name: "Volo Staked SUI";
|
|
7123
|
+
readonly decimals: 9;
|
|
7124
|
+
readonly address: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT";
|
|
7125
|
+
};
|
|
7126
|
+
readonly yapSUI: {
|
|
7127
|
+
readonly symbol: "yapSUI";
|
|
7128
|
+
readonly name: "Yap Staked SUI";
|
|
7129
|
+
readonly decimals: 9;
|
|
7130
|
+
readonly address: "0x83f1bb8c91ecd1fd313344058b0eed94d63c54e41d8d1ae5bff1353443517d65::yap_sui::YAP_SUI";
|
|
7131
|
+
};
|
|
7132
|
+
readonly trevinSUI: {
|
|
7133
|
+
readonly symbol: "trevinSUI";
|
|
7134
|
+
readonly name: "Trevin Staked SUI";
|
|
7135
|
+
readonly decimals: 9;
|
|
7136
|
+
readonly address: "0x502867b177303bf1bf226245fcdd3403c177e78d175a55a56c0602c7ff51c7fa::trevin_sui::TREVIN_SUI";
|
|
7137
|
+
};
|
|
6705
7138
|
};
|
|
6706
7139
|
readonly nativeToken: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
6707
7140
|
readonly bnUSD: "0xff4de2b2b57dd7611d2812d231a467d007b702a101fd5c7ad3b278257cddb507::bnusd::BNUSD";
|
|
@@ -6717,6 +7150,7 @@ declare const spokeChainConfig: {
|
|
|
6717
7150
|
readonly assetManager: "cx1be33c283c7dc7617181d1b21a6a2309e71b1ee7";
|
|
6718
7151
|
readonly connection: "cxe5cdf3b0f26967b0efc72d470d57bbf534268f94";
|
|
6719
7152
|
readonly rateLimit: "cxbbdcea9e6757023a046067ba8daa3c4c50304358";
|
|
7153
|
+
readonly wICX: "cx3975b43d260fb8ec802cef6e60c2f4d07486f11d";
|
|
6720
7154
|
};
|
|
6721
7155
|
readonly chain: {
|
|
6722
7156
|
readonly id: "0x1.icon";
|
|
@@ -6748,6 +7182,74 @@ declare const spokeChainConfig: {
|
|
|
6748
7182
|
readonly nid: "0x1";
|
|
6749
7183
|
};
|
|
6750
7184
|
};
|
|
7185
|
+
declare const HubVaultSymbols: readonly ["sodaAVAX", "sodaBNB", "sodaETH", "sodaBTC", "sodaSUI", "sodaINJ", "sodaXLM", "sodaSOL", "sodaSODA", "sodaUSDT", "sodaUSDC", "bnUSD", "sodaPOL", "sodaNIBI", "sodaS", "IbnUSD"];
|
|
7186
|
+
type HubVaultSymbol = (typeof HubVaultSymbols)[number];
|
|
7187
|
+
declare const hubVaults: {
|
|
7188
|
+
readonly IbnUSD: {
|
|
7189
|
+
readonly address: "0x9D4b663Eb075d2a1C7B8eaEFB9eCCC0510388B51";
|
|
7190
|
+
readonly reserves: ["0x654DdDf32a9a2aC53f5FB54bf1e93F66791f8047", "0xddf6AD38F9C9451C1F4cDf369040F6869e37393e", "0x1559B52d2e165da1505a542EA37C543c9137f52a"];
|
|
7191
|
+
};
|
|
7192
|
+
readonly sodaS: {
|
|
7193
|
+
readonly address: "0x62ecc3eeb80a162c57624b3ff80313fe69f5203e";
|
|
7194
|
+
readonly reserves: ["0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38"];
|
|
7195
|
+
};
|
|
7196
|
+
readonly sodaNIBI: {
|
|
7197
|
+
readonly address: "0xc6c85287a8b173a509c2f198bb719a8a5a2d0c68";
|
|
7198
|
+
readonly reserves: ["0xe0064414c2c1a636a9424c7a17d86fbf7fd3f190"];
|
|
7199
|
+
};
|
|
7200
|
+
readonly sodaPOL: {
|
|
7201
|
+
readonly address: "0x208ed38f4783328aa9ebfec360d32e7520a9b779";
|
|
7202
|
+
readonly reserves: ["0x9ee17486571917837210824b0d4cadfe3b324d12"];
|
|
7203
|
+
};
|
|
7204
|
+
readonly bnUSD: {
|
|
7205
|
+
readonly address: "0xe801ca34e19abcbfea12025378d19c4fbe250131";
|
|
7206
|
+
readonly reserves: ["0xabbb91c0617090f0028bdc27597cd0d038f3a833", "0xbdf1f453fcb61424011bbddcb96cfdb30f3fe876", "0x94dc79ce9c515ba4ae4d195da8e6ab86c69bfc38", "0x5ce6c1c51ff762cf3acd21396257046f694168b6", "0xdf5639d91359866f266b56d60d98ede9feedd100", "0x238384ae2b4f0ec189ecb5031859ba306b2679c5", "0x419ca9054e44e94ceab52846ecdc3997439bbca6", "0x18f85f9e80ff9496eebd5979a051af16ce751567", "0x289cda1043b4ce26bdca3c12e534f56b24308a5b", "0x23225ab8e63fca4070296678cb46566d57e1bbe3", "0x14c65b1cdc0b821569081b1f77342da0d0cbf439", "0xdf23097b9aeb917bf8fb70e99b6c528fffa35364", "0x11b93c162aabffd026539bb3b9f9ec22c8b7ef8a", "0x69425ffb14704124a58d6f69d510f74a59d9a5bc", "0x9d4b663eb075d2a1c7b8eaefb9eccc0510388b51"];
|
|
7207
|
+
};
|
|
7208
|
+
readonly sodaSODA: {
|
|
7209
|
+
readonly address: "0x21685e341de7844135329914be6bd8d16982d834";
|
|
7210
|
+
readonly reserves: ["0x7c7d53eecda37a87ce0d5bf8e0b24512a48dc963"];
|
|
7211
|
+
};
|
|
7212
|
+
readonly sodaAVAX: {
|
|
7213
|
+
readonly address: "0x14238d267557e9d799016ad635b53cd15935d290";
|
|
7214
|
+
readonly reserves: ["0xc9e4f0b6195f389d9d2b639f2878b7674eb9d8cd"];
|
|
7215
|
+
};
|
|
7216
|
+
readonly sodaBNB: {
|
|
7217
|
+
readonly address: "0x40cd41b35db9e5109ae7e54b44de8625db320e6b";
|
|
7218
|
+
readonly reserves: ["0x13b70564b1ec12876b20fab5d1bb630311312f4f"];
|
|
7219
|
+
};
|
|
7220
|
+
readonly sodaETH: {
|
|
7221
|
+
readonly address: "0x4effb5813271699683c25c734f4dabc45b363709";
|
|
7222
|
+
readonly reserves: ["0x70178089842be7f8e4726b33f0d1569db8021faa", "0xad332860dd3b6f0e63f4f66e9457900917ac78cd", "0xdcd9578b51ef55239b6e68629d822a8d97c95b86", "0x57fc2ac5701e463ae261adbd6c99fbeb48ce5293", "0x50c42deacd8fc9773493ed674b675be577f2634b"];
|
|
7223
|
+
};
|
|
7224
|
+
readonly sodaBTC: {
|
|
7225
|
+
readonly address: "0x7a1a5555842ad2d0ed274d09b5c4406a95799d5d";
|
|
7226
|
+
readonly reserves: ["0x2803a23a3ba6b09e57d1c71dec0d9efdbb00a27f", "0xfb0acb1b2720b620935f50a6dd3f7fea52b2fcbe", "0x96fc8540736f1598b7e235e6de8814062b3b5d3b", "0xd8a24c71fea5bb81c66c01e532de7d9b11e13905"];
|
|
7227
|
+
};
|
|
7228
|
+
readonly sodaSUI: {
|
|
7229
|
+
readonly address: "0xdc5b4b00f98347e95b9f94911213dab4c687e1e3";
|
|
7230
|
+
readonly reserves: ["0x4676b2a551b25c04e235553c1c81019337384673"];
|
|
7231
|
+
};
|
|
7232
|
+
readonly sodaINJ: {
|
|
7233
|
+
readonly address: "0x1f22279c89b213944b7ea41dacb0a868ddcdfd13";
|
|
7234
|
+
readonly reserves: ["0xd375590b4955f6ea5623f799153f9b787a3bd319"];
|
|
7235
|
+
};
|
|
7236
|
+
readonly sodaXLM: {
|
|
7237
|
+
readonly address: "0x6bc8c37cba91f76e68c9e6d689a9c21e4d32079b";
|
|
7238
|
+
readonly reserves: ["0x8ac68af223907fb1b893086601a3d99e00f2fa9d"];
|
|
7239
|
+
};
|
|
7240
|
+
readonly sodaSOL: {
|
|
7241
|
+
readonly address: "0xdea692287e2ce8cb08fa52917be0f16b1dacdc87";
|
|
7242
|
+
readonly reserves: ["0x0c09e69a4528945de6d16c7e469dea6996fdf636"];
|
|
7243
|
+
};
|
|
7244
|
+
readonly sodaUSDT: {
|
|
7245
|
+
readonly address: "0xbdf1f453fcb61424011bbddcb96cfdb30f3fe876";
|
|
7246
|
+
readonly reserves: ["0x41fd5c169e014e2a657b9de3553f7a7b735fe47a", "0xc168067d95109003805ac865ae556e8476dc69bc", "0x3c0a80c6a1110fc80309382b3989ec626c135ee9", "0x6047828dc181963ba44974801ff68e538da5eaf9"];
|
|
7247
|
+
};
|
|
7248
|
+
readonly sodaUSDC: {
|
|
7249
|
+
readonly address: "0xabbb91c0617090f0028bdc27597cd0d038f3a833";
|
|
7250
|
+
readonly reserves: ["0x41abf4b1559ff709ef8150079bcb26db1fffd117", "0x72e852545b024ddcbc5b70c1bcbdaa025164259c", "0xb7c213cbd24967de9838fa014668fddb338f724b", "0xdb7bda65c3a1c51d64dc4444e418684677334109", "0xa36893ba308b332fdebfa95916d1df3a2e3cf8b3", "0x29219dd400f2bf60e5a23d13be72b486d4038894", "0x5635369c8a29a081d26c2e9e28012fca548ba0cb", "0x3d73437dd81b3f9ec82752beb1752f03a8531710", "0x4bc1211faa06fb50ff61a70331f56167ae511057", "0x348007b53f25a9a857ab8ea81ec9e3ccbcf440f2", "0xc3f020057510ffe10ceb882e1b48238b43d78a5e", "0x9d58508ad10d34048a11640735ca5075bba07b35"];
|
|
7251
|
+
};
|
|
7252
|
+
};
|
|
6751
7253
|
declare const hubAssets: Record<SpokeChainId, Record<Address | string, {
|
|
6752
7254
|
asset: Address;
|
|
6753
7255
|
decimal: number;
|
|
@@ -6760,15 +7262,237 @@ declare const getSolverConfig: (chainId: HubChainId) => SolverConfig;
|
|
|
6760
7262
|
declare const getSupportedSolverTokens: (chainId: SpokeChainId) => readonly Token[];
|
|
6761
7263
|
declare const isSolverSupportedToken: (chainId: SpokeChainId, token: string) => boolean;
|
|
6762
7264
|
declare const getMoneyMarketConfig: (chainId: HubChainId) => MoneyMarketConfig;
|
|
7265
|
+
declare const moneyMarketSupportedTokens: {
|
|
7266
|
+
readonly "0xa86a.avax": readonly [{
|
|
7267
|
+
readonly symbol: "AVAX";
|
|
7268
|
+
readonly name: "Avalanche";
|
|
7269
|
+
readonly decimals: 18;
|
|
7270
|
+
readonly address: "0x0000000000000000000000000000000000000000";
|
|
7271
|
+
}, {
|
|
7272
|
+
readonly symbol: "USDT";
|
|
7273
|
+
readonly name: "Tether USD";
|
|
7274
|
+
readonly decimals: 6;
|
|
7275
|
+
readonly address: "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7";
|
|
7276
|
+
}, {
|
|
7277
|
+
readonly symbol: "USDC";
|
|
7278
|
+
readonly name: "USD Coin";
|
|
7279
|
+
readonly decimals: 6;
|
|
7280
|
+
readonly address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E";
|
|
7281
|
+
}, {
|
|
7282
|
+
readonly symbol: "bnUSD";
|
|
7283
|
+
readonly name: "bnUSD";
|
|
7284
|
+
readonly decimals: 18;
|
|
7285
|
+
readonly address: "0x6958a4CBFe11406E2a1c1d3a71A1971aD8B3b92F";
|
|
7286
|
+
}];
|
|
7287
|
+
readonly "0xa4b1.arbitrum": readonly [{
|
|
7288
|
+
readonly symbol: "ETH";
|
|
7289
|
+
readonly name: "Ethereum";
|
|
7290
|
+
readonly decimals: 18;
|
|
7291
|
+
readonly address: "0x0000000000000000000000000000000000000000";
|
|
7292
|
+
}, {
|
|
7293
|
+
readonly symbol: "bnUSD";
|
|
7294
|
+
readonly name: "bnUSD";
|
|
7295
|
+
readonly decimals: 18;
|
|
7296
|
+
readonly address: "0xA256dd181C3f6E5eC68C6869f5D50a712d47212e";
|
|
7297
|
+
}, {
|
|
7298
|
+
readonly symbol: "WBTC";
|
|
7299
|
+
readonly name: "Wrapped BTC";
|
|
7300
|
+
readonly decimals: 8;
|
|
7301
|
+
readonly address: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f";
|
|
7302
|
+
}, {
|
|
7303
|
+
readonly symbol: "tBTC";
|
|
7304
|
+
readonly name: "Arbitrum tBTC v2";
|
|
7305
|
+
readonly decimals: 18;
|
|
7306
|
+
readonly address: "0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40";
|
|
7307
|
+
}, {
|
|
7308
|
+
readonly symbol: "USDT";
|
|
7309
|
+
readonly name: "TetherToken";
|
|
7310
|
+
readonly decimals: 6;
|
|
7311
|
+
readonly address: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9";
|
|
7312
|
+
}, {
|
|
7313
|
+
readonly symbol: "USDC";
|
|
7314
|
+
readonly name: "USD Coin (USDC)";
|
|
7315
|
+
readonly decimals: 6;
|
|
7316
|
+
readonly address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831";
|
|
7317
|
+
}];
|
|
7318
|
+
readonly "0x2105.base": readonly [{
|
|
7319
|
+
readonly symbol: "ETH";
|
|
7320
|
+
readonly name: "Ethereum";
|
|
7321
|
+
readonly decimals: 18;
|
|
7322
|
+
readonly address: "0x0000000000000000000000000000000000000000";
|
|
7323
|
+
}, {
|
|
7324
|
+
readonly symbol: "bnUSD";
|
|
7325
|
+
readonly name: "bnUSD";
|
|
7326
|
+
readonly decimals: 18;
|
|
7327
|
+
readonly address: "0xAcfab3F31C0a18559D78556BBf297EC29c6cf8aa";
|
|
7328
|
+
}, {
|
|
7329
|
+
readonly symbol: "USDC";
|
|
7330
|
+
readonly name: "USD Coin";
|
|
7331
|
+
readonly decimals: 6;
|
|
7332
|
+
readonly address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
7333
|
+
}, {
|
|
7334
|
+
readonly symbol: "cbBTC";
|
|
7335
|
+
readonly name: "Coinbase Wrapped BTC";
|
|
7336
|
+
readonly decimals: 8;
|
|
7337
|
+
readonly address: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf";
|
|
7338
|
+
}];
|
|
7339
|
+
readonly "0xa.optimism": readonly [{
|
|
7340
|
+
readonly symbol: "ETH";
|
|
7341
|
+
readonly name: "Ethereum";
|
|
7342
|
+
readonly decimals: 18;
|
|
7343
|
+
readonly address: "0x0000000000000000000000000000000000000000";
|
|
7344
|
+
}, {
|
|
7345
|
+
readonly symbol: "bnUSD";
|
|
7346
|
+
readonly name: "bnUSD";
|
|
7347
|
+
readonly decimals: 18;
|
|
7348
|
+
readonly address: "0xF4f7dC27c17470a26d0de9039Cf0EA5045F100E8";
|
|
7349
|
+
}, {
|
|
7350
|
+
readonly symbol: "USDC";
|
|
7351
|
+
readonly name: "USD Coin";
|
|
7352
|
+
readonly decimals: 6;
|
|
7353
|
+
readonly address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85";
|
|
7354
|
+
}, {
|
|
7355
|
+
readonly symbol: "USDT";
|
|
7356
|
+
readonly name: "Tether USD";
|
|
7357
|
+
readonly decimals: 6;
|
|
7358
|
+
readonly address: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58";
|
|
7359
|
+
}];
|
|
7360
|
+
readonly "0x89.polygon": readonly [{
|
|
7361
|
+
readonly symbol: "POL";
|
|
7362
|
+
readonly name: "Polygon";
|
|
7363
|
+
readonly decimals: 18;
|
|
7364
|
+
readonly address: "0x0000000000000000000000000000000000000000";
|
|
7365
|
+
}, {
|
|
7366
|
+
readonly symbol: "bnUSD";
|
|
7367
|
+
readonly name: "bnUSD";
|
|
7368
|
+
readonly decimals: 18;
|
|
7369
|
+
readonly address: "0x39E77f86C1B1f3fbAb362A82b49D2E86C09659B4";
|
|
7370
|
+
}, {
|
|
7371
|
+
readonly symbol: "USDC";
|
|
7372
|
+
readonly name: "USD Coin";
|
|
7373
|
+
readonly decimals: 6;
|
|
7374
|
+
readonly address: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359";
|
|
7375
|
+
}];
|
|
7376
|
+
readonly "0x38.bsc": readonly [{
|
|
7377
|
+
readonly symbol: "BNB";
|
|
7378
|
+
readonly name: "BNB";
|
|
7379
|
+
readonly decimals: 18;
|
|
7380
|
+
readonly address: "0x0000000000000000000000000000000000000000";
|
|
7381
|
+
}, {
|
|
7382
|
+
readonly symbol: "ETHB";
|
|
7383
|
+
readonly name: "Ethereum BSC";
|
|
7384
|
+
readonly decimals: 18;
|
|
7385
|
+
readonly address: "0x2170Ed0880ac9A755fd29B2688956BD959F933F8";
|
|
7386
|
+
}, {
|
|
7387
|
+
readonly symbol: "BTCB";
|
|
7388
|
+
readonly name: "Bitcoin BSC";
|
|
7389
|
+
readonly decimals: 18;
|
|
7390
|
+
readonly address: "0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c";
|
|
7391
|
+
}, {
|
|
7392
|
+
readonly symbol: "bnUSD";
|
|
7393
|
+
readonly name: "bnUSD";
|
|
7394
|
+
readonly decimals: 18;
|
|
7395
|
+
readonly address: "0x8428FedC020737a5A2291F46cB1B80613eD71638";
|
|
7396
|
+
}];
|
|
7397
|
+
readonly solana: readonly [{
|
|
7398
|
+
readonly symbol: "SOL";
|
|
7399
|
+
readonly name: "Solana";
|
|
7400
|
+
readonly decimals: 9;
|
|
7401
|
+
readonly address: "11111111111111111111111111111111";
|
|
7402
|
+
}, {
|
|
7403
|
+
readonly symbol: "bnUSD";
|
|
7404
|
+
readonly name: "bnUSD";
|
|
7405
|
+
readonly decimals: 9;
|
|
7406
|
+
readonly address: "3rSPCLNEF7Quw4wX8S1NyKivELoyij8eYA2gJwBgt4V5";
|
|
7407
|
+
}, {
|
|
7408
|
+
readonly symbol: "USDC";
|
|
7409
|
+
readonly name: "USD Coin";
|
|
7410
|
+
readonly decimals: 6;
|
|
7411
|
+
readonly address: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
|
|
7412
|
+
}];
|
|
7413
|
+
readonly "0x1.icon": readonly [{
|
|
7414
|
+
readonly symbol: "bnUSD";
|
|
7415
|
+
readonly name: "bnUSD";
|
|
7416
|
+
readonly decimals: 18;
|
|
7417
|
+
readonly address: "cx88fd7df7ddff82f7cc735c871dc519838cb235bb";
|
|
7418
|
+
}];
|
|
7419
|
+
readonly stellar: readonly [{
|
|
7420
|
+
readonly symbol: "XLM";
|
|
7421
|
+
readonly name: "Stellar Lumens";
|
|
7422
|
+
readonly decimals: 7;
|
|
7423
|
+
readonly address: "CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA";
|
|
7424
|
+
}, {
|
|
7425
|
+
readonly symbol: "bnUSD";
|
|
7426
|
+
readonly name: "bnUSD";
|
|
7427
|
+
readonly decimals: 7;
|
|
7428
|
+
readonly address: "CD6YBFFWMU2UJHX2NGRJ7RN76IJVTCC7MRA46DUBXNB7E6W7H7JRJ2CX";
|
|
7429
|
+
}];
|
|
7430
|
+
readonly sui: readonly [{
|
|
7431
|
+
readonly symbol: "SUI";
|
|
7432
|
+
readonly name: "SUI";
|
|
7433
|
+
readonly decimals: 9;
|
|
7434
|
+
readonly address: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
7435
|
+
}, {
|
|
7436
|
+
readonly symbol: "bnUSD";
|
|
7437
|
+
readonly name: "bnUSD";
|
|
7438
|
+
readonly decimals: 9;
|
|
7439
|
+
readonly address: "0xff4de2b2b57dd7611d2812d231a467d007b702a101fd5c7ad3b278257cddb507::bnusd::BNUSD";
|
|
7440
|
+
}, {
|
|
7441
|
+
readonly symbol: "USDC";
|
|
7442
|
+
readonly name: "USD Coin";
|
|
7443
|
+
readonly decimals: 6;
|
|
7444
|
+
readonly address: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC";
|
|
7445
|
+
}];
|
|
7446
|
+
readonly "injective-1": readonly [{
|
|
7447
|
+
readonly symbol: "INJ";
|
|
7448
|
+
readonly name: "Injective";
|
|
7449
|
+
readonly decimals: 18;
|
|
7450
|
+
readonly address: "inj";
|
|
7451
|
+
}, {
|
|
7452
|
+
readonly symbol: "bnUSD";
|
|
7453
|
+
readonly name: "bnUSD";
|
|
7454
|
+
readonly decimals: 18;
|
|
7455
|
+
readonly address: "factory/inj1d036ftaatxpkqsu9hja8r24rv3v33chz3appxp/bnUSD";
|
|
7456
|
+
}, {
|
|
7457
|
+
readonly symbol: "USDC";
|
|
7458
|
+
readonly name: "USD Coin";
|
|
7459
|
+
readonly decimals: 6;
|
|
7460
|
+
readonly address: "ibc/2CBC2EA121AE42563B08028466F37B600F2D7D4282342DE938283CC3FB2BC00E";
|
|
7461
|
+
}];
|
|
7462
|
+
readonly nibiru: readonly [];
|
|
7463
|
+
readonly sonic: readonly [{
|
|
7464
|
+
readonly symbol: "Sonic";
|
|
7465
|
+
readonly name: "Sonic";
|
|
7466
|
+
readonly decimals: 18;
|
|
7467
|
+
readonly address: "0x0000000000000000000000000000000000000000";
|
|
7468
|
+
}, {
|
|
7469
|
+
readonly symbol: "WETH";
|
|
7470
|
+
readonly name: "Wrapped Ether";
|
|
7471
|
+
readonly decimals: 18;
|
|
7472
|
+
readonly address: "0x50c42dEAcD8Fc9773493ED674b675bE577f2634b";
|
|
7473
|
+
}, {
|
|
7474
|
+
readonly symbol: "USDC";
|
|
7475
|
+
readonly name: "USD Coin";
|
|
7476
|
+
readonly decimals: 6;
|
|
7477
|
+
readonly address: "0x29219dd400f2Bf60E5a23d13Be72B486D4038894";
|
|
7478
|
+
}, {
|
|
7479
|
+
readonly symbol: "USDT";
|
|
7480
|
+
readonly name: "Tether USD";
|
|
7481
|
+
readonly decimals: 6;
|
|
7482
|
+
readonly address: "0x6047828dc181963ba44974801FF68e538dA5eaF9";
|
|
7483
|
+
}, {
|
|
7484
|
+
readonly symbol: "wSonic";
|
|
7485
|
+
readonly name: "Wrapped Sonic";
|
|
7486
|
+
readonly decimals: 18;
|
|
7487
|
+
readonly address: "0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38";
|
|
7488
|
+
}];
|
|
7489
|
+
};
|
|
6763
7490
|
declare const isMoneyMarketSupportedToken: (chainId: SpokeChainId, token: string) => boolean;
|
|
6764
7491
|
declare const getSupportedMoneyMarketTokens: (chainId: SpokeChainId) => readonly Token[];
|
|
6765
|
-
declare const HubVaultSymbols: readonly ["sodaAVAX", "sodaBNB", "sodaETH", "sodaBTC", "sodaSUI", "sodaINJ", "sodaXLM", "sodaSOL"];
|
|
6766
|
-
type HubVaultSymbol = (typeof HubVaultSymbols)[number];
|
|
6767
|
-
declare const hubVaults: Record<HubVaultSymbol, VaultType>;
|
|
6768
7492
|
declare const hubVaultsAddressSet: Set<`0x${string}`>;
|
|
6769
7493
|
declare const moneyMarketReserveHubAssetsSet: Set<`0x${string}`>;
|
|
6770
7494
|
declare const isMoneyMarketReserveHubAsset: (hubAsset: Address) => boolean;
|
|
6771
|
-
declare const moneyMarketReserveAssets: readonly [
|
|
7495
|
+
declare const moneyMarketReserveAssets: readonly [...("0x9D4b663Eb075d2a1C7B8eaEFB9eCCC0510388B51" | "0x62ecc3eeb80a162c57624b3ff80313fe69f5203e" | "0xc6c85287a8b173a509c2f198bb719a8a5a2d0c68" | "0x208ed38f4783328aa9ebfec360d32e7520a9b779" | "0xe801ca34e19abcbfea12025378d19c4fbe250131" | "0xabbb91c0617090f0028bdc27597cd0d038f3a833" | "0xbdf1f453fcb61424011bbddcb96cfdb30f3fe876" | "0x21685e341de7844135329914be6bd8d16982d834" | "0x14238d267557e9d799016ad635b53cd15935d290" | "0x40cd41b35db9e5109ae7e54b44de8625db320e6b" | "0x4effb5813271699683c25c734f4dabc45b363709" | "0x7a1a5555842ad2d0ed274d09b5c4406a95799d5d" | "0xdc5b4b00f98347e95b9f94911213dab4c687e1e3" | "0x1f22279c89b213944b7ea41dacb0a868ddcdfd13" | "0x6bc8c37cba91f76e68c9e6d689a9c21e4d32079b" | "0xdea692287e2ce8cb08fa52917be0f16b1dacdc87")[], `0x${string}`];
|
|
6772
7496
|
declare const isMoneyMarketReserveAsset: (asset: Address) => boolean;
|
|
6773
7497
|
declare const originalAssetTohubAssetMap: Map<SpokeChainId, Map<OriginalAssetAddress, HubAssetInfo>>;
|
|
6774
7498
|
declare const hubAssetToOriginalAssetMap: Map<SpokeChainId, Map<Address, OriginalAssetAddress>>;
|
|
@@ -6811,5 +7535,20 @@ declare function isIconSpokeProvider(value: SpokeProvider): value is IconSpokePr
|
|
|
6811
7535
|
declare function isSuiSpokeProvider(value: SpokeProvider): value is SuiSpokeProvider;
|
|
6812
7536
|
declare function isConfiguredSolverConfig(value: SolverConfigParams): value is Prettify<SolverConfig & Optional<PartnerFeeConfig, 'partnerFee'>>;
|
|
6813
7537
|
declare function isConfiguredMoneyMarketConfig(value: MoneyMarketConfigParams): value is Prettify<MoneyMarketConfig & Optional<PartnerFeeConfig, 'partnerFee'>>;
|
|
7538
|
+
declare function isIntentCreationFailedError(error: unknown): error is IntentError<'CREATION_FAILED'>;
|
|
7539
|
+
declare function isIntentSubmitTxFailedError(error: unknown): error is IntentError<'SUBMIT_TX_FAILED'>;
|
|
7540
|
+
declare function isIntentPostExecutionFailedError(error: unknown): error is IntentError<'POST_EXECUTION_FAILED'>;
|
|
7541
|
+
declare function isWaitUntilIntentExecutedFailed(error: unknown): error is IntentError<'RELAY_TIMEOUT'>;
|
|
7542
|
+
declare function isIntentCreationUnknownError(error: unknown): error is IntentError<'UNKNOWN'>;
|
|
7543
|
+
declare function isMoneyMarketSubmitTxFailedError(error: unknown): error is MoneyMarketError<'SUBMIT_TX_FAILED'>;
|
|
7544
|
+
declare function isMoneyMarketRelayTimeoutError(error: unknown): error is MoneyMarketError<'RELAY_TIMEOUT'>;
|
|
7545
|
+
declare function isMoneyMarketCreateSupplyIntentFailedError(error: unknown): error is MoneyMarketError<'CREATE_SUPPLY_INTENT_FAILED'>;
|
|
7546
|
+
declare function isMoneyMarketCreateBorrowIntentFailedError(error: unknown): error is MoneyMarketError<'CREATE_BORROW_INTENT_FAILED'>;
|
|
7547
|
+
declare function isMoneyMarketCreateWithdrawIntentFailedError(error: unknown): error is MoneyMarketError<'CREATE_WITHDRAW_INTENT_FAILED'>;
|
|
7548
|
+
declare function isMoneyMarketCreateRepayIntentFailedError(error: unknown): error is MoneyMarketError<'CREATE_REPAY_INTENT_FAILED'>;
|
|
7549
|
+
declare function isMoneyMarketSupplyUnknownError(error: unknown): error is MoneyMarketUnknownError<'SUPPLY_UNKNOWN_ERROR'>;
|
|
7550
|
+
declare function isMoneyMarketBorrowUnknownError(error: unknown): error is MoneyMarketUnknownError<'BORROW_UNKNOWN_ERROR'>;
|
|
7551
|
+
declare function isMoneyMarketWithdrawUnknownError(error: unknown): error is MoneyMarketUnknownError<'WITHDRAW_UNKNOWN_ERROR'>;
|
|
7552
|
+
declare function isMoneyMarketRepayUnknownError(error: unknown): error is MoneyMarketUnknownError<'REPAY_UNKNOWN_ERROR'>;
|
|
6814
7553
|
|
|
6815
|
-
export { type AggregatedReserveData, type AssetInfo, type BaseCurrencyInfo, type BaseHubChainConfig, type BaseSpokeChainConfig, type BaseSpokeChainInfo, BigIntToHex, type BorrowInfo, type CWReturnType, CWSpokeProvider, type CosmosSpokeChainConfig, type CreateIntentParams, type CustomProvider, DEFAULT_MAX_RETRY, DEFAULT_RELAYER_API_ENDPOINT, DEFAULT_RELAY_TX_TIMEOUT, DEFAULT_RETRY_DELAY_MS, type Default, EVM_CHAIN_IDS, EVM_SPOKE_CHAIN_IDS, Erc20Service, EvmAssetManagerService, type EvmChainId, type EvmContractCall, type EvmDepositToDataParams, type EvmHubChainConfig, EvmHubProvider, type EvmHubProviderConfig, type EvmInitializedConfig, type EvmReturnType, EvmSolverService, type EvmSpokeChainConfig, type EvmSpokeChainId, type EvmSpokeDepositParams, EvmSpokeProvider, EvmSpokeService, type EvmTransferParams, type EvmTransferToHubParams, type EvmTxReturnType, type EvmUninitializedBrowserConfig, type EvmUninitializedConfig, type EvmUninitializedPrivateKeyConfig, EvmVaultTokenService, EvmWalletAbstraction, type EvmWithdrawAssetDataParams, FEE_PERCENTAGE_SCALE, type FeeAmount, type FeeData, type GetAddressType, type GetPacketParams, type GetPacketResponse, type GetRawTxReturnType, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeChainIdType, type GetSpokeDepositParamsType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type HttpPrefixedUrl, type HttpUrl, type HubAssetInfo, type HubChainConfig, type HubChainInfo, type HubVaultSymbol, HubVaultSymbols, ICON_TX_RESULT_WAIT_MAX_RETRY, INTENT_RELAY_CHAIN_IDS, type ISpokeProvider, type IWalletProvider, type IconAddress, type IconJsonRpcVersion, type IconRawTransaction, type IconReturnType, type IconSpokeChainConfig, IconSpokeProvider, type
|
|
7554
|
+
export { type AggregatedReserveData, type AssetInfo, type BaseCurrencyInfo, type BaseHubChainConfig, type BaseSpokeChainConfig, type BaseSpokeChainInfo, BigIntToHex, type BorrowInfo, type CWReturnType, CWSpokeProvider, type CosmosSpokeChainConfig, type CreateIntentParams, type CustomProvider, DEFAULT_MAX_RETRY, DEFAULT_RELAYER_API_ENDPOINT, DEFAULT_RELAY_TX_TIMEOUT, DEFAULT_RETRY_DELAY_MS, type Default, EVM_CHAIN_IDS, EVM_SPOKE_CHAIN_IDS, Erc20Service, EvmAssetManagerService, type EvmChainId, type EvmContractCall, type EvmDepositToDataParams, type EvmHubChainConfig, EvmHubProvider, type EvmHubProviderConfig, type EvmInitializedConfig, type EvmReturnType, EvmSolverService, type EvmSpokeChainConfig, type EvmSpokeChainId, type EvmSpokeDepositParams, EvmSpokeProvider, EvmSpokeService, type EvmTransferParams, type EvmTransferToHubParams, type EvmTxReturnType, type EvmUninitializedBrowserConfig, type EvmUninitializedConfig, type EvmUninitializedPrivateKeyConfig, EvmVaultTokenService, EvmWalletAbstraction, type EvmWithdrawAssetDataParams, FEE_PERCENTAGE_SCALE, type FeeAmount, type FeeData, type GetAddressType, type GetMigrateParams, type GetMigrationFailedPayload, type GetMoneyMarketError, type GetMoneyMarketParams, type GetPacketParams, type GetPacketResponse, type GetRawTxReturnType, type GetRelayRequestParamType, type GetRelayResponse, type GetRevertMigrationParams, type GetSpokeChainIdType, type GetSpokeDepositParamsType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type HttpPrefixedUrl, type HttpUrl, type HubAssetInfo, type HubChainConfig, type HubChainInfo, type HubTxHash, type HubVaultSymbol, HubVaultSymbols, ICON_TX_RESULT_WAIT_MAX_RETRY, INTENT_RELAY_CHAIN_IDS, type ISpokeProvider, type IWalletProvider, type IconAddress, type IconJsonRpcVersion, type IconRawTransaction, type IconReturnType, type IconSpokeChainConfig, IconSpokeProvider, type IcxCreateRevertMigrationParams, type IcxMigrateParams, IcxMigrationService, type IcxRawTransaction, type IcxRevertMigrationParams, type IcxTokenType, type Intent, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentCreationFailedErrorData, type IntentData, IntentDataType, type IntentError, type IntentErrorCode, type IntentErrorData, type IntentRelayChainId, type IntentRelayRequest, type IntentRelayRequestParams, type IntentState, type IntentSubmitTxFailedErrorData, type IntentWaitUntilIntentExecutedFailedErrorData, IntentsAbi, type JsonRpcPayloadResponse, MAX_UINT256, type MigrationAction, type MigrationError, type MigrationErrorCode, type MigrationErrorData, type MigrationFailedErrorData, type MigrationParams, MigrationService, type MigrationServiceConfig, type MigrationTokens, type MoneyMarketAction, type MoneyMarketBorrowFailedError, type MoneyMarketBorrowParams, type MoneyMarketConfig, type MoneyMarketConfigParams, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketExtraData, type MoneyMarketOptionalExtraData, type MoneyMarketParams, type MoneyMarketRepayFailedError, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConfig, type MoneyMarketSubmitTxFailedError, type MoneyMarketSupplyFailedError, type MoneyMarketSupplyParams, type MoneyMarketUnknownError, type MoneyMarketUnknownErrorCode, type MoneyMarketWithdrawFailedError, type MoneyMarketWithdrawParams, type Optional, type PacketData, type PartnerFee, type PartnerFeeAmount, type PartnerFeeConfig, type PartnerFeePercentage, type Prettify, type PromiseCWTxReturnType, type PromiseEvmTxReturnType, type PromiseIconTxReturnType, type PromiseSolanaTxReturnType, type PromiseStellarTxReturnType, type PromiseSuiTxReturnType, type PromiseTxReturnType, type QuoteType, type RawTxReturnType, type RelayAction, type RelayError, type RelayErrorCode, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayerApiConfig, type ReserveDataLegacy, type ResponseAddressType, type ResponseSigningType, type Result, STELLAR_DEFAULT_TX_TIMEOUT_SECONDS, STELLAR_PRIORITY_FEE, Sodax, type SodaxConfig, type SolanaChainConfig, type SolanaRawTransaction, type SolanaReturnType, SolanaSpokeProvider, type SolverConfig, type SolverConfigParams, type SolverErrorResponse, type SolverExecutionRequest, type SolverExecutionResponse, SolverIntentErrorCode, type SolverIntentQuoteRequest, type SolverIntentQuoteResponse, type SolverIntentQuoteResponseRaw, SolverIntentStatusCode, type SolverIntentStatusRequest, type SolverIntentStatusResponse, SolverService, type SolverServiceConfig, type SonicSpokeChainConfig, type SonicSpokeDepositParams, SonicSpokeProvider, SonicSpokeService, type SpokeChainConfig, type SpokeChainInfo, type SpokeDepositParams, type SpokeProvider, SpokeService, type SpokeTokenSymbols, type SpokeTxHash, type StellarReturnType, type StellarRpcConfig, type StellarSpokeChainConfig, StellarSpokeProvider, type SubmitTxParams, type SubmitTxResponse, type SuiRawTransaction, type SuiReturnType, type SuiSpokeChainConfig, SuiSpokeProvider, type TokenInfo, type TxReturnType, type UserReserveData, VAULT_TOKEN_DECIMALS, type VaultReserves, type VaultType, type WaitUntilIntentExecutedPayload, WalletAbstractionService, type WithdrawInfo, assetManagerAbi, calculateFeeAmount, calculatePercentageFeeAmount, chainIdToHubAssetsMap, connectionAbi, encodeAddress, encodeContractCalls, erc20Abi, getEvmViemChain, getHubAssetInfo, getHubChainConfig, getIconAddressBytes, getIntentRelayChainId, getMoneyMarketConfig, getOriginalAssetAddress, getPacket, getRandomBytes, getSolanaAddressBytes, getSolverConfig, getSpokeChainIdFromIntentRelayChainId, getSupportedMoneyMarketTokens, getSupportedSolverTokens, getTransactionPackets, hubAssetToOriginalAssetMap, hubAssets, hubVaults, hubVaultsAddressSet, intentRelayChainIdToSpokeChainIdMap, isCWSpokeProvider, isConfiguredMoneyMarketConfig, isConfiguredSolverConfig, isEvmHubChainConfig, isEvmInitializedConfig, isEvmSpokeChainConfig, isEvmSpokeProvider, isEvmUninitializedBrowserConfig, isEvmUninitializedConfig, isEvmUninitializedPrivateKeyConfig, isIconAddress, isIconSpokeProvider, isIntentCreationFailedError, isIntentCreationUnknownError, isIntentPostExecutionFailedError, isIntentRelayChainId, isIntentSubmitTxFailedError, isJsonRpcPayloadResponse, isMoneyMarketBorrowUnknownError, isMoneyMarketCreateBorrowIntentFailedError, isMoneyMarketCreateRepayIntentFailedError, isMoneyMarketCreateSupplyIntentFailedError, isMoneyMarketCreateWithdrawIntentFailedError, isMoneyMarketRelayTimeoutError, isMoneyMarketRepayUnknownError, isMoneyMarketReserveAsset, isMoneyMarketReserveHubAsset, isMoneyMarketSubmitTxFailedError, isMoneyMarketSupplyUnknownError, isMoneyMarketSupportedToken, isMoneyMarketWithdrawUnknownError, isNativeToken, isPartnerFeeAmount, isPartnerFeePercentage, isResponseAddressType, isResponseSigningType, isSolanaSpokeProvider, isSolverSupportedToken, isSonicSpokeProvider, isStellarSpokeProvider, isSuiSpokeProvider, isValidChainHubAsset, isValidHubAsset, isValidIntentRelayChainId, isValidOriginalAssetAddress, isValidSpokeChainId, isWaitUntilIntentExecutedFailed, moneyMarketReserveAssets, moneyMarketReserveHubAssetsSet, moneyMarketSupportedTokens, originalAssetTohubAssetMap, poolAbi, randomUint256, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, retry, sonicWalletFactoryAbi, spokeAssetManagerAbi, spokeChainConfig, spokeChainIdsSet, submitTransaction, supportedHubAssets, supportedHubChains, supportedSpokeChains, supportedTokensPerChain, uiPoolDataAbi, variableDebtTokenAbi, vaultTokenAbi, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|