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.
- package/bundle.min.js +21 -2
- package/package.json +29 -30
- package/proto/generated/google/protobuf/wrappers.d.ts +260 -29
- package/proto/generated/platform.client.d.ts +251 -0
- package/proto/generated/platform.d.ts +3682 -1939
- package/src/DashPlatformSDK.d.ts +5 -4
- package/src/contestedResources/createStateTransition.d.ts +1 -2
- package/src/grpcConnectionPool.d.ts +30 -8
- package/src/keyPair/deriveChild.d.ts +2 -2
- package/src/keyPair/derivePath.d.ts +2 -2
- package/src/keyPair/index.d.ts +39 -114
- package/src/keyPair/mnemonicToSeed.d.ts +1 -1
- package/src/names/searchByIdentity.d.ts +1 -1
- package/src/node/index.d.ts +3 -3
- package/src/node/totalCredits.d.ts +2 -1
- package/src/types.d.ts +6 -12
- package/src/utils/bytesToTypedArray.d.ts +1 -0
- package/src/utils/calculateMsgHash.d.ts +1 -1
- package/src/utils/calculateSignHash.d.ts +1 -1
- package/src/utils/calculateStateIdHash.d.ts +1 -1
- package/src/utils/createVoterIdentityId.d.ts +1 -1
- package/src/utils/getEvonodeList.d.ts +2 -2
- package/src/utils/sha256.d.ts +1 -1
- package/src/utils/signHash.d.ts +1 -1
- package/src/utils/signRequestId.d.ts +1 -1
- package/src/utils/verifyTenderdashProof.d.ts +1 -1
- package/src/voting/createStateTransition.d.ts +1 -2
- package/src/voting/index.d.ts +3 -4
- package/bundle.min.js.LICENSE.txt +0 -1
- package/index.js +0 -5
- package/proto/generated/google/protobuf/wrappers.js +0 -398
- package/proto/generated/platform.js +0 -18524
- package/src/DashPlatformSDK.js +0 -91
- package/src/constants.js +0 -13
- package/src/contestedResources/createStateTransition.js +0 -9
- package/src/contestedResources/getContestedResourceVoteState.js +0 -123
- package/src/contestedResources/index.js +0 -76
- package/src/dataContracts/create.js +0 -14
- package/src/dataContracts/createStateTransition.js +0 -23
- package/src/dataContracts/getDataContractByIdentifier.js +0 -87
- package/src/dataContracts/index.js +0 -103
- package/src/documents/create.js +0 -7
- package/src/documents/createStateTransition.js +0 -64
- package/src/documents/index.js +0 -130
- package/src/documents/query.js +0 -94
- package/src/grpcConnectionPool.js +0 -137
- package/src/identities/createStateTransition.js +0 -46
- package/src/identities/getIdentityBalance.js +0 -83
- package/src/identities/getIdentityByIdentifier.js +0 -83
- package/src/identities/getIdentityByNonUniquePublicKeyHash.js +0 -85
- package/src/identities/getIdentityByPublicKeyHash.js +0 -83
- package/src/identities/getIdentityContractNonce.js +0 -86
- package/src/identities/getIdentityNonce.js +0 -84
- package/src/identities/getIdentityPublicKeys.js +0 -85
- package/src/identities/index.js +0 -237
- package/src/keyPair/deriveChild.js +0 -50
- package/src/keyPair/derivePath.js +0 -50
- package/src/keyPair/index.js +0 -323
- package/src/keyPair/keyToPublicKey.d.ts +0 -2
- package/src/keyPair/keyToPublicKey.js +0 -47
- package/src/keyPair/keyToWalletId.d.ts +0 -2
- package/src/keyPair/keyToWalletId.js +0 -50
- package/src/keyPair/keyToXPrivateKey.d.ts +0 -3
- package/src/keyPair/keyToXPrivateKey.js +0 -50
- package/src/keyPair/keyToXPublicKey.d.ts +0 -3
- package/src/keyPair/keyToXPublicKey.js +0 -50
- package/src/keyPair/mnemonicToIdentityKey.d.ts +0 -3
- package/src/keyPair/mnemonicToIdentityKey.js +0 -57
- package/src/keyPair/mnemonicToSeed.js +0 -47
- package/src/keyPair/mnemonicToWallet.d.ts +0 -2
- package/src/keyPair/mnemonicToWallet.js +0 -55
- package/src/keyPair/privateKeyToWif.d.ts +0 -2
- package/src/keyPair/privateKeyToWif.js +0 -50
- package/src/keyPair/publicKeyToAddress.d.ts +0 -2
- package/src/keyPair/publicKeyToAddress.js +0 -50
- package/src/keyPair/seedToWallet.d.ts +0 -2
- package/src/keyPair/seedToWallet.js +0 -50
- package/src/keyPair/walletToIdentityKey.d.ts +0 -3
- package/src/keyPair/walletToIdentityKey.js +0 -56
- package/src/keyPair/xkeyToHDXKey.d.ts +0 -2
- package/src/keyPair/xkeyToHDXKey.js +0 -50
- package/src/names/index.js +0 -170
- package/src/names/registerName.js +0 -131
- package/src/names/searchByIdentity.js +0 -51
- package/src/names/searchByName.js +0 -64
- package/src/names/testNameContested.js +0 -6
- package/src/names/validateName.js +0 -14
- package/src/node/epochs.js +0 -88
- package/src/node/index.js +0 -102
- package/src/node/status.js +0 -85
- package/src/node/totalCredits.js +0 -76
- package/src/signer/AbstractSigner.js +0 -2
- package/src/signer/PrivateKeySigner.d.ts +0 -0
- package/src/signer/PrivateKeySigner.js +0 -64
- package/src/signer/setSigner.js +0 -8
- package/src/stateTransitions/broadcast.js +0 -60
- package/src/stateTransitions/index.js +0 -87
- package/src/stateTransitions/waitForStateTransitionResult.js +0 -60
- package/src/tokens/createStateTransition.js +0 -79
- package/src/tokens/getIdentitiesTokenBalances.js +0 -86
- package/src/tokens/getIdentityTokensBalances.js +0 -86
- package/src/tokens/getTokenContractInfo.js +0 -86
- package/src/tokens/getTokenDirectPurchasePrices.js +0 -83
- package/src/tokens/getTokenTotalSupply.js +0 -84
- package/src/tokens/index.js +0 -193
- package/src/types.js +0 -25
- package/src/utils/base58ToBytes.js +0 -7
- package/src/utils/bytesToHex.js +0 -6
- package/src/utils/calculateMsgHash.js +0 -34
- package/src/utils/calculateSignHash.js +0 -11
- package/src/utils/calculateStateIdHash.js +0 -12
- package/src/utils/convertToHomographSafeChars.js +0 -14
- package/src/utils/createVoterIdentityId.js +0 -12
- package/src/utils/getEvonodeList.js +0 -63
- package/src/utils/getQuorumPublicKey.js +0 -69
- package/src/utils/getRandomArrayItem.js +0 -6
- package/src/utils/getRandomBytes.js +0 -7
- package/src/utils/hexToBytes.js +0 -7
- package/src/utils/index.js +0 -68
- package/src/utils/indexBytesToString.js +0 -7
- package/src/utils/sha256.js +0 -13
- package/src/utils/signHash.js +0 -25
- package/src/utils/signRequestId.js +0 -22
- package/src/utils/sleep.js +0 -51
- package/src/utils/stringToIndexValueBytes.js +0 -13
- package/src/utils/verifyTenderdashProof.js +0 -30
- package/src/voting/createStateTransition.js +0 -9
- package/src/voting/createVote.js +0 -8
- package/src/voting/index.js +0 -62
- package/test/unit/ContestedResources.spec.js +0 -344
- package/test/unit/DataContract.spec.js +0 -142
- package/test/unit/Document.spec.js +0 -199
- package/test/unit/Identity.spec.js +0 -357
- package/test/unit/KeyPair.spec.js +0 -149
- package/test/unit/Names.spec.js +0 -96
- package/test/unit/Node.spec.js +0 -129
- package/test/unit/SDK.spec.js +0 -12
- package/test/unit/Tokens.spec.js +0 -288
package/src/DashPlatformSDK.d.ts
CHANGED
|
@@ -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:
|
|
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:
|
|
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:
|
|
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:
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
|
|
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
|
-
|
|
6
|
-
network:
|
|
7
|
-
constructor(network:
|
|
8
|
-
_initialize(network:
|
|
9
|
-
getClient():
|
|
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 '
|
|
2
|
-
export default function deriveChild(
|
|
1
|
+
import { HDKey } from '@scure/bip32';
|
|
2
|
+
export default function deriveChild(hdKey: HDKey, index: number): HDKey;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { HDKey } from '
|
|
2
|
-
export default function derivePath(
|
|
1
|
+
import { HDKey } from '@scure/bip32';
|
|
2
|
+
export default function derivePath(hdKey: HDKey, path: string): HDKey;
|
package/src/keyPair/index.d.ts
CHANGED
|
@@ -1,142 +1,67 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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 {
|
|
15
|
+
* @return {Uint8Array} Seed bytes
|
|
83
16
|
*/
|
|
84
|
-
mnemonicToSeed(mnemonic: string, salt?: string
|
|
17
|
+
mnemonicToSeed(mnemonic: string, salt?: string): Uint8Array;
|
|
85
18
|
/**
|
|
86
|
-
* Returns
|
|
19
|
+
* Returns seed from mnemonic phrase
|
|
87
20
|
*
|
|
88
|
-
* @param
|
|
89
|
-
* @param
|
|
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 {
|
|
24
|
+
* @return {HDKey} HDKey
|
|
94
25
|
*/
|
|
95
|
-
|
|
26
|
+
seedToHdKey(seed: Uint8Array, network?: Network): HDKey;
|
|
96
27
|
/**
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
-
*
|
|
46
|
+
* Derives an {HDKey} child by identity index and key index from an {HDKey}
|
|
116
47
|
*
|
|
117
|
-
*
|
|
118
|
-
* @param opts {HDFromSeedOptions?} - Optional options with network version
|
|
48
|
+
* Usually used to get a identity private key from seed
|
|
119
49
|
*
|
|
120
|
-
* @
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
* @
|
|
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
|
-
|
|
57
|
+
deriveIdentityPrivateKey(hdKey: HDKey, identityIndex: number, keyIndex: number, network: Network): HDKey;
|
|
134
58
|
/**
|
|
135
|
-
*
|
|
59
|
+
* Converts {PublicKey} to a Dash network address (P2PKH)
|
|
60
|
+
*
|
|
61
|
+
* @param publicKey {Uint8Array}
|
|
62
|
+
* @param network {Network}
|
|
136
63
|
*
|
|
137
|
-
* @
|
|
138
|
-
* @param opts {HDFromXKeyOptions=} - Optional options
|
|
139
|
-
* @return {Promise<HDXKey>}
|
|
64
|
+
* @returns {string}
|
|
140
65
|
*/
|
|
141
|
-
|
|
66
|
+
p2pkhAddress(publicKey: Uint8Array, network: Network): string;
|
|
142
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function mnemonicToSeed(mnemonic: string, salt?: string
|
|
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
|
|
3
|
+
export default function searchByIdentity(grpcPool: GRPCConnectionPool, identifier: IdentifierWASM): Promise<DocumentWASM[]>;
|
package/src/node/index.d.ts
CHANGED
|
@@ -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:
|
|
13
|
-
constructor(grpcPool: GRPCConnectionPool, network:
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
1
|
+
import { MasternodeList, Network } from '../types';
|
|
2
|
+
export default function getDAPINodeList(network: Network): Promise<MasternodeList>;
|
package/src/utils/sha256.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function sha256(input: Uint8Array | string): Uint8Array | string
|
|
1
|
+
export default function sha256(input: Uint8Array | string): Promise<Uint8Array | string>;
|
package/src/utils/signHash.d.ts
CHANGED
|
@@ -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;
|
package/src/voting/index.d.ts
CHANGED
|
@@ -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; } });
|