@echoxyz/sonar-react 0.6.1 → 0.7.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @echoxyz/sonar-react
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f47a532: Replace EntityUUID + ObfuscatedEntityID in the API interface with a single EntityID
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [f47a532]
12
+ - @echoxyz/sonar-core@0.6.0
13
+
14
+ ## 0.6.2
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [bece3e6]
19
+ - @echoxyz/sonar-core@0.5.0
20
+
3
21
  ## 0.6.1
4
22
 
5
23
  ### Patch Changes
package/README.md CHANGED
@@ -121,15 +121,15 @@ const ExampleEntityPanel = () => {
121
121
 
122
122
  ```tsx
123
123
  function Example({
124
- entityUUID,
124
+ entityID,
125
125
  walletAddress,
126
126
  }: {
127
- entityUUID: string;
127
+ entityID: string;
128
128
  walletAddress: string;
129
129
  }) {
130
130
  const sonarPurchaser = useSonarPurchase({
131
131
  saleUUID: sonarConfig.saleUUID,
132
- entityUUID,
132
+ entityID,
133
133
  entityType,
134
134
  walletAddress,
135
135
  });
package/dist/index.cjs CHANGED
@@ -193,7 +193,7 @@ function useSonarEntity(args) {
193
193
  }
194
194
  function useSonarPurchase(args) {
195
195
  const saleUUID = args.saleUUID;
196
- const entityUUID = args.entityUUID;
196
+ const entityID = args.entityID;
197
197
  const walletAddress = args.walletAddress;
198
198
  const client = useSonarClient();
199
199
  const [state, setState] = (0, import_react2.useState)({
@@ -204,10 +204,10 @@ function useSonarPurchase(args) {
204
204
  const generatePurchasePermit = (0, import_react2.useCallback)(() => {
205
205
  return client.generatePurchasePermit({
206
206
  saleUUID,
207
- entityUUID,
207
+ entityID,
208
208
  walletAddress
209
209
  });
210
- }, [client, saleUUID, entityUUID, walletAddress]);
210
+ }, [client, saleUUID, entityID, walletAddress]);
211
211
  (0, import_react2.useEffect)(() => {
212
212
  const fetchPurchaseData = async () => {
213
213
  setState({
@@ -218,7 +218,7 @@ function useSonarPurchase(args) {
218
218
  try {
219
219
  const response = await client.prePurchaseCheck({
220
220
  saleUUID,
221
- entityUUID,
221
+ entityID,
222
222
  walletAddress
223
223
  });
224
224
  if (response.ReadyToPurchase) {
@@ -247,7 +247,7 @@ function useSonarPurchase(args) {
247
247
  }
248
248
  };
249
249
  fetchPurchaseData();
250
- }, [saleUUID, entityUUID, walletAddress, client, generatePurchasePermit]);
250
+ }, [saleUUID, entityID, walletAddress, client, generatePurchasePermit]);
251
251
  return state;
252
252
  }
253
253
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
- import { SonarClient, EntityDetails, GeneratePurchasePermitResponse, PrePurchaseFailureReason } from '@echoxyz/sonar-core';
3
+ import { SonarClient, EntityDetails, GeneratePurchasePermitResponse, PrePurchaseFailureReason, Hex } from '@echoxyz/sonar-core';
4
4
 
5
5
  type SonarProviderProps = {
6
6
  children: React.ReactNode;
@@ -64,7 +64,7 @@ type UseSonarPurchaseResultLoading = {
64
64
  type UseSonarPurchaseResult = UseSonarPurchaseResultLoading | UseSonarPurchaseResultReadyToPurchase | UseSonarPurchaseResultNotReadyToPurchase | UseSonarPurchaseResultError;
65
65
  declare function useSonarPurchase(args: {
66
66
  saleUUID: string;
67
- entityUUID: string;
67
+ entityID: Hex;
68
68
  walletAddress: string;
69
69
  }): UseSonarPurchaseResult;
70
70
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
- import { SonarClient, EntityDetails, GeneratePurchasePermitResponse, PrePurchaseFailureReason } from '@echoxyz/sonar-core';
3
+ import { SonarClient, EntityDetails, GeneratePurchasePermitResponse, PrePurchaseFailureReason, Hex } from '@echoxyz/sonar-core';
4
4
 
5
5
  type SonarProviderProps = {
6
6
  children: React.ReactNode;
@@ -64,7 +64,7 @@ type UseSonarPurchaseResultLoading = {
64
64
  type UseSonarPurchaseResult = UseSonarPurchaseResultLoading | UseSonarPurchaseResultReadyToPurchase | UseSonarPurchaseResultNotReadyToPurchase | UseSonarPurchaseResultError;
65
65
  declare function useSonarPurchase(args: {
66
66
  saleUUID: string;
67
- entityUUID: string;
67
+ entityID: Hex;
68
68
  walletAddress: string;
69
69
  }): UseSonarPurchaseResult;
70
70
 
package/dist/index.js CHANGED
@@ -165,7 +165,7 @@ function useSonarEntity(args) {
165
165
  }
166
166
  function useSonarPurchase(args) {
167
167
  const saleUUID = args.saleUUID;
168
- const entityUUID = args.entityUUID;
168
+ const entityID = args.entityID;
169
169
  const walletAddress = args.walletAddress;
170
170
  const client = useSonarClient();
171
171
  const [state, setState] = useState2({
@@ -176,10 +176,10 @@ function useSonarPurchase(args) {
176
176
  const generatePurchasePermit = useCallback2(() => {
177
177
  return client.generatePurchasePermit({
178
178
  saleUUID,
179
- entityUUID,
179
+ entityID,
180
180
  walletAddress
181
181
  });
182
- }, [client, saleUUID, entityUUID, walletAddress]);
182
+ }, [client, saleUUID, entityID, walletAddress]);
183
183
  useEffect2(() => {
184
184
  const fetchPurchaseData = async () => {
185
185
  setState({
@@ -190,7 +190,7 @@ function useSonarPurchase(args) {
190
190
  try {
191
191
  const response = await client.prePurchaseCheck({
192
192
  saleUUID,
193
- entityUUID,
193
+ entityID,
194
194
  walletAddress
195
195
  });
196
196
  if (response.ReadyToPurchase) {
@@ -219,7 +219,7 @@ function useSonarPurchase(args) {
219
219
  }
220
220
  };
221
221
  fetchPurchaseData();
222
- }, [saleUUID, entityUUID, walletAddress, client, generatePurchasePermit]);
222
+ }, [saleUUID, entityID, walletAddress, client, generatePurchasePermit]);
223
223
  return state;
224
224
  }
225
225
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@echoxyz/sonar-react",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -16,7 +16,7 @@
16
16
  "react": ">=18"
17
17
  },
18
18
  "dependencies": {
19
- "@echoxyz/sonar-core": "0.4.1"
19
+ "@echoxyz/sonar-core": "0.6.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@testing-library/react": "^16.0.0",