@dashevo/evo-sdk 2.1.0-dev.7 → 2.1.0-dev.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/sdk.d.ts CHANGED
@@ -62,4 +62,4 @@ export { SystemFacade } from './system/facade.js';
62
62
  export { GroupFacade } from './group/facade.js';
63
63
  export { VotingFacade } from './voting/facade.js';
64
64
  export { wallet } from './wallet/functions.js';
65
- export { verifyIdentityResponse, verifyDataContract, verifyDocuments, start } from './wasm.js';
65
+ export * from './wasm.js';
package/dist/sdk.js CHANGED
@@ -100,4 +100,4 @@ export { SystemFacade } from './system/facade.js';
100
100
  export { GroupFacade } from './group/facade.js';
101
101
  export { VotingFacade } from './voting/facade.js';
102
102
  export { wallet } from './wallet/functions.js';
103
- export { verifyIdentityResponse, verifyDataContract, verifyDocuments, start } from './wasm.js';
103
+ export * from './wasm.js';
@@ -2,7 +2,7 @@ import type { EvoSDK } from '../sdk.js';
2
2
  export declare class TokensFacade {
3
3
  private sdk;
4
4
  constructor(sdk: EvoSDK);
5
- calculateId(contractId: string, tokenPosition: number): string;
5
+ calculateId(contractId: string, tokenPosition: number): Promise<string>;
6
6
  priceByContract(contractId: string, tokenPosition: number): Promise<any>;
7
7
  totalSupply(tokenId: string): Promise<any>;
8
8
  totalSupplyWithProof(tokenId: string): Promise<any>;
@@ -4,7 +4,8 @@ export class TokensFacade {
4
4
  constructor(sdk) {
5
5
  this.sdk = sdk;
6
6
  }
7
- calculateId(contractId, tokenPosition) {
7
+ async calculateId(contractId, tokenPosition) {
8
+ await wasm.ensureInitialized();
8
9
  return wasm.WasmSdk.calculateTokenIdFromContract(contractId, tokenPosition);
9
10
  }
10
11
  // Queries
@@ -1,24 +1,24 @@
1
1
  export declare namespace wallet {
2
- function generateMnemonic(wordCount?: number, languageCode?: string): string;
3
- function validateMnemonic(mnemonic: string, languageCode?: string): boolean;
4
- function mnemonicToSeed(mnemonic: string, passphrase?: string): Uint8Array;
5
- function deriveKeyFromSeedPhrase(mnemonic: string, passphrase: string | null | undefined, network: string): any;
6
- function deriveKeyFromSeedWithPath(mnemonic: string, passphrase: string | null | undefined, path: string, network: string): any;
7
- function deriveKeyFromSeedWithExtendedPath(mnemonic: string, passphrase: string | null | undefined, path: string, network: string): any;
8
- function deriveDashpayContactKey(mnemonic: string, passphrase: string | null | undefined, senderIdentityId: string, receiverIdentityId: string, account: number, addressIndex: number, network: string): any;
9
- function derivationPathBip44Mainnet(account: number, change: number, index: number): any;
10
- function derivationPathBip44Testnet(account: number, change: number, index: number): any;
11
- function derivationPathDip9Mainnet(featureType: number, account: number, index: number): any;
12
- function derivationPathDip9Testnet(featureType: number, account: number, index: number): any;
13
- function derivationPathDip13Mainnet(account: number): any;
14
- function derivationPathDip13Testnet(account: number): any;
15
- function deriveChildPublicKey(xpub: string, index: number, hardened: boolean): string;
16
- function xprvToXpub(xprv: string): string;
17
- function generateKeyPair(network: string): any;
18
- function generateKeyPairs(network: string, count: number): any[];
19
- function keyPairFromWif(privateKeyWif: string): any;
20
- function keyPairFromHex(privateKeyHex: string, network: string): any;
21
- function pubkeyToAddress(pubkeyHex: string, network: string): string;
22
- function validateAddress(address: string, network: string): boolean;
23
- function signMessage(message: string, privateKeyWif: string): string;
2
+ function generateMnemonic(wordCount?: number, languageCode?: string): Promise<string>;
3
+ function validateMnemonic(mnemonic: string, languageCode?: string): Promise<boolean>;
4
+ function mnemonicToSeed(mnemonic: string, passphrase?: string): Promise<Uint8Array>;
5
+ function deriveKeyFromSeedPhrase(mnemonic: string, passphrase: string | null | undefined, network: string): Promise<any>;
6
+ function deriveKeyFromSeedWithPath(mnemonic: string, passphrase: string | null | undefined, path: string, network: string): Promise<any>;
7
+ function deriveKeyFromSeedWithExtendedPath(mnemonic: string, passphrase: string | null | undefined, path: string, network: string): Promise<any>;
8
+ function deriveDashpayContactKey(mnemonic: string, passphrase: string | null | undefined, senderIdentityId: string, receiverIdentityId: string, account: number, addressIndex: number, network: string): Promise<any>;
9
+ function derivationPathBip44Mainnet(account: number, change: number, index: number): Promise<any>;
10
+ function derivationPathBip44Testnet(account: number, change: number, index: number): Promise<any>;
11
+ function derivationPathDip9Mainnet(featureType: number, account: number, index: number): Promise<any>;
12
+ function derivationPathDip9Testnet(featureType: number, account: number, index: number): Promise<any>;
13
+ function derivationPathDip13Mainnet(account: number): Promise<any>;
14
+ function derivationPathDip13Testnet(account: number): Promise<any>;
15
+ function deriveChildPublicKey(xpub: string, index: number, hardened: boolean): Promise<string>;
16
+ function xprvToXpub(xprv: string): Promise<string>;
17
+ function generateKeyPair(network: string): Promise<any>;
18
+ function generateKeyPairs(network: string, count: number): Promise<any[]>;
19
+ function keyPairFromWif(privateKeyWif: string): Promise<any>;
20
+ function keyPairFromHex(privateKeyHex: string, network: string): Promise<any>;
21
+ function pubkeyToAddress(pubkeyHex: string, network: string): Promise<string>;
22
+ function validateAddress(address: string, network: string): Promise<boolean>;
23
+ function signMessage(message: string, privateKeyWif: string): Promise<string>;
24
24
  }
@@ -1,91 +1,113 @@
1
1
  import * as wasm from '../wasm.js';
2
2
  export var wallet;
3
3
  (function (wallet) {
4
- function generateMnemonic(wordCount, languageCode) {
4
+ async function generateMnemonic(wordCount, languageCode) {
5
+ await wasm.ensureInitialized();
5
6
  return wasm.WasmSdk.generateMnemonic(wordCount ?? null, languageCode ?? null);
6
7
  }
7
8
  wallet.generateMnemonic = generateMnemonic;
8
- function validateMnemonic(mnemonic, languageCode) {
9
+ async function validateMnemonic(mnemonic, languageCode) {
10
+ await wasm.ensureInitialized();
9
11
  return wasm.WasmSdk.validateMnemonic(mnemonic, languageCode ?? null);
10
12
  }
11
13
  wallet.validateMnemonic = validateMnemonic;
12
- function mnemonicToSeed(mnemonic, passphrase) {
14
+ async function mnemonicToSeed(mnemonic, passphrase) {
15
+ await wasm.ensureInitialized();
13
16
  return wasm.WasmSdk.mnemonicToSeed(mnemonic, passphrase ?? null);
14
17
  }
15
18
  wallet.mnemonicToSeed = mnemonicToSeed;
16
- function deriveKeyFromSeedPhrase(mnemonic, passphrase, network) {
19
+ async function deriveKeyFromSeedPhrase(mnemonic, passphrase, network) {
20
+ await wasm.ensureInitialized();
17
21
  return wasm.WasmSdk.deriveKeyFromSeedPhrase(mnemonic, passphrase ?? null, network);
18
22
  }
19
23
  wallet.deriveKeyFromSeedPhrase = deriveKeyFromSeedPhrase;
20
- function deriveKeyFromSeedWithPath(mnemonic, passphrase, path, network) {
24
+ async function deriveKeyFromSeedWithPath(mnemonic, passphrase, path, network) {
25
+ await wasm.ensureInitialized();
21
26
  return wasm.WasmSdk.deriveKeyFromSeedWithPath(mnemonic, passphrase ?? null, path, network);
22
27
  }
23
28
  wallet.deriveKeyFromSeedWithPath = deriveKeyFromSeedWithPath;
24
- function deriveKeyFromSeedWithExtendedPath(mnemonic, passphrase, path, network) {
29
+ async function deriveKeyFromSeedWithExtendedPath(mnemonic, passphrase, path, network) {
30
+ await wasm.ensureInitialized();
25
31
  return wasm.WasmSdk.deriveKeyFromSeedWithExtendedPath(mnemonic, passphrase ?? null, path, network);
26
32
  }
27
33
  wallet.deriveKeyFromSeedWithExtendedPath = deriveKeyFromSeedWithExtendedPath;
28
- function deriveDashpayContactKey(mnemonic, passphrase, senderIdentityId, receiverIdentityId, account, addressIndex, network) {
34
+ async function deriveDashpayContactKey(mnemonic, passphrase, senderIdentityId, receiverIdentityId, account, addressIndex, network) {
35
+ await wasm.ensureInitialized();
29
36
  return wasm.WasmSdk.deriveDashpayContactKey(mnemonic, passphrase ?? null, senderIdentityId, receiverIdentityId, account, addressIndex, network);
30
37
  }
31
38
  wallet.deriveDashpayContactKey = deriveDashpayContactKey;
32
- function derivationPathBip44Mainnet(account, change, index) {
39
+ async function derivationPathBip44Mainnet(account, change, index) {
40
+ await wasm.ensureInitialized();
33
41
  return wasm.WasmSdk.derivationPathBip44Mainnet(account, change, index);
34
42
  }
35
43
  wallet.derivationPathBip44Mainnet = derivationPathBip44Mainnet;
36
- function derivationPathBip44Testnet(account, change, index) {
44
+ async function derivationPathBip44Testnet(account, change, index) {
45
+ await wasm.ensureInitialized();
37
46
  return wasm.WasmSdk.derivationPathBip44Testnet(account, change, index);
38
47
  }
39
48
  wallet.derivationPathBip44Testnet = derivationPathBip44Testnet;
40
- function derivationPathDip9Mainnet(featureType, account, index) {
49
+ async function derivationPathDip9Mainnet(featureType, account, index) {
50
+ await wasm.ensureInitialized();
41
51
  return wasm.WasmSdk.derivationPathDip9Mainnet(featureType, account, index);
42
52
  }
43
53
  wallet.derivationPathDip9Mainnet = derivationPathDip9Mainnet;
44
- function derivationPathDip9Testnet(featureType, account, index) {
54
+ async function derivationPathDip9Testnet(featureType, account, index) {
55
+ await wasm.ensureInitialized();
45
56
  return wasm.WasmSdk.derivationPathDip9Testnet(featureType, account, index);
46
57
  }
47
58
  wallet.derivationPathDip9Testnet = derivationPathDip9Testnet;
48
- function derivationPathDip13Mainnet(account) {
59
+ async function derivationPathDip13Mainnet(account) {
60
+ await wasm.ensureInitialized();
49
61
  return wasm.WasmSdk.derivationPathDip13Mainnet(account);
50
62
  }
51
63
  wallet.derivationPathDip13Mainnet = derivationPathDip13Mainnet;
52
- function derivationPathDip13Testnet(account) {
64
+ async function derivationPathDip13Testnet(account) {
65
+ await wasm.ensureInitialized();
53
66
  return wasm.WasmSdk.derivationPathDip13Testnet(account);
54
67
  }
55
68
  wallet.derivationPathDip13Testnet = derivationPathDip13Testnet;
56
- function deriveChildPublicKey(xpub, index, hardened) {
69
+ async function deriveChildPublicKey(xpub, index, hardened) {
70
+ await wasm.ensureInitialized();
57
71
  return wasm.WasmSdk.deriveChildPublicKey(xpub, index, hardened);
58
72
  }
59
73
  wallet.deriveChildPublicKey = deriveChildPublicKey;
60
- function xprvToXpub(xprv) {
74
+ async function xprvToXpub(xprv) {
75
+ await wasm.ensureInitialized();
61
76
  return wasm.WasmSdk.xprvToXpub(xprv);
62
77
  }
63
78
  wallet.xprvToXpub = xprvToXpub;
64
- function generateKeyPair(network) {
79
+ async function generateKeyPair(network) {
80
+ await wasm.ensureInitialized();
65
81
  return wasm.WasmSdk.generateKeyPair(network);
66
82
  }
67
83
  wallet.generateKeyPair = generateKeyPair;
68
- function generateKeyPairs(network, count) {
84
+ async function generateKeyPairs(network, count) {
85
+ await wasm.ensureInitialized();
69
86
  return wasm.WasmSdk.generateKeyPairs(network, count);
70
87
  }
71
88
  wallet.generateKeyPairs = generateKeyPairs;
72
- function keyPairFromWif(privateKeyWif) {
89
+ async function keyPairFromWif(privateKeyWif) {
90
+ await wasm.ensureInitialized();
73
91
  return wasm.WasmSdk.keyPairFromWif(privateKeyWif);
74
92
  }
75
93
  wallet.keyPairFromWif = keyPairFromWif;
76
- function keyPairFromHex(privateKeyHex, network) {
94
+ async function keyPairFromHex(privateKeyHex, network) {
95
+ await wasm.ensureInitialized();
77
96
  return wasm.WasmSdk.keyPairFromHex(privateKeyHex, network);
78
97
  }
79
98
  wallet.keyPairFromHex = keyPairFromHex;
80
- function pubkeyToAddress(pubkeyHex, network) {
99
+ async function pubkeyToAddress(pubkeyHex, network) {
100
+ await wasm.ensureInitialized();
81
101
  return wasm.WasmSdk.pubkeyToAddress(pubkeyHex, network);
82
102
  }
83
103
  wallet.pubkeyToAddress = pubkeyToAddress;
84
- function validateAddress(address, network) {
104
+ async function validateAddress(address, network) {
105
+ await wasm.ensureInitialized();
85
106
  return wasm.WasmSdk.validateAddress(address, network);
86
107
  }
87
108
  wallet.validateAddress = validateAddress;
88
- function signMessage(message, privateKeyWif) {
109
+ async function signMessage(message, privateKeyWif) {
110
+ await wasm.ensureInitialized();
89
111
  return wasm.WasmSdk.signMessage(message, privateKeyWif);
90
112
  }
91
113
  wallet.signMessage = signMessage;
package/dist/wasm.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export declare function ensureInitialized(): Promise<void>;
2
2
  export * from '@dashevo/wasm-sdk/compressed';
3
3
  export { default } from '@dashevo/wasm-sdk/compressed';
4
+ export type { DataContract } from '@dashevo/wasm-sdk/compressed';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashevo/evo-sdk",
3
- "version": "2.1.0-dev.7",
3
+ "version": "2.1.0-dev.8",
4
4
  "type": "module",
5
5
  "main": "./dist/evo-sdk.module.js",
6
6
  "types": "./dist/sdk.d.ts",
@@ -22,7 +22,7 @@
22
22
  "README.md"
23
23
  ],
24
24
  "dependencies": {
25
- "@dashevo/wasm-sdk": "2.1.0-dev.7"
25
+ "@dashevo/wasm-sdk": "2.1.0-dev.8"
26
26
  },
27
27
  "scripts": {
28
28
  "build": "rm -rf dist && tsc -p tsconfig.json && webpack --config webpack.config.cjs",