@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/index.cjs CHANGED
@@ -10641,7 +10641,7 @@ class MultiRollupApiClients {
10641
10641
  }
10642
10642
 
10643
10643
  // eslint-disable-next-line @typescript-eslint/naming-convention
10644
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.42.1' };
10644
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.44.0' };
10645
10645
  const createConfig = ({ basePath, headers, }) => {
10646
10646
  if (!basePath.trim()) {
10647
10647
  throw Error('basePath can not be empty');
@@ -10713,7 +10713,7 @@ class APIError extends Error {
10713
10713
 
10714
10714
  /* eslint-disable implicit-arrow-linebreak */
10715
10715
  const defaultHeaders = {
10716
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.42.1',
10716
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.44.0',
10717
10717
  };
10718
10718
  /**
10719
10719
  * createAPIConfiguration to create a custom Configuration
@@ -11152,7 +11152,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
11152
11152
  chainID,
11153
11153
  coreContractAddress,
11154
11154
  registrationContractAddress,
11155
- sdkVersion: 'ts-immutable-sdk-0.42.1',
11155
+ sdkVersion: 'ts-immutable-sdk-0.44.0',
11156
11156
  });
11157
11157
  /**
11158
11158
  * Sets `sdkVersion` at the time of build
@@ -41071,6 +41071,14 @@ var SaleEventType;
41071
41071
  SaleEventType["LANGUAGE_CHANGED"] = "language-changed";
41072
41072
  SaleEventType["PAYMENT_METHOD"] = "payment-method";
41073
41073
  })(SaleEventType || (SaleEventType = {}));
41074
+ /**
41075
+ * Enum representing Sale Widget available payment types.
41076
+ */
41077
+ var SalePaymentTypes;
41078
+ (function (SalePaymentTypes) {
41079
+ SalePaymentTypes["CRYPTO"] = "crypto";
41080
+ SalePaymentTypes["FIAT"] = "fiat";
41081
+ })(SalePaymentTypes || (SalePaymentTypes = {}));
41074
41082
 
41075
41083
  /**
41076
41084
  * Enum of possible Bridge Widget event types.
@@ -41937,7 +41945,7 @@ const GAS_OVERRIDES = {
41937
41945
  maxPriorityFeePerGas: ethers.BigNumber.from(101e9),
41938
41946
  };
41939
41947
 
41940
- const SDK_VERSION_MARKER = '0.42.1';
41948
+ const SDK_VERSION_MARKER = '0.44.0';
41941
41949
  // This SDK version is replaced by the `yarn build` command ran on the root level
41942
41950
  const globalPackageVersion = () => SDK_VERSION_MARKER;
41943
41951
 
@@ -45205,7 +45213,7 @@ const sell = async (config, provider, orders) => {
45205
45213
  if (orders.length === 0) {
45206
45214
  throw new CheckoutError('No orders were provided to the orders array. Please provide at least one order.', CheckoutErrorType.PREPARE_ORDER_LISTING_ERROR);
45207
45215
  }
45208
- const { buyToken, sellToken, makerFees } = orders[0];
45216
+ const { buyToken, sellToken, makerFees, orderExpiry, } = orders[0];
45209
45217
  let decimals = 18;
45210
45218
  if (buyToken.type === ItemType.ERC20) {
45211
45219
  // get this from the allowed list
@@ -45226,6 +45234,7 @@ const sell = async (config, provider, orders) => {
45226
45234
  contractAddress: sellToken.collectionAddress,
45227
45235
  tokenId: sellToken.id,
45228
45236
  },
45237
+ orderExpiry,
45229
45238
  }));
45230
45239
  }
45231
45240
  catch (err) {
@@ -45817,8 +45826,23 @@ class Checkout {
45817
45826
  }
45818
45827
  }
45819
45828
 
45829
+ class BlockExplorerService {
45830
+ /**
45831
+ * getTransationLink returns the link to the transaction on blockscout
45832
+ * @param hash transaction hash
45833
+ * @returns link to the transaction on blockscout
45834
+ */
45835
+ static getTransactionLink(chainId, hash) {
45836
+ const url = BLOCKSCOUT_CHAIN_URL_MAP?.[chainId]?.url;
45837
+ if (!url || !hash)
45838
+ return undefined;
45839
+ return `${url}/tx/${hash}`;
45840
+ }
45841
+ }
45842
+
45820
45843
  var checkout = /*#__PURE__*/Object.freeze({
45821
45844
  __proto__: null,
45845
+ BlockExplorerService: BlockExplorerService,
45822
45846
  get BridgeEventType () { return BridgeEventType; },
45823
45847
  get ChainId () { return ChainId; },
45824
45848
  get ChainName () { return ChainName; },
@@ -45843,6 +45867,7 @@ var checkout = /*#__PURE__*/Object.freeze({
45843
45867
  get ProviderEventType () { return ProviderEventType; },
45844
45868
  get RoutingOutcomeType () { return RoutingOutcomeType; },
45845
45869
  get SaleEventType () { return SaleEventType; },
45870
+ get SalePaymentTypes () { return SalePaymentTypes; },
45846
45871
  get SwapEventType () { return SwapEventType; },
45847
45872
  get TokenFilterTypes () { return TokenFilterTypes; },
45848
45873
  get TransactionOrGasType () { return TransactionOrGasType; },
package/dist/index.d.ts CHANGED
@@ -17202,8 +17202,10 @@ type SellOrder = {
17202
17202
  sellToken: SellToken;
17203
17203
  /** the token info of the price of the item */
17204
17204
  buyToken: BuyToken;
17205
- /** option array of makerFees to be applied to the listing */
17205
+ /** optional array of makerFees to be applied to the listing */
17206
17206
  makerFees?: OrderFee[];
17207
+ /** optional order expiry date. Default order expiry to 2 years from now */
17208
+ orderExpiry?: Date;
17207
17209
  };
17208
17210
  /**
17209
17211
  * Represents the token that the item can be bought with once listed for sale.
@@ -18633,7 +18635,7 @@ declare enum SaleEventType {
18633
18635
  */
18634
18636
  type SaleSuccess = {
18635
18637
  /** Chosen payment method */
18636
- paymentMethod: string | undefined;
18638
+ paymentMethod: SalePaymentTypes | undefined;
18637
18639
  /** The executed transactions */
18638
18640
  transactions: {
18639
18641
  method: string;
@@ -18653,7 +18655,7 @@ type SaleFailed = {
18653
18655
  /** The timestamp of the failed swap. */
18654
18656
  timestamp: number;
18655
18657
  /** Chosen payment method */
18656
- paymentMethod: string | undefined;
18658
+ paymentMethod: SalePaymentTypes | undefined;
18657
18659
  /** The executed transactions */
18658
18660
  transactions: {
18659
18661
  method: string;
@@ -18665,7 +18667,7 @@ type SaleFailed = {
18665
18667
  * @property {Object} transactions
18666
18668
  */
18667
18669
  type SaleTransactionSuccess = {
18668
- paymentMethod: string | undefined;
18670
+ paymentMethod: SalePaymentTypes | undefined;
18669
18671
  /** The executed transactions */
18670
18672
  transactions: {
18671
18673
  method: string;
@@ -18678,8 +18680,15 @@ type SaleTransactionSuccess = {
18678
18680
  */
18679
18681
  type SalePaymentMethod = {
18680
18682
  /** Chosen payment method */
18681
- paymentMethod: string | undefined;
18683
+ paymentMethod: SalePaymentTypes | undefined;
18682
18684
  };
18685
+ /**
18686
+ * Enum representing Sale Widget available payment types.
18687
+ */
18688
+ declare enum SalePaymentTypes {
18689
+ CRYPTO = "crypto",
18690
+ FIAT = "fiat"
18691
+ }
18683
18692
 
18684
18693
  /**
18685
18694
  * Enum of possible Bridge Widget event types.
@@ -18888,10 +18897,14 @@ type OnRampWidgetParams = {
18888
18897
  type SaleWidgetParams = {
18889
18898
  /** The total price to pay for the items in the sale */
18890
18899
  amount?: string;
18900
+ /** Environment id from Immutable Hub */
18891
18901
  environmentId?: string;
18902
+ /** Contract address of the token accepted for payments */
18892
18903
  fromTokenAddress?: string;
18893
18904
  /** The list of products to be purchased */
18894
18905
  items?: SaleItem[];
18906
+ /** The name of the NFT collection on sale */
18907
+ collectionName?: string;
18895
18908
  /** The wallet provider name to default to if no web3Provider is passed */
18896
18909
  walletProviderName?: WalletProviderName;
18897
18910
  /** The language to use for the sales widget */
@@ -19435,9 +19448,20 @@ type ErrorType = {
19435
19448
  };
19436
19449
  };
19437
19450
 
19451
+ declare class BlockExplorerService {
19452
+ /**
19453
+ * getTransationLink returns the link to the transaction on blockscout
19454
+ * @param hash transaction hash
19455
+ * @returns link to the transaction on blockscout
19456
+ */
19457
+ static getTransactionLink(chainId: ChainId, hash: string): string | undefined;
19458
+ }
19459
+
19438
19460
  type checkout_d_AllowedNetworkConfig = AllowedNetworkConfig;
19439
19461
  type checkout_d_AvailableRoutingOptions = AvailableRoutingOptions;
19440
19462
  type checkout_d_BalanceDelta = BalanceDelta;
19463
+ type checkout_d_BlockExplorerService = BlockExplorerService;
19464
+ declare const checkout_d_BlockExplorerService: typeof BlockExplorerService;
19441
19465
  type checkout_d_BridgeEventType = BridgeEventType;
19442
19466
  declare const checkout_d_BridgeEventType: typeof BridgeEventType;
19443
19467
  type checkout_d_BridgeFailed = BridgeFailed;
@@ -19577,6 +19601,8 @@ declare const checkout_d_SaleEventType: typeof SaleEventType;
19577
19601
  type checkout_d_SaleFailed = SaleFailed;
19578
19602
  type checkout_d_SaleItem = SaleItem;
19579
19603
  type checkout_d_SalePaymentMethod = SalePaymentMethod;
19604
+ type checkout_d_SalePaymentTypes = SalePaymentTypes;
19605
+ declare const checkout_d_SalePaymentTypes: typeof SalePaymentTypes;
19580
19606
  type checkout_d_SaleSuccess = SaleSuccess;
19581
19607
  type checkout_d_SaleTransactionSuccess = SaleTransactionSuccess;
19582
19608
  type checkout_d_SaleWidgetConfiguration = SaleWidgetConfiguration;
@@ -19645,6 +19671,7 @@ declare namespace checkout_d {
19645
19671
  checkout_d_AllowedNetworkConfig as AllowedNetworkConfig,
19646
19672
  checkout_d_AvailableRoutingOptions as AvailableRoutingOptions,
19647
19673
  checkout_d_BalanceDelta as BalanceDelta,
19674
+ checkout_d_BlockExplorerService as BlockExplorerService,
19648
19675
  checkout_d_BridgeEventType as BridgeEventType,
19649
19676
  checkout_d_BridgeFailed as BridgeFailed,
19650
19677
  checkout_d_BridgeFundingStep as BridgeFundingStep,
@@ -19761,6 +19788,7 @@ declare namespace checkout_d {
19761
19788
  checkout_d_SaleFailed as SaleFailed,
19762
19789
  checkout_d_SaleItem as SaleItem,
19763
19790
  checkout_d_SalePaymentMethod as SalePaymentMethod,
19791
+ checkout_d_SalePaymentTypes as SalePaymentTypes,
19764
19792
  checkout_d_SaleSuccess as SaleSuccess,
19765
19793
  checkout_d_SaleTransactionSuccess as SaleTransactionSuccess,
19766
19794
  checkout_d_SaleWidgetConfiguration as SaleWidgetConfiguration,
package/dist/index.js CHANGED
@@ -10619,7 +10619,7 @@ class MultiRollupApiClients {
10619
10619
  }
10620
10620
 
10621
10621
  // eslint-disable-next-line @typescript-eslint/naming-convention
10622
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.42.1' };
10622
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.44.0' };
10623
10623
  const createConfig = ({ basePath, headers, }) => {
10624
10624
  if (!basePath.trim()) {
10625
10625
  throw Error('basePath can not be empty');
@@ -10691,7 +10691,7 @@ class APIError extends Error {
10691
10691
 
10692
10692
  /* eslint-disable implicit-arrow-linebreak */
10693
10693
  const defaultHeaders = {
10694
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.42.1',
10694
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.44.0',
10695
10695
  };
10696
10696
  /**
10697
10697
  * createAPIConfiguration to create a custom Configuration
@@ -11130,7 +11130,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
11130
11130
  chainID,
11131
11131
  coreContractAddress,
11132
11132
  registrationContractAddress,
11133
- sdkVersion: 'ts-immutable-sdk-0.42.1',
11133
+ sdkVersion: 'ts-immutable-sdk-0.44.0',
11134
11134
  });
11135
11135
  /**
11136
11136
  * Sets `sdkVersion` at the time of build
@@ -41049,6 +41049,14 @@ var SaleEventType;
41049
41049
  SaleEventType["LANGUAGE_CHANGED"] = "language-changed";
41050
41050
  SaleEventType["PAYMENT_METHOD"] = "payment-method";
41051
41051
  })(SaleEventType || (SaleEventType = {}));
41052
+ /**
41053
+ * Enum representing Sale Widget available payment types.
41054
+ */
41055
+ var SalePaymentTypes;
41056
+ (function (SalePaymentTypes) {
41057
+ SalePaymentTypes["CRYPTO"] = "crypto";
41058
+ SalePaymentTypes["FIAT"] = "fiat";
41059
+ })(SalePaymentTypes || (SalePaymentTypes = {}));
41052
41060
 
41053
41061
  /**
41054
41062
  * Enum of possible Bridge Widget event types.
@@ -41915,7 +41923,7 @@ const GAS_OVERRIDES = {
41915
41923
  maxPriorityFeePerGas: BigNumber$1.from(101e9),
41916
41924
  };
41917
41925
 
41918
- const SDK_VERSION_MARKER = '0.42.1';
41926
+ const SDK_VERSION_MARKER = '0.44.0';
41919
41927
  // This SDK version is replaced by the `yarn build` command ran on the root level
41920
41928
  const globalPackageVersion = () => SDK_VERSION_MARKER;
41921
41929
 
@@ -45183,7 +45191,7 @@ const sell = async (config, provider, orders) => {
45183
45191
  if (orders.length === 0) {
45184
45192
  throw new CheckoutError('No orders were provided to the orders array. Please provide at least one order.', CheckoutErrorType.PREPARE_ORDER_LISTING_ERROR);
45185
45193
  }
45186
- const { buyToken, sellToken, makerFees } = orders[0];
45194
+ const { buyToken, sellToken, makerFees, orderExpiry, } = orders[0];
45187
45195
  let decimals = 18;
45188
45196
  if (buyToken.type === ItemType.ERC20) {
45189
45197
  // get this from the allowed list
@@ -45204,6 +45212,7 @@ const sell = async (config, provider, orders) => {
45204
45212
  contractAddress: sellToken.collectionAddress,
45205
45213
  tokenId: sellToken.id,
45206
45214
  },
45215
+ orderExpiry,
45207
45216
  }));
45208
45217
  }
45209
45218
  catch (err) {
@@ -45795,8 +45804,23 @@ class Checkout {
45795
45804
  }
45796
45805
  }
45797
45806
 
45807
+ class BlockExplorerService {
45808
+ /**
45809
+ * getTransationLink returns the link to the transaction on blockscout
45810
+ * @param hash transaction hash
45811
+ * @returns link to the transaction on blockscout
45812
+ */
45813
+ static getTransactionLink(chainId, hash) {
45814
+ const url = BLOCKSCOUT_CHAIN_URL_MAP?.[chainId]?.url;
45815
+ if (!url || !hash)
45816
+ return undefined;
45817
+ return `${url}/tx/${hash}`;
45818
+ }
45819
+ }
45820
+
45798
45821
  var checkout = /*#__PURE__*/Object.freeze({
45799
45822
  __proto__: null,
45823
+ BlockExplorerService: BlockExplorerService,
45800
45824
  get BridgeEventType () { return BridgeEventType; },
45801
45825
  get ChainId () { return ChainId; },
45802
45826
  get ChainName () { return ChainName; },
@@ -45821,6 +45845,7 @@ var checkout = /*#__PURE__*/Object.freeze({
45821
45845
  get ProviderEventType () { return ProviderEventType; },
45822
45846
  get RoutingOutcomeType () { return RoutingOutcomeType; },
45823
45847
  get SaleEventType () { return SaleEventType; },
45848
+ get SalePaymentTypes () { return SalePaymentTypes; },
45824
45849
  get SwapEventType () { return SwapEventType; },
45825
45850
  get TokenFilterTypes () { return TokenFilterTypes; },
45826
45851
  get TransactionOrGasType () { return TransactionOrGasType; },
package/dist/passport.js CHANGED
@@ -8724,7 +8724,7 @@ class MultiRollupApiClients {
8724
8724
  }
8725
8725
 
8726
8726
  // eslint-disable-next-line @typescript-eslint/naming-convention
8727
- const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.42.1' };
8727
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.44.0' };
8728
8728
  const createConfig = ({ basePath, headers, }) => {
8729
8729
  if (!basePath.trim()) {
8730
8730
  throw Error('basePath can not be empty');
@@ -8792,7 +8792,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
8792
8792
  chainID,
8793
8793
  coreContractAddress,
8794
8794
  registrationContractAddress,
8795
- sdkVersion: 'ts-immutable-sdk-0.42.1',
8795
+ sdkVersion: 'ts-immutable-sdk-0.44.0',
8796
8796
  });
8797
8797
  /**
8798
8798
  * Sets `sdkVersion` at the time of build
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@imtbl/sdk",
3
3
  "description": "Immutable Unified SDK",
4
- "version": "0.42.1",
4
+ "version": "0.44.0",
5
5
  "author": "Immutable",
6
6
  "browser": "./dist/index.browser.js",
7
7
  "bugs": "https://github.com/immutable/ts-immutable-sdk/issues",