@imtbl/sdk 0.35.8 → 0.36.0
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/blockchain_data.js +1 -1
- package/dist/browser/checkout/sdk.js +6 -6
- package/dist/browser/checkout/widgets.js +57 -57
- package/dist/checkout.d.ts +51 -30
- package/dist/checkout.js +7988 -3754
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +12 -12
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +8465 -4231
- package/dist/index.d.ts +54 -33
- package/dist/index.js +7227 -2993
- package/dist/passport.js +3 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -17517,6 +17517,26 @@ interface CheckConnectionResult {
|
|
|
17517
17517
|
walletAddress: string;
|
|
17518
17518
|
}
|
|
17519
17519
|
|
|
17520
|
+
/**
|
|
17521
|
+
* @typedef {Object} BridgeFeeResponse
|
|
17522
|
+
* @property {ethers.BigNumber} sourceChainGas - Gas cost to send tokens to the bridge contract on the source chain.
|
|
17523
|
+
* - priced in the source chain's native token.
|
|
17524
|
+
* @property {ethers.BigNumber} bridgeFee - destinationChainGas + validatorFee.
|
|
17525
|
+
* This will be added to the tx.value of the bridge transaction and forwarded to the Axelar Gas Service contract.
|
|
17526
|
+
* - priced in the source chain's native token.
|
|
17527
|
+
* @property {ethers.BigNumber} imtblFee - The fee charged by Immutable to facilitate the bridge.
|
|
17528
|
+
* - priced in the source chain's native token.
|
|
17529
|
+
* @property {ethers.BigNumber} totalFees - The total fees the user will be charged which is;
|
|
17530
|
+
* sourceChainGas + bridgeFee + imtblFee.
|
|
17531
|
+
* - priced in the source chain's native token.
|
|
17532
|
+
*/
|
|
17533
|
+
interface BridgeFeeResponse {
|
|
17534
|
+
sourceChainGas: BigNumber;
|
|
17535
|
+
bridgeFee: BigNumber;
|
|
17536
|
+
imtblFee: BigNumber;
|
|
17537
|
+
totalFees: BigNumber;
|
|
17538
|
+
}
|
|
17539
|
+
|
|
17520
17540
|
/**
|
|
17521
17541
|
* An enum representing the type of gas estimate.
|
|
17522
17542
|
* @enum {string}
|
|
@@ -17536,11 +17556,9 @@ type GasEstimateParams = GasEstimateBridgeToL2Params | GasEstimateSwapParams;
|
|
|
17536
17556
|
/**
|
|
17537
17557
|
* An interface representing the parameters for estimating gas for a bridge to L2 transaction {@link Checkout.gasEstimate}.
|
|
17538
17558
|
* @param {GasEstimateType.BRIDGE_TO_L2} gasEstimateType - The type of gas estimate.
|
|
17539
|
-
* @param {boolean} isSpendingCapApprovalRequired - Whether or not spending cap approval is required.
|
|
17540
17559
|
*/
|
|
17541
17560
|
interface GasEstimateBridgeToL2Params {
|
|
17542
17561
|
gasEstimateType: GasEstimateType.BRIDGE_TO_L2;
|
|
17543
|
-
isSpendingCapApprovalRequired: boolean;
|
|
17544
17562
|
}
|
|
17545
17563
|
/**
|
|
17546
17564
|
* An interface representing the parameters for a gas estimate swap {@link Checkout.gasEstimate}.
|
|
@@ -17554,28 +17572,31 @@ interface GasEstimateSwapParams {
|
|
|
17554
17572
|
* An interface representing the result of a gas estimate for a swap transaction {@link Checkout.gasEstimate}.
|
|
17555
17573
|
* @interface GasEstimateSwapResult
|
|
17556
17574
|
* @property {GasEstimateType.SWAP} gasEstimateType - The type of gas estimate, which is always "SWAP".
|
|
17557
|
-
* @property {TokenAmountEstimate}
|
|
17575
|
+
* @property {TokenAmountEstimate} fees - The estimated gas fee for the swap transaction.
|
|
17558
17576
|
*/
|
|
17559
17577
|
interface GasEstimateSwapResult {
|
|
17560
17578
|
gasEstimateType: GasEstimateType.SWAP;
|
|
17561
|
-
|
|
17579
|
+
fees: TokenAmountEstimate;
|
|
17562
17580
|
}
|
|
17563
17581
|
/**
|
|
17564
17582
|
* An interface representing the result of a gas estimate for a bridge to L2 transaction {@link Checkout.gasEstimate}.
|
|
17565
17583
|
* @interface GasEstimateBridgeToL2Result
|
|
17566
17584
|
* @property {GasEstimateType.BRIDGE_TO_L2} gasEstimateType - The type of gas estimate.
|
|
17567
|
-
* @property {
|
|
17568
|
-
* @property {
|
|
17569
|
-
* @property {boolean} bridgeable - A boolean indicating whether the transaction is bridgeable.
|
|
17585
|
+
* @property {BridgeFeeResponse} fees - The estimated fees for the transaction.
|
|
17586
|
+
* @property {TokenInfo | undefined} token - The gas token information.
|
|
17570
17587
|
*/
|
|
17571
17588
|
interface GasEstimateBridgeToL2Result {
|
|
17572
17589
|
gasEstimateType: GasEstimateType.BRIDGE_TO_L2;
|
|
17573
|
-
|
|
17574
|
-
|
|
17575
|
-
bridgeable: boolean;
|
|
17590
|
+
fees: BridgeFeeResponse;
|
|
17591
|
+
token?: TokenInfo;
|
|
17576
17592
|
}
|
|
17593
|
+
/**
|
|
17594
|
+
* An interface representing the estimated fees.
|
|
17595
|
+
* @property {BigNumber | undefined} totalFees - The estimated fees for the transaction.
|
|
17596
|
+
* @property {TokenInfo | undefined} token - The gas token information.
|
|
17597
|
+
*/
|
|
17577
17598
|
interface TokenAmountEstimate {
|
|
17578
|
-
|
|
17599
|
+
totalFees?: BigNumber;
|
|
17579
17600
|
token?: TokenInfo;
|
|
17580
17601
|
}
|
|
17581
17602
|
|
|
@@ -18059,14 +18080,14 @@ type SaleTransactionSuccess = {
|
|
|
18059
18080
|
*/
|
|
18060
18081
|
declare enum BridgeEventType {
|
|
18061
18082
|
CLOSE_WIDGET = "close-widget",
|
|
18062
|
-
|
|
18063
|
-
|
|
18083
|
+
FAILURE = "failure",
|
|
18084
|
+
TRANSACTION_SENT = "transaction-sent"
|
|
18064
18085
|
}
|
|
18065
18086
|
/**
|
|
18066
18087
|
* Represents a successful bridge transaction.
|
|
18067
18088
|
* @property {string} transactionHash
|
|
18068
18089
|
*/
|
|
18069
|
-
type
|
|
18090
|
+
type BridgeTransactionSent = {
|
|
18070
18091
|
/** The hash of the successful transaction. */
|
|
18071
18092
|
transactionHash: string;
|
|
18072
18093
|
};
|
|
@@ -18182,13 +18203,13 @@ type ConnectWidgetParams = {};
|
|
|
18182
18203
|
|
|
18183
18204
|
/**
|
|
18184
18205
|
* Bridge Widget parameters
|
|
18185
|
-
* @property {string | undefined}
|
|
18206
|
+
* @property {string | undefined} contractAddress
|
|
18186
18207
|
* @property {string | undefined} amount
|
|
18187
18208
|
* @property {WalletProviderName | undefined} walletProviderName
|
|
18188
18209
|
*/
|
|
18189
18210
|
type BridgeWidgetParams = {
|
|
18190
18211
|
/** The contract address of the token to bridge from, used to populate the bridge form token field */
|
|
18191
|
-
|
|
18212
|
+
contractAddress?: string;
|
|
18192
18213
|
/** The formatted amount to bridge, used to populate the bridge form amount field */
|
|
18193
18214
|
amount?: string;
|
|
18194
18215
|
/** The wallet provider name to use for the bridge widget */
|
|
@@ -18384,7 +18405,7 @@ type WidgetEventData = {
|
|
|
18384
18405
|
[SwapEventType.CLOSE_WIDGET]: {};
|
|
18385
18406
|
} & OrchestrationMapping & ProviderEventMapping;
|
|
18386
18407
|
[WidgetType.BRIDGE]: {
|
|
18387
|
-
[BridgeEventType.
|
|
18408
|
+
[BridgeEventType.TRANSACTION_SENT]: BridgeTransactionSent;
|
|
18388
18409
|
[BridgeEventType.FAILURE]: BridgeFailed;
|
|
18389
18410
|
[BridgeEventType.CLOSE_WIDGET]: {};
|
|
18390
18411
|
} & OrchestrationMapping & ProviderEventMapping;
|
|
@@ -18741,6 +18762,18 @@ declare global {
|
|
|
18741
18762
|
}
|
|
18742
18763
|
}
|
|
18743
18764
|
|
|
18765
|
+
/**
|
|
18766
|
+
* Base URL for the Immutable API based on the environment.
|
|
18767
|
+
* @property {string} DEVELOPMENT - The base URL for the development environment.
|
|
18768
|
+
* @property {string} SANDBOX - The base URL for the sandbox environment.
|
|
18769
|
+
* @property {string} PRODUCTION - The base URL for the production environment.
|
|
18770
|
+
*/
|
|
18771
|
+
declare const IMMUTABLE_API_BASE_URL: {
|
|
18772
|
+
[x: string]: string;
|
|
18773
|
+
sandbox: string;
|
|
18774
|
+
production: string;
|
|
18775
|
+
};
|
|
18776
|
+
|
|
18744
18777
|
/**
|
|
18745
18778
|
* Enum representing different types of errors that can occur during the checkout process.
|
|
18746
18779
|
*/
|
|
@@ -18800,18 +18833,6 @@ type ErrorType = {
|
|
|
18800
18833
|
};
|
|
18801
18834
|
};
|
|
18802
18835
|
|
|
18803
|
-
/**
|
|
18804
|
-
* Base URL for the checkout API based on the environment.
|
|
18805
|
-
* @property {string} DEVELOPMENT - The base URL for the development environment.
|
|
18806
|
-
* @property {string} SANDBOX - The base URL for the sandbox environment.
|
|
18807
|
-
* @property {string} PRODUCTION - The base URL for the production environment.
|
|
18808
|
-
*/
|
|
18809
|
-
declare const CHECKOUT_API_BASE_URL: {
|
|
18810
|
-
[x: string]: string;
|
|
18811
|
-
sandbox: string;
|
|
18812
|
-
production: string;
|
|
18813
|
-
};
|
|
18814
|
-
|
|
18815
18836
|
type checkout_d_AllowedNetworkConfig = AllowedNetworkConfig;
|
|
18816
18837
|
type checkout_d_AvailableRoutingOptions = AvailableRoutingOptions;
|
|
18817
18838
|
type checkout_d_BalanceDelta = BalanceDelta;
|
|
@@ -18819,7 +18840,7 @@ type checkout_d_BridgeEventType = BridgeEventType;
|
|
|
18819
18840
|
declare const checkout_d_BridgeEventType: typeof BridgeEventType;
|
|
18820
18841
|
type checkout_d_BridgeFailed = BridgeFailed;
|
|
18821
18842
|
type checkout_d_BridgeFundingStep = BridgeFundingStep;
|
|
18822
|
-
type
|
|
18843
|
+
type checkout_d_BridgeTransactionSent = BridgeTransactionSent;
|
|
18823
18844
|
type checkout_d_BridgeWidgetConfiguration = BridgeWidgetConfiguration;
|
|
18824
18845
|
type checkout_d_BridgeWidgetParams = BridgeWidgetParams;
|
|
18825
18846
|
type checkout_d_BuyOrder = BuyOrder;
|
|
@@ -18829,7 +18850,6 @@ type checkout_d_BuyResultFailed = BuyResultFailed;
|
|
|
18829
18850
|
type checkout_d_BuyResultInsufficientFunds = BuyResultInsufficientFunds;
|
|
18830
18851
|
type checkout_d_BuyResultSuccess = BuyResultSuccess;
|
|
18831
18852
|
type checkout_d_BuyToken = BuyToken;
|
|
18832
|
-
declare const checkout_d_CHECKOUT_API_BASE_URL: typeof CHECKOUT_API_BASE_URL;
|
|
18833
18853
|
type checkout_d_CancelParams = CancelParams;
|
|
18834
18854
|
type checkout_d_CancelResult = CancelResult;
|
|
18835
18855
|
type checkout_d_CancelResultFailed = CancelResultFailed;
|
|
@@ -18903,6 +18923,7 @@ type checkout_d_GetTokenAllowListParams = GetTokenAllowListParams;
|
|
|
18903
18923
|
type checkout_d_GetTokenAllowListResult = GetTokenAllowListResult;
|
|
18904
18924
|
type checkout_d_GetWalletAllowListParams = GetWalletAllowListParams;
|
|
18905
18925
|
type checkout_d_GetWalletAllowListResult = GetWalletAllowListResult;
|
|
18926
|
+
declare const checkout_d_IMMUTABLE_API_BASE_URL: typeof IMMUTABLE_API_BASE_URL;
|
|
18906
18927
|
type checkout_d_IMTBLWidgetEvents = IMTBLWidgetEvents;
|
|
18907
18928
|
declare const checkout_d_IMTBLWidgetEvents: typeof IMTBLWidgetEvents;
|
|
18908
18929
|
type checkout_d_IWidgetsFactory = IWidgetsFactory;
|
|
@@ -19017,7 +19038,7 @@ declare namespace checkout_d {
|
|
|
19017
19038
|
checkout_d_BridgeEventType as BridgeEventType,
|
|
19018
19039
|
checkout_d_BridgeFailed as BridgeFailed,
|
|
19019
19040
|
checkout_d_BridgeFundingStep as BridgeFundingStep,
|
|
19020
|
-
|
|
19041
|
+
checkout_d_BridgeTransactionSent as BridgeTransactionSent,
|
|
19021
19042
|
checkout_d_BridgeWidgetConfiguration as BridgeWidgetConfiguration,
|
|
19022
19043
|
checkout_d_BridgeWidgetParams as BridgeWidgetParams,
|
|
19023
19044
|
checkout_d_BuyOrder as BuyOrder,
|
|
@@ -19027,7 +19048,6 @@ declare namespace checkout_d {
|
|
|
19027
19048
|
checkout_d_BuyResultInsufficientFunds as BuyResultInsufficientFunds,
|
|
19028
19049
|
checkout_d_BuyResultSuccess as BuyResultSuccess,
|
|
19029
19050
|
checkout_d_BuyToken as BuyToken,
|
|
19030
|
-
checkout_d_CHECKOUT_API_BASE_URL as CHECKOUT_API_BASE_URL,
|
|
19031
19051
|
checkout_d_CancelParams as CancelParams,
|
|
19032
19052
|
checkout_d_CancelResult as CancelResult,
|
|
19033
19053
|
checkout_d_CancelResultFailed as CancelResultFailed,
|
|
@@ -19089,6 +19109,7 @@ declare namespace checkout_d {
|
|
|
19089
19109
|
checkout_d_GetTokenAllowListResult as GetTokenAllowListResult,
|
|
19090
19110
|
checkout_d_GetWalletAllowListParams as GetWalletAllowListParams,
|
|
19091
19111
|
checkout_d_GetWalletAllowListResult as GetWalletAllowListResult,
|
|
19112
|
+
checkout_d_IMMUTABLE_API_BASE_URL as IMMUTABLE_API_BASE_URL,
|
|
19092
19113
|
checkout_d_IMTBLWidgetEvents as IMTBLWidgetEvents,
|
|
19093
19114
|
checkout_d_IWidgetsFactory as IWidgetsFactory,
|
|
19094
19115
|
checkout_d_ItemBalance as ItemBalance,
|