@sodax/sdk 0.0.1-rc.11 → 0.0.1-rc.13
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 +3 -3
- package/dist/index.cjs +1173 -484
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +615 -139
- package/dist/index.d.ts +615 -139
- package/dist/index.mjs +1153 -482
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address, Hex, PublicClient, HttpTransport, Hash, GetLogsReturnType, TransactionReceipt, WalletClient, CustomTransport, Chain, Account } from 'viem';
|
|
2
|
-
import {
|
|
2
|
+
import { IInjectiveWalletProvider, InjectiveExecuteResponse, SpokeChainId, Hex as Hex$1, IEvmWalletProvider, Address as Address$1, Token, HubAddress, Hash as Hash$1, IconEoaAddress, IIconWalletProvider, ISolanaWalletProvider, SolanaBase58PublicKey, IStellarWalletProvider, ISuiWalletProvider, ChainType, InjectiveNetworkEnv, InjectiveRawTransaction, 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';
|
|
@@ -4099,22 +4099,22 @@ interface State {
|
|
|
4099
4099
|
hub_chain_id: string;
|
|
4100
4100
|
owner: string;
|
|
4101
4101
|
}
|
|
4102
|
-
declare class
|
|
4103
|
-
readonly walletProvider:
|
|
4104
|
-
chainConfig:
|
|
4105
|
-
constructor(conf:
|
|
4102
|
+
declare class InjectiveSpokeProvider implements ISpokeProvider {
|
|
4103
|
+
readonly walletProvider: IInjectiveWalletProvider;
|
|
4104
|
+
chainConfig: InjectiveSpokeChainConfig;
|
|
4105
|
+
constructor(conf: InjectiveSpokeChainConfig, walletProvider: IInjectiveWalletProvider);
|
|
4106
4106
|
getState(): Promise<State>;
|
|
4107
4107
|
getBalance(token: String): Promise<number>;
|
|
4108
4108
|
private transfer;
|
|
4109
|
-
depositToken<R extends boolean = false>(sender: string, tokenAddress: string, to: Uint8Array, amount: string, data?: Uint8Array, raw?: R): Promise<
|
|
4110
|
-
static deposit<R extends boolean = false>(sender: string, token_address: string, to: Address, amount: string, data: Hex | undefined, provider:
|
|
4111
|
-
depositNative<R extends boolean = false>(sender: string, token: string, to: Uint8Array, amount: string, data?: Uint8Array, raw?: R): Promise<
|
|
4109
|
+
depositToken<R extends boolean = false>(sender: string, tokenAddress: string, to: Uint8Array, amount: string, data?: Uint8Array, raw?: R): Promise<InjectiveReturnType<R>>;
|
|
4110
|
+
static deposit<R extends boolean = false>(sender: string, token_address: string, to: Address, amount: string, data: Hex | undefined, provider: InjectiveSpokeProvider, raw?: R): PromiseInjectiveTxReturnType<R>;
|
|
4111
|
+
depositNative<R extends boolean = false>(sender: string, token: string, to: Uint8Array, amount: string, data?: Uint8Array, raw?: R): Promise<InjectiveReturnType<R>>;
|
|
4112
4112
|
isNative(token: string): Promise<boolean>;
|
|
4113
|
-
receiveMessage(senderAddress: string, srcChainId: string, srcAddress: Uint8Array, connSn: string, payload: Uint8Array, signatures: Uint8Array[]): Promise<
|
|
4114
|
-
setRateLimit(senderAddress: string, rateLimit: string): Promise<
|
|
4115
|
-
setConnection(senderAddress: string, connection: string): Promise<
|
|
4116
|
-
setOwner(senderAddress: string, owner: string): Promise<
|
|
4117
|
-
send_message<R extends boolean = false>(sender: string, dst_chain_id: string, dst_address: Hex, payload: Hex, raw?: R):
|
|
4113
|
+
receiveMessage(senderAddress: string, srcChainId: string, srcAddress: Uint8Array, connSn: string, payload: Uint8Array, signatures: Uint8Array[]): Promise<InjectiveExecuteResponse>;
|
|
4114
|
+
setRateLimit(senderAddress: string, rateLimit: string): Promise<InjectiveExecuteResponse>;
|
|
4115
|
+
setConnection(senderAddress: string, connection: string): Promise<InjectiveExecuteResponse>;
|
|
4116
|
+
setOwner(senderAddress: string, owner: string): Promise<InjectiveExecuteResponse>;
|
|
4117
|
+
send_message<R extends boolean = false>(sender: string, dst_chain_id: string, dst_address: Hex, payload: Hex, raw?: R): PromiseInjectiveTxReturnType<R>;
|
|
4118
4118
|
static stringToUint8Array(str: string): Uint8Array;
|
|
4119
4119
|
static uint8ArrayToString(arr: Uint8Array): string;
|
|
4120
4120
|
static toBigIntString(num: number | bigint): string;
|
|
@@ -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
|
|
@@ -5184,15 +5230,15 @@ declare class SolverService {
|
|
|
5184
5230
|
/**
|
|
5185
5231
|
* Get the status of an intent from Solver API
|
|
5186
5232
|
* NOTE: intentHash should be retrieved from relay packet dst_tx_hash property (see createAndSubmitIntent)
|
|
5187
|
-
* @param {
|
|
5188
|
-
* @returns {Promise<Result<
|
|
5233
|
+
* @param {SolverIntentStatusRequest} request - The intent status request
|
|
5234
|
+
* @returns {Promise<Result<SolverIntentStatusResponse, SolverErrorResponse>>} The solver intent status response
|
|
5189
5235
|
*
|
|
5190
5236
|
* @example
|
|
5191
|
-
* const
|
|
5192
|
-
* "
|
|
5193
|
-
* } satisfies
|
|
5237
|
+
* const request = {
|
|
5238
|
+
* "intent_tx_hash": "a0dd7652-b360-4123-ab2d-78cfbcd20c6b" // destination tx hash from relay packet
|
|
5239
|
+
* } satisfies SolverIntentStatusRequest
|
|
5194
5240
|
*
|
|
5195
|
-
* const response = await solverService.getStatus(
|
|
5241
|
+
* const response = await solverService.getStatus(request);
|
|
5196
5242
|
*
|
|
5197
5243
|
* if (response.ok) {
|
|
5198
5244
|
* const { status, intent_hash } = response.value;
|
|
@@ -5202,18 +5248,18 @@ declare class SolverService {
|
|
|
5202
5248
|
* // handle error
|
|
5203
5249
|
* }
|
|
5204
5250
|
*/
|
|
5205
|
-
getStatus(
|
|
5251
|
+
getStatus(request: SolverIntentStatusRequest): Promise<Result<SolverIntentStatusResponse, SolverErrorResponse>>;
|
|
5206
5252
|
/**
|
|
5207
5253
|
* Post execution of intent order transaction executed on hub chain to Solver API
|
|
5208
|
-
* @param {
|
|
5209
|
-
* @returns {Promise<Result<
|
|
5254
|
+
* @param {SolverExecutionRequest} request - The intent execution request
|
|
5255
|
+
* @returns {Promise<Result<SolverExecutionResponse, SolverErrorResponse>>} The intent execution response
|
|
5210
5256
|
*
|
|
5211
5257
|
* @example
|
|
5212
|
-
* const
|
|
5258
|
+
* const request = {
|
|
5213
5259
|
* "intent_tx_hash": "0xba3dce19347264db32ced212ff1a2036f20d9d2c7493d06af15027970be061af",
|
|
5214
|
-
* } satisfies
|
|
5260
|
+
* } satisfies SolverExecutionRequest
|
|
5215
5261
|
*
|
|
5216
|
-
* const response = await solverService.postExecution(
|
|
5262
|
+
* const response = await solverService.postExecution(request);
|
|
5217
5263
|
*
|
|
5218
5264
|
* if (response.ok) {
|
|
5219
5265
|
* const { answer, intent_hash } = response.value;
|
|
@@ -5223,13 +5269,73 @@ declare class SolverService {
|
|
|
5223
5269
|
* // handle error
|
|
5224
5270
|
* }
|
|
5225
5271
|
*/
|
|
5226
|
-
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>>>;
|
|
5227
5333
|
/**
|
|
5228
5334
|
* Creates an intent and submits it to the Solver API and Relayer API
|
|
5229
5335
|
* @param {CreateIntentParams} payload - The intent to create
|
|
5230
5336
|
* @param {ISpokeProvider} spokeProvider - The spoke provider
|
|
5231
5337
|
* @param {number} timeout - The timeout in milliseconds for the transaction. Default is 60 seconds.
|
|
5232
|
-
* @returns {Promise<Result<[
|
|
5338
|
+
* @returns {Promise<Result<[SolverExecutionResponse, Intent, PacketData], IntentError<IntentErrorCode>>>} The solver execution response, intent, and packet data
|
|
5233
5339
|
*
|
|
5234
5340
|
* @example
|
|
5235
5341
|
* const payload = {
|
|
@@ -5241,8 +5347,8 @@ declare class SolverService {
|
|
|
5241
5347
|
* "allowPartialFill": false, // Whether the intent can be partially filled
|
|
5242
5348
|
* "srcChain": "0x38.bsc", // Chain ID where input tokens originate
|
|
5243
5349
|
* "dstChain": "0xa4b1.arbitrum", // Chain ID where output tokens should be delivered
|
|
5244
|
-
* "srcAddress": "0x..", // Source address
|
|
5245
|
-
* "dstAddress": "0x...", // Destination address
|
|
5350
|
+
* "srcAddress": "0x..", // Source address (original address on spoke chain)
|
|
5351
|
+
* "dstAddress": "0x...", // Destination address (original address on spoke chain)
|
|
5246
5352
|
* "solver": "0x..", // Optional specific solver address (address(0) = any solver)
|
|
5247
5353
|
* "data": "0x..", // Additional arbitrary data
|
|
5248
5354
|
* } satisfies CreateIntentParams;
|
|
@@ -5250,15 +5356,15 @@ declare class SolverService {
|
|
|
5250
5356
|
* const createAndSubmitIntentResult = await solverService.createAndSubmitIntent(payload, spokeProvider);
|
|
5251
5357
|
*
|
|
5252
5358
|
* if (createAndSubmitIntentResult.ok) {
|
|
5253
|
-
* const [
|
|
5254
|
-
* console.log('Intent execution response:',
|
|
5359
|
+
* const [solverExecutionResponse, intent, packetData] = createAndSubmitIntentResult.value;
|
|
5360
|
+
* console.log('Intent execution response:', solverExecutionResponse);
|
|
5255
5361
|
* console.log('Intent:', intent);
|
|
5256
5362
|
* console.log('Packet data:', packetData);
|
|
5257
5363
|
* } else {
|
|
5258
5364
|
* // handle error
|
|
5259
5365
|
* }
|
|
5260
5366
|
*/
|
|
5261
|
-
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>>>;
|
|
5262
5368
|
/**
|
|
5263
5369
|
* Check whether assetManager contract is allowed to move the given payload amount
|
|
5264
5370
|
* @param {CreateIntentParams} params - The intent to create
|
|
@@ -5275,8 +5381,8 @@ declare class SolverService {
|
|
|
5275
5381
|
* "allowPartialFill": false, // Whether the intent can be partially filled
|
|
5276
5382
|
* "srcChain": "0x38.bsc", // Chain ID where input tokens originate
|
|
5277
5383
|
* "dstChain": "0xa4b1.arbitrum", // Chain ID where output tokens should be delivered
|
|
5278
|
-
* "srcAddress": "0x..", // Source address
|
|
5279
|
-
* "dstAddress": "0x...", // Destination address
|
|
5384
|
+
* "srcAddress": "0x..", // Source address (original address on spoke chain)
|
|
5385
|
+
* "dstAddress": "0x...", // Destination address (original address on spoke chain)
|
|
5280
5386
|
* "solver": "0x..", // Optional specific solver address (address(0) = any solver)
|
|
5281
5387
|
* "data": "0x..", // Additional arbitrary data
|
|
5282
5388
|
* } satisfies CreateIntentParams;
|
|
@@ -5320,11 +5426,11 @@ declare class SolverService {
|
|
|
5320
5426
|
/**
|
|
5321
5427
|
* Creates an intent by handling token approval and intent creation
|
|
5322
5428
|
* NOTE: This method does not submit the intent to the Solver API
|
|
5323
|
-
* @param {CreateIntentParams} params - The intent to create
|
|
5429
|
+
* @param {Omit<CreateIntentParams, 'srcAddress'>} params - The intent to create
|
|
5324
5430
|
* @param {SpokeProvider} spokeProvider - The spoke provider
|
|
5325
5431
|
* @param {boolean} raw - Whether to return the raw transaction
|
|
5326
5432
|
* @param {PartnerFee} fee - The fee to apply to the intent
|
|
5327
|
-
* @returns {Promise<Result<[TxReturnType<S, R>, Intent & FeeAmount],
|
|
5433
|
+
* @returns {Promise<Result<[TxReturnType<S, R>, Intent & FeeAmount], IntentError<'CREATION_FAILED'>>>} The encoded contract call
|
|
5328
5434
|
*
|
|
5329
5435
|
* @example
|
|
5330
5436
|
* const payload = {
|
|
@@ -5336,8 +5442,8 @@ declare class SolverService {
|
|
|
5336
5442
|
* "allowPartialFill": false, // Whether the intent can be partially filled
|
|
5337
5443
|
* "srcChain": "0x38.bsc", // Chain ID where input tokens originate
|
|
5338
5444
|
* "dstChain": "0xa4b1.arbitrum", // Chain ID where output tokens should be delivered
|
|
5339
|
-
* "srcAddress": "0x..", // Source address
|
|
5340
|
-
* "dstAddress": "0x...", // Destination address
|
|
5445
|
+
* "srcAddress": "0x..", // Source address (original address on spoke chain)
|
|
5446
|
+
* "dstAddress": "0x...", // Destination address (original address on spoke chain)
|
|
5341
5447
|
* "solver": "0x..", // Optional specific solver address (address(0) = any solver)
|
|
5342
5448
|
* "data": "0x..", // Additional arbitrary data
|
|
5343
5449
|
* } satisfies CreateIntentParams;
|
|
@@ -5349,7 +5455,7 @@ declare class SolverService {
|
|
|
5349
5455
|
* console.log('Intent:', intent);
|
|
5350
5456
|
*
|
|
5351
5457
|
*/
|
|
5352
|
-
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'>>>;
|
|
5353
5459
|
/**
|
|
5354
5460
|
* Cancels an intent
|
|
5355
5461
|
* @param {Intent} intent - The intent to cancel
|
|
@@ -5357,7 +5463,7 @@ declare class SolverService {
|
|
|
5357
5463
|
* @param {boolean} raw - Whether to return the raw transaction
|
|
5358
5464
|
* @returns {Promise<TxReturnType<T, R>>} The encoded contract call
|
|
5359
5465
|
*/
|
|
5360
|
-
cancelIntent<
|
|
5466
|
+
cancelIntent<S extends SpokeProvider, R extends boolean = false>(intent: Intent, spokeProvider: S, raw?: R): Promise<Result<TxReturnType<S, R>>>;
|
|
5361
5467
|
/**
|
|
5362
5468
|
* Gets an intent from a transaction hash (on Hub chain)
|
|
5363
5469
|
* @param {Hash} txHash - The transaction hash on Hub chain
|
|
@@ -5387,7 +5493,7 @@ type RelayAction = 'submit' | 'get_transaction_packets' | 'get_packet';
|
|
|
5387
5493
|
* executed - has confirmed transaction-hash
|
|
5388
5494
|
*/
|
|
5389
5495
|
type RelayTxStatus = 'pending' | 'validating' | 'executing' | 'executed';
|
|
5390
|
-
type RelayErrorCode = '
|
|
5496
|
+
type RelayErrorCode = 'SUBMIT_TX_FAILED' | 'RELAY_TIMEOUT';
|
|
5391
5497
|
type RelayError = {
|
|
5392
5498
|
code: RelayErrorCode;
|
|
5393
5499
|
error: unknown;
|
|
@@ -5395,6 +5501,10 @@ type RelayError = {
|
|
|
5395
5501
|
type SubmitTxParams = {
|
|
5396
5502
|
chain_id: string;
|
|
5397
5503
|
tx_hash: string;
|
|
5504
|
+
data?: {
|
|
5505
|
+
address: Hex;
|
|
5506
|
+
payload: Hex;
|
|
5507
|
+
};
|
|
5398
5508
|
};
|
|
5399
5509
|
type GetTransactionPacketsParams = {
|
|
5400
5510
|
chain_id: string;
|
|
@@ -5470,15 +5580,21 @@ declare function getTransactionPackets(payload: IntentRelayRequest<'get_transact
|
|
|
5470
5580
|
* @returns The response from the intent relay service.
|
|
5471
5581
|
*/
|
|
5472
5582
|
declare function getPacket(payload: IntentRelayRequest<'get_packet'>, apiUrl: HttpUrl): Promise<GetRelayResponse<'get_packet'>>;
|
|
5473
|
-
declare function waitUntilIntentExecuted(payload: WaitUntilIntentExecutedPayload): Promise<Result<PacketData,
|
|
5583
|
+
declare function waitUntilIntentExecuted(payload: WaitUntilIntentExecutedPayload): Promise<Result<PacketData, IntentError<'RELAY_TIMEOUT'>>>;
|
|
5474
5584
|
/**
|
|
5475
5585
|
* Submit the transaction to the Solver API and wait for it to be executed
|
|
5476
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.
|
|
5477
5590
|
* @param spokeProvider - The spoke provider.
|
|
5478
5591
|
* @param timeout - The timeout in milliseconds for the transaction. Default is 20 seconds.
|
|
5479
5592
|
* @returns The transaction hash.
|
|
5480
5593
|
*/
|
|
5481
|
-
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>>;
|
|
5482
5598
|
|
|
5483
5599
|
declare const IntentCreatedEventAbi: {
|
|
5484
5600
|
readonly type: "event";
|
|
@@ -5856,14 +5972,6 @@ declare class MigrationService {
|
|
|
5856
5972
|
createRevertMigrationIntent<R extends boolean = false>(params: IcxCreateRevertMigrationParams, spokeProvider: SonicSpokeProvider, raw?: R): Promise<Result<TxReturnType<SonicSpokeProvider, R>, MigrationError<'CREATE_REVERT_MIGRATION_INTENT_FAILED'>>>;
|
|
5857
5973
|
}
|
|
5858
5974
|
|
|
5859
|
-
type CWSpokeDepositParams = {
|
|
5860
|
-
from: string;
|
|
5861
|
-
to?: HubAddress;
|
|
5862
|
-
token: string;
|
|
5863
|
-
amount: bigint;
|
|
5864
|
-
data: Hex;
|
|
5865
|
-
};
|
|
5866
|
-
|
|
5867
5975
|
declare class IconSpokeProvider {
|
|
5868
5976
|
readonly walletProvider: IIconWalletProvider;
|
|
5869
5977
|
readonly chainConfig: IconSpokeChainConfig;
|
|
@@ -5893,15 +6001,28 @@ type SolanaSpokeDepositParams = {
|
|
|
5893
6001
|
data: Hex;
|
|
5894
6002
|
};
|
|
5895
6003
|
|
|
6004
|
+
type StellarRpcConfig = {
|
|
6005
|
+
horizonRpcUrl?: HttpUrl;
|
|
6006
|
+
sorobanRpcUrl?: HttpUrl;
|
|
6007
|
+
};
|
|
5896
6008
|
declare class StellarSpokeProvider implements ISpokeProvider {
|
|
5897
6009
|
private readonly server;
|
|
6010
|
+
private readonly sorobanServer;
|
|
5898
6011
|
private readonly contract;
|
|
5899
6012
|
readonly chainConfig: StellarSpokeChainConfig;
|
|
5900
6013
|
readonly walletProvider: IStellarWalletProvider;
|
|
5901
|
-
constructor(walletProvider: IStellarWalletProvider,
|
|
6014
|
+
constructor(walletProvider: IStellarWalletProvider, config: StellarSpokeChainConfig, rpcConfig?: StellarRpcConfig);
|
|
5902
6015
|
getBalance(tokenAddress: string): Promise<number>;
|
|
6016
|
+
private buildPriorityStellarTransaction;
|
|
6017
|
+
private handleSendTransactionError;
|
|
6018
|
+
private signAndSendTransaction;
|
|
6019
|
+
private waitForTransaction;
|
|
6020
|
+
private submitOrRestoreAndRetry;
|
|
6021
|
+
private handleSimulationRestore;
|
|
5903
6022
|
deposit<R extends boolean = false>(token: string, amount: string, recipient: Uint8Array, data: Uint8Array, raw?: R): PromiseStellarTxReturnType<R>;
|
|
5904
6023
|
sendMessage<R extends boolean = false>(dst_chain_id: string, dst_address: Uint8Array, payload: Uint8Array, raw?: R): PromiseStellarTxReturnType<R>;
|
|
6024
|
+
private buildDepositCall;
|
|
6025
|
+
private buildSendMessageCall;
|
|
5905
6026
|
static getAddressBCSBytes(stellaraddress: string): Hex;
|
|
5906
6027
|
static getTsWalletBytes(stellaraddress: string): Hex;
|
|
5907
6028
|
}
|
|
@@ -5951,6 +6072,14 @@ type SuiSpokeDepositParams = {
|
|
|
5951
6072
|
data: Hex;
|
|
5952
6073
|
};
|
|
5953
6074
|
|
|
6075
|
+
type InjectiveSpokeDepositParams = {
|
|
6076
|
+
from: string;
|
|
6077
|
+
to?: HubAddress;
|
|
6078
|
+
token: string;
|
|
6079
|
+
amount: bigint;
|
|
6080
|
+
data: Hex;
|
|
6081
|
+
};
|
|
6082
|
+
|
|
5954
6083
|
type IntentRelayChainId = (typeof INTENT_RELAY_CHAIN_IDS)[keyof typeof INTENT_RELAY_CHAIN_IDS];
|
|
5955
6084
|
type EvmChainId = (typeof EVM_CHAIN_IDS)[number];
|
|
5956
6085
|
type EvmSpokeChainId = (typeof EVM_SPOKE_CHAIN_IDS)[number];
|
|
@@ -6043,7 +6172,7 @@ type SuiSpokeChainConfig = BaseSpokeChainConfig<'SUI'> & {
|
|
|
6043
6172
|
};
|
|
6044
6173
|
rpc_url: string;
|
|
6045
6174
|
};
|
|
6046
|
-
type
|
|
6175
|
+
type InjectiveSpokeChainConfig = BaseSpokeChainConfig<'INJECTIVE'> & {
|
|
6047
6176
|
rpcUrl: string;
|
|
6048
6177
|
walletAddress: string;
|
|
6049
6178
|
addresses: {
|
|
@@ -6058,7 +6187,7 @@ type CosmosSpokeChainConfig = BaseSpokeChainConfig<'INJECTIVE'> & {
|
|
|
6058
6187
|
gasPrice: string;
|
|
6059
6188
|
isBrowser: boolean;
|
|
6060
6189
|
networkId: string;
|
|
6061
|
-
network:
|
|
6190
|
+
network: InjectiveNetworkEnv;
|
|
6062
6191
|
};
|
|
6063
6192
|
type StellarSpokeChainConfig = BaseSpokeChainConfig<'STELLAR'> & {
|
|
6064
6193
|
addresses: {
|
|
@@ -6068,7 +6197,8 @@ type StellarSpokeChainConfig = BaseSpokeChainConfig<'STELLAR'> & {
|
|
|
6068
6197
|
rateLimit: string;
|
|
6069
6198
|
testToken: string;
|
|
6070
6199
|
};
|
|
6071
|
-
|
|
6200
|
+
horizonRpcUrl: HttpUrl;
|
|
6201
|
+
sorobanRpcUrl: HttpUrl;
|
|
6072
6202
|
};
|
|
6073
6203
|
type IconSpokeChainConfig = BaseSpokeChainConfig<'ICON'> & {
|
|
6074
6204
|
addresses: {
|
|
@@ -6095,7 +6225,7 @@ type SolanaChainConfig = BaseSpokeChainConfig<'SOLANA'> & {
|
|
|
6095
6225
|
gasPrice: string;
|
|
6096
6226
|
};
|
|
6097
6227
|
type HubChainConfig = EvmHubChainConfig;
|
|
6098
|
-
type SpokeChainConfig = EvmSpokeChainConfig | SonicSpokeChainConfig |
|
|
6228
|
+
type SpokeChainConfig = EvmSpokeChainConfig | SonicSpokeChainConfig | InjectiveSpokeChainConfig | IconSpokeChainConfig | SuiSpokeChainConfig | StellarSpokeChainConfig | SolanaChainConfig;
|
|
6099
6229
|
type EvmContractCall = {
|
|
6100
6230
|
address: Address$1;
|
|
6101
6231
|
value: bigint;
|
|
@@ -6168,9 +6298,9 @@ type Result<T, E = Error | unknown> = {
|
|
|
6168
6298
|
error: E;
|
|
6169
6299
|
};
|
|
6170
6300
|
type HttpPrefixedUrl = `http${string}`;
|
|
6171
|
-
type SpokeDepositParams = EvmSpokeDepositParams |
|
|
6172
|
-
type GetSpokeDepositParamsType<T extends SpokeProvider> = T extends EvmSpokeProvider ? EvmSpokeDepositParams : T extends
|
|
6173
|
-
type GetAddressType<T extends SpokeProvider> = T extends EvmSpokeProvider ? Address$1 : T extends
|
|
6301
|
+
type SpokeDepositParams = EvmSpokeDepositParams | InjectiveSpokeDepositParams | IconSpokeDepositParams;
|
|
6302
|
+
type GetSpokeDepositParamsType<T extends SpokeProvider> = T extends EvmSpokeProvider ? EvmSpokeDepositParams : T extends InjectiveSpokeProvider ? InjectiveSpokeDepositParams : T extends SuiSpokeProvider ? SuiSpokeDepositParams : T extends IconSpokeProvider ? IconSpokeDepositParams : T extends StellarSpokeProvider ? StellarSpokeDepositParams : T extends SolanaSpokeProvider ? SolanaSpokeDepositParams : T extends SonicSpokeProvider ? SonicSpokeDepositParams : never;
|
|
6303
|
+
type GetAddressType<T extends SpokeProvider> = T extends EvmSpokeProvider ? Address$1 : T extends InjectiveSpokeProvider ? string : T extends StellarSpokeProvider ? Hex$1 : T extends IconSpokeProvider ? IconAddress : T extends SuiSpokeProvider ? Hex$1 : T extends SolanaSpokeProvider ? Hex$1 : T extends SonicSpokeProvider ? Address$1 : never;
|
|
6174
6304
|
type HttpUrl = `http://${string}` | `https://${string}`;
|
|
6175
6305
|
type SolverConfig = {
|
|
6176
6306
|
intentsContract: Address$1;
|
|
@@ -6178,7 +6308,7 @@ type SolverConfig = {
|
|
|
6178
6308
|
};
|
|
6179
6309
|
type SolverConfigParams = Prettify<SolverConfig & Optional<PartnerFeeConfig, 'partnerFee'>> | Optional<PartnerFeeConfig, 'partnerFee'>;
|
|
6180
6310
|
type QuoteType = 'exact_input' | 'exact_output';
|
|
6181
|
-
type
|
|
6311
|
+
type SolverIntentQuoteRequest = {
|
|
6182
6312
|
token_src: string;
|
|
6183
6313
|
token_src_blockchain_id: SpokeChainId;
|
|
6184
6314
|
token_dst: string;
|
|
@@ -6186,40 +6316,40 @@ type IntentQuoteRequest = {
|
|
|
6186
6316
|
amount: bigint;
|
|
6187
6317
|
quote_type: QuoteType;
|
|
6188
6318
|
};
|
|
6189
|
-
type
|
|
6319
|
+
type SolverIntentQuoteResponseRaw = {
|
|
6190
6320
|
quoted_amount: string;
|
|
6191
6321
|
};
|
|
6192
|
-
type
|
|
6322
|
+
type SolverIntentQuoteResponse = {
|
|
6193
6323
|
quoted_amount: bigint;
|
|
6194
6324
|
};
|
|
6195
|
-
type
|
|
6325
|
+
type SolverErrorResponse = {
|
|
6196
6326
|
detail: {
|
|
6197
|
-
code:
|
|
6327
|
+
code: SolverIntentErrorCode;
|
|
6198
6328
|
message: string;
|
|
6199
6329
|
};
|
|
6200
6330
|
};
|
|
6201
|
-
type
|
|
6331
|
+
type SolverExecutionRequest = {
|
|
6202
6332
|
intent_tx_hash: Hex$1;
|
|
6203
6333
|
};
|
|
6204
|
-
type
|
|
6334
|
+
type SolverExecutionResponse = {
|
|
6205
6335
|
answer: 'OK';
|
|
6206
6336
|
intent_hash: Hex$1;
|
|
6207
6337
|
};
|
|
6208
|
-
type
|
|
6338
|
+
type SolverIntentStatusRequest = {
|
|
6209
6339
|
intent_tx_hash: Hex$1;
|
|
6210
6340
|
};
|
|
6211
|
-
type
|
|
6212
|
-
status:
|
|
6341
|
+
type SolverIntentStatusResponse = {
|
|
6342
|
+
status: SolverIntentStatusCode;
|
|
6213
6343
|
fill_tx_hash?: string;
|
|
6214
6344
|
};
|
|
6215
|
-
declare enum
|
|
6345
|
+
declare enum SolverIntentStatusCode {
|
|
6216
6346
|
NOT_FOUND = -1,
|
|
6217
6347
|
NOT_STARTED_YET = 1,// It's in the task pool, but not started yet
|
|
6218
6348
|
STARTED_NOT_FINISHED = 2,
|
|
6219
6349
|
SOLVED = 3,
|
|
6220
6350
|
FAILED = 4
|
|
6221
6351
|
}
|
|
6222
|
-
declare enum
|
|
6352
|
+
declare enum SolverIntentErrorCode {
|
|
6223
6353
|
NO_PATH_FOUND = -4,// No path to swap Token X to Token Y
|
|
6224
6354
|
NO_PRIVATE_LIQUIDITY = -5,// Path found, but we have no private liquidity on the dest chain
|
|
6225
6355
|
NOT_ENOUGH_PRIVATE_LIQUIDITY = -8,// Path found, but not enough private liquidity on the dst chain
|
|
@@ -6268,20 +6398,20 @@ type SuiRawTransaction = {
|
|
|
6268
6398
|
};
|
|
6269
6399
|
type EvmReturnType<Raw extends boolean> = Raw extends true ? EvmRawTransaction : Hex$1;
|
|
6270
6400
|
type SolanaReturnType<Raw extends boolean> = Raw extends true ? SolanaRawTransaction : Hex$1;
|
|
6271
|
-
type StellarReturnType<Raw extends boolean> = Raw extends true ? StellarRawTransaction :
|
|
6401
|
+
type StellarReturnType<Raw extends boolean> = Raw extends true ? StellarRawTransaction : string;
|
|
6272
6402
|
type IconReturnType<Raw extends boolean> = Raw extends true ? IconRawTransaction : Hex$1;
|
|
6273
6403
|
type SuiReturnType<Raw extends boolean> = Raw extends true ? SuiRawTransaction : Hex$1;
|
|
6274
|
-
type
|
|
6275
|
-
type TxReturnType<T extends SpokeProvider, Raw extends boolean> = T['chainConfig']['chain']['type'] extends 'EVM' ? EvmReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'SOLANA' ? SolanaReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'STELLAR' ? StellarReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'ICON' ? IconReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'SUI' ? SuiReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'INJECTIVE' ?
|
|
6404
|
+
type InjectiveReturnType<Raw extends boolean> = Raw extends true ? InjectiveRawTransaction : Hex$1;
|
|
6405
|
+
type TxReturnType<T extends SpokeProvider, Raw extends boolean> = T['chainConfig']['chain']['type'] extends 'EVM' ? EvmReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'SOLANA' ? SolanaReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'STELLAR' ? StellarReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'ICON' ? IconReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'SUI' ? SuiReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'INJECTIVE' ? InjectiveReturnType<Raw> : never;
|
|
6276
6406
|
type PromiseEvmTxReturnType<Raw extends boolean> = Promise<TxReturnType<EvmSpokeProvider, Raw>>;
|
|
6277
6407
|
type PromiseSolanaTxReturnType<Raw extends boolean> = Promise<TxReturnType<SolanaSpokeProvider, Raw>>;
|
|
6278
6408
|
type PromiseStellarTxReturnType<Raw extends boolean> = Promise<TxReturnType<StellarSpokeProvider, Raw>>;
|
|
6279
6409
|
type PromiseIconTxReturnType<Raw extends boolean> = Promise<TxReturnType<IconSpokeProvider, Raw>>;
|
|
6280
6410
|
type PromiseSuiTxReturnType<Raw extends boolean> = Promise<TxReturnType<SuiSpokeProvider, Raw>>;
|
|
6281
|
-
type
|
|
6282
|
-
type RawTxReturnType = EvmRawTransaction | SolanaRawTransaction |
|
|
6411
|
+
type PromiseInjectiveTxReturnType<Raw extends boolean> = Promise<TxReturnType<InjectiveSpokeProvider, Raw>>;
|
|
6412
|
+
type RawTxReturnType = EvmRawTransaction | SolanaRawTransaction | InjectiveRawTransaction | IconRawTransaction | SuiRawTransaction;
|
|
6283
6413
|
type GetRawTxReturnType<T extends ChainType> = T extends 'EVM' ? PromiseEvmTxReturnType<boolean> : never;
|
|
6284
|
-
type PromiseTxReturnType<T extends ISpokeProvider, Raw extends boolean> = T['chainConfig']['chain']['type'] extends 'EVM' ? PromiseEvmTxReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'SOLANA' ? PromiseSolanaTxReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'STELLAR' ? PromiseStellarTxReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'ICON' ? PromiseIconTxReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'SUI' ? PromiseSuiTxReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'INJECTIVE' ?
|
|
6414
|
+
type PromiseTxReturnType<T extends ISpokeProvider, Raw extends boolean> = T['chainConfig']['chain']['type'] extends 'EVM' ? PromiseEvmTxReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'SOLANA' ? PromiseSolanaTxReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'STELLAR' ? PromiseStellarTxReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'ICON' ? PromiseIconTxReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'SUI' ? PromiseSuiTxReturnType<Raw> : T['chainConfig']['chain']['type'] extends 'INJECTIVE' ? PromiseInjectiveTxReturnType<Raw> : never;
|
|
6285
6415
|
type VaultType = {
|
|
6286
6416
|
address: Address$1;
|
|
6287
6417
|
reserves: Address$1[];
|
|
@@ -6292,6 +6422,8 @@ type Prettify<T> = {
|
|
|
6292
6422
|
type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
6293
6423
|
type ExtractKeys<T> = T extends unknown ? keyof T : never;
|
|
6294
6424
|
type SpokeTokenSymbols = ExtractKeys<(typeof spokeChainConfig)[SpokeChainId]['supportedTokens']>;
|
|
6425
|
+
type SpokeTxHash = string;
|
|
6426
|
+
type HubTxHash = string;
|
|
6295
6427
|
|
|
6296
6428
|
declare function getIconAddressBytes(address: string): Hex;
|
|
6297
6429
|
|
|
@@ -6339,8 +6471,8 @@ declare class EvmSpokeProvider implements ISpokeProvider {
|
|
|
6339
6471
|
constructor(walletProvider: IEvmWalletProvider, chainConfig: EvmSpokeChainConfig, rpcUrl?: string);
|
|
6340
6472
|
}
|
|
6341
6473
|
|
|
6342
|
-
type IWalletProvider = IEvmWalletProvider |
|
|
6343
|
-
type SpokeProvider = (EvmSpokeProvider |
|
|
6474
|
+
type IWalletProvider = IEvmWalletProvider | IInjectiveWalletProvider | IStellarWalletProvider | ISuiWalletProvider | IIconWalletProvider | IInjectiveWalletProvider | ISolanaWalletProvider;
|
|
6475
|
+
type SpokeProvider = (EvmSpokeProvider | InjectiveSpokeProvider | IconSpokeProvider | SuiSpokeProvider | StellarSpokeProvider | SolanaSpokeProvider | SonicSpokeProvider) & ISpokeProvider;
|
|
6344
6476
|
|
|
6345
6477
|
declare function getSolanaAddressBytes(address: PublicKey): Hex;
|
|
6346
6478
|
|
|
@@ -6435,6 +6567,8 @@ declare const DEFAULT_RETRY_DELAY_MS = 2000;
|
|
|
6435
6567
|
declare const ICON_TX_RESULT_WAIT_MAX_RETRY = 10;
|
|
6436
6568
|
declare const MAX_UINT256: bigint;
|
|
6437
6569
|
declare const FEE_PERCENTAGE_SCALE = 10000n;
|
|
6570
|
+
declare const STELLAR_PRIORITY_FEE = "10000";
|
|
6571
|
+
declare const STELLAR_DEFAULT_TX_TIMEOUT_SECONDS = 100;
|
|
6438
6572
|
declare const VAULT_TOKEN_DECIMALS = 18;
|
|
6439
6573
|
declare const INTENT_RELAY_CHAIN_IDS: {
|
|
6440
6574
|
readonly AVAX: 6n;
|
|
@@ -6500,6 +6634,12 @@ declare const spokeChainConfig: {
|
|
|
6500
6634
|
readonly decimals: 18;
|
|
6501
6635
|
readonly address: "0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38";
|
|
6502
6636
|
};
|
|
6637
|
+
readonly SODA: {
|
|
6638
|
+
readonly symbol: "SODA";
|
|
6639
|
+
readonly name: "SODAX";
|
|
6640
|
+
readonly decimals: 18;
|
|
6641
|
+
readonly address: "0x7c7d53EEcda37a87ce0D5bf8E0b24512A48dC963";
|
|
6642
|
+
};
|
|
6503
6643
|
};
|
|
6504
6644
|
};
|
|
6505
6645
|
readonly solana: {
|
|
@@ -6538,8 +6678,8 @@ declare const spokeChainConfig: {
|
|
|
6538
6678
|
};
|
|
6539
6679
|
};
|
|
6540
6680
|
readonly gasPrice: "500000";
|
|
6541
|
-
readonly rpcUrl: "https://
|
|
6542
|
-
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";
|
|
6543
6683
|
readonly walletAddress: "";
|
|
6544
6684
|
};
|
|
6545
6685
|
readonly "0xa86a.avax": {
|
|
@@ -6633,12 +6773,6 @@ declare const spokeChainConfig: {
|
|
|
6633
6773
|
readonly decimals: 18;
|
|
6634
6774
|
readonly address: "0xA256dd181C3f6E5eC68C6869f5D50a712d47212e";
|
|
6635
6775
|
};
|
|
6636
|
-
readonly WETH: {
|
|
6637
|
-
readonly symbol: "WETH";
|
|
6638
|
-
readonly name: "Wrapped Ether";
|
|
6639
|
-
readonly decimals: 18;
|
|
6640
|
-
readonly address: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1";
|
|
6641
|
-
};
|
|
6642
6776
|
readonly wstETH: {
|
|
6643
6777
|
readonly symbol: "wstETH";
|
|
6644
6778
|
readonly name: "Wrapped stETH";
|
|
@@ -6930,9 +7064,10 @@ declare const spokeChainConfig: {
|
|
|
6930
7064
|
};
|
|
6931
7065
|
readonly nativeToken: "CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA";
|
|
6932
7066
|
readonly bnUSD: "CD6YBFFWMU2UJHX2NGRJ7RN76IJVTCC7MRA46DUBXNB7E6W7H7JRJ2CX";
|
|
6933
|
-
readonly
|
|
7067
|
+
readonly horizonRpcUrl: "https://horizon.stellar.org";
|
|
7068
|
+
readonly sorobanRpcUrl: "https://rpc.ankr.com/stellar_soroban";
|
|
6934
7069
|
readonly chain: {
|
|
6935
|
-
readonly name: "
|
|
7070
|
+
readonly name: "Stellar";
|
|
6936
7071
|
readonly id: "stellar";
|
|
6937
7072
|
readonly type: "STELLAR";
|
|
6938
7073
|
};
|
|
@@ -6964,6 +7099,42 @@ declare const spokeChainConfig: {
|
|
|
6964
7099
|
readonly decimals: 6;
|
|
6965
7100
|
readonly address: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC";
|
|
6966
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
|
+
};
|
|
6967
7138
|
};
|
|
6968
7139
|
readonly nativeToken: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
6969
7140
|
readonly bnUSD: "0xff4de2b2b57dd7611d2812d231a467d007b702a101fd5c7ad3b278257cddb507::bnusd::BNUSD";
|
|
@@ -7011,6 +7182,74 @@ declare const spokeChainConfig: {
|
|
|
7011
7182
|
readonly nid: "0x1";
|
|
7012
7183
|
};
|
|
7013
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
|
+
};
|
|
7014
7253
|
declare const hubAssets: Record<SpokeChainId, Record<Address | string, {
|
|
7015
7254
|
asset: Address;
|
|
7016
7255
|
decimal: number;
|
|
@@ -7023,15 +7262,237 @@ declare const getSolverConfig: (chainId: HubChainId) => SolverConfig;
|
|
|
7023
7262
|
declare const getSupportedSolverTokens: (chainId: SpokeChainId) => readonly Token[];
|
|
7024
7263
|
declare const isSolverSupportedToken: (chainId: SpokeChainId, token: string) => boolean;
|
|
7025
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
|
+
};
|
|
7026
7490
|
declare const isMoneyMarketSupportedToken: (chainId: SpokeChainId, token: string) => boolean;
|
|
7027
7491
|
declare const getSupportedMoneyMarketTokens: (chainId: SpokeChainId) => readonly Token[];
|
|
7028
|
-
declare const HubVaultSymbols: readonly ["sodaAVAX", "sodaBNB", "sodaETH", "sodaBTC", "sodaSUI", "sodaINJ", "sodaXLM", "sodaSOL"];
|
|
7029
|
-
type HubVaultSymbol = (typeof HubVaultSymbols)[number];
|
|
7030
|
-
declare const hubVaults: Record<HubVaultSymbol, VaultType>;
|
|
7031
7492
|
declare const hubVaultsAddressSet: Set<`0x${string}`>;
|
|
7032
7493
|
declare const moneyMarketReserveHubAssetsSet: Set<`0x${string}`>;
|
|
7033
7494
|
declare const isMoneyMarketReserveHubAsset: (hubAsset: Address) => boolean;
|
|
7034
|
-
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}`];
|
|
7035
7496
|
declare const isMoneyMarketReserveAsset: (asset: Address) => boolean;
|
|
7036
7497
|
declare const originalAssetTohubAssetMap: Map<SpokeChainId, Map<OriginalAssetAddress, HubAssetInfo>>;
|
|
7037
7498
|
declare const hubAssetToOriginalAssetMap: Map<SpokeChainId, Map<Address, OriginalAssetAddress>>;
|
|
@@ -7069,10 +7530,25 @@ declare function isEvmSpokeProvider(value: SpokeProvider): value is EvmSpokeProv
|
|
|
7069
7530
|
declare function isSonicSpokeProvider(value: SpokeProvider): value is SonicSpokeProvider;
|
|
7070
7531
|
declare function isSolanaSpokeProvider(value: SpokeProvider): value is SolanaSpokeProvider;
|
|
7071
7532
|
declare function isStellarSpokeProvider(value: SpokeProvider): value is StellarSpokeProvider;
|
|
7072
|
-
declare function
|
|
7533
|
+
declare function isInjectiveSpokeProvider(value: SpokeProvider): value is InjectiveSpokeProvider;
|
|
7073
7534
|
declare function isIconSpokeProvider(value: SpokeProvider): value is IconSpokeProvider;
|
|
7074
7535
|
declare function isSuiSpokeProvider(value: SpokeProvider): value is SuiSpokeProvider;
|
|
7075
7536
|
declare function isConfiguredSolverConfig(value: SolverConfigParams): value is Prettify<SolverConfig & Optional<PartnerFeeConfig, 'partnerFee'>>;
|
|
7076
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'>;
|
|
7077
7553
|
|
|
7078
|
-
export { type AggregatedReserveData, type AssetInfo, type BaseCurrencyInfo, type BaseHubChainConfig, type BaseSpokeChainConfig, type BaseSpokeChainInfo, BigIntToHex, type BorrowInfo, type
|
|
7554
|
+
export { type AggregatedReserveData, type AssetInfo, type BaseCurrencyInfo, type BaseHubChainConfig, type BaseSpokeChainConfig, type BaseSpokeChainInfo, BigIntToHex, type BorrowInfo, 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 InjectiveReturnType, type InjectiveSpokeChainConfig, InjectiveSpokeProvider, 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 PromiseEvmTxReturnType, type PromiseIconTxReturnType, type PromiseInjectiveTxReturnType, 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, isConfiguredMoneyMarketConfig, isConfiguredSolverConfig, isEvmHubChainConfig, isEvmInitializedConfig, isEvmSpokeChainConfig, isEvmSpokeProvider, isEvmUninitializedBrowserConfig, isEvmUninitializedConfig, isEvmUninitializedPrivateKeyConfig, isIconAddress, isIconSpokeProvider, isInjectiveSpokeProvider, 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 };
|