dash-platform-sdk 1.3.0-dev.6 → 1.3.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/bundle.min.js +16 -16
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +4 -2
- package/proto/generated/google/protobuf/wrappers.js +1 -1
- package/proto/generated/platform.client.d.ts +46 -46
- package/proto/generated/platform.client.js +1 -1
- package/proto/generated/platform.d.ts +1 -1
- package/proto/generated/platform.js +2 -2
- package/src/DashPlatformSDK.d.ts +14 -14
- package/src/DashPlatformSDK.js +12 -12
- package/src/contestedResources/getContestedResourceVoteState.d.ts +3 -3
- package/src/contestedResources/getContestedResourceVoteState.js +4 -4
- package/src/contestedResources/index.d.ts +3 -3
- package/src/contestedResources/index.js +1 -1
- package/src/dataContracts/create.d.ts +1 -1
- package/src/dataContracts/getDataContractByIdentifier.d.ts +2 -2
- package/src/dataContracts/getDataContractByIdentifier.js +5 -5
- package/src/dataContracts/index.d.ts +2 -2
- package/src/dataContracts/index.js +3 -3
- package/src/documents/create.d.ts +1 -1
- package/src/documents/createStateTransition.d.ts +1 -1
- package/src/documents/index.d.ts +2 -2
- package/src/documents/index.js +3 -3
- package/src/documents/query.d.ts +2 -2
- package/src/documents/query.js +6 -6
- package/src/grpcConnectionPool.d.ts +2 -2
- package/src/grpcConnectionPool.js +4 -4
- package/src/identities/createStateTransition.d.ts +1 -1
- package/src/identities/getIdentityBalance.d.ts +2 -2
- package/src/identities/getIdentityBalance.js +4 -4
- package/src/identities/getIdentityByIdentifier.d.ts +2 -2
- package/src/identities/getIdentityByIdentifier.js +4 -4
- package/src/identities/getIdentityByNonUniquePublicKeyHash.d.ts +1 -1
- package/src/identities/getIdentityByNonUniquePublicKeyHash.js +6 -6
- package/src/identities/getIdentityByPublicKeyHash.d.ts +1 -1
- package/src/identities/getIdentityByPublicKeyHash.js +5 -5
- package/src/identities/getIdentityContractNonce.d.ts +2 -2
- package/src/identities/getIdentityContractNonce.js +4 -4
- package/src/identities/getIdentityNonce.d.ts +2 -2
- package/src/identities/getIdentityNonce.js +4 -4
- package/src/identities/getIdentityPublicKeys.d.ts +2 -2
- package/src/identities/getIdentityPublicKeys.js +4 -4
- package/src/identities/index.d.ts +2 -2
- package/src/identities/index.js +9 -9
- package/src/keyPair/index.d.ts +1 -1
- package/src/keyPair/index.js +3 -3
- package/src/names/index.d.ts +2 -2
- package/src/names/index.js +7 -7
- package/src/names/registerName.d.ts +1 -1
- package/src/names/registerName.js +10 -10
- package/src/names/searchByIdentity.d.ts +1 -1
- package/src/names/searchByIdentity.js +1 -1
- package/src/names/searchByName.d.ts +1 -1
- package/src/names/searchByName.js +2 -2
- package/src/node/epochs.d.ts +1 -1
- package/src/node/epochs.js +5 -5
- package/src/node/index.d.ts +3 -3
- package/src/node/index.js +3 -3
- package/src/node/status.d.ts +2 -2
- package/src/node/status.js +2 -2
- package/src/node/totalCredits.d.ts +2 -2
- package/src/node/totalCredits.js +5 -5
- package/src/signer/PrivateKeySigner.d.ts +1 -0
- package/src/signer/PrivateKeySigner.js +1 -0
- package/src/signer/setSigner.d.ts +1 -1
- package/src/stateTransitions/broadcast.d.ts +1 -1
- package/src/stateTransitions/broadcast.js +1 -1
- package/src/stateTransitions/index.d.ts +1 -1
- package/src/stateTransitions/index.js +2 -2
- package/src/stateTransitions/waitForStateTransitionResult.d.ts +1 -1
- package/src/tokens/createStateTransition.d.ts +1 -1
- package/src/tokens/getIdentitiesTokenBalances.d.ts +2 -2
- package/src/tokens/getIdentitiesTokenBalances.js +4 -4
- package/src/tokens/getIdentityTokensBalances.d.ts +2 -2
- package/src/tokens/getIdentityTokensBalances.js +4 -4
- package/src/tokens/getTokenContractInfo.d.ts +2 -2
- package/src/tokens/getTokenContractInfo.js +4 -4
- package/src/tokens/getTokenDirectPurchasePrices.d.ts +2 -2
- package/src/tokens/getTokenDirectPurchasePrices.js +4 -4
- package/src/tokens/getTokenTotalSupply.d.ts +2 -2
- package/src/tokens/getTokenTotalSupply.js +4 -4
- package/src/tokens/index.d.ts +5 -5
- package/src/tokens/index.js +7 -7
- package/src/types.d.ts +2 -2
- package/src/types.js +1 -1
- package/src/utils/calculateMsgHash.js +1 -1
- package/src/utils/calculateSignHash.d.ts +1 -1
- package/src/utils/calculateSignHash.js +3 -3
- package/src/utils/calculateStateIdHash.d.ts +1 -1
- package/src/utils/calculateStateIdHash.js +2 -2
- package/src/utils/createMasternodeIdentityId.d.ts +2 -0
- package/src/utils/createMasternodeIdentityId.js +4 -0
- package/src/utils/createVoterIdentityId.js +3 -3
- package/src/utils/getEvonodeList.d.ts +1 -1
- package/src/utils/index.d.ts +18 -0
- package/src/utils/index.js +26 -3
- package/src/utils/sha256.js +2 -2
- package/src/utils/signHash.js +1 -1
- package/src/utils/signRequestId.js +1 -1
- package/src/utils/verifyTenderdashProof.d.ts +1 -1
- package/src/utils/verifyTenderdashProof.js +4 -4
- package/src/voting/index.d.ts +3 -3
- package/src/voting/index.js +4 -4
- package/test/unit/ContestedResources.spec.js +2 -3
- package/test/unit/DataContract.spec.js +1 -1
- package/test/unit/Document.spec.js +1 -1
- package/test/unit/Identity.spec.js +1 -1
- package/test/unit/KeyPair.spec.js +1 -1
- package/test/unit/Names.spec.js +3 -3
- package/test/unit/Node.spec.js +1 -1
- package/test/unit/SDK.spec.js +1 -1
- package/test/unit/Tokens.spec.js +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Proof, ResponseMetadata } from '../../proto/generated/platform';
|
|
1
|
+
import { Proof, ResponseMetadata } from '../../proto/generated/platform.js';
|
|
2
2
|
export default function verifyTenderdashProof(proof: Proof, metadata: ResponseMetadata, rootHash: Uint8Array, quorumPublicKey: string): Promise<boolean>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CanonicalVote, SignedMsgType, StateId } from '../../proto/generated/platform';
|
|
2
|
-
import { calculateSignHash } from './calculateSignHash';
|
|
3
|
-
import { calculateStateIdHash } from './calculateStateIdHash';
|
|
1
|
+
import { CanonicalVote, SignedMsgType, StateId } from '../../proto/generated/platform.js';
|
|
2
|
+
import { calculateSignHash } from './calculateSignHash.js';
|
|
3
|
+
import { calculateStateIdHash } from './calculateStateIdHash.js';
|
|
4
4
|
import { verifySignatureDigest } from 'pshenmic-dpp';
|
|
5
|
-
import hexToBytes from './hexToBytes';
|
|
5
|
+
import hexToBytes from './hexToBytes.js';
|
|
6
6
|
export default async function verifyTenderdashProof(proof, metadata, rootHash, quorumPublicKey) {
|
|
7
7
|
const stateId = StateId.create({
|
|
8
8
|
appVersion: String(metadata.protocolVersion),
|
package/src/voting/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IdentifierLike, ResourceVoteChoice } from '../types';
|
|
1
|
+
import { IdentifierLike, ResourceVoteChoice } from '../types.js';
|
|
2
2
|
import { IdentifierWASM, StateTransitionWASM, VoteWASM } from 'pshenmic-dpp';
|
|
3
3
|
/**
|
|
4
4
|
* Voting controller for performing masternode votes
|
|
@@ -26,9 +26,9 @@ export declare class VotingController {
|
|
|
26
26
|
*/
|
|
27
27
|
createVote(dataContractId: IdentifierLike, documentTypeName: string, indexName: string, indexValues: string[], choice: ResourceVoteChoice): VoteWASM;
|
|
28
28
|
/**
|
|
29
|
-
* Creates a {StateTransitionWASM} from
|
|
29
|
+
* Creates a {StateTransitionWASM} from masternode Pro Tx Hash and voter identity
|
|
30
30
|
*
|
|
31
|
-
* @param voteWASM {VoteWASM} vote instance from .
|
|
31
|
+
* @param voteWASM {VoteWASM} vote instance from .createMasternodeVote() method
|
|
32
32
|
* @param proTxHash {string} pro tx hash of the masternode as hex
|
|
33
33
|
* @param voterIdentity {IdentifierWASM} voter identity identifier
|
|
34
34
|
* @param identityNonce {BigInt} identity nonce
|
package/src/voting/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import createVote from './createVote';
|
|
1
|
+
import createVote from './createVote.js';
|
|
2
2
|
import { IdentifierWASM, MasternodeVoteTransitionWASM, ResourceVoteChoiceWASM } from 'pshenmic-dpp';
|
|
3
|
-
import { createVoterIdentityId } from '../utils/createVoterIdentityId';
|
|
3
|
+
import { createVoterIdentityId } from '../utils/createVoterIdentityId.js';
|
|
4
4
|
/**
|
|
5
5
|
* Voting controller for performing masternode votes
|
|
6
6
|
*
|
|
@@ -41,9 +41,9 @@ export class VotingController {
|
|
|
41
41
|
return createVote(new IdentifierWASM(dataContractId), documentTypeName, indexName, indexValues, resourceVoteChoice);
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
* Creates a {StateTransitionWASM} from
|
|
44
|
+
* Creates a {StateTransitionWASM} from masternode Pro Tx Hash and voter identity
|
|
45
45
|
*
|
|
46
|
-
* @param voteWASM {VoteWASM} vote instance from .
|
|
46
|
+
* @param voteWASM {VoteWASM} vote instance from .createMasternodeVote() method
|
|
47
47
|
* @param proTxHash {string} pro tx hash of the masternode as hex
|
|
48
48
|
* @param voterIdentity {IdentifierWASM} voter identity identifier
|
|
49
49
|
* @param identityNonce {BigInt} identity nonce
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DataContractWASM, PlatformVersionWASM, PrivateKeyWASM } from 'pshenmic-dpp';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { ContestedStateResultType } from '../../src/types';
|
|
2
|
+
import { DashPlatformSDK, ContestedStateResultType } from '../../src/types.js';
|
|
3
|
+
import stringToIndexValueBytes from '../../src/utils/stringToIndexValueBytes.js';
|
|
5
4
|
let sdk;
|
|
6
5
|
let contract;
|
|
7
6
|
describe('Contested Resources', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IdentityPublicKeyWASM, IdentityWASM, KeyType, PrivateKeyWASM, Purpose, SecurityLevel } from 'pshenmic-dpp';
|
|
2
|
-
import { DashPlatformSDK } from '../../src/types';
|
|
2
|
+
import { DashPlatformSDK } from '../../src/types.js';
|
|
3
3
|
let sdk;
|
|
4
4
|
describe('Identity', () => {
|
|
5
5
|
beforeAll(() => {
|
package/test/unit/Names.spec.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import broadcast from '../../src/stateTransitions/broadcast';
|
|
1
|
+
import broadcast from '../../src/stateTransitions/broadcast.js';
|
|
2
2
|
import { DocumentWASM, PrivateKeyWASM } from 'pshenmic-dpp';
|
|
3
|
-
import { DashPlatformSDK } from '../../src/DashPlatformSDK';
|
|
4
|
-
import sleep from '../../src/utils/sleep';
|
|
3
|
+
import { DashPlatformSDK } from '../../src/DashPlatformSDK.js';
|
|
4
|
+
import sleep from '../../src/utils/sleep.js';
|
|
5
5
|
jest.mock('../../src/stateTransitions/broadcast');
|
|
6
6
|
jest.mock('../../src/utils/sleep');
|
|
7
7
|
let sdk;
|
package/test/unit/Node.spec.js
CHANGED
package/test/unit/SDK.spec.js
CHANGED
package/test/unit/Tokens.spec.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StateTransitionWASM, TokenBaseTransitionWASM, TokenEmergencyActionWASM } from 'pshenmic-dpp';
|
|
2
|
-
import { DashPlatformSDK } from '../../src/DashPlatformSDK';
|
|
2
|
+
import { DashPlatformSDK } from '../../src/DashPlatformSDK.js';
|
|
3
3
|
let sdk;
|
|
4
4
|
describe('Tokens', () => {
|
|
5
5
|
beforeAll(() => {
|