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

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 (91) hide show
  1. package/bundle.min.js +17 -17
  2. package/index.js +2 -0
  3. package/package.json +4 -4
  4. package/proto/generated/google/protobuf/wrappers.js +615 -0
  5. package/proto/generated/platform.client.js +175 -0
  6. package/proto/generated/platform.js +8277 -0
  7. package/src/DashPlatformSDK.js +101 -0
  8. package/src/constants.js +10 -0
  9. package/src/contestedResources/createStateTransition.js +6 -0
  10. package/src/contestedResources/getContestedResourceVoteState.js +72 -0
  11. package/src/contestedResources/index.js +30 -0
  12. package/src/dataContracts/create.js +11 -0
  13. package/src/dataContracts/createStateTransition.js +19 -0
  14. package/src/dataContracts/getDataContractByIdentifier.js +44 -0
  15. package/src/dataContracts/index.js +57 -0
  16. package/src/documents/create.js +4 -0
  17. package/src/documents/createStateTransition.js +52 -0
  18. package/src/documents/index.js +83 -0
  19. package/src/documents/query.js +62 -0
  20. package/src/grpcConnectionPool.js +79 -0
  21. package/src/identities/createStateTransition.js +34 -0
  22. package/src/identities/getIdentityBalance.js +40 -0
  23. package/src/identities/getIdentityByIdentifier.js +40 -0
  24. package/src/identities/getIdentityByNonUniquePublicKeyHash.js +44 -0
  25. package/src/identities/getIdentityByPublicKeyHash.js +40 -0
  26. package/src/identities/getIdentityContractNonce.js +43 -0
  27. package/src/identities/getIdentityNonce.js +41 -0
  28. package/src/identities/getIdentityPublicKeys.js +47 -0
  29. package/src/identities/index.js +141 -0
  30. package/src/keyPair/deriveChild.js +3 -0
  31. package/src/keyPair/derivePath.js +3 -0
  32. package/src/keyPair/index.js +89 -0
  33. package/src/keyPair/mnemonicToSeed.js +4 -0
  34. package/src/names/index.js +102 -0
  35. package/src/names/registerName.js +64 -0
  36. package/src/names/searchByIdentity.js +5 -0
  37. package/src/names/searchByName.js +16 -0
  38. package/src/names/testNameContested.js +3 -0
  39. package/src/names/validateName.js +11 -0
  40. package/src/node/epochs.js +46 -0
  41. package/src/node/index.js +43 -0
  42. package/src/node/status.js +41 -0
  43. package/src/node/totalCredits.js +35 -0
  44. package/src/signer/AbstractSigner.js +1 -0
  45. package/src/signer/PrivateKeySigner.d.ts +0 -0
  46. package/src/signer/PrivateKeySigner.js +64 -0
  47. package/src/signer/setSigner.js +5 -0
  48. package/src/stateTransitions/broadcast.js +10 -0
  49. package/src/stateTransitions/index.js +34 -0
  50. package/src/stateTransitions/waitForStateTransitionResult.js +8 -0
  51. package/src/tokens/createStateTransition.js +67 -0
  52. package/src/tokens/getIdentitiesTokenBalances.js +43 -0
  53. package/src/tokens/getIdentityTokensBalances.js +43 -0
  54. package/src/tokens/getTokenContractInfo.js +43 -0
  55. package/src/tokens/getTokenDirectPurchasePrices.js +40 -0
  56. package/src/tokens/getTokenTotalSupply.js +41 -0
  57. package/src/tokens/index.js +108 -0
  58. package/src/types.js +15 -0
  59. package/src/utils/base58ToBytes.js +4 -0
  60. package/src/utils/bytesToHex.js +3 -0
  61. package/src/utils/bytesToTypedArray.js +3 -0
  62. package/src/utils/calculateMsgHash.js +31 -0
  63. package/src/utils/calculateSignHash.js +8 -0
  64. package/src/utils/calculateStateIdHash.js +10 -0
  65. package/src/utils/convertToHomographSafeChars.js +11 -0
  66. package/src/utils/createVoterIdentityId.js +13 -0
  67. package/src/utils/getEvonodeList.js +12 -0
  68. package/src/utils/getQuorumPublicKey.js +18 -0
  69. package/src/utils/getRandomArrayItem.js +3 -0
  70. package/src/utils/getRandomBytes.js +4 -0
  71. package/src/utils/hexToBytes.js +3 -0
  72. package/src/utils/index.js +61 -0
  73. package/src/utils/indexBytesToString.js +4 -0
  74. package/src/utils/sha256.js +15 -0
  75. package/src/utils/signHash.js +22 -0
  76. package/src/utils/signRequestId.js +19 -0
  77. package/src/utils/sleep.js +3 -0
  78. package/src/utils/stringToIndexValueBytes.js +10 -0
  79. package/src/utils/verifyTenderdashProof.js +26 -0
  80. package/src/voting/createStateTransition.js +6 -0
  81. package/src/voting/createVote.js +5 -0
  82. package/src/voting/index.js +55 -0
  83. package/test/unit/ContestedResources.spec.js +259 -0
  84. package/test/unit/DataContract.spec.js +75 -0
  85. package/test/unit/Document.spec.js +109 -0
  86. package/test/unit/Identity.spec.js +232 -0
  87. package/test/unit/KeyPair.spec.js +34 -0
  88. package/test/unit/Names.spec.js +33 -0
  89. package/test/unit/Node.spec.js +58 -0
  90. package/test/unit/SDK.spec.js +10 -0
  91. package/test/unit/Tokens.spec.js +121 -0
@@ -0,0 +1,175 @@
1
+ import { Platform } from "./platform";
2
+ import { stackIntercept } from "@protobuf-ts/runtime-rpc";
3
+ /**
4
+ * @generated from protobuf service org.dash.platform.dapi.v0.Platform
5
+ */
6
+ export class PlatformClient {
7
+ _transport;
8
+ typeName = Platform.typeName;
9
+ methods = Platform.methods;
10
+ options = Platform.options;
11
+ constructor(_transport) {
12
+ this._transport = _transport;
13
+ }
14
+ /**
15
+ * @generated from protobuf rpc: broadcastStateTransition
16
+ */
17
+ broadcastStateTransition(input, options) {
18
+ const method = this.methods[0], opt = this._transport.mergeOptions(options);
19
+ return stackIntercept("unary", this._transport, method, opt, input);
20
+ }
21
+ /**
22
+ * @generated from protobuf rpc: getIdentity
23
+ */
24
+ getIdentity(input, options) {
25
+ const method = this.methods[1], opt = this._transport.mergeOptions(options);
26
+ return stackIntercept("unary", this._transport, method, opt, input);
27
+ }
28
+ /**
29
+ * @generated from protobuf rpc: getIdentityKeys
30
+ */
31
+ getIdentityKeys(input, options) {
32
+ const method = this.methods[2], opt = this._transport.mergeOptions(options);
33
+ return stackIntercept("unary", this._transport, method, opt, input);
34
+ }
35
+ /**
36
+ * @generated from protobuf rpc: getIdentitiesContractKeys
37
+ */
38
+ getIdentitiesContractKeys(input, options) {
39
+ const method = this.methods[3], opt = this._transport.mergeOptions(options);
40
+ return stackIntercept("unary", this._transport, method, opt, input);
41
+ }
42
+ /**
43
+ * @generated from protobuf rpc: getIdentityNonce
44
+ */
45
+ getIdentityNonce(input, options) {
46
+ const method = this.methods[4], opt = this._transport.mergeOptions(options);
47
+ return stackIntercept("unary", this._transport, method, opt, input);
48
+ }
49
+ /**
50
+ * @generated from protobuf rpc: getIdentityContractNonce
51
+ */
52
+ getIdentityContractNonce(input, options) {
53
+ const method = this.methods[5], opt = this._transport.mergeOptions(options);
54
+ return stackIntercept("unary", this._transport, method, opt, input);
55
+ }
56
+ /**
57
+ * @generated from protobuf rpc: getIdentityBalance
58
+ */
59
+ getIdentityBalance(input, options) {
60
+ const method = this.methods[6], opt = this._transport.mergeOptions(options);
61
+ return stackIntercept("unary", this._transport, method, opt, input);
62
+ }
63
+ /**
64
+ * @generated from protobuf rpc: getIdentitiesBalances
65
+ */
66
+ getIdentitiesBalances(input, options) {
67
+ const method = this.methods[7], opt = this._transport.mergeOptions(options);
68
+ return stackIntercept("unary", this._transport, method, opt, input);
69
+ }
70
+ /**
71
+ * @generated from protobuf rpc: getIdentityBalanceAndRevision
72
+ */
73
+ getIdentityBalanceAndRevision(input, options) {
74
+ const method = this.methods[8], opt = this._transport.mergeOptions(options);
75
+ return stackIntercept("unary", this._transport, method, opt, input);
76
+ }
77
+ /**
78
+ * @generated from protobuf rpc: getDataContract
79
+ */
80
+ getDataContract(input, options) {
81
+ const method = this.methods[9], opt = this._transport.mergeOptions(options);
82
+ return stackIntercept("unary", this._transport, method, opt, input);
83
+ }
84
+ /**
85
+ * @generated from protobuf rpc: getDocuments
86
+ */
87
+ getDocuments(input, options) {
88
+ const method = this.methods[10], opt = this._transport.mergeOptions(options);
89
+ return stackIntercept("unary", this._transport, method, opt, input);
90
+ }
91
+ /**
92
+ * @generated from protobuf rpc: getIdentityByPublicKeyHash
93
+ */
94
+ getIdentityByPublicKeyHash(input, options) {
95
+ const method = this.methods[11], opt = this._transport.mergeOptions(options);
96
+ return stackIntercept("unary", this._transport, method, opt, input);
97
+ }
98
+ /**
99
+ * @generated from protobuf rpc: getIdentityByNonUniquePublicKeyHash
100
+ */
101
+ getIdentityByNonUniquePublicKeyHash(input, options) {
102
+ const method = this.methods[12], opt = this._transport.mergeOptions(options);
103
+ return stackIntercept("unary", this._transport, method, opt, input);
104
+ }
105
+ /**
106
+ * @generated from protobuf rpc: getEpochsInfo
107
+ */
108
+ getEpochsInfo(input, options) {
109
+ const method = this.methods[13], opt = this._transport.mergeOptions(options);
110
+ return stackIntercept("unary", this._transport, method, opt, input);
111
+ }
112
+ /**
113
+ * @generated from protobuf rpc: getContestedResources
114
+ */
115
+ getContestedResources(input, options) {
116
+ const method = this.methods[14], opt = this._transport.mergeOptions(options);
117
+ return stackIntercept("unary", this._transport, method, opt, input);
118
+ }
119
+ /**
120
+ * @generated from protobuf rpc: getContestedResourceVoteState
121
+ */
122
+ getContestedResourceVoteState(input, options) {
123
+ const method = this.methods[15], opt = this._transport.mergeOptions(options);
124
+ return stackIntercept("unary", this._transport, method, opt, input);
125
+ }
126
+ /**
127
+ * @generated from protobuf rpc: getTotalCreditsInPlatform
128
+ */
129
+ getTotalCreditsInPlatform(input, options) {
130
+ const method = this.methods[16], opt = this._transport.mergeOptions(options);
131
+ return stackIntercept("unary", this._transport, method, opt, input);
132
+ }
133
+ /**
134
+ * @generated from protobuf rpc: getStatus
135
+ */
136
+ getStatus(input, options) {
137
+ const method = this.methods[17], opt = this._transport.mergeOptions(options);
138
+ return stackIntercept("unary", this._transport, method, opt, input);
139
+ }
140
+ /**
141
+ * @generated from protobuf rpc: getIdentityTokenBalances
142
+ */
143
+ getIdentityTokenBalances(input, options) {
144
+ const method = this.methods[18], opt = this._transport.mergeOptions(options);
145
+ return stackIntercept("unary", this._transport, method, opt, input);
146
+ }
147
+ /**
148
+ * @generated from protobuf rpc: getIdentitiesTokenBalances
149
+ */
150
+ getIdentitiesTokenBalances(input, options) {
151
+ const method = this.methods[19], opt = this._transport.mergeOptions(options);
152
+ return stackIntercept("unary", this._transport, method, opt, input);
153
+ }
154
+ /**
155
+ * @generated from protobuf rpc: getTokenContractInfo
156
+ */
157
+ getTokenContractInfo(input, options) {
158
+ const method = this.methods[20], opt = this._transport.mergeOptions(options);
159
+ return stackIntercept("unary", this._transport, method, opt, input);
160
+ }
161
+ /**
162
+ * @generated from protobuf rpc: getTokenDirectPurchasePrices
163
+ */
164
+ getTokenDirectPurchasePrices(input, options) {
165
+ const method = this.methods[21], opt = this._transport.mergeOptions(options);
166
+ return stackIntercept("unary", this._transport, method, opt, input);
167
+ }
168
+ /**
169
+ * @generated from protobuf rpc: getTokenTotalSupply
170
+ */
171
+ getTokenTotalSupply(input, options) {
172
+ const method = this.methods[22], opt = this._transport.mergeOptions(options);
173
+ return stackIntercept("unary", this._transport, method, opt, input);
174
+ }
175
+ }