@sodax/types 1.5.7-beta → 2.0.0-rc.10
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 +86 -20
- package/dist/backend/backendApi.d.ts +74 -0
- package/dist/backend/backendApi.js +1 -0
- package/dist/backend/index.d.ts +1 -81
- package/dist/backend/index.js +1 -2
- package/dist/{btc/index.d.ts → bitcoin/bitcoin.d.ts} +30 -31
- package/dist/{btc/index.js → bitcoin/bitcoin.js} +4 -4
- package/dist/bitcoin/index.d.ts +1 -0
- package/dist/bitcoin/index.js +1 -0
- package/dist/chains/chain-keys.d.ts +30 -0
- package/dist/chains/chain-keys.js +38 -0
- package/dist/chains/chains.d.ts +3602 -0
- package/dist/chains/chains.js +711 -0
- package/dist/chains/index.d.ts +2 -0
- package/dist/chains/index.js +2 -0
- package/dist/chains/tokens.d.ts +4617 -0
- package/dist/chains/tokens.js +2242 -0
- package/dist/common/common.d.ts +281 -0
- package/dist/common/common.js +29 -0
- package/dist/common/constants.d.ts +69 -0
- package/dist/common/constants.js +30 -0
- package/dist/common/index.d.ts +2 -275
- package/dist/common/index.js +2 -2
- package/dist/dex/dex.d.ts +267 -0
- package/dist/dex/dex.js +127 -0
- package/dist/dex/index.d.ts +1 -0
- package/dist/dex/index.js +1 -0
- package/dist/dex/pancakeswap-infinity.d.ts +538 -0
- package/dist/dex/pancakeswap-infinity.js +2 -0
- package/dist/evm/evm.d.ts +47 -0
- package/dist/evm/evm.js +1 -0
- package/dist/evm/index.d.ts +1 -40
- package/dist/evm/index.js +1 -2
- package/dist/icon/icon.d.ts +54 -0
- package/dist/icon/icon.js +1 -0
- package/dist/icon/index.d.ts +1 -36
- package/dist/icon/index.js +1 -2
- package/dist/index.d.ts +15 -8
- package/dist/index.js +15 -8
- package/dist/injective/index.d.ts +1 -68
- package/dist/injective/index.js +1 -17
- package/dist/injective/injective.d.ts +102 -0
- package/dist/injective/injective.js +1 -0
- package/dist/moneyMarket/index.d.ts +1 -0
- package/dist/moneyMarket/index.js +1 -0
- package/dist/moneyMarket/moneyMarket.d.ts +2559 -0
- package/dist/moneyMarket/moneyMarket.js +199 -0
- package/dist/near/index.d.ts +1 -70
- package/dist/near/index.js +1 -2
- package/dist/near/near-api-js.d.ts +6118 -0
- package/dist/near/near-api-js.js +1 -0
- package/dist/near/near.d.ts +74 -0
- package/dist/near/near.js +1 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +1 -0
- package/dist/shared/shared.d.ts +16 -0
- package/dist/shared/shared.js +5 -0
- package/dist/sodax-config/index.d.ts +1 -0
- package/dist/sodax-config/index.js +1 -0
- package/dist/sodax-config/sodax-config.d.ts +6307 -0
- package/dist/sodax-config/sodax-config.js +21 -0
- package/dist/solana/index.d.ts +1 -100
- package/dist/solana/index.js +1 -2
- package/dist/solana/solana-web3.d.ts +389 -0
- package/dist/solana/solana-web3.js +1 -0
- package/dist/solana/solana.d.ts +110 -0
- package/dist/solana/solana.js +1 -0
- package/dist/stacks/index.d.ts +1 -17
- package/dist/stacks/index.js +1 -2
- package/dist/stacks/stacks.d.ts +210 -0
- package/dist/stacks/stacks.js +1 -0
- package/dist/stellar/index.d.ts +1 -70
- package/dist/stellar/index.js +1 -2
- package/dist/stellar/stellar.d.ts +96 -0
- package/dist/stellar/stellar.js +1 -0
- package/dist/sui/index.d.ts +1 -33
- package/dist/sui/index.js +1 -2
- package/dist/sui/sui.d.ts +311 -0
- package/dist/sui/sui.js +1 -0
- package/dist/swap/index.d.ts +1 -0
- package/dist/swap/index.js +1 -0
- package/dist/swap/swap.d.ts +3500 -0
- package/dist/swap/swap.js +248 -0
- package/dist/utils/deep-partial.d.ts +8 -0
- package/dist/utils/deep-partial.js +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/utils.d.ts +60 -0
- package/dist/utils/utils.js +143 -0
- package/dist/wallet/index.d.ts +2 -0
- package/dist/wallet/index.js +2 -0
- package/dist/wallet/providers.d.ts +23 -0
- package/dist/wallet/providers.js +1 -0
- package/dist/wallet/wallet.d.ts +18 -0
- package/dist/wallet/wallet.js +1 -0
- package/package.json +42 -14
- package/dist/backend/index.d.ts.map +0 -1
- package/dist/backend/index.js.map +0 -1
- package/dist/btc/index.d.ts.map +0 -1
- package/dist/btc/index.js.map +0 -1
- package/dist/common/index.d.ts.map +0 -1
- package/dist/common/index.js.map +0 -1
- package/dist/constants/index.d.ts +0 -7299
- package/dist/constants/index.d.ts.map +0 -1
- package/dist/constants/index.js +0 -3227
- package/dist/constants/index.js.map +0 -1
- package/dist/evm/index.d.ts.map +0 -1
- package/dist/evm/index.js.map +0 -1
- package/dist/icon/index.d.ts.map +0 -1
- package/dist/icon/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/injective/index.d.ts.map +0 -1
- package/dist/injective/index.js.map +0 -1
- package/dist/near/index.d.ts.map +0 -1
- package/dist/near/index.js.map +0 -1
- package/dist/solana/index.d.ts.map +0 -1
- package/dist/solana/index.js.map +0 -1
- package/dist/stacks/index.d.ts.map +0 -1
- package/dist/stacks/index.js.map +0 -1
- package/dist/stellar/index.d.ts.map +0 -1
- package/dist/stellar/index.js.map +0 -1
- package/dist/sui/index.d.ts.map +0 -1
- package/dist/sui/index.js.map +0 -1
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import type { Address, Hex, HttpUrl } from '../shared/shared.js';
|
|
2
|
+
import type { ChainKey, ChainKeys, ChainType } from '../chains/chain-keys.js';
|
|
3
|
+
import type { GetChainType, SpokeChainConfig, spokeChainConfig, SpokeChainKey, IconAddress } from '../chains/chains.js';
|
|
4
|
+
import type { XToken } from '../chains/tokens.js';
|
|
5
|
+
import type { EvmRawTransaction, EvmReturnType } from '../evm/evm.js';
|
|
6
|
+
import type { BitcoinReturnType } from '../bitcoin/bitcoin.js';
|
|
7
|
+
import type { IconRawTransaction, IconReturnType } from '../icon/icon.js';
|
|
8
|
+
import type { InjectiveRawTransaction, InjectiveReturnType } from '../injective/injective.js';
|
|
9
|
+
import type { NearRawTransaction, NearReturnType } from '../near/near.js';
|
|
10
|
+
import type { SolanaRawTransaction, SolanaReturnType } from '../solana/solana.js';
|
|
11
|
+
import type { StacksRawTransaction, StacksReturnType } from '../stacks/stacks.js';
|
|
12
|
+
import type { StellarRawTransaction, StellarReturnType } from '../stellar/stellar.js';
|
|
13
|
+
import type { SuiRawTransaction, SuiReturnType } from '../sui/sui.js';
|
|
14
|
+
import type { GetWalletProviderType } from '../wallet/providers.js';
|
|
15
|
+
export type Default = {
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type RelayerApiConfig = {
|
|
19
|
+
relayerApiEndpoint: HttpUrl;
|
|
20
|
+
};
|
|
21
|
+
export type UnstakeSodaRequest = {
|
|
22
|
+
amount: bigint;
|
|
23
|
+
startTime: bigint;
|
|
24
|
+
to: Address;
|
|
25
|
+
};
|
|
26
|
+
export type UserUnstakeInfo = {
|
|
27
|
+
id: bigint;
|
|
28
|
+
request: UnstakeSodaRequest;
|
|
29
|
+
};
|
|
30
|
+
export type VaultReserves = {
|
|
31
|
+
tokens: readonly Address[];
|
|
32
|
+
balances: readonly bigint[];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Fee type for transaction fees.
|
|
36
|
+
* @property address - The address to which the fee is sent.
|
|
37
|
+
* @property amount - Optional fixed fee amount in wei.
|
|
38
|
+
*/
|
|
39
|
+
export type PartnerFeeAmount = {
|
|
40
|
+
address: Address;
|
|
41
|
+
amount: bigint;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Fee type for transaction fees.
|
|
45
|
+
* @property address - The address to which the fee is sent.
|
|
46
|
+
* @property percentage - Optional fee percentage in basis points (e.g., 100 = 1%). Maximum allowed is 100 (1%).
|
|
47
|
+
*/
|
|
48
|
+
export type PartnerFeePercentage = {
|
|
49
|
+
address: Address;
|
|
50
|
+
percentage: number;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Fee type for transaction fees.
|
|
54
|
+
* @property address - The address to which the fee is sent.
|
|
55
|
+
* @property percentage - Optional fee percentage in basis points (e.g., 100 = 1%). Maximum allowed is 100 (1%).
|
|
56
|
+
* @property amount - Optional fixed fee amount in wei. If both percentage and amount are provided, amount will be used.
|
|
57
|
+
*/
|
|
58
|
+
export type PartnerFee = PartnerFeeAmount | PartnerFeePercentage;
|
|
59
|
+
export type PartnerFeeConfig = {
|
|
60
|
+
partnerFee: PartnerFee | undefined;
|
|
61
|
+
};
|
|
62
|
+
export type FeeAmount = {
|
|
63
|
+
feeAmount: bigint;
|
|
64
|
+
};
|
|
65
|
+
export type OptionalFee = {
|
|
66
|
+
fee?: PartnerFee;
|
|
67
|
+
};
|
|
68
|
+
export type IconContractAddress = `cx${string}`;
|
|
69
|
+
export type Result<T, E = Error | unknown> = {
|
|
70
|
+
ok: true;
|
|
71
|
+
value: T;
|
|
72
|
+
} | {
|
|
73
|
+
ok: false;
|
|
74
|
+
error: E;
|
|
75
|
+
};
|
|
76
|
+
export type GetTokenAddressType<C extends SpokeChainKey | ChainType> = GetChainType<C> extends 'EVM' ? Address : string;
|
|
77
|
+
export type GetAddressType<C extends SpokeChainKey | ChainType> = GetChainType<C> extends 'EVM' ? Address : GetChainType<C> extends 'INJECTIVE' ? string : GetChainType<C> extends 'STELLAR' ? Hex : GetChainType<C> extends 'ICON' ? IconAddress : GetChainType<C> extends 'SUI' ? Hex : GetChainType<C> extends 'SOLANA' ? Hex : GetChainType<C> extends 'STACKS' ? string : GetChainType<C> extends 'NEAR' ? Address : string;
|
|
78
|
+
export type QuoteType = 'exact_input';
|
|
79
|
+
export type SolverIntentQuoteRequest = {
|
|
80
|
+
token_src: string;
|
|
81
|
+
token_src_blockchain_id: SpokeChainKey;
|
|
82
|
+
token_dst: string;
|
|
83
|
+
token_dst_blockchain_id: SpokeChainKey;
|
|
84
|
+
amount: bigint;
|
|
85
|
+
quote_type: QuoteType;
|
|
86
|
+
};
|
|
87
|
+
export type SolverIntentQuoteResponseRaw = {
|
|
88
|
+
quoted_amount: string;
|
|
89
|
+
};
|
|
90
|
+
export type SolverIntentQuoteResponse = {
|
|
91
|
+
quoted_amount: bigint;
|
|
92
|
+
};
|
|
93
|
+
export type SolverErrorResponse = {
|
|
94
|
+
detail: {
|
|
95
|
+
code: SolverIntentErrorCode;
|
|
96
|
+
message: string;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
export type SolverExecutionRequest = {
|
|
100
|
+
intent_tx_hash: Hex;
|
|
101
|
+
};
|
|
102
|
+
export type SolverExecutionResponse = {
|
|
103
|
+
answer: 'OK';
|
|
104
|
+
intent_hash: Hex;
|
|
105
|
+
};
|
|
106
|
+
export type SolverIntentStatusRequest = {
|
|
107
|
+
intent_tx_hash: Hex;
|
|
108
|
+
};
|
|
109
|
+
export type SolverIntentStatusResponse = {
|
|
110
|
+
status: SolverIntentStatusCode;
|
|
111
|
+
fill_tx_hash?: string;
|
|
112
|
+
};
|
|
113
|
+
export declare enum SolverIntentStatusCode {
|
|
114
|
+
NOT_FOUND = -1,
|
|
115
|
+
NOT_STARTED_YET = 1,// It's in the task pool, but not started yet
|
|
116
|
+
STARTED_NOT_FINISHED = 2,
|
|
117
|
+
SOLVED = 3,
|
|
118
|
+
FAILED = 4
|
|
119
|
+
}
|
|
120
|
+
export declare enum SolverIntentErrorCode {
|
|
121
|
+
NO_PATH_FOUND = -4,// No path to swap Token X to Token Y
|
|
122
|
+
NO_PRIVATE_LIQUIDITY = -5,// Path found, but we have no private liquidity on the dest chain
|
|
123
|
+
NOT_ENOUGH_PRIVATE_LIQUIDITY = -8,// Path found, but not enough private liquidity on the dst chain
|
|
124
|
+
NO_EXECUTION_MODULE_FOUND = -7,// Path found, private liquidity, but execution modules unavailable
|
|
125
|
+
QUOTE_NOT_FOUND = -8,// When executing, given quote_uuid does not exist
|
|
126
|
+
QUOTE_NOT_MATCH = -9,// When executing, given quote_uuid does not match the quote
|
|
127
|
+
INTENT_DATA_NOT_MATCH_QUOTE = -10,
|
|
128
|
+
NO_GAS_HANDLER_FOR_BLOCKCHAIN = -11,
|
|
129
|
+
INTENT_NOT_FOUND = -12,
|
|
130
|
+
QUOTE_EXPIRED = -13,
|
|
131
|
+
MAX_INPUT_AMOUNT = -14,
|
|
132
|
+
MAX_DIFF_OUTPUT = -15,
|
|
133
|
+
STOPPED = -16,
|
|
134
|
+
NO_ORACLE_MODULE_FOUND = -17,
|
|
135
|
+
NEGATIVE_INPUT_AMOUNT = -18,
|
|
136
|
+
INTENT_ALREADY_IN_ORDERBOOK = -19,
|
|
137
|
+
CREATE_INTENT_ORDER_FAILED = -998,
|
|
138
|
+
UNKNOWN = -999
|
|
139
|
+
}
|
|
140
|
+
export type HashTxReturnType = EvmReturnType<false> | SolanaReturnType<false> | IconReturnType<false> | SuiReturnType<false> | InjectiveReturnType<false> | StellarReturnType<false> | StacksReturnType<false> | NearReturnType<false>;
|
|
141
|
+
export type RawTxReturnType = EvmRawTransaction | SolanaRawTransaction | InjectiveRawTransaction | IconRawTransaction | SuiRawTransaction | StellarRawTransaction | StacksRawTransaction | NearRawTransaction;
|
|
142
|
+
export type GetDefaultTxReturnType<Raw extends boolean> = Raw extends true ? RawTxReturnType : HashTxReturnType;
|
|
143
|
+
/**
|
|
144
|
+
* Return type for a transaction based on the given ChainId or ChainType.
|
|
145
|
+
* Default to GetDefaultTxReturnType<Raw>
|
|
146
|
+
*/
|
|
147
|
+
export type TxReturnType<C extends SpokeChainKey | ChainType, Raw extends boolean> = GetChainType<C> extends 'EVM' ? EvmReturnType<Raw> : GetChainType<C> extends 'SOLANA' ? SolanaReturnType<Raw> : GetChainType<C> extends 'STELLAR' ? StellarReturnType<Raw> : GetChainType<C> extends 'ICON' ? IconReturnType<Raw> : GetChainType<C> extends 'SUI' ? SuiReturnType<Raw> : GetChainType<C> extends 'INJECTIVE' ? InjectiveReturnType<Raw> : GetChainType<C> extends 'STACKS' ? StacksReturnType<Raw> : GetChainType<C> extends 'NEAR' ? NearReturnType<Raw> : GetChainType<C> extends 'BITCOIN' ? BitcoinReturnType<Raw> : GetDefaultTxReturnType<Raw>;
|
|
148
|
+
export type Prettify<T> = {
|
|
149
|
+
[K in keyof T]: T[K];
|
|
150
|
+
} & {};
|
|
151
|
+
export type Optional<T, K extends keyof T = keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
152
|
+
type ExtractKeys<T> = T extends unknown ? keyof T : never;
|
|
153
|
+
export type SpokeTokenSymbols = ExtractKeys<(typeof spokeChainConfig)[SpokeChainKey]['supportedTokens']>;
|
|
154
|
+
export type SpokeTxHash = string;
|
|
155
|
+
export type HubTxHash = string;
|
|
156
|
+
export type SolanaGasEstimate = number | undefined;
|
|
157
|
+
export type EvmGasEstimate = bigint;
|
|
158
|
+
export type StellarGasEstimate = bigint;
|
|
159
|
+
export type IconGasEstimate = bigint;
|
|
160
|
+
export type SuiGasEstimate = {
|
|
161
|
+
computationCost: string;
|
|
162
|
+
nonRefundableStorageFee: string;
|
|
163
|
+
storageCost: string;
|
|
164
|
+
storageRebate: string;
|
|
165
|
+
};
|
|
166
|
+
export type InjectiveGasEstimate = {
|
|
167
|
+
gasWanted: number;
|
|
168
|
+
gasUsed: number;
|
|
169
|
+
};
|
|
170
|
+
export type BitcoinGasEstimate = bigint;
|
|
171
|
+
export type StacksFeeEstimation = {
|
|
172
|
+
fee: number;
|
|
173
|
+
fee_rate: number;
|
|
174
|
+
};
|
|
175
|
+
export type FeeEstimateTransaction = {
|
|
176
|
+
low: StacksFeeEstimation;
|
|
177
|
+
medium: StacksFeeEstimation;
|
|
178
|
+
high: StacksFeeEstimation;
|
|
179
|
+
};
|
|
180
|
+
export type NearGasEstimate = bigint;
|
|
181
|
+
export type GasEstimateType = EvmGasEstimate | SolanaGasEstimate | StellarGasEstimate | IconGasEstimate | SuiGasEstimate | InjectiveGasEstimate;
|
|
182
|
+
export type GetEstimateGasReturnTypeForSpokeChainId<C extends SpokeChainKey | ChainType> = GetChainType<C> extends 'EVM' ? EvmGasEstimate : GetChainType<C> extends 'SOLANA' ? SolanaGasEstimate : GetChainType<C> extends 'STELLAR' ? StellarGasEstimate : GetChainType<C> extends 'ICON' ? IconGasEstimate : GetChainType<C> extends 'SUI' ? SuiGasEstimate : GetChainType<C> extends 'INJECTIVE' ? InjectiveGasEstimate : GetChainType<C> extends 'NEAR' ? NearGasEstimate : GetChainType<C> extends 'BITCOIN' ? BitcoinGasEstimate : GetChainType<C> extends 'STACKS' ? FeeEstimateTransaction : GasEstimateType;
|
|
183
|
+
export type GetEstimateGasReturnTypeForChainType<C extends ChainType> = C extends 'EVM' ? EvmGasEstimate : C extends 'SOLANA' ? SolanaGasEstimate : C extends 'STELLAR' ? StellarGasEstimate : C extends 'ICON' ? IconGasEstimate : C extends 'SUI' ? SuiGasEstimate : C extends 'INJECTIVE' ? InjectiveGasEstimate : C extends 'BITCOIN' ? BitcoinGasEstimate : C extends 'STACKS' ? FeeEstimateTransaction : C extends 'NEAR' ? NearGasEstimate : GasEstimateType;
|
|
184
|
+
export type GetEstimateGasReturnType<C extends SpokeChainKey | ChainType> = C extends SpokeChainKey ? GetEstimateGasReturnTypeForSpokeChainId<C> : C extends ChainType ? GetEstimateGasReturnTypeForChainType<C> : GasEstimateType;
|
|
185
|
+
export type StellarRpcConfig = {
|
|
186
|
+
horizonRpcUrl?: string;
|
|
187
|
+
sorobanRpcUrl?: string;
|
|
188
|
+
};
|
|
189
|
+
export type BitcoinRpcConfig = {
|
|
190
|
+
rpcUrl?: string;
|
|
191
|
+
radfiApiUrl?: string;
|
|
192
|
+
radfiUmsUrl?: string;
|
|
193
|
+
};
|
|
194
|
+
export type InjectiveRpcConfig = {
|
|
195
|
+
indexer?: string;
|
|
196
|
+
grpc?: string;
|
|
197
|
+
};
|
|
198
|
+
export type StacksNetworkName = 'mainnet' | 'testnet' | 'devnet' | 'mocknet';
|
|
199
|
+
/**
|
|
200
|
+
* Structural mirror of `StacksNetwork` from @stacks/network (modeled against
|
|
201
|
+
* @stacks/network@7.3.1). Kept local to avoid importing external types per
|
|
202
|
+
* @sodax/types rules. Real `StacksNetwork` objects satisfy this via TS
|
|
203
|
+
* structural typing, so consumers can pass `networkFrom(...)` output directly.
|
|
204
|
+
*
|
|
205
|
+
* Maintenance: bump this type in lockstep with `@stacks/network` in the
|
|
206
|
+
* workspace catalog. If upstream adds required fields, consumers will get
|
|
207
|
+
* a compile error until this type is updated to match.
|
|
208
|
+
*/
|
|
209
|
+
export type StacksNetworkLike = {
|
|
210
|
+
chainId: number;
|
|
211
|
+
transactionVersion: number;
|
|
212
|
+
peerNetworkId: number;
|
|
213
|
+
magicBytes: string;
|
|
214
|
+
bootAddress: string;
|
|
215
|
+
addressVersion: {
|
|
216
|
+
singleSig: number;
|
|
217
|
+
multiSig: number;
|
|
218
|
+
};
|
|
219
|
+
client: {
|
|
220
|
+
baseUrl: string;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
export type RpcConfig = Partial<{
|
|
224
|
+
[K in ChainKey]: K extends typeof ChainKeys.STELLAR_MAINNET ? StellarRpcConfig : K extends typeof ChainKeys.BITCOIN_MAINNET ? BitcoinRpcConfig : K extends typeof ChainKeys.INJECTIVE_MAINNET ? InjectiveRpcConfig : K extends typeof ChainKeys.STACKS_MAINNET ? StacksNetworkName | StacksNetworkLike : string;
|
|
225
|
+
}>;
|
|
226
|
+
export type AssetInfo = {
|
|
227
|
+
chainId: bigint;
|
|
228
|
+
spokeAddress: `0x${string}`;
|
|
229
|
+
};
|
|
230
|
+
export type MoneyMarketConfig = {
|
|
231
|
+
supportedTokens: Record<SpokeChainKey, readonly XToken[]>;
|
|
232
|
+
supportedReserveAssets: readonly Address[];
|
|
233
|
+
uiPoolDataProvider: Address;
|
|
234
|
+
lendingPool: Address;
|
|
235
|
+
poolAddressesProvider: Address;
|
|
236
|
+
bnUSD: Address;
|
|
237
|
+
bnUSDVault: Address;
|
|
238
|
+
bnUSDAToken: Address;
|
|
239
|
+
partnerFee: PartnerFee | undefined;
|
|
240
|
+
};
|
|
241
|
+
export type TokenInfo = {
|
|
242
|
+
decimals: number;
|
|
243
|
+
depositFee: bigint;
|
|
244
|
+
withdrawalFee: bigint;
|
|
245
|
+
maxDeposit: bigint;
|
|
246
|
+
isSupported: boolean;
|
|
247
|
+
};
|
|
248
|
+
export type BridgeLimit = {
|
|
249
|
+
amount: bigint;
|
|
250
|
+
decimals: number;
|
|
251
|
+
type: 'DEPOSIT_LIMIT' | 'WITHDRAWAL_LIMIT';
|
|
252
|
+
};
|
|
253
|
+
export type SpokeChainConfigMap = Record<SpokeChainKey, SpokeChainConfig>;
|
|
254
|
+
export type WalletProviderSlot<K extends SpokeChainKey | ChainType, Raw extends boolean = false> = Raw extends true ? {
|
|
255
|
+
raw: true;
|
|
256
|
+
walletProvider?: never;
|
|
257
|
+
} : {
|
|
258
|
+
raw?: false;
|
|
259
|
+
walletProvider: GetWalletProviderType<K>;
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Standard exec-mode wrapper for hub/spoke flows: bounded `params`, optional relay toggles,
|
|
263
|
+
* plus {@link WalletProviderSlot} (`raw: true` for unsigned payloads, otherwise `walletProvider` required).
|
|
264
|
+
* Compose feature-specific extras at the alias site, e.g.
|
|
265
|
+
* `SpokeExecActionParams<K, Raw, P> & { fee?: PartnerFee }`.
|
|
266
|
+
*/
|
|
267
|
+
export type SpokeExecActionParams<K extends SpokeChainKey, Raw extends boolean, P> = {
|
|
268
|
+
params: P;
|
|
269
|
+
skipSimulation?: boolean;
|
|
270
|
+
timeout?: number;
|
|
271
|
+
} & WalletProviderSlot<K, Raw>;
|
|
272
|
+
export type ExecuteAction<A> = Extract<A, {
|
|
273
|
+
raw?: false;
|
|
274
|
+
}>;
|
|
275
|
+
export type RawAction<A> = Extract<A, {
|
|
276
|
+
raw: true;
|
|
277
|
+
}>;
|
|
278
|
+
export type GetActionChainType<T extends {
|
|
279
|
+
srcChainKey: SpokeChainKey;
|
|
280
|
+
}> = GetChainType<T['srcChainKey']>;
|
|
281
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export var SolverIntentStatusCode;
|
|
2
|
+
(function (SolverIntentStatusCode) {
|
|
3
|
+
SolverIntentStatusCode[SolverIntentStatusCode["NOT_FOUND"] = -1] = "NOT_FOUND";
|
|
4
|
+
SolverIntentStatusCode[SolverIntentStatusCode["NOT_STARTED_YET"] = 1] = "NOT_STARTED_YET";
|
|
5
|
+
SolverIntentStatusCode[SolverIntentStatusCode["STARTED_NOT_FINISHED"] = 2] = "STARTED_NOT_FINISHED";
|
|
6
|
+
SolverIntentStatusCode[SolverIntentStatusCode["SOLVED"] = 3] = "SOLVED";
|
|
7
|
+
SolverIntentStatusCode[SolverIntentStatusCode["FAILED"] = 4] = "FAILED";
|
|
8
|
+
})(SolverIntentStatusCode || (SolverIntentStatusCode = {}));
|
|
9
|
+
export var SolverIntentErrorCode;
|
|
10
|
+
(function (SolverIntentErrorCode) {
|
|
11
|
+
SolverIntentErrorCode[SolverIntentErrorCode["NO_PATH_FOUND"] = -4] = "NO_PATH_FOUND";
|
|
12
|
+
SolverIntentErrorCode[SolverIntentErrorCode["NO_PRIVATE_LIQUIDITY"] = -5] = "NO_PRIVATE_LIQUIDITY";
|
|
13
|
+
SolverIntentErrorCode[SolverIntentErrorCode["NOT_ENOUGH_PRIVATE_LIQUIDITY"] = -8] = "NOT_ENOUGH_PRIVATE_LIQUIDITY";
|
|
14
|
+
SolverIntentErrorCode[SolverIntentErrorCode["NO_EXECUTION_MODULE_FOUND"] = -7] = "NO_EXECUTION_MODULE_FOUND";
|
|
15
|
+
SolverIntentErrorCode[SolverIntentErrorCode["QUOTE_NOT_FOUND"] = -8] = "QUOTE_NOT_FOUND";
|
|
16
|
+
SolverIntentErrorCode[SolverIntentErrorCode["QUOTE_NOT_MATCH"] = -9] = "QUOTE_NOT_MATCH";
|
|
17
|
+
SolverIntentErrorCode[SolverIntentErrorCode["INTENT_DATA_NOT_MATCH_QUOTE"] = -10] = "INTENT_DATA_NOT_MATCH_QUOTE";
|
|
18
|
+
SolverIntentErrorCode[SolverIntentErrorCode["NO_GAS_HANDLER_FOR_BLOCKCHAIN"] = -11] = "NO_GAS_HANDLER_FOR_BLOCKCHAIN";
|
|
19
|
+
SolverIntentErrorCode[SolverIntentErrorCode["INTENT_NOT_FOUND"] = -12] = "INTENT_NOT_FOUND";
|
|
20
|
+
SolverIntentErrorCode[SolverIntentErrorCode["QUOTE_EXPIRED"] = -13] = "QUOTE_EXPIRED";
|
|
21
|
+
SolverIntentErrorCode[SolverIntentErrorCode["MAX_INPUT_AMOUNT"] = -14] = "MAX_INPUT_AMOUNT";
|
|
22
|
+
SolverIntentErrorCode[SolverIntentErrorCode["MAX_DIFF_OUTPUT"] = -15] = "MAX_DIFF_OUTPUT";
|
|
23
|
+
SolverIntentErrorCode[SolverIntentErrorCode["STOPPED"] = -16] = "STOPPED";
|
|
24
|
+
SolverIntentErrorCode[SolverIntentErrorCode["NO_ORACLE_MODULE_FOUND"] = -17] = "NO_ORACLE_MODULE_FOUND";
|
|
25
|
+
SolverIntentErrorCode[SolverIntentErrorCode["NEGATIVE_INPUT_AMOUNT"] = -18] = "NEGATIVE_INPUT_AMOUNT";
|
|
26
|
+
SolverIntentErrorCode[SolverIntentErrorCode["INTENT_ALREADY_IN_ORDERBOOK"] = -19] = "INTENT_ALREADY_IN_ORDERBOOK";
|
|
27
|
+
SolverIntentErrorCode[SolverIntentErrorCode["CREATE_INTENT_ORDER_FAILED"] = -998] = "CREATE_INTENT_ORDER_FAILED";
|
|
28
|
+
SolverIntentErrorCode[SolverIntentErrorCode["UNKNOWN"] = -999] = "UNKNOWN";
|
|
29
|
+
})(SolverIntentErrorCode || (SolverIntentErrorCode = {}));
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type IntentChainId, type SpokeChainKey } from '../chains/chains.js';
|
|
2
|
+
import type { Address, HttpUrl } from '../shared/shared.js';
|
|
3
|
+
export declare const DEFAULT_MAX_RETRY = 3;
|
|
4
|
+
export declare const DEFAULT_RELAY_TX_TIMEOUT = 120000;
|
|
5
|
+
export declare const DEFAULT_RETRY_DELAY_MS = 2000;
|
|
6
|
+
export declare const ICON_TX_RESULT_WAIT_MAX_RETRY = 10;
|
|
7
|
+
export declare const MAX_UINT256: bigint;
|
|
8
|
+
export declare const FEE_PERCENTAGE_SCALE = 10000n;
|
|
9
|
+
export declare const DEFAULT_DEADLINE_OFFSET = 300n;
|
|
10
|
+
export declare const DEFAULT_BACKEND_API_ENDPOINT = "https://api.sodax.com/v1/be";
|
|
11
|
+
export declare const DEFAULT_BACKEND_API_TIMEOUT = 30000;
|
|
12
|
+
export declare const DEFAULT_BACKEND_API_HEADERS: {
|
|
13
|
+
'Content-Type': string;
|
|
14
|
+
Accept: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const DEFAULT_RELAYER_API_ENDPOINT = "https://xcall-relay.nw.iconblockchain.xyz";
|
|
17
|
+
export declare const VAULT_TOKEN_DECIMALS = 18;
|
|
18
|
+
export type ApiConfig = {
|
|
19
|
+
baseURL: HttpUrl;
|
|
20
|
+
timeout: number;
|
|
21
|
+
headers: Record<string, string>;
|
|
22
|
+
};
|
|
23
|
+
export declare const apiConfig: {
|
|
24
|
+
baseURL: "https://api.sodax.com/v1/be";
|
|
25
|
+
timeout: number;
|
|
26
|
+
headers: {
|
|
27
|
+
'Content-Type': string;
|
|
28
|
+
Accept: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export type SolverConfig = {
|
|
32
|
+
intentsContract: Address;
|
|
33
|
+
solverApiEndpoint: HttpUrl;
|
|
34
|
+
protocolIntentsContract: Address;
|
|
35
|
+
};
|
|
36
|
+
export declare const solverConfig: {
|
|
37
|
+
readonly intentsContract: "0x6382D6ccD780758C5e8A6123c33ee8F4472F96ef";
|
|
38
|
+
readonly solverApiEndpoint: "https://api.sodax.com/v1/intent";
|
|
39
|
+
readonly protocolIntentsContract: "0xaFf2EDb3057ed6f9C1dA6c930b8ddDf2beE573A5";
|
|
40
|
+
};
|
|
41
|
+
export type RelayConfig = {
|
|
42
|
+
relayerApiEndpoint: HttpUrl;
|
|
43
|
+
relayChainIdMap: Record<SpokeChainKey, IntentChainId>;
|
|
44
|
+
};
|
|
45
|
+
export declare const relayConfig: {
|
|
46
|
+
relayerApiEndpoint: "https://xcall-relay.nw.iconblockchain.xyz";
|
|
47
|
+
relayChainIdMap: {
|
|
48
|
+
readonly "0xa86a.avax": 6n;
|
|
49
|
+
readonly "0xa4b1.arbitrum": 23n;
|
|
50
|
+
readonly "0x2105.base": 30n;
|
|
51
|
+
readonly "0x38.bsc": 4n;
|
|
52
|
+
readonly "injective-1": 19n;
|
|
53
|
+
readonly sonic: 146n;
|
|
54
|
+
readonly "0xa.optimism": 24n;
|
|
55
|
+
readonly "0x89.polygon": 5n;
|
|
56
|
+
readonly solana: 1n;
|
|
57
|
+
readonly sui: 21n;
|
|
58
|
+
readonly stellar: 27n;
|
|
59
|
+
readonly "0x1.icon": 1768124270n;
|
|
60
|
+
readonly hyper: 26745n;
|
|
61
|
+
readonly lightlink: 27756n;
|
|
62
|
+
readonly near: 15n;
|
|
63
|
+
readonly ethereum: 2n;
|
|
64
|
+
readonly bitcoin: 627463n;
|
|
65
|
+
readonly redbelly: 726564n;
|
|
66
|
+
readonly "0x2019.kaia": 27489n;
|
|
67
|
+
readonly stacks: 60n;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RelayChainIdMap } from '../chains/chains.js';
|
|
2
|
+
export const DEFAULT_MAX_RETRY = 3;
|
|
3
|
+
export const DEFAULT_RELAY_TX_TIMEOUT = 120000; // 120 seconds
|
|
4
|
+
export const DEFAULT_RETRY_DELAY_MS = 2000;
|
|
5
|
+
export const ICON_TX_RESULT_WAIT_MAX_RETRY = 10;
|
|
6
|
+
export const MAX_UINT256 = (1n << 256n) - 1n;
|
|
7
|
+
export const FEE_PERCENTAGE_SCALE = 10000n; // 100% = 10000
|
|
8
|
+
export const DEFAULT_DEADLINE_OFFSET = 300n; // 5 minutes in seconds
|
|
9
|
+
export const DEFAULT_BACKEND_API_ENDPOINT = 'https://api.sodax.com/v1/be';
|
|
10
|
+
export const DEFAULT_BACKEND_API_TIMEOUT = 30000; // 30 seconds
|
|
11
|
+
export const DEFAULT_BACKEND_API_HEADERS = {
|
|
12
|
+
'Content-Type': 'application/json',
|
|
13
|
+
Accept: 'application/json',
|
|
14
|
+
};
|
|
15
|
+
export const DEFAULT_RELAYER_API_ENDPOINT = 'https://xcall-relay.nw.iconblockchain.xyz';
|
|
16
|
+
export const VAULT_TOKEN_DECIMALS = 18;
|
|
17
|
+
export const apiConfig = {
|
|
18
|
+
baseURL: DEFAULT_BACKEND_API_ENDPOINT,
|
|
19
|
+
timeout: DEFAULT_BACKEND_API_TIMEOUT,
|
|
20
|
+
headers: DEFAULT_BACKEND_API_HEADERS,
|
|
21
|
+
};
|
|
22
|
+
export const solverConfig = {
|
|
23
|
+
intentsContract: '0x6382D6ccD780758C5e8A6123c33ee8F4472F96ef',
|
|
24
|
+
solverApiEndpoint: 'https://api.sodax.com/v1/intent',
|
|
25
|
+
protocolIntentsContract: '0xaFf2EDb3057ed6f9C1dA6c930b8ddDf2beE573A5',
|
|
26
|
+
};
|
|
27
|
+
export const relayConfig = {
|
|
28
|
+
relayerApiEndpoint: DEFAULT_RELAYER_API_ENDPOINT,
|
|
29
|
+
relayChainIdMap: RelayChainIdMap,
|
|
30
|
+
};
|
package/dist/common/index.d.ts
CHANGED
|
@@ -1,275 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type HubChainId = (typeof HUB_CHAIN_IDS)[number];
|
|
4
|
-
export type SpokeChainId = (typeof CHAIN_IDS)[number];
|
|
5
|
-
export type ChainId = (typeof CHAIN_IDS)[number];
|
|
6
|
-
export declare const ChainTypeArr: readonly ["ICON", "EVM", "INJECTIVE", "SUI", "STELLAR", "SOLANA", "STACKS", "NEAR", "BITCOIN"];
|
|
7
|
-
export type ChainType = (typeof ChainTypeArr)[number];
|
|
8
|
-
export type Chain = {
|
|
9
|
-
id: string | number;
|
|
10
|
-
name: string;
|
|
11
|
-
testnet: boolean;
|
|
12
|
-
};
|
|
13
|
-
export type XChain = Chain & {
|
|
14
|
-
xChainId: ChainId;
|
|
15
|
-
xChainType: ChainType;
|
|
16
|
-
};
|
|
17
|
-
export type Token = {
|
|
18
|
-
symbol: string;
|
|
19
|
-
name: string;
|
|
20
|
-
decimals: number;
|
|
21
|
-
address: string;
|
|
22
|
-
};
|
|
23
|
-
export type Erc20Token = {
|
|
24
|
-
name: string;
|
|
25
|
-
symbol: string;
|
|
26
|
-
decimals: number;
|
|
27
|
-
address: Address;
|
|
28
|
-
};
|
|
29
|
-
export type XToken = (Token | Erc20Token) & {
|
|
30
|
-
xChainId: ChainId;
|
|
31
|
-
};
|
|
32
|
-
export type ByteArray = Uint8Array;
|
|
33
|
-
export type Hex = `0x${string}`;
|
|
34
|
-
export type Hash = `0x${string}`;
|
|
35
|
-
export type Address = `0x${string}`;
|
|
36
|
-
export type HubAddress = Address;
|
|
37
|
-
export type OriginalAssetAddress = string;
|
|
38
|
-
export interface WalletAddressProvider {
|
|
39
|
-
getWalletAddress(): Promise<string>;
|
|
40
|
-
getPublicKey?: () => Promise<string>;
|
|
41
|
-
}
|
|
42
|
-
export type HttpUrl = `http://${string}` | `https://${string}`;
|
|
43
|
-
export type StellarRpcConfig = {
|
|
44
|
-
horizonRpcUrl?: HttpUrl;
|
|
45
|
-
sorobanRpcUrl?: HttpUrl;
|
|
46
|
-
};
|
|
47
|
-
export type BitcoinRpcConfig = {
|
|
48
|
-
rpcUrl?: string;
|
|
49
|
-
radfiApiUrl?: string;
|
|
50
|
-
radfiUmsUrl?: string;
|
|
51
|
-
};
|
|
52
|
-
export type RpcConfig = Partial<{
|
|
53
|
-
[K in ChainId]: K extends typeof STELLAR_MAINNET_CHAIN_ID ? StellarRpcConfig : K extends typeof BITCOIN_MAINNET_CHAIN_ID ? BitcoinRpcConfig : string;
|
|
54
|
-
}> & {
|
|
55
|
-
[ETHEREUM_MAINNET_CHAIN_ID]?: string | undefined;
|
|
56
|
-
};
|
|
57
|
-
export type IntentRelayChainId = (typeof ChainIdToIntentRelayChainId)[keyof typeof ChainIdToIntentRelayChainId];
|
|
58
|
-
export type IntentRelayChainIdMap = Record<ChainId, IntentRelayChainId>;
|
|
59
|
-
export type SpokeChainConfigMap = Record<SpokeChainId, SpokeChainConfig>;
|
|
60
|
-
export type HubVaultSymbol = (typeof HubVaultSymbols)[number];
|
|
61
|
-
export type EvmChainId = (typeof EVM_CHAIN_IDS)[number];
|
|
62
|
-
export type EvmSpokeChainId = (typeof EVM_CHAIN_IDS)[number];
|
|
63
|
-
export type GetSpokeChainIdType<T extends ChainType> = T extends 'EVM' ? EvmSpokeChainId : SpokeChainId;
|
|
64
|
-
export type BaseSpokeChainInfo<T extends ChainType> = {
|
|
65
|
-
name: string;
|
|
66
|
-
id: GetSpokeChainIdType<T>;
|
|
67
|
-
chainId: string | number;
|
|
68
|
-
type: T;
|
|
69
|
-
};
|
|
70
|
-
export type HubAssetInfo = {
|
|
71
|
-
asset: Address;
|
|
72
|
-
decimal: number;
|
|
73
|
-
vault: Address;
|
|
74
|
-
};
|
|
75
|
-
export type BaseHubChainConfig<T extends ChainType> = {
|
|
76
|
-
chain: HubChainInfo<T>;
|
|
77
|
-
addresses: {
|
|
78
|
-
[key: string]: Address | string | Uint8Array;
|
|
79
|
-
};
|
|
80
|
-
supportedTokens: Token[];
|
|
81
|
-
nativeToken: Address | string;
|
|
82
|
-
};
|
|
83
|
-
export type HubChainInfo<T extends ChainType> = {
|
|
84
|
-
name: string;
|
|
85
|
-
id: HubChainId;
|
|
86
|
-
type: T;
|
|
87
|
-
};
|
|
88
|
-
export type HubChainConfig = EvmHubChainConfig;
|
|
89
|
-
export type AssetInfo = {
|
|
90
|
-
chainId: bigint;
|
|
91
|
-
spokeAddress: `0x${string}`;
|
|
92
|
-
};
|
|
93
|
-
export type EvmHubChainConfig = BaseHubChainConfig<'EVM'> & {
|
|
94
|
-
addresses: {
|
|
95
|
-
assetManager: Address;
|
|
96
|
-
hubWallet: Address;
|
|
97
|
-
xTokenManager: Address;
|
|
98
|
-
icxMigration: Address;
|
|
99
|
-
balnSwap: Address;
|
|
100
|
-
sodaToken: Address;
|
|
101
|
-
sodaVault: Address;
|
|
102
|
-
stakedSoda: Address;
|
|
103
|
-
xSoda: Address;
|
|
104
|
-
stakingRouter: Address;
|
|
105
|
-
walletRouter: Address;
|
|
106
|
-
};
|
|
107
|
-
nativeToken: Address;
|
|
108
|
-
wrappedNativeToken: Address;
|
|
109
|
-
};
|
|
110
|
-
export type SpokeChainInfo<T extends ChainType> = BaseSpokeChainInfo<T>;
|
|
111
|
-
export type BaseSpokeChainConfig<T extends ChainType> = {
|
|
112
|
-
chain: SpokeChainInfo<T>;
|
|
113
|
-
addresses: {
|
|
114
|
-
[key: string]: string;
|
|
115
|
-
};
|
|
116
|
-
supportedTokens: Record<string, XToken>;
|
|
117
|
-
nativeToken: string;
|
|
118
|
-
bnUSD: string;
|
|
119
|
-
};
|
|
120
|
-
export type SonicSpokeChainConfig = BaseSpokeChainConfig<'EVM'> & {
|
|
121
|
-
addresses: {
|
|
122
|
-
walletRouter: Address;
|
|
123
|
-
wrappedSonic: Address;
|
|
124
|
-
};
|
|
125
|
-
nativeToken: Address;
|
|
126
|
-
};
|
|
127
|
-
export type SolanaChainConfig = BaseSpokeChainConfig<'SOLANA'> & {
|
|
128
|
-
addresses: {
|
|
129
|
-
assetManager: string;
|
|
130
|
-
connection: string;
|
|
131
|
-
xTokenManager: string;
|
|
132
|
-
rateLimit: string;
|
|
133
|
-
};
|
|
134
|
-
chain: SpokeChainInfo<'SOLANA'>;
|
|
135
|
-
rpcUrl: string;
|
|
136
|
-
walletAddress: string;
|
|
137
|
-
nativeToken: string;
|
|
138
|
-
gasPrice: string;
|
|
139
|
-
};
|
|
140
|
-
export type StellarAssetTrustline = {
|
|
141
|
-
assetCode: string;
|
|
142
|
-
contractId: string;
|
|
143
|
-
assetIssuer: string;
|
|
144
|
-
};
|
|
145
|
-
export type StellarSpokeChainConfig = BaseSpokeChainConfig<'STELLAR'> & {
|
|
146
|
-
addresses: {
|
|
147
|
-
assetManager: string;
|
|
148
|
-
connection: string;
|
|
149
|
-
xTokenManager: string;
|
|
150
|
-
rateLimit: string;
|
|
151
|
-
};
|
|
152
|
-
horizonRpcUrl: HttpUrl;
|
|
153
|
-
sorobanRpcUrl: HttpUrl;
|
|
154
|
-
trustlineConfigs: StellarAssetTrustline[];
|
|
155
|
-
};
|
|
156
|
-
export type BitcoinSpokeChainConfig = BaseSpokeChainConfig<'BITCOIN'> & {
|
|
157
|
-
addresses: {
|
|
158
|
-
assetManager: string;
|
|
159
|
-
};
|
|
160
|
-
rpcUrl: string;
|
|
161
|
-
network: string;
|
|
162
|
-
radfiApiUrl: string;
|
|
163
|
-
radfiApiKey: string;
|
|
164
|
-
radfiUmsUrl: string;
|
|
165
|
-
};
|
|
166
|
-
export type InjectiveSpokeChainConfig = BaseSpokeChainConfig<'INJECTIVE'> & {
|
|
167
|
-
rpcUrl: string;
|
|
168
|
-
walletAddress: string;
|
|
169
|
-
addresses: {
|
|
170
|
-
assetManager: string;
|
|
171
|
-
connection: string;
|
|
172
|
-
xTokenManager: string;
|
|
173
|
-
rateLimit: string;
|
|
174
|
-
};
|
|
175
|
-
nativeToken: string;
|
|
176
|
-
prefix: string;
|
|
177
|
-
gasPrice: string;
|
|
178
|
-
isBrowser: boolean;
|
|
179
|
-
networkId: string;
|
|
180
|
-
network: InjectiveNetworkEnv;
|
|
181
|
-
};
|
|
182
|
-
export type EvmSpokeChainConfig = BaseSpokeChainConfig<'EVM'> & {
|
|
183
|
-
addresses: {
|
|
184
|
-
assetManager: Address;
|
|
185
|
-
connection: Address;
|
|
186
|
-
};
|
|
187
|
-
nativeToken: string;
|
|
188
|
-
};
|
|
189
|
-
export type SuiSpokeChainConfig = BaseSpokeChainConfig<'SUI'> & {
|
|
190
|
-
addresses: {
|
|
191
|
-
originalAssetManager: string;
|
|
192
|
-
assetManagerConfigId: string;
|
|
193
|
-
connection: string;
|
|
194
|
-
xTokenManager: string;
|
|
195
|
-
rateLimit: string;
|
|
196
|
-
};
|
|
197
|
-
rpc_url: string;
|
|
198
|
-
};
|
|
199
|
-
export type NearSpokeChainConfig = BaseSpokeChainConfig<'NEAR'> & {
|
|
200
|
-
addresses: {
|
|
201
|
-
assetManager: string;
|
|
202
|
-
connection: string;
|
|
203
|
-
rateLimit: string;
|
|
204
|
-
intentFiller: string;
|
|
205
|
-
};
|
|
206
|
-
rpcUrl: string;
|
|
207
|
-
};
|
|
208
|
-
export type IconAddress = `hx${string}` | `cx${string}`;
|
|
209
|
-
export type IconSpokeChainConfig = BaseSpokeChainConfig<'ICON'> & {
|
|
210
|
-
addresses: {
|
|
211
|
-
assetManager: IconAddress;
|
|
212
|
-
connection: IconAddress;
|
|
213
|
-
rateLimit: IconAddress;
|
|
214
|
-
wICX: `cx${string}`;
|
|
215
|
-
};
|
|
216
|
-
nid: Hex;
|
|
217
|
-
};
|
|
218
|
-
export type StacksSpokeChainConfig = BaseSpokeChainConfig<'STACKS'> & {
|
|
219
|
-
addresses: {
|
|
220
|
-
assetManager: string;
|
|
221
|
-
connection: string;
|
|
222
|
-
rateLimit: string;
|
|
223
|
-
xTokenManager: string;
|
|
224
|
-
};
|
|
225
|
-
chain: SpokeChainInfo<'STACKS'>;
|
|
226
|
-
rpcUrl: string;
|
|
227
|
-
nativeToken: string;
|
|
228
|
-
};
|
|
229
|
-
export type SpokeChainConfig = EvmSpokeChainConfig | SonicSpokeChainConfig | InjectiveSpokeChainConfig | IconSpokeChainConfig | SuiSpokeChainConfig | StellarSpokeChainConfig | BitcoinSpokeChainConfig | SolanaChainConfig | StacksSpokeChainConfig | NearSpokeChainConfig;
|
|
230
|
-
export type SolverConfig = {
|
|
231
|
-
intentsContract: Address;
|
|
232
|
-
solverApiEndpoint: HttpUrl;
|
|
233
|
-
protocolIntentsContract?: Address;
|
|
234
|
-
};
|
|
235
|
-
export type MoneyMarketConfig = {
|
|
236
|
-
uiPoolDataProvider: Address;
|
|
237
|
-
lendingPool: Address;
|
|
238
|
-
poolAddressesProvider: Address;
|
|
239
|
-
bnUSD: Address;
|
|
240
|
-
bnUSDVault: Address;
|
|
241
|
-
bnUSDAToken: Address;
|
|
242
|
-
};
|
|
243
|
-
export type HubAsset = {
|
|
244
|
-
asset: Address;
|
|
245
|
-
decimal: number;
|
|
246
|
-
vault: Address;
|
|
247
|
-
symbol: string;
|
|
248
|
-
name: string;
|
|
249
|
-
};
|
|
250
|
-
export type TokenInfo = {
|
|
251
|
-
decimals: number;
|
|
252
|
-
depositFee: bigint;
|
|
253
|
-
withdrawalFee: bigint;
|
|
254
|
-
maxDeposit: bigint;
|
|
255
|
-
isSupported: boolean;
|
|
256
|
-
};
|
|
257
|
-
export type BridgeLimit = {
|
|
258
|
-
amount: bigint;
|
|
259
|
-
decimals: number;
|
|
260
|
-
type: 'DEPOSIT_LIMIT' | 'WITHDRAWAL_LIMIT';
|
|
261
|
-
};
|
|
262
|
-
export type ConcentratedLiquidityConfig = {
|
|
263
|
-
permit2: Address;
|
|
264
|
-
clPoolManager: Address;
|
|
265
|
-
router: Address;
|
|
266
|
-
clPositionManager: Address;
|
|
267
|
-
clPositionDescriptor: Address;
|
|
268
|
-
clQuoter: Address;
|
|
269
|
-
clTickLens: Address;
|
|
270
|
-
defaultHook: Address;
|
|
271
|
-
stataTokenFactory: Address;
|
|
272
|
-
defaultTickSpacing: number;
|
|
273
|
-
defaultBitmap: bigint;
|
|
274
|
-
};
|
|
275
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export * from './common.js';
|
|
2
|
+
export * from './constants.js';
|