@imtbl/sdk 0.42.1 → 0.44.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 +28 -6
- package/dist/checkout.js +27 -4
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +3 -3
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +30 -5
- package/dist/index.d.ts +33 -5
- package/dist/index.js +30 -5
- package/dist/passport.js +2 -2
- package/package.json +1 -1
package/dist/checkout.d.ts
CHANGED
|
@@ -10888,8 +10888,10 @@ type SellOrder = {
|
|
|
10888
10888
|
sellToken: SellToken;
|
|
10889
10889
|
/** the token info of the price of the item */
|
|
10890
10890
|
buyToken: BuyToken;
|
|
10891
|
-
/**
|
|
10891
|
+
/** optional array of makerFees to be applied to the listing */
|
|
10892
10892
|
makerFees?: OrderFee[];
|
|
10893
|
+
/** optional order expiry date. Default order expiry to 2 years from now */
|
|
10894
|
+
orderExpiry?: Date;
|
|
10893
10895
|
};
|
|
10894
10896
|
/**
|
|
10895
10897
|
* Represents the token that the item can be bought with once listed for sale.
|
|
@@ -12703,7 +12705,7 @@ declare enum SaleEventType {
|
|
|
12703
12705
|
*/
|
|
12704
12706
|
type SaleSuccess = {
|
|
12705
12707
|
/** Chosen payment method */
|
|
12706
|
-
paymentMethod:
|
|
12708
|
+
paymentMethod: SalePaymentTypes | undefined;
|
|
12707
12709
|
/** The executed transactions */
|
|
12708
12710
|
transactions: {
|
|
12709
12711
|
method: string;
|
|
@@ -12723,7 +12725,7 @@ type SaleFailed = {
|
|
|
12723
12725
|
/** The timestamp of the failed swap. */
|
|
12724
12726
|
timestamp: number;
|
|
12725
12727
|
/** Chosen payment method */
|
|
12726
|
-
paymentMethod:
|
|
12728
|
+
paymentMethod: SalePaymentTypes | undefined;
|
|
12727
12729
|
/** The executed transactions */
|
|
12728
12730
|
transactions: {
|
|
12729
12731
|
method: string;
|
|
@@ -12735,7 +12737,7 @@ type SaleFailed = {
|
|
|
12735
12737
|
* @property {Object} transactions
|
|
12736
12738
|
*/
|
|
12737
12739
|
type SaleTransactionSuccess = {
|
|
12738
|
-
paymentMethod:
|
|
12740
|
+
paymentMethod: SalePaymentTypes | undefined;
|
|
12739
12741
|
/** The executed transactions */
|
|
12740
12742
|
transactions: {
|
|
12741
12743
|
method: string;
|
|
@@ -12748,8 +12750,15 @@ type SaleTransactionSuccess = {
|
|
|
12748
12750
|
*/
|
|
12749
12751
|
type SalePaymentMethod = {
|
|
12750
12752
|
/** Chosen payment method */
|
|
12751
|
-
paymentMethod:
|
|
12753
|
+
paymentMethod: SalePaymentTypes | undefined;
|
|
12752
12754
|
};
|
|
12755
|
+
/**
|
|
12756
|
+
* Enum representing Sale Widget available payment types.
|
|
12757
|
+
*/
|
|
12758
|
+
declare enum SalePaymentTypes {
|
|
12759
|
+
CRYPTO = "crypto",
|
|
12760
|
+
FIAT = "fiat"
|
|
12761
|
+
}
|
|
12753
12762
|
|
|
12754
12763
|
/**
|
|
12755
12764
|
* Enum of possible Bridge Widget event types.
|
|
@@ -12958,10 +12967,14 @@ type OnRampWidgetParams = {
|
|
|
12958
12967
|
type SaleWidgetParams = {
|
|
12959
12968
|
/** The total price to pay for the items in the sale */
|
|
12960
12969
|
amount?: string;
|
|
12970
|
+
/** Environment id from Immutable Hub */
|
|
12961
12971
|
environmentId?: string;
|
|
12972
|
+
/** Contract address of the token accepted for payments */
|
|
12962
12973
|
fromTokenAddress?: string;
|
|
12963
12974
|
/** The list of products to be purchased */
|
|
12964
12975
|
items?: SaleItem[];
|
|
12976
|
+
/** The name of the NFT collection on sale */
|
|
12977
|
+
collectionName?: string;
|
|
12965
12978
|
/** The wallet provider name to default to if no web3Provider is passed */
|
|
12966
12979
|
walletProviderName?: WalletProviderName;
|
|
12967
12980
|
/** The language to use for the sales widget */
|
|
@@ -13505,4 +13518,13 @@ type ErrorType = {
|
|
|
13505
13518
|
};
|
|
13506
13519
|
};
|
|
13507
13520
|
|
|
13508
|
-
|
|
13521
|
+
declare class BlockExplorerService {
|
|
13522
|
+
/**
|
|
13523
|
+
* getTransationLink returns the link to the transaction on blockscout
|
|
13524
|
+
* @param hash transaction hash
|
|
13525
|
+
* @returns link to the transaction on blockscout
|
|
13526
|
+
*/
|
|
13527
|
+
static getTransactionLink(chainId: ChainId, hash: string): string | undefined;
|
|
13528
|
+
}
|
|
13529
|
+
|
|
13530
|
+
export { AllowedNetworkConfig, AvailableRoutingOptions, BalanceDelta, BlockExplorerService, BridgeEventType, BridgeFailed, BridgeFundingStep, BridgeTransactionSent, BridgeWidgetConfiguration, BridgeWidgetParams, BuyOrder, BuyParams, BuyResult, BuyResultFailed, BuyResultInsufficientFunds, BuyResultSuccess, BuyToken, CancelParams, CancelResult, CancelResultFailed, CancelResultSuccess, ChainId, ChainName, ChainSlug, 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, FeeType, FiatRampParams, FulfillmentTransaction, FundingItem, FundingRoute, FundingStep, FundingStepType, GasAmount, GasEstimateBridgeToL2Result, GasEstimateParams, GasEstimateSwapResult, GasEstimateTokenConfig, GasEstimateType, GasToken, GasTokenType, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetNetworkAllowListParams, GetNetworkAllowListResult, GetNetworkParams, GetTokenAllowListParams, GetTokenAllowListResult, GetTokenInfoParams, GetWalletAllowListParams, GetWalletAllowListResult, IMMUTABLE_API_BASE_URL, IMTBLWidgetEvents, IWidgetsFactory, ItemBalance, ItemType, LanguageChanged, 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, SalePaymentMethod, SalePaymentTypes, 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, WidgetLanguage, WidgetParameters, WidgetProperties, WidgetTheme, WidgetType };
|
package/dist/checkout.js
CHANGED
|
@@ -25921,7 +25921,7 @@ class APIError extends Error {
|
|
|
25921
25921
|
|
|
25922
25922
|
/* eslint-disable implicit-arrow-linebreak */
|
|
25923
25923
|
const defaultHeaders = {
|
|
25924
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.
|
|
25924
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.44.0',
|
|
25925
25925
|
};
|
|
25926
25926
|
/**
|
|
25927
25927
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -26406,6 +26406,14 @@ var SaleEventType;
|
|
|
26406
26406
|
SaleEventType["LANGUAGE_CHANGED"] = "language-changed";
|
|
26407
26407
|
SaleEventType["PAYMENT_METHOD"] = "payment-method";
|
|
26408
26408
|
})(SaleEventType || (SaleEventType = {}));
|
|
26409
|
+
/**
|
|
26410
|
+
* Enum representing Sale Widget available payment types.
|
|
26411
|
+
*/
|
|
26412
|
+
var SalePaymentTypes;
|
|
26413
|
+
(function (SalePaymentTypes) {
|
|
26414
|
+
SalePaymentTypes["CRYPTO"] = "crypto";
|
|
26415
|
+
SalePaymentTypes["FIAT"] = "fiat";
|
|
26416
|
+
})(SalePaymentTypes || (SalePaymentTypes = {}));
|
|
26409
26417
|
|
|
26410
26418
|
/**
|
|
26411
26419
|
* Enum of possible Bridge Widget event types.
|
|
@@ -27272,7 +27280,7 @@ const GAS_OVERRIDES = {
|
|
|
27272
27280
|
maxPriorityFeePerGas: BigNumber$1.from(101e9),
|
|
27273
27281
|
};
|
|
27274
27282
|
|
|
27275
|
-
const SDK_VERSION_MARKER = '0.
|
|
27283
|
+
const SDK_VERSION_MARKER = '0.44.0';
|
|
27276
27284
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
27277
27285
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
27278
27286
|
|
|
@@ -30540,7 +30548,7 @@ const sell = async (config, provider, orders) => {
|
|
|
30540
30548
|
if (orders.length === 0) {
|
|
30541
30549
|
throw new CheckoutError('No orders were provided to the orders array. Please provide at least one order.', CheckoutErrorType.PREPARE_ORDER_LISTING_ERROR);
|
|
30542
30550
|
}
|
|
30543
|
-
const { buyToken, sellToken, makerFees } = orders[0];
|
|
30551
|
+
const { buyToken, sellToken, makerFees, orderExpiry, } = orders[0];
|
|
30544
30552
|
let decimals = 18;
|
|
30545
30553
|
if (buyToken.type === ItemType.ERC20) {
|
|
30546
30554
|
// get this from the allowed list
|
|
@@ -30561,6 +30569,7 @@ const sell = async (config, provider, orders) => {
|
|
|
30561
30569
|
contractAddress: sellToken.collectionAddress,
|
|
30562
30570
|
tokenId: sellToken.id,
|
|
30563
30571
|
},
|
|
30572
|
+
orderExpiry,
|
|
30564
30573
|
}));
|
|
30565
30574
|
}
|
|
30566
30575
|
catch (err) {
|
|
@@ -31152,4 +31161,18 @@ class Checkout {
|
|
|
31152
31161
|
}
|
|
31153
31162
|
}
|
|
31154
31163
|
|
|
31155
|
-
|
|
31164
|
+
class BlockExplorerService {
|
|
31165
|
+
/**
|
|
31166
|
+
* getTransationLink returns the link to the transaction on blockscout
|
|
31167
|
+
* @param hash transaction hash
|
|
31168
|
+
* @returns link to the transaction on blockscout
|
|
31169
|
+
*/
|
|
31170
|
+
static getTransactionLink(chainId, hash) {
|
|
31171
|
+
const url = BLOCKSCOUT_CHAIN_URL_MAP?.[chainId]?.url;
|
|
31172
|
+
if (!url || !hash)
|
|
31173
|
+
return undefined;
|
|
31174
|
+
return `${url}/tx/${hash}`;
|
|
31175
|
+
}
|
|
31176
|
+
}
|
|
31177
|
+
|
|
31178
|
+
export { BlockExplorerService, BridgeEventType, ChainId, ChainName, ChainSlug, Checkout, CheckoutConfiguration, CheckoutErrorType, CheckoutStatus, ConnectEventType, ConnectTargetLayer, ExchangeType, FeeType, FundingStepType, GasEstimateType, GasTokenType, IMMUTABLE_API_BASE_URL, IMTBLWidgetEvents, ItemType, NetworkFilterTypes, OnRampEventType, OrchestrationEventType, ProviderEventType, RoutingOutcomeType, SaleEventType, SalePaymentTypes, SwapEventType, TokenFilterTypes, TransactionOrGasType, WalletEventType, WalletFilterTypes, WalletProviderName, WidgetTheme, WidgetType };
|
|
@@ -17,7 +17,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
17
17
|
chainID,
|
|
18
18
|
coreContractAddress,
|
|
19
19
|
registrationContractAddress,
|
|
20
|
-
sdkVersion: 'ts-immutable-sdk-0.
|
|
20
|
+
sdkVersion: 'ts-immutable-sdk-0.44.0',
|
|
21
21
|
});
|
|
22
22
|
/**
|
|
23
23
|
* Sets `sdkVersion` at the time of build
|