@hypercerts-org/marketplace-sdk 0.3.23 → 0.3.24

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.
@@ -283,4 +283,9 @@ export declare class HypercertExchangeClient {
283
283
  }): Promise<{
284
284
  success: boolean;
285
285
  }>;
286
+ /**
287
+ * Delete the order
288
+ * @param orderId Order ID
289
+ */
290
+ deleteOrder(orderId: string): Promise<boolean>;
286
291
  }
package/dist/index.cjs.js CHANGED
@@ -7606,6 +7606,20 @@ class ApiClient {
7606
7606
  .then((res) => this.handleResponse(res))
7607
7607
  .then((res) => res.data);
7608
7608
  };
7609
+ this.deleteOrder = async (orderId, signature) => {
7610
+ return fetch(`${this._baseUrl}/marketplace/orders`, {
7611
+ method: "DELETE",
7612
+ headers: {
7613
+ "Content-Type": "application/json",
7614
+ },
7615
+ body: JSON.stringify({
7616
+ orderId,
7617
+ signature,
7618
+ }),
7619
+ })
7620
+ .then((res) => this.handleResponse(res))
7621
+ .then((res) => res.success);
7622
+ };
7609
7623
  const url = baseUrl || `${sdk.CONSTANTS.ENDPOINTS[indexerEnvironment]}/v1`;
7610
7624
  if (!url) {
7611
7625
  throw new Error("No API URL provided");
@@ -8185,6 +8199,18 @@ class HypercertExchangeClient {
8185
8199
  chainId,
8186
8200
  });
8187
8201
  }
8202
+ /**
8203
+ * Delete the order
8204
+ * @param orderId Order ID
8205
+ */
8206
+ async deleteOrder(orderId) {
8207
+ const signer = this.getSigner();
8208
+ if (!signer) {
8209
+ throw new Error(`No signer address could be determined when deleting order ${orderId}`);
8210
+ }
8211
+ const signedMessage = await signer.signMessage(`Delete order ${orderId}`);
8212
+ return this.api.deleteOrder(orderId, signedMessage);
8213
+ }
8188
8214
  }
8189
8215
 
8190
8216
  const utils = {
package/dist/index.esm.js CHANGED
@@ -7604,6 +7604,20 @@ class ApiClient {
7604
7604
  .then((res) => this.handleResponse(res))
7605
7605
  .then((res) => res.data);
7606
7606
  };
7607
+ this.deleteOrder = async (orderId, signature) => {
7608
+ return fetch(`${this._baseUrl}/marketplace/orders`, {
7609
+ method: "DELETE",
7610
+ headers: {
7611
+ "Content-Type": "application/json",
7612
+ },
7613
+ body: JSON.stringify({
7614
+ orderId,
7615
+ signature,
7616
+ }),
7617
+ })
7618
+ .then((res) => this.handleResponse(res))
7619
+ .then((res) => res.success);
7620
+ };
7607
7621
  const url = baseUrl || `${CONSTANTS.ENDPOINTS[indexerEnvironment]}/v1`;
7608
7622
  if (!url) {
7609
7623
  throw new Error("No API URL provided");
@@ -8183,6 +8197,18 @@ class HypercertExchangeClient {
8183
8197
  chainId,
8184
8198
  });
8185
8199
  }
8200
+ /**
8201
+ * Delete the order
8202
+ * @param orderId Order ID
8203
+ */
8204
+ async deleteOrder(orderId) {
8205
+ const signer = this.getSigner();
8206
+ if (!signer) {
8207
+ throw new Error(`No signer address could be determined when deleting order ${orderId}`);
8208
+ }
8209
+ const signedMessage = await signer.signMessage(`Delete order ${orderId}`);
8210
+ return this.api.deleteOrder(orderId, signedMessage);
8211
+ }
8186
8212
  }
8187
8213
 
8188
8214
  const utils = {
@@ -61,7 +61,36 @@ export declare class ApiClient {
61
61
  chainId: unknown;
62
62
  amounts: number[];
63
63
  additionalParameters: string;
64
- hypercert: unknown;
64
+ hypercert: {
65
+ uri: string | null;
66
+ units: unknown;
67
+ token_id: unknown;
68
+ metadata: {
69
+ work_timeframe_to: unknown;
70
+ work_timeframe_from: unknown;
71
+ work_scope: string[] | null;
72
+ uri: string | null;
73
+ rights: string[] | null;
74
+ properties: unknown;
75
+ name: string | null;
76
+ impact_timeframe_to: unknown;
77
+ impact_timeframe_from: unknown;
78
+ impact_scope: string[] | null;
79
+ id: string;
80
+ external_url: string | null;
81
+ description: string | null;
82
+ contributors: string[] | null;
83
+ allow_list_uri: string | null;
84
+ } | null;
85
+ last_update_block_timestamp: unknown;
86
+ last_update_block_number: unknown;
87
+ id: string;
88
+ creation_block_timestamp: unknown;
89
+ creation_block_number: unknown;
90
+ contracts_id: string | null;
91
+ creator_address: string | null;
92
+ hypercert_id: string | null;
93
+ } | null;
65
94
  id: string;
66
95
  }[] | null | undefined>;
67
96
  /**
@@ -100,6 +129,7 @@ export declare class ApiClient {
100
129
  invalidated: boolean;
101
130
  validator_codes: OrderValidatorCode[];
102
131
  }[]>;
132
+ deleteOrder: (orderId: string, signature: string) => Promise<boolean>;
103
133
  }
104
134
  interface FetchOrderArgs {
105
135
  signer: `0x${string}`;
@@ -28,6 +28,35 @@ export declare const getOrders: ({ chainId, signer }: {
28
28
  chainId: unknown;
29
29
  amounts: number[];
30
30
  additionalParameters: string;
31
- hypercert: unknown;
31
+ hypercert: {
32
+ uri: string | null;
33
+ units: unknown;
34
+ token_id: unknown;
35
+ metadata: {
36
+ work_timeframe_to: unknown;
37
+ work_timeframe_from: unknown;
38
+ work_scope: string[] | null;
39
+ uri: string | null;
40
+ rights: string[] | null;
41
+ properties: unknown;
42
+ name: string | null;
43
+ impact_timeframe_to: unknown;
44
+ impact_timeframe_from: unknown;
45
+ impact_scope: string[] | null;
46
+ id: string;
47
+ external_url: string | null;
48
+ description: string | null;
49
+ contributors: string[] | null;
50
+ allow_list_uri: string | null;
51
+ } | null;
52
+ last_update_block_timestamp: unknown;
53
+ last_update_block_number: unknown;
54
+ id: string;
55
+ creation_block_timestamp: unknown;
56
+ creation_block_number: unknown;
57
+ contracts_id: string | null;
58
+ creator_address: string | null;
59
+ hypercert_id: string | null;
60
+ } | null;
32
61
  id: string;
33
62
  }[] | null | undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypercerts-org/marketplace-sdk",
3
- "version": "0.3.23",
3
+ "version": "0.3.24",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",