dash 3.21.1 → 3.21.6

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 (45) hide show
  1. package/.mocharc.yml +1 -0
  2. package/CHANGELOG.md +9 -0
  3. package/build/src/SDK/Client/Client.js +2 -2
  4. package/build/src/SDK/Client/Platform/createAssetLockTransaction.js +1 -1
  5. package/build/src/SDK/Client/Platform/methods/names/register.js +1 -1
  6. package/build/src/SDK/Client/Platform/methods/names/register.js.map +1 -1
  7. package/build/src/test/mocks/createAndAttachTransportMocksToClient.js +5 -2
  8. package/build/src/test/mocks/createAndAttachTransportMocksToClient.js.map +1 -1
  9. package/build/src/utils/createFakeIntantLock.js +2 -0
  10. package/build/src/utils/createFakeIntantLock.js.map +1 -1
  11. package/dist/src/SDK/Client/Platform/createAssetLockTransaction.d.ts +1 -1
  12. package/dist/src/SDK/SDK.d.ts +167 -4
  13. package/docs/README.md +6 -6
  14. package/docs/_sidebar.md +8 -8
  15. package/docs/examples/pay-to-another-address.md +1 -1
  16. package/docs/examples/publishing-a-new-contract.md +1 -1
  17. package/docs/examples/receive-money-and-check-balance.md +2 -2
  18. package/docs/getting-started/core-concepts.md +2 -2
  19. package/docs/getting-started/dash-platform-applications.md +1 -1
  20. package/docs/getting-started/quickstart.md +1 -1
  21. package/docs/platform/contracts/about-contracts.md +1 -1
  22. package/docs/platform/contracts/broadcast.md +2 -2
  23. package/docs/platform/contracts/create.md +2 -2
  24. package/docs/platform/documents/broadcast.md +4 -4
  25. package/docs/platform/documents/create.md +2 -2
  26. package/docs/platform/identities/about-identity.md +1 -1
  27. package/docs/platform/identities/register.md +1 -1
  28. package/docs/platform/identities/topUp.md +1 -1
  29. package/docs/platform/names/register.md +1 -1
  30. package/karma.conf.js +18 -8
  31. package/package.json +47 -27
  32. package/src/SDK/Client/Client.ts +2 -2
  33. package/src/SDK/Client/Platform/createAssetLockTransaction.ts +1 -1
  34. package/src/SDK/Client/Platform/methods/names/register.ts +1 -1
  35. package/src/test/mocks/createAndAttachTransportMocksToClient.ts +25 -21
  36. package/src/utils/createFakeIntantLock.ts +2 -0
  37. package/webpack.base.config.js +26 -9
  38. package/webpack.config.js +4 -13
  39. package/.editorconfig +0 -2
  40. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
  41. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -27
  42. package/.github/PULL_REQUEST_TEMPLATE.md +0 -32
  43. package/.github/workflows/.env +0 -5
  44. package/.github/workflows/test_and_release.yml +0 -170
  45. package/dist/dash.min.js +0 -56
package/.mocharc.yml CHANGED
@@ -1,3 +1,4 @@
1
1
  exit: true
2
+ timeout: 5000
2
3
  file:
3
4
  - ./src/test/bootstrap.js
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # [3.21.2](https://github.com/dashevo/DashJS/compare/v3.21.1...v3.21.2) (2021-10-26)
2
+
3
+
4
+ ### Chores
5
+
6
+ * update DPNS and DashPay contract ids ([#292](https://github.com/dashevo/DashJS/issues/292))
7
+
8
+
9
+
1
10
  # [3.21.1](https://github.com/dashevo/DashJS/compare/v3.21.0...v3.21.1) (2021-10-26)
2
11
 
3
12
 
@@ -120,10 +120,10 @@ var Client = /** @class */ (function (_super) {
120
120
  _this.defaultAccountIndex = ((_a = _this.options.wallet) === null || _a === void 0 ? void 0 : _a.defaultAccountIndex) || 0;
121
121
  _this.apps = new ClientApps_1.ClientApps(Object.assign({
122
122
  dpns: {
123
- contractId: 'EBnvxB5RSW8NbBbXdRS3zPqFEaZnjCZ8WeurjvLTaru7'
123
+ contractId: 'Bw9PUC3aSEGQ4j5qrvpNLrRNFPVMiUHZLr1atgfYJcmf'
124
124
  },
125
125
  dashpay: {
126
- contractId: 'GAvZdha4t3mCQyvCVvv7LMYw3CXN4X5hvFZ4S6qCAdod',
126
+ contractId: '2Vuou3EfbrtunwCZvQp1XS5PXZ5CgC1pGBz4VPT4ojmy',
127
127
  },
128
128
  }, _this.options.apps));
129
129
  _this.platform = new Platform_1.Platform({
@@ -44,7 +44,7 @@ var ASSET_LOCK_OUTPUT_INDEX = 0;
44
44
  * Creates a funding transaction for the platform identity and returns one-time key to sign the state transition
45
45
  * @param {Platform} platform
46
46
  * @param {number} fundingAmount - amount of dash to fund the identity's credits
47
- * @return {{transaction: Transaction, privateKey: PrivateKey}} - transaction and one time private key
47
+ * @return {Promise<{transaction: Transaction, privateKey: PrivateKey}>} - transaction and one time private key
48
48
  * that can be used to sign registration/top-up state transition
49
49
  */
50
50
  function createAssetLockTransaction(platform, fundingAmount) {
@@ -41,7 +41,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
42
  exports.register = void 0;
43
43
  var Identifier_1 = __importDefault(require("@dashevo/dpp/lib/Identifier"));
44
- var hash = require('@dashevo/dpp/lib/util/hash');
44
+ var hash = require('@dashevo/dpp/lib/util/hash').hash;
45
45
  var crypto = require('crypto');
46
46
  /**
47
47
  * Register names to the platform
@@ -1 +1 @@
1
- {"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../../../src/SDK/Client/Platform/methods/names/register.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2EAAqD;AAErD,IAAM,IAAI,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AACnD,IAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEjC;;;;;;;;;;;GAWG;AACH,SAAsB,QAAQ,CACC,IAAY,EACZ,OAGC,EACD,QAGC;;;;;wBAE9B,qBAAM,IAAI,CAAC,UAAU,EAAE,EAAA;;oBAAvB,SAAuB,CAAC;oBAExB,IAAI,OAAO,CAAC,oBAAoB,EAAE;wBAC5B,OAAO,CAAC,oBAAoB,GAAG,oBAAU,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;qBAChF;oBAED,IAAI,OAAO,CAAC,mBAAmB,EAAE;wBA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ACR;4BACI,KAAK,OAAA;4BACL,eAAe,iBAAA;4BACf,0BAA0B,4BAAA;4BAC1B,YAAY,cAAA;4BACZ,OAAO,SAAA;4BACP,cAAc,EAAE;gCACZ,eAAe,EAAE,CAAC,mBAAmB;6BACxC;yBACJ,CACJ,EAAA;;oBAbK,cAAc,GAAG,SAatB;oBAED,6CAA6C;oBAC7C,qBAAM,IAAI,CAAC,SAAS,CAAC,SAAS,CAC1B;4BACI,MAAM,EAAE,CAAC,cAAc,CAAC;yBAC3B,EACD,QAAQ,CACX,EAAA;;oBAND,6CAA6C;oBAC7C,SAKC,CAAC;oBAEF,sBAAO,cAAc,EAAC;;;;CACzB;AA3FD,4BA2FC;AAED,kBAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../../../src/SDK/Client/Platform/methods/names/register.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2EAAqD;AAE7C,IAAA,IAAI,GAAK,OAAO,CAAC,4BAA4B,CAAC,KAA1C,CAA2C;AACvD,IAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEjC;;;;;;;;;;;GAWG;AACH,SAAsB,QAAQ,CACC,IAAY,EACZ,OAGC,EACD,QAGC;;;;;wBAE9B,qBAAM,IAAI,CAAC,UAAU,EAAE,EAAA;;oBAAvB,SAAuB,CAAC;oBAExB,IAAI,OAAO,CAAC,oBAAoB,EAAE;wBAC5B,OAAO,CAAC,oBAAoB,GAAG,oBAAU,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;qBAChF;oBAED,IAAI,OAAO,CAAC,mBAAmB,EAAE;wBAC7B,OAAO,CAAC,mBAAmB,GAAG,oBAAU,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;qBAC9E;oBAEK,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;oBAE7B,0B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ACJ,EAAA;;oBAbK,cAAc,GAAG,SAatB;oBAED,6CAA6C;oBAC7C,qBAAM,IAAI,CAAC,SAAS,CAAC,SAAS,CAC1B;4BACI,MAAM,EAAE,CAAC,cAAc,CAAC;yBAC3B,EACD,QAAQ,CACX,EAAA;;oBAND,6CAA6C;oBAC7C,SAKC,CAAC;oBAEF,sBAAO,cAAc,EAAC;;;;CACzB;AA3FD,4BA2FC;AAED,kBAAe,QAAQ,CAAC"}
@@ -58,10 +58,13 @@ function makeTxStreamEmitISLocksForTransactions(transportMock, txStreamMock) {
58
58
  transportMock.sendTransaction.callsFake(function (txString) {
59
59
  var transaction = new dashcore_lib_1.Transaction(txString);
60
60
  var isLock = createFakeIntantLock_1.createFakeInstantLock(transaction.hash);
61
- // Emit IS lock for the transaction
62
- txStreamMock.emit(TxStreamMock.EVENTS.data, new TxStreamDataResponseMock({ instantSendLockMessages: [isLock.toBuffer()] }));
61
+ setImmediate(function () {
62
+ // Emit IS lock for the transaction
63
+ txStreamMock.emit(TxStreamMock.EVENTS.data, new TxStreamDataResponseMock({ instantSendLockMessages: [isLock.toBuffer()] }));
64
+ });
63
65
  // Emit the same transaction back to the client so it will know about the change transaction
64
66
  txStreamMock.emit(TxStreamMock.EVENTS.data, new TxStreamDataResponseMock({ rawTransactions: [transaction.toBuffer()] }));
67
+ return transaction.hash;
65
68
  });
66
69
  }
67
70
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"createAndAttachTransportMocksToClient.js","sourceRoot":"","sources":["../../../../src/test/mocks/createAndAttachTransportMocksToClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAoD;AACpD,+GAAyF;AACzF,gFAA0D;AAE1D,yEAAyE;AACzE,sGAAgF;AAChF,+DAA8D;AAE9D,yCAAwC;AACxC,IAAM,mBAAmB,GAAG,OAAO,CAAC,2EAA2E,CAAC,CAAC;AAEjH,aAAa;AACb,IAAM,YAAY,GAAG,OAAO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oB,CAAC;oBAErB,kCAAkC;oBAClC,aAAa,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;oBAC7D,sCAAsC,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;oBACpE,kCAAkC,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;oBAE3D,sBAAO,EAAE,YAAY,cAAA,EAAE,aAAa,eAAA,EAAE,cAAc,gBAAA,EAAE,EAAC;;;;CAC1D;AAzBD,sFAyBC"}
1
+ {"version":3,"file":"createAndAttachTransportMocksToClient.js","sourceRoot":"","sources":["../../../../src/test/mocks/createAndAttachTransportMocksToClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAoD;AACpD,+GAAyF;AACzF,gFAA0D;AAE1D,yEAAyE;AACzE,sGAAgF;AAChF,+DAA8D;AAE9D,yCAAwC;AACxC,IAAM,mBAAmB,GAAG,OAAO,CAAC,2EAA2E,CAAC,CAAC;AAEjH,aAAa;AACb,IAAM,YAAY,GAAG,OAAO,CAAC,iDAAiD,CAAC,CAAC;AAChF,aAAa;AACb,IAAM,wBAAwB,GAAG,OAAO,CAAC,6DAA6D,CAAC,CAAC;AACxG,aAAa;AACb,IAAM,aAAa,GAAG,OAAO,CAAC,kDAAkD,CAAC,CAAC;AAElF,SAAS,sCAAsC,CAAC,aAAa,EAAE,YAAY;IACzE,aAAa,CAAC,eAAe,CAAC,SAAS,CAAC,UAAC,QAAQ;QAC/C,IAAM,WAAW,GAAG,IAAI,0BAAW,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAM,MAAM,GAAG,4CAAqB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAEvD,YAAY,CAAC;YACX,mCAAmC;YACnC,YAAY,CAAC,IAAI,CACf,YAAY,CAAC,MAAM,CAAC,IAAI,EACxB,IAAI,wBAAwB,CAC1B,EAAE,uBAAuB,EAAE,CAAC,MAAM,CAAC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AQ,EAAE,EAAE,oCAA0B,EAAE,CAAC,CAAC,CAAC;qBACzK;;;;SACJ,CAAC,CAAC;AACP,CAAC;AAED,SAAsB,qCAAqC,CAAC,MAAM,EAAE,KAAK;;;;;;oBAC/D,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;oBAClC,aAAa,GAAG,IAAI,aAAa,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;oBACvD,cAAc,GAAG,2CAAoB,CAAC,KAAK,CAAC,CAAC;oBAEnD,sDAAsD;oBACtD,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,aAAa,CAAC;oBACxC,0CAA0C;oBAC1C,MAAM,CAAC,UAAU,GAAG,cAAc,CAAC;oBAG7B,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;oBAClD,2CAA2C;oBAC3C,qBAAM,WAAI,CAAC,CAAC,CAAC,EAAA;;oBADb,2CAA2C;oBAC3C,SAAa,CAAC;oBACd,+DAA+D;oBAC/D,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;oBAC3C,8BAA8B;oBAC9B,qBAAM,cAAc,EAAA;;oBADpB,8BAA8B;oBAC9B,SAAoB,CAAC;oBAErB,kCAAkC;oBAClC,aAAa,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;oBAC7D,sCAAsC,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;oBACpE,kCAAkC,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;oBAE3D,sBAAO,EAAE,YAAY,cAAA,EAAE,aAAa,eAAA,EAAE,cAAc,gBAAA,EAAE,EAAC;;;;CAC1D;AAzBD,sFAyBC"}
@@ -4,8 +4,10 @@ exports.createFakeInstantLock = void 0;
4
4
  var dashcore_lib_1 = require("@dashevo/dashcore-lib");
5
5
  function createFakeInstantLock(transactionHash) {
6
6
  return new dashcore_lib_1.InstantLock({
7
+ version: 1,
7
8
  txid: transactionHash,
8
9
  signature: Buffer.alloc(96).toString('hex'),
10
+ cyclehash: '0dc8d0df62b076a7757ab5ca07dde0f1e2bfaf83f94299fd9a77577e6cc7022e',
9
11
  inputs: [
10
12
  {
11
13
  outpointHash: '6e200d059fb567ba19e92f5c2dcd3dde522fd4e0a50af223752db16158dabb1d',
@@ -1 +1 @@
1
- {"version":3,"file":"createFakeIntantLock.js","sourceRoot":"","sources":["../../../src/utils/createFakeIntantLock.ts"],"names":[],"mappings":";;;AAAA,sDAAoD;AAEpD,SAAgB,qBAAqB,CAAC,eAAuB;IACzD,OAAO,IAAI,0BAAW,CAAC;QACnB,IAAI,EAAE,eAAe;QACrB,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC3C,MAAM,EAAE;YACJ;gBACI,YAAY,EAAE,kEAAkE;gBAChF,aAAa,EAAE,CAAC;aACnB;SACJ;KACJ,CAAC,CAAC;AACP,CAAC;AAXD,sDAWC"}
1
+ {"version":3,"file":"createFakeIntantLock.js","sourceRoot":"","sources":["../../../src/utils/createFakeIntantLock.ts"],"names":[],"mappings":";;;AAAA,sDAAoD;AAEpD,SAAgB,qBAAqB,CAAC,eAAuB;IACzD,OAAO,IAAI,0BAAW,CAAC;QACnB,OAAO,EAAE,CAAC;QACV,IAAI,EAAE,eAAe;QACrB,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC3C,SAAS,EAAE,kEAAkE;QAC7E,MAAM,EAAE;YACJ;gBACI,YAAY,EAAE,kEAAkE;gBAChF,aAAa,EAAE,CAAC;aACnB;SACJ;KACJ,CAAC,CAAC;AACP,CAAC;AAbD,sDAaC"}
@@ -4,7 +4,7 @@ import { Platform } from "./Platform";
4
4
  * Creates a funding transaction for the platform identity and returns one-time key to sign the state transition
5
5
  * @param {Platform} platform
6
6
  * @param {number} fundingAmount - amount of dash to fund the identity's credits
7
- * @return {{transaction: Transaction, privateKey: PrivateKey}} - transaction and one time private key
7
+ * @return {Promise<{transaction: Transaction, privateKey: PrivateKey}>} - transaction and one time private key
8
8
  * that can be used to sign registration/top-up state transition
9
9
  */
10
10
  export default function createAssetLockTransaction(platform: Platform, fundingAmount: any): Promise<{
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import { Client as _Client } from './Client';
2
3
  import { Platform as _Platform } from './Platform';
3
4
  import { Wallet as _Wallet, Account as _Account, KeyChain as _KeyChain } from '@dashevo/wallet-lib';
@@ -10,10 +11,172 @@ export declare namespace SDK {
10
11
  let Account: typeof _Account;
11
12
  let KeyChain: typeof _KeyChain;
12
13
  let WalletLib: {
13
- CONSTANTS: any;
14
- EVENTS: any;
15
- plugins: any;
16
- utils: any;
14
+ CONSTANTS: {
15
+ BIP45: string;
16
+ BIP44: string;
17
+ DUFFS_PER_DASH: number;
18
+ BIP44_ADDRESS_GAP: number;
19
+ SECURE_TRANSACTION_CONFIRMATIONS_NB: number;
20
+ BIP32__ROOT_PATH: string;
21
+ BIP44_LIVENET_ROOT_PATH: string;
22
+ BIP44_TESTNET_ROOT_PATH: string;
23
+ DIP9_LIVENET_ROOT_PATH: string;
24
+ DIP9_TESTNET_ROOT_PATH: string;
25
+ UTXO_SELECTION_MAX_SINGLE_UTXO_FACTOR: number;
26
+ UTXO_SELECTION_MIN_TX_AMOUNT_VS_UTXO_FACTOR: number;
27
+ UTXO_SELECTION_MAX_FEE_VS_TX_AMOUNT_FACTOR: number;
28
+ UTXO_SELECTION_MAX_FEE_VS_SINGLE_UTXO_FEE_FACTOR: number;
29
+ MAX_STANDARD_TX_SIZE: number;
30
+ MAX_P2SH_SIGOPS: number;
31
+ COINBASE_MATURITY: number;
32
+ UTXO_CHAINED_SPENDING_LIMIT_FOR_TX: number;
33
+ FEES: {
34
+ DUST_RELAY_TX_FEE: number;
35
+ ZERO: number;
36
+ ECONOMIC: number;
37
+ NORMAL: number;
38
+ PRIORITY: number;
39
+ INSTANT_FEE_PER_INPUTS: number;
40
+ };
41
+ UNCONFIRMED_TRANSACTION_STATUS_CODE: number;
42
+ WALLET_TYPES: {
43
+ ADDRESS: string;
44
+ PUBLICKEY: string;
45
+ PRIVATEKEY: string;
46
+ SINGLE_ADDRESS: string;
47
+ HDWALLET: string;
48
+ HDPUBLIC: string;
49
+ };
50
+ INJECTION_LISTS: {
51
+ SAFE_FUNCTIONS: string[];
52
+ UNSAFE_FUNCTIONS: string[];
53
+ UNSAFE_PROPERTIES: string[];
54
+ SAFE_PROPERTIES: string[];
55
+ };
56
+ TRANSACTION_HISTORY_TYPES: {
57
+ RECEIVED: string;
58
+ SENT: string;
59
+ ADDRESS_TRANSFER: string;
60
+ ACCOUNT_TRANSFER: string;
61
+ UNKNOWN: string;
62
+ };
63
+ STORAGE: {
64
+ autosaveIntervalTime: number;
65
+ };
66
+ TXIN_OUTPOINT_TXID_BYTES: number;
67
+ TXIN_OUTPOINT_INDEX_BYTES: number;
68
+ TXIN_SEQUENCE_BYTES: number;
69
+ TXOUT_DUFFS_VALUE_BYTES: number;
70
+ VERSION_BYTES: number;
71
+ N_LOCKTIME_BYTES: number;
72
+ BLOOM_FALSE_POSITIVE_RATE: number;
73
+ NULL_HASH: string;
74
+ };
75
+ EVENTS: {
76
+ PREFETCHED: string;
77
+ CREATED: string;
78
+ STARTED: string;
79
+ READY: string;
80
+ CONFIRMED_BALANCE_CHANGED: string;
81
+ UNCONFIRMED_BALANCE_CHANGED: string;
82
+ BLOCKHEIGHT_CHANGED: string;
83
+ BLOCK: string;
84
+ TRANSACTION: string;
85
+ BLOCKHEADER: string;
86
+ FETCHED_ADDRESS: string;
87
+ ERROR_UPDATE_ADDRESS: string;
88
+ FETCHED_TRANSACTION: string;
89
+ FETCHED_UNCONFIRMED_TRANSACTION: string;
90
+ FETCHED_CONFIRMED_TRANSACTION: string;
91
+ GENERATED_ADDRESS: string;
92
+ DISCOVERY_STARTED: string;
93
+ CONFIGURED: string;
94
+ INITIALIZED: string;
95
+ SAVE_STATE_FAILED: string;
96
+ SAVE_STATE_SUCCESS: string;
97
+ REHYDRATE_STATE_FAILED: string;
98
+ REHYDRATE_STATE_SUCCESS: string;
99
+ INSTANT_LOCK: string;
100
+ };
101
+ plugins: {
102
+ StandardPlugin: typeof import("@dashevo/wallet-libsrc/plugins/StandardPlugin");
103
+ Worker: typeof import("@dashevo/wallet-libsrc/plugins/Worker");
104
+ };
105
+ utils: {
106
+ extendTransactionsWithMetadata: (transactions: any, transactionsMetadata: any) => any[];
107
+ varIntSizeBytesFromLength: (length: any) => number;
108
+ calculateTransactionFees: typeof import("@dashevo/wallet-libsrc/utils/calculateTransactionFees");
109
+ categorizeTransactions: typeof import("@dashevo/wallet-libsrc/utils/categorizeTransactions");
110
+ mnemonicToHDPrivateKey: (mnemonic: any, network?: any, passphrase?: string) => any;
111
+ generateNewMnemonic: () => any;
112
+ seedToHDPrivateKey: (seed: any, network?: string) => any;
113
+ mnemonicToWalletId: (mnemonic: any) => string;
114
+ filterTransactions: typeof import("@dashevo/wallet-libsrc/utils/filterTransactions");
115
+ classifyAddresses: typeof import("@dashevo/wallet-libsrc/utils/classifyAddresses");
116
+ mnemonicToSeed: (mnemonic: any, password?: string) => any;
117
+ feeCalculation: (type?: string) => {
118
+ type: null;
119
+ value: null;
120
+ };
121
+ coinSelection: (utxosList: any, outputsList: any, deductFee?: boolean, feeCategory?: string, strategy?: (utxosList: any, outputsList: any, deductFee?: any, feeCategory?: any) => {
122
+ utxos: never[];
123
+ outputs: never[];
124
+ feeCategory: any;
125
+ estimatedFee: number;
126
+ utxosValue: number;
127
+ }) => {
128
+ utxos: never[];
129
+ outputs: never[];
130
+ feeCategory: any;
131
+ estimatedFee: number;
132
+ utxosValue: number;
133
+ };
134
+ doubleSha256: (data: any) => Buffer;
135
+ dashToDuffs: typeof import("@dashevo/wallet-libsrc/utils/dashToDuffs");
136
+ duffsToDash: typeof import("@dashevo/wallet-libsrc/utils/duffsToDash");
137
+ fundWallet: typeof import("@dashevo/wallet-libsrc/utils/fundWallet");
138
+ getBytesOf: typeof import("@dashevo/wallet-libsrc/utils/getBytesOf");
139
+ hasMethod: typeof import("@dashevo/wallet-libsrc/utils/hasMethod");
140
+ hasProp: typeof import("@dashevo/wallet-libsrc/utils/hasProp");
141
+ sha256: (data: any) => Buffer;
142
+ hash: (alg: any, data: any) => Buffer;
143
+ is: {
144
+ arr: (arr: any) => boolean;
145
+ num: (num: any) => boolean;
146
+ float: (float: any) => boolean;
147
+ int: (int: any) => boolean;
148
+ hex: (h: any) => boolean;
149
+ string: (str: any) => boolean;
150
+ bool: (b: any) => boolean;
151
+ obj: (obj: any) => boolean;
152
+ fn: (fn: any) => boolean;
153
+ type(val: any, type: any): boolean;
154
+ def: (val: any) => boolean;
155
+ undef: (val: any) => boolean;
156
+ null: (val: any) => boolean;
157
+ exist: (val: any) => boolean;
158
+ undefOrNull: (val: any) => boolean;
159
+ promise: (fn: any) => boolean;
160
+ JSON(val: any): boolean;
161
+ stringified(val: any): boolean;
162
+ mnemonic: (mnemonic: any) => boolean;
163
+ network: (network: any) => boolean;
164
+ publicKey: (pKey: any) => any;
165
+ privateKey: (pKey: any) => any;
166
+ HDPrivateKey: (hdKey: any) => any;
167
+ HDPublicKey: (hdKey: any) => any;
168
+ seed: (seed: any) => boolean;
169
+ address: (addr: any) => boolean;
170
+ addressObj: (addrObj: any) => boolean;
171
+ transactionObj: (tx: any) => boolean;
172
+ dashcoreTransaction: (tx: any) => boolean;
173
+ feeRate: (feeRate: any) => boolean;
174
+ txid: (txid: any) => boolean;
175
+ utxo: (utxo: any) => boolean;
176
+ output: (output: any) => boolean;
177
+ rawtx: (rawtx: any) => boolean;
178
+ };
179
+ };
17
180
  };
18
181
  }
19
182
  export { SDK as default };
package/docs/README.md CHANGED
@@ -65,12 +65,12 @@ client.getWalletAccount().then(async (account) => {
65
65
 
66
66
  ### Use-cases examples
67
67
 
68
- - [Generate a mnemonic](/examples/generate-a-new-mnemonic.md)
69
- - [Receive money and display balance](/examples/receive-money-and-check-balance.md)
70
- - [Pay to another address](/examples/pay-to-another-address.md)
71
- - [Use a local evonet](/examples/use-local-evonet.md)
72
- - [Publishing a new contract](/examples/publishing-a-new-contract.md)
73
- - [Use another BIP44 account](/examples/use-different-account.md)
68
+ - [Generate a mnemonic](examples/generate-a-new-mnemonic.md)
69
+ - [Receive money and display balance](examples/receive-money-and-check-balance.md)
70
+ - [Pay to another address](examples/pay-to-another-address.md)
71
+ - [Use a local evonet](examples/use-local-evonet.md)
72
+ - [Publishing a new contract](examples/publishing-a-new-contract.md)
73
+ - [Use another BIP44 account](examples/use-different-account.md)
74
74
 
75
75
  ### Tutorial
76
76
 
package/docs/_sidebar.md CHANGED
@@ -7,14 +7,14 @@
7
7
  - [With TypeScript](getting-started/with-typescript.md)
8
8
 
9
9
  - Examples
10
- - [Generate a mnemonic](/examples/generate-a-new-mnemonic.md)
11
- - [Receive money and display balance](/examples/receive-money-and-check-balance.md)
12
- - [Pay to another address](/examples/pay-to-another-address.md)
13
- - [Use a local evonet](/examples/use-local-evonet.md)
14
- - [Fetch an identity from its name](/examples/fetch-an-identity-from-its-name.md)
15
- - [Publishing a new contract](/examples/publishing-a-new-contract.md)
16
- - [Use another BIP44 account](/examples/use-different-account.md)
17
- - [Sign and verify messages](/examples/sign-and-verify-messages.md)
10
+ - [Generate a mnemonic](examples/generate-a-new-mnemonic.md)
11
+ - [Receive money and display balance](examples/receive-money-and-check-balance.md)
12
+ - [Pay to another address](examples/pay-to-another-address.md)
13
+ - [Use a local evonet](examples/use-local-evonet.md)
14
+ - [Fetch an identity from its name](examples/fetch-an-identity-from-its-name.md)
15
+ - [Publishing a new contract](examples/publishing-a-new-contract.md)
16
+ - [Use another BIP44 account](examples/use-different-account.md)
17
+ - [Sign and verify messages](examples/sign-and-verify-messages.md)
18
18
 
19
19
  - Tutorial
20
20
  - [Register an identity](https://dashplatform.readme.io/docs/tutorial-register-an-identity)
@@ -1,6 +1,6 @@
1
1
  ## Paying to another address
2
2
 
3
- In order to pay, you need to have an [existing balance](/examples/receive-money-and-check-balance.md).
3
+ In order to pay, you need to have an [existing balance](../examples/receive-money-and-check-balance.md).
4
4
  The below code will allow you to pay to a single address a specific amount of satoshis.
5
5
 
6
6
  ```js
@@ -2,7 +2,7 @@
2
2
 
3
3
  Right now, Evonet does not support publishing a public contract. You will have to run a local instance or wait for updates to the [Dash Platform documentation](https://dashplatform.readme.io/docs) regarding how to run a devnet locally and publish a contract.
4
4
 
5
- For now you can try your luck using the [Dash Network Deploy tool](https://github.com/dashevo/dash-network-deploy) and refer to [how to use a local evonet](/examples/use-local-evonet.md).
5
+ For now you can try your luck using the [Dash Network Deploy tool](https://github.com/dashevo/dash-network-deploy) and refer to [how to use a local evonet](../examples/use-local-evonet.md).
6
6
 
7
7
  ## Create your contract
8
8
 
@@ -1,6 +1,6 @@
1
1
  ## Receive money and display balance
2
2
 
3
- Initialize the SDK Client with your [generated mnemonic](/examples/generate-a-new-mnemonic) passed as an option.
3
+ Initialize the SDK Client with your [generated mnemonic](../examples/generate-a-new-mnemonic.md) passed as an option.
4
4
  By default, the SDK Client will work on Evonet, the only network having DAPI at the time of writing.
5
5
 
6
6
  ```js
@@ -13,7 +13,7 @@ const client = new Dash.Client({
13
13
 
14
14
  Having set up your `client` instance, you be able to access the `account` and `wallet` instance generated from your mnemonic.
15
15
 
16
- You can read more on [how to use a different account](/examples/use-different-account) as by default, you are on the first BIP44 account.
16
+ You can read more on [how to use a different account](../examples/use-different-account.md) as by default, you are on the first BIP44 account.
17
17
 
18
18
 
19
19
  ## Generate a receiving address
@@ -16,7 +16,7 @@ Since the introduction of deterministic wallets ([BIP44](https://github.com/bitc
16
16
 
17
17
  It is the instance you will use most of the time for receiving or broadcasting payments.
18
18
 
19
- You can access your account with `client.getWalletAccount()` and see [how to use a different account](/examples/use-different-account) if you need to get a specific account index.
19
+ You can access your account with `client.getWalletAccount()` and see [how to use a different account](../examples/use-different-account.md) if you need to get a specific account index.
20
20
 
21
21
  ## App Schema and Contracts
22
22
 
@@ -25,4 +25,4 @@ The Dash Platform Chain, provides to developers the ability to create applicatio
25
25
  When registered, those applications schemas are called contracts and contains a contractId (namespace : `client.platform.contracts`).
26
26
  By default, this library supports Dash Platform Name Service (DPNS) (to attach a name to an identity), under the namespace `client.platform.names` for testnet.
27
27
 
28
- You can read more on [how to use DPNS on a local Evonet devnet](/examples/use-local-evonet.md) or [how to use multiple apps](/getting-started/multiple-apps.md).
28
+ You can read more on [how to use DPNS on a local Evonet devnet](../examples/use-local-evonet.md) or [how to use multiple apps](../getting-started/multiple-apps.md).
@@ -1,6 +1,6 @@
1
1
  ## DPNS
2
2
 
3
- DPNS is handled in the Dash SDK Client under the namespace `client.platform.names.*'`. [Read more here](/platform/names)
3
+ DPNS is handled in the Dash SDK Client under the namespace `client.platform.names.*'`. [Read more here](../platform/names/about-dpns.md)
4
4
 
5
5
  ## DashPay
6
6
 
@@ -50,7 +50,7 @@ client.getWalletAccount().then(async (account) => {
50
50
 
51
51
  ## Read a document
52
52
 
53
- At the time of writing, you will need to have registered a data contract yourself. See [publishing a new contract](/examples/publishing-a-new-contract.md).
53
+ At the time of writing, you will need to have registered a data contract yourself. See [publishing a new contract](../examples/publishing-a-new-contract.md).
54
54
 
55
55
  ```js
56
56
 
@@ -1,6 +1,6 @@
1
1
  ## What is a contract
2
2
 
3
- Contracts are a [registered](/examples/publishing-a-new-contract.md) set of rules defined in a [JSON Application Schema](/getting-started/core-concepts#schemas).
3
+ Contracts are a [registered](../../examples/publishing-a-new-contract.md) set of rules defined in a [JSON Application Schema](../../getting-started/core-concepts#schemas).
4
4
 
5
5
  See more on the Dash Platform documentation about [Data Contract](https://dashplatform.readme.io/docs/explanation-platform-protocol-data-contract).
6
6
 
@@ -5,8 +5,8 @@ Parameters:
5
5
 
6
6
  | parameters | type | required | Description |
7
7
  |---------------------------|-----------|----------------| ------------------------------------------------------------------------------|
8
- | **contract** | Contract | yes | A valid [created contract](/platform/contracts/create.md) |
9
- | **identity** | Identity | yes | A valid [registered `application` identity](/platform/identities/register.md) |
8
+ | **contract** | Contract | yes | A valid [created contract](../contracts/create.md) |
9
+ | **identity** | Identity | yes | A valid [registered `application` identity](../identities/register.md) |
10
10
 
11
11
  **Example**:
12
12
  ```js
@@ -6,7 +6,7 @@ Parameters:
6
6
  | parameters | type | required | Description |
7
7
  |--------------------------|-------------------|------------------ | ----------------------------------------------------------------- |
8
8
  | **contractDefinitions** | JSONDataContract | yes | The defined [JSON Application Schema](https://dashplatform.readme.io/docs/explanation-platform-protocol-data-contract) |
9
- | **identity** | Identity | yes | A valid [registered `application` identity](/platform/identities/register.md) |
9
+ | **identity** | Identity | yes | A valid [registered `application` identity](../identities/register.md) |
10
10
 
11
11
  **Example**:
12
12
 
@@ -31,6 +31,6 @@ Parameters:
31
31
  const validationResult = client.platform.dpp.dataContract.validate(contract);
32
32
  ```
33
33
 
34
- **Note**: When your contract is created, it will only exist locally, use the [broadcast](/platform/contracts/broadcast.md) method to register it.
34
+ **Note**: When your contract is created, it will only exist locally, use the [broadcast](../contracts/broadcast.md) method to register it.
35
35
 
36
36
  Returns : Contract.
@@ -6,10 +6,10 @@ Parameters:
6
6
  | parameters | type | required | Description |
7
7
  |----------------------------|------------|----------| ----------------------------------------------------------------------------|
8
8
  | **documents** | Object | yes | |
9
- | **documents.create** | Document[] | no | array of valid [created document](/platform/documents/create.md) to create |
10
- | **documents.replace** | Document[] | no | array of valid [created document](/platform/documents/create.md) to replace |
11
- | **documents.delete** | Document[] | no | array of valid [created document](/platform/documents/create.md) to delete |
12
- | **identity** | Identity | yes | A valid [registered identity](/platform/identities/register.md) |
9
+ | **documents.create** | Document[] | no | array of valid [created document](../documents/create.md) to create |
10
+ | **documents.replace** | Document[] | no | array of valid [created document](../documents/create.md) to replace |
11
+ | **documents.delete** | Document[] | no | array of valid [created document](../documents/create.md) to delete |
12
+ | **identity** | Identity | yes | A valid [registered identity](../identities/register.md) |
13
13
 
14
14
 
15
15
  **Example**:
@@ -6,7 +6,7 @@ Parameters:
6
6
  | parameters | type | required | Description |
7
7
  |-------------------|---------|------------------ | ----------------------------------------------------------------- |
8
8
  | **dotLocator** | string | yes | Field of a specific application, under the form `appName.fieldName` |
9
- | **identity** | Identity| yes | A valid [registered identity](/platform/identities/register.md) |
9
+ | **identity** | Identity| yes | A valid [registered identity](../identities/register.md) |
10
10
  | **docOpts** | Object | yes | A valid data that match the data contract structure |
11
11
 
12
12
  **Example**:
@@ -21,6 +21,6 @@ const helloWorldDocument = await platform.documents.create(
21
21
  { message: 'Hello World'},
22
22
  );
23
23
  ```
24
- **Note**: When your document is created, it will only exist locally, use the [broadcast](/platform/documents/broadcast.md) method to register it.
24
+ **Note**: When your document is created, it will only exist locally, use the [broadcast](../documents/broadcast.md) method to register it.
25
25
 
26
26
  Returns: Document
@@ -4,7 +4,7 @@ An Identity is a blockchain-based identifier for individuals (users) and applica
4
4
  Identity is the atomic element that linked with additional applications can be extended to provide new functionality.
5
5
 
6
6
  Read more on the Dash Platform documentation about [Identity](https://dashplatform.readme.io/docs/explanation-identity).
7
- You might also want to consult the usage for the [DPNS Name Service](/platform/names) in order to attach a name to your created identity.
7
+ You might also want to consult the usage for the [DPNS Name Service](../names/about-dpns.md) in order to attach a name to your created identity.
8
8
 
9
9
  ## Credits
10
10
 
@@ -9,6 +9,6 @@ Parameters:
9
9
 
10
10
  **Example**: `await client.platform.identities.register()`
11
11
 
12
- **Note**: The created identity will be associated to the active account. You might want to know more about how to [change your active account](/examples/use-different-account).
12
+ **Note**: The created identity will be associated to the active account. You might want to know more about how to [change your active account](../../examples/use-different-account.md).
13
13
 
14
14
  Returns : Identity.
@@ -5,7 +5,7 @@ Parameters:
5
5
 
6
6
  | parameters | type | required | Description |
7
7
  |-------------------|---------|------------------| ----------------------------------------------------------------------------------------|
8
- | **identity** | Identity| yes | A valid [registered identity](/platform/identities/register.md) |
8
+ | **identity** | Identity| yes | A valid [registered identity](../identities/register.md) |
9
9
  | **amount** | number | yes | A duffs (satoshis) value corresponding to the amount you want to top up to the identity.|
10
10
 
11
11
  **Example**:
@@ -9,7 +9,7 @@ Parameters:
9
9
  | **records** | Object | yes | records object having only one of the following items |
10
10
  | **records.dashUniqueIdentityId** | String | no | Unique Identity ID for this name record |
11
11
  | **records.dashAliasIdentityId** | String | no | Used to signify that this name is the alias for another id |
12
- | **identity** | Identity | yes | A valid [registered identity](/platform/identities/register.md) |
12
+ | **identity** | Identity | yes | A valid [registered identity](../identities/register.md) |
13
13
 
14
14
 
15
15
  **Example**: `await client.platform.identities.register('alice', { dashUniqueIdentityId: identity.getId() }, identity)`
package/karma.conf.js CHANGED
@@ -4,13 +4,20 @@ const dotenvResult = require('dotenv-safe').config();
4
4
 
5
5
  const webpackBaseConfig = require("./webpack.base.config");
6
6
 
7
+ const karmaMocha = require('karma-mocha');
8
+ const karmaMochaReporter = require('karma-mocha-reporter');
9
+ const karmaChai = require('karma-chai');
10
+ const karmaChromeLauncher = require('karma-chrome-launcher');
11
+ const karmaFirefoxLauncher = require('karma-firefox-launcher');
12
+ const karmaWebpack = require('karma-webpack');
13
+
7
14
  if (dotenvResult.error) {
8
15
  throw dotenvResult.error;
9
16
  }
10
17
 
11
18
  module.exports = (config) => {
12
19
  config.set({
13
- frameworks: ['mocha', 'chai'],
20
+ frameworks: ['mocha', 'chai', 'webpack'],
14
21
  files: [
15
22
  'src/**/*.spec.ts',
16
23
  'src/test/karma/bootstrap.ts',
@@ -25,6 +32,7 @@ module.exports = (config) => {
25
32
  ...webpackBaseConfig,
26
33
  mode: 'development',
27
34
  plugins: [
35
+ ...webpackBaseConfig.plugins,
28
36
  new webpack.EnvironmentPlugin(
29
37
  dotenvResult.parsed,
30
38
  ),
@@ -38,14 +46,16 @@ module.exports = (config) => {
38
46
  browsers: ['ChromeHeadless', 'FirefoxHeadless'],
39
47
  singleRun: false,
40
48
  concurrency: Infinity,
41
- browserNoActivityTimeout: 7 * 60 * 1000,
49
+ browserNoActivityTimeout: 7 * 60 * 1000, // 30000 default
50
+ browserDisconnectTimeout: 3 * 2000, // 2000 default
51
+ pingTimeout: 3 * 5000, // 5000 default
42
52
  plugins: [
43
- 'karma-mocha',
44
- 'karma-mocha-reporter',
45
- 'karma-chai',
46
- 'karma-chrome-launcher',
47
- 'karma-firefox-launcher',
48
- 'karma-webpack',
53
+ karmaMocha,
54
+ karmaMochaReporter,
55
+ karmaChai,
56
+ karmaChromeLauncher,
57
+ karmaFirefoxLauncher,
58
+ karmaWebpack,
49
59
  ],
50
60
  customLaunchers: {
51
61
  FirefoxHeadless: {