@imtbl/sdk 0.1.4-alpha → 0.1.5-alpha

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.ts CHANGED
@@ -10360,7 +10360,7 @@ declare class ImmutableXClient {
10360
10360
  getDeposit(request: DepositsApiGetDepositRequest): Promise<Deposit>;
10361
10361
  /**
10362
10362
  * Get a list of Deposits
10363
- * @param request - optional request object containing the parameters to be provided in the API request
10363
+ * @param request - optional object containing the parameters to be provided in the API request
10364
10364
  * @returns a promise that resolves with the requested list of Deposits
10365
10365
  * @throws {@link index.IMXError}
10366
10366
  */
@@ -10381,7 +10381,7 @@ declare class ImmutableXClient {
10381
10381
  getAsset(request: AssetsApiGetAssetRequest): Promise<Asset>;
10382
10382
  /**
10383
10383
  * Get a list of Assets
10384
- * @param request - optional request object containing the parameters to be provided in the API request
10384
+ * @param request - optional object containing the parameters to be provided in the API request
10385
10385
  * @returns a promise that resolves with the requested list of Assets
10386
10386
  * @throws {@link index.IMXError}
10387
10387
  */
@@ -10410,7 +10410,7 @@ declare class ImmutableXClient {
10410
10410
  listCollectionFilters(request: CollectionsApiListCollectionFiltersRequest): Promise<CollectionFilter>;
10411
10411
  /**
10412
10412
  * Get a list of Collections
10413
- * @param request - optional request object containing the parameters to be provided in the API request
10413
+ * @param request - optional object containing the parameters to be provided in the API request
10414
10414
  * @returns a promise that resolves with the requested list of Collections
10415
10415
  * @throws {@link index.IMXError}
10416
10416
  */
@@ -10536,7 +10536,7 @@ declare class ImmutableXClient {
10536
10536
  getMint(request: MintsApiGetMintRequest): Promise<Mint[]>;
10537
10537
  /**
10538
10538
  * Get a list of Mints
10539
- * @param request optional request object containing the parameters to be provided in the API request
10539
+ * @param request optional object containing the parameters to be provided in the API request
10540
10540
  * @returns a promise that resolves with the requested list of Mints
10541
10541
  * @throws {@link index.IMXError}
10542
10542
  */
@@ -10551,7 +10551,7 @@ declare class ImmutableXClient {
10551
10551
  mint(ethSigner: Signer, request: UnsignedMintRequest): Promise<MintTokensResponse>;
10552
10552
  /**
10553
10553
  * Get a list of Withdrawals
10554
- * @param request - optional request object containing the parameters to be provided in the API request
10554
+ * @param request - optional object containing the parameters to be provided in the API request
10555
10555
  * @returns a promise that resolves with the requested list of Withdrawals
10556
10556
  * @throws {@link index.IMXError}
10557
10557
  */
@@ -10572,7 +10572,7 @@ declare class ImmutableXClient {
10572
10572
  getOrder(request: OrdersApiGetOrderRequest): Promise<Order>;
10573
10573
  /**
10574
10574
  * Get a list of Orders
10575
- * @param request - optional request object containing the parameters to be provided in the API request
10575
+ * @param request - optional object containing the parameters to be provided in the API request
10576
10576
  * @returns a promise that resolves with the requested list of Orders
10577
10577
  * @throws {@link index.IMXError}
10578
10578
  */
@@ -10586,7 +10586,7 @@ declare class ImmutableXClient {
10586
10586
  getTrade(request: TradesApiGetTradeRequest): Promise<Trade>;
10587
10587
  /**
10588
10588
  * Get a list of Trades
10589
- * @param request - optional request object containing the parameters to be provided in the API request
10589
+ * @param request - optional object containing the parameters to be provided in the API request
10590
10590
  * @returns a promise that resolves with the requested list of Trades
10591
10591
  * @throws {@link index.IMXError}
10592
10592
  */
@@ -10600,7 +10600,7 @@ declare class ImmutableXClient {
10600
10600
  getToken(request: TokensApiGetTokenRequest): Promise<TokenDetails>;
10601
10601
  /**
10602
10602
  * Get a list of Tokens
10603
- * @param request - optional request object containing the parameters to be provided in the API request
10603
+ * @param request - optional object containing the parameters to be provided in the API request
10604
10604
  * @returns a promise that resolves with the requested list of Tokens
10605
10605
  * @throws {@link index.IMXError}
10606
10606
  */
@@ -10614,7 +10614,7 @@ declare class ImmutableXClient {
10614
10614
  getTransfer(request: TransfersApiGetTransferRequest): Promise<Transfer>;
10615
10615
  /**
10616
10616
  * Get a list of Transfers
10617
- * @param request - optional request object containing the parameters to be provided in the API request
10617
+ * @param request - optional object containing the parameters to be provided in the API request
10618
10618
  * @returns a promise that resolves with the requested list of Transfers
10619
10619
  * @throws {@link index.IMXError}
10620
10620
  */
@@ -10888,7 +10888,7 @@ interface TokenInfo {
10888
10888
  */
10889
10889
  interface GetTokenAllowListParams {
10890
10890
  type: TokenFilterTypes;
10891
- chainId: ChainId;
10891
+ chainId?: ChainId;
10892
10892
  exclude?: TokenFilter[];
10893
10893
  }
10894
10894
  /**
@@ -11146,6 +11146,57 @@ declare enum WalletFilterTypes {
11146
11146
  DESKTOP = "desktop",
11147
11147
  MOBILE = "mobile"
11148
11148
  }
11149
+ /**
11150
+ * Enum representing the types of token filters available.
11151
+ */
11152
+ declare enum SupportedFiatCurrencies {
11153
+ USD = "USD"
11154
+ }
11155
+ /**
11156
+ * Interface representing the parameters for {@link Checkout.convertTokenToFiat}.
11157
+ * @property {BigNumber} amount - The the amount of token we are converting.
11158
+ * @property {TokenInfo} token - The token we are converting from.
11159
+ * @property {SupportedFiatCurrencies} fiatSymbol - The fiat currency we are converting to.
11160
+ */
11161
+ interface ConvertTokensToFiatParams {
11162
+ amounts: {
11163
+ [key: string]: {
11164
+ amount: BigNumber;
11165
+ token: TokenInfo;
11166
+ };
11167
+ };
11168
+ fiatSymbol: SupportedFiatCurrencies;
11169
+ }
11170
+ /**
11171
+ * Interface representing the result of a specific token to fiat conversion.
11172
+ * @property {TokenInfo} token - The token that we converted from.
11173
+ * @property {string} fiatSymbol - The fiat currency we converted to.
11174
+ * @property {number} quotedAt - The unix timestamp for when the quote was generated.
11175
+ * @property {number} quote - The quote at the given timestamp.
11176
+ * @property {BigNumber} amount - The amount we converted.
11177
+ * @property {number} convertedAmount - The converted amount.
11178
+ */
11179
+ interface TokenToFiatConversionResult extends FiatConversionQuote {
11180
+ token: TokenInfo;
11181
+ fiatSymbol: string;
11182
+ amount: BigNumber;
11183
+ convertedAmount: number;
11184
+ }
11185
+ /**
11186
+ * Interface representing the result of {@link Checkout.convertTokenToFiat}.
11187
+ */
11188
+ interface ConvertTokensToFiatResult {
11189
+ [key: string]: TokenToFiatConversionResult;
11190
+ }
11191
+ /**
11192
+ * Interface representing the result of a specific token to fiat conversion.
11193
+ * @property {number} quotedAt - The unix timestamp for when the quote was generated.
11194
+ * @property {number} quote - The quote at the given timestamp.
11195
+ */
11196
+ interface FiatConversionQuote {
11197
+ quote: number;
11198
+ quotedAt: number;
11199
+ }
11149
11200
  /**
11150
11201
  * The different types of errors that can be returned by the checkout process.
11151
11202
  */
@@ -11160,7 +11211,10 @@ declare enum CheckoutErrorType {
11160
11211
  PROVIDER_REQUEST_MISSING_ERROR = "PROVIDER_REQUEST_MISSING_ERROR",
11161
11212
  PROVIDER_REQUEST_FAILED_ERROR = "PROVIDER_REQUEST_FAILED_ERROR",
11162
11213
  USER_REJECTED_REQUEST_ERROR = "USER_REJECTED_REQUEST_ERROR",
11163
- TRANSACTION_ERROR = "TRANSACTION_ERROR"
11214
+ TRANSACTION_ERROR = "TRANSACTION_ERROR",
11215
+ FIAT_CONVERSION_ERROR = "FIAT_CONVERSION_ERROR",
11216
+ TOKEN_NOT_SUPPORTED_ERROR = "TOKEN_NOT_SUPPORTED_ERROR",
11217
+ FIAT_CURRENCY_NOT_SUPPORTED_ERROR = "FIAT_CURRENCY_NOT_SUPPORTED_ERROR"
11164
11218
  }
11165
11219
  /**
11166
11220
  * The type signature for an error.
@@ -25696,5 +25750,56 @@ declare enum WidgetTheme {
25696
25750
  DARK = "dark",
25697
25751
  CUSTOM = "custom"
25698
25752
  }
25699
-
25700
- export { BridgeEvent, BridgeEventType, BridgeFailed, BridgeSuccess, BuyClose, BuyEvent, BuyEventType, BuyFailed, BuyNotConnected, BuySuccess, ChainId, CheckConnectionParams, CheckConnectionResult, Checkout, CheckoutErrorType, ConnectEvent, ConnectEventType, ConnectParams, ConnectResult, ConnectionFailed, ConnectionProviders, ConnectionSuccess, Environment, ErrorType, GenericIMXProvider, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetNetworkAllowListParams, GetNetworkAllowListResult, GetNetworkParams, GetTokenAllowListParams, GetTokenAllowListResult, GetWalletAllowListParams, GetWalletAllowListResult, IMTBLWidgetEvents, IMXProvider, ImmutableConfiguration, ImmutableXClient, ImtblBridgeProps, ImtblBuyProps, ImtblConnectProps, ImtblExampleProps, ImtblInnerWidgetExampleProps, ImtblOuterWidgetExampleProps, ImtblSwapProps, ImtblTransitionExampleProps, ImtblWalletProps, ImxModuleConfiguration as ImxClientModuleConfiguration, WalletConnection as ImxClientWalletConnection, MetaMaskIMXProvider, ModuleConfiguration, Network, NetworkFilter, NetworkFilterTypes, NetworkInfo, Passport, PassportError, PassportModuleConfiguration, ProviderConfiguration, SendTransactionParams, SendTransactionResult, SwapEvent, SwapEventType, SwapFailed, SwapSuccess, SwitchNetworkParams, SwitchNetworkResult, TokenFilter, TokenFilterTypes, TokenInfo, Transaction, WalletEvent, WalletEventType, WalletFilter, WalletFilterTypes, WalletInfo, WalletNetworkSwitchEvent, WidgetTheme, createStarkSigner as imxClientCreateStarkSigner, generateLegacyStarkPrivateKey as imxClientGenerateLegacyStarkPrivateKey };
25753
+ declare enum WidgetConnectionProviders {
25754
+ METAMASK = "metamask"
25755
+ }
25756
+ declare enum CheckoutWidgetTagNames {
25757
+ CONNECT = "imtbl-connect",
25758
+ WALLET = "imtbl-wallet",
25759
+ SWAP = "imtbl-swap",
25760
+ BUY = "imtbl-buy",
25761
+ BRIDGE = "imtbl-bridge",
25762
+ EXAMPLe = "imtbl-example"
25763
+ }
25764
+ type CheckoutWidgetsConfig = {
25765
+ theme?: WidgetTheme;
25766
+ };
25767
+ interface BridgeReactProps {
25768
+ providerPreference: WidgetConnectionProviders;
25769
+ fromContractAddress?: string;
25770
+ amount?: string;
25771
+ fromNetwork?: Network;
25772
+ }
25773
+ declare function BridgeReact(props: BridgeReactProps): JSX.Element;
25774
+ interface BuyReactProps {
25775
+ providerPreference: WidgetConnectionProviders;
25776
+ orderId: string;
25777
+ }
25778
+ declare function BuyReact(props: BuyReactProps): JSX.Element;
25779
+ declare function CheckoutWidgets(config?: CheckoutWidgetsConfig): void;
25780
+ declare function UpdateConfig(config: CheckoutWidgetsConfig): void;
25781
+ declare function SetProvider(tagName: CheckoutWidgetTagNames, provider: Web3Provider | null): void;
25782
+ interface ConnectReactProps {
25783
+ providerPreference?: WidgetConnectionProviders;
25784
+ }
25785
+ declare function ConnectReact(props: ConnectReactProps): JSX.Element;
25786
+ interface SwapReactProps {
25787
+ providerPreference: WidgetConnectionProviders;
25788
+ fromContractAddress?: string;
25789
+ amount?: string;
25790
+ toContractAddress?: string;
25791
+ }
25792
+ declare function SwapReact(props: SwapReactProps): JSX.Element;
25793
+ interface WalletReactProps {
25794
+ providerPreference?: WidgetConnectionProviders;
25795
+ }
25796
+ declare function WalletReact(props: WalletReactProps): JSX.Element;
25797
+ interface ExampleReactProps {
25798
+ providerPreference: WidgetConnectionProviders;
25799
+ fromContractAddress?: string;
25800
+ amount?: string;
25801
+ fromNetwork?: Network;
25802
+ }
25803
+ declare function ExampleReact(props: ExampleReactProps): JSX.Element;
25804
+
25805
+ export { BridgeEvent, BridgeEventType, BridgeFailed, BridgeReact, BridgeReactProps, BridgeSuccess, BuyClose, BuyEvent, BuyEventType, BuyFailed, BuyNotConnected, BuyReact, BuyReactProps, BuySuccess, ChainId, CheckConnectionParams, CheckConnectionResult, Checkout, CheckoutErrorType, CheckoutWidgetTagNames, CheckoutWidgets, CheckoutWidgetsConfig, ConnectEvent, ConnectEventType, ConnectParams, ConnectReact, ConnectReactProps, ConnectResult, ConnectionFailed, ConnectionProviders, ConnectionSuccess, ConvertTokensToFiatParams, ConvertTokensToFiatResult, Environment, ErrorType, ExampleReact, ExampleReactProps, GenericIMXProvider, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetNetworkAllowListParams, GetNetworkAllowListResult, GetNetworkParams, GetTokenAllowListParams, GetTokenAllowListResult, GetWalletAllowListParams, GetWalletAllowListResult, IMTBLWidgetEvents, IMXProvider, ImmutableConfiguration, ImmutableXClient, ImtblBridgeProps, ImtblBuyProps, ImtblConnectProps, ImtblExampleProps, ImtblInnerWidgetExampleProps, ImtblOuterWidgetExampleProps, ImtblSwapProps, ImtblTransitionExampleProps, ImtblWalletProps, ImxModuleConfiguration as ImxClientModuleConfiguration, WalletConnection as ImxClientWalletConnection, MetaMaskIMXProvider, ModuleConfiguration, Network, NetworkFilter, NetworkFilterTypes, NetworkInfo, Passport, PassportError, PassportModuleConfiguration, ProviderConfiguration, SendTransactionParams, SendTransactionResult, SetProvider, SupportedFiatCurrencies, SwapEvent, SwapEventType, SwapFailed, SwapReact, SwapReactProps, SwapSuccess, SwitchNetworkParams, SwitchNetworkResult, TokenFilter, TokenFilterTypes, TokenInfo, TokenToFiatConversionResult, Transaction, UpdateConfig, WalletEvent, WalletEventType, WalletFilter, WalletFilterTypes, WalletInfo, WalletNetworkSwitchEvent, WalletReact, WalletReactProps, WidgetConnectionProviders, WidgetTheme, createStarkSigner as imxClientCreateStarkSigner, generateLegacyStarkPrivateKey as imxClientGenerateLegacyStarkPrivateKey };