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.
Files changed (113) hide show
  1. package/bundle.min.js +16 -16
  2. package/index.d.ts +1 -1
  3. package/index.js +1 -1
  4. package/package.json +4 -2
  5. package/proto/generated/google/protobuf/wrappers.js +1 -1
  6. package/proto/generated/platform.client.d.ts +46 -46
  7. package/proto/generated/platform.client.js +1 -1
  8. package/proto/generated/platform.d.ts +1 -1
  9. package/proto/generated/platform.js +2 -2
  10. package/src/DashPlatformSDK.d.ts +14 -14
  11. package/src/DashPlatformSDK.js +12 -12
  12. package/src/contestedResources/getContestedResourceVoteState.d.ts +3 -3
  13. package/src/contestedResources/getContestedResourceVoteState.js +4 -4
  14. package/src/contestedResources/index.d.ts +3 -3
  15. package/src/contestedResources/index.js +1 -1
  16. package/src/dataContracts/create.d.ts +1 -1
  17. package/src/dataContracts/getDataContractByIdentifier.d.ts +2 -2
  18. package/src/dataContracts/getDataContractByIdentifier.js +5 -5
  19. package/src/dataContracts/index.d.ts +2 -2
  20. package/src/dataContracts/index.js +3 -3
  21. package/src/documents/create.d.ts +1 -1
  22. package/src/documents/createStateTransition.d.ts +1 -1
  23. package/src/documents/index.d.ts +2 -2
  24. package/src/documents/index.js +3 -3
  25. package/src/documents/query.d.ts +2 -2
  26. package/src/documents/query.js +6 -6
  27. package/src/grpcConnectionPool.d.ts +2 -2
  28. package/src/grpcConnectionPool.js +4 -4
  29. package/src/identities/createStateTransition.d.ts +1 -1
  30. package/src/identities/getIdentityBalance.d.ts +2 -2
  31. package/src/identities/getIdentityBalance.js +4 -4
  32. package/src/identities/getIdentityByIdentifier.d.ts +2 -2
  33. package/src/identities/getIdentityByIdentifier.js +4 -4
  34. package/src/identities/getIdentityByNonUniquePublicKeyHash.d.ts +1 -1
  35. package/src/identities/getIdentityByNonUniquePublicKeyHash.js +6 -6
  36. package/src/identities/getIdentityByPublicKeyHash.d.ts +1 -1
  37. package/src/identities/getIdentityByPublicKeyHash.js +5 -5
  38. package/src/identities/getIdentityContractNonce.d.ts +2 -2
  39. package/src/identities/getIdentityContractNonce.js +4 -4
  40. package/src/identities/getIdentityNonce.d.ts +2 -2
  41. package/src/identities/getIdentityNonce.js +4 -4
  42. package/src/identities/getIdentityPublicKeys.d.ts +2 -2
  43. package/src/identities/getIdentityPublicKeys.js +4 -4
  44. package/src/identities/index.d.ts +2 -2
  45. package/src/identities/index.js +9 -9
  46. package/src/keyPair/index.d.ts +1 -1
  47. package/src/keyPair/index.js +3 -3
  48. package/src/names/index.d.ts +2 -2
  49. package/src/names/index.js +7 -7
  50. package/src/names/registerName.d.ts +1 -1
  51. package/src/names/registerName.js +10 -10
  52. package/src/names/searchByIdentity.d.ts +1 -1
  53. package/src/names/searchByIdentity.js +1 -1
  54. package/src/names/searchByName.d.ts +1 -1
  55. package/src/names/searchByName.js +2 -2
  56. package/src/node/epochs.d.ts +1 -1
  57. package/src/node/epochs.js +5 -5
  58. package/src/node/index.d.ts +3 -3
  59. package/src/node/index.js +3 -3
  60. package/src/node/status.d.ts +2 -2
  61. package/src/node/status.js +2 -2
  62. package/src/node/totalCredits.d.ts +2 -2
  63. package/src/node/totalCredits.js +5 -5
  64. package/src/signer/PrivateKeySigner.d.ts +1 -0
  65. package/src/signer/PrivateKeySigner.js +1 -0
  66. package/src/signer/setSigner.d.ts +1 -1
  67. package/src/stateTransitions/broadcast.d.ts +1 -1
  68. package/src/stateTransitions/broadcast.js +1 -1
  69. package/src/stateTransitions/index.d.ts +1 -1
  70. package/src/stateTransitions/index.js +2 -2
  71. package/src/stateTransitions/waitForStateTransitionResult.d.ts +1 -1
  72. package/src/tokens/createStateTransition.d.ts +1 -1
  73. package/src/tokens/getIdentitiesTokenBalances.d.ts +2 -2
  74. package/src/tokens/getIdentitiesTokenBalances.js +4 -4
  75. package/src/tokens/getIdentityTokensBalances.d.ts +2 -2
  76. package/src/tokens/getIdentityTokensBalances.js +4 -4
  77. package/src/tokens/getTokenContractInfo.d.ts +2 -2
  78. package/src/tokens/getTokenContractInfo.js +4 -4
  79. package/src/tokens/getTokenDirectPurchasePrices.d.ts +2 -2
  80. package/src/tokens/getTokenDirectPurchasePrices.js +4 -4
  81. package/src/tokens/getTokenTotalSupply.d.ts +2 -2
  82. package/src/tokens/getTokenTotalSupply.js +4 -4
  83. package/src/tokens/index.d.ts +5 -5
  84. package/src/tokens/index.js +7 -7
  85. package/src/types.d.ts +2 -2
  86. package/src/types.js +1 -1
  87. package/src/utils/calculateMsgHash.js +1 -1
  88. package/src/utils/calculateSignHash.d.ts +1 -1
  89. package/src/utils/calculateSignHash.js +3 -3
  90. package/src/utils/calculateStateIdHash.d.ts +1 -1
  91. package/src/utils/calculateStateIdHash.js +2 -2
  92. package/src/utils/createMasternodeIdentityId.d.ts +2 -0
  93. package/src/utils/createMasternodeIdentityId.js +4 -0
  94. package/src/utils/createVoterIdentityId.js +3 -3
  95. package/src/utils/getEvonodeList.d.ts +1 -1
  96. package/src/utils/index.d.ts +18 -0
  97. package/src/utils/index.js +26 -3
  98. package/src/utils/sha256.js +2 -2
  99. package/src/utils/signHash.js +1 -1
  100. package/src/utils/signRequestId.js +1 -1
  101. package/src/utils/verifyTenderdashProof.d.ts +1 -1
  102. package/src/utils/verifyTenderdashProof.js +4 -4
  103. package/src/voting/index.d.ts +3 -3
  104. package/src/voting/index.js +4 -4
  105. package/test/unit/ContestedResources.spec.js +2 -3
  106. package/test/unit/DataContract.spec.js +1 -1
  107. package/test/unit/Document.spec.js +1 -1
  108. package/test/unit/Identity.spec.js +1 -1
  109. package/test/unit/KeyPair.spec.js +1 -1
  110. package/test/unit/Names.spec.js +3 -3
  111. package/test/unit/Node.spec.js +1 -1
  112. package/test/unit/SDK.spec.js +1 -1
  113. package/test/unit/Tokens.spec.js +1 -1
@@ -1,4 +1,4 @@
1
- import sha256 from './sha256';
1
+ import sha256 from './sha256.js';
2
2
  export default async function signRequestId(prefix, height, round) {
3
3
  const prefixBytes = new TextEncoder().encode(prefix);
4
4
  // len + i64 + i32 (prefix length + 8 bytes for height + 4 bytes for round)
@@ -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),
@@ -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 masternoe protxhash and voter identity
29
+ * Creates a {StateTransitionWASM} from masternode Pro Tx Hash and voter identity
30
30
  *
31
- * @param voteWASM {VoteWASM} vote instance from .createMsternodeVote() method
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
@@ -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 masternoe protxhash and voter identity
44
+ * Creates a {StateTransitionWASM} from masternode Pro Tx Hash and voter identity
45
45
  *
46
- * @param voteWASM {VoteWASM} vote instance from .createMsternodeVote() method
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 stringToIndexValueBytes from '../../src/utils/stringToIndexValueBytes';
3
- import { DashPlatformSDK } from '../../src/DashPlatformSDK';
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 { DataContractWASM, StateTransitionWASM } from 'pshenmic-dpp';
2
- import { DashPlatformSDK } from '../../src/types';
2
+ import { DashPlatformSDK } from '../../src/types.js';
3
3
  let sdk;
4
4
  let ownerIdentifier;
5
5
  let identityNonce;
@@ -1,5 +1,5 @@
1
1
  import { DocumentWASM, GasFeesPaidByWASM, StateTransitionWASM } from 'pshenmic-dpp';
2
- import { DashPlatformSDK } from '../../src/DashPlatformSDK';
2
+ import { DashPlatformSDK } from '../../src/DashPlatformSDK.js';
3
3
  let sdk;
4
4
  let dataContract;
5
5
  let identity;
@@ -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(() => {
@@ -1,4 +1,4 @@
1
- import { DashPlatformSDK } from '../../src/DashPlatformSDK';
1
+ import { DashPlatformSDK } from '../../src/DashPlatformSDK.js';
2
2
  let sdk;
3
3
  let mnemonic;
4
4
  describe('KeyPair', () => {
@@ -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;
@@ -1,4 +1,4 @@
1
- import { DashPlatformSDK } from '../../src/DashPlatformSDK';
1
+ import { DashPlatformSDK } from '../../src/DashPlatformSDK.js';
2
2
  let sdk;
3
3
  describe('Node', () => {
4
4
  beforeAll(() => {
@@ -1,4 +1,4 @@
1
- import { DashPlatformSDK } from '../../src/DashPlatformSDK';
1
+ import { DashPlatformSDK } from '../../src/DashPlatformSDK.js';
2
2
  let sdk;
3
3
  describe('DashPlatformSDK', () => {
4
4
  beforeAll(() => {
@@ -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(() => {