dash-platform-sdk 1.5.0-dev.1 → 1.5.0-dev.10

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 (42) hide show
  1. package/README.md +15 -14
  2. package/bundle.min.js +1 -21
  3. package/package.json +4 -3
  4. package/proto/generated/platform.client.d.ts +50 -0
  5. package/proto/generated/platform.client.js +53 -18
  6. package/proto/generated/platform.d.ts +888 -0
  7. package/proto/generated/platform.js +2216 -417
  8. package/src/constants.d.ts +1 -1
  9. package/src/constants.js +1 -1
  10. package/src/identities/createStateTransition.js +2 -2
  11. package/src/keyPair/index.d.ts +63 -1
  12. package/src/keyPair/index.js +96 -1
  13. package/src/node/{epochs.d.ts → epochInfos.d.ts} +1 -1
  14. package/src/node/{epochs.js → epochInfos.js} +1 -1
  15. package/src/node/finalizedEpochInfos.d.ts +21 -0
  16. package/src/node/finalizedEpochInfos.js +54 -0
  17. package/src/node/index.d.ts +9 -1
  18. package/src/node/index.js +11 -1
  19. package/src/platformAddresses/createStateTransition.d.ts +12 -0
  20. package/src/platformAddresses/createStateTransition.js +62 -0
  21. package/src/platformAddresses/getAddressesBranchState.d.ts +3 -0
  22. package/src/platformAddresses/getAddressesBranchState.js +21 -0
  23. package/src/platformAddresses/getAddressesTrunkState.d.ts +3 -0
  24. package/src/platformAddresses/getAddressesTrunkState.js +33 -0
  25. package/src/platformAddresses/getRecentAddressBalanceChanges.d.ts +3 -0
  26. package/src/platformAddresses/getRecentAddressBalanceChanges.js +38 -0
  27. package/src/platformAddresses/getRecentCompactedAddressBalanceChanges.d.ts +3 -0
  28. package/src/platformAddresses/getRecentCompactedAddressBalanceChanges.js +37 -0
  29. package/src/platformAddresses/index.d.ts +63 -2
  30. package/src/platformAddresses/index.js +76 -0
  31. package/src/shielded/createStateTransition.d.ts +1 -1
  32. package/src/shielded/createStateTransition.js +7 -2
  33. package/src/shielded/index.d.ts +7 -6
  34. package/src/shielded/index.js +10 -8
  35. package/src/utils/verifyTenderdashProof.js +3 -0
  36. package/test/unit/Identity.spec.js +1 -1
  37. package/test/unit/KeyPair.spec.js +49 -1
  38. package/test/unit/Node.spec.js +6 -0
  39. package/test/unit/PlatformAddress.spec.js +155 -1
  40. package/test/unit/Shielded.spec.js +17 -16
  41. package/types.d.ts +69 -2
  42. package/types.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dash-platform-sdk",
3
- "version": "1.5.0-dev.1",
3
+ "version": "1.5.0-dev.10",
4
4
  "main": "index.js",
5
5
  "description": "Lightweight SDK for accessing Dash Platform blockchain",
6
6
  "repository": {
@@ -25,7 +25,8 @@
25
25
  "@babel/preset-env": "^7.28.0",
26
26
  "@babel/preset-typescript": "^7.27.1",
27
27
  "@protobuf-ts/plugin": "^2.11.1",
28
- "@rollup/plugin-commonjs": "^28.0.6",
28
+ "@rollup/plugin-alias": "^6.0.0",
29
+ "@rollup/plugin-commonjs": "^29.0.3",
29
30
  "@rollup/plugin-node-resolve": "^16.0.1",
30
31
  "@rollup/plugin-terser": "^0.4.4",
31
32
  "@rollup/plugin-typescript": "^12.1.4",
@@ -59,6 +60,6 @@
59
60
  "@scure/bip39": "^2.0.0",
60
61
  "@scure/btc-signer": "^2.0.1",
61
62
  "cbor-x": "^1.6.0",
62
- "pshenmic-dpp": "2.0.0-dev.22"
63
+ "pshenmic-dpp": "2.0.0-dev.29"
63
64
  }
64
65
  }
@@ -12,6 +12,14 @@ import type { GetShieldedAnchorsResponse } from "./platform.js";
12
12
  import type { GetShieldedAnchorsRequest } from "./platform.js";
13
13
  import type { GetShieldedEncryptedNotesResponse } from "./platform.js";
14
14
  import type { GetShieldedEncryptedNotesRequest } from "./platform.js";
15
+ import type { GetRecentCompactedAddressBalanceChangesResponse } from "./platform.js";
16
+ import type { GetRecentCompactedAddressBalanceChangesRequest } from "./platform.js";
17
+ import type { GetRecentAddressBalanceChangesResponse } from "./platform.js";
18
+ import type { GetRecentAddressBalanceChangesRequest } from "./platform.js";
19
+ import type { GetAddressesBranchStateResponse } from "./platform.js";
20
+ import type { GetAddressesBranchStateRequest } from "./platform.js";
21
+ import type { GetAddressesTrunkStateResponse } from "./platform.js";
22
+ import type { GetAddressesTrunkStateRequest } from "./platform.js";
15
23
  import type { GetAddressesInfosResponse } from "./platform.js";
16
24
  import type { GetAddressesInfosRequest } from "./platform.js";
17
25
  import type { GetAddressInfoResponse } from "./platform.js";
@@ -36,6 +44,8 @@ import type { GetContestedResourceVoteStateResponse } from "./platform.js";
36
44
  import type { GetContestedResourceVoteStateRequest } from "./platform.js";
37
45
  import type { GetContestedResourcesResponse } from "./platform.js";
38
46
  import type { GetContestedResourcesRequest } from "./platform.js";
47
+ import type { GetFinalizedEpochInfosResponse } from "./platform.js";
48
+ import type { GetFinalizedEpochInfosRequest } from "./platform.js";
39
49
  import type { GetEpochsInfoResponse } from "./platform.js";
40
50
  import type { GetEpochsInfoRequest } from "./platform.js";
41
51
  import type { GetIdentityByNonUniquePublicKeyHashResponse } from "./platform.js";
@@ -126,6 +136,10 @@ export interface IPlatformClient {
126
136
  * @generated from protobuf rpc: getEpochsInfo
127
137
  */
128
138
  getEpochsInfo(input: GetEpochsInfoRequest, options?: RpcOptions): UnaryCall<GetEpochsInfoRequest, GetEpochsInfoResponse>;
139
+ /**
140
+ * @generated from protobuf rpc: getFinalizedEpochInfos
141
+ */
142
+ getFinalizedEpochInfos(input: GetFinalizedEpochInfosRequest, options?: RpcOptions): UnaryCall<GetFinalizedEpochInfosRequest, GetFinalizedEpochInfosResponse>;
129
143
  /**
130
144
  * @generated from protobuf rpc: getContestedResources
131
145
  */
@@ -174,6 +188,22 @@ export interface IPlatformClient {
174
188
  * @generated from protobuf rpc: getAddressesInfos
175
189
  */
176
190
  getAddressesInfos(input: GetAddressesInfosRequest, options?: RpcOptions): UnaryCall<GetAddressesInfosRequest, GetAddressesInfosResponse>;
191
+ /**
192
+ * @generated from protobuf rpc: getAddressesTrunkState
193
+ */
194
+ getAddressesTrunkState(input: GetAddressesTrunkStateRequest, options?: RpcOptions): UnaryCall<GetAddressesTrunkStateRequest, GetAddressesTrunkStateResponse>;
195
+ /**
196
+ * @generated from protobuf rpc: getAddressesBranchState
197
+ */
198
+ getAddressesBranchState(input: GetAddressesBranchStateRequest, options?: RpcOptions): UnaryCall<GetAddressesBranchStateRequest, GetAddressesBranchStateResponse>;
199
+ /**
200
+ * @generated from protobuf rpc: getRecentAddressBalanceChanges
201
+ */
202
+ getRecentAddressBalanceChanges(input: GetRecentAddressBalanceChangesRequest, options?: RpcOptions): UnaryCall<GetRecentAddressBalanceChangesRequest, GetRecentAddressBalanceChangesResponse>;
203
+ /**
204
+ * @generated from protobuf rpc: getRecentCompactedAddressBalanceChanges
205
+ */
206
+ getRecentCompactedAddressBalanceChanges(input: GetRecentCompactedAddressBalanceChangesRequest, options?: RpcOptions): UnaryCall<GetRecentCompactedAddressBalanceChangesRequest, GetRecentCompactedAddressBalanceChangesResponse>;
177
207
  /**
178
208
  * @generated from protobuf rpc: getShieldedEncryptedNotes
179
209
  */
@@ -266,6 +296,10 @@ export declare class PlatformClient implements IPlatformClient, ServiceInfo {
266
296
  * @generated from protobuf rpc: getEpochsInfo
267
297
  */
268
298
  getEpochsInfo(input: GetEpochsInfoRequest, options?: RpcOptions): UnaryCall<GetEpochsInfoRequest, GetEpochsInfoResponse>;
299
+ /**
300
+ * @generated from protobuf rpc: getFinalizedEpochInfos
301
+ */
302
+ getFinalizedEpochInfos(input: GetFinalizedEpochInfosRequest, options?: RpcOptions): UnaryCall<GetFinalizedEpochInfosRequest, GetFinalizedEpochInfosResponse>;
269
303
  /**
270
304
  * @generated from protobuf rpc: getContestedResources
271
305
  */
@@ -314,6 +348,22 @@ export declare class PlatformClient implements IPlatformClient, ServiceInfo {
314
348
  * @generated from protobuf rpc: getAddressesInfos
315
349
  */
316
350
  getAddressesInfos(input: GetAddressesInfosRequest, options?: RpcOptions): UnaryCall<GetAddressesInfosRequest, GetAddressesInfosResponse>;
351
+ /**
352
+ * @generated from protobuf rpc: getAddressesTrunkState
353
+ */
354
+ getAddressesTrunkState(input: GetAddressesTrunkStateRequest, options?: RpcOptions): UnaryCall<GetAddressesTrunkStateRequest, GetAddressesTrunkStateResponse>;
355
+ /**
356
+ * @generated from protobuf rpc: getAddressesBranchState
357
+ */
358
+ getAddressesBranchState(input: GetAddressesBranchStateRequest, options?: RpcOptions): UnaryCall<GetAddressesBranchStateRequest, GetAddressesBranchStateResponse>;
359
+ /**
360
+ * @generated from protobuf rpc: getRecentAddressBalanceChanges
361
+ */
362
+ getRecentAddressBalanceChanges(input: GetRecentAddressBalanceChangesRequest, options?: RpcOptions): UnaryCall<GetRecentAddressBalanceChangesRequest, GetRecentAddressBalanceChangesResponse>;
363
+ /**
364
+ * @generated from protobuf rpc: getRecentCompactedAddressBalanceChanges
365
+ */
366
+ getRecentCompactedAddressBalanceChanges(input: GetRecentCompactedAddressBalanceChangesRequest, options?: RpcOptions): UnaryCall<GetRecentCompactedAddressBalanceChangesRequest, GetRecentCompactedAddressBalanceChangesResponse>;
317
367
  /**
318
368
  * @generated from protobuf rpc: getShieldedEncryptedNotes
319
369
  */
@@ -109,130 +109,165 @@ export class PlatformClient {
109
109
  const method = this.methods[13], opt = this._transport.mergeOptions(options);
110
110
  return stackIntercept("unary", this._transport, method, opt, input);
111
111
  }
112
+ /**
113
+ * @generated from protobuf rpc: getFinalizedEpochInfos
114
+ */
115
+ getFinalizedEpochInfos(input, options) {
116
+ const method = this.methods[14], opt = this._transport.mergeOptions(options);
117
+ return stackIntercept("unary", this._transport, method, opt, input);
118
+ }
112
119
  /**
113
120
  * @generated from protobuf rpc: getContestedResources
114
121
  */
115
122
  getContestedResources(input, options) {
116
- const method = this.methods[14], opt = this._transport.mergeOptions(options);
123
+ const method = this.methods[15], opt = this._transport.mergeOptions(options);
117
124
  return stackIntercept("unary", this._transport, method, opt, input);
118
125
  }
119
126
  /**
120
127
  * @generated from protobuf rpc: getContestedResourceVoteState
121
128
  */
122
129
  getContestedResourceVoteState(input, options) {
123
- const method = this.methods[15], opt = this._transport.mergeOptions(options);
130
+ const method = this.methods[16], opt = this._transport.mergeOptions(options);
124
131
  return stackIntercept("unary", this._transport, method, opt, input);
125
132
  }
126
133
  /**
127
134
  * @generated from protobuf rpc: getTotalCreditsInPlatform
128
135
  */
129
136
  getTotalCreditsInPlatform(input, options) {
130
- const method = this.methods[16], opt = this._transport.mergeOptions(options);
137
+ const method = this.methods[17], opt = this._transport.mergeOptions(options);
131
138
  return stackIntercept("unary", this._transport, method, opt, input);
132
139
  }
133
140
  /**
134
141
  * @generated from protobuf rpc: getStatus
135
142
  */
136
143
  getStatus(input, options) {
137
- const method = this.methods[17], opt = this._transport.mergeOptions(options);
144
+ const method = this.methods[18], opt = this._transport.mergeOptions(options);
138
145
  return stackIntercept("unary", this._transport, method, opt, input);
139
146
  }
140
147
  /**
141
148
  * @generated from protobuf rpc: getIdentityTokenBalances
142
149
  */
143
150
  getIdentityTokenBalances(input, options) {
144
- const method = this.methods[18], opt = this._transport.mergeOptions(options);
151
+ const method = this.methods[19], opt = this._transport.mergeOptions(options);
145
152
  return stackIntercept("unary", this._transport, method, opt, input);
146
153
  }
147
154
  /**
148
155
  * @generated from protobuf rpc: getIdentitiesTokenBalances
149
156
  */
150
157
  getIdentitiesTokenBalances(input, options) {
151
- const method = this.methods[19], opt = this._transport.mergeOptions(options);
158
+ const method = this.methods[20], opt = this._transport.mergeOptions(options);
152
159
  return stackIntercept("unary", this._transport, method, opt, input);
153
160
  }
154
161
  /**
155
162
  * @generated from protobuf rpc: getTokenContractInfo
156
163
  */
157
164
  getTokenContractInfo(input, options) {
158
- const method = this.methods[20], opt = this._transport.mergeOptions(options);
165
+ const method = this.methods[21], opt = this._transport.mergeOptions(options);
159
166
  return stackIntercept("unary", this._transport, method, opt, input);
160
167
  }
161
168
  /**
162
169
  * @generated from protobuf rpc: getTokenDirectPurchasePrices
163
170
  */
164
171
  getTokenDirectPurchasePrices(input, options) {
165
- const method = this.methods[21], opt = this._transport.mergeOptions(options);
172
+ const method = this.methods[22], opt = this._transport.mergeOptions(options);
166
173
  return stackIntercept("unary", this._transport, method, opt, input);
167
174
  }
168
175
  /**
169
176
  * @generated from protobuf rpc: getTokenTotalSupply
170
177
  */
171
178
  getTokenTotalSupply(input, options) {
172
- const method = this.methods[22], opt = this._transport.mergeOptions(options);
179
+ const method = this.methods[23], opt = this._transport.mergeOptions(options);
173
180
  return stackIntercept("unary", this._transport, method, opt, input);
174
181
  }
175
182
  /**
176
183
  * @generated from protobuf rpc: waitForStateTransitionResult
177
184
  */
178
185
  waitForStateTransitionResult(input, options) {
179
- const method = this.methods[23], opt = this._transport.mergeOptions(options);
186
+ const method = this.methods[24], opt = this._transport.mergeOptions(options);
180
187
  return stackIntercept("unary", this._transport, method, opt, input);
181
188
  }
182
189
  /**
183
190
  * @generated from protobuf rpc: getAddressInfo
184
191
  */
185
192
  getAddressInfo(input, options) {
186
- const method = this.methods[24], opt = this._transport.mergeOptions(options);
193
+ const method = this.methods[25], opt = this._transport.mergeOptions(options);
187
194
  return stackIntercept("unary", this._transport, method, opt, input);
188
195
  }
189
196
  /**
190
197
  * @generated from protobuf rpc: getAddressesInfos
191
198
  */
192
199
  getAddressesInfos(input, options) {
193
- const method = this.methods[25], opt = this._transport.mergeOptions(options);
200
+ const method = this.methods[26], opt = this._transport.mergeOptions(options);
201
+ return stackIntercept("unary", this._transport, method, opt, input);
202
+ }
203
+ /**
204
+ * @generated from protobuf rpc: getAddressesTrunkState
205
+ */
206
+ getAddressesTrunkState(input, options) {
207
+ const method = this.methods[27], opt = this._transport.mergeOptions(options);
208
+ return stackIntercept("unary", this._transport, method, opt, input);
209
+ }
210
+ /**
211
+ * @generated from protobuf rpc: getAddressesBranchState
212
+ */
213
+ getAddressesBranchState(input, options) {
214
+ const method = this.methods[28], opt = this._transport.mergeOptions(options);
215
+ return stackIntercept("unary", this._transport, method, opt, input);
216
+ }
217
+ /**
218
+ * @generated from protobuf rpc: getRecentAddressBalanceChanges
219
+ */
220
+ getRecentAddressBalanceChanges(input, options) {
221
+ const method = this.methods[29], opt = this._transport.mergeOptions(options);
222
+ return stackIntercept("unary", this._transport, method, opt, input);
223
+ }
224
+ /**
225
+ * @generated from protobuf rpc: getRecentCompactedAddressBalanceChanges
226
+ */
227
+ getRecentCompactedAddressBalanceChanges(input, options) {
228
+ const method = this.methods[30], opt = this._transport.mergeOptions(options);
194
229
  return stackIntercept("unary", this._transport, method, opt, input);
195
230
  }
196
231
  /**
197
232
  * @generated from protobuf rpc: getShieldedEncryptedNotes
198
233
  */
199
234
  getShieldedEncryptedNotes(input, options) {
200
- const method = this.methods[26], opt = this._transport.mergeOptions(options);
235
+ const method = this.methods[31], opt = this._transport.mergeOptions(options);
201
236
  return stackIntercept("unary", this._transport, method, opt, input);
202
237
  }
203
238
  /**
204
239
  * @generated from protobuf rpc: getShieldedAnchors
205
240
  */
206
241
  getShieldedAnchors(input, options) {
207
- const method = this.methods[27], opt = this._transport.mergeOptions(options);
242
+ const method = this.methods[32], opt = this._transport.mergeOptions(options);
208
243
  return stackIntercept("unary", this._transport, method, opt, input);
209
244
  }
210
245
  /**
211
246
  * @generated from protobuf rpc: getMostRecentShieldedAnchor
212
247
  */
213
248
  getMostRecentShieldedAnchor(input, options) {
214
- const method = this.methods[28], opt = this._transport.mergeOptions(options);
249
+ const method = this.methods[33], opt = this._transport.mergeOptions(options);
215
250
  return stackIntercept("unary", this._transport, method, opt, input);
216
251
  }
217
252
  /**
218
253
  * @generated from protobuf rpc: getShieldedPoolState
219
254
  */
220
255
  getShieldedPoolState(input, options) {
221
- const method = this.methods[29], opt = this._transport.mergeOptions(options);
256
+ const method = this.methods[34], opt = this._transport.mergeOptions(options);
222
257
  return stackIntercept("unary", this._transport, method, opt, input);
223
258
  }
224
259
  /**
225
260
  * @generated from protobuf rpc: getShieldedNotesCount
226
261
  */
227
262
  getShieldedNotesCount(input, options) {
228
- const method = this.methods[30], opt = this._transport.mergeOptions(options);
263
+ const method = this.methods[35], opt = this._transport.mergeOptions(options);
229
264
  return stackIntercept("unary", this._transport, method, opt, input);
230
265
  }
231
266
  /**
232
267
  * @generated from protobuf rpc: getShieldedNullifiers
233
268
  */
234
269
  getShieldedNullifiers(input, options) {
235
- const method = this.methods[31], opt = this._transport.mergeOptions(options);
270
+ const method = this.methods[36], opt = this._transport.mergeOptions(options);
236
271
  return stackIntercept("unary", this._transport, method, opt, input);
237
272
  }
238
273
  }