@hypercerts-org/marketplace-sdk 0.3.1 → 0.3.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.
package/dist/index.cjs.js CHANGED
@@ -3,9 +3,9 @@
3
3
  var ethers = require('ethers');
4
4
  var contracts = require('@hypercerts-org/contracts');
5
5
  var merkletreejs = require('merkletreejs');
6
- var sdk = require('@hypercerts-org/sdk');
7
6
  var jsSha3 = require('js-sha3');
8
7
  var supabaseJs = require('@supabase/supabase-js');
8
+ var sdk = require('@hypercerts-org/sdk');
9
9
 
10
10
  var abiIERC721 = [
11
11
  {
@@ -1094,11 +1094,11 @@ var asDeployedChain$1 = /*#__PURE__*/Object.freeze({
1094
1094
  });
1095
1095
 
1096
1096
  const sepoliaAddresses = {
1097
- EXCHANGE_V2: sdk.deployments[11155111].addresses?.HypercertExchange,
1098
- TRANSFER_MANAGER_V2: sdk.deployments[11155111].addresses?.TransferManager,
1099
- ORDER_VALIDATOR_V2: sdk.deployments[11155111].addresses?.OrderValidator,
1097
+ EXCHANGE_V2: contracts.deployments[11155111].HypercertExchange,
1098
+ TRANSFER_MANAGER_V2: contracts.deployments[11155111].TransferManager,
1099
+ ORDER_VALIDATOR_V2: contracts.deployments[11155111].OrderValidatorV2A,
1100
1100
  WETH: "0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9",
1101
- MINTER: sdk.deployments[11155111].addresses?.HypercertMinterUUPS,
1101
+ MINTER: contracts.deployments[11155111].HypercertMinterUUPS,
1102
1102
  };
1103
1103
  /**
1104
1104
  * List of useful contract addresses
@@ -4888,8 +4888,8 @@ class ApiClient {
4888
4888
  const hypercertsClient = new sdk.HypercertClient({
4889
4889
  chain: { id: chainId },
4890
4890
  });
4891
- const fractions = await hypercertsClient.indexer.fractionsByClaim(hypercertId);
4892
- const tokenIds = fractions?.claimTokens.map((fraction) => fraction.tokenID) || [];
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
4893
  return supabaseHypercerts.from("marketplace_orders").select("*").containedBy("itemIds", tokenIds).throwOnError();
4894
4894
  };
4895
4895
  this.handleResponse = async (res) => {
package/dist/index.esm.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { Contract, ZeroAddress, AbiCoder, TypedDataEncoder, keccak256, solidityPackedKeccak256, ethers, ZeroHash, MaxUint256 } from 'ethers';
2
- import { HypercertExchangeAbi, TransferManagerAbi, OrderValidatorV2A as OrderValidatorV2A$1 } from '@hypercerts-org/contracts';
2
+ import { HypercertExchangeAbi, TransferManagerAbi, OrderValidatorV2A as OrderValidatorV2A$1, deployments } from '@hypercerts-org/contracts';
3
3
  import { MerkleTree } from 'merkletreejs';
4
- import { deployments, HypercertClient } from '@hypercerts-org/sdk';
5
4
  import { keccak256 as keccak256$1 } from 'js-sha3';
6
5
  import { createClient } from '@supabase/supabase-js';
6
+ import { HypercertClient } from '@hypercerts-org/sdk';
7
7
 
8
8
  var abiIERC721 = [
9
9
  {
@@ -1092,11 +1092,11 @@ var asDeployedChain$1 = /*#__PURE__*/Object.freeze({
1092
1092
  });
1093
1093
 
1094
1094
  const sepoliaAddresses = {
1095
- EXCHANGE_V2: deployments[11155111].addresses?.HypercertExchange,
1096
- TRANSFER_MANAGER_V2: deployments[11155111].addresses?.TransferManager,
1097
- ORDER_VALIDATOR_V2: deployments[11155111].addresses?.OrderValidator,
1095
+ EXCHANGE_V2: deployments[11155111].HypercertExchange,
1096
+ TRANSFER_MANAGER_V2: deployments[11155111].TransferManager,
1097
+ ORDER_VALIDATOR_V2: deployments[11155111].OrderValidatorV2A,
1098
1098
  WETH: "0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9",
1099
- MINTER: deployments[11155111].addresses?.HypercertMinterUUPS,
1099
+ MINTER: deployments[11155111].HypercertMinterUUPS,
1100
1100
  };
1101
1101
  /**
1102
1102
  * List of useful contract addresses
@@ -4886,8 +4886,8 @@ class ApiClient {
4886
4886
  const hypercertsClient = new HypercertClient({
4887
4887
  chain: { id: chainId },
4888
4888
  });
4889
- const fractions = await hypercertsClient.indexer.fractionsByClaim(hypercertId);
4890
- const tokenIds = fractions?.claimTokens.map((fraction) => fraction.tokenID) || [];
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
4891
  return supabaseHypercerts.from("marketplace_orders").select("*").containedBy("itemIds", tokenIds).throwOnError();
4892
4892
  };
4893
4893
  this.handleResponse = async (res) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypercerts-org/marketplace-sdk",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -47,7 +47,7 @@
47
47
  "devDependencies": {
48
48
  "@commitlint/cli": "^17.0.2",
49
49
  "@commitlint/config-conventional": "^17.0.2",
50
- "@hypercerts-org/contracts": "1.1.2",
50
+ "@hypercerts-org/contracts": "2.0.0-alpha.0",
51
51
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
52
52
  "@looksrare/contracts-exchange-v1": "^1.2.0",
53
53
  "@looksrare/contracts-exchange-v2": "^0.1.2",
@@ -91,7 +91,7 @@
91
91
  "typescript": "^5.3.3"
92
92
  },
93
93
  "dependencies": {
94
- "@hypercerts-org/sdk": "2.0.0-alpha.5",
94
+ "@hypercerts-org/sdk": "2.0.0-alpha.12",
95
95
  "@supabase/supabase-js": "^2.39.2",
96
96
  "ethers": "^6.6.2",
97
97
  "merkletreejs": "^0.3.9"