@imtbl/sdk 0.35.8 → 0.36.1

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.
@@ -11668,6 +11668,26 @@ interface CheckConnectionResult {
11668
11668
  walletAddress: string;
11669
11669
  }
11670
11670
 
11671
+ /**
11672
+ * @typedef {Object} BridgeFeeResponse
11673
+ * @property {ethers.BigNumber} sourceChainGas - Gas cost to send tokens to the bridge contract on the source chain.
11674
+ * - priced in the source chain's native token.
11675
+ * @property {ethers.BigNumber} bridgeFee - destinationChainGas + validatorFee.
11676
+ * This will be added to the tx.value of the bridge transaction and forwarded to the Axelar Gas Service contract.
11677
+ * - priced in the source chain's native token.
11678
+ * @property {ethers.BigNumber} imtblFee - The fee charged by Immutable to facilitate the bridge.
11679
+ * - priced in the source chain's native token.
11680
+ * @property {ethers.BigNumber} totalFees - The total fees the user will be charged which is;
11681
+ * sourceChainGas + bridgeFee + imtblFee.
11682
+ * - priced in the source chain's native token.
11683
+ */
11684
+ interface BridgeFeeResponse {
11685
+ sourceChainGas: BigNumber;
11686
+ bridgeFee: BigNumber;
11687
+ imtblFee: BigNumber;
11688
+ totalFees: BigNumber;
11689
+ }
11690
+
11671
11691
  /**
11672
11692
  * An enum representing the type of gas estimate.
11673
11693
  * @enum {string}
@@ -11687,11 +11707,9 @@ type GasEstimateParams = GasEstimateBridgeToL2Params | GasEstimateSwapParams;
11687
11707
  /**
11688
11708
  * An interface representing the parameters for estimating gas for a bridge to L2 transaction {@link Checkout.gasEstimate}.
11689
11709
  * @param {GasEstimateType.BRIDGE_TO_L2} gasEstimateType - The type of gas estimate.
11690
- * @param {boolean} isSpendingCapApprovalRequired - Whether or not spending cap approval is required.
11691
11710
  */
11692
11711
  interface GasEstimateBridgeToL2Params {
11693
11712
  gasEstimateType: GasEstimateType.BRIDGE_TO_L2;
11694
- isSpendingCapApprovalRequired: boolean;
11695
11713
  }
11696
11714
  /**
11697
11715
  * An interface representing the parameters for a gas estimate swap {@link Checkout.gasEstimate}.
@@ -11705,28 +11723,31 @@ interface GasEstimateSwapParams {
11705
11723
  * An interface representing the result of a gas estimate for a swap transaction {@link Checkout.gasEstimate}.
11706
11724
  * @interface GasEstimateSwapResult
11707
11725
  * @property {GasEstimateType.SWAP} gasEstimateType - The type of gas estimate, which is always "SWAP".
11708
- * @property {TokenAmountEstimate} gasFee - The estimated gas fee for the swap transaction.
11726
+ * @property {TokenAmountEstimate} fees - The estimated gas fee for the swap transaction.
11709
11727
  */
11710
11728
  interface GasEstimateSwapResult {
11711
11729
  gasEstimateType: GasEstimateType.SWAP;
11712
- gasFee: TokenAmountEstimate;
11730
+ fees: TokenAmountEstimate;
11713
11731
  }
11714
11732
  /**
11715
11733
  * An interface representing the result of a gas estimate for a bridge to L2 transaction {@link Checkout.gasEstimate}.
11716
11734
  * @interface GasEstimateBridgeToL2Result
11717
11735
  * @property {GasEstimateType.BRIDGE_TO_L2} gasEstimateType - The type of gas estimate.
11718
- * @property {TokenAmountEstimate} gasFee - The estimated gas fee for the transaction.
11719
- * @property {TokenAmountEstimate} bridgeFee - The estimated bridge fee for the transaction.
11720
- * @property {boolean} bridgeable - A boolean indicating whether the transaction is bridgeable.
11736
+ * @property {BridgeFeeResponse} fees - The estimated fees for the transaction.
11737
+ * @property {TokenInfo | undefined} token - The gas token information.
11721
11738
  */
11722
11739
  interface GasEstimateBridgeToL2Result {
11723
11740
  gasEstimateType: GasEstimateType.BRIDGE_TO_L2;
11724
- gasFee: TokenAmountEstimate;
11725
- bridgeFee: TokenAmountEstimate;
11726
- bridgeable: boolean;
11741
+ fees: BridgeFeeResponse;
11742
+ token?: TokenInfo;
11727
11743
  }
11744
+ /**
11745
+ * An interface representing the estimated fees.
11746
+ * @property {BigNumber | undefined} totalFees - The estimated fees for the transaction.
11747
+ * @property {TokenInfo | undefined} token - The gas token information.
11748
+ */
11728
11749
  interface TokenAmountEstimate {
11729
- estimatedAmount?: BigNumber;
11750
+ totalFees?: BigNumber;
11730
11751
  token?: TokenInfo;
11731
11752
  }
11732
11753
 
@@ -12210,14 +12231,14 @@ type SaleTransactionSuccess = {
12210
12231
  */
12211
12232
  declare enum BridgeEventType {
12212
12233
  CLOSE_WIDGET = "close-widget",
12213
- SUCCESS = "success",
12214
- FAILURE = "failure"
12234
+ FAILURE = "failure",
12235
+ TRANSACTION_SENT = "transaction-sent"
12215
12236
  }
12216
12237
  /**
12217
12238
  * Represents a successful bridge transaction.
12218
12239
  * @property {string} transactionHash
12219
12240
  */
12220
- type BridgeSuccess = {
12241
+ type BridgeTransactionSent = {
12221
12242
  /** The hash of the successful transaction. */
12222
12243
  transactionHash: string;
12223
12244
  };
@@ -12333,13 +12354,13 @@ type ConnectWidgetParams = {};
12333
12354
 
12334
12355
  /**
12335
12356
  * Bridge Widget parameters
12336
- * @property {string | undefined} fromContractAddress
12357
+ * @property {string | undefined} contractAddress
12337
12358
  * @property {string | undefined} amount
12338
12359
  * @property {WalletProviderName | undefined} walletProviderName
12339
12360
  */
12340
12361
  type BridgeWidgetParams = {
12341
12362
  /** The contract address of the token to bridge from, used to populate the bridge form token field */
12342
- fromContractAddress?: string;
12363
+ contractAddress?: string;
12343
12364
  /** The formatted amount to bridge, used to populate the bridge form amount field */
12344
12365
  amount?: string;
12345
12366
  /** The wallet provider name to use for the bridge widget */
@@ -12535,7 +12556,7 @@ type WidgetEventData = {
12535
12556
  [SwapEventType.CLOSE_WIDGET]: {};
12536
12557
  } & OrchestrationMapping & ProviderEventMapping;
12537
12558
  [WidgetType.BRIDGE]: {
12538
- [BridgeEventType.SUCCESS]: BridgeSuccess;
12559
+ [BridgeEventType.TRANSACTION_SENT]: BridgeTransactionSent;
12539
12560
  [BridgeEventType.FAILURE]: BridgeFailed;
12540
12561
  [BridgeEventType.CLOSE_WIDGET]: {};
12541
12562
  } & OrchestrationMapping & ProviderEventMapping;
@@ -12892,6 +12913,18 @@ declare global {
12892
12913
  }
12893
12914
  }
12894
12915
 
12916
+ /**
12917
+ * Base URL for the Immutable API based on the environment.
12918
+ * @property {string} DEVELOPMENT - The base URL for the development environment.
12919
+ * @property {string} SANDBOX - The base URL for the sandbox environment.
12920
+ * @property {string} PRODUCTION - The base URL for the production environment.
12921
+ */
12922
+ declare const IMMUTABLE_API_BASE_URL: {
12923
+ [x: string]: string;
12924
+ sandbox: string;
12925
+ production: string;
12926
+ };
12927
+
12895
12928
  /**
12896
12929
  * Enum representing different types of errors that can occur during the checkout process.
12897
12930
  */
@@ -12951,16 +12984,4 @@ type ErrorType = {
12951
12984
  };
12952
12985
  };
12953
12986
 
12954
- /**
12955
- * Base URL for the checkout API based on the environment.
12956
- * @property {string} DEVELOPMENT - The base URL for the development environment.
12957
- * @property {string} SANDBOX - The base URL for the sandbox environment.
12958
- * @property {string} PRODUCTION - The base URL for the production environment.
12959
- */
12960
- declare const CHECKOUT_API_BASE_URL: {
12961
- [x: string]: string;
12962
- sandbox: string;
12963
- production: string;
12964
- };
12965
-
12966
- export { AllowedNetworkConfig, AvailableRoutingOptions, BalanceDelta, BridgeEventType, BridgeFailed, BridgeFundingStep, BridgeSuccess, BridgeWidgetConfiguration, BridgeWidgetParams, BuyOrder, BuyParams, BuyResult, BuyResultFailed, BuyResultInsufficientFunds, BuyResultSuccess, BuyToken, CHECKOUT_API_BASE_URL, CancelParams, CancelResult, CancelResultFailed, CancelResultSuccess, ChainId, ChainName, CheckConnectionParams, CheckConnectionResult, Checkout, CheckoutBridgeConfiguration, CheckoutConfiguration, CheckoutErrorType, CheckoutModuleConfiguration, CheckoutOnRampConfiguration, CheckoutStatus, CheckoutSwapConfiguration, CheckoutWidgetsConfig, ConnectEventType, ConnectParams, ConnectResult, ConnectTargetLayer, ConnectWidgetConfiguration, ConnectWidgetParams, ConnectionFailed, ConnectionSuccess, CreateProviderParams, CreateProviderResult, DexConfig, ERC20ItemRequirement, ERC721Balance, ERC721ItemRequirement, ErrorType, ExchangeType, Fee, FeePercentage, FeeToken, FiatRampParams, FulfillmentTransaction, FundingItem, FundingRoute, FundingStep, FundingStepType, GasAmount, GasEstimateBridgeToL2Result, GasEstimateParams, GasEstimateSwapResult, GasEstimateTokenConfig, GasEstimateType, GasToken, GasTokenType, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetNetworkAllowListParams, GetNetworkAllowListResult, GetNetworkParams, GetTokenAllowListParams, GetTokenAllowListResult, GetWalletAllowListParams, GetWalletAllowListResult, IMTBLWidgetEvents, IWidgetsFactory, ItemBalance, ItemType, NativeItemRequirement, NetworkFilter, NetworkFilterTypes, NetworkInfo, NoRouteOptions, NoRoutesFound, OnRampEventType, OnRampFailed, OnRampFundingStep, OnRampProviderFees, OnRampSuccess, OnRampWidgetParams, OnrampWidgetConfiguration, OrchestrationEvent, OrchestrationEventData, OrchestrationEventType, OrderFee, ProviderEvent, ProviderEventType, ProviderUpdated, RemoteConfiguration, RequestBridgeEvent, RequestConnectEvent, RequestOnrampEvent, RequestSwapEvent, RequestWalletEvent, RoutesFound, RoutingOutcome, RoutingOutcomeType, SaleEventType, SaleFailed, SaleItem, SaleSuccess, SaleTransactionSuccess, SaleWidgetConfiguration, SaleWidgetParams, SellOrder, SellParams, SellResult, SellResultFailed, SellResultInsufficientFunds, SellResultSuccess, SellToken, SemanticVersion, SendTransactionParams, SendTransactionResult, SmartCheckoutInsufficient, SmartCheckoutParams, SmartCheckoutResult, SmartCheckoutRouter, SmartCheckoutSufficient, SwapEventType, SwapFailed, SwapFundingStep, SwapRejected, SwapSuccess, SwapWidgetConfiguration, SwapWidgetParams, SwitchNetworkParams, SwitchNetworkResult, TokenAmountEstimate, TokenBalance, TokenFilter, TokenFilterTypes, TokenInfo, TransactionOrGasType, TransactionRequirement, WalletDisconnect, WalletEventType, WalletFilter, WalletFilterTypes, WalletInfo, WalletNetworkSwitch, WalletProviderName, WalletWidgetConfiguration, WalletWidgetParams, Widget, WidgetConfiguration, WidgetConfigurations, WidgetEvent, WidgetEventData, WidgetEventTypes, WidgetParameters, WidgetProperties, WidgetTheme, WidgetType };
12987
+ export { AllowedNetworkConfig, AvailableRoutingOptions, BalanceDelta, BridgeEventType, BridgeFailed, BridgeFundingStep, BridgeTransactionSent, BridgeWidgetConfiguration, BridgeWidgetParams, BuyOrder, BuyParams, BuyResult, BuyResultFailed, BuyResultInsufficientFunds, BuyResultSuccess, BuyToken, CancelParams, CancelResult, CancelResultFailed, CancelResultSuccess, ChainId, ChainName, CheckConnectionParams, CheckConnectionResult, Checkout, CheckoutBridgeConfiguration, CheckoutConfiguration, CheckoutErrorType, CheckoutModuleConfiguration, CheckoutOnRampConfiguration, CheckoutStatus, CheckoutSwapConfiguration, CheckoutWidgetsConfig, ConnectEventType, ConnectParams, ConnectResult, ConnectTargetLayer, ConnectWidgetConfiguration, ConnectWidgetParams, ConnectionFailed, ConnectionSuccess, CreateProviderParams, CreateProviderResult, DexConfig, ERC20ItemRequirement, ERC721Balance, ERC721ItemRequirement, ErrorType, ExchangeType, Fee, FeePercentage, FeeToken, FiatRampParams, FulfillmentTransaction, FundingItem, FundingRoute, FundingStep, FundingStepType, GasAmount, GasEstimateBridgeToL2Result, GasEstimateParams, GasEstimateSwapResult, GasEstimateTokenConfig, GasEstimateType, GasToken, GasTokenType, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetNetworkAllowListParams, GetNetworkAllowListResult, GetNetworkParams, GetTokenAllowListParams, GetTokenAllowListResult, GetWalletAllowListParams, GetWalletAllowListResult, IMMUTABLE_API_BASE_URL, IMTBLWidgetEvents, IWidgetsFactory, ItemBalance, ItemType, NativeItemRequirement, NetworkFilter, NetworkFilterTypes, NetworkInfo, NoRouteOptions, NoRoutesFound, OnRampEventType, OnRampFailed, OnRampFundingStep, OnRampProviderFees, OnRampSuccess, OnRampWidgetParams, OnrampWidgetConfiguration, OrchestrationEvent, OrchestrationEventData, OrchestrationEventType, OrderFee, ProviderEvent, ProviderEventType, ProviderUpdated, RemoteConfiguration, RequestBridgeEvent, RequestConnectEvent, RequestOnrampEvent, RequestSwapEvent, RequestWalletEvent, RoutesFound, RoutingOutcome, RoutingOutcomeType, SaleEventType, SaleFailed, SaleItem, SaleSuccess, SaleTransactionSuccess, SaleWidgetConfiguration, SaleWidgetParams, SellOrder, SellParams, SellResult, SellResultFailed, SellResultInsufficientFunds, SellResultSuccess, SellToken, SemanticVersion, SendTransactionParams, SendTransactionResult, SmartCheckoutInsufficient, SmartCheckoutParams, SmartCheckoutResult, SmartCheckoutRouter, SmartCheckoutSufficient, SwapEventType, SwapFailed, SwapFundingStep, SwapRejected, SwapSuccess, SwapWidgetConfiguration, SwapWidgetParams, SwitchNetworkParams, SwitchNetworkResult, TokenAmountEstimate, TokenBalance, TokenFilter, TokenFilterTypes, TokenInfo, TransactionOrGasType, TransactionRequirement, WalletDisconnect, WalletEventType, WalletFilter, WalletFilterTypes, WalletInfo, WalletNetworkSwitch, WalletProviderName, WalletWidgetConfiguration, WalletWidgetParams, Widget, WidgetConfiguration, WidgetConfigurations, WidgetEvent, WidgetEventData, WidgetEventTypes, WidgetParameters, WidgetProperties, WidgetTheme, WidgetType };