@0xsequence/marketplace-sdk 2.0.1 → 2.0.2

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.
Files changed (116) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/BellIcon.js +1 -1
  3. package/dist/Card.js +1 -1
  4. package/dist/ShopCard.d.ts +4 -4
  5. package/dist/builder-api.js +1 -1
  6. package/dist/collectible.js +1 -1
  7. package/dist/collection.js +1 -1
  8. package/dist/create-config.d.ts +597 -201
  9. package/dist/create-config.js +1 -1
  10. package/dist/currency.js +1 -1
  11. package/dist/dist.js +167 -148
  12. package/dist/dist.js.map +1 -1
  13. package/dist/expirationDateSelect.js +1 -1
  14. package/dist/filter-state.d.ts +1 -1
  15. package/dist/filters.d.ts +4 -4
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +2 -2
  18. package/dist/index10.d.ts +3 -3
  19. package/dist/index11.d.ts +17 -17
  20. package/dist/index12.d.ts +26 -26
  21. package/dist/index14.d.ts +3 -3
  22. package/dist/index15.d.ts +3 -3
  23. package/dist/index16.d.ts +2 -2
  24. package/dist/index17.d.ts +86 -86
  25. package/dist/index18.d.ts +40 -40
  26. package/dist/index19.d.ts +5 -5
  27. package/dist/index2.d.ts +4 -1
  28. package/dist/index21.d.ts +15 -15
  29. package/dist/index22.d.ts +8 -65
  30. package/dist/index23.d.ts +21 -13
  31. package/dist/index26.d.ts +4 -4
  32. package/dist/index27.d.ts +4 -4
  33. package/dist/index28.d.ts +10 -10
  34. package/dist/index3.d.ts +2 -2194
  35. package/dist/index31.d.ts +5 -5
  36. package/dist/index33.d.ts +3 -3
  37. package/dist/index34.d.ts +4 -4
  38. package/dist/index35.d.ts +1 -1
  39. package/dist/index36.d.ts +7 -7
  40. package/dist/index37.d.ts +6 -6
  41. package/dist/index38.d.ts +8 -8
  42. package/dist/index39.d.ts +1 -1
  43. package/dist/index4.d.ts +995 -995
  44. package/dist/index40.d.ts +2 -2
  45. package/dist/index8.d.ts +2 -2
  46. package/dist/index9.d.ts +2811 -3
  47. package/dist/inventory.d.ts +4 -4
  48. package/dist/inventory.js +2 -2
  49. package/dist/marketplace2.js +2 -2
  50. package/dist/metadata.d.ts +73 -73
  51. package/dist/primary-sale-checkout-options.d.ts +4 -4
  52. package/dist/quantityInput.js +1 -1
  53. package/dist/ranges.d.ts +17 -17
  54. package/dist/react/_internal/index.d.ts +1 -1
  55. package/dist/react/_internal/index.js +1 -1
  56. package/dist/react/index.d.ts +1 -1
  57. package/dist/react/queries/collectible/index.d.ts +1 -1
  58. package/dist/react/queries/index.d.ts +1 -1
  59. package/dist/react/ssr/index.d.ts +1 -1
  60. package/dist/react/ssr/index.js +2 -2
  61. package/dist/react/ui/components/marketplace-collectible-card/index.d.ts +1 -1
  62. package/dist/react/ui/components/marketplace-logos/index.d.ts +21 -21
  63. package/dist/react/ui/modals/CreateListingModal/internal/hooks/index.d.ts +1 -1
  64. package/dist/react/ui/modals/MakeOfferModal/internal/hooks/index.d.ts +1 -1
  65. package/dist/react/ui/modals/_internal/components/alertMessage/index.d.ts +2 -2
  66. package/dist/react/ui/modals/_internal/components/baseModal/index.d.ts +6 -6
  67. package/dist/react/ui/modals/_internal/components/calendar/index.d.ts +2 -2
  68. package/dist/react/ui/modals/_internal/components/calendarDropdown/index.d.ts +2 -2
  69. package/dist/react/ui/modals/_internal/components/currencyImage/index.d.ts +2 -2
  70. package/dist/react/ui/modals/_internal/components/currencyOptionsSelect/index.d.ts +3 -3
  71. package/dist/react/ui/modals/_internal/components/floorPriceText/index.d.ts +2 -2
  72. package/dist/react/ui/modals/_internal/components/priceInput/index.d.ts +3 -3
  73. package/dist/react/ui/modals/_internal/components/quantityInput/index.d.ts +2 -2
  74. package/dist/react/ui/modals/_internal/components/selectWaasFeeOptions/index.d.ts +2 -2
  75. package/dist/react/ui/modals/_internal/components/switchChainErrorModal/index.d.ts +2 -2
  76. package/dist/react/ui/modals/_internal/components/timeAgo/index.d.ts +2 -2
  77. package/dist/react/ui/modals/_internal/components/tokenPreview/index.d.ts +3 -3
  78. package/dist/react/ui/modals/_internal/components/transaction-footer/index.d.ts +3 -3
  79. package/dist/react/ui/modals/_internal/components/transactionDetails/index.d.ts +3 -3
  80. package/dist/react/ui/modals/_internal/components/transactionPreview/index.d.ts +3 -3
  81. package/dist/react/ui/modals/_internal/components/transactionStatusModal/index.d.ts +3 -3
  82. package/dist/react.js +2192 -1903
  83. package/dist/react.js.map +1 -1
  84. package/dist/token-balances.d.ts +28 -28
  85. package/dist/transaction-footer.js +1 -1
  86. package/dist/types/index.d.ts +1 -1
  87. package/dist/types/index.js +1 -1
  88. package/dist/types.d.ts +1 -1
  89. package/dist/url-state.js +1 -1
  90. package/dist/utils/index.js +1 -1
  91. package/dist/utils.js +20 -4
  92. package/dist/utils.js.map +1 -1
  93. package/package.json +7 -5
  94. package/src/react/hooks/config/useMarketplaceConfig.test.tsx +1 -0
  95. package/src/react/hooks/transactions/useCancelTransactionSteps.tsx +4 -1
  96. package/src/react/hooks/utils/useEnsureCorrectChain.ts +10 -5
  97. package/src/react/ui/modals/BuyModal/components/BuyModalContent.tsx +34 -31
  98. package/src/react/ui/modals/BuyModal/components/CryptoPaymentModal.tsx +74 -11
  99. package/src/react/ui/modals/BuyModal/components/Modal.tsx +62 -1
  100. package/src/react/ui/modals/BuyModal/hooks/useExecuteBundledTransactions.ts +13 -26
  101. package/src/react/ui/modals/BuyModal/internal/__tests__/buildTrailsMarketBuyActions.test.ts +213 -0
  102. package/src/react/ui/modals/BuyModal/internal/buildTrailsMarketBuyActions.ts +259 -0
  103. package/src/react/ui/modals/BuyModal/internal/buyModalContext.ts +79 -10
  104. package/src/react/ui/modals/BuyModal/internal/cryptoPaymentModalContext.tsx +44 -17
  105. package/src/react/ui/modals/MakeOfferModal/internal/context.ts +2 -1
  106. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +2 -1
  107. package/src/react/ui/modals/_internal/components/priceInput/index.tsx +12 -11
  108. package/src/react/ui/modals/_internal/helpers/currency.test.ts +27 -0
  109. package/src/react/ui/modals/_internal/helpers/currency.ts +4 -2
  110. package/src/utils/__tests__/getMarketplaceDetails.test.ts +10 -0
  111. package/src/utils/__tests__/getWebRPCErrorMessage.test.ts +28 -0
  112. package/src/utils/__tests__/marketplaceNormalization.test.ts +38 -0
  113. package/src/utils/getConduitAddressForOrderbook.ts +2 -10
  114. package/src/utils/getMarketplaceDetails.ts +11 -4
  115. package/src/utils/getWebRPCErrorMessage.ts +21 -0
  116. package/src/utils/normalizeMarketplace.ts +31 -0
@@ -1,4 +1,4 @@
1
- import { T as MarketplaceWalletType } from "./dist.js";
1
+ import { D as MarketplaceWalletType } from "./dist.js";
2
2
  import { t as networkToWagmiChain } from "./networkconfigToWagmiChain.js";
3
3
  import { n as MissingConfigError } from "./transaction.js";
4
4
  import { allNetworks, findNetworkConfig } from "@0xsequence/network";
package/dist/currency.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as findMarketCollection, u as compareAddress } from "./utils.js";
1
+ import { d as findMarketCollection, p as compareAddress } from "./utils.js";
2
2
  import { g as getQueryClient, r as getMarketplaceClient } from "./api.js";
3
3
  import { r as buildQueryOptions } from "./_internal.js";
4
4
  import { n as marketplaceConfigOptions } from "./config.js";
package/dist/dist.js CHANGED
@@ -459,152 +459,6 @@ function spreadWith(obj, overrides) {
459
459
  };
460
460
  }
461
461
 
462
- //#endregion
463
- //#region ../api/dist/transforms.js
464
- function toContractInfo(raw) {
465
- if (!raw.address || !raw.address.startsWith("0x") || raw.address.length !== 42) return;
466
- return spreadWith(raw, {
467
- chainId: normalizeChainId(raw.chainId),
468
- address: normalizeAddress(raw.address),
469
- extensions: transformOptional(raw.extensions, (ext) => {
470
- const result = { ...ext };
471
- if (ext.originChainId !== void 0) result.originChainId = normalizeChainId(ext.originChainId);
472
- if (ext.originAddress?.startsWith("0x") && ext.originAddress.length === 42) result.originAddress = normalizeAddress(ext.originAddress);
473
- return result;
474
- })
475
- });
476
- }
477
- function toTokenMetadata(raw) {
478
- return spreadWith(raw, {
479
- tokenId: normalizeTokenId(raw.tokenId),
480
- attributes: raw.attributes
481
- });
482
- }
483
- function toNativeTokenBalance(raw) {
484
- const result = {
485
- accountAddress: normalizeAddress(raw.accountAddress),
486
- chainId: normalizeChainId(raw.chainId),
487
- balance: BigInt(raw.balance)
488
- };
489
- if (raw.errorReason) result.errorReason = raw.errorReason;
490
- return result;
491
- }
492
- function toTokenBalance(raw) {
493
- const { tokenID, contractType, ...rest } = raw;
494
- return spreadWith(rest, {
495
- contractType,
496
- contractAddress: normalizeAddress(raw.contractAddress),
497
- accountAddress: normalizeAddress(raw.accountAddress),
498
- tokenId: raw.tokenID ? normalizeTokenId(raw.tokenID) : 0n,
499
- balance: BigInt(raw.balance),
500
- chainId: normalizeChainId(raw.chainId),
501
- contractInfo: transformOptional(raw.contractInfo, toContractInfo),
502
- tokenMetadata: transformOptional(raw.tokenMetadata, toTokenMetadata),
503
- uniqueCollectibles: transformOptional(raw.uniqueCollectibles, BigInt)
504
- });
505
- }
506
- function toTokenSupply(raw, contractAddress) {
507
- return {
508
- tokenId: normalizeTokenId(raw.tokenID),
509
- supply: BigInt(raw.supply),
510
- chainId: normalizeChainId(raw.chainId),
511
- contractAddress,
512
- contractInfo: transformOptional(raw.contractInfo, toContractInfo),
513
- tokenMetadata: transformOptional(raw.tokenMetadata, toTokenMetadata)
514
- };
515
- }
516
- function toTransactionReceipt(raw) {
517
- return spreadWith(raw, {
518
- effectiveGasPrice: BigInt(raw.effectiveGasPrice),
519
- from: raw.from?.startsWith("0x") && raw.from.length === 42 ? normalizeAddress(raw.from) : void 0,
520
- to: raw.to?.startsWith("0x") && raw.to.length === 42 ? normalizeAddress(raw.to) : void 0,
521
- logs: transformArray(raw.logs, (log) => {
522
- const { contractAddress, index, ...rest } = log;
523
- return spreadWith(rest, {
524
- address: normalizeAddress(contractAddress),
525
- logIndex: index
526
- });
527
- })
528
- });
529
- }
530
- function toTokenIDRange(raw) {
531
- return {
532
- startTokenId: normalizeTokenId(raw.start),
533
- endTokenId: normalizeTokenId(raw.end)
534
- };
535
- }
536
- function toPage(raw) {
537
- if (!raw) return {
538
- page: 0,
539
- pageSize: 0,
540
- more: false
541
- };
542
- return spreadWith(raw, {
543
- page: raw.page || 0,
544
- pageSize: raw.pageSize || 0,
545
- more: raw.more || false
546
- });
547
- }
548
- function toGetTokenBalancesResponse(raw) {
549
- return spreadWith(raw, {
550
- balances: transformArray(raw.balances, toTokenBalance),
551
- page: toPage(raw.page)
552
- });
553
- }
554
- function toGetTokenSuppliesResponse(raw, contractAddress) {
555
- const tokenIDs = transformOptionalArray(raw.tokenIDs, (tokenSupply) => toTokenSupply(tokenSupply, contractAddress)) || [];
556
- return spreadWith(raw, {
557
- contractAddress,
558
- tokenIDs,
559
- supplies: tokenIDs,
560
- page: toPage(raw.page)
561
- });
562
- }
563
- function toGetTokenIDRangesResponse(raw, contractAddress) {
564
- const tokenIDRanges = transformOptionalArray(raw.tokenIDRanges, toTokenIDRange) || [];
565
- return spreadWith(raw, {
566
- contractAddress,
567
- tokenIDRanges,
568
- ranges: tokenIDRanges
569
- });
570
- }
571
- function toGetTokenBalancesDetailsResponse(raw) {
572
- return spreadWith(raw, {
573
- page: toPage(raw.page),
574
- nativeBalances: (raw.nativeBalances || []).map(toNativeTokenBalance),
575
- balances: raw.balances.map(toTokenBalance)
576
- });
577
- }
578
- function toGetTokenBalancesByContractResponse(raw) {
579
- return spreadWith(raw, {
580
- page: toPage(raw.page),
581
- balances: raw.balances.map(toTokenBalance)
582
- });
583
- }
584
- function toGetNativeTokenBalanceResponse(raw) {
585
- return spreadWith(raw, { balance: toNativeTokenBalance(raw.balance) });
586
- }
587
- function toGetTokenBalancesArgs(req) {
588
- const { tokenId, ...rest } = req;
589
- const accountAddress = "userAddress" in req && req.userAddress ? req.userAddress : "accountAddress" in req ? req.accountAddress : void 0;
590
- const contractAddress = "collectionAddress" in req && req.collectionAddress ? req.collectionAddress : "contractAddress" in req && req.contractAddress ? req.contractAddress : void 0;
591
- return {
592
- ...rest,
593
- ...accountAddress && { accountAddress },
594
- ...contractAddress && { contractAddress },
595
- ...tokenId !== void 0 && { tokenID: tokenId.toString() }
596
- };
597
- }
598
- function toGetUserCollectionBalancesArgs(req) {
599
- return {
600
- filter: {
601
- accountAddresses: [req.userAddress],
602
- contractAddresses: [req.collectionAddress]
603
- },
604
- omitMetadata: req.includeMetadata === false ? true : void 0
605
- };
606
- }
607
-
608
462
  //#endregion
609
463
  //#region ../api/dist/marketplace.gen.js
610
464
  let SortOrder = /* @__PURE__ */ function(SortOrder$1) {
@@ -2015,6 +1869,152 @@ const webrpcErrorByCode = {
2015
1869
  const WebrpcHeader = "Webrpc";
2016
1870
  const WebrpcHeaderValue = "webrpc@v0.31.1;gen-typescript@v0.23.1;api-client@v0-25.11.10+051e186";
2017
1871
 
1872
+ //#endregion
1873
+ //#region ../api/dist/transforms.js
1874
+ function toContractInfo(raw) {
1875
+ if (!raw.address || !raw.address.startsWith("0x") || raw.address.length !== 42) return;
1876
+ return spreadWith(raw, {
1877
+ chainId: normalizeChainId(raw.chainId),
1878
+ address: normalizeAddress(raw.address),
1879
+ extensions: transformOptional(raw.extensions, (ext) => {
1880
+ const result = { ...ext };
1881
+ if (ext.originChainId !== void 0) result.originChainId = normalizeChainId(ext.originChainId);
1882
+ if (ext.originAddress?.startsWith("0x") && ext.originAddress.length === 42) result.originAddress = normalizeAddress(ext.originAddress);
1883
+ return result;
1884
+ })
1885
+ });
1886
+ }
1887
+ function toTokenMetadata(raw) {
1888
+ return spreadWith(raw, {
1889
+ tokenId: normalizeTokenId(raw.tokenId),
1890
+ attributes: raw.attributes
1891
+ });
1892
+ }
1893
+ function toNativeTokenBalance(raw) {
1894
+ const result = {
1895
+ accountAddress: normalizeAddress(raw.accountAddress),
1896
+ chainId: normalizeChainId(raw.chainId),
1897
+ balance: BigInt(raw.balance)
1898
+ };
1899
+ if (raw.errorReason) result.errorReason = raw.errorReason;
1900
+ return result;
1901
+ }
1902
+ function toTokenBalance(raw) {
1903
+ const { tokenID, contractType, ...rest } = raw;
1904
+ return spreadWith(rest, {
1905
+ contractType,
1906
+ contractAddress: normalizeAddress(raw.contractAddress),
1907
+ accountAddress: normalizeAddress(raw.accountAddress),
1908
+ tokenId: raw.tokenID ? normalizeTokenId(raw.tokenID) : 0n,
1909
+ balance: BigInt(raw.balance),
1910
+ chainId: normalizeChainId(raw.chainId),
1911
+ contractInfo: transformOptional(raw.contractInfo, toContractInfo),
1912
+ tokenMetadata: transformOptional(raw.tokenMetadata, toTokenMetadata),
1913
+ uniqueCollectibles: transformOptional(raw.uniqueCollectibles, BigInt)
1914
+ });
1915
+ }
1916
+ function toTokenSupply(raw, contractAddress) {
1917
+ return {
1918
+ tokenId: normalizeTokenId(raw.tokenID),
1919
+ supply: BigInt(raw.supply),
1920
+ chainId: normalizeChainId(raw.chainId),
1921
+ contractAddress,
1922
+ contractInfo: transformOptional(raw.contractInfo, toContractInfo),
1923
+ tokenMetadata: transformOptional(raw.tokenMetadata, toTokenMetadata)
1924
+ };
1925
+ }
1926
+ function toTransactionReceipt(raw) {
1927
+ return spreadWith(raw, {
1928
+ effectiveGasPrice: BigInt(raw.effectiveGasPrice),
1929
+ from: raw.from?.startsWith("0x") && raw.from.length === 42 ? normalizeAddress(raw.from) : void 0,
1930
+ to: raw.to?.startsWith("0x") && raw.to.length === 42 ? normalizeAddress(raw.to) : void 0,
1931
+ logs: transformArray(raw.logs, (log) => {
1932
+ const { contractAddress, index, ...rest } = log;
1933
+ return spreadWith(rest, {
1934
+ address: normalizeAddress(contractAddress),
1935
+ logIndex: index
1936
+ });
1937
+ })
1938
+ });
1939
+ }
1940
+ function toTokenIDRange(raw) {
1941
+ return {
1942
+ startTokenId: normalizeTokenId(raw.start),
1943
+ endTokenId: normalizeTokenId(raw.end)
1944
+ };
1945
+ }
1946
+ function toPage(raw) {
1947
+ if (!raw) return {
1948
+ page: 0,
1949
+ pageSize: 0,
1950
+ more: false
1951
+ };
1952
+ return spreadWith(raw, {
1953
+ page: raw.page || 0,
1954
+ pageSize: raw.pageSize || 0,
1955
+ more: raw.more || false
1956
+ });
1957
+ }
1958
+ function toGetTokenBalancesResponse(raw) {
1959
+ return spreadWith(raw, {
1960
+ balances: transformArray(raw.balances, toTokenBalance),
1961
+ page: toPage(raw.page)
1962
+ });
1963
+ }
1964
+ function toGetTokenSuppliesResponse(raw, contractAddress) {
1965
+ const tokenIDs = transformOptionalArray(raw.tokenIDs, (tokenSupply) => toTokenSupply(tokenSupply, contractAddress)) || [];
1966
+ return spreadWith(raw, {
1967
+ contractAddress,
1968
+ tokenIDs,
1969
+ supplies: tokenIDs,
1970
+ page: toPage(raw.page)
1971
+ });
1972
+ }
1973
+ function toGetTokenIDRangesResponse(raw, contractAddress) {
1974
+ const tokenIDRanges = transformOptionalArray(raw.tokenIDRanges, toTokenIDRange) || [];
1975
+ return spreadWith(raw, {
1976
+ contractAddress,
1977
+ tokenIDRanges,
1978
+ ranges: tokenIDRanges
1979
+ });
1980
+ }
1981
+ function toGetTokenBalancesDetailsResponse(raw) {
1982
+ return spreadWith(raw, {
1983
+ page: toPage(raw.page),
1984
+ nativeBalances: (raw.nativeBalances || []).map(toNativeTokenBalance),
1985
+ balances: raw.balances.map(toTokenBalance)
1986
+ });
1987
+ }
1988
+ function toGetTokenBalancesByContractResponse(raw) {
1989
+ return spreadWith(raw, {
1990
+ page: toPage(raw.page),
1991
+ balances: raw.balances.map(toTokenBalance)
1992
+ });
1993
+ }
1994
+ function toGetNativeTokenBalanceResponse(raw) {
1995
+ return spreadWith(raw, { balance: toNativeTokenBalance(raw.balance) });
1996
+ }
1997
+ function toGetTokenBalancesArgs(req) {
1998
+ const { tokenId, ...rest } = req;
1999
+ const accountAddress = "userAddress" in req && req.userAddress ? req.userAddress : "accountAddress" in req ? req.accountAddress : void 0;
2000
+ const contractAddress = "collectionAddress" in req && req.collectionAddress ? req.collectionAddress : "contractAddress" in req && req.contractAddress ? req.contractAddress : void 0;
2001
+ return {
2002
+ ...rest,
2003
+ ...accountAddress && { accountAddress },
2004
+ ...contractAddress && { contractAddress },
2005
+ ...tokenId !== void 0 && { tokenID: tokenId.toString() }
2006
+ };
2007
+ }
2008
+ function toGetUserCollectionBalancesArgs(req) {
2009
+ return {
2010
+ filter: {
2011
+ accountAddresses: [req.userAddress],
2012
+ contractAddresses: [req.collectionAddress]
2013
+ },
2014
+ omitMetadata: req.includeMetadata === false ? true : void 0
2015
+ };
2016
+ }
2017
+
2018
2018
  //#endregion
2019
2019
  //#region ../api/dist/transforms2.js
2020
2020
  function toBridgeInfo(raw) {
@@ -2128,6 +2128,12 @@ function toGetTokenMetadataPropertyFiltersReturn(raw) {
2128
2128
 
2129
2129
  //#endregion
2130
2130
  //#region ../api/dist/index.js
2131
+ function normalizeMarketplaceKind(kind) {
2132
+ return kind === MarketplaceKind.magic_eden ? MarketplaceKind.opensea : kind;
2133
+ }
2134
+ function normalizeOrderbookKind(kind) {
2135
+ return kind === OrderbookKind.magic_eden ? OrderbookKind.opensea : kind;
2136
+ }
2131
2137
  function toLookupMarketplaceReturn(data) {
2132
2138
  const marketCollections = transformArray(data.marketCollections, toMarketCollection);
2133
2139
  const shopCollections = transformArray(data.shopCollections, toShopCollection);
@@ -2154,7 +2160,7 @@ function toMarketCollection(data) {
2154
2160
  chainId: normalizeChainId(data.chainId),
2155
2161
  itemsAddress: normalizeAddress(data.itemsAddress),
2156
2162
  contractType: data.contractType,
2157
- destinationMarketplace: data.destinationMarketplace
2163
+ destinationMarketplace: normalizeOrderbookKind(data.destinationMarketplace)
2158
2164
  };
2159
2165
  }
2160
2166
  function toShopCollection(data) {
@@ -2407,6 +2413,7 @@ function toCurrencies(raw) {
2407
2413
  function toOrder(raw) {
2408
2414
  return {
2409
2415
  ...raw,
2416
+ marketplace: normalizeMarketplaceKind(raw.marketplace),
2410
2417
  priceCurrencyAddress: normalizeAddress(raw.priceCurrencyAddress)
2411
2418
  };
2412
2419
  }
@@ -2684,6 +2691,18 @@ function isTransactionStep(step) {
2684
2691
  StepType.createListing
2685
2692
  ].includes(step.id);
2686
2693
  }
2694
+ function isApprovalStep(step) {
2695
+ return step.id === StepType.tokenApproval;
2696
+ }
2697
+ function isBuyStep(step) {
2698
+ return step.id === StepType.buy;
2699
+ }
2700
+ function findApprovalStep(steps) {
2701
+ return steps.find(isApprovalStep);
2702
+ }
2703
+ function findBuyStep(steps) {
2704
+ return steps.find(isBuyStep);
2705
+ }
2687
2706
  /**
2688
2707
  * Wrapped Metadata Client
2689
2708
  *
@@ -2767,5 +2786,5 @@ var MetadataClient = class {
2767
2786
  };
2768
2787
 
2769
2788
  //#endregion
2770
- export { FilterCondition as C, WalletKind as S, MarketplaceWalletType as T, PropertyType as _, builder_exports as a, TransactionCrypto as b, CollectionStatus as c, MarketplaceKind as d, MetadataStatus as f, OrderbookKind as g, OrderStatus as h, MetadataClient as i, CurrencyStatus as l, OrderSide as m, IndexerClient as n, isSignatureStep as o, OfferType as p, MarketplaceClient as r, isTransactionStep as s, ContractType$2 as t, ExecuteType as u, SortOrder as v, MarketplaceService as w, TransactionOnRampProvider as x, StepType as y };
2789
+ export { TransactionOnRampProvider as C, MarketplaceWalletType as D, MarketplaceService as E, TransactionCrypto as S, FilterCondition as T, OrderStatus as _, builder_exports as a, SortOrder as b, isSignatureStep as c, CurrencyStatus as d, ExecuteType as f, OrderSide as g, OfferType as h, MetadataClient as i, isTransactionStep as l, MetadataStatus as m, IndexerClient as n, findApprovalStep as o, MarketplaceKind as p, MarketplaceClient as r, findBuyStep as s, ContractType$2 as t, CollectionStatus as u, OrderbookKind as v, WalletKind as w, StepType as x, PropertyType as y };
2771
2790
  //# sourceMappingURL=dist.js.map