emblem-vault-sdk 1.4.4 → 1.4.6
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 +1 -1
- package/dist/index.js +1 -1
- package/docs/bundle.js +1 -1
- package/package.json +5 -4
- package/tsconfig.json +2 -0
- package/types/index.d.ts +22 -0
- package/types/types.d.ts +120 -0
- package/types/utils.d.ts +18 -0
package/dist/bundle.js
CHANGED
|
@@ -684212,7 +684212,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
684212
684212
|
};
|
|
684213
684213
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
684214
684214
|
const utils_1 = require("./utils");
|
|
684215
|
-
const SDK_VERSION = '1.4.
|
|
684215
|
+
const SDK_VERSION = '1.4.6';
|
|
684216
684216
|
class EmblemVaultSDK {
|
|
684217
684217
|
constructor(apiKey, baseUrl) {
|
|
684218
684218
|
this.apiKey = apiKey;
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
35
|
const utils_1 = require("./utils");
|
|
36
|
-
const SDK_VERSION = '1.4.
|
|
36
|
+
const SDK_VERSION = '1.4.6';
|
|
37
37
|
class EmblemVaultSDK {
|
|
38
38
|
constructor(apiKey, baseUrl) {
|
|
39
39
|
this.apiKey = apiKey;
|
package/docs/bundle.js
CHANGED
|
@@ -684212,7 +684212,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
684212
684212
|
};
|
|
684213
684213
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
684214
684214
|
const utils_1 = require("./utils");
|
|
684215
|
-
const SDK_VERSION = '1.4.
|
|
684215
|
+
const SDK_VERSION = '1.4.6';
|
|
684216
684216
|
class EmblemVaultSDK {
|
|
684217
684217
|
constructor(apiKey, baseUrl) {
|
|
684218
684218
|
this.apiKey = apiKey;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emblem-vault-sdk",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.4.6",
|
|
4
|
+
"description": "Emble Vault Software Development Kit",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"bump:major": "node ./script/bump.js major",
|
|
@@ -11,11 +11,12 @@
|
|
|
11
11
|
"test:node": "JEST_ENV=node jest",
|
|
12
12
|
"test:browser": "JEST_ENV=browser jest",
|
|
13
13
|
"test:all": "npm run test:node && npm run test:browser",
|
|
14
|
-
"build": "tsc
|
|
15
|
-
"postbuild": "node ./script/version.js",
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"postbuild": "node ./script/version.js && mv dist/index.d.ts types/index.d.ts && mv dist/types.d.ts types/types.d.ts && mv dist/utils.d.ts types/utils.d.ts",
|
|
16
16
|
"bundle": "npm run build && browserify dist/index.js -o dist/bundle.js && cp dist/bundle.js docs/bundle.js",
|
|
17
17
|
"watch": "onchange 'src/*.ts' -- npm run bundle"
|
|
18
18
|
},
|
|
19
|
+
"types": "dist/index.d.ts",
|
|
19
20
|
"keywords": [],
|
|
20
21
|
"author": "",
|
|
21
22
|
"license": "MIT",
|
package/tsconfig.json
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
"strict": true, /* Enable all strict type-checking options. */
|
|
8
8
|
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
|
|
9
9
|
"resolveJsonModule": true, /* Include this to allow importing of .json files. */
|
|
10
|
+
"declaration": true, /* Generates corresponding '.d.ts' file. */
|
|
11
|
+
"declarationMap": false, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
|
10
12
|
"outDir": "./dist" /* Redirect output structure to the directory. */
|
|
11
13
|
},
|
|
12
14
|
"exclude": ["**/*.test.ts"]
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CuratedCollectionsResponse, MetaData, Vault } from './types';
|
|
2
|
+
declare class EmblemVaultSDK {
|
|
3
|
+
private apiKey;
|
|
4
|
+
private baseUrl;
|
|
5
|
+
constructor(apiKey: string, baseUrl?: string);
|
|
6
|
+
generateUploadUrl(): void;
|
|
7
|
+
getAssetMetadata(projectName: string, strict?: boolean): any[];
|
|
8
|
+
getAllProjects(): any[];
|
|
9
|
+
fetchCuratedContracts(hideUnMintable?: boolean, overrideFunc?: Function | boolean): Promise<CuratedCollectionsResponse>;
|
|
10
|
+
createCuratedVault(template: any): Promise<Vault>;
|
|
11
|
+
fetchMetadata(tokenId: string): Promise<MetaData>;
|
|
12
|
+
fetchVaultsOfType(vaultType: string, address: string): Promise<any>;
|
|
13
|
+
loadWeb3(): Promise<import("web3").default<import("web3-eth").RegisteredSubscription> | undefined>;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface Window {
|
|
17
|
+
EmblemVaultSDK: any;
|
|
18
|
+
web3: any;
|
|
19
|
+
ethereum: any;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export default EmblemVaultSDK;
|
package/types/types.d.ts
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export type ContractDetails = {
|
|
2
|
+
[key: string]: string;
|
|
3
|
+
};
|
|
4
|
+
export type Collection = {
|
|
5
|
+
id: number;
|
|
6
|
+
created_at: string;
|
|
7
|
+
contracts: ContractDetails;
|
|
8
|
+
name: string;
|
|
9
|
+
nativeAssets: string[];
|
|
10
|
+
mintable: boolean;
|
|
11
|
+
autoLoad: boolean;
|
|
12
|
+
addressChain: string;
|
|
13
|
+
collectionType: string;
|
|
14
|
+
loadTypes: string[];
|
|
15
|
+
description: string;
|
|
16
|
+
purchaseMethod: string;
|
|
17
|
+
showBalance: boolean;
|
|
18
|
+
balanceUrl: string;
|
|
19
|
+
price: number;
|
|
20
|
+
collectionChain: string;
|
|
21
|
+
balanceQty: number | null;
|
|
22
|
+
imageHandler: string;
|
|
23
|
+
loadingImages: string[];
|
|
24
|
+
placeholderImages: string[] | null;
|
|
25
|
+
balanceAfterLive: boolean;
|
|
26
|
+
balanceCheckers: string[] | null;
|
|
27
|
+
tokenIdScheme: string | null;
|
|
28
|
+
generateVaultBody: Function;
|
|
29
|
+
generateCreateTemplate: Function;
|
|
30
|
+
};
|
|
31
|
+
export interface MetaData {
|
|
32
|
+
collection_name?: string;
|
|
33
|
+
animation_url?: any;
|
|
34
|
+
_id?: any;
|
|
35
|
+
name?: any;
|
|
36
|
+
ipfs?: any;
|
|
37
|
+
tokenId?: any;
|
|
38
|
+
description?: any;
|
|
39
|
+
image?: any;
|
|
40
|
+
image_ipfs?: any;
|
|
41
|
+
ownedImage?: any;
|
|
42
|
+
addresses?: any;
|
|
43
|
+
network?: any;
|
|
44
|
+
attributes?: any[];
|
|
45
|
+
values?: any;
|
|
46
|
+
totalValue?: number;
|
|
47
|
+
private?: boolean;
|
|
48
|
+
external_url?: string;
|
|
49
|
+
status?: string;
|
|
50
|
+
claimedBy?: string;
|
|
51
|
+
youtube_url?: string;
|
|
52
|
+
ciphertextV2?: string;
|
|
53
|
+
live?: boolean;
|
|
54
|
+
nonce?: number;
|
|
55
|
+
signature?: string;
|
|
56
|
+
to?: string;
|
|
57
|
+
is_dynamic?: boolean;
|
|
58
|
+
platform?: string;
|
|
59
|
+
curation_status?: string;
|
|
60
|
+
origDescription?: string;
|
|
61
|
+
sealed?: boolean;
|
|
62
|
+
collectionAddress?: string;
|
|
63
|
+
targetAsset?: any;
|
|
64
|
+
targetContract?: any;
|
|
65
|
+
mintLocked?: boolean;
|
|
66
|
+
mintLockBlock?: number;
|
|
67
|
+
curatedIds?: any;
|
|
68
|
+
ownedBy?: string;
|
|
69
|
+
fraud?: boolean;
|
|
70
|
+
batchId?: number;
|
|
71
|
+
batch_index?: number;
|
|
72
|
+
success?: boolean;
|
|
73
|
+
coverImage?: string;
|
|
74
|
+
move_targetContract?: any;
|
|
75
|
+
move_targetAsset?: any;
|
|
76
|
+
project?: any;
|
|
77
|
+
background_color?: string;
|
|
78
|
+
ownershipInfo?: any;
|
|
79
|
+
alpha?: boolean;
|
|
80
|
+
}
|
|
81
|
+
export type Address = {
|
|
82
|
+
path?: string;
|
|
83
|
+
address: string;
|
|
84
|
+
coin: string;
|
|
85
|
+
derivationPath?: string;
|
|
86
|
+
};
|
|
87
|
+
export type ContentType = {
|
|
88
|
+
valid: boolean;
|
|
89
|
+
contentType: string;
|
|
90
|
+
extension: string;
|
|
91
|
+
embed: boolean;
|
|
92
|
+
};
|
|
93
|
+
export type TargetContract = {
|
|
94
|
+
"1": string;
|
|
95
|
+
name: string;
|
|
96
|
+
description?: string;
|
|
97
|
+
tokenId?: string;
|
|
98
|
+
};
|
|
99
|
+
export type TargetAsset = {
|
|
100
|
+
name: string;
|
|
101
|
+
image: string;
|
|
102
|
+
ownedImage: string;
|
|
103
|
+
contentType?: ContentType;
|
|
104
|
+
description?: string;
|
|
105
|
+
};
|
|
106
|
+
export type Vault = {
|
|
107
|
+
name: string;
|
|
108
|
+
version: number;
|
|
109
|
+
basePath: string;
|
|
110
|
+
pubkey: string;
|
|
111
|
+
addresses: Address[];
|
|
112
|
+
ciphertextV2: string;
|
|
113
|
+
targetContract: TargetContract;
|
|
114
|
+
targetAsset: TargetAsset;
|
|
115
|
+
tokenId: string;
|
|
116
|
+
to: string;
|
|
117
|
+
network: string;
|
|
118
|
+
live: boolean;
|
|
119
|
+
};
|
|
120
|
+
export type CuratedCollectionsResponse = Collection[];
|
package/types/utils.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const NFT_DATA: any;
|
|
2
|
+
export declare const pad: (num: string | any[], size: number) => string | null;
|
|
3
|
+
export declare const evaluateFacts: (allowed: boolean, facts: {
|
|
4
|
+
eval: any;
|
|
5
|
+
msg: string;
|
|
6
|
+
}[], msgCallback: any) => boolean;
|
|
7
|
+
export declare const metadataObj2Arr: (data: any) => any[];
|
|
8
|
+
export declare const metadataAllProjects: (projects: any[]) => any[];
|
|
9
|
+
export declare const fetchData: (url: string, apiKey: string, method?: string, body?: any) => Promise<any>;
|
|
10
|
+
export declare function generateAttributeTemplate(record: any): any;
|
|
11
|
+
export declare function generateImageTemplate(record: any): any;
|
|
12
|
+
export declare function generateTemplate(record: any): any;
|
|
13
|
+
export declare function templateGuard(input: {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
hasOwnProperty: (arg0: string) => any;
|
|
16
|
+
}): void;
|
|
17
|
+
export declare function genericGuard(input: any, type: string, key: string): void;
|
|
18
|
+
export declare const COIN_TO_NETWORK: any;
|