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

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 (78) hide show
  1. package/bundle.min.js +17 -17
  2. package/package.json +4 -3
  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 +2 -0
  11. package/src/contestedResources/getContestedResourceVoteState.d.ts +1 -1
  12. package/src/contestedResources/getContestedResourceVoteState.js +6 -4
  13. package/src/contestedResources/index.d.ts +1 -1
  14. package/src/dataContracts/create.d.ts +1 -1
  15. package/src/dataContracts/create.js +3 -2
  16. package/src/dataContracts/getDataContractByIdentifier.d.ts +1 -1
  17. package/src/dataContracts/getDataContractByIdentifier.js +3 -3
  18. package/src/dataContracts/index.d.ts +1 -1
  19. package/src/documents/create.d.ts +1 -1
  20. package/src/documents/create.js +1 -1
  21. package/src/documents/createStateTransition.d.ts +1 -1
  22. package/src/documents/index.d.ts +1 -1
  23. package/src/documents/query.d.ts +1 -1
  24. package/src/documents/query.js +3 -3
  25. package/src/grpcConnectionPool.d.ts +1 -1
  26. package/src/identities/createStateTransition.d.ts +2 -2
  27. package/src/identities/createStateTransition.js +11 -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 +8 -5
  41. package/src/identities/index.js +18 -5
  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 +62 -5
  51. package/src/tokens/createStateTransition.d.ts +1 -1
  52. package/src/tokens/getIdentitiesTokenBalances.d.ts +1 -1
  53. package/src/tokens/getIdentitiesTokenBalances.js +3 -2
  54. package/src/tokens/getIdentityTokensBalances.d.ts +1 -1
  55. package/src/tokens/getIdentityTokensBalances.js +3 -2
  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/Identity.spec.js +36 -2
  70. package/test/unit/Names.spec.js +4 -2
  71. package/{src/types.d.ts → types.d.ts} +11 -4
  72. package/{src/types.js → types.js} +2 -2
  73. package/src/signer/AbstractSigner.d.ts +0 -12
  74. package/src/signer/AbstractSigner.js +0 -1
  75. package/src/signer/PrivateKeySigner.d.ts +0 -1
  76. package/src/signer/PrivateKeySigner.js +0 -65
  77. package/src/signer/setSigner.d.ts +0 -2
  78. package/src/signer/setSigner.js +0 -5
@@ -1,8 +1,9 @@
1
- import { IdentifierWASM, PlatformVersionWASM, verifyTokensBalancesForIdentityProof } from 'pshenmic-dpp';
1
+ import { IdentifierWASM, verifyTokensBalancesForIdentityProof } from 'pshenmic-dpp';
2
2
  import { GetIdentityTokenBalancesRequest } from '../../proto/generated/platform.js';
3
3
  import { getQuorumPublicKey } from '../utils/getQuorumPublicKey.js';
4
4
  import bytesToHex from '../utils/bytesToHex.js';
5
5
  import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
6
+ import { LATEST_PLATFORM_VERSION } from '../constants.js';
6
7
  export default async function getIdentityTokensBalances(grpcPool, identifier, tokenIdentifiers) {
7
8
  const id = new IdentifierWASM(identifier);
8
9
  const tokenIds = tokenIdentifiers.map(tokenIdentifier => new IdentifierWASM(tokenIdentifier));
@@ -29,7 +30,7 @@ export default async function getIdentityTokensBalances(grpcPool, identifier, to
29
30
  if (metadata == null) {
30
31
  throw new Error('Metadata not found');
31
32
  }
32
- const { rootHash, balances } = verifyTokensBalancesForIdentityProof(proof.grovedbProof, tokenIds, id, true, PlatformVersionWASM.PLATFORM_V9);
33
+ const { rootHash, balances } = verifyTokensBalancesForIdentityProof(proof.grovedbProof, tokenIds, id, true, LATEST_PLATFORM_VERSION);
33
34
  const quorumPublicKey = await getQuorumPublicKey(grpcPool.network, proof.quorumType, bytesToHex(proof.quorumHash));
34
35
  const verify = await verifyTenderdashProof(proof, metadata, rootHash, quorumPublicKey);
35
36
  if (!verify) {
@@ -1,5 +1,5 @@
1
1
  import GRPCConnectionPool from '../grpcConnectionPool.js';
2
- import { IdentifierLike } from '../types.js';
2
+ import { IdentifierLike } from '../../types.js';
3
3
  import { IdentifierWASM } from 'pshenmic-dpp';
4
4
  export interface TokenContractInfo {
5
5
  dataContractId: IdentifierWASM;
@@ -1,8 +1,9 @@
1
1
  import { GetTokenContractInfoRequest } from '../../proto/generated/platform.js';
2
- import { IdentifierWASM, PlatformVersionWASM, verifyTokenContractInfoProof } from 'pshenmic-dpp';
2
+ import { IdentifierWASM, verifyTokenContractInfoProof } from 'pshenmic-dpp';
3
3
  import { getQuorumPublicKey } from '../utils/getQuorumPublicKey.js';
4
4
  import bytesToHex from '../utils/bytesToHex.js';
5
5
  import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
6
+ import { LATEST_PLATFORM_VERSION } from '../constants.js';
6
7
  export default async function getTokenContractInfo(grpcPool, tokenIdentifier) {
7
8
  const tokenId = new IdentifierWASM(tokenIdentifier);
8
9
  const getTokenContractInfoRequest = GetTokenContractInfoRequest.create({
@@ -27,7 +28,7 @@ export default async function getTokenContractInfo(grpcPool, tokenIdentifier) {
27
28
  if (metadata == null) {
28
29
  throw new Error('Metadata not found');
29
30
  }
30
- const { rootHash, contractInfo } = verifyTokenContractInfoProof(proof.grovedbProof, tokenId, true, PlatformVersionWASM.PLATFORM_V9);
31
+ const { rootHash, contractInfo } = verifyTokenContractInfoProof(proof.grovedbProof, tokenId, true, LATEST_PLATFORM_VERSION);
31
32
  if (contractInfo == null) {
32
33
  throw new Error('ContractInfo not found');
33
34
  }
@@ -1,3 +1,3 @@
1
1
  import GRPCConnectionPool from '../grpcConnectionPool.js';
2
- import { IdentifierLike, TokenDirectPurchasePrices } from '../types.js';
2
+ import { IdentifierLike, TokenDirectPurchasePrices } from '../../types.js';
3
3
  export default function getTokenDirectPurchasePrices(grpcPool: GRPCConnectionPool, tokenIdentifiers: IdentifierLike[]): Promise<TokenDirectPurchasePrices[]>;
@@ -1,8 +1,9 @@
1
- import { IdentifierWASM, PlatformVersionWASM, verifyTokenDirectPurchasePrices } from 'pshenmic-dpp';
1
+ import { IdentifierWASM, verifyTokenDirectPurchasePrices } from 'pshenmic-dpp';
2
2
  import { getQuorumPublicKey } from '../utils/getQuorumPublicKey.js';
3
3
  import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
4
4
  import bytesToHex from '../utils/bytesToHex.js';
5
5
  import { GetTokenDirectPurchasePricesRequest } from '../../proto/generated/platform.js';
6
+ import { LATEST_PLATFORM_VERSION } from '../constants.js';
6
7
  export default async function getTokenDirectPurchasePrices(grpcPool, tokenIdentifiers) {
7
8
  const tokenIds = tokenIdentifiers.map(tokenId => new IdentifierWASM(tokenId).bytes());
8
9
  const request = GetTokenDirectPurchasePricesRequest.create({
@@ -27,7 +28,7 @@ export default async function getTokenDirectPurchasePrices(grpcPool, tokenIdenti
27
28
  if (metadata == null) {
28
29
  throw new Error('Metadata not found');
29
30
  }
30
- const { rootHash, prices } = verifyTokenDirectPurchasePrices(proof.grovedbProof, tokenIds, true, PlatformVersionWASM.PLATFORM_V9);
31
+ const { rootHash, prices } = verifyTokenDirectPurchasePrices(proof.grovedbProof, tokenIds, true, LATEST_PLATFORM_VERSION);
31
32
  if (prices == null) {
32
33
  throw new Error('Prices not found');
33
34
  }
@@ -1,3 +1,3 @@
1
1
  import GRPCConnectionPool from '../grpcConnectionPool.js';
2
- import { IdentifierLike, TokenTotalSupply } from '../types.js';
2
+ import { IdentifierLike, TokenTotalSupply } from '../../types.js';
3
3
  export default function getTokenTotalSupply(grpcPool: GRPCConnectionPool, tokenIdentifier: IdentifierLike): Promise<TokenTotalSupply>;
@@ -1,8 +1,9 @@
1
1
  import { GetTokenTotalSupplyRequest } from '../../proto/generated/platform.js';
2
- import { IdentifierWASM, PlatformVersionWASM, verifyTokenTotalSupplyProof } from 'pshenmic-dpp';
2
+ import { IdentifierWASM, verifyTokenTotalSupplyProof } from 'pshenmic-dpp';
3
3
  import { getQuorumPublicKey } from '../utils/getQuorumPublicKey.js';
4
4
  import bytesToHex from '../utils/bytesToHex.js';
5
5
  import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
6
+ import { LATEST_PLATFORM_VERSION } from '../constants.js';
6
7
  export default async function getTokenTotalSupply(grpcPool, tokenIdentifier) {
7
8
  const tokenId = new IdentifierWASM(tokenIdentifier);
8
9
  const getTokenTotalSupplyRequest = GetTokenTotalSupplyRequest.create({
@@ -27,7 +28,7 @@ export default async function getTokenTotalSupply(grpcPool, tokenIdentifier) {
27
28
  if (metadata == null) {
28
29
  throw new Error('Metadata not found');
29
30
  }
30
- const { rootHash, totalBalance } = verifyTokenTotalSupplyProof(proof.grovedbProof, tokenId, true, PlatformVersionWASM.PLATFORM_V9);
31
+ const { rootHash, totalBalance } = verifyTokenTotalSupplyProof(proof.grovedbProof, tokenId, true, LATEST_PLATFORM_VERSION);
31
32
  const quorumPublicKey = await getQuorumPublicKey(grpcPool.network, proof.quorumType, bytesToHex(proof.quorumHash));
32
33
  const verify = await verifyTenderdashProof(proof, metadata, rootHash, quorumPublicKey);
33
34
  if (!verify) {
@@ -1,5 +1,5 @@
1
1
  import GRPCConnectionPool from '../grpcConnectionPool.js';
2
- import { IdentifierLike, TokenDirectPurchasePrices, TokenTotalSupply, TokenTransitionParams, TokenTransitionType } from '../types.js';
2
+ import { IdentifierLike, TokenDirectPurchasePrices, TokenTotalSupply, TokenTransitionParams, TokenTransitionType } from '../../types.js';
3
3
  import { IdentitiesTokenBalances } from './getIdentitiesTokenBalances.js';
4
4
  import { IdentityTokenBalances } from './getIdentityTokensBalances.js';
5
5
  import { TokenContractInfo } from './getTokenContractInfo.js';
@@ -1,2 +1,2 @@
1
- import { MasternodeList, Network } from '../types.js';
1
+ import { MasternodeList, Network } from '../../types.js';
2
2
  export default function getDAPINodeList(network: Network): Promise<MasternodeList>;
@@ -1,4 +1,5 @@
1
1
  import { IdentifierWASM } from 'pshenmic-dpp';
2
+ import { IdentifierLike } from '../../types.js';
2
3
  /**
3
4
  * Collection of conversion functions
4
5
  *
@@ -62,4 +63,11 @@ export declare class UtilsController {
62
63
  * @return {string}
63
64
  * */
64
65
  createMasternodeIdentifier(proTxHash: string): IdentifierWASM;
66
+ /**
67
+ * Validates an identifier, accepts string or buffer
68
+ *
69
+ * @param identifier {IdentifierLike} identifier to test
70
+ * @return {boolean}
71
+ * */
72
+ validateIdentifier(identifier: IdentifierLike): boolean;
65
73
  }
@@ -3,6 +3,7 @@ import { base58 } from '@scure/base';
3
3
  import hexToBytes from './hexToBytes.js';
4
4
  import bytesToHex from './bytesToHex.js';
5
5
  import { createVoterIdentityId } from './createVoterIdentityId.js';
6
+ import { IdentifierWASM } from 'pshenmic-dpp';
6
7
  import { createMasternodeIdentityId } from './createMasternodeIdentityId.js';
7
8
  /**
8
9
  * Collection of conversion functions
@@ -81,4 +82,20 @@ export class UtilsController {
81
82
  createMasternodeIdentifier(proTxHash) {
82
83
  return createMasternodeIdentityId(proTxHash);
83
84
  }
85
+ /**
86
+ * Validates an identifier, accepts string or buffer
87
+ *
88
+ * @param identifier {IdentifierLike} identifier to test
89
+ * @return {boolean}
90
+ * */
91
+ validateIdentifier(identifier) {
92
+ try {
93
+ // eslint-disable-next-line
94
+ new IdentifierWASM(identifier);
95
+ return true;
96
+ }
97
+ catch (e) {
98
+ return false;
99
+ }
100
+ }
84
101
  }
@@ -1,4 +1,4 @@
1
- import { IdentifierLike, ResourceVoteChoice } from '../types.js';
1
+ import { IdentifierLike, ResourceVoteChoice } from '../../types.js';
2
2
  import { IdentifierWASM, StateTransitionWASM, VoteWASM } from 'pshenmic-dpp';
3
3
  /**
4
4
  * Voting controller for performing masternode votes
@@ -1,6 +1,7 @@
1
- import { DataContractWASM, PlatformVersionWASM, PrivateKeyWASM } from 'pshenmic-dpp';
2
- import { DashPlatformSDK, ContestedStateResultType } from '../../src/types.js';
1
+ import { DataContractWASM, PrivateKeyWASM } from 'pshenmic-dpp';
2
+ import { DashPlatformSDK, ContestedStateResultType } from '../../types.js';
3
3
  import stringToIndexValueBytes from '../../src/utils/stringToIndexValueBytes.js';
4
+ import { LATEST_PLATFORM_VERSION } from '../../src/constants.js';
4
5
  let sdk;
5
6
  let contract;
6
7
  describe('Contested Resources', () => {
@@ -171,7 +172,7 @@ describe('Contested Resources', () => {
171
172
  documentsMutable: false,
172
173
  additionalProperties: false
173
174
  }
174
- }, undefined, undefined, true, PlatformVersionWASM.PLATFORM_V9);
175
+ }, undefined, undefined, true, LATEST_PLATFORM_VERSION);
175
176
  contract.id = 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec';
176
177
  });
177
178
  test('should be able to get contested resource vote state with finishedVoteInfo', async () => {
@@ -184,6 +185,7 @@ describe('Contested Resources', () => {
184
185
  expect(voteState.contenders.length).toBeGreaterThan(0);
185
186
  expect(voteState.abstainVoteTally).toBeDefined();
186
187
  expect(voteState.lockVoteTally).toBeDefined();
188
+ expect(voteState.skipped).toBeDefined();
187
189
  });
188
190
  test('should be able to get contested resource vote state for incorrect values', async () => {
189
191
  try {
@@ -1,5 +1,5 @@
1
1
  import { DataContractWASM, StateTransitionWASM } from 'pshenmic-dpp';
2
- import { DashPlatformSDK } from '../../src/types.js';
2
+ import { DashPlatformSDK } from '../../types.js';
3
3
  let sdk;
4
4
  let ownerIdentifier;
5
5
  let identityNonce;
@@ -11,7 +11,7 @@ describe('DataContract', () => {
11
11
  ownerIdentifier = 'GARSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec';
12
12
  identityNonce = BigInt(11);
13
13
  config = {
14
- $format_version: '0',
14
+ $format_version: '1',
15
15
  canBeDeleted: true,
16
16
  readonly: true,
17
17
  keepsHistory: false,
@@ -19,7 +19,8 @@ describe('DataContract', () => {
19
19
  documentsMutableContractDefault: false,
20
20
  documentsCanBeDeletedContractDefault: true,
21
21
  requiresIdentityEncryptionBoundedKey: null,
22
- requiresIdentityDecryptionBoundedKey: null
22
+ requiresIdentityDecryptionBoundedKey: null,
23
+ sizedIntegerTypes: true
23
24
  };
24
25
  schema = {
25
26
  note: {
@@ -1,5 +1,6 @@
1
- import { IdentityPublicKeyWASM, IdentityWASM, KeyType, PrivateKeyWASM, Purpose, SecurityLevel } from 'pshenmic-dpp';
2
- import { DashPlatformSDK } from '../../src/types.js';
1
+ import { CoreScriptWASM, IdentityPublicKeyWASM, IdentityWASM, KeyType, PrivateKeyWASM, Purpose, SecurityLevel, StateTransitionWASM } from 'pshenmic-dpp';
2
+ import { DashPlatformSDK } from '../../types.js';
3
+ import { base58 } from '@scure/base';
3
4
  let sdk;
4
5
  describe('Identity', () => {
5
6
  beforeAll(() => {
@@ -228,5 +229,38 @@ describe('Identity', () => {
228
229
  });
229
230
  identityUpdateTransition.signByPrivateKey(masterPrivateKey, masterKeyId, KeyType.ECDSA_SECP256K1);
230
231
  });
232
+ test('should able be create credit transfer transition', async () => {
233
+ const identityId = 'QMfCRPcjXoTnZa9sA9JR2KWgGxZXMRJ4akgS3Uia1Qv';
234
+ const recipientId = 'HT3pUBM1Uv2mKgdPEN1gxa7A4PdsvNY89aJbdSKQb5wR';
235
+ const amount = 100000n;
236
+ const identityNonce = await sdk.identities.getIdentityNonce(identityId);
237
+ const stateTransition = sdk.identities.createStateTransition('creditTransfer', { identityId, identityNonce, recipientId, amount });
238
+ expect(stateTransition).toEqual(expect.any(StateTransitionWASM));
239
+ });
240
+ test('should be able create credit withdrawal', async () => {
241
+ const identityId = 'QMfCRPcjXoTnZa9sA9JR2KWgGxZXMRJ4akgS3Uia1Qv';
242
+ const amount = 100000n;
243
+ const identityNonce = await sdk.identities.getIdentityNonce(identityId);
244
+ const withdrawalAddress = 'yjHVQ3dj37UJwXFmvMTKR9ZVfoJSc3opTD';
245
+ const stateTransition = sdk.identities.createStateTransition('withdrawal', { identityId, identityNonce, amount, withdrawalAddress });
246
+ expect(stateTransition).toEqual(expect.any(StateTransitionWASM));
247
+ });
248
+ test('should be able create credit withdrawal with custom CoreScript', async () => {
249
+ const identityId = 'QMfCRPcjXoTnZa9sA9JR2KWgGxZXMRJ4akgS3Uia1Qv';
250
+ const amount = 100000n;
251
+ const identityNonce = await sdk.identities.getIdentityNonce(identityId);
252
+ const withdrawalAddress = 'yjHVQ3dj37UJwXFmvMTKR9ZVfoJSc3opTD';
253
+ const outputScript = CoreScriptWASM.newP2PKH(base58.decode(withdrawalAddress).slice(1, 21));
254
+ const stateTransition = sdk.identities.createStateTransition('withdrawal', { identityId, identityNonce, amount, outputScript });
255
+ expect(stateTransition).toEqual(expect.any(StateTransitionWASM));
256
+ });
257
+ test('should be able create credit withdrawal with no withdrawal address', async () => {
258
+ const identityId = 'QMfCRPcjXoTnZa9sA9JR2KWgGxZXMRJ4akgS3Uia1Qv';
259
+ const recipientId = 'HT3pUBM1Uv2mKgdPEN1gxa7A4PdsvNY89aJbdSKQb5wR';
260
+ const amount = 100000n;
261
+ const identityNonce = await sdk.identities.getIdentityNonce(identityId);
262
+ const stateTransition = sdk.identities.createStateTransition('creditTransfer', { identityId, recipientId, amount, identityNonce });
263
+ expect(stateTransition).toEqual(expect.any(StateTransitionWASM));
264
+ });
231
265
  });
232
266
  });
@@ -2,6 +2,7 @@ import broadcast from '../../src/stateTransitions/broadcast.js';
2
2
  import { DocumentWASM, PrivateKeyWASM } from 'pshenmic-dpp';
3
3
  import { DashPlatformSDK } from '../../src/DashPlatformSDK.js';
4
4
  import sleep from '../../src/utils/sleep.js';
5
+ jest.mock('../../src/stateTransitions/waitForStateTransitionResult');
5
6
  jest.mock('../../src/stateTransitions/broadcast');
6
7
  jest.mock('../../src/utils/sleep');
7
8
  let sdk;
@@ -11,13 +12,14 @@ describe('DPNS names', () => {
11
12
  // @ts-expect-error
12
13
  sleep.mockReturnValue(Promise.resolve());
13
14
  sdk.stateTransitions.broadcast = jest.fn();
15
+ sdk.stateTransitions.waitForStateTransitionResult = jest.fn();
14
16
  });
15
- test('should be able to search names by DPNS name', async () => {
17
+ xtest('should be able to search names by DPNS name', async () => {
16
18
  const documents = await sdk.names.searchByName('xyz.dash');
17
19
  expect(documents?.length).toEqual(1);
18
20
  expect(documents[0]).toEqual(expect.any(DocumentWASM));
19
21
  });
20
- test('should be able to search names by identity', async () => {
22
+ xtest('should be able to search names by identity', async () => {
21
23
  const documents = await sdk.names.searchByIdentity('36LGwPSXef8q8wpdnx4EdDeVNuqCYNAE9boDu5bxytsm');
22
24
  expect(documents?.length).toEqual(3);
23
25
  const [xyzDocument] = documents;
@@ -1,10 +1,9 @@
1
- import { DocumentWASM, GasFeesPaidByWASM, IdentifierWASM, KeyType, Purpose, SecurityLevel, TokenEmergencyActionWASM, TokenPricingScheduleWASM } from 'pshenmic-dpp';
2
- export { IdentifierWASM, IdentityWASM, DocumentWASM, DataContractWASM, StateTransitionWASM, IdentityPublicKeyWASM } from 'pshenmic-dpp';
1
+ import { CoreScriptWASM, DocumentWASM, GasFeesPaidByWASM, IdentifierWASM, KeyType, Purpose, SecurityLevel, TokenEmergencyActionWASM, TokenPricingScheduleWASM } from 'pshenmic-dpp';
2
+ export { CoreScriptWASM, DocumentWASM, GasFeesPaidByWASM, IdentifierWASM, KeyType, Purpose, SecurityLevel, TokenEmergencyActionWASM, TokenPricingScheduleWASM, StateTransitionWASM, BatchTransitionWASM, IdentityPublicKeyWASM, PrivateKeyWASM, DataContractUpdateTransitionWASM, IdentityWASM, IdentityUpdateTransitionWASM, IdentityCreditTransferWASM, MasternodeVoteTransitionWASM } from 'pshenmic-dpp';
3
3
  export type IdentifierLike = IdentifierWASM | string | Uint8Array;
4
4
  export type Network = 'mainnet' | 'testnet';
5
- export { DashPlatformSDK } from './DashPlatformSDK.js';
5
+ export { DashPlatformSDK } from './src/DashPlatformSDK.js';
6
6
  export type MasternodeList = Record<string, MasternodeInfo>;
7
- export { AbstractSigner } from './signer/AbstractSigner.js';
8
7
  export interface DocumentTransitionParams {
9
8
  identityContractNonce: bigint;
10
9
  amount?: bigint;
@@ -123,6 +122,7 @@ export interface ContestedResourceVoteState {
123
122
  contenders: Contender[];
124
123
  abstainVoteTally?: number | undefined;
125
124
  lockVoteTally?: number | undefined;
125
+ skipped: boolean;
126
126
  finishedVoteInfo?: FinishedVoteInfo;
127
127
  }
128
128
  export interface DataContractConfig {
@@ -135,6 +135,7 @@ export interface DataContractConfig {
135
135
  documentsCanBeDeletedContractDefault: boolean;
136
136
  requiresIdentityEncryptionBoundedKey?: number | null;
137
137
  requiresIdentityDecryptionBoundedKey?: number | null;
138
+ sizedIntegerTypes: boolean;
138
139
  }
139
140
  export type TokenTransitionType = 'burn' | 'mint' | 'transfer' | 'freeze' | 'unfreeze' | 'destroyFrozenFunds' | 'emergencyAction' | 'directPurchase' | 'setPriceForDirectPurchase';
140
141
  export interface TokenTransitionParams {
@@ -186,7 +187,13 @@ export interface IdentityTransitionParams {
186
187
  disablePublicKeyIds?: number[];
187
188
  revision?: bigint;
188
189
  identityNonce?: bigint;
190
+ amount?: bigint;
189
191
  identityId?: IdentifierLike;
192
+ recipientId?: IdentifierLike;
193
+ withdrawalAddress?: string;
194
+ outputScript?: CoreScriptWASM;
195
+ pooling?: 'Standard' | 'Never' | 'IfAvailable';
196
+ coreFeePerByte?: number;
190
197
  userFeeIncrease?: number;
191
198
  }
192
199
  export interface TokenTotalSupply {
@@ -1,5 +1,5 @@
1
- export { IdentifierWASM, IdentityWASM, DocumentWASM, DataContractWASM, StateTransitionWASM, IdentityPublicKeyWASM } from 'pshenmic-dpp';
2
- export { DashPlatformSDK } from './DashPlatformSDK.js';
1
+ export { CoreScriptWASM, DocumentWASM, GasFeesPaidByWASM, IdentifierWASM, KeyType, Purpose, SecurityLevel, TokenEmergencyActionWASM, TokenPricingScheduleWASM, StateTransitionWASM, BatchTransitionWASM, IdentityPublicKeyWASM, PrivateKeyWASM, DataContractUpdateTransitionWASM, IdentityWASM, IdentityUpdateTransitionWASM, IdentityCreditTransferWASM, MasternodeVoteTransitionWASM } from 'pshenmic-dpp';
2
+ export { DashPlatformSDK } from './src/DashPlatformSDK.js';
3
3
  export var ContestedStateResultType;
4
4
  (function (ContestedStateResultType) {
5
5
  ContestedStateResultType[ContestedStateResultType["DOCUMENTS"] = 0] = "DOCUMENTS";
@@ -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
- }