dash-platform-sdk 1.3.0-dev.7 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dash-platform-sdk",
3
- "version": "1.3.0-dev.7",
3
+ "version": "1.3.0-dev.8",
4
4
  "main": "index.js",
5
5
  "description": "Lightweight SDK for accessing Dash Platform blockchain",
6
6
  "ts-standard": {
@@ -0,0 +1,2 @@
1
+ import { IdentifierWASM } from 'pshenmic-dpp';
2
+ export declare function createMasternodeIdentityId(proTxHash: string): IdentifierWASM;
@@ -0,0 +1,4 @@
1
+ import { IdentifierWASM } from 'pshenmic-dpp';
2
+ export function createMasternodeIdentityId(proTxHash) {
3
+ return IdentifierWASM.fromHex(proTxHash);
4
+ }
@@ -1,3 +1,4 @@
1
+ import { IdentifierWASM } from 'pshenmic-dpp';
1
2
  /**
2
3
  * Collection of conversion functions
3
4
  *
@@ -44,4 +45,21 @@ export declare class UtilsController {
44
45
  * @return {string}
45
46
  */
46
47
  convertToHomographSafeChars(str: string): string;
48
+ /**
49
+ * Creates a voting identity identifier from proTxHash and voting address
50
+ *
51
+ * @param proTxHash {string} Pro TX Hash in hex format
52
+ * @param publicKeyHash {string} Voting address's public key hash (20 bytes), in hex
53
+ *
54
+ * @return {Promise<string>}
55
+ */
56
+ createVoterIdentifier(proTxHash: string, publicKeyHash: string): Promise<IdentifierWASM>;
57
+ /**
58
+ * Creates a masternode identity identifier from proTxHash
59
+ *
60
+ * @param proTxHash {string} Pro TX Hash in hex format
61
+ *
62
+ * @return {string}
63
+ * */
64
+ createMasternodeIdentifier(proTxHash: string): IdentifierWASM;
47
65
  }
@@ -2,6 +2,8 @@ import convertToHomographSafeChars from './convertToHomographSafeChars.js';
2
2
  import { base58 } from '@scure/base';
3
3
  import hexToBytes from './hexToBytes.js';
4
4
  import bytesToHex from './bytesToHex.js';
5
+ import { createVoterIdentityId } from './createVoterIdentityId.js';
6
+ import { createMasternodeIdentityId } from './createMasternodeIdentityId.js';
5
7
  /**
6
8
  * Collection of conversion functions
7
9
  *
@@ -58,4 +60,25 @@ export class UtilsController {
58
60
  convertToHomographSafeChars(str) {
59
61
  return convertToHomographSafeChars(str);
60
62
  }
63
+ /**
64
+ * Creates a voting identity identifier from proTxHash and voting address
65
+ *
66
+ * @param proTxHash {string} Pro TX Hash in hex format
67
+ * @param publicKeyHash {string} Voting address's public key hash (20 bytes), in hex
68
+ *
69
+ * @return {Promise<string>}
70
+ */
71
+ async createVoterIdentifier(proTxHash, publicKeyHash) {
72
+ return await createVoterIdentityId(proTxHash, publicKeyHash);
73
+ }
74
+ /**
75
+ * Creates a masternode identity identifier from proTxHash
76
+ *
77
+ * @param proTxHash {string} Pro TX Hash in hex format
78
+ *
79
+ * @return {string}
80
+ * */
81
+ createMasternodeIdentifier(proTxHash) {
82
+ return createMasternodeIdentityId(proTxHash);
83
+ }
61
84
  }
@@ -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
@@ -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