dash-platform-sdk 1.3.0-dev.9 → 1.4.0-dev.2

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 (80) hide show
  1. package/bundle.min.js +17 -17
  2. package/package.json +2 -5
  3. package/proto/generated/platform.client.d.ts +10 -0
  4. package/proto/generated/platform.client.js +7 -0
  5. package/proto/generated/platform.d.ts +114 -0
  6. package/proto/generated/platform.js +224 -1
  7. package/src/DashPlatformSDK.d.ts +1 -5
  8. package/src/DashPlatformSDK.js +0 -5
  9. package/src/constants.d.ts +2 -0
  10. package/src/constants.js +1 -0
  11. package/src/contestedResources/getContestedResourceVoteState.d.ts +1 -1
  12. package/src/contestedResources/getContestedResourceVoteState.js +10 -5
  13. package/src/contestedResources/index.d.ts +1 -1
  14. package/src/dataContracts/create.d.ts +3 -3
  15. package/src/dataContracts/create.js +3 -2
  16. package/src/dataContracts/createStateTransition.js +0 -1
  17. package/src/dataContracts/getDataContractByIdentifier.d.ts +1 -1
  18. package/src/dataContracts/getDataContractByIdentifier.js +3 -3
  19. package/src/dataContracts/index.d.ts +3 -3
  20. package/src/documents/create.d.ts +1 -1
  21. package/src/documents/create.js +1 -1
  22. package/src/documents/createStateTransition.d.ts +1 -1
  23. package/src/documents/index.d.ts +3 -3
  24. package/src/documents/query.d.ts +3 -3
  25. package/src/documents/query.js +3 -3
  26. package/src/grpcConnectionPool.d.ts +1 -1
  27. package/src/identities/createStateTransition.d.ts +1 -1
  28. package/src/identities/getIdentityBalance.d.ts +1 -1
  29. package/src/identities/getIdentityBalance.js +3 -2
  30. package/src/identities/getIdentityByIdentifier.d.ts +1 -1
  31. package/src/identities/getIdentityByIdentifier.js +3 -2
  32. package/src/identities/getIdentityByNonUniquePublicKeyHash.js +3 -2
  33. package/src/identities/getIdentityByPublicKeyHash.js +3 -2
  34. package/src/identities/getIdentityContractNonce.d.ts +1 -1
  35. package/src/identities/getIdentityContractNonce.js +3 -2
  36. package/src/identities/getIdentityNonce.d.ts +1 -1
  37. package/src/identities/getIdentityNonce.js +3 -2
  38. package/src/identities/getIdentityPublicKeys.d.ts +2 -2
  39. package/src/identities/getIdentityPublicKeys.js +19 -9
  40. package/src/identities/index.d.ts +4 -3
  41. package/src/identities/index.js +6 -6
  42. package/src/keyPair/index.d.ts +1 -1
  43. package/src/names/index.d.ts +1 -1
  44. package/src/node/epochs.js +3 -2
  45. package/src/node/index.d.ts +1 -1
  46. package/src/node/status.d.ts +1 -1
  47. package/src/node/totalCredits.d.ts +1 -1
  48. package/src/node/totalCredits.js +3 -3
  49. package/src/stateTransitions/broadcast.js +1 -1
  50. package/src/stateTransitions/waitForStateTransitionResult.js +68 -5
  51. package/src/tokens/createStateTransition.d.ts +1 -1
  52. package/src/tokens/getIdentitiesTokenBalances.d.ts +2 -2
  53. package/src/tokens/getIdentitiesTokenBalances.js +6 -5
  54. package/src/tokens/getIdentityTokensBalances.d.ts +2 -2
  55. package/src/tokens/getIdentityTokensBalances.js +6 -5
  56. package/src/tokens/getTokenContractInfo.d.ts +1 -1
  57. package/src/tokens/getTokenContractInfo.js +3 -2
  58. package/src/tokens/getTokenDirectPurchasePrices.d.ts +1 -1
  59. package/src/tokens/getTokenDirectPurchasePrices.js +3 -2
  60. package/src/tokens/getTokenTotalSupply.d.ts +1 -1
  61. package/src/tokens/getTokenTotalSupply.js +3 -2
  62. package/src/tokens/index.d.ts +1 -1
  63. package/src/utils/getEvonodeList.d.ts +1 -1
  64. package/src/utils/index.d.ts +8 -0
  65. package/src/utils/index.js +17 -0
  66. package/src/voting/index.d.ts +1 -1
  67. package/test/unit/ContestedResources.spec.js +5 -3
  68. package/test/unit/DataContract.spec.js +4 -3
  69. package/test/unit/Document.spec.js +2 -2
  70. package/test/unit/Identity.spec.js +27 -27
  71. package/test/unit/Names.spec.js +2 -0
  72. package/test/unit/Tokens.spec.js +3 -3
  73. package/{src/types.d.ts → types.d.ts} +8 -7
  74. package/{src/types.js → types.js} +2 -2
  75. package/src/signer/AbstractSigner.d.ts +0 -12
  76. package/src/signer/AbstractSigner.js +0 -1
  77. package/src/signer/PrivateKeySigner.d.ts +0 -1
  78. package/src/signer/PrivateKeySigner.js +0 -65
  79. package/src/signer/setSigner.d.ts +0 -2
  80. package/src/signer/setSigner.js +0 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dash-platform-sdk",
3
- "version": "1.3.0-dev.9",
3
+ "version": "1.4.0-dev.2",
4
4
  "main": "index.js",
5
5
  "description": "Lightweight SDK for accessing Dash Platform blockchain",
6
6
  "ts-standard": {
@@ -47,9 +47,6 @@
47
47
  "test": "jest",
48
48
  "docs": "typedoc"
49
49
  },
50
- "peerDependencies": {
51
- "pshenmic-dpp": "1.1.0-dev.7"
52
- },
53
50
  "dependencies": {
54
51
  "@bufbuild/protobuf": "^2.6.0",
55
52
  "@protobuf-ts/grpcweb-transport": "^2.11.1",
@@ -58,6 +55,6 @@
58
55
  "@scure/bip39": "^2.0.0",
59
56
  "@scure/btc-signer": "^2.0.1",
60
57
  "cbor-x": "^1.6.0",
61
- "pshenmic-dpp": "1.1.0-dev.7"
58
+ "pshenmic-dpp": "2.0.0-dev.4"
62
59
  }
63
60
  }
@@ -1,5 +1,7 @@
1
1
  import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
2
2
  import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
3
+ import type { WaitForStateTransitionResultResponse } from "./platform.js";
4
+ import type { WaitForStateTransitionResultRequest } from "./platform.js";
3
5
  import type { GetTokenTotalSupplyResponse } from "./platform.js";
4
6
  import type { GetTokenTotalSupplyRequest } from "./platform.js";
5
7
  import type { GetTokenDirectPurchasePricesResponse } from "./platform.js";
@@ -144,6 +146,10 @@ export interface IPlatformClient {
144
146
  * @generated from protobuf rpc: getTokenTotalSupply
145
147
  */
146
148
  getTokenTotalSupply(input: GetTokenTotalSupplyRequest, options?: RpcOptions): UnaryCall<GetTokenTotalSupplyRequest, GetTokenTotalSupplyResponse>;
149
+ /**
150
+ * @generated from protobuf rpc: waitForStateTransitionResult
151
+ */
152
+ waitForStateTransitionResult(input: WaitForStateTransitionResultRequest, options?: RpcOptions): UnaryCall<WaitForStateTransitionResultRequest, WaitForStateTransitionResultResponse>;
147
153
  }
148
154
  /**
149
155
  * @generated from protobuf service org.dash.platform.dapi.v0.Platform
@@ -248,4 +254,8 @@ export declare class PlatformClient implements IPlatformClient, ServiceInfo {
248
254
  * @generated from protobuf rpc: getTokenTotalSupply
249
255
  */
250
256
  getTokenTotalSupply(input: GetTokenTotalSupplyRequest, options?: RpcOptions): UnaryCall<GetTokenTotalSupplyRequest, GetTokenTotalSupplyResponse>;
257
+ /**
258
+ * @generated from protobuf rpc: waitForStateTransitionResult
259
+ */
260
+ waitForStateTransitionResult(input: WaitForStateTransitionResultRequest, options?: RpcOptions): UnaryCall<WaitForStateTransitionResultRequest, WaitForStateTransitionResultResponse>;
251
261
  }
@@ -172,4 +172,11 @@ export class PlatformClient {
172
172
  const method = this.methods[22], opt = this._transport.mergeOptions(options);
173
173
  return stackIntercept("unary", this._transport, method, opt, input);
174
174
  }
175
+ /**
176
+ * @generated from protobuf rpc: waitForStateTransitionResult
177
+ */
178
+ waitForStateTransitionResult(input, options) {
179
+ const method = this.methods[23], opt = this._transport.mergeOptions(options);
180
+ return stackIntercept("unary", this._transport, method, opt, input);
181
+ }
175
182
  }
@@ -2709,6 +2709,80 @@ export interface CanonicalVote {
2709
2709
  */
2710
2710
  chainId: string;
2711
2711
  }
2712
+ /**
2713
+ * @generated from protobuf message org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest
2714
+ */
2715
+ export interface WaitForStateTransitionResultRequest {
2716
+ /**
2717
+ * @generated from protobuf oneof: version
2718
+ */
2719
+ version: {
2720
+ oneofKind: "v0";
2721
+ /**
2722
+ * @generated from protobuf field: org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 v0 = 1
2723
+ */
2724
+ v0: WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0;
2725
+ } | {
2726
+ oneofKind: undefined;
2727
+ };
2728
+ }
2729
+ /**
2730
+ * @generated from protobuf message org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0
2731
+ */
2732
+ export interface WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0 {
2733
+ /**
2734
+ * @generated from protobuf field: bytes state_transition_hash = 1
2735
+ */
2736
+ stateTransitionHash: Uint8Array;
2737
+ /**
2738
+ * @generated from protobuf field: bool prove = 2
2739
+ */
2740
+ prove: boolean;
2741
+ }
2742
+ /**
2743
+ * @generated from protobuf message org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse
2744
+ */
2745
+ export interface WaitForStateTransitionResultResponse {
2746
+ /**
2747
+ * @generated from protobuf oneof: version
2748
+ */
2749
+ version: {
2750
+ oneofKind: "v0";
2751
+ /**
2752
+ * @generated from protobuf field: org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 v0 = 1
2753
+ */
2754
+ v0: WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0;
2755
+ } | {
2756
+ oneofKind: undefined;
2757
+ };
2758
+ }
2759
+ /**
2760
+ * @generated from protobuf message org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0
2761
+ */
2762
+ export interface WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0 {
2763
+ /**
2764
+ * @generated from protobuf oneof: result
2765
+ */
2766
+ result: {
2767
+ oneofKind: "error";
2768
+ /**
2769
+ * @generated from protobuf field: org.dash.platform.dapi.v0.StateTransitionBroadcastError error = 1
2770
+ */
2771
+ error: StateTransitionBroadcastError;
2772
+ } | {
2773
+ oneofKind: "proof";
2774
+ /**
2775
+ * @generated from protobuf field: org.dash.platform.dapi.v0.Proof proof = 2
2776
+ */
2777
+ proof: Proof;
2778
+ } | {
2779
+ oneofKind: undefined;
2780
+ };
2781
+ /**
2782
+ * @generated from protobuf field: org.dash.platform.dapi.v0.ResponseMetadata metadata = 3
2783
+ */
2784
+ metadata?: ResponseMetadata;
2785
+ }
2712
2786
  /**
2713
2787
  * @generated from protobuf enum org.dash.platform.dapi.v0.KeyPurpose
2714
2788
  */
@@ -4137,6 +4211,46 @@ declare class CanonicalVote$Type extends MessageType<CanonicalVote> {
4137
4211
  * @generated MessageType for protobuf message org.dash.platform.dapi.v0.CanonicalVote
4138
4212
  */
4139
4213
  export declare const CanonicalVote: CanonicalVote$Type;
4214
+ declare class WaitForStateTransitionResultRequest$Type extends MessageType<WaitForStateTransitionResultRequest> {
4215
+ constructor();
4216
+ create(value?: PartialMessage<WaitForStateTransitionResultRequest>): WaitForStateTransitionResultRequest;
4217
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WaitForStateTransitionResultRequest): WaitForStateTransitionResultRequest;
4218
+ internalBinaryWrite(message: WaitForStateTransitionResultRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
4219
+ }
4220
+ /**
4221
+ * @generated MessageType for protobuf message org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest
4222
+ */
4223
+ export declare const WaitForStateTransitionResultRequest: WaitForStateTransitionResultRequest$Type;
4224
+ declare class WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0$Type extends MessageType<WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0> {
4225
+ constructor();
4226
+ create(value?: PartialMessage<WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0>): WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0;
4227
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0): WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0;
4228
+ internalBinaryWrite(message: WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
4229
+ }
4230
+ /**
4231
+ * @generated MessageType for protobuf message org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0
4232
+ */
4233
+ export declare const WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0: WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0$Type;
4234
+ declare class WaitForStateTransitionResultResponse$Type extends MessageType<WaitForStateTransitionResultResponse> {
4235
+ constructor();
4236
+ create(value?: PartialMessage<WaitForStateTransitionResultResponse>): WaitForStateTransitionResultResponse;
4237
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WaitForStateTransitionResultResponse): WaitForStateTransitionResultResponse;
4238
+ internalBinaryWrite(message: WaitForStateTransitionResultResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
4239
+ }
4240
+ /**
4241
+ * @generated MessageType for protobuf message org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse
4242
+ */
4243
+ export declare const WaitForStateTransitionResultResponse: WaitForStateTransitionResultResponse$Type;
4244
+ declare class WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0$Type extends MessageType<WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0> {
4245
+ constructor();
4246
+ create(value?: PartialMessage<WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0>): WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0;
4247
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0): WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0;
4248
+ internalBinaryWrite(message: WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
4249
+ }
4250
+ /**
4251
+ * @generated MessageType for protobuf message org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0
4252
+ */
4253
+ export declare const WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0: WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0$Type;
4140
4254
  /**
4141
4255
  * @generated ServiceType for protobuf service org.dash.platform.dapi.v0.Platform
4142
4256
  */
@@ -8247,6 +8247,228 @@ class CanonicalVote$Type extends MessageType {
8247
8247
  * @generated MessageType for protobuf message org.dash.platform.dapi.v0.CanonicalVote
8248
8248
  */
8249
8249
  export const CanonicalVote = new CanonicalVote$Type();
8250
+ // @generated message type with reflection information, may provide speed optimized methods
8251
+ class WaitForStateTransitionResultRequest$Type extends MessageType {
8252
+ constructor() {
8253
+ super("org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest", [
8254
+ { no: 1, name: "v0", kind: "message", oneof: "version", T: () => WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0 }
8255
+ ]);
8256
+ }
8257
+ create(value) {
8258
+ const message = globalThis.Object.create((this.messagePrototype));
8259
+ message.version = { oneofKind: undefined };
8260
+ if (value !== undefined)
8261
+ reflectionMergePartial(this, message, value);
8262
+ return message;
8263
+ }
8264
+ internalBinaryRead(reader, length, options, target) {
8265
+ let message = target ?? this.create(), end = reader.pos + length;
8266
+ while (reader.pos < end) {
8267
+ let [fieldNo, wireType] = reader.tag();
8268
+ switch (fieldNo) {
8269
+ case /* org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 v0 */ 1:
8270
+ message.version = {
8271
+ oneofKind: "v0",
8272
+ v0: WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0.internalBinaryRead(reader, reader.uint32(), options, message.version.v0)
8273
+ };
8274
+ break;
8275
+ default:
8276
+ let u = options.readUnknownField;
8277
+ if (u === "throw")
8278
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
8279
+ let d = reader.skip(wireType);
8280
+ if (u !== false)
8281
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
8282
+ }
8283
+ }
8284
+ return message;
8285
+ }
8286
+ internalBinaryWrite(message, writer, options) {
8287
+ /* org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 v0 = 1; */
8288
+ if (message.version.oneofKind === "v0")
8289
+ WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0.internalBinaryWrite(message.version.v0, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
8290
+ let u = options.writeUnknownFields;
8291
+ if (u !== false)
8292
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
8293
+ return writer;
8294
+ }
8295
+ }
8296
+ /**
8297
+ * @generated MessageType for protobuf message org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest
8298
+ */
8299
+ export const WaitForStateTransitionResultRequest = new WaitForStateTransitionResultRequest$Type();
8300
+ // @generated message type with reflection information, may provide speed optimized methods
8301
+ class WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0$Type extends MessageType {
8302
+ constructor() {
8303
+ super("org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0", [
8304
+ { no: 1, name: "state_transition_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
8305
+ { no: 2, name: "prove", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
8306
+ ]);
8307
+ }
8308
+ create(value) {
8309
+ const message = globalThis.Object.create((this.messagePrototype));
8310
+ message.stateTransitionHash = new Uint8Array(0);
8311
+ message.prove = false;
8312
+ if (value !== undefined)
8313
+ reflectionMergePartial(this, message, value);
8314
+ return message;
8315
+ }
8316
+ internalBinaryRead(reader, length, options, target) {
8317
+ let message = target ?? this.create(), end = reader.pos + length;
8318
+ while (reader.pos < end) {
8319
+ let [fieldNo, wireType] = reader.tag();
8320
+ switch (fieldNo) {
8321
+ case /* bytes state_transition_hash */ 1:
8322
+ message.stateTransitionHash = reader.bytes();
8323
+ break;
8324
+ case /* bool prove */ 2:
8325
+ message.prove = reader.bool();
8326
+ break;
8327
+ default:
8328
+ let u = options.readUnknownField;
8329
+ if (u === "throw")
8330
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
8331
+ let d = reader.skip(wireType);
8332
+ if (u !== false)
8333
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
8334
+ }
8335
+ }
8336
+ return message;
8337
+ }
8338
+ internalBinaryWrite(message, writer, options) {
8339
+ /* bytes state_transition_hash = 1; */
8340
+ if (message.stateTransitionHash.length)
8341
+ writer.tag(1, WireType.LengthDelimited).bytes(message.stateTransitionHash);
8342
+ /* bool prove = 2; */
8343
+ if (message.prove !== false)
8344
+ writer.tag(2, WireType.Varint).bool(message.prove);
8345
+ let u = options.writeUnknownFields;
8346
+ if (u !== false)
8347
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
8348
+ return writer;
8349
+ }
8350
+ }
8351
+ /**
8352
+ * @generated MessageType for protobuf message org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0
8353
+ */
8354
+ export const WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0 = new WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0$Type();
8355
+ // @generated message type with reflection information, may provide speed optimized methods
8356
+ class WaitForStateTransitionResultResponse$Type extends MessageType {
8357
+ constructor() {
8358
+ super("org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse", [
8359
+ { no: 1, name: "v0", kind: "message", oneof: "version", T: () => WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0 }
8360
+ ]);
8361
+ }
8362
+ create(value) {
8363
+ const message = globalThis.Object.create((this.messagePrototype));
8364
+ message.version = { oneofKind: undefined };
8365
+ if (value !== undefined)
8366
+ reflectionMergePartial(this, message, value);
8367
+ return message;
8368
+ }
8369
+ internalBinaryRead(reader, length, options, target) {
8370
+ let message = target ?? this.create(), end = reader.pos + length;
8371
+ while (reader.pos < end) {
8372
+ let [fieldNo, wireType] = reader.tag();
8373
+ switch (fieldNo) {
8374
+ case /* org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 v0 */ 1:
8375
+ message.version = {
8376
+ oneofKind: "v0",
8377
+ v0: WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0.internalBinaryRead(reader, reader.uint32(), options, message.version.v0)
8378
+ };
8379
+ break;
8380
+ default:
8381
+ let u = options.readUnknownField;
8382
+ if (u === "throw")
8383
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
8384
+ let d = reader.skip(wireType);
8385
+ if (u !== false)
8386
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
8387
+ }
8388
+ }
8389
+ return message;
8390
+ }
8391
+ internalBinaryWrite(message, writer, options) {
8392
+ /* org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 v0 = 1; */
8393
+ if (message.version.oneofKind === "v0")
8394
+ WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0.internalBinaryWrite(message.version.v0, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
8395
+ let u = options.writeUnknownFields;
8396
+ if (u !== false)
8397
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
8398
+ return writer;
8399
+ }
8400
+ }
8401
+ /**
8402
+ * @generated MessageType for protobuf message org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse
8403
+ */
8404
+ export const WaitForStateTransitionResultResponse = new WaitForStateTransitionResultResponse$Type();
8405
+ // @generated message type with reflection information, may provide speed optimized methods
8406
+ class WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0$Type extends MessageType {
8407
+ constructor() {
8408
+ super("org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0", [
8409
+ { no: 1, name: "error", kind: "message", oneof: "result", T: () => StateTransitionBroadcastError },
8410
+ { no: 2, name: "proof", kind: "message", oneof: "result", T: () => Proof },
8411
+ { no: 3, name: "metadata", kind: "message", T: () => ResponseMetadata }
8412
+ ]);
8413
+ }
8414
+ create(value) {
8415
+ const message = globalThis.Object.create((this.messagePrototype));
8416
+ message.result = { oneofKind: undefined };
8417
+ if (value !== undefined)
8418
+ reflectionMergePartial(this, message, value);
8419
+ return message;
8420
+ }
8421
+ internalBinaryRead(reader, length, options, target) {
8422
+ let message = target ?? this.create(), end = reader.pos + length;
8423
+ while (reader.pos < end) {
8424
+ let [fieldNo, wireType] = reader.tag();
8425
+ switch (fieldNo) {
8426
+ case /* org.dash.platform.dapi.v0.StateTransitionBroadcastError error */ 1:
8427
+ message.result = {
8428
+ oneofKind: "error",
8429
+ error: StateTransitionBroadcastError.internalBinaryRead(reader, reader.uint32(), options, message.result.error)
8430
+ };
8431
+ break;
8432
+ case /* org.dash.platform.dapi.v0.Proof proof */ 2:
8433
+ message.result = {
8434
+ oneofKind: "proof",
8435
+ proof: Proof.internalBinaryRead(reader, reader.uint32(), options, message.result.proof)
8436
+ };
8437
+ break;
8438
+ case /* org.dash.platform.dapi.v0.ResponseMetadata metadata */ 3:
8439
+ message.metadata = ResponseMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata);
8440
+ break;
8441
+ default:
8442
+ let u = options.readUnknownField;
8443
+ if (u === "throw")
8444
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
8445
+ let d = reader.skip(wireType);
8446
+ if (u !== false)
8447
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
8448
+ }
8449
+ }
8450
+ return message;
8451
+ }
8452
+ internalBinaryWrite(message, writer, options) {
8453
+ /* org.dash.platform.dapi.v0.StateTransitionBroadcastError error = 1; */
8454
+ if (message.result.oneofKind === "error")
8455
+ StateTransitionBroadcastError.internalBinaryWrite(message.result.error, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
8456
+ /* org.dash.platform.dapi.v0.Proof proof = 2; */
8457
+ if (message.result.oneofKind === "proof")
8458
+ Proof.internalBinaryWrite(message.result.proof, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
8459
+ /* org.dash.platform.dapi.v0.ResponseMetadata metadata = 3; */
8460
+ if (message.metadata)
8461
+ ResponseMetadata.internalBinaryWrite(message.metadata, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
8462
+ let u = options.writeUnknownFields;
8463
+ if (u !== false)
8464
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
8465
+ return writer;
8466
+ }
8467
+ }
8468
+ /**
8469
+ * @generated MessageType for protobuf message org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0
8470
+ */
8471
+ export const WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0 = new WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0$Type();
8250
8472
  /**
8251
8473
  * @generated ServiceType for protobuf service org.dash.platform.dapi.v0.Platform
8252
8474
  */
@@ -8273,5 +8495,6 @@ export const Platform = new ServiceType("org.dash.platform.dapi.v0.Platform", [
8273
8495
  { name: "getIdentitiesTokenBalances", options: {}, I: GetIdentitiesTokenBalancesRequest, O: GetIdentitiesTokenBalancesResponse },
8274
8496
  { name: "getTokenContractInfo", options: {}, I: GetTokenContractInfoRequest, O: GetTokenContractInfoResponse },
8275
8497
  { name: "getTokenDirectPurchasePrices", options: {}, I: GetTokenDirectPurchasePricesRequest, O: GetTokenDirectPurchasePricesResponse },
8276
- { name: "getTokenTotalSupply", options: {}, I: GetTokenTotalSupplyRequest, O: GetTokenTotalSupplyResponse }
8498
+ { name: "getTokenTotalSupply", options: {}, I: GetTokenTotalSupplyRequest, O: GetTokenTotalSupplyResponse },
8499
+ { name: "waitForStateTransitionResult", options: {}, I: WaitForStateTransitionResultRequest, O: WaitForStateTransitionResultResponse }
8277
8500
  ]);
@@ -9,9 +9,8 @@ import { NamesController } from './names/index.js';
9
9
  import { DataContractsController } from './dataContracts/index.js';
10
10
  import { ContestedResourcesController } from './contestedResources/index.js';
11
11
  import { TokensController } from './tokens/index.js';
12
- import { AbstractSigner } from './signer/AbstractSigner.js';
13
12
  import { VotingController } from './voting/index.js';
14
- import { Network } from './types.js';
13
+ import { Network } from '../types.js';
15
14
  export interface GRPCOptions {
16
15
  poolLimit: 5;
17
16
  dapiUrl?: string | string[];
@@ -21,7 +20,6 @@ export interface SDKOptions {
21
20
  grpc?: GRPCOptions;
22
21
  /** @deprecated Use {GRPCOptions} instead, will be removed in next major version **/
23
22
  dapiUrl?: string | string[];
24
- signer?: AbstractSigner;
25
23
  }
26
24
  /**
27
25
  * Javascript SDK for that let you interact with a Dash Platform blockchain
@@ -42,7 +40,6 @@ export declare class DashPlatformSDK {
42
40
  tokens: TokensController;
43
41
  utils: UtilsController;
44
42
  names: NamesController;
45
- signer?: AbstractSigner;
46
43
  node: NodeController;
47
44
  /**
48
45
  * Constructs a new DashPlatformSDK instance, optionally pass options
@@ -60,7 +57,6 @@ export declare class DashPlatformSDK {
60
57
  * @param network
61
58
  */
62
59
  _initialize(grpcPool: GRPCConnectionPool, network: Network): void;
63
- setSigner(signer: AbstractSigner): void;
64
60
  /**
65
61
  * Get currently used network
66
62
  *
@@ -29,7 +29,6 @@ export class DashPlatformSDK {
29
29
  tokens;
30
30
  utils;
31
31
  names;
32
- signer;
33
32
  node;
34
33
  /**
35
34
  * Constructs a new DashPlatformSDK instance, optionally pass options
@@ -42,7 +41,6 @@ export class DashPlatformSDK {
42
41
  throw new Error('If options is passed, network must be set (either mainnet or testnet)');
43
42
  }
44
43
  this.network = options?.network ?? 'mainnet';
45
- this.signer = options?.signer;
46
44
  this.options = options;
47
45
  this.utils = new UtilsController();
48
46
  // Compatibility
@@ -74,9 +72,6 @@ export class DashPlatformSDK {
74
72
  this.names = new NamesController(grpcPool);
75
73
  this.keyPair = new KeyPairController();
76
74
  }
77
- setSigner(signer) {
78
- this.signer = signer;
79
- }
80
75
  /**
81
76
  * Get currently used network
82
77
  *
@@ -1,3 +1,4 @@
1
+ import { PlatformVersionWASM } from 'pshenmic-dpp';
1
2
  /**
2
3
  * Default amount of documents to retrieve from DAPI
3
4
  */
@@ -8,3 +9,4 @@ export declare const MAINNET_ACTIVATION_HEIGHT = 2128896;
8
9
  export declare const GRPC_DEFAULT_POOL_LIMIT = 5;
9
10
  export declare const DPNS_DATA_CONTRACT_ID = "GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec";
10
11
  export declare const DPNS_DATA_CONTRACT_BYTES = "AeZoxlmvZq7h5ywYbd57W34KHXEqCcQNVyH2Ir9TxTFVAAAAAAABAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIGZG9tYWluFgsSEGRvY3VtZW50c011dGFibGUTABIMY2FuQmVEZWxldGVkEwESDHRyYW5zZmVyYWJsZQIBEgl0cmFkZU1vZGUCARIEdHlwZRIGb2JqZWN0EgdpbmRpY2VzFQIWBBIEbmFtZRIScGFyZW50TmFtZUFuZExhYmVsEgpwcm9wZXJ0aWVzFQIWARIabm9ybWFsaXplZFBhcmVudERvbWFpbk5hbWUSA2FzYxYBEg9ub3JtYWxpemVkTGFiZWwSA2FzYxIGdW5pcXVlEwESCWNvbnRlc3RlZBYDEgxmaWVsZE1hdGNoZXMVARYCEgVmaWVsZBIPbm9ybWFsaXplZExhYmVsEgxyZWdleFBhdHRlcm4SE15bYS16QS1aMDEtXXszLDE5fSQSCnJlc29sdXRpb24CABILZGVzY3JpcHRpb24SqklmIHRoZSBub3JtYWxpemVkIGxhYmVsIHBhcnQgb2YgdGhpcyBpbmRleCBpcyBsZXNzIHRoYW4gMjAgY2hhcmFjdGVycyAoYWxsIGFscGhhYmV0IGEteiwgQS1aLCAwLCAxLCBhbmQgLSkgdGhlbiBhIG1hc3Rlcm5vZGUgdm90ZSBjb250ZXN0IHRha2Vz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Rpb24gYW5kIGRlbGV0aW9uIGFyZSByZXN0cmljdGVkAAAAAAAAAAAAAA==";
12
+ export declare const LATEST_PLATFORM_VERSION = PlatformVersionWASM.PLATFORM_V11;
package/src/constants.js CHANGED
@@ -8,3 +8,4 @@ export const MAINNET_ACTIVATION_HEIGHT = 2128896;
8
8
  export const GRPC_DEFAULT_POOL_LIMIT = 5;
9
9
  export const DPNS_DATA_CONTRACT_ID = 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec';
10
10
  export const DPNS_DATA_CONTRACT_BYTES = 'AeZoxlmvZq7h5ywYbd57W34KHXEqCcQNVyH2Ir9TxTFVAAAAAAABAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIGZG9tYWluFgsSEGRvY3VtZW50c011dGFibGUTABIMY2FuQmVEZWxldGVkEwESDHRyYW5zZmVyYWJsZQIBEgl0cmFkZU1vZGUCARIEdHlwZRIGb2JqZWN0EgdpbmRpY2VzFQIWBBIEbmFtZRIScGFyZW50TmFtZUFuZExhYmVsEgpwcm9wZXJ0aWVzFQIWARIabm9ybWFsaXplZFBhcmVudERvbWFpbk5hbWUSA2FzYxYBEg9ub3JtYWxpemVkTGFiZWwSA2FzYxIGdW5pcXVlEwESCWNvbnRlc3RlZBYDEgxmaWVsZE1hdGNoZXMVARYCEgVmaWVsZBIPbm9ybWFsaXplZExhYmVsEgxyZWdleFBhdHRlcm4SE15bYS16QS1aMDEtXXszLDE5fSQSCnJlc29sdXRpb24CABILZGVzY3JpcHRpb24SqklmIHRoZSBub3JtYWxpemVkIGxhYmVsIHBhcnQgb2YgdGhpcyBpbmRleCBpcyBsZXNzIHRoYW4gMjAgY2hhcmFjdGVycyAoYWxsIGFscGhhYmV0IGEteiwgQS1aLCAwLCAxLCBhbmQgLSkgdGhlbiBhIG1hc3Rlcm5vZGUgdm90ZSBjb250ZXN0IHRha2VzIHBsYWNlIHRvIGdpdmUgb3V0IHRoZSBuYW1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dGVkAAAAAAAAAAAAAA==';
11
+ export const LATEST_PLATFORM_VERSION = 11 /* PlatformVersionWASM.PLATFORM_V11 */;
@@ -1,4 +1,4 @@
1
- import { ContestedResourceVoteState, ContestedStateResultType } from '../types.js';
1
+ import { ContestedResourceVoteState, ContestedStateResultType } from '../../types.js';
2
2
  import GRPCConnectionPool from '../grpcConnectionPool.js';
3
3
  import { GetContestedResourceVoteStateRequest_GetContestedResourceVoteStateRequestV0_StartAtIdentifierInfo } from '../../proto/generated/platform.js';
4
4
  import { DataContractWASM } from 'pshenmic-dpp';
@@ -1,8 +1,9 @@
1
1
  import { GetContestedResourceVoteStateRequest } from '../../proto/generated/platform.js';
2
- import { DocumentWASM, IdentifierWASM, PlatformVersionWASM, verifyVotePollVoteStateProof } from 'pshenmic-dpp';
2
+ import { DocumentWASM, IdentifierWASM, verifyVotePollVoteStateProof } from 'pshenmic-dpp';
3
3
  import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
4
4
  import { getQuorumPublicKey } from '../utils/getQuorumPublicKey.js';
5
5
  import bytesToHex from '../utils/bytesToHex.js';
6
+ import { LATEST_PLATFORM_VERSION } from '../constants.js';
6
7
  export default async function getContestedResourceVoteState(grpcPool, contract, documentTypeName, indexName, indexValues, resultType, allowIncludeLockedAndAbstainingVoteTally, startAtIdentifierInfo, count) {
7
8
  if (startAtIdentifierInfo != null) {
8
9
  startAtIdentifierInfo = {
@@ -39,7 +40,10 @@ export default async function getContestedResourceVoteState(grpcPool, contract,
39
40
  if (metadata == null) {
40
41
  throw new Error('Metadata not found');
41
42
  }
42
- const { rootHash, result } = verifyVotePollVoteStateProof(proof.grovedbProof, contract, documentTypeName, indexName, indexValues, resultType, allowIncludeLockedAndAbstainingVoteTally, count, startAtIdentifierInfo, PlatformVersionWASM.PLATFORM_V9);
43
+ const { rootHash, result } = verifyVotePollVoteStateProof(proof.grovedbProof, contract, documentTypeName, indexName, indexValues,
44
+ // same enums
45
+ // @ts-expect-error
46
+ resultType, allowIncludeLockedAndAbstainingVoteTally, count, startAtIdentifierInfo, LATEST_PLATFORM_VERSION);
43
47
  const quorumPublicKey = await getQuorumPublicKey(grpcPool.network, proof.quorumType, bytesToHex(proof.quorumHash));
44
48
  const verify = await verifyTenderdashProof(proof, metadata, rootHash, quorumPublicKey);
45
49
  if (!verify) {
@@ -52,16 +56,17 @@ export default async function getContestedResourceVoteState(grpcPool, contract,
52
56
  }
53
57
  return {
54
58
  contenders: contenders.map(contender => ({
55
- ...contender,
56
59
  identifier: contender.identityId,
57
- document: contender.serializedDocument != null ? DocumentWASM.fromBytes(contender.serializedDocument, contract, documentTypeName, PlatformVersionWASM.PLATFORM_V9) : undefined
60
+ document: contender.serializedDocument != null ? DocumentWASM.fromBytes(contender.serializedDocument, contract, documentTypeName, LATEST_PLATFORM_VERSION) : undefined,
61
+ voteTally: contender.voteTally
58
62
  })),
59
63
  abstainVoteTally: result?.abstainingVoteTally ?? 0,
60
64
  lockVoteTally: result?.lockedVoteTally ?? 0,
65
+ skipped: result?.skipped === 1,
61
66
  finishedVoteInfo: (winner != null)
62
67
  ? {
63
68
  type: winner.type,
64
- wonByIdentityId: winner.identityId != null ? new IdentifierWASM(winner.identityId) : undefined,
69
+ wonByIdentityId: 'identityId' in winner ? new IdentifierWASM(winner.identityId) : undefined,
65
70
  finishedAtBlockHeight: winner.blockInfo.height,
66
71
  finishedAtCoreBlockHeight: winner.blockInfo.coreHeight,
67
72
  finishedAtBlockTimeMs: winner.blockInfo.timeMs,
@@ -1,5 +1,5 @@
1
1
  import GRPCConnectionPool from '../grpcConnectionPool.js';
2
- import { ContestedResourceVoteState, ContestedStateResultType } from '../types.js';
2
+ import { ContestedResourceVoteState, ContestedStateResultType } from '../../types.js';
3
3
  import { DataContractWASM } from 'pshenmic-dpp';
4
4
  import { StartAtIdentifierInfo } from './getContestedResourceVoteState.js';
5
5
  /**
@@ -1,3 +1,3 @@
1
- import { DataContractWASM, PlatformVersionWASM, TokenConfigurationWASM } from 'pshenmic-dpp';
2
- import { DataContractConfig, IdentifierLike } from '../types.js';
3
- export default function createDataContract(ownerId: IdentifierLike, identityNonce: bigint, schema: object, tokenConfiguration?: TokenConfigurationWASM, config?: DataContractConfig, fullValidation?: boolean | undefined, platformVersion?: PlatformVersionWASM | undefined): DataContractWASM;
1
+ import { DataContractTokens, DataContractWASM, PlatformVersionWASM } from 'pshenmic-dpp';
2
+ import { DataContractConfig, IdentifierLike } from '../../types.js';
3
+ export default function createDataContract(ownerId: IdentifierLike, identityNonce: bigint, schema: object, tokenConfiguration?: DataContractTokens[], config?: DataContractConfig, fullValidation?: boolean | undefined, platformVersion?: PlatformVersionWASM | undefined): DataContractWASM;
@@ -1,9 +1,10 @@
1
- import { DataContractWASM, IdentifierWASM, PlatformVersionWASM } from 'pshenmic-dpp';
1
+ import { DataContractWASM, IdentifierWASM } from 'pshenmic-dpp';
2
+ import { LATEST_PLATFORM_VERSION } from '../constants.js';
2
3
  export default function createDataContract(ownerId, identityNonce, schema, tokenConfiguration, config, fullValidation, platformVersion) {
3
4
  const id = new IdentifierWASM(ownerId);
4
5
  const dataContract = new DataContractWASM(id, identityNonce, schema,
5
6
  // we don't know what that param means yet
6
- null, tokenConfiguration, fullValidation ?? true, platformVersion ?? PlatformVersionWASM.PLATFORM_V9);
7
+ undefined, tokenConfiguration, fullValidation ?? true, platformVersion ?? LATEST_PLATFORM_VERSION);
7
8
  if (config != null) {
8
9
  dataContract.setConfig(config, platformVersion);
9
10
  }
@@ -13,7 +13,6 @@ export default function createStateTransition(dataContract, type, identityNonce)
13
13
  if (TransitionClass == null) {
14
14
  throw new Error(`Unknown DataContract transition type: ${type}. Should be 'create' or 'update'.`);
15
15
  }
16
- // @ts-expect-error
17
16
  const dataContractTransition = new TransitionClass(dataContract, identityNonce);
18
17
  return dataContractTransition.toStateTransition();
19
18
  }
@@ -1,4 +1,4 @@
1
1
  import { DataContractWASM } from 'pshenmic-dpp';
2
- import { IdentifierLike } from '../types.js';
2
+ import { IdentifierLike } from '../../types.js';
3
3
  import GRPCConnectionPool from '../grpcConnectionPool.js';
4
4
  export default function getByIdentifier(grpcPool: GRPCConnectionPool, identifier: IdentifierLike): Promise<DataContractWASM>;