@hypercerts-org/marketplace-sdk 0.3.2 → 0.3.4

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.js CHANGED
@@ -702,7 +702,7 @@ exports.CollectionType = void 0;
702
702
  exports.StrategyType = void 0;
703
703
  (function (StrategyType) {
704
704
  StrategyType[StrategyType["standard"] = 0] = "standard";
705
- StrategyType[StrategyType["collection"] = 1] = "collection";
705
+ StrategyType[StrategyType["collection"] = 10] = "collection";
706
706
  StrategyType[StrategyType["collectionWithMerkleTree"] = 2] = "collectionWithMerkleTree";
707
707
  StrategyType[StrategyType["dutchAuction"] = 4] = "dutchAuction";
708
708
  StrategyType[StrategyType["itemIdsRange"] = 5] = "itemIdsRange";
@@ -710,7 +710,7 @@ exports.StrategyType = void 0;
710
710
  StrategyType[StrategyType["hypercertCollectionOfferWithProof"] = 7] = "hypercertCollectionOfferWithProof";
711
711
  StrategyType[StrategyType["hypercertCollectionOfferWithAllowlist"] = 8] = "hypercertCollectionOfferWithAllowlist";
712
712
  StrategyType[StrategyType["hypercertDutchAuction"] = 9] = "hypercertDutchAuction";
713
- StrategyType[StrategyType["hypercertFractionOffer"] = 10] = "hypercertFractionOffer";
713
+ StrategyType[StrategyType["hypercertFractionOffer"] = 1] = "hypercertFractionOffer";
714
714
  StrategyType[StrategyType["hypercertFractionOfferWithAllowlist"] = 11] = "hypercertFractionOfferWithAllowlist";
715
715
  })(exports.StrategyType || (exports.StrategyType = {}));
716
716
  /** Type for maker order */
@@ -4884,13 +4884,14 @@ class ApiClient {
4884
4884
  * @param hypercertId Hypercert ID
4885
4885
  * @param chainId Chain ID
4886
4886
  */
4887
- this.fetchOrdersByHypercertId = async ({ hypercertId, chainId }) => {
4887
+ this.fetchOrdersByHypercertId = async ({ hypercertId }) => {
4888
4888
  const hypercertsClient = new sdk.HypercertClient({
4889
- chain: { id: chainId },
4889
+ environment: "test",
4890
4890
  });
4891
4891
  const fractions = await hypercertsClient.indexer.fractionsByHypercert({ hypercertId });
4892
- const tokenIds = fractions?.hypercerts.data?.flatMap((hypercert) => hypercert.fractions?.data?.map((fraction) => fraction.hypercert_id)) || [];
4893
- return supabaseHypercerts.from("marketplace_orders").select("*").containedBy("itemIds", tokenIds).throwOnError();
4892
+ const tokenIds = fractions?.hypercerts.data?.flatMap((hypercert) => hypercert.fractions?.data?.map((fraction) => sdk.parseClaimOrFractionId(fraction.hypercert_id).id)) || [];
4893
+ const result = await supabaseHypercerts.from("marketplace_orders").select("*").overlaps("itemIds", tokenIds);
4894
+ return result;
4894
4895
  };
4895
4896
  this.handleResponse = async (res) => {
4896
4897
  if (!res.ok) {
package/dist/index.esm.js CHANGED
@@ -3,7 +3,7 @@ import { HypercertExchangeAbi, TransferManagerAbi, OrderValidatorV2A as OrderVal
3
3
  import { MerkleTree } from 'merkletreejs';
4
4
  import { keccak256 as keccak256$1 } from 'js-sha3';
5
5
  import { createClient } from '@supabase/supabase-js';
6
- import { HypercertClient } from '@hypercerts-org/sdk';
6
+ import { HypercertClient, parseClaimOrFractionId } from '@hypercerts-org/sdk';
7
7
 
8
8
  var abiIERC721 = [
9
9
  {
@@ -700,7 +700,7 @@ var CollectionType;
700
700
  var StrategyType;
701
701
  (function (StrategyType) {
702
702
  StrategyType[StrategyType["standard"] = 0] = "standard";
703
- StrategyType[StrategyType["collection"] = 1] = "collection";
703
+ StrategyType[StrategyType["collection"] = 10] = "collection";
704
704
  StrategyType[StrategyType["collectionWithMerkleTree"] = 2] = "collectionWithMerkleTree";
705
705
  StrategyType[StrategyType["dutchAuction"] = 4] = "dutchAuction";
706
706
  StrategyType[StrategyType["itemIdsRange"] = 5] = "itemIdsRange";
@@ -708,7 +708,7 @@ var StrategyType;
708
708
  StrategyType[StrategyType["hypercertCollectionOfferWithProof"] = 7] = "hypercertCollectionOfferWithProof";
709
709
  StrategyType[StrategyType["hypercertCollectionOfferWithAllowlist"] = 8] = "hypercertCollectionOfferWithAllowlist";
710
710
  StrategyType[StrategyType["hypercertDutchAuction"] = 9] = "hypercertDutchAuction";
711
- StrategyType[StrategyType["hypercertFractionOffer"] = 10] = "hypercertFractionOffer";
711
+ StrategyType[StrategyType["hypercertFractionOffer"] = 1] = "hypercertFractionOffer";
712
712
  StrategyType[StrategyType["hypercertFractionOfferWithAllowlist"] = 11] = "hypercertFractionOfferWithAllowlist";
713
713
  })(StrategyType || (StrategyType = {}));
714
714
  /** Type for maker order */
@@ -4882,13 +4882,14 @@ class ApiClient {
4882
4882
  * @param hypercertId Hypercert ID
4883
4883
  * @param chainId Chain ID
4884
4884
  */
4885
- this.fetchOrdersByHypercertId = async ({ hypercertId, chainId }) => {
4885
+ this.fetchOrdersByHypercertId = async ({ hypercertId }) => {
4886
4886
  const hypercertsClient = new HypercertClient({
4887
- chain: { id: chainId },
4887
+ environment: "test",
4888
4888
  });
4889
4889
  const fractions = await hypercertsClient.indexer.fractionsByHypercert({ hypercertId });
4890
- const tokenIds = fractions?.hypercerts.data?.flatMap((hypercert) => hypercert.fractions?.data?.map((fraction) => fraction.hypercert_id)) || [];
4891
- return supabaseHypercerts.from("marketplace_orders").select("*").containedBy("itemIds", tokenIds).throwOnError();
4890
+ const tokenIds = fractions?.hypercerts.data?.flatMap((hypercert) => hypercert.fractions?.data?.map((fraction) => parseClaimOrFractionId(fraction.hypercert_id).id)) || [];
4891
+ const result = await supabaseHypercerts.from("marketplace_orders").select("*").overlaps("itemIds", tokenIds);
4892
+ return result;
4892
4893
  };
4893
4894
  this.handleResponse = async (res) => {
4894
4895
  if (!res.ok) {
package/dist/types.d.ts CHANGED
@@ -32,7 +32,7 @@ export declare enum CollectionType {
32
32
  /** List of trading strategies */
33
33
  export declare enum StrategyType {
34
34
  standard = 0,
35
- collection = 1,
35
+ collection = 10,
36
36
  collectionWithMerkleTree = 2,
37
37
  dutchAuction = 4,
38
38
  itemIdsRange = 5,
@@ -40,7 +40,7 @@ export declare enum StrategyType {
40
40
  hypercertCollectionOfferWithProof = 7,
41
41
  hypercertCollectionOfferWithAllowlist = 8,
42
42
  hypercertDutchAuction = 9,
43
- hypercertFractionOffer = 10,
43
+ hypercertFractionOffer = 1,
44
44
  hypercertFractionOfferWithAllowlist = 11
45
45
  }
46
46
  /** Type for maker order */