emblem-vault-sdk 1.7.7 → 1.7.8
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/bundle.js +6 -36
- package/dist/index.js +1 -1
- package/dist/utils.js +0 -1
- package/docs/bundle.js +6 -36
- package/package.json +5 -3
- package/src/utils.ts +0 -1
- package/tests/EmblemVaultSdk.test.ts +5 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emblem-vault-sdk",
|
|
3
|
-
"version": "1.7.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.7.8",
|
|
4
|
+
"description": "Emblem Vault Software Development Kit",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"bump:major": "node ./script/bump.js major",
|
|
@@ -33,7 +33,9 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@ethersproject/bignumber": "^5.7.0",
|
|
36
|
-
"node-fetch": "^2.6.6",
|
|
37
36
|
"web3": "^4.4.0"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=20.11.0"
|
|
38
40
|
}
|
|
39
41
|
}
|
package/src/utils.ts
CHANGED
|
@@ -37,7 +37,6 @@ export const metadataAllProjects = (projects: any[]) => projects.reduce((unique:
|
|
|
37
37
|
}, []);
|
|
38
38
|
|
|
39
39
|
export const fetchData = async (url: string, apiKey: string, method: string = 'GET', body: any = null) => {
|
|
40
|
-
const fetch = typeof window !== 'undefined' && typeof window.fetch === 'function' ? window.fetch : require('node-fetch');
|
|
41
40
|
const options: any = {
|
|
42
41
|
method: method,
|
|
43
42
|
headers: { 'x-api-key': apiKey },
|
|
@@ -18,7 +18,7 @@ describe('EmblemVaultSDK', () => {
|
|
|
18
18
|
test('should get curated contracts', async () => {
|
|
19
19
|
const sdk = new EmblemVaultSDK(apiKey);
|
|
20
20
|
const contracts = await sdk.fetchCuratedContracts();
|
|
21
|
-
expect(contracts).
|
|
21
|
+
expect(Array.isArray(contracts)).toBeTruthy();
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
test('should make template with functions', async () => {
|
|
@@ -44,15 +44,16 @@ describe('EmblemVaultSDK', () => {
|
|
|
44
44
|
test('should fetch metadata', async () => {
|
|
45
45
|
const sdk = new EmblemVaultSDK(apiKey);
|
|
46
46
|
const metadata = await sdk.fetchMetadata("1337");
|
|
47
|
-
expect(metadata).
|
|
47
|
+
expect(typeof metadata).toEqual('object');
|
|
48
48
|
expect(metadata.name).toEqual("Patrick's Birthday Vault");
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
test('should fetch vaults of type', async () => {
|
|
52
52
|
const sdk = new EmblemVaultSDK(apiKey);
|
|
53
53
|
const vaults = await sdk.fetchVaultsOfType("created", TEST_ADDRESS);
|
|
54
|
-
expect(vaults).
|
|
55
|
-
|
|
54
|
+
expect(Array.isArray(vaults)).toBeTruthy();
|
|
55
|
+
// todo: test for a non-zero value address
|
|
56
|
+
expect(vaults.length).toBeGreaterThanOrEqual(0);
|
|
56
57
|
});
|
|
57
58
|
});
|
|
58
59
|
|