@sodax/sdk 2.0.0-rc.11 → 2.0.0-rc.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { IConfigApi, ApiConfig, Result, SubmitSwapTxRequest, SubmitSwapTxResponse, GetSubmitSwapTxStatusParams, SubmitSwapTxStatusResponse, Address, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, SpokeChainKey, GetSwapTokensByChainIdApiResponse, GetMoneyMarketTokensApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, SodaxConfig, DeepPartial, XToken, OriginalAssetAddress, IntentRelayChainId, HubChainKey, HubConfig, PoolKey, SpokeChainConfig, RelayConfig, SolverConfig, SwapsConfig, BridgeConfig, MoneyMarketConfig, DexConfig, GetSpokeChainConfigType, EvmContractCall, Hex, IEvmWalletProvider, EvmRawTransactionReceipt, PartnerFee, QuoteType, EvmChainKey, WalletProviderSlot, TxReturnType, ChainType, GetChainType, SolanaRawTransactionReceipt, StellarSorobanTransactionReceipt, IconTransactionResult, SuiRawTransactionReceipt, InjectiveRawTransactionReceipt, NearRawTransactionReceipt, StacksRawTransactionReceipt, BitcoinRawTransactionReceipt, GetAddressType, HubAddress, GetTokenAddressType, EvmSpokeOnlyChainKey, StellarChainKey, SonicChainKey, AssetInfo, TokenInfo, VaultReserves, StacksChainKey, FeeEstimateTransaction, StacksTransactionParams, RadfiConfig, IBitcoinWalletProvider, RadfiDepositTxResponse, BtcAddressType, BitcoinChainKey, HttpUrl, NearChainKey, FillData, NearRawTransaction, SuiPaginatedCoins, SuiChainKey, SuiExecutionResult, SuiGasEstimate, IStellarWalletProvider, StellarGasEstimate, SolanaChainKey, SolanaGasEstimate, SolanaBase58PublicKey, SolanaRawTransactionInstruction, SolanaSerializedTransaction, SolanaRpcResponseAndContext, SolanaTokenAmount, IconChainKey, IconGasEstimate, InjectiveChainKey, InjectiveGasEstimate, JsonObject, InjectiveRawTransaction, IInjectiveWalletProvider, InjectiveExecuteResponse, GetEstimateGasReturnType, IconAddress, IWalletProvider, EvmSpokeChainConfig, PartnerFeeAmount, PartnerFeePercentage, GetWalletProviderType, SpokeExecActionParams, FeeAmount, Hash as Hash$1, SolverIntentQuoteRequest, SolverIntentQuoteResponse, SolverErrorResponse, SolverIntentStatusRequest, SolverIntentStatusResponse, SolverExecutionRequest, SolverExecutionResponse, IconEoaAddress, IcxTokenType, IconContractAddress, BridgeLimit, UserUnstakeInfo, ConcentratedLiquidityConfig } from '@sodax/types';
1
+ import { IConfigApi, ApiConfig, SodaxLogger, Result, SubmitSwapTxRequest, SubmitSwapTxResponse, GetSubmitSwapTxStatusParams, SubmitSwapTxStatusResponse, Address, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, SpokeChainKey, GetSwapTokensByChainIdApiResponse, GetMoneyMarketTokensApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, SodaxConfig, DeepPartial, XToken, OriginalAssetAddress, IntentRelayChainId, HubChainKey, HubConfig, PoolKey, SpokeChainConfig, RelayConfig, SolverConfig, SwapsConfig, BridgeConfig, MoneyMarketConfig, DexConfig, GetSpokeChainConfigType, EvmContractCall, Hex, IEvmWalletProvider, EvmRawTransactionReceipt, PartnerFee, QuoteType, EvmChainKey, WalletProviderSlot, TxReturnType, ChainType, GetChainType, SolanaRawTransactionReceipt, StellarSorobanTransactionReceipt, IconTransactionResult, SuiRawTransactionReceipt, InjectiveRawTransactionReceipt, NearRawTransactionReceipt, StacksRawTransactionReceipt, BitcoinRawTransactionReceipt, GetAddressType, HubAddress, GetTokenAddressType, EvmSpokeOnlyChainKey, StellarChainKey, SonicChainKey, AssetInfo, TokenInfo, VaultReserves, StacksChainKey, FeeEstimateTransaction, StacksTransactionParams, HttpUrl, RadfiConfig, IBitcoinWalletProvider, RadfiDepositTxResponse, BtcAddressType, BitcoinChainKey, NearChainKey, FillData, NearRawTransaction, INearWalletProvider, SuiPaginatedCoins, SuiChainKey, SuiExecutionResult, SuiGasEstimate, IStellarWalletProvider, StellarGasEstimate, SolanaChainKey, SolanaGasEstimate, SolanaBase58PublicKey, SolanaRawTransactionInstruction, SolanaSerializedTransaction, SolanaRpcResponseAndContext, SolanaTokenAmount, IconChainKey, IconGasEstimate, InjectiveChainKey, InjectiveGasEstimate, JsonObject, InjectiveRawTransaction, IInjectiveWalletProvider, InjectiveExecuteResponse, GetEstimateGasReturnType, IconAddress, IWalletProvider, EvmSpokeChainConfig, PartnerFeeAmount, PartnerFeePercentage, GetWalletProviderType, SodaxLoggerOption, SpokeExecActionParams, FeeAmount, Hash as Hash$1, SolverIntentQuoteRequest, SolverIntentQuoteResponse, SolverErrorResponse, SolverIntentStatusRequest, SolverIntentStatusResponse, SolverExecutionRequest, SolverExecutionResponse, IconEoaAddress, IcxTokenType, IconContractAddress, BridgeLimit, UserUnstakeInfo, ConcentratedLiquidityConfig, SodaxOptions } from '@sodax/types';
2
2
  export * from '@sodax/types';
3
3
  import * as viem from 'viem';
4
4
  import { Hex as Hex$1, Chain, Address as Address$1, PublicClient, HttpTransport, Hash, GetLogsReturnType } from 'viem';
@@ -7526,7 +7526,8 @@ interface MoneyMarketBorrowers {
7526
7526
  declare class BackendApiService implements IConfigApi {
7527
7527
  private readonly config;
7528
7528
  private readonly headers;
7529
- constructor(config: ApiConfig);
7529
+ private readonly logger;
7530
+ constructor(config: ApiConfig, logger?: SodaxLogger);
7530
7531
  /**
7531
7532
  * Execute a single HTTP request and return the parsed JSON body.
7532
7533
  *
@@ -7817,6 +7818,11 @@ type ConfigServiceConstructorParams = {
7817
7818
  * that a remote config fetch never clobbers explicit user overrides.
7818
7819
  */
7819
7820
  userConfig?: DeepPartial<SodaxConfig>;
7821
+ /**
7822
+ * Pre-resolved SDK log sink. Held outside the swappable `SodaxConfig` so a dynamic config fetch
7823
+ * in {@link ConfigService.initialize} never replaces it. Defaults to the console logger when omitted.
7824
+ */
7825
+ logger?: SodaxLogger;
7820
7826
  };
7821
7827
  /**
7822
7828
  * ConfigApiService - Service for fetching configuration data from the backend API or fallbacking to default values
@@ -7825,6 +7831,11 @@ declare class ConfigService {
7825
7831
  private sodax;
7826
7832
  private readonly api;
7827
7833
  private readonly userConfig?;
7834
+ /**
7835
+ * SDK log sink. Resolved once at construction and kept independent of {@link sodax} so that
7836
+ * {@link initialize}'s dynamic-config swap never clobbers it. Read by services via `config.logger`.
7837
+ */
7838
+ readonly logger: SodaxLogger;
7828
7839
  private initialized;
7829
7840
  private supportedHubAssetsSet;
7830
7841
  private supportedSodaVaultAssetsSet;
@@ -7835,7 +7846,7 @@ declare class ConfigService {
7835
7846
  private stakedATokenAddressesSet;
7836
7847
  private chainToSupportedTokenAddressMap;
7837
7848
  private hubAssetToXTokenMap;
7838
- constructor({ api, config, userConfig }: ConfigServiceConstructorParams);
7849
+ constructor({ api, config, userConfig, logger }: ConfigServiceConstructorParams);
7839
7850
  initialize(): Promise<Result<void>>;
7840
7851
  getChains(): GetChainsApiResponse;
7841
7852
  getSwapTokens(): GetSwapTokensApiResponse;
@@ -8620,10 +8631,89 @@ declare class StacksSpokeService {
8620
8631
  waitForTransactionReceipt(params: WaitForTxReceiptParams<StacksChainKey>): Promise<Result<WaitForTxReceiptReturnType<StacksChainKey>>>;
8621
8632
  }
8622
8633
 
8634
+ type RelayExtraData = {
8635
+ address: Hex;
8636
+ payload: Hex;
8637
+ };
8638
+ /**
8639
+ * Signed Bitcoin on-demand payload (money-market borrow/withdraw) carried in the relay submit
8640
+ * `data` as a JSON object — not a stringified JSON. There is no broadcast tx for these.
8641
+ * `public_key` is the signer's public key, required by the relay to verify a BIP-322 signature
8642
+ * (BIP-322 is not public-key-recoverable, unlike BIP-137).
8643
+ */
8644
+ type OnDemandRelayData = {
8645
+ payload_hex: string;
8646
+ signature?: string;
8647
+ public_key?: string;
8648
+ };
8649
+ type IntentDeliveryInfo = {
8650
+ srcChainKey: SpokeChainKey;
8651
+ srcTxHash: string;
8652
+ srcAddress: string;
8653
+ dstChainKey: SpokeChainKey;
8654
+ dstTxHash: string;
8655
+ dstAddress: string;
8656
+ };
8657
+ type WaitUntilIntentExecutedPayload = {
8658
+ intentRelayChainId: string;
8659
+ srcTxHash: string;
8660
+ timeout?: number;
8661
+ apiUrl: HttpUrl;
8662
+ };
8663
+ type RelayAction = 'submit' | 'get_transaction_packets' | 'get_packet';
8664
+ type IntentRelayRequest<T extends RelayAction> = {
8665
+ action: T;
8666
+ params: T extends 'submit' ? {
8667
+ chain_id: string;
8668
+ tx_hash: string;
8669
+ data?: RelayExtraData | OnDemandRelayData;
8670
+ } : T extends 'get_transaction_packets' ? {
8671
+ chain_id: string;
8672
+ tx_hash: string;
8673
+ } : T extends 'get_packet' ? {
8674
+ chain_id: string;
8675
+ tx_hash: string;
8676
+ conn_sn: string;
8677
+ } : never;
8678
+ };
8679
+
8623
8680
  /**
8624
- * Raw error body shape returned by the Radfi HTTP API on non-2xx responses.
8681
+ * Types derived from Core SDK specific types
8682
+ * NOTE: common (non Core SDK specific) types should be put in @sodax/types package
8683
+ */
8684
+ type HubProvider = EvmHubProvider;
8685
+ type RateLimitConfig = {
8686
+ maxAvailable: number;
8687
+ ratePerSecond: number;
8688
+ available: number;
8689
+ };
8690
+ /**
8691
+ * Structural types
8692
+ */
8693
+ type OptionalRaw<R extends boolean> = {
8694
+ raw?: R;
8695
+ };
8696
+ type OptionalSkipSimulation = {
8697
+ skipSimulation?: boolean;
8698
+ };
8699
+ type OptionalTimeout = {
8700
+ timeout?: number;
8701
+ };
8702
+ type TxHashPair = {
8703
+ srcChainTxHash: string;
8704
+ dstChainTxHash: string;
8705
+ };
8706
+ type IntentTxResult<K extends SpokeChainKey, Raw extends boolean> = {
8707
+ tx: TxReturnType<K, Raw>;
8708
+ relayData: RelayExtraData;
8709
+ };
8710
+
8711
+ type DestinationParamsType = RawDestinationParams;
8712
+
8713
+ /**
8714
+ * Raw error body shape returned by the Bound Exchange HTTP API on non-2xx responses.
8625
8715
  * The human-readable detail typically lives at `error.details` (nested), with
8626
- * `code` carrying a Radfi-specific identifier (e.g. "2002" insufficientBTCBalance,
8716
+ * `code` carrying a Bound Exchange-specific identifier (e.g. "2002" insufficientBTCBalance,
8627
8717
  * "4008" duplicatedPubKey) and `message` an i18n key.
8628
8718
  */
8629
8719
  type RadfiErrorBody = {
@@ -8636,8 +8726,8 @@ type RadfiErrorBody = {
8636
8726
  };
8637
8727
  };
8638
8728
  /**
8639
- * Structured error from a Radfi HTTP request. Exposes `status` (HTTP), `code`
8640
- * (Radfi-specific identifier), and `details` (human-readable) so callers can
8729
+ * Structured error from a Bound Exchange HTTP request. Exposes `status` (HTTP), `code`
8730
+ * (Bound Exchange-specific identifier), and `details` (human-readable) so callers can
8641
8731
  * discriminate without fragile string-matching on `message`. The raw response
8642
8732
  * body is preserved on `cause` for structured logging.
8643
8733
  */
@@ -8712,7 +8802,7 @@ declare class RadfiProvider {
8712
8802
  refreshToken: string;
8713
8803
  constructor(config: RadfiConfig);
8714
8804
  /**
8715
- * Authenticate with Radfi: BIP322-sign a login message, then call the Radfi API.
8805
+ * Authenticate with Bound Exchange: BIP322-sign a login message, then call the Bound Exchange API.
8716
8806
  * Returns accessToken, refreshToken, and tradingAddress.
8717
8807
  */
8718
8808
  authenticateWithWallet(walletProvider: IBitcoinWalletProvider, cachedPublicKey?: string): Promise<{
@@ -8722,8 +8812,8 @@ declare class RadfiProvider {
8722
8812
  publicKey: string;
8723
8813
  }>;
8724
8814
  /**
8725
- * Ensure a valid Radfi access token is set on this provider.
8726
- * If a token exists, validates it via the Radfi API.
8815
+ * Ensure a valid Bound Exchange access token is set on this provider.
8816
+ * If a token exists, validates it via the Bound Exchange API.
8727
8817
  * If invalid, tries refreshing with the refresh token first.
8728
8818
  * If refresh also fails, falls back to full re-authentication (BIP322 sign).
8729
8819
  */
@@ -8753,9 +8843,18 @@ declare class RadfiProvider {
8753
8843
  userAddress: string;
8754
8844
  data: string;
8755
8845
  }, accessToken: string): Promise<RadfiDepositTxResponse>;
8846
+ /**
8847
+ * Co-sign and broadcast a `sodax-withdraw` deposit via the Bound Exchange API.
8848
+ *
8849
+ * `relayData` ({ address, payload }) is the same `RelayExtraData` the SDK returns from
8850
+ * `createIntent()` / money-market supply etc. It is optional and non-breaking: when supplied,
8851
+ * the Bound Exchange backend persists it so it can auto-resubmit the intent relay if the relay
8852
+ * gets stuck (otherwise a stuck relay eventually refunds instead of completing the swap).
8853
+ */
8756
8854
  requestRadfiSignature(params: {
8757
8855
  userAddress: string;
8758
8856
  signedBase64Tx: string;
8857
+ relayData?: RelayExtraData;
8759
8858
  }, accessToken: string): Promise<string>;
8760
8859
  /**
8761
8860
  * Fetch expired (or near-expiry) UTXOs for a trading wallet address from UMS API.
@@ -8765,7 +8864,7 @@ declare class RadfiProvider {
8765
8864
  pageSize?: number;
8766
8865
  }): Promise<RadfiUtxoListResponse>;
8767
8866
  /**
8768
- * Build a renew-utxo transaction via the Radfi API.
8867
+ * Build a renew-utxo transaction via the Bound Exchange API.
8769
8868
  * Returns a PSBT that needs to be signed by the user.
8770
8869
  */
8771
8870
  buildRenewUtxoTransaction(params: {
@@ -8773,8 +8872,8 @@ declare class RadfiProvider {
8773
8872
  txIdVouts: string[];
8774
8873
  }, accessToken: string): Promise<RadfiBuildTxResponse>;
8775
8874
  /**
8776
- * Sign and broadcast a renew-utxo transaction via the Radfi API.
8777
- * The user signs the PSBT first, then Radfi co-signs and broadcasts.
8875
+ * Sign and broadcast a renew-utxo transaction via the Bound Exchange API.
8876
+ * The user signs the PSBT first, then Bound Exchange co-signs and broadcasts.
8778
8877
  */
8779
8878
  signAndBroadcastRenewUtxo(params: {
8780
8879
  userAddress: string;
@@ -8791,7 +8890,7 @@ declare class RadfiProvider {
8791
8890
  withdrawTo: string;
8792
8891
  }, accessToken: string): Promise<RadfiBuildTxResponse>;
8793
8892
  /**
8794
- * Sign and broadcast a withdraw transaction via Radfi.
8893
+ * Sign and broadcast a withdraw transaction via Bound Exchange.
8795
8894
  */
8796
8895
  signAndBroadcastWithdraw(params: {
8797
8896
  userAddress: string;
@@ -8819,20 +8918,33 @@ interface BtcPayload {
8819
8918
  timestamp: number;
8820
8919
  address_type: BtcAddressType;
8821
8920
  }
8921
+ /**
8922
+ * Calculate the actual vbytes of an OP_RETURN output given the payload byte length.
8923
+ * Accounts for variable-length pushdata opcodes and script-length varints.
8924
+ */
8925
+ declare function calcOpReturnOutputVbytes(payloadByteLength: number): number;
8822
8926
  /**
8823
8927
  * Estimate transaction size in vbytes.
8824
8928
  * @param addressType — caller's address type for accurate per-input weight.
8825
8929
  * P2PKH ≈ 148 vB, P2SH-P2WPKH ≈ 91 vB, P2WPKH ≈ 68 vB, P2TR ≈ 58 vB.
8826
8930
  * Defaults to P2WPKH (68 vB) when omitted.
8931
+ * @param opReturnOutputVbytes — actual OP_RETURN output size in vbytes.
8932
+ * Use calcOpReturnOutputVbytes() when the payload size is known. Defaults to 44 vB (~33-byte payload).
8827
8933
  */
8828
- declare function estimateBitcoinTxSize(inputCount: number, outputCount: number, addressType?: BtcAddressType): number;
8934
+ declare function estimateBitcoinTxSize(inputCount: number, outputCount: number, addressType?: BtcAddressType, opReturnOutputVbytes?: number): number;
8829
8935
  declare function encodeBtcPayloadToBytes(payload: BtcPayload): string;
8830
8936
  /**
8831
8937
  * Normalize a signed PSBT to base64 format.
8832
8938
  * Unisat/OKX wallets return hex, Xverse returns base64.
8833
- * Radfi API expects base64.
8939
+ * Bound Exchange API expects base64.
8834
8940
  */
8835
8941
  declare function normalizePsbtToBase64(signedPsbt: string): string;
8942
+ /**
8943
+ * Normalize a wallet message signature to base64. The intent relay requires the on-demand
8944
+ * withdrawal signature as base64. Browser wallets (UniSat/Xverse/OKX) already return base64; a hex
8945
+ * signature (e.g. a private-key wallet) is encoded. Mirrors `normalizePsbtToBase64`.
8946
+ */
8947
+ declare function normalizeSignatureToBase64(signature: string): string;
8836
8948
 
8837
8949
  type BitcoinUTXO = {
8838
8950
  txid: string;
@@ -8854,6 +8966,7 @@ interface BitcoinTransactionResult {
8854
8966
  interface OnDemandBtcPayload {
8855
8967
  payload_hex: string;
8856
8968
  signature?: string;
8969
+ public_key?: string;
8857
8970
  }
8858
8971
  declare class BitcoinSpokeService {
8859
8972
  private readonly config;
@@ -8899,7 +9012,7 @@ declare class BitcoinSpokeService {
8899
9012
  */
8900
9013
  getDeposit(params: GetDepositParams<BitcoinChainKey>): Promise<bigint>;
8901
9014
  /**
8902
- * Fund the Radfi trading wallet by sending BTC from the user's personal wallet
9015
+ * Fund the Bound Exchange trading wallet by sending BTC from the user's personal wallet
8903
9016
  *
8904
9017
  * @param {bigint} amount - Amount in satoshis to send
8905
9018
  * @param {BitcoinSpokeProvider} spokeProvider - The Bitcoin spoke provider (must have signing capability)
@@ -8920,13 +9033,30 @@ declare class BitcoinSpokeService {
8920
9033
  sendMessage<Raw extends boolean>(params: SendMessageParams<BitcoinChainKey, Raw> & {
8921
9034
  walletMode?: WalletMode;
8922
9035
  }): Promise<TxReturnType<BitcoinChainKey, Raw>>;
9036
+ /**
9037
+ * Build the relay submit/poll identity for an on-demand action (borrow/withdraw).
9038
+ *
9039
+ * Bitcoin borrow/withdraw are on-demand: there is no broadcast transaction — the spoke result is
9040
+ * the signed payload JSON produced by {@link encodeWithdrawalData}/{@link sendMessage}. The relay
9041
+ * accepts the submit under the literal `withdraw` tx_hash with the signed payload (as a JSON object)
9042
+ * in `data`, then tracks the resulting packet under a derived id: `od:` + keccak256 of the ASCII
9043
+ * `payload_hex` string (hash the hex characters, not the decoded bytes). Polling must use that
9044
+ * derived id (`pollTxHash`), not `withdraw`.
9045
+ *
9046
+ * @param tx - The JSON-stringified signed payload returned by `sendMessage` / `encodeWithdrawalData`.
9047
+ */
9048
+ getOnDemandRelayIdentity(tx: string): {
9049
+ srcTxHash: string;
9050
+ data: OnDemandRelayData;
9051
+ pollTxHash: string;
9052
+ };
8923
9053
  /**
8924
9054
  * Build a priority Bitcoin transaction with proper fee calculation
8925
9055
  */
8926
9056
  buildBitcoinTransaction(utxos: BitcoinUTXO[], outputs: Array<{
8927
9057
  address: string;
8928
9058
  value: number;
8929
- }>, changeAddress: string, chainId: BitcoinChainKey, walletProvider: IBitcoinWalletProvider, feeRate?: number): Promise<Psbt>;
9059
+ }>, changeAddress: string, chainId: BitcoinChainKey, walletProvider: IBitcoinWalletProvider, feeRate?: number, opReturnOutputVbytes?: number): Promise<Psbt>;
8930
9060
  /**
8931
9061
  * Deposit operation - transfer BTC to the asset manager
8932
9062
  */
@@ -8941,6 +9071,12 @@ declare class BitcoinSpokeService {
8941
9071
  * Fetch UTXOs for an address
8942
9072
  */
8943
9073
  fetchUTXOs(address: string): Promise<BitcoinUTXO[]>;
9074
+ /**
9075
+ * Returns the set of "txid:vout" outpoints currently being spent by
9076
+ * unconfirmed transactions in the mempool for the given address.
9077
+ * Used to prevent double-spend when building a new PSBT.
9078
+ */
9079
+ private fetchMempoolSpentOutpoints;
8944
9080
  /**
8945
9081
  * Fetch raw transaction hex
8946
9082
  */
@@ -8959,77 +9095,11 @@ declare class BitcoinSpokeService {
8959
9095
  waitForTransactionReceipt(params: WaitForTxReceiptParams<BitcoinChainKey>): Promise<Result<WaitForTxReceiptReturnType<BitcoinChainKey>>>;
8960
9096
  }
8961
9097
 
8962
- type RelayExtraData = {
8963
- address: Hex;
8964
- payload: Hex;
8965
- };
8966
- type IntentDeliveryInfo = {
8967
- srcChainKey: SpokeChainKey;
8968
- srcTxHash: string;
8969
- srcAddress: string;
8970
- dstChainKey: SpokeChainKey;
8971
- dstTxHash: string;
8972
- dstAddress: string;
8973
- };
8974
- type WaitUntilIntentExecutedPayload = {
8975
- intentRelayChainId: string;
8976
- srcTxHash: string;
8977
- timeout?: number;
8978
- apiUrl: HttpUrl;
8979
- };
8980
- type RelayAction = 'submit' | 'get_transaction_packets' | 'get_packet';
8981
- type IntentRelayRequest<T extends RelayAction> = {
8982
- action: T;
8983
- params: T extends 'submit' ? {
8984
- chain_id: string;
8985
- tx_hash: string;
8986
- data?: RelayExtraData;
8987
- } : T extends 'get_transaction_packets' ? {
8988
- chain_id: string;
8989
- tx_hash: string;
8990
- } : T extends 'get_packet' ? {
8991
- chain_id: string;
8992
- tx_hash: string;
8993
- conn_sn: string;
8994
- } : never;
8995
- };
8996
-
8997
- /**
8998
- * Types derived from Core SDK specific types
8999
- * NOTE: common (non Core SDK specific) types should be put in @sodax/types package
9000
- */
9001
- type HubProvider = EvmHubProvider;
9002
- type RateLimitConfig = {
9003
- maxAvailable: number;
9004
- ratePerSecond: number;
9005
- available: number;
9006
- };
9007
- /**
9008
- * Structural types
9009
- */
9010
- type OptionalRaw<R extends boolean> = {
9011
- raw?: R;
9012
- };
9013
- type OptionalSkipSimulation = {
9014
- skipSimulation?: boolean;
9015
- };
9016
- type OptionalTimeout = {
9017
- timeout?: number;
9018
- };
9019
- type TxHashPair = {
9020
- srcChainTxHash: string;
9021
- dstChainTxHash: string;
9022
- };
9023
- type IntentTxResult<K extends SpokeChainKey, Raw extends boolean> = {
9024
- tx: TxReturnType<K, Raw>;
9025
- relayData: RelayExtraData;
9026
- };
9027
-
9028
- type DestinationParamsType = RawDestinationParams;
9029
-
9030
9098
  type QueryResponse = string | number | boolean | object | undefined;
9031
9099
  type CallResponse = string | number | object | bigint | boolean;
9032
9100
  declare const NEAR_DEFAULT_GAS: bigint;
9101
+ /** NEP-141 default storage bond for a one-time `storage_deposit` registration (0.00125 NEAR). */
9102
+ declare const NEAR_STORAGE_DEPOSIT: bigint;
9033
9103
  declare class NearSpokeService {
9034
9104
  private readonly config;
9035
9105
  readonly rpcProvider: JsonRpcProvider;
@@ -9060,6 +9130,34 @@ declare class NearSpokeService {
9060
9130
  * @returns {Promise<bigint>} The balance of the token.
9061
9131
  */
9062
9132
  getDeposit(params: GetDepositParams<NearChainKey>): Promise<bigint>;
9133
+ /**
9134
+ * Whether `accountId` is storage-registered on a NEP-141 `token` contract. NEP-141 requires an
9135
+ * account to pay a one-time storage bond before it can receive (hold a balance of) the token, so
9136
+ * this gates any leg that delivers a token to a user on NEAR (swap output on NEAR, bridge into
9137
+ * NEAR, money-market borrow/withdraw to NEAR).
9138
+ *
9139
+ * Native NEAR is not a NEP-141 token and has no storage registration, so this returns `true` for
9140
+ * the native token. The view goes through {@link queryContract}, i.e. the configurable RPC from
9141
+ * chain config — a custom `rpcUrl` passed to the SDK is honoured.
9142
+ */
9143
+ isStorageRegistered(token: string, accountId: string): Promise<boolean>;
9144
+ /**
9145
+ * Build (and, unless `raw`, submit) a NEP-141 `storage_deposit` registration for `accountId` on
9146
+ * the `token` contract. Call this when {@link isStorageRegistered} is `false` before a token is
9147
+ * delivered to the account on NEAR.
9148
+ *
9149
+ * Native NEAR has no storage registration — passing the native token throws.
9150
+ *
9151
+ * @param params.deposit Storage bond to attach; defaults to {@link NEAR_STORAGE_DEPOSIT}
9152
+ * (0.00125 NEAR). Override per token if its `storage_balance_bounds.min` differs.
9153
+ */
9154
+ registerStorage<Raw extends boolean = false>(params: {
9155
+ token: string;
9156
+ accountId: string;
9157
+ walletProvider: INearWalletProvider;
9158
+ deposit?: bigint;
9159
+ raw?: Raw;
9160
+ }): Promise<TxReturnType<NearChainKey, Raw>>;
9063
9161
  /**
9064
9162
  * Sends a message to the hub chain.
9065
9163
  * @param {SendMessageParams} params - Includes dstChainKey, the chain key of the hub chain.
@@ -9634,10 +9732,11 @@ type GetRelayResponse<T extends RelayAction> = T extends 'submit' ? SubmitTxResp
9634
9732
  type IntentRelayRequestParams = SubmitTxParams | GetTransactionPacketsParams | GetPacketParams;
9635
9733
  type RelayAndWaitParams = {
9636
9734
  srcTxHash: string;
9637
- data: RelayExtraData;
9735
+ data: RelayExtraData | OnDemandRelayData;
9638
9736
  chainKey: SpokeChainKey;
9639
9737
  relayerApiEndpoint: HttpUrl;
9640
9738
  timeout: number | undefined;
9739
+ pollTxHash?: string;
9641
9740
  };
9642
9741
  /**
9643
9742
  * Submits a transaction to the intent relay service.
@@ -11539,6 +11638,20 @@ declare function isOptionalStellarWalletProviderType(walletProvider: IWalletProv
11539
11638
  declare function isUndefinedOrValidWalletProviderForChainKey<K extends SpokeChainKey>(chainKey: K, walletProvider: IWalletProvider | undefined): walletProvider is GetWalletProviderType<K> | undefined;
11540
11639
  declare function isOptionalBitcoinWalletProviderType(walletProvider: IWalletProvider | undefined): walletProvider is IBitcoinWalletProvider | undefined;
11541
11640
 
11641
+ /**
11642
+ * Default logger. Mirrors the SDK's historical `console.*` behavior so existing consumers
11643
+ * see no change when they don't pass a `logger`. `data` is appended only when present to keep
11644
+ * single-arg log lines unchanged.
11645
+ */
11646
+ declare const consoleLogger: SodaxLogger;
11647
+ /** No-op logger. Drops every SDK log line. Selected via `new Sodax({ logger: 'silent' })`. */
11648
+ declare const silentLogger: SodaxLogger;
11649
+ /**
11650
+ * Resolve a {@link SodaxLoggerOption} (a preset name, a custom logger, or `undefined`) into a
11651
+ * concrete {@link SodaxLogger}. Defaults to {@link consoleLogger} so logging is on unless opted out.
11652
+ */
11653
+ declare function resolveLogger(option: SodaxLoggerOption | undefined): SodaxLogger;
11654
+
11542
11655
  /** Swap-module narrow error types. */
11543
11656
 
11544
11657
  declare const swapInvariant: FeatureInvariant;
@@ -11780,7 +11893,7 @@ declare class SwapService {
11780
11893
  * - `raw: false` — broadcasts the transaction; `walletProvider` is required and must match `K`.
11781
11894
  *
11782
11895
  * Validates tokens and chain keys against the active `ConfigService` before constructing the
11783
- * intent. Bitcoin source chains require an additional RadFi access token step.
11896
+ * intent. Bitcoin source chains require an additional Bound Exchange access token step.
11784
11897
  *
11785
11898
  * @param _params - Intent parameters, source chain key, wallet provider (when `raw: false`),
11786
11899
  * and optional `skipSimulation` flag.
@@ -12818,7 +12931,7 @@ declare class BridgeService {
12818
12931
  * transaction simulation or batching). When `raw` is `false`, signs and submits the deposit
12819
12932
  * transaction via the provided wallet provider.
12820
12933
  *
12821
- * Bitcoin is only supported with `raw: false` because it requires the RadFi trading wallet
12934
+ * Bitcoin is only supported with `raw: false` because it requires the Bound Exchange trading wallet
12822
12935
  * derivation flow.
12823
12936
  *
12824
12937
  * @param _params - Bridge parameters including source/destination chain keys, token addresses,
@@ -15309,6 +15422,15 @@ declare class MoneyMarketService {
15309
15422
  * trigger the hub-side execution via {@link relayTxAndWaitPacket}.
15310
15423
  */
15311
15424
  createSupplyIntent<K extends SpokeChainKey, Raw extends boolean>(_params: MoneyMarketSupplyActionParams<K, Raw>): Promise<Result<IntentTxResult<K, Raw>, MoneyMarketCreateIntentError>>;
15425
+ /**
15426
+ * Build the relay submit/poll identity for a money-market borrow/withdraw.
15427
+ *
15428
+ * Bitcoin borrow/withdraw are on-demand: the spoke result is a signed payload JSON that the relay
15429
+ * submits under the literal "withdraw" tx_hash and tracks under a derived `od:<hash>` poll id
15430
+ * (see {@link BitcoinSpokeService.getOnDemandRelayIdentity}). Every other chain relays and polls by
15431
+ * its real spoke tx hash, so `pollTxHash` is undefined and `srcChainTxHash` stays the spoke tx.
15432
+ */
15433
+ private buildRelayIdentity;
15312
15434
  /**
15313
15435
  * Borrow tokens from the money market lending pool and wait for the cross-chain relay to
15314
15436
  * deliver the funds to the destination address.
@@ -15908,7 +16030,7 @@ declare class Sodax {
15908
16030
  readonly config: ConfigService;
15909
16031
  readonly hubProvider: HubProvider;
15910
16032
  readonly spoke: SpokeService;
15911
- constructor(config?: DeepPartial<SodaxConfig>);
16033
+ constructor(config?: SodaxOptions);
15912
16034
  /**
15913
16035
  * Initializes the Sodax instance with dynamic configuration.
15914
16036
  * You should use this option if you do not want to update package versions when new chains and tokens are added.
@@ -16222,7 +16344,7 @@ declare class SolverApiService {
16222
16344
  * @param config - Solver endpoint configuration.
16223
16345
  * @returns A `Result` containing `{ answer: 'OK', intent_hash: Hex }` on success.
16224
16346
  */
16225
- static postExecution(request: SolverExecutionRequest, config: SolverConfig): Promise<Result<SolverExecutionResponse, SolverErrorResponse>>;
16347
+ static postExecution(request: SolverExecutionRequest, config: SolverConfig, logger?: SodaxLogger): Promise<Result<SolverExecutionResponse, SolverErrorResponse>>;
16226
16348
  /**
16227
16349
  * Polls the solver API for the current execution status of an intent (`POST /status`).
16228
16350
  *
@@ -16232,7 +16354,7 @@ declare class SolverApiService {
16232
16354
  * `fill_tx_hash` is set only when `status === SolverIntentStatusCode.SOLVED (3)`.
16233
16355
  * @throws Invariant error if `intent_tx_hash` is empty (thrown before the async request).
16234
16356
  */
16235
- static getStatus(request: SolverIntentStatusRequest, config: SolverConfig): Promise<Result<SolverIntentStatusResponse, SolverErrorResponse>>;
16357
+ static getStatus(request: SolverIntentStatusRequest, config: SolverConfig, logger?: SodaxLogger): Promise<Result<SolverIntentStatusResponse, SolverErrorResponse>>;
16236
16358
  }
16237
16359
 
16238
16360
  /**
@@ -16465,4 +16587,4 @@ type DexErrorCode = LookupErrorCode;
16465
16587
  type DexError = SodaxError<DexErrorCode>;
16466
16588
  declare const isDexError: (e: unknown) => e is SodaxError<LookupErrorCode>;
16467
16589
 
16468
- export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, type AggregatedReserveData, type AllowanceCheckErrorCode, type AllowanceInfo, type AllowanceResponse, type AllowanceTransferDetails, type ApiResponse, type ApproveErrorCode, type ApyRange, type AssetDepositAction, type AssetEntry, AssetService, type AssetServiceConstructorParams, type AssetWithdrawAction, type AutoSwapPreferences, BackendApiService, type BalnLockParams, type BalnMigrateAction, type BalnMigrateParams, type BalnSwapAbi, BalnSwapService, type BalnSwapServiceConstructorParams, type BaseCurrencyInfo, BigIntToHex, type BigNumberValue, BigNumberZeroDecimal, BitcoinSpokeService, type BitcoinTransactionResult, type BitcoinUTXO, BnUSDMigrationService, type BnUSDMigrationServiceConstructorParams, type BnUSDRevertMigrationParams, type BorrowInfo, type BridgeAction, type BridgeAllowanceCheckError, type BridgeAllowanceCheckErrorCode, type BridgeApproveError, type BridgeApproveErrorCode, type BridgeCreateIntentError, type BridgeCreateIntentErrorCode, type BridgeError, type BridgeErrorCode, type BridgeLookupError, type BridgeLookupErrorCode, type BridgeOrchestrationError, type BridgeOrchestrationErrorCode, type BridgeParams, BridgeService, type BridgeServiceConstructorParams, type BtcPayload, CREATE_INTENT_CODES, type CalculateAllReserveIncentivesRequest, type CalculateAllUserIncentivesRequest, type CalculateCompoundedRateRequest, type CallResponse, type CancelIntentActionParams, type CancelIntentParams, type CancelUnstakeAction, type CancelUnstakeParams, type ClClaimRewardsParams, type ClDecreaseLiquidityParams, type ClGetPoolDataParams, type ClIncreaseLiquidityParams, type ClLiquidityClaimRewardsAction, type ClLiquidityDecreaseLiquidityAction, type ClLiquidityIncreaseLiquidityAction, type ClLiquidityWithdrawAction, type ClMintPositionEventLog, type ClPositionInfo, ClService, type ClServiceConstructorParams, type ClSupplyAction, type ClSupplyParams, type ClWithdrawParams, type ClaimAction, type ClaimParams, type CombinedReserveData, type ComputedUserReserve, type ConcentratedLiquidityParams, type ConcentratedLiquidityTokenInfo, ConfigService, type ConfigServiceConstructorParams, type ConnMsg, type CreateAssetDepositParams, type CreateAssetWithdrawParams, type CreateBridgeIntentParams, type CreateIntentErrorCode, type CreateIntentParams, type CreateIntentResult, type CreateLimitOrderParams, type CreateSonicSwapIntentParams, type CreateViemPublicClientParams, CustomSorobanServer, CustomStellarAccount, type DepositParams, type DepositSimulationParams, type DestinationParamsType, type DetailedLock, type DexError, type DexErrorCode, DexService, type DexServiceConstructorParams, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, type EnrichedToken, type Erc20ApproveParams, type Erc20IsAllowanceParams, Erc20Service, type Erc20Token, Erc4626Service, type EstimateGasParams, EvmAssetManagerService, type EvmDepositToDataParams, EvmHubProvider, type EvmHubProviderConstructorParams, EvmSolverService, EvmSpokeService, EvmVaultTokenService, type EvmWithdrawAssetDataParams, type ExecuteMsg, type FeatureInvariant, type FeeData, type FeeTokenApproveAction, type FeeTokenApproveParams, type FetchHubAssetBalancesParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, GAS_ESTIMATION_CODES, type GasEstimationErrorCode, type GetDepositParams, type GetIntentSubmitTxExtraDataParams, type GetPacketParams, type GetPacketResponse, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeServiceType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type GetTxReceiptType, type GetUserRouterParams, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, HttpRelayError, type HubAssetBalance, type HubProvider, type IconJsonRpcVersion, IconSpokeService, type IcxCreateRevertMigrationParams, type IcxMigrateAction, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRevertMigrationAction, type IcxRevertMigrationParams, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, type InjectiveBalance, InjectiveSpokeService, type InstantUnstakeAction, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapResult, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentData, IntentDataType, type IntentDeliveryInfo, IntentFilledEventAbi, type IntentFilledEventLog, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentTxResult, IntentsAbi, type JsonRpcPayloadResponse, LOOKUP_CODES, LTV_PRECISION, LendingPoolService, type LendingPoolServiceConstructorParams, type LimitOrderActionParams, LockupMultiplier, LockupPeriod, type LookupErrorCode, type MapRelayFailureCtx, type MigrateOrchestrationError, type MigrateOrchestrationErrorCode, type MigrationAction, type MigrationAllowanceCheckError, type MigrationAllowanceCheckErrorCode, type MigrationApproveError, type MigrationApproveErrorCode, type MigrationCreateIntentError, type MigrationCreateIntentErrorCode, type MigrationDirection, type MigrationError, type MigrationErrorCode, type MigrationLookupError, type MigrationLookupErrorCode, type MigrationOp, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConstructorParams, type MigrationTokens, MintPositionEventAbi, type MintPositionEventLog, type MoneyMarketAction, type MoneyMarketAllowanceCheckError, type MoneyMarketAllowanceCheckErrorCode, type MoneyMarketAllowanceParams, type MoneyMarketApproveActionParams, type MoneyMarketApproveError, type MoneyMarketApproveErrorCode, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowActionParams, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketCreateIntentError, type MoneyMarketCreateIntentErrorCode, MoneyMarketDataService, type MoneyMarketDataServiceConstructorParams, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketGasEstimationError, type MoneyMarketGasEstimationErrorCode, type MoneyMarketOrchestrationError, type MoneyMarketOrchestrationErrorCode, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayActionParams, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConstructorParams, type MoneyMarketSupplyActionParams, type MoneyMarketSupplyParams, type MoneyMarketWithdrawActionParams, type MoneyMarketWithdrawParams, NEAR_DEFAULT_GAS, NearSpokeService, type OnDemandBtcPayload, type OptionalRaw, type OptionalSkipSimulation, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerAction, type PartnerError, type PartnerErrorCode, type PartnerFeeClaimAssetBalance, PartnerFeeClaimService, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapAction, type PartnerFeeClaimSwapParams, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, Permit2Service, type PermitBatch, type PermitDetails, type PermitSingle, type PoolBaseCurrencyHumanized, type PoolData, type PoolRewardConfig, type PoolSpokeAssets, type PostExecutionError, type PostExecutionErrorCode, ProtocolIntentsAbi, type QueryMsg, type QueryResponse, RAY, RAY_DECIMALS, RELAY_ERROR_CODES, RadfiApiError, type RadfiAuthResult, type RadfiBuildTxResponse, type RadfiErrorBody, type RadfiMaxSpentResponse, RadfiProvider, type RadfiTradingWallet, type RadfiUtxo, type RadfiUtxoListResponse, type RadfiWalletBalance, type RateLimitConfig, type RawDestinationParams, type RecoveryAction, type RecoveryError, type RecoveryErrorCode, RecoveryService, type RecoveryServiceConstructorParams, type RelayAction, type RelayAndWaitParams, type RelayCode, type RelayErrorCode, type RelayExtraData, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayWrappedErrorCode, type RequestConfig, type RequestOverrideConfig, type RequestTrustlineParams, type ReserveCalculationData, type ReserveData, type ReserveDataHumanized, type ReserveDataLegacy, type ReserveDataWithPrice, type ReserveEMode, type ReserveIncentiveDict, type ReservesDataHumanized, type ReservesIncentiveDataHumanized, type ResponseAddressType, type ResponseSigningType, type RevertMigrationOrchestrationError, type RevertMigrationOrchestrationErrorCode, type RewardInfoHumanized, SECONDS_PER_YEAR, SODAX_ERROR_CODES, SODAX_FEATURES, type SendMessageParams, type SetSwapPreferenceAction, type SetSwapPreferenceParams, Sodax, SodaxError, type SodaxErrorCode, type SodaxErrorContext, type SodaxErrorJSON, type SodaxFeature, type SodaxPhase, SolanaSpokeService, SolverApiService, SonicSpokeService, type SpokeApproveParams, type SpokeApproveParamsEvmSpoke, type SpokeApproveParamsHub, type SpokeApproveParamsStellar, type SpokeIsAllowanceValidParams, type SpokeIsAllowanceValidParamsEvmSpoke, type SpokeIsAllowanceValidParamsHub, type SpokeIsAllowanceValidParamsOther, type SpokeIsAllowanceValidParamsStellar, SpokeService, type SpokeServiceConstructorParams, type SpokeServiceType, StacksSpokeService, type StakeAction, type StakeOrchestrationError, type StakeOrchestrationErrorCode, type StakeParams, type StakingActionType, type StakingActionUnion, type StakingAllowanceCheckError, type StakingAllowanceCheckErrorCode, type StakingApproveError, type StakingApproveErrorCode, type StakingConfig, type StakingCreateIntentError, type StakingCreateIntentErrorCode, type StakingError, type StakingErrorCode, type StakingInfo, type StakingInfoFetchError, type StakingInfoFetchErrorCode, StakingLogic, type StakingOrchestrationError, type StakingOrchestrationErrorCode, type StakingParamsUnion, StakingService, type StakingServiceConstructorParams, type State, StellarSpokeService, type SubmitTxParams, type SubmitTxResponse, SuiSpokeService, SupportedMigrationTokens, type SwapAction, type SwapActionParams, type SwapCreateIntentError, type SwapCreateIntentErrorCode, type SwapError, type SwapErrorCode, type SwapResponse, SwapService, type SwapServiceConstructorParams, type TokenSpenderPair, type TokenWithConversion, type TxHashPair, type TxStatus, USD_DECIMALS, type UiPoolDataProviderInterface, UiPoolDataProviderService, type UiPoolDataProviderServiceConstructorParams, type UnifiedBnUSDMigrateAction, type UnifiedBnUSDMigrateParams, type UnstakeAction, type UnstakeParams, type UnstakeRequest, type UnstakeRequestWithPenalty, type UnstakingInfo, type UserIncentiveData, type UserIncentiveDataHumanized, type UserIncentiveDict, type UserIntentsResponse, type UserReserveCalculationData, type UserReserveData, type UserReserveDataHumanized, type UserReserveDataString, type UserReservesIncentivesDataHumanized, type UserRewardInfoHumanized, type VerifySimulationParams, type VerifyTxHashParams, WAD, WAD_RAY_RATIO, WEI_DECIMALS, type WaitForTxReceiptParams, type WaitForTxReceiptReturnType, type WaitUntilIntentExecutedPayload, type WalletMode, type WalletSimulationParams, type WithdrawHubAssetAction, type WithdrawHubAssetParams, type WithdrawInfo, adjustAmountByFee, allowanceCheckFailed, approveFailed, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bridgeInvariant, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, connectionAbi, convertTransactionInstructionToRaw, createInvariant, deepMerge, defaultHookAbi, dexInvariant, encodeAddress, encodeBtcPayloadToBytes, encodeContractCalls, erc20Abi, erc4626Abi, estimateBitcoinTxSize, executionFailed, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, gasEstimationFailed, getAndFormatReserveEModes, getAssetManagerIdl, getAssetManagerProgram, getCompoundedBalance, getConnectionIdl, getConnectionProgram, getEvmViemChain, getIconAddressBytes, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getProvider, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getTransactionPackets, hexToBigInt, hexToSolanaAddress, hyper, intentCreationFailed, isBalnMigrateParams, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexError, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isHubChainKeyType, isIconAddress, isIconChainKeyType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveChainKeyType, isJsonRpcPayloadResponse, isMigrateOrchestrationError, isMigrationAllowanceCheckError, isMigrationApproveError, isMigrationCreateIntentError, isMigrationError, isMigrationLookupError, isMoneyMarketAllowanceCheckError, isMoneyMarketApproveError, isMoneyMarketCreateIntentError, isMoneyMarketError, isMoneyMarketGasEstimationError, isMoneyMarketOrchestrationError, isNearChainKeyType, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKeyType, isStellarWalletProviderType, isSubmitSwapTxResponse, isSubmitSwapTxStatusResponse, isSuiChainKeyType, isSwapCreateIntentError, isSwapError, isUndefinedOrValidWalletProviderForChainKey, isUnifiedBnUSDMigrateParams, lookupFailed, mapRelayFailure, mergeSodaxConfig, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, nativeToUSD, normalize, normalizeBN, normalizePsbtToBase64, normalizedToUsd, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, retry, reverseEncodeAddress, serializeAddressData, sleep, sodaxInvariant, sonicWalletFactoryAbi, spokeAssetManagerAbi, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, submitTransaction, swapExactInSingleParamsAbi, swapInvariant, uiPoolDataAbi, universalRouterAbi, unknownFailed, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
16590
+ export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, type AggregatedReserveData, type AllowanceCheckErrorCode, type AllowanceInfo, type AllowanceResponse, type AllowanceTransferDetails, type ApiResponse, type ApproveErrorCode, type ApyRange, type AssetDepositAction, type AssetEntry, AssetService, type AssetServiceConstructorParams, type AssetWithdrawAction, type AutoSwapPreferences, BackendApiService, type BalnLockParams, type BalnMigrateAction, type BalnMigrateParams, type BalnSwapAbi, BalnSwapService, type BalnSwapServiceConstructorParams, type BaseCurrencyInfo, BigIntToHex, type BigNumberValue, BigNumberZeroDecimal, BitcoinSpokeService, type BitcoinTransactionResult, type BitcoinUTXO, BnUSDMigrationService, type BnUSDMigrationServiceConstructorParams, type BnUSDRevertMigrationParams, type BorrowInfo, type BridgeAction, type BridgeAllowanceCheckError, type BridgeAllowanceCheckErrorCode, type BridgeApproveError, type BridgeApproveErrorCode, type BridgeCreateIntentError, type BridgeCreateIntentErrorCode, type BridgeError, type BridgeErrorCode, type BridgeLookupError, type BridgeLookupErrorCode, type BridgeOrchestrationError, type BridgeOrchestrationErrorCode, type BridgeParams, BridgeService, type BridgeServiceConstructorParams, type BtcPayload, CREATE_INTENT_CODES, type CalculateAllReserveIncentivesRequest, type CalculateAllUserIncentivesRequest, type CalculateCompoundedRateRequest, type CallResponse, type CancelIntentActionParams, type CancelIntentParams, type CancelUnstakeAction, type CancelUnstakeParams, type ClClaimRewardsParams, type ClDecreaseLiquidityParams, type ClGetPoolDataParams, type ClIncreaseLiquidityParams, type ClLiquidityClaimRewardsAction, type ClLiquidityDecreaseLiquidityAction, type ClLiquidityIncreaseLiquidityAction, type ClLiquidityWithdrawAction, type ClMintPositionEventLog, type ClPositionInfo, ClService, type ClServiceConstructorParams, type ClSupplyAction, type ClSupplyParams, type ClWithdrawParams, type ClaimAction, type ClaimParams, type CombinedReserveData, type ComputedUserReserve, type ConcentratedLiquidityParams, type ConcentratedLiquidityTokenInfo, ConfigService, type ConfigServiceConstructorParams, type ConnMsg, type CreateAssetDepositParams, type CreateAssetWithdrawParams, type CreateBridgeIntentParams, type CreateIntentErrorCode, type CreateIntentParams, type CreateIntentResult, type CreateLimitOrderParams, type CreateSonicSwapIntentParams, type CreateViemPublicClientParams, CustomSorobanServer, CustomStellarAccount, type DepositParams, type DepositSimulationParams, type DestinationParamsType, type DetailedLock, type DexError, type DexErrorCode, DexService, type DexServiceConstructorParams, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, type EnrichedToken, type Erc20ApproveParams, type Erc20IsAllowanceParams, Erc20Service, type Erc20Token, Erc4626Service, type EstimateGasParams, EvmAssetManagerService, type EvmDepositToDataParams, EvmHubProvider, type EvmHubProviderConstructorParams, EvmSolverService, EvmSpokeService, EvmVaultTokenService, type EvmWithdrawAssetDataParams, type ExecuteMsg, type FeatureInvariant, type FeeData, type FeeTokenApproveAction, type FeeTokenApproveParams, type FetchHubAssetBalancesParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, GAS_ESTIMATION_CODES, type GasEstimationErrorCode, type GetDepositParams, type GetIntentSubmitTxExtraDataParams, type GetPacketParams, type GetPacketResponse, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeServiceType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type GetTxReceiptType, type GetUserRouterParams, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, HttpRelayError, type HubAssetBalance, type HubProvider, type IconJsonRpcVersion, IconSpokeService, type IcxCreateRevertMigrationParams, type IcxMigrateAction, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRevertMigrationAction, type IcxRevertMigrationParams, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, type InjectiveBalance, InjectiveSpokeService, type InstantUnstakeAction, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapResult, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentData, IntentDataType, type IntentDeliveryInfo, IntentFilledEventAbi, type IntentFilledEventLog, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentTxResult, IntentsAbi, type JsonRpcPayloadResponse, LOOKUP_CODES, LTV_PRECISION, LendingPoolService, type LendingPoolServiceConstructorParams, type LimitOrderActionParams, LockupMultiplier, LockupPeriod, type LookupErrorCode, type MapRelayFailureCtx, type MigrateOrchestrationError, type MigrateOrchestrationErrorCode, type MigrationAction, type MigrationAllowanceCheckError, type MigrationAllowanceCheckErrorCode, type MigrationApproveError, type MigrationApproveErrorCode, type MigrationCreateIntentError, type MigrationCreateIntentErrorCode, type MigrationDirection, type MigrationError, type MigrationErrorCode, type MigrationLookupError, type MigrationLookupErrorCode, type MigrationOp, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConstructorParams, type MigrationTokens, MintPositionEventAbi, type MintPositionEventLog, type MoneyMarketAction, type MoneyMarketAllowanceCheckError, type MoneyMarketAllowanceCheckErrorCode, type MoneyMarketAllowanceParams, type MoneyMarketApproveActionParams, type MoneyMarketApproveError, type MoneyMarketApproveErrorCode, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowActionParams, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketCreateIntentError, type MoneyMarketCreateIntentErrorCode, MoneyMarketDataService, type MoneyMarketDataServiceConstructorParams, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketGasEstimationError, type MoneyMarketGasEstimationErrorCode, type MoneyMarketOrchestrationError, type MoneyMarketOrchestrationErrorCode, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayActionParams, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConstructorParams, type MoneyMarketSupplyActionParams, type MoneyMarketSupplyParams, type MoneyMarketWithdrawActionParams, type MoneyMarketWithdrawParams, NEAR_DEFAULT_GAS, NEAR_STORAGE_DEPOSIT, NearSpokeService, type OnDemandBtcPayload, type OnDemandRelayData, type OptionalRaw, type OptionalSkipSimulation, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerAction, type PartnerError, type PartnerErrorCode, type PartnerFeeClaimAssetBalance, PartnerFeeClaimService, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapAction, type PartnerFeeClaimSwapParams, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, Permit2Service, type PermitBatch, type PermitDetails, type PermitSingle, type PoolBaseCurrencyHumanized, type PoolData, type PoolRewardConfig, type PoolSpokeAssets, type PostExecutionError, type PostExecutionErrorCode, ProtocolIntentsAbi, type QueryMsg, type QueryResponse, RAY, RAY_DECIMALS, RELAY_ERROR_CODES, RadfiApiError, type RadfiAuthResult, type RadfiBuildTxResponse, type RadfiErrorBody, type RadfiMaxSpentResponse, RadfiProvider, type RadfiTradingWallet, type RadfiUtxo, type RadfiUtxoListResponse, type RadfiWalletBalance, type RateLimitConfig, type RawDestinationParams, type RecoveryAction, type RecoveryError, type RecoveryErrorCode, RecoveryService, type RecoveryServiceConstructorParams, type RelayAction, type RelayAndWaitParams, type RelayCode, type RelayErrorCode, type RelayExtraData, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayWrappedErrorCode, type RequestConfig, type RequestOverrideConfig, type RequestTrustlineParams, type ReserveCalculationData, type ReserveData, type ReserveDataHumanized, type ReserveDataLegacy, type ReserveDataWithPrice, type ReserveEMode, type ReserveIncentiveDict, type ReservesDataHumanized, type ReservesIncentiveDataHumanized, type ResponseAddressType, type ResponseSigningType, type RevertMigrationOrchestrationError, type RevertMigrationOrchestrationErrorCode, type RewardInfoHumanized, SECONDS_PER_YEAR, SODAX_ERROR_CODES, SODAX_FEATURES, type SendMessageParams, type SetSwapPreferenceAction, type SetSwapPreferenceParams, Sodax, SodaxError, type SodaxErrorCode, type SodaxErrorContext, type SodaxErrorJSON, type SodaxFeature, type SodaxPhase, SolanaSpokeService, SolverApiService, SonicSpokeService, type SpokeApproveParams, type SpokeApproveParamsEvmSpoke, type SpokeApproveParamsHub, type SpokeApproveParamsStellar, type SpokeIsAllowanceValidParams, type SpokeIsAllowanceValidParamsEvmSpoke, type SpokeIsAllowanceValidParamsHub, type SpokeIsAllowanceValidParamsOther, type SpokeIsAllowanceValidParamsStellar, SpokeService, type SpokeServiceConstructorParams, type SpokeServiceType, StacksSpokeService, type StakeAction, type StakeOrchestrationError, type StakeOrchestrationErrorCode, type StakeParams, type StakingActionType, type StakingActionUnion, type StakingAllowanceCheckError, type StakingAllowanceCheckErrorCode, type StakingApproveError, type StakingApproveErrorCode, type StakingConfig, type StakingCreateIntentError, type StakingCreateIntentErrorCode, type StakingError, type StakingErrorCode, type StakingInfo, type StakingInfoFetchError, type StakingInfoFetchErrorCode, StakingLogic, type StakingOrchestrationError, type StakingOrchestrationErrorCode, type StakingParamsUnion, StakingService, type StakingServiceConstructorParams, type State, StellarSpokeService, type SubmitTxParams, type SubmitTxResponse, SuiSpokeService, SupportedMigrationTokens, type SwapAction, type SwapActionParams, type SwapCreateIntentError, type SwapCreateIntentErrorCode, type SwapError, type SwapErrorCode, type SwapResponse, SwapService, type SwapServiceConstructorParams, type TokenSpenderPair, type TokenWithConversion, type TxHashPair, type TxStatus, USD_DECIMALS, type UiPoolDataProviderInterface, UiPoolDataProviderService, type UiPoolDataProviderServiceConstructorParams, type UnifiedBnUSDMigrateAction, type UnifiedBnUSDMigrateParams, type UnstakeAction, type UnstakeParams, type UnstakeRequest, type UnstakeRequestWithPenalty, type UnstakingInfo, type UserIncentiveData, type UserIncentiveDataHumanized, type UserIncentiveDict, type UserIntentsResponse, type UserReserveCalculationData, type UserReserveData, type UserReserveDataHumanized, type UserReserveDataString, type UserReservesIncentivesDataHumanized, type UserRewardInfoHumanized, type VerifySimulationParams, type VerifyTxHashParams, WAD, WAD_RAY_RATIO, WEI_DECIMALS, type WaitForTxReceiptParams, type WaitForTxReceiptReturnType, type WaitUntilIntentExecutedPayload, type WalletMode, type WalletSimulationParams, type WithdrawHubAssetAction, type WithdrawHubAssetParams, type WithdrawInfo, adjustAmountByFee, allowanceCheckFailed, approveFailed, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bridgeInvariant, calcOpReturnOutputVbytes, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, connectionAbi, consoleLogger, convertTransactionInstructionToRaw, createInvariant, deepMerge, defaultHookAbi, dexInvariant, encodeAddress, encodeBtcPayloadToBytes, encodeContractCalls, erc20Abi, erc4626Abi, estimateBitcoinTxSize, executionFailed, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, gasEstimationFailed, getAndFormatReserveEModes, getAssetManagerIdl, getAssetManagerProgram, getCompoundedBalance, getConnectionIdl, getConnectionProgram, getEvmViemChain, getIconAddressBytes, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getProvider, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getTransactionPackets, hexToBigInt, hexToSolanaAddress, hyper, intentCreationFailed, isBalnMigrateParams, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexError, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isHubChainKeyType, isIconAddress, isIconChainKeyType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveChainKeyType, isJsonRpcPayloadResponse, isMigrateOrchestrationError, isMigrationAllowanceCheckError, isMigrationApproveError, isMigrationCreateIntentError, isMigrationError, isMigrationLookupError, isMoneyMarketAllowanceCheckError, isMoneyMarketApproveError, isMoneyMarketCreateIntentError, isMoneyMarketError, isMoneyMarketGasEstimationError, isMoneyMarketOrchestrationError, isNearChainKeyType, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKeyType, isStellarWalletProviderType, isSubmitSwapTxResponse, isSubmitSwapTxStatusResponse, isSuiChainKeyType, isSwapCreateIntentError, isSwapError, isUndefinedOrValidWalletProviderForChainKey, isUnifiedBnUSDMigrateParams, lookupFailed, mapRelayFailure, mergeSodaxConfig, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, nativeToUSD, normalize, normalizeBN, normalizePsbtToBase64, normalizeSignatureToBase64, normalizedToUsd, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, resolveLogger, retry, reverseEncodeAddress, serializeAddressData, silentLogger, sleep, sodaxInvariant, sonicWalletFactoryAbi, spokeAssetManagerAbi, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, submitTransaction, swapExactInSingleParamsAbi, swapInvariant, uiPoolDataAbi, universalRouterAbi, unknownFailed, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };