dash-platform-sdk 1.5.0-dev.6 → 1.5.0-dev.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dash-platform-sdk",
3
- "version": "1.5.0-dev.6",
3
+ "version": "1.5.0-dev.7",
4
4
  "main": "index.js",
5
5
  "description": "Lightweight SDK for accessing Dash Platform blockchain",
6
6
  "repository": {
@@ -23,7 +23,7 @@ const identityTransitionsMap = {
23
23
  withdrawal: {
24
24
  class: IdentityCreditWithdrawalTransitionWASM,
25
25
  arguments: ['identityId', 'amount', 'coreFeePerByte', 'pooling', 'identityNonce', 'outputScript'],
26
- optionalArguments: ['userFeeIncrease']
26
+ optionalArguments: ['outputScript', 'userFeeIncrease']
27
27
  }
28
28
  };
29
29
  export default function createStateTransition(type, params) {
@@ -35,7 +35,7 @@ export default function createStateTransition(type, params) {
35
35
  .filter((classArgument) => params[classArgument] == null &&
36
36
  !(optionalArguments).includes(classArgument));
37
37
  if (missingArgument != null) {
38
- throw new Error(`Token transition param "${missingArgument}" is missing`);
38
+ throw new Error(`Transition param "${missingArgument}" is missing`);
39
39
  }
40
40
  const transitionParams = classArguments.map((classArgument) => params[classArgument]);
41
41
  // @ts-expect-error
@@ -4,6 +4,9 @@ import { calculateStateIdHash } from './calculateStateIdHash.js';
4
4
  import { verifySignatureDigest } from 'pshenmic-dpp';
5
5
  import hexToBytes from './hexToBytes.js';
6
6
  export default async function verifyTenderdashProof(proof, metadata, rootHash, quorumPublicKey) {
7
+ if ((new Date().getTime() - new Date(metadata.timeMs).getTime()) > 15 * 60 * 60 * 1000) {
8
+ throw new Error('Request is stalled (over 15 minutes)');
9
+ }
7
10
  const stateId = StateId.create({
8
11
  appVersion: String(metadata.protocolVersion),
9
12
  coreChainLockedHeight: metadata.coreChainLockedHeight,
@@ -259,7 +259,7 @@ describe('Identity', () => {
259
259
  const recipientId = 'HT3pUBM1Uv2mKgdPEN1gxa7A4PdsvNY89aJbdSKQb5wR';
260
260
  const amount = 100000n;
261
261
  const identityNonce = await sdk.identities.getIdentityNonce(identityId);
262
- const stateTransition = sdk.identities.createStateTransition('creditTransfer', { identityId, recipientId, amount, identityNonce });
262
+ const stateTransition = sdk.identities.createStateTransition('withdrawal', { identityId, recipientId, amount, identityNonce });
263
263
  expect(stateTransition).toEqual(expect.any(StateTransitionWASM));
264
264
  });
265
265
  });