@hypercerts-org/marketplace-sdk 0.3.2 → 0.3.3

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
@@ -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
  {
@@ -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) {