dash-platform-sdk 1.3.0-dev.4 → 1.3.0-dev.5

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.
Files changed (138) hide show
  1. package/bundle.min.js +21 -2
  2. package/package.json +29 -30
  3. package/proto/generated/google/protobuf/wrappers.d.ts +260 -29
  4. package/proto/generated/platform.client.d.ts +251 -0
  5. package/proto/generated/platform.d.ts +3682 -1939
  6. package/src/DashPlatformSDK.d.ts +5 -4
  7. package/src/contestedResources/createStateTransition.d.ts +1 -2
  8. package/src/grpcConnectionPool.d.ts +30 -8
  9. package/src/keyPair/deriveChild.d.ts +2 -2
  10. package/src/keyPair/derivePath.d.ts +2 -2
  11. package/src/keyPair/index.d.ts +39 -114
  12. package/src/keyPair/mnemonicToSeed.d.ts +1 -1
  13. package/src/names/searchByIdentity.d.ts +1 -1
  14. package/src/node/index.d.ts +3 -3
  15. package/src/node/totalCredits.d.ts +2 -1
  16. package/src/types.d.ts +6 -12
  17. package/src/utils/bytesToTypedArray.d.ts +1 -0
  18. package/src/utils/calculateMsgHash.d.ts +1 -1
  19. package/src/utils/calculateSignHash.d.ts +1 -1
  20. package/src/utils/calculateStateIdHash.d.ts +1 -1
  21. package/src/utils/createVoterIdentityId.d.ts +1 -1
  22. package/src/utils/getEvonodeList.d.ts +2 -2
  23. package/src/utils/sha256.d.ts +1 -1
  24. package/src/utils/signHash.d.ts +1 -1
  25. package/src/utils/signRequestId.d.ts +1 -1
  26. package/src/utils/verifyTenderdashProof.d.ts +1 -1
  27. package/src/voting/createStateTransition.d.ts +1 -2
  28. package/src/voting/index.d.ts +3 -4
  29. package/bundle.min.js.LICENSE.txt +0 -1
  30. package/index.js +0 -5
  31. package/proto/generated/google/protobuf/wrappers.js +0 -398
  32. package/proto/generated/platform.js +0 -18524
  33. package/src/DashPlatformSDK.js +0 -91
  34. package/src/constants.js +0 -13
  35. package/src/contestedResources/createStateTransition.js +0 -9
  36. package/src/contestedResources/getContestedResourceVoteState.js +0 -123
  37. package/src/contestedResources/index.js +0 -76
  38. package/src/dataContracts/create.js +0 -14
  39. package/src/dataContracts/createStateTransition.js +0 -23
  40. package/src/dataContracts/getDataContractByIdentifier.js +0 -87
  41. package/src/dataContracts/index.js +0 -103
  42. package/src/documents/create.js +0 -7
  43. package/src/documents/createStateTransition.js +0 -64
  44. package/src/documents/index.js +0 -130
  45. package/src/documents/query.js +0 -94
  46. package/src/grpcConnectionPool.js +0 -137
  47. package/src/identities/createStateTransition.js +0 -46
  48. package/src/identities/getIdentityBalance.js +0 -83
  49. package/src/identities/getIdentityByIdentifier.js +0 -83
  50. package/src/identities/getIdentityByNonUniquePublicKeyHash.js +0 -85
  51. package/src/identities/getIdentityByPublicKeyHash.js +0 -83
  52. package/src/identities/getIdentityContractNonce.js +0 -86
  53. package/src/identities/getIdentityNonce.js +0 -84
  54. package/src/identities/getIdentityPublicKeys.js +0 -85
  55. package/src/identities/index.js +0 -237
  56. package/src/keyPair/deriveChild.js +0 -50
  57. package/src/keyPair/derivePath.js +0 -50
  58. package/src/keyPair/index.js +0 -323
  59. package/src/keyPair/keyToPublicKey.d.ts +0 -2
  60. package/src/keyPair/keyToPublicKey.js +0 -47
  61. package/src/keyPair/keyToWalletId.d.ts +0 -2
  62. package/src/keyPair/keyToWalletId.js +0 -50
  63. package/src/keyPair/keyToXPrivateKey.d.ts +0 -3
  64. package/src/keyPair/keyToXPrivateKey.js +0 -50
  65. package/src/keyPair/keyToXPublicKey.d.ts +0 -3
  66. package/src/keyPair/keyToXPublicKey.js +0 -50
  67. package/src/keyPair/mnemonicToIdentityKey.d.ts +0 -3
  68. package/src/keyPair/mnemonicToIdentityKey.js +0 -57
  69. package/src/keyPair/mnemonicToSeed.js +0 -47
  70. package/src/keyPair/mnemonicToWallet.d.ts +0 -2
  71. package/src/keyPair/mnemonicToWallet.js +0 -55
  72. package/src/keyPair/privateKeyToWif.d.ts +0 -2
  73. package/src/keyPair/privateKeyToWif.js +0 -50
  74. package/src/keyPair/publicKeyToAddress.d.ts +0 -2
  75. package/src/keyPair/publicKeyToAddress.js +0 -50
  76. package/src/keyPair/seedToWallet.d.ts +0 -2
  77. package/src/keyPair/seedToWallet.js +0 -50
  78. package/src/keyPair/walletToIdentityKey.d.ts +0 -3
  79. package/src/keyPair/walletToIdentityKey.js +0 -56
  80. package/src/keyPair/xkeyToHDXKey.d.ts +0 -2
  81. package/src/keyPair/xkeyToHDXKey.js +0 -50
  82. package/src/names/index.js +0 -170
  83. package/src/names/registerName.js +0 -131
  84. package/src/names/searchByIdentity.js +0 -51
  85. package/src/names/searchByName.js +0 -64
  86. package/src/names/testNameContested.js +0 -6
  87. package/src/names/validateName.js +0 -14
  88. package/src/node/epochs.js +0 -88
  89. package/src/node/index.js +0 -102
  90. package/src/node/status.js +0 -85
  91. package/src/node/totalCredits.js +0 -76
  92. package/src/signer/AbstractSigner.js +0 -2
  93. package/src/signer/PrivateKeySigner.d.ts +0 -0
  94. package/src/signer/PrivateKeySigner.js +0 -64
  95. package/src/signer/setSigner.js +0 -8
  96. package/src/stateTransitions/broadcast.js +0 -60
  97. package/src/stateTransitions/index.js +0 -87
  98. package/src/stateTransitions/waitForStateTransitionResult.js +0 -60
  99. package/src/tokens/createStateTransition.js +0 -79
  100. package/src/tokens/getIdentitiesTokenBalances.js +0 -86
  101. package/src/tokens/getIdentityTokensBalances.js +0 -86
  102. package/src/tokens/getTokenContractInfo.js +0 -86
  103. package/src/tokens/getTokenDirectPurchasePrices.js +0 -83
  104. package/src/tokens/getTokenTotalSupply.js +0 -84
  105. package/src/tokens/index.js +0 -193
  106. package/src/types.js +0 -25
  107. package/src/utils/base58ToBytes.js +0 -7
  108. package/src/utils/bytesToHex.js +0 -6
  109. package/src/utils/calculateMsgHash.js +0 -34
  110. package/src/utils/calculateSignHash.js +0 -11
  111. package/src/utils/calculateStateIdHash.js +0 -12
  112. package/src/utils/convertToHomographSafeChars.js +0 -14
  113. package/src/utils/createVoterIdentityId.js +0 -12
  114. package/src/utils/getEvonodeList.js +0 -63
  115. package/src/utils/getQuorumPublicKey.js +0 -69
  116. package/src/utils/getRandomArrayItem.js +0 -6
  117. package/src/utils/getRandomBytes.js +0 -7
  118. package/src/utils/hexToBytes.js +0 -7
  119. package/src/utils/index.js +0 -68
  120. package/src/utils/indexBytesToString.js +0 -7
  121. package/src/utils/sha256.js +0 -13
  122. package/src/utils/signHash.js +0 -25
  123. package/src/utils/signRequestId.js +0 -22
  124. package/src/utils/sleep.js +0 -51
  125. package/src/utils/stringToIndexValueBytes.js +0 -13
  126. package/src/utils/verifyTenderdashProof.js +0 -30
  127. package/src/voting/createStateTransition.js +0 -9
  128. package/src/voting/createVote.js +0 -8
  129. package/src/voting/index.js +0 -62
  130. package/test/unit/ContestedResources.spec.js +0 -344
  131. package/test/unit/DataContract.spec.js +0 -142
  132. package/test/unit/Document.spec.js +0 -199
  133. package/test/unit/Identity.spec.js +0 -357
  134. package/test/unit/KeyPair.spec.js +0 -149
  135. package/test/unit/Names.spec.js +0 -96
  136. package/test/unit/Node.spec.js +0 -129
  137. package/test/unit/SDK.spec.js +0 -12
  138. package/test/unit/Tokens.spec.js +0 -288
@@ -11,12 +11,13 @@ import { ContestedResourcesController } from './contestedResources';
11
11
  import { TokensController } from './tokens';
12
12
  import { AbstractSigner } from './signer/AbstractSigner';
13
13
  import { VotingController } from './voting';
14
+ import { Network } from './types';
14
15
  export interface GRPCOptions {
15
16
  poolLimit: 5;
16
17
  dapiUrl?: string | string[];
17
18
  }
18
19
  export interface SDKOptions {
19
- network: 'testnet' | 'mainnet';
20
+ network: Network;
20
21
  grpc?: GRPCOptions;
21
22
  /** @deprecated Use {GRPCOptions} instead, will be removed in next major version **/
22
23
  dapiUrl?: string | string[];
@@ -26,7 +27,7 @@ export interface SDKOptions {
26
27
  * Javascript SDK for that let you interact with a Dash Platform blockchain
27
28
  */
28
29
  export declare class DashPlatformSDK {
29
- network: 'testnet' | 'mainnet';
30
+ network: Network;
30
31
  /** @ignore **/
31
32
  grpcPool: GRPCConnectionPool;
32
33
  /** @ignore **/
@@ -58,7 +59,7 @@ export declare class DashPlatformSDK {
58
59
  * @param grpcPool
59
60
  * @param network
60
61
  */
61
- _initialize(grpcPool: GRPCConnectionPool, network: 'testnet' | 'mainnet'): void;
62
+ _initialize(grpcPool: GRPCConnectionPool, network: Network): void;
62
63
  setSigner(signer: AbstractSigner): void;
63
64
  /**
64
65
  * Get currently used network
@@ -71,5 +72,5 @@ export declare class DashPlatformSDK {
71
72
  *
72
73
  * @param network {string}
73
74
  */
74
- setNetwork(network: 'testnet' | 'mainnet'): void;
75
+ setNetwork(network: Network): void;
75
76
  }
@@ -1,3 +1,2 @@
1
- import { StateTransitionWASM } from 'pshenmic-dpp';
2
- import { VoteWASM } from 'pshenmic-dpp/dist/wasm/pshenmic_dpp';
1
+ import { StateTransitionWASM, VoteWASM } from 'pshenmic-dpp';
3
2
  export default function createStateTransition(voteWASM: VoteWASM, proTxHash: string, identityNonce: bigint): StateTransitionWASM;
@@ -1,10 +1,32 @@
1
- import { Channel, Client } from 'nice-grpc-web';
2
- import { PlatformDefinition } from '../proto/generated/platform';
3
- import { GRPCOptions } from './DashPlatformSDK';
1
+ import { PlatformClient } from '../proto/generated/platform.client';
2
+ import { Network } from './types';
3
+ export type MasternodeList = Record<string, MasternodeInfo>;
4
+ export interface GRPCOptions {
5
+ poolLimit: 5;
6
+ dapiUrl?: string | string[];
7
+ }
8
+ export interface MasternodeInfo {
9
+ proTxHash: string;
10
+ address: string;
11
+ payee: string;
12
+ status: string;
13
+ type: string;
14
+ platformNodeID: string;
15
+ platformP2PPort: number;
16
+ platformHTTPPort: number;
17
+ pospenaltyscore: number;
18
+ consecutivePayments: number;
19
+ lastpaidtime: number;
20
+ lastpaidblock: number;
21
+ owneraddress: string;
22
+ votingaddress: string;
23
+ collateraladdress: string;
24
+ pubkeyoperator: string;
25
+ }
4
26
  export default class GRPCConnectionPool {
5
- channels: Channel[];
6
- network: string;
7
- constructor(network: 'testnet' | 'mainnet', grpcOptions?: GRPCOptions);
8
- _initialize(network: 'testnet' | 'mainnet', poolLimit: number, dapiUrl?: string | string[]): Promise<void>;
9
- getClient(): Client<PlatformDefinition>;
27
+ dapiUrls: string[];
28
+ network: Network;
29
+ constructor(network: Network, grpcOptions?: GRPCOptions);
30
+ _initialize(network: Network, poolLimit: number, dapiUrl?: string | string[]): Promise<void>;
31
+ getClient(abortController?: AbortController): PlatformClient;
10
32
  }
@@ -1,2 +1,2 @@
1
- import { HDKey } from 'dashhd';
2
- export default function deriveChild(parent: HDKey, index: number, hardened: boolean): Promise<HDKey>;
1
+ import { HDKey } from '@scure/bip32';
2
+ export default function deriveChild(hdKey: HDKey, index: number): HDKey;
@@ -1,2 +1,2 @@
1
- import { HDKey } from 'dashhd';
2
- export default function derivePath(parent: HDKey, path: string): Promise<HDKey>;
1
+ import { HDKey } from '@scure/bip32';
2
+ export default function derivePath(hdKey: HDKey, path: string): HDKey;
@@ -1,142 +1,67 @@
1
- import { HDFromSeedOptions, HDFromXKeyOptions, HDKey, HDWallet, HDXKey } from 'dashhd';
2
- import { NetworkVersion, WalletToIdentityKeyOpts } from '../types';
1
+ import { HDKey } from '@scure/bip32';
2
+ import { Network } from '../types';
3
3
  /**
4
4
  * Collection of functions to work with private keys and seed phrases
5
5
  *
6
6
  * @hideconstructor
7
7
  */
8
8
  export declare class KeyPairController {
9
- /**
10
- * Allows to derive child HD Key
11
- *
12
- * @param parent {HDKey} - The HDKey parent instance
13
- * @param index {number} - Index of child
14
- * @param hardened {boolean} - hardened or no
15
- *
16
- * @return {Promise<HDKey>} A promise that resolves child key
17
- */
18
- deriveChild(parent: HDKey, index: number, hardened: boolean): Promise<HDKey>;
19
- /**
20
- * Allows to derive HD key by path
21
- *
22
- * @param parent {HDKey} - The HDKey parent instance
23
- * @param path {string} - Path of children
24
- *
25
- * @return {Promise<HDKey>} A promise that resolves key by path
26
- */
27
- derivePath(parent: HDKey, path: string): Promise<HDKey>;
28
- /**
29
- * Convert a HDKey to a public key
30
- *
31
- * @param hdKey {HDKey} - The HDKey to be converted into a public key
32
- * @param opts {NetworkVersion=} - Network version
33
- *
34
- * @return {Promise<Uint8Array>} - converted public key
35
- */
36
- keyToPublicKey(hdKey: HDKey, opts?: NetworkVersion): Promise<Uint8Array>;
37
- /**
38
- * Converts a HDKey to a wallet ID
39
- *
40
- * @param hdKey {HDKey} - The HDKey to be converted into a wallet id.
41
- *
42
- * @return {Promise<string>} Wallet id from used key
43
- */
44
- keyToWalletId(hdKey: HDKey): Promise<string>;
45
- /**
46
- * Converts an HDKey instance to an extended private key (xprv)
47
- *
48
- * @param hdKey {HDKey} - The HDKey instance to convert
49
- * @param opts {NetworkVersion=} - Optional, containing the version
50
- *
51
- * @returns {Promise<string>} A promise that resolves to the xPrivateKey string
52
- */
53
- keyToXPrivateKey(hdKey: HDKey, opts?: NetworkVersion): Promise<string>;
54
- /**
55
- * Convert a HDKey to a xPublicKey
56
- * @param hdKey {HDKey} - The HDKey instance to convert
57
- * @param opts {NetworkVersion=} - Optional, containing the version
58
- *
59
- * @return {Promise<Uint8Array>}
60
- */
61
- keyToXPublicKey(hdKey: HDKey, opts?: NetworkVersion): Promise<Uint8Array>;
62
- /**
63
- * Derives an Identity HDKey from a mnemonic phrase.
64
- *
65
- * @param mnemonic {string} - The BIP39 mnemonic phrase.
66
- * @param identityIndex {number} - The identity index (default: 0).
67
- * @param keyIndex {number} - The key index within the identity (default: 0).
68
- * @param salt {string=} - Optional salt for seed derivation.
69
- * @param verify {boolean=} - Whether to verify the mnemonic during derivation.
70
- * @param opts {(HDFromSeedOptions & WalletToIdentityKeyOpts)=} - Additional options for HD seed derivation and wallet-to-identity conversion.
71
- *
72
- * @returns {Promise<HDKey>} A promise that resolves to the derived identity HDKey.
73
- */
74
- mnemonicToIdentityKey(mnemonic: string, identityIndex?: number, keyIndex?: number, salt?: string, verify?: boolean, opts?: HDFromSeedOptions & WalletToIdentityKeyOpts): Promise<HDKey>;
75
9
  /**
76
10
  * Returns seed from mnemonic phrase
77
11
  *
78
12
  * @param mnemonic {string} - The BIP39 mnemonic phrase.
79
13
  * @param salt {string=} - Optional salt for seed derivation.
80
- * @param verify {boolean=} - Whether to verify the mnemonic during derivation.
81
14
  *
82
- * @return {Promise<Uint8Array>} Seed bytes
15
+ * @return {Uint8Array} Seed bytes
83
16
  */
84
- mnemonicToSeed(mnemonic: string, salt?: string, verify?: boolean): Promise<Uint8Array>;
17
+ mnemonicToSeed(mnemonic: string, salt?: string): Uint8Array;
85
18
  /**
86
- * Returns wallet from mnemonic phrase
19
+ * Returns seed from mnemonic phrase
87
20
  *
88
- * @param mnemonic {string} - The BIP39 mnemonic phrase.
89
- * @param salt {string=} - Optional salt for seed derivation.
90
- * @param verify {boolean=} - Whether to verify the mnemonic during derivation.
91
- * @param opts {HDFromSeedOptions=} - Optional derivation settings
21
+ * @param seed {Uint8Array}
22
+ * @param network {Network} network
92
23
  *
93
- * @return {Promise<HDWallet>} Wallet from mnemonic
24
+ * @return {HDKey} HDKey
94
25
  */
95
- mnemonicToWallet(mnemonic: string, salt?: string, verify?: boolean, opts?: HDFromSeedOptions): Promise<HDKey>;
26
+ seedToHdKey(seed: Uint8Array, network?: Network): HDKey;
96
27
  /**
97
- * Convert a private key to WIF
98
- *
99
- * @param privateKeyBytes {Uint8Array} - Private key bytes
100
- * @param opts {NetworkVersion=} - Optional options with network version
101
- *
102
- * @return {Promise<string>} WIF
103
- */
104
- privateKeyToWif(privateKeyBytes: Uint8Array, opts?: NetworkVersion): Promise<string>;
28
+ * Allows to derive child HD Key
29
+ *
30
+ * @param hdKey {HDKey} - The HDKey parent instance
31
+ * @param index {number} - Index of child
32
+ *
33
+ * @return {Promise<HDKey>} A promise that resolves child key
34
+ */
35
+ deriveChild(hdKey: HDKey, index: number): Promise<HDKey>;
105
36
  /**
106
- * Convert public key to address
107
- *
108
- * @param publicKeyBytes {Uint8Array} - Bytes of public key
109
- * @param opts {NetworkVersion=} - Optional options with network version
110
- *
111
- * @return {Promise<string>} address string
112
- */
113
- publicKeyToAddress(publicKeyBytes: Uint8Array, opts?: NetworkVersion): Promise<string>;
37
+ * Allows to derive HD key by path
38
+ *
39
+ * @param hdKey {HDKey} - The HDKey parent instance
40
+ * @param path {string} - Path of children
41
+ *
42
+ * @return {Promise<HDKey>} A promise that resolves key by path
43
+ */
44
+ derivePath(hdKey: HDKey, path: string): Promise<HDKey>;
114
45
  /**
115
- * Convert seed bytes to wallet
46
+ * Derives an {HDKey} child by identity index and key index from an {HDKey}
116
47
  *
117
- * @param seed {Uint8Array} - seed bytes
118
- * @param opts {HDFromSeedOptions?} - Optional options with network version
48
+ * Usually used to get a identity private key from seed
119
49
  *
120
- * @return {Promise<HDWallet>}
121
- */
122
- seedToWallet(seed: Uint8Array, opts?: HDFromSeedOptions): Promise<HDWallet>;
123
- /**
124
- * Returns identity key from wallet
50
+ * @param hdKey {HDKey}
51
+ * @param identityIndex {number}
52
+ * @param keyIndex {number}
53
+ * @param network {Network}
125
54
  *
126
- * @param wallet {HDWallet | HDKey} - wallet that will be used
127
- * @param identityIndex {number} - index of identity for wallet
128
- * @param keyIndex {number} - index of key for identity
129
- * @param opts {WalletToIdentityKeyOpts=} - optional options
130
- *
131
- * @return {Promise<HDKey>}
55
+ * @returns {HDKey}
132
56
  */
133
- walletToIdentityKey(wallet: HDWallet | HDKey, identityIndex: number, keyIndex: number, opts?: WalletToIdentityKeyOpts): Promise<HDKey>;
57
+ deriveIdentityPrivateKey(hdKey: HDKey, identityIndex: number, keyIndex: number, network: Network): HDKey;
134
58
  /**
135
- * Allows to convert xKey to HDXKey
59
+ * Converts {PublicKey} to a Dash network address (P2PKH)
60
+ *
61
+ * @param publicKey {Uint8Array}
62
+ * @param network {Network}
136
63
  *
137
- * @param xKey {string} - String with xKey
138
- * @param opts {HDFromXKeyOptions=} - Optional options
139
- * @return {Promise<HDXKey>}
64
+ * @returns {string}
140
65
  */
141
- xKeyToHDXKey(xKey: string, opts?: HDFromXKeyOptions): Promise<HDXKey>;
66
+ p2pkhAddress(publicKey: Uint8Array, network: Network): string;
142
67
  }
@@ -1 +1 @@
1
- export default function mnemonicToSeed(mnemonic: string, salt?: string, verify?: boolean): Promise<Uint8Array>;
1
+ export default function mnemonicToSeed(mnemonic: string, salt?: string): Uint8Array;
@@ -1,3 +1,3 @@
1
1
  import { DocumentWASM, IdentifierWASM } from 'pshenmic-dpp';
2
2
  import GRPCConnectionPool from '../grpcConnectionPool';
3
- export default function search(grpcPool: GRPCConnectionPool, identifier: IdentifierWASM): Promise<DocumentWASM[]>;
3
+ export default function searchByIdentity(grpcPool: GRPCConnectionPool, identifier: IdentifierWASM): Promise<DocumentWASM[]>;
@@ -1,5 +1,5 @@
1
1
  import GRPCConnectionPool from '../grpcConnectionPool';
2
- import { NodeStatus } from '../types';
2
+ import { Network, NodeStatus } from '../types';
3
3
  import { EpochInfo } from './epochs';
4
4
  /**
5
5
  * Node controller for requesting information about DAPI node
@@ -9,8 +9,8 @@ import { EpochInfo } from './epochs';
9
9
  export declare class NodeController {
10
10
  /** @ignore **/
11
11
  grpcPool: GRPCConnectionPool;
12
- network: 'testnet' | 'mainnet';
13
- constructor(grpcPool: GRPCConnectionPool, network: 'testnet' | 'mainnet');
12
+ network: Network;
13
+ constructor(grpcPool: GRPCConnectionPool, network: Network);
14
14
  /**
15
15
  * Retrieves an info about node
16
16
  * Includes information about genesis, chain, software versions
@@ -1,2 +1,3 @@
1
1
  import GRPCConnectionPool from '../grpcConnectionPool';
2
- export default function totalCredits(grpcPool: GRPCConnectionPool, network: 'testnet' | 'mainnet'): Promise<bigint>;
2
+ import { Network } from '../types';
3
+ export default function totalCredits(grpcPool: GRPCConnectionPool, network: Network): Promise<bigint>;
package/src/types.d.ts CHANGED
@@ -1,16 +1,10 @@
1
1
  import { DocumentWASM, GasFeesPaidByWASM, IdentifierWASM, KeyType, Purpose, SecurityLevel, TokenEmergencyActionWASM, TokenPricingScheduleWASM } from 'pshenmic-dpp';
2
- import { Versions } from 'dashhd';
3
2
  export { IdentifierWASM, IdentityWASM, DocumentWASM, DataContractWASM, StateTransitionWASM, IdentityPublicKeyWASM } from 'pshenmic-dpp';
4
3
  export type IdentifierLike = IdentifierWASM | string | Uint8Array;
4
+ export type Network = 'mainnet' | 'testnet';
5
5
  export { DashPlatformSDK } from './DashPlatformSDK';
6
6
  export type MasternodeList = Record<string, MasternodeInfo>;
7
7
  export { AbstractSigner } from './signer/AbstractSigner';
8
- export interface WalletToIdentityKeyOpts {
9
- network?: 'mainnet' | 'testnet';
10
- }
11
- export interface NetworkVersion {
12
- version: Versions;
13
- }
14
8
  export interface DocumentTransitionParams {
15
9
  identityContractNonce: bigint;
16
10
  amount?: bigint;
@@ -48,17 +42,17 @@ export interface MasternodeInfo {
48
42
  }
49
43
  export interface NodeStatus {
50
44
  version: {
51
- software: {
45
+ software?: {
52
46
  dapi: string;
53
47
  drive?: string | undefined;
54
48
  tenderdash?: string | undefined;
55
49
  } | undefined;
56
- protocol: {
57
- tenderdash: {
58
- p2p: number;
50
+ protocol?: {
51
+ tenderdash?: {
52
+ p2P: number;
59
53
  block: number;
60
54
  } | undefined;
61
- drive: {
55
+ drive?: {
62
56
  latest: number;
63
57
  current: number;
64
58
  } | undefined;
@@ -0,0 +1 @@
1
+ export declare function typedArrayToBuffer(bytes: Uint8Array): ArrayBuffer;
@@ -1 +1 @@
1
- export declare function calculateMsgHash(chainId: string, height: bigint, round: number, type: number, blockId: Uint8Array, stateId: Uint8Array): Uint8Array;
1
+ export declare function calculateMsgHash(chainId: string, height: bigint, round: number, type: number, blockId: Uint8Array, stateId: Uint8Array): Promise<Uint8Array>;
@@ -1,2 +1,2 @@
1
1
  import { CanonicalVote } from '../../proto/generated/platform';
2
- export declare function calculateSignHash(commit: CanonicalVote, chainId: string, quorumType: number, quorumHash: Uint8Array, height: bigint, round: number): Uint8Array;
2
+ export declare function calculateSignHash(commit: CanonicalVote, chainId: string, quorumType: number, quorumHash: Uint8Array, height: bigint, round: number): Promise<Uint8Array>;
@@ -1,2 +1,2 @@
1
1
  import { StateId } from '../../proto/generated/platform';
2
- export declare function calculateStateIdHash(stateId: StateId): Uint8Array;
2
+ export declare function calculateStateIdHash(stateId: StateId): Promise<Uint8Array>;
@@ -1,2 +1,2 @@
1
1
  import { IdentifierWASM } from 'pshenmic-dpp';
2
- export declare function createVoterIdentityId(proTxHash: string, publicKeyHash: string): IdentifierWASM;
2
+ export declare function createVoterIdentityId(proTxHash: string, publicKeyHash: string): Promise<IdentifierWASM>;
@@ -1,2 +1,2 @@
1
- import { MasternodeList } from '../types';
2
- export default function getDAPINodeList(network: 'testnet' | 'mainnet'): Promise<MasternodeList>;
1
+ import { MasternodeList, Network } from '../types';
2
+ export default function getDAPINodeList(network: Network): Promise<MasternodeList>;
@@ -1 +1 @@
1
- export default function sha256(input: Uint8Array | string): Uint8Array | string;
1
+ export default function sha256(input: Uint8Array | string): Promise<Uint8Array | string>;
@@ -1 +1 @@
1
- export default function signHash(quorumType: number, quorumHash: Uint8Array, requestId: Uint8Array, signBytesHash: Uint8Array): Uint8Array;
1
+ export default function signHash(quorumType: number, quorumHash: Uint8Array, requestId: Uint8Array, signBytesHash: Uint8Array): Promise<Uint8Array>;
@@ -1 +1 @@
1
- export default function signRequestId(prefix: string, height: bigint, round: number): Uint8Array;
1
+ export default function signRequestId(prefix: string, height: bigint, round: number): Promise<Uint8Array>;
@@ -1,2 +1,2 @@
1
1
  import { Proof, ResponseMetadata } from '../../proto/generated/platform';
2
- export default function verifyTenderdashProof(proof: Proof, metadata: ResponseMetadata, rootHash: Uint8Array, quorumPublicKey: string): boolean;
2
+ export default function verifyTenderdashProof(proof: Proof, metadata: ResponseMetadata, rootHash: Uint8Array, quorumPublicKey: string): Promise<boolean>;
@@ -1,3 +1,2 @@
1
- import { StateTransitionWASM } from 'pshenmic-dpp';
2
- import { VoteWASM } from 'pshenmic-dpp/dist/wasm/pshenmic_dpp';
1
+ import { StateTransitionWASM, VoteWASM } from 'pshenmic-dpp';
3
2
  export default function createStateTransition(voteWASM: VoteWASM, proTxHash: string, identityNonce: bigint): StateTransitionWASM;
@@ -1,6 +1,5 @@
1
1
  import { IdentifierLike, ResourceVoteChoice } from '../types';
2
- import { IdentifierWASM, StateTransitionWASM } from 'pshenmic-dpp';
3
- import { VoteWASM } from 'pshenmic-dpp/dist/wasm/pshenmic_dpp';
2
+ import { IdentifierWASM, StateTransitionWASM, VoteWASM } from 'pshenmic-dpp';
4
3
  /**
5
4
  * Voting controller for performing masternode votes
6
5
  *
@@ -13,9 +12,9 @@ export declare class VotingController {
13
12
  * @param proTxHash {string} voter's masternode pro tx hash
14
13
  * @param publicKeyHash {string} voter address's public key hash
15
14
  *
16
- * @return {IdentifierWASM}
15
+ * @return {Promise<IdentifierWASM>}
17
16
  */
18
- createVoterIdentityId(proTxHash: string, publicKeyHash: string): IdentifierWASM;
17
+ createVoterIdentityId(proTxHash: string, publicKeyHash: string): Promise<IdentifierWASM>;
19
18
  /**
20
19
  * Creates a {VoteWASM} with all information about the vote, such as data contract id, choice, and target index
21
20
  *
@@ -1 +0,0 @@
1
- /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
package/index.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DashPlatformSDK = void 0;
4
- var DashPlatformSDK_1 = require("./src/DashPlatformSDK");
5
- Object.defineProperty(exports, "DashPlatformSDK", { enumerable: true, get: function () { return DashPlatformSDK_1.DashPlatformSDK; } });