dash 3.21.0-dev.9 → 3.21.4
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/.mocharc.yml +1 -0
- package/CHANGELOG.md +34 -0
- package/build/src/SDK/Client/Client.js +2 -2
- package/build/src/SDK/Client/Platform/createAssetLockTransaction.js +1 -1
- package/build/src/SDK/Client/Platform/methods/documents/create.js +3 -0
- package/build/src/SDK/Client/Platform/methods/documents/create.js.map +1 -1
- package/build/src/SDK/Client/Platform/methods/names/register.js +1 -1
- package/build/src/SDK/Client/Platform/methods/names/register.js.map +1 -1
- package/build/src/utils/createFakeIntantLock.js +2 -0
- package/build/src/utils/createFakeIntantLock.js.map +1 -1
- package/dist/dash.min.js +7 -61
- package/dist/dash.min.js.LICENSE.txt +47 -0
- package/dist/src/SDK/Client/Platform/createAssetLockTransaction.d.ts +1 -1
- package/dist/src/SDK/SDK.d.ts +167 -4
- package/docs/README.md +6 -6
- package/docs/_sidebar.md +8 -8
- package/docs/examples/pay-to-another-address.md +1 -1
- package/docs/examples/publishing-a-new-contract.md +1 -1
- package/docs/examples/receive-money-and-check-balance.md +2 -2
- package/docs/getting-started/core-concepts.md +2 -2
- package/docs/getting-started/dash-platform-applications.md +1 -1
- package/docs/getting-started/quickstart.md +1 -1
- package/docs/platform/contracts/about-contracts.md +1 -1
- package/docs/platform/contracts/broadcast.md +2 -2
- package/docs/platform/contracts/create.md +2 -2
- package/docs/platform/documents/broadcast.md +4 -4
- package/docs/platform/documents/create.md +2 -2
- package/docs/platform/identities/about-identity.md +1 -1
- package/docs/platform/identities/register.md +1 -1
- package/docs/platform/identities/topUp.md +1 -1
- package/docs/platform/names/register.md +1 -1
- package/karma.conf.js +4 -1
- package/package.json +39 -22
- package/src/SDK/Client/Client.ts +2 -2
- package/src/SDK/Client/Platform/createAssetLockTransaction.ts +1 -1
- package/src/SDK/Client/Platform/methods/documents/create.ts +4 -0
- package/src/SDK/Client/Platform/methods/names/register.ts +1 -1
- package/src/utils/createFakeIntantLock.ts +2 -0
- package/webpack.base.config.js +23 -9
- package/webpack.config.js +23 -11
- package/.editorconfig +0 -2
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -27
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -32
- package/.github/workflows/.env +0 -4
- package/.github/workflows/test_and_release.yml +0 -170
package/.mocharc.yml
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
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
|
+
|
|
10
|
+
# [3.21.1](https://github.com/dashevo/DashJS/compare/v3.21.0...v3.21.1) (2021-10-26)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Chores
|
|
14
|
+
|
|
15
|
+
* update DPNS and DashPay contract ids ([#290](https://github.com/dashevo/DashJS/issues/290))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# [3.21.0](https://github.com/dashevo/DashJS/compare/v3.20.3...v3.21.0) (2021-10-21)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **Document:** throw error on null Data Сontract ([#244](https://github.com/dashevo/DashJS/issues/244))
|
|
25
|
+
* support higher protocol version ([#271](https://github.com/dashevo/DashJS/issues/271))
|
|
26
|
+
* add `driveProtocolVersion` option ([#249](https://github.com/dashevo/DashJS/issues/249))
|
|
27
|
+
* convenient broadcast errors ([#262](https://github.com/dashevo/DashJS/issues/262), [#266](https://github.com/dashevo/DashJS/issues/266), [#273](https://github.com/dashevo/DashJS/issues/273))
|
|
28
|
+
|
|
29
|
+
### BREAKING CHANGE
|
|
30
|
+
|
|
31
|
+
`StateTransitionBroadcastError#getData` is removed. Use `StateTransitionBroadcastError#getCause` to get additional details.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
1
35
|
## [3.20.3](https://github.com/dashevo/DashJS/compare/v3.20.2...v3.20.3) (2021-08-08)
|
|
2
36
|
|
|
3
37
|
### Chores
|
|
@@ -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: '
|
|
123
|
+
contractId: 'Bw9PUC3aSEGQ4j5qrvpNLrRNFPVMiUHZLr1atgfYJcmf'
|
|
124
124
|
},
|
|
125
125
|
dashpay: {
|
|
126
|
-
contractId: '
|
|
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) {
|
|
@@ -61,6 +61,9 @@ function create(typeLocator, identity, data) {
|
|
|
61
61
|
return [4 /*yield*/, this.contracts.get(contractId)];
|
|
62
62
|
case 2:
|
|
63
63
|
dataContract = _b.sent();
|
|
64
|
+
if (dataContract === null) {
|
|
65
|
+
throw new Error("Contract " + appName + " not found. Ensure contractId " + contractId + " is correct.");
|
|
66
|
+
}
|
|
64
67
|
return [2 /*return*/, dpp.document.create(dataContract, identity.getId(), fieldType, data)];
|
|
65
68
|
}
|
|
66
69
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../../../src/SDK/Client/Platform/methods/documents/create.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;;;;;;;GAOG;AACH,SAAsB,MAAM,CAAiB,WAAmB,EAAE,QAAa,EAAE,IAAqB;IAArB,qBAAA,EAAA,SAAqB;;;;;wBAClG,qBAAM,IAAI,CAAC,UAAU,EAAE,EAAA;;oBAAvB,SAAuB,CAAC;oBAEhB,GAAG,GAAK,IAAI,IAAT,CAAU;oBAEf,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC;oBAG5C,KAAuB,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,EAAvG,OAAO,QAAA,EAAE,SAAS,QAAA,CAAsF;oBAEvG,UAAU,GAAK,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,WAAvC,CAAwC;oBAErC,qBAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,EAAA;;oBAAnD,YAAY,GAAG,SAAoC;oBAEzD,sBAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CACtB,YAAY,EACZ,QAAQ,CAAC,KAAK,EAAE,EAChB,SAAS,EACT,IAAI,CACP,EAAC;;;;CACL;
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../../../src/SDK/Client/Platform/methods/documents/create.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;;;;;;;GAOG;AACH,SAAsB,MAAM,CAAiB,WAAmB,EAAE,QAAa,EAAE,IAAqB;IAArB,qBAAA,EAAA,SAAqB;;;;;wBAClG,qBAAM,IAAI,CAAC,UAAU,EAAE,EAAA;;oBAAvB,SAAuB,CAAC;oBAEhB,GAAG,GAAK,IAAI,IAAT,CAAU;oBAEf,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC;oBAG5C,KAAuB,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,EAAvG,OAAO,QAAA,EAAE,SAAS,QAAA,CAAsF;oBAEvG,UAAU,GAAK,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,WAAvC,CAAwC;oBAErC,qBAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,EAAA;;oBAAnD,YAAY,GAAG,SAAoC;oBAEzD,IAAI,YAAY,KAAK,IAAI,EAAE;wBACvB,MAAM,IAAI,KAAK,CAAC,cAAY,OAAO,sCAAiC,UAAU,iBAAc,CAAC,CAAA;qBAChG;oBAED,sBAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CACtB,YAAY,EACZ,QAAQ,CAAC,KAAK,EAAE,EAChB,SAAS,EACT,IAAI,CACP,EAAC;;;;CACL;AAxBD,wBAwBC;AAED,kBAAe,MAAM,CAAC"}
|
|
@@ -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;
|
|
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,0BAA0B,GAAG,UAAU;y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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"}
|
|
@@ -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;
|
|
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"}
|