dash-platform-sdk 1.3.0-dev.6 → 1.3.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.
Files changed (109) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +1 -1
  3. package/package.json +4 -2
  4. package/proto/generated/google/protobuf/wrappers.js +1 -1
  5. package/proto/generated/platform.client.d.ts +46 -46
  6. package/proto/generated/platform.client.js +1 -1
  7. package/proto/generated/platform.d.ts +1 -1
  8. package/proto/generated/platform.js +2 -2
  9. package/src/DashPlatformSDK.d.ts +14 -14
  10. package/src/DashPlatformSDK.js +12 -12
  11. package/src/contestedResources/getContestedResourceVoteState.d.ts +3 -3
  12. package/src/contestedResources/getContestedResourceVoteState.js +4 -4
  13. package/src/contestedResources/index.d.ts +3 -3
  14. package/src/contestedResources/index.js +1 -1
  15. package/src/dataContracts/create.d.ts +1 -1
  16. package/src/dataContracts/getDataContractByIdentifier.d.ts +2 -2
  17. package/src/dataContracts/getDataContractByIdentifier.js +5 -5
  18. package/src/dataContracts/index.d.ts +2 -2
  19. package/src/dataContracts/index.js +3 -3
  20. package/src/documents/create.d.ts +1 -1
  21. package/src/documents/createStateTransition.d.ts +1 -1
  22. package/src/documents/index.d.ts +2 -2
  23. package/src/documents/index.js +3 -3
  24. package/src/documents/query.d.ts +2 -2
  25. package/src/documents/query.js +6 -6
  26. package/src/grpcConnectionPool.d.ts +2 -2
  27. package/src/grpcConnectionPool.js +4 -4
  28. package/src/identities/createStateTransition.d.ts +1 -1
  29. package/src/identities/getIdentityBalance.d.ts +2 -2
  30. package/src/identities/getIdentityBalance.js +4 -4
  31. package/src/identities/getIdentityByIdentifier.d.ts +2 -2
  32. package/src/identities/getIdentityByIdentifier.js +4 -4
  33. package/src/identities/getIdentityByNonUniquePublicKeyHash.d.ts +1 -1
  34. package/src/identities/getIdentityByNonUniquePublicKeyHash.js +6 -6
  35. package/src/identities/getIdentityByPublicKeyHash.d.ts +1 -1
  36. package/src/identities/getIdentityByPublicKeyHash.js +5 -5
  37. package/src/identities/getIdentityContractNonce.d.ts +2 -2
  38. package/src/identities/getIdentityContractNonce.js +4 -4
  39. package/src/identities/getIdentityNonce.d.ts +2 -2
  40. package/src/identities/getIdentityNonce.js +4 -4
  41. package/src/identities/getIdentityPublicKeys.d.ts +2 -2
  42. package/src/identities/getIdentityPublicKeys.js +4 -4
  43. package/src/identities/index.d.ts +2 -2
  44. package/src/identities/index.js +9 -9
  45. package/src/keyPair/index.d.ts +1 -1
  46. package/src/keyPair/index.js +3 -3
  47. package/src/names/index.d.ts +2 -2
  48. package/src/names/index.js +7 -7
  49. package/src/names/registerName.d.ts +1 -1
  50. package/src/names/registerName.js +10 -10
  51. package/src/names/searchByIdentity.d.ts +1 -1
  52. package/src/names/searchByIdentity.js +1 -1
  53. package/src/names/searchByName.d.ts +1 -1
  54. package/src/names/searchByName.js +2 -2
  55. package/src/node/epochs.d.ts +1 -1
  56. package/src/node/epochs.js +5 -5
  57. package/src/node/index.d.ts +3 -3
  58. package/src/node/index.js +3 -3
  59. package/src/node/status.d.ts +2 -2
  60. package/src/node/status.js +2 -2
  61. package/src/node/totalCredits.d.ts +2 -2
  62. package/src/node/totalCredits.js +5 -5
  63. package/src/signer/PrivateKeySigner.d.ts +1 -0
  64. package/src/signer/PrivateKeySigner.js +1 -0
  65. package/src/signer/setSigner.d.ts +1 -1
  66. package/src/stateTransitions/broadcast.d.ts +1 -1
  67. package/src/stateTransitions/broadcast.js +1 -1
  68. package/src/stateTransitions/index.d.ts +1 -1
  69. package/src/stateTransitions/index.js +2 -2
  70. package/src/stateTransitions/waitForStateTransitionResult.d.ts +1 -1
  71. package/src/tokens/createStateTransition.d.ts +1 -1
  72. package/src/tokens/getIdentitiesTokenBalances.d.ts +2 -2
  73. package/src/tokens/getIdentitiesTokenBalances.js +4 -4
  74. package/src/tokens/getIdentityTokensBalances.d.ts +2 -2
  75. package/src/tokens/getIdentityTokensBalances.js +4 -4
  76. package/src/tokens/getTokenContractInfo.d.ts +2 -2
  77. package/src/tokens/getTokenContractInfo.js +4 -4
  78. package/src/tokens/getTokenDirectPurchasePrices.d.ts +2 -2
  79. package/src/tokens/getTokenDirectPurchasePrices.js +4 -4
  80. package/src/tokens/getTokenTotalSupply.d.ts +2 -2
  81. package/src/tokens/getTokenTotalSupply.js +4 -4
  82. package/src/tokens/index.d.ts +5 -5
  83. package/src/tokens/index.js +7 -7
  84. package/src/types.d.ts +2 -2
  85. package/src/types.js +1 -1
  86. package/src/utils/calculateMsgHash.js +1 -1
  87. package/src/utils/calculateSignHash.d.ts +1 -1
  88. package/src/utils/calculateSignHash.js +3 -3
  89. package/src/utils/calculateStateIdHash.d.ts +1 -1
  90. package/src/utils/calculateStateIdHash.js +2 -2
  91. package/src/utils/createVoterIdentityId.js +3 -3
  92. package/src/utils/getEvonodeList.d.ts +1 -1
  93. package/src/utils/index.js +3 -3
  94. package/src/utils/sha256.js +2 -2
  95. package/src/utils/signHash.js +1 -1
  96. package/src/utils/signRequestId.js +1 -1
  97. package/src/utils/verifyTenderdashProof.d.ts +1 -1
  98. package/src/utils/verifyTenderdashProof.js +4 -4
  99. package/src/voting/index.d.ts +1 -1
  100. package/src/voting/index.js +2 -2
  101. package/test/unit/ContestedResources.spec.js +2 -3
  102. package/test/unit/DataContract.spec.js +1 -1
  103. package/test/unit/Document.spec.js +1 -1
  104. package/test/unit/Identity.spec.js +1 -1
  105. package/test/unit/KeyPair.spec.js +1 -1
  106. package/test/unit/Names.spec.js +3 -3
  107. package/test/unit/Node.spec.js +1 -1
  108. package/test/unit/SDK.spec.js +1 -1
  109. package/test/unit/Tokens.spec.js +1 -1
@@ -1,13 +1,13 @@
1
- import getIdentityContractNonce from './getIdentityContractNonce';
2
- import getIdentityPublicKeys from './getIdentityPublicKeys';
3
- import getIdentityNonce from './getIdentityNonce';
4
- import getIdentityBalance from './getIdentityBalance';
5
- import getIdentityByPublicKeyHash from './getIdentityByPublicKeyHash';
6
- import getIdentityByIdentifier from './getIdentityByIdentifier';
1
+ import getIdentityContractNonce from './getIdentityContractNonce.js';
2
+ import getIdentityPublicKeys from './getIdentityPublicKeys.js';
3
+ import getIdentityNonce from './getIdentityNonce.js';
4
+ import getIdentityBalance from './getIdentityBalance.js';
5
+ import getIdentityByPublicKeyHash from './getIdentityByPublicKeyHash.js';
6
+ import getIdentityByIdentifier from './getIdentityByIdentifier.js';
7
7
  import { AssetLockProofWASM, ContractBoundsWASM, IdentifierWASM, IdentityPublicKeyInCreationWASM, OutPointWASM } from 'pshenmic-dpp';
8
- import createStateTransition from './createStateTransition';
9
- import getIdentityByNonUniquePublicKeyHash from './getIdentityByNonUniquePublicKeyHash';
10
- import hexToBytes from '../utils/hexToBytes';
8
+ import createStateTransition from './createStateTransition.js';
9
+ import getIdentityByNonUniquePublicKeyHash from './getIdentityByNonUniquePublicKeyHash.js';
10
+ import hexToBytes from '../utils/hexToBytes.js';
11
11
  /**
12
12
  * Collection of methods to query identities and its related data
13
13
  *
@@ -1,5 +1,5 @@
1
1
  import { HDKey } from '@scure/bip32';
2
- import { Network } from '../types';
2
+ import { Network } from '../types.js';
3
3
  /**
4
4
  * Collection of functions to work with private keys and seed phrases
5
5
  *
@@ -1,7 +1,7 @@
1
1
  import { HDKey } from '@scure/bip32';
2
- import mnemonicToSeed from './mnemonicToSeed';
3
- import deriveChild from './deriveChild';
4
- import derivePath from './derivePath';
2
+ import mnemonicToSeed from './mnemonicToSeed.js';
3
+ import deriveChild from './deriveChild.js';
4
+ import derivePath from './derivePath.js';
5
5
  import { p2pkh } from '@scure/btc-signer';
6
6
  const DASH_VERSIONS = {
7
7
  mainnet: { pubKeyHash: 0x4c, scriptHash: 0x10, bech32: 'dc', wif: 0xcc, private: 0x0488ade4, public: 0x0488b21e },
@@ -1,6 +1,6 @@
1
- import GRPCConnectionPool from '../grpcConnectionPool';
1
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
2
2
  import { DocumentWASM, PrivateKeyWASM } from 'pshenmic-dpp';
3
- import { IdentifierLike } from '../types';
3
+ import { IdentifierLike } from '../types.js';
4
4
  /**
5
5
  * Functions related to DPNS names (usernames)
6
6
  *
@@ -1,11 +1,11 @@
1
1
  import { IdentifierWASM } from 'pshenmic-dpp';
2
- import searchByName from './searchByName';
3
- import searchByIdentity from './searchByIdentity';
4
- import registerName from './registerName';
5
- import validateName from './validateName';
6
- import getIdentityByIdentifier from '../identities/getIdentityByIdentifier';
7
- import convertToHomographSafeChars from '../utils/convertToHomographSafeChars';
8
- import testNameContested from './testNameContested';
2
+ import searchByName from './searchByName.js';
3
+ import searchByIdentity from './searchByIdentity.js';
4
+ import registerName from './registerName.js';
5
+ import validateName from './validateName.js';
6
+ import getIdentityByIdentifier from '../identities/getIdentityByIdentifier.js';
7
+ import convertToHomographSafeChars from '../utils/convertToHomographSafeChars.js';
8
+ import testNameContested from './testNameContested.js';
9
9
  /**
10
10
  * Functions related to DPNS names (usernames)
11
11
  *
@@ -1,3 +1,3 @@
1
1
  import { IdentityWASM, PrivateKeyWASM } from 'pshenmic-dpp';
2
- import GRPCConnectionPool from '../grpcConnectionPool';
2
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
3
3
  export default function registerName(grpcPool: GRPCConnectionPool, name: string, identity: IdentityWASM, privateKey: PrivateKeyWASM): Promise<void>;
@@ -1,14 +1,14 @@
1
- import convertToHomographSafeChars from '../utils/convertToHomographSafeChars';
1
+ import convertToHomographSafeChars from '../utils/convertToHomographSafeChars.js';
2
2
  import { PrefundedVotingBalanceWASM } from 'pshenmic-dpp';
3
- import getRandomBytes from '../utils/getRandomBytes';
4
- import sha256 from '../utils/sha256';
5
- import createDocument from '../documents/create';
6
- import createStateTransition from '../documents/createStateTransition';
7
- import getIdentityContractNonce from '../identities/getIdentityContractNonce';
8
- import broadcast from '../stateTransitions/broadcast';
9
- import waitForStateTransitionResult from '../stateTransitions/waitForStateTransitionResult';
10
- import testNameContested from './testNameContested';
11
- import { DPNS_DATA_CONTRACT_ID } from '../constants';
3
+ import getRandomBytes from '../utils/getRandomBytes.js';
4
+ import sha256 from '../utils/sha256.js';
5
+ import createDocument from '../documents/create.js';
6
+ import createStateTransition from '../documents/createStateTransition.js';
7
+ import getIdentityContractNonce from '../identities/getIdentityContractNonce.js';
8
+ import broadcast from '../stateTransitions/broadcast.js';
9
+ import waitForStateTransitionResult from '../stateTransitions/waitForStateTransitionResult.js';
10
+ import testNameContested from './testNameContested.js';
11
+ import { DPNS_DATA_CONTRACT_ID } from '../constants.js';
12
12
  export default async function registerName(grpcPool, name, identity, privateKey) {
13
13
  const [identityPublicKey] = identity.getPublicKeys().filter(identityPublicKey => identityPublicKey.getPublicKeyHash() === privateKey.getPublicKeyHash());
14
14
  if (identityPublicKey == null) {
@@ -1,3 +1,3 @@
1
1
  import { DocumentWASM, IdentifierWASM } from 'pshenmic-dpp';
2
- import GRPCConnectionPool from '../grpcConnectionPool';
2
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
3
3
  export default function searchByIdentity(grpcPool: GRPCConnectionPool, identifier: IdentifierWASM): Promise<DocumentWASM[]>;
@@ -1,4 +1,4 @@
1
- import query from '../documents/query';
1
+ import query from '../documents/query.js';
2
2
  const DPNS_DATA_CONTRACT_ID = 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec';
3
3
  export default async function searchByIdentity(grpcPool, identifier) {
4
4
  return await query(grpcPool, DPNS_DATA_CONTRACT_ID, 'domain', [['records.identity', '=', identifier.base58()]], [['records.identity', 'asc']]);
@@ -1,3 +1,3 @@
1
1
  import { DocumentWASM } from 'pshenmic-dpp';
2
- import GRPCConnectionPool from '../grpcConnectionPool';
2
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
3
3
  export default function search(grpcPool: GRPCConnectionPool, name: string): Promise<DocumentWASM[]>;
@@ -1,5 +1,5 @@
1
- import convertToHomographSafeChars from '../utils/convertToHomographSafeChars';
2
- import query from '../documents/query';
1
+ import convertToHomographSafeChars from '../utils/convertToHomographSafeChars.js';
2
+ import query from '../documents/query.js';
3
3
  const DPNS_DATA_CONTRACT_ID = 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec';
4
4
  export default async function search(grpcPool, name) {
5
5
  const [label, parentDomainName] = name.split('.');
@@ -1,4 +1,4 @@
1
- import GRPCConnectionPool from '../grpcConnectionPool';
1
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
2
2
  export interface EpochInfo {
3
3
  number: number;
4
4
  firstBlockHeight: number;
@@ -1,9 +1,9 @@
1
- import { GetEpochsInfoRequest } from '../../proto/generated/platform';
1
+ import { GetEpochsInfoRequest } from '../../proto/generated/platform.js';
2
2
  import { PlatformVersionWASM, verifyEpochsInfoProof } from 'pshenmic-dpp';
3
- import { getQuorumPublicKey } from '../utils/getQuorumPublicKey';
4
- import bytesToHex from '../utils/bytesToHex';
5
- import verifyTenderdashProof from '../utils/verifyTenderdashProof';
6
- import { UInt32Value } from '../../proto/generated/google/protobuf/wrappers';
3
+ import { getQuorumPublicKey } from '../utils/getQuorumPublicKey.js';
4
+ import bytesToHex from '../utils/bytesToHex.js';
5
+ import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
6
+ import { UInt32Value } from '../../proto/generated/google/protobuf/wrappers.js';
7
7
  export default async function epochs(grpcPool, count, ascending, start) {
8
8
  const getEpochsInfoRequest = GetEpochsInfoRequest.create({
9
9
  version: {
@@ -1,6 +1,6 @@
1
- import GRPCConnectionPool from '../grpcConnectionPool';
2
- import { Network, NodeStatus } from '../types';
3
- import { EpochInfo } from './epochs';
1
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
2
+ import { Network, NodeStatus } from '../types.js';
3
+ import { EpochInfo } from './epochs.js';
4
4
  /**
5
5
  * Node controller for requesting information about DAPI node
6
6
  *
package/src/node/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import getStatus from './status';
2
- import getEpochsInfo from './epochs';
3
- import getTotalCredits from './totalCredits';
1
+ import getStatus from './status.js';
2
+ import getEpochsInfo from './epochs.js';
3
+ import getTotalCredits from './totalCredits.js';
4
4
  /**
5
5
  * Node controller for requesting information about DAPI node
6
6
  *
@@ -1,3 +1,3 @@
1
- import { NodeStatus } from '../types';
2
- import GRPCConnectionPool from '../grpcConnectionPool';
1
+ import { NodeStatus } from '../types.js';
2
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
3
3
  export default function status(grpcPool: GRPCConnectionPool): Promise<NodeStatus>;
@@ -1,5 +1,5 @@
1
- import { GetStatusRequest } from '../../proto/generated/platform';
2
- import bytesToHex from '../utils/bytesToHex';
1
+ import { GetStatusRequest } from '../../proto/generated/platform.js';
2
+ import bytesToHex from '../utils/bytesToHex.js';
3
3
  export default async function status(grpcPool) {
4
4
  const getStatusRequest = GetStatusRequest.create({
5
5
  version: {
@@ -1,3 +1,3 @@
1
- import GRPCConnectionPool from '../grpcConnectionPool';
2
- import { Network } from '../types';
1
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
2
+ import { Network } from '../types.js';
3
3
  export default function totalCredits(grpcPool: GRPCConnectionPool, network: Network): Promise<bigint>;
@@ -1,9 +1,9 @@
1
- import { GetTotalCreditsInPlatformRequest } from '../../proto/generated/platform';
2
- import { HALVING_INTERVAL, MAINNET_ACTIVATION_HEIGHT, TESTNET_ACTIVATION_HEIGHT } from '../constants';
1
+ import { GetTotalCreditsInPlatformRequest } from '../../proto/generated/platform.js';
2
+ import { HALVING_INTERVAL, MAINNET_ACTIVATION_HEIGHT, TESTNET_ACTIVATION_HEIGHT } from '../constants.js';
3
3
  import { PlatformVersionWASM, verifyTotalCreditsProof } from 'pshenmic-dpp';
4
- import { getQuorumPublicKey } from '../utils/getQuorumPublicKey';
5
- import bytesToHex from '../utils/bytesToHex';
6
- import verifyTenderdashProof from '../utils/verifyTenderdashProof';
4
+ import { getQuorumPublicKey } from '../utils/getQuorumPublicKey.js';
5
+ import bytesToHex from '../utils/bytesToHex.js';
6
+ import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
7
7
  export default async function totalCredits(grpcPool, network) {
8
8
  const getTotalCreditsInPlatformRequest = GetTotalCreditsInPlatformRequest.create({
9
9
  version: {
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,4 @@
1
+ export {};
1
2
  // import { IdentityWASM, NetworkWASM, PrivateKeyWASM, StateTransitionWASM } from 'pshenmic-dpp'
2
3
  // import { base64 } from '@scure/base'
3
4
  // import { IdentitiesController } from '../identities'
@@ -1,2 +1,2 @@
1
- import { AbstractSigner } from './AbstractSigner';
1
+ import { AbstractSigner } from './AbstractSigner.js';
2
2
  export default function setSigner(signer: AbstractSigner): void;
@@ -1,3 +1,3 @@
1
1
  import { StateTransitionWASM } from 'pshenmic-dpp';
2
- import GRPCConnectionPool from '../grpcConnectionPool';
2
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
3
3
  export default function broadcast(grpcPool: GRPCConnectionPool, stateTransition: StateTransitionWASM): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { BroadcastStateTransitionRequest } from '../../proto/generated/platform';
1
+ import { BroadcastStateTransitionRequest } from '../../proto/generated/platform.js';
2
2
  export default async function broadcast(grpcPool, stateTransition) {
3
3
  if (stateTransition.signature.length === 0) {
4
4
  throw new Error('State Transition is not signed');
@@ -1,5 +1,5 @@
1
1
  import { StateTransitionWASM } from 'pshenmic-dpp';
2
- import GRPCConnectionPool from '../grpcConnectionPool';
2
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
3
3
  /**
4
4
  * Collection of methods to perform state transitions (transactions) such like broadcast, wait for state transition result
5
5
  *
@@ -1,5 +1,5 @@
1
- import waitForStateTransitionResult from './waitForStateTransitionResult';
2
- import broadcast from './broadcast';
1
+ import waitForStateTransitionResult from './waitForStateTransitionResult.js';
2
+ import broadcast from './broadcast.js';
3
3
  /**
4
4
  * Collection of methods to perform state transitions (transactions) such like broadcast, wait for state transition result
5
5
  *
@@ -1,3 +1,3 @@
1
1
  import { StateTransitionWASM } from 'pshenmic-dpp';
2
- import GRPCConnectionPool from '../grpcConnectionPool';
2
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
3
3
  export default function waitForStateTransitionResult(grpcPool: GRPCConnectionPool, stateTransition: StateTransitionWASM): Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import { IdentifierWASM, StateTransitionWASM, TokenBaseTransitionWASM } from 'pshenmic-dpp';
2
- import { TokenTransitionParams, TokenTransitionType } from '../types';
2
+ import { TokenTransitionParams, TokenTransitionType } from '../types.js';
3
3
  export default function createStateTransition(base: TokenBaseTransitionWASM, ownerId: IdentifierWASM, type: TokenTransitionType, params: TokenTransitionParams): StateTransitionWASM;
@@ -1,5 +1,5 @@
1
- import GRPCConnectionPool from '../grpcConnectionPool';
2
- import { IdentifierLike } from '../types';
1
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
2
+ import { IdentifierLike } from '../types.js';
3
3
  import { IdentifierWASM } from 'pshenmic-dpp';
4
4
  export interface IdentitiesTokenBalances {
5
5
  identityId: IdentifierWASM;
@@ -1,8 +1,8 @@
1
- import { GetIdentitiesTokenBalancesRequest } from '../../proto/generated/platform';
1
+ import { GetIdentitiesTokenBalancesRequest } from '../../proto/generated/platform.js';
2
2
  import { IdentifierWASM, PlatformVersionWASM, verifyTokenBalancesForIdentitiesProof } from 'pshenmic-dpp';
3
- import { getQuorumPublicKey } from '../utils/getQuorumPublicKey';
4
- import bytesToHex from '../utils/bytesToHex';
5
- import verifyTenderdashProof from '../utils/verifyTenderdashProof';
3
+ import { getQuorumPublicKey } from '../utils/getQuorumPublicKey.js';
4
+ import bytesToHex from '../utils/bytesToHex.js';
5
+ import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
6
6
  export default async function getIdentitiesTokenBalances(grpcPool, identifiers, tokenIdentifier) {
7
7
  const ids = identifiers.map(identifier => new IdentifierWASM(identifier));
8
8
  const tokenId = new IdentifierWASM(tokenIdentifier);
@@ -1,5 +1,5 @@
1
- import GRPCConnectionPool from '../grpcConnectionPool';
2
- import { IdentifierLike } from '../types';
1
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
2
+ import { IdentifierLike } from '../types.js';
3
3
  import { IdentifierWASM } from 'pshenmic-dpp';
4
4
  export interface IdentityTokenBalances {
5
5
  tokenId: IdentifierWASM;
@@ -1,8 +1,8 @@
1
1
  import { IdentifierWASM, PlatformVersionWASM, verifyTokensBalancesForIdentityProof } from 'pshenmic-dpp';
2
- import { GetIdentityTokenBalancesRequest } from '../../proto/generated/platform';
3
- import { getQuorumPublicKey } from '../utils/getQuorumPublicKey';
4
- import bytesToHex from '../utils/bytesToHex';
5
- import verifyTenderdashProof from '../utils/verifyTenderdashProof';
2
+ import { GetIdentityTokenBalancesRequest } from '../../proto/generated/platform.js';
3
+ import { getQuorumPublicKey } from '../utils/getQuorumPublicKey.js';
4
+ import bytesToHex from '../utils/bytesToHex.js';
5
+ import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
6
6
  export default async function getIdentityTokensBalances(grpcPool, identifier, tokenIdentifiers) {
7
7
  const id = new IdentifierWASM(identifier);
8
8
  const tokenIds = tokenIdentifiers.map(tokenIdentifier => new IdentifierWASM(tokenIdentifier));
@@ -1,5 +1,5 @@
1
- import GRPCConnectionPool from '../grpcConnectionPool';
2
- import { IdentifierLike } from '../types';
1
+ import GRPCConnectionPool from '../grpcConnectionPool.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,8 @@
1
- import { GetTokenContractInfoRequest } from '../../proto/generated/platform';
1
+ import { GetTokenContractInfoRequest } from '../../proto/generated/platform.js';
2
2
  import { IdentifierWASM, PlatformVersionWASM, verifyTokenContractInfoProof } from 'pshenmic-dpp';
3
- import { getQuorumPublicKey } from '../utils/getQuorumPublicKey';
4
- import bytesToHex from '../utils/bytesToHex';
5
- import verifyTenderdashProof from '../utils/verifyTenderdashProof';
3
+ import { getQuorumPublicKey } from '../utils/getQuorumPublicKey.js';
4
+ import bytesToHex from '../utils/bytesToHex.js';
5
+ import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
6
6
  export default async function getTokenContractInfo(grpcPool, tokenIdentifier) {
7
7
  const tokenId = new IdentifierWASM(tokenIdentifier);
8
8
  const getTokenContractInfoRequest = GetTokenContractInfoRequest.create({
@@ -1,3 +1,3 @@
1
- import GRPCConnectionPool from '../grpcConnectionPool';
2
- import { IdentifierLike, TokenDirectPurchasePrices } from '../types';
1
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
2
+ import { IdentifierLike, TokenDirectPurchasePrices } from '../types.js';
3
3
  export default function getTokenDirectPurchasePrices(grpcPool: GRPCConnectionPool, tokenIdentifiers: IdentifierLike[]): Promise<TokenDirectPurchasePrices[]>;
@@ -1,8 +1,8 @@
1
1
  import { IdentifierWASM, PlatformVersionWASM, verifyTokenDirectPurchasePrices } from 'pshenmic-dpp';
2
- import { getQuorumPublicKey } from '../utils/getQuorumPublicKey';
3
- import verifyTenderdashProof from '../utils/verifyTenderdashProof';
4
- import bytesToHex from '../utils/bytesToHex';
5
- import { GetTokenDirectPurchasePricesRequest } from '../../proto/generated/platform';
2
+ import { getQuorumPublicKey } from '../utils/getQuorumPublicKey.js';
3
+ import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
4
+ import bytesToHex from '../utils/bytesToHex.js';
5
+ import { GetTokenDirectPurchasePricesRequest } from '../../proto/generated/platform.js';
6
6
  export default async function getTokenDirectPurchasePrices(grpcPool, tokenIdentifiers) {
7
7
  const tokenIds = tokenIdentifiers.map(tokenId => new IdentifierWASM(tokenId).bytes());
8
8
  const request = GetTokenDirectPurchasePricesRequest.create({
@@ -1,3 +1,3 @@
1
- import GRPCConnectionPool from '../grpcConnectionPool';
2
- import { IdentifierLike, TokenTotalSupply } from '../types';
1
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
2
+ import { IdentifierLike, TokenTotalSupply } from '../types.js';
3
3
  export default function getTokenTotalSupply(grpcPool: GRPCConnectionPool, tokenIdentifier: IdentifierLike): Promise<TokenTotalSupply>;
@@ -1,8 +1,8 @@
1
- import { GetTokenTotalSupplyRequest } from '../../proto/generated/platform';
1
+ import { GetTokenTotalSupplyRequest } from '../../proto/generated/platform.js';
2
2
  import { IdentifierWASM, PlatformVersionWASM, verifyTokenTotalSupplyProof } from 'pshenmic-dpp';
3
- import { getQuorumPublicKey } from '../utils/getQuorumPublicKey';
4
- import bytesToHex from '../utils/bytesToHex';
5
- import verifyTenderdashProof from '../utils/verifyTenderdashProof';
3
+ import { getQuorumPublicKey } from '../utils/getQuorumPublicKey.js';
4
+ import bytesToHex from '../utils/bytesToHex.js';
5
+ import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
6
6
  export default async function getTokenTotalSupply(grpcPool, tokenIdentifier) {
7
7
  const tokenId = new IdentifierWASM(tokenIdentifier);
8
8
  const getTokenTotalSupplyRequest = GetTokenTotalSupplyRequest.create({
@@ -1,8 +1,8 @@
1
- import GRPCConnectionPool from '../grpcConnectionPool';
2
- import { IdentifierLike, TokenDirectPurchasePrices, TokenTotalSupply, TokenTransitionParams, TokenTransitionType } from '../types';
3
- import { IdentitiesTokenBalances } from './getIdentitiesTokenBalances';
4
- import { IdentityTokenBalances } from './getIdentityTokensBalances';
5
- import { TokenContractInfo } from './getTokenContractInfo';
1
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
2
+ import { IdentifierLike, TokenDirectPurchasePrices, TokenTotalSupply, TokenTransitionParams, TokenTransitionType } from '../types.js';
3
+ import { IdentitiesTokenBalances } from './getIdentitiesTokenBalances.js';
4
+ import { IdentityTokenBalances } from './getIdentityTokensBalances.js';
5
+ import { TokenContractInfo } from './getTokenContractInfo.js';
6
6
  import { StateTransitionWASM, TokenBaseTransitionWASM } from 'pshenmic-dpp';
7
7
  /**
8
8
  * Tokens controller for requesting information about tokens and tokens holders
@@ -1,11 +1,11 @@
1
- import getIdentitiesTokenBalances from './getIdentitiesTokenBalances';
2
- import getIdentityTokensBalances from './getIdentityTokensBalances';
3
- import getTokenContractInfo from './getTokenContractInfo';
4
- import getTokenTotalSupply from './getTokenTotalSupply';
5
- import createStateTransition from './createStateTransition';
1
+ import getIdentitiesTokenBalances from './getIdentitiesTokenBalances.js';
2
+ import getIdentityTokensBalances from './getIdentityTokensBalances.js';
3
+ import getTokenContractInfo from './getTokenContractInfo.js';
4
+ import getTokenTotalSupply from './getTokenTotalSupply.js';
5
+ import createStateTransition from './createStateTransition.js';
6
6
  import { IdentifierWASM, TokenBaseTransitionWASM, TokenPricingScheduleWASM } from 'pshenmic-dpp';
7
- import getIdentityContractNonce from '../identities/getIdentityContractNonce';
8
- import getTokenDirectPurchasePrices from './getTokenDirectPurchasePrices';
7
+ import getIdentityContractNonce from '../identities/getIdentityContractNonce.js';
8
+ import getTokenDirectPurchasePrices from './getTokenDirectPurchasePrices.js';
9
9
  /**
10
10
  * Tokens controller for requesting information about tokens and tokens holders
11
11
  *
package/src/types.d.ts CHANGED
@@ -2,9 +2,9 @@ import { DocumentWASM, GasFeesPaidByWASM, IdentifierWASM, KeyType, Purpose, Secu
2
2
  export { IdentifierWASM, IdentityWASM, DocumentWASM, DataContractWASM, StateTransitionWASM, IdentityPublicKeyWASM } from 'pshenmic-dpp';
3
3
  export type IdentifierLike = IdentifierWASM | string | Uint8Array;
4
4
  export type Network = 'mainnet' | 'testnet';
5
- export { DashPlatformSDK } from './DashPlatformSDK';
5
+ export { DashPlatformSDK } from './DashPlatformSDK.js';
6
6
  export type MasternodeList = Record<string, MasternodeInfo>;
7
- export { AbstractSigner } from './signer/AbstractSigner';
7
+ export { AbstractSigner } from './signer/AbstractSigner.js';
8
8
  export interface DocumentTransitionParams {
9
9
  identityContractNonce: bigint;
10
10
  amount?: bigint;
package/src/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { IdentifierWASM, IdentityWASM, DocumentWASM, DataContractWASM, StateTransitionWASM, IdentityPublicKeyWASM } from 'pshenmic-dpp';
2
- export { DashPlatformSDK } from './DashPlatformSDK';
2
+ export { DashPlatformSDK } from './DashPlatformSDK.js';
3
3
  export var ContestedStateResultType;
4
4
  (function (ContestedStateResultType) {
5
5
  ContestedStateResultType[ContestedStateResultType["DOCUMENTS"] = 0] = "DOCUMENTS";
@@ -1,4 +1,4 @@
1
- import sha256 from './sha256';
1
+ import sha256 from './sha256.js';
2
2
  export async function calculateMsgHash(chainId, height, round, type, blockId, stateId) {
3
3
  const fixedSize = 4 + 8 + 8 + 32 + 32;
4
4
  const chainIdBytes = new TextEncoder().encode(chainId);
@@ -1,2 +1,2 @@
1
- import { CanonicalVote } from '../../proto/generated/platform';
1
+ import { CanonicalVote } from '../../proto/generated/platform.js';
2
2
  export declare function calculateSignHash(commit: CanonicalVote, chainId: string, quorumType: number, quorumHash: Uint8Array, height: bigint, round: number): Promise<Uint8Array>;
@@ -1,6 +1,6 @@
1
- import { calculateMsgHash } from './calculateMsgHash';
2
- import signRequestId from './signRequestId';
3
- import signHash from './signHash';
1
+ import { calculateMsgHash } from './calculateMsgHash.js';
2
+ import signRequestId from './signRequestId.js';
3
+ import signHash from './signHash.js';
4
4
  export async function calculateSignHash(commit, chainId, quorumType, quorumHash, height, round) {
5
5
  const requestId = await signRequestId('dpbvote', height, round);
6
6
  const signBytesHash = await calculateMsgHash(chainId, height, round, commit.type, commit.blockId, commit.stateId);
@@ -1,2 +1,2 @@
1
- import { StateId } from '../../proto/generated/platform';
1
+ import { StateId } from '../../proto/generated/platform.js';
2
2
  export declare function calculateStateIdHash(stateId: StateId): Promise<Uint8Array>;
@@ -1,5 +1,5 @@
1
- import { StateId } from '../../proto/generated/platform';
2
- import sha256 from './sha256';
1
+ import { StateId } from '../../proto/generated/platform.js';
2
+ import sha256 from './sha256.js';
3
3
  import { BinaryWriter } from '@bufbuild/protobuf/wire';
4
4
  export async function calculateStateIdHash(stateId) {
5
5
  const writer = new BinaryWriter();
@@ -1,7 +1,7 @@
1
1
  import { IdentifierWASM } from 'pshenmic-dpp';
2
- import sha256 from './sha256';
3
- import bytesToHex from './bytesToHex';
4
- import hexToBytes from './hexToBytes';
2
+ import sha256 from './sha256.js';
3
+ import bytesToHex from './bytesToHex.js';
4
+ import hexToBytes from './hexToBytes.js';
5
5
  export async function createVoterIdentityId(proTxHash, publicKeyHash) {
6
6
  const proTxHashBytes = hexToBytes(proTxHash);
7
7
  const publicKeyHashBytes = hexToBytes(publicKeyHash);
@@ -1,2 +1,2 @@
1
- import { MasternodeList, Network } from '../types';
1
+ import { MasternodeList, Network } from '../types.js';
2
2
  export default function getDAPINodeList(network: Network): Promise<MasternodeList>;
@@ -1,7 +1,7 @@
1
- import convertToHomographSafeChars from './convertToHomographSafeChars';
1
+ import convertToHomographSafeChars from './convertToHomographSafeChars.js';
2
2
  import { base58 } from '@scure/base';
3
- import hexToBytes from './hexToBytes';
4
- import bytesToHex from './bytesToHex';
3
+ import hexToBytes from './hexToBytes.js';
4
+ import bytesToHex from './bytesToHex.js';
5
5
  /**
6
6
  * Collection of conversion functions
7
7
  *
@@ -1,5 +1,5 @@
1
- import bytesToHex from './bytesToHex';
2
- import { typedArrayToBuffer } from './bytesToTypedArray';
1
+ import bytesToHex from './bytesToHex.js';
2
+ import { typedArrayToBuffer } from './bytesToTypedArray.js';
3
3
  export default async function sha256(input) {
4
4
  if (typeof input === 'string') {
5
5
  const encoder = new TextEncoder();
@@ -1,4 +1,4 @@
1
- import sha256 from './sha256';
1
+ import sha256 from './sha256.js';
2
2
  export default async function signHash(quorumType, quorumHash, requestId, signBytesHash) {
3
3
  // Calculate total length: 1 byte for quorumType + 3 arrays of 32 bytes each
4
4
  const totalLength = 1 + quorumHash.length + requestId.length + signBytesHash.length;
@@ -1,4 +1,4 @@
1
- import sha256 from './sha256';
1
+ import sha256 from './sha256.js';
2
2
  export default async function signRequestId(prefix, height, round) {
3
3
  const prefixBytes = new TextEncoder().encode(prefix);
4
4
  // len + i64 + i32 (prefix length + 8 bytes for height + 4 bytes for round)
@@ -1,2 +1,2 @@
1
- import { Proof, ResponseMetadata } from '../../proto/generated/platform';
1
+ import { Proof, ResponseMetadata } from '../../proto/generated/platform.js';
2
2
  export default function verifyTenderdashProof(proof: Proof, metadata: ResponseMetadata, rootHash: Uint8Array, quorumPublicKey: string): Promise<boolean>;
@@ -1,8 +1,8 @@
1
- import { CanonicalVote, SignedMsgType, StateId } from '../../proto/generated/platform';
2
- import { calculateSignHash } from './calculateSignHash';
3
- import { calculateStateIdHash } from './calculateStateIdHash';
1
+ import { CanonicalVote, SignedMsgType, StateId } from '../../proto/generated/platform.js';
2
+ import { calculateSignHash } from './calculateSignHash.js';
3
+ import { calculateStateIdHash } from './calculateStateIdHash.js';
4
4
  import { verifySignatureDigest } from 'pshenmic-dpp';
5
- import hexToBytes from './hexToBytes';
5
+ import hexToBytes from './hexToBytes.js';
6
6
  export default async function verifyTenderdashProof(proof, metadata, rootHash, quorumPublicKey) {
7
7
  const stateId = StateId.create({
8
8
  appVersion: String(metadata.protocolVersion),
@@ -1,4 +1,4 @@
1
- import { IdentifierLike, ResourceVoteChoice } from '../types';
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,6 @@
1
- import createVote from './createVote';
1
+ import createVote from './createVote.js';
2
2
  import { IdentifierWASM, MasternodeVoteTransitionWASM, ResourceVoteChoiceWASM } from 'pshenmic-dpp';
3
- import { createVoterIdentityId } from '../utils/createVoterIdentityId';
3
+ import { createVoterIdentityId } from '../utils/createVoterIdentityId.js';
4
4
  /**
5
5
  * Voting controller for performing masternode votes
6
6
  *
@@ -1,7 +1,6 @@
1
1
  import { DataContractWASM, PlatformVersionWASM, PrivateKeyWASM } from 'pshenmic-dpp';
2
- import stringToIndexValueBytes from '../../src/utils/stringToIndexValueBytes';
3
- import { DashPlatformSDK } from '../../src/DashPlatformSDK';
4
- import { ContestedStateResultType } from '../../src/types';
2
+ import { DashPlatformSDK, ContestedStateResultType } from '../../src/types.js';
3
+ import stringToIndexValueBytes from '../../src/utils/stringToIndexValueBytes.js';
5
4
  let sdk;
6
5
  let contract;
7
6
  describe('Contested Resources', () => {