@human-protocol/sdk 4.1.5 → 4.3.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/dist/base.d.ts +10 -1
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +21 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +10 -8
- package/dist/error.d.ts +2 -2
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +3 -3
- package/dist/escrow.d.ts +6 -6
- package/dist/escrow.d.ts.map +1 -1
- package/dist/escrow.js +23 -24
- package/dist/graphql/queries/escrow.js +1 -1
- package/dist/interfaces.d.ts +2 -2
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/kvstore.d.ts +25 -0
- package/dist/kvstore.d.ts.map +1 -1
- package/dist/kvstore.js +42 -3
- package/dist/staking.d.ts.map +1 -1
- package/dist/staking.js +6 -5
- package/dist/utils.d.ts +7 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +17 -1
- package/package.json +6 -6
- package/src/base.ts +23 -1
- package/src/constants.ts +10 -7
- package/src/error.ts +2 -2
- package/src/escrow.ts +44 -27
- package/src/graphql/queries/escrow.ts +1 -1
- package/src/interfaces.ts +2 -2
- package/src/kvstore.ts +47 -3
- package/src/staking.ts +18 -5
- package/src/utils.ts +15 -0
package/src/utils.ts
CHANGED
|
@@ -54,6 +54,21 @@ export const isValidUrl = (url: string) => {
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* **Check if a string is a valid JSON.*
|
|
59
|
+
*
|
|
60
|
+
* @param {string} input
|
|
61
|
+
* @returns {boolean}
|
|
62
|
+
*/
|
|
63
|
+
export const isValidJson = (input: string): boolean => {
|
|
64
|
+
try {
|
|
65
|
+
JSON.parse(input);
|
|
66
|
+
return true;
|
|
67
|
+
} catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
57
72
|
/**
|
|
58
73
|
* **Get the subgraph URL.*
|
|
59
74
|
*
|