dash-platform-sdk 1.3.0-dev.8 → 1.4.0-dev.1

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 (81) 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 +2 -2
  28. package/src/identities/createStateTransition.js +11 -1
  29. package/src/identities/getIdentityBalance.d.ts +1 -1
  30. package/src/identities/getIdentityBalance.js +3 -2
  31. package/src/identities/getIdentityByIdentifier.d.ts +1 -1
  32. package/src/identities/getIdentityByIdentifier.js +3 -2
  33. package/src/identities/getIdentityByNonUniquePublicKeyHash.js +3 -2
  34. package/src/identities/getIdentityByPublicKeyHash.js +3 -2
  35. package/src/identities/getIdentityContractNonce.d.ts +1 -1
  36. package/src/identities/getIdentityContractNonce.js +3 -2
  37. package/src/identities/getIdentityNonce.d.ts +1 -1
  38. package/src/identities/getIdentityNonce.js +3 -2
  39. package/src/identities/getIdentityPublicKeys.d.ts +2 -2
  40. package/src/identities/getIdentityPublicKeys.js +19 -9
  41. package/src/identities/index.d.ts +8 -5
  42. package/src/identities/index.js +17 -5
  43. package/src/keyPair/index.d.ts +1 -1
  44. package/src/names/index.d.ts +1 -1
  45. package/src/node/epochs.js +3 -2
  46. package/src/node/index.d.ts +1 -1
  47. package/src/node/status.d.ts +1 -1
  48. package/src/node/totalCredits.d.ts +1 -1
  49. package/src/node/totalCredits.js +3 -3
  50. package/src/stateTransitions/broadcast.js +1 -1
  51. package/src/stateTransitions/waitForStateTransitionResult.js +68 -5
  52. package/src/tokens/createStateTransition.d.ts +1 -1
  53. package/src/tokens/getIdentitiesTokenBalances.d.ts +2 -2
  54. package/src/tokens/getIdentitiesTokenBalances.js +6 -5
  55. package/src/tokens/getIdentityTokensBalances.d.ts +2 -2
  56. package/src/tokens/getIdentityTokensBalances.js +6 -5
  57. package/src/tokens/getTokenContractInfo.d.ts +1 -1
  58. package/src/tokens/getTokenContractInfo.js +3 -2
  59. package/src/tokens/getTokenDirectPurchasePrices.d.ts +1 -1
  60. package/src/tokens/getTokenDirectPurchasePrices.js +3 -2
  61. package/src/tokens/getTokenTotalSupply.d.ts +1 -1
  62. package/src/tokens/getTokenTotalSupply.js +3 -2
  63. package/src/tokens/index.d.ts +1 -1
  64. package/src/utils/getEvonodeList.d.ts +1 -1
  65. package/src/utils/index.d.ts +8 -0
  66. package/src/utils/index.js +17 -0
  67. package/src/voting/index.d.ts +1 -1
  68. package/test/unit/ContestedResources.spec.js +5 -3
  69. package/test/unit/DataContract.spec.js +4 -3
  70. package/test/unit/Document.spec.js +2 -2
  71. package/test/unit/Identity.spec.js +61 -27
  72. package/test/unit/Names.spec.js +2 -0
  73. package/test/unit/Tokens.spec.js +3 -3
  74. package/{src/types.d.ts → types.d.ts} +15 -8
  75. package/{src/types.js → types.js} +2 -2
  76. package/src/signer/AbstractSigner.d.ts +0 -12
  77. package/src/signer/AbstractSigner.js +0 -1
  78. package/src/signer/PrivateKeySigner.d.ts +0 -1
  79. package/src/signer/PrivateKeySigner.js +0 -65
  80. package/src/signer/setSigner.d.ts +0 -2
  81. package/src/signer/setSigner.js +0 -5
@@ -1,12 +0,0 @@
1
- import { StateTransitionWASM } from 'pshenmic-dpp';
2
- export interface WalletInfo {
3
- identities: string[];
4
- currentIdentity: string | null;
5
- }
6
- /**
7
- * Abstract interface for custom signer implementation
8
- */
9
- export interface AbstractSigner {
10
- connect: () => Promise<WalletInfo>;
11
- signAndBroadcast: (stateTransition: StateTransitionWASM) => Promise<StateTransitionWASM>;
12
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,65 +0,0 @@
1
- export {};
2
- // import { IdentityWASM, NetworkWASM, PrivateKeyWASM, StateTransitionWASM } from 'pshenmic-dpp'
3
- // import { base64 } from '@scure/base'
4
- // import { IdentitiesController } from '../identities'
5
- // import {AbstractSigner} from "./AbstractSigner";
6
- //
7
- // export class PrivateKeySigner implements AbstractSigner {
8
- // privateKey: PrivateKeyWASM
9
- // identity: IdentityWASM
10
- // identities: IdentitiesController
11
- //
12
- // constructor (identitiesController: IdentitiesController, privateKey: string | PrivateKeyWASM, network?: NetworkWASM | string) {
13
- // this.identities = identitiesController
14
- //
15
- // if (typeof privateKey === 'string') {
16
- // let privateKeyWASM
17
- //
18
- // try {
19
- // privateKeyWASM = PrivateKeyWASM.fromWIF(privateKey)
20
- // } catch (e) {
21
- // }
22
- //
23
- // if (privateKey.length === 64 && !network) {
24
- // throw new Error('Network must be specified if hex or base64 private key being used')
25
- // }
26
- //
27
- // try {
28
- // privateKeyWASM = PrivateKeyWASM.fromHex(privateKey, network)
29
- // } catch (e) {
30
- // }
31
- //
32
- // try {
33
- // privateKeyWASM = PrivateKeyWASM.fromBytes(base64.decode(privateKey), network)
34
- // } catch (e) {
35
- // }
36
- //
37
- // if (privateKeyWASM == null) {
38
- // throw new Error('Could not decode private key')
39
- // }
40
- // } else if (privateKey?.__type === 'PrivateKeyWASM') {
41
- // this.privateKey = privateKey
42
- // } else {
43
- // throw new Error('Unrecognized private key type')
44
- // }
45
- // }
46
- //
47
- // async connect (): Promise<void> {
48
- // this.identity = await this.identities.getIdentityByPublicKeyHash(this.privateKey.getPublicKeyHash())
49
- // }
50
- //
51
- // getCurrentIdentity (): IdentityWASM {
52
- // return this.identity
53
- // }
54
- //
55
- // signStateTransition (stateTransition: StateTransitionWASM): void {
56
- // const [identityPublicKey] = this.identity.getPublicKeys()
57
- // .filter(identityPublicKey => identityPublicKey.getPublicKeyHash() === this.privateKey.getPublicKeyHash())
58
- //
59
- // if (identityPublicKey == null) {
60
- // throw new Error('Could not find an identity public key of identity matching this private key')
61
- // }
62
- //
63
- // stateTransition.sign(this.privateKey, identityPublicKey)
64
- // }
65
- // }
@@ -1,2 +0,0 @@
1
- import { AbstractSigner } from './AbstractSigner.js';
2
- export default function setSigner(signer: AbstractSigner): void;
@@ -1,5 +0,0 @@
1
- export default function setSigner(signer) {
2
- this.signer = signer;
3
- this.signer.identities = this.identities;
4
- this.signer.setSigner = setSigner;
5
- }