dash 3.22.0-dev.2 → 3.22.0-dev.3
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/build/src/SDK/Client/Client.spec.js +3 -3
- package/build/src/SDK/Client/Client.spec.js.map +1 -1
- package/build/src/SDK/Client/Platform/Platform.js +4 -2
- package/build/src/SDK/Client/Platform/Platform.js.map +1 -1
- package/build/src/SDK/Client/Platform/createAssetLockTransaction.js +1 -1
- package/build/src/SDK/Client/Platform/methods/contracts/{broadcast.js → publish.js} +6 -6
- package/build/src/SDK/Client/Platform/methods/contracts/publish.js.map +1 -0
- package/build/src/SDK/Client/Platform/methods/contracts/update.js +75 -0
- package/build/src/SDK/Client/Platform/methods/contracts/update.js.map +1 -0
- package/build/src/SDK/Client/Platform/methods/documents/get.js +2 -5
- package/build/src/SDK/Client/Platform/methods/documents/get.js.map +1 -1
- package/build/src/SDK/Client/Platform/methods/identities/internal/createIdentityCreateTransition.js +9 -1
- package/build/src/SDK/Client/Platform/methods/identities/internal/createIdentityCreateTransition.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/test/fixtures/createIdentityFixtureInAccount.js +2 -0
- package/build/src/test/fixtures/createIdentityFixtureInAccount.js.map +1 -1
- package/build/src/test/mocks/createAndAttachTransportMocksToClient.js +5 -2
- package/build/src/test/mocks/createAndAttachTransportMocksToClient.js.map +1 -1
- package/build/src/utils/createFakeIntantLock.js +2 -0
- package/build/src/utils/createFakeIntantLock.js.map +1 -1
- package/build/tests/fixtures/contracts.json +3 -1
- package/dist/src/SDK/Client/Platform/Platform.d.ts +7 -1
- package/dist/src/SDK/Client/Platform/createAssetLockTransaction.d.ts +1 -1
- package/dist/src/SDK/Client/Platform/methods/contracts/publish.d.ts +10 -0
- package/dist/src/SDK/Client/Platform/methods/contracts/update.d.ts +10 -0
- package/dist/src/SDK/SDK.d.ts +167 -4
- package/docs/README.md +6 -6
- package/docs/_sidebar.md +19 -17
- package/docs/examples/pay-to-another-address.md +1 -1
- package/docs/examples/publishing-a-new-contract.md +7 -7
- package/docs/examples/receive-money-and-check-balance.md +2 -2
- package/docs/examples/updating-a-contract.md +55 -0
- 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/create.md +2 -2
- package/docs/platform/contracts/{broadcast.md → publish.md} +8 -8
- package/docs/platform/contracts/update.md +14 -0
- 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/examples/node/register-contract.js +1 -1
- package/examples/schema.json +2 -0
- package/karma.conf.js +17 -8
- package/package.json +32 -23
- package/src/SDK/Client/Client.spec.ts +3 -3
- package/src/SDK/Client/Platform/Platform.ts +12 -3
- package/src/SDK/Client/Platform/createAssetLockTransaction.ts +1 -1
- package/src/SDK/Client/Platform/methods/contracts/{broadcast.ts → publish.ts} +4 -4
- package/src/SDK/Client/Platform/methods/contracts/update.ts +26 -0
- package/src/SDK/Client/Platform/methods/documents/get.ts +1 -4
- package/src/SDK/Client/Platform/methods/identities/internal/createIdentityCreateTransition.ts +6 -1
- package/src/SDK/Client/Platform/methods/names/register.ts +1 -1
- package/src/test/fixtures/createIdentityFixtureInAccount.ts +3 -1
- package/src/test/mocks/createAndAttachTransportMocksToClient.ts +25 -21
- package/src/utils/createFakeIntantLock.ts +2 -0
- package/tests/fixtures/contracts.json +3 -1
- package/tests/fixtures/dp1.schema.json +2 -0
- package/tests/fixtures/ratePlatform.schema.json +1 -0
- package/webpack.base.config.js +5 -2
- package/webpack.config.js +3 -24
- 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 -5
- package/.github/workflows/test_and_release.yml +0 -170
- package/build/src/SDK/Client/Platform/methods/contracts/broadcast.js.map +0 -1
- package/dist/dash.min.js +0 -8
- package/dist/dash.min.js.LICENSE.txt +0 -47
- package/dist/src/SDK/Client/Platform/methods/contracts/broadcast.d.ts +0 -10
package/package.json
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dash",
|
|
3
|
-
"version": "3.22.0-dev.
|
|
3
|
+
"version": "3.22.0-dev.3",
|
|
4
4
|
"description": "Dash library for JavaScript/TypeScript ecosystem (Wallet, DAPI, Primitives, BLS, ...)",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"unpkg": "dist/dash.min.js",
|
|
7
7
|
"types": "dist/src/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"start:dev": "nodemon --exec '
|
|
10
|
-
"build": "
|
|
11
|
-
"build:web": "
|
|
9
|
+
"start:dev": "nodemon --exec 'yarn run build && yarn run test:unit'",
|
|
10
|
+
"build": "yarn run build:ts",
|
|
11
|
+
"build:web": "yarn run build:ts && webpack --stats-error-details",
|
|
12
12
|
"build:ts": "tsc",
|
|
13
|
-
"
|
|
13
|
+
"lint": "",
|
|
14
|
+
"test": "yarn run test:unit && yarn run test:functional && yarn run test:browsers",
|
|
14
15
|
"test:browsers": "karma start ./karma.conf.js --single-run",
|
|
15
|
-
"test:unit": "
|
|
16
|
-
"test:functional": "
|
|
17
|
-
"prepublishOnly": "
|
|
18
|
-
"prepare": "
|
|
16
|
+
"test:unit": "TS_NODE_COMPILER_OPTIONS={\"target\":\"es6\"} ts-mocha \"src/**/*.spec.ts\"",
|
|
17
|
+
"test:functional": "yarn run build && mocha --recursive tests/functional/**/*.js",
|
|
18
|
+
"prepublishOnly": "yarn run build:web",
|
|
19
|
+
"prepare": "yarn run build"
|
|
20
|
+
},
|
|
21
|
+
"ultra": {
|
|
22
|
+
"concurrent": [
|
|
23
|
+
"test"
|
|
24
|
+
]
|
|
19
25
|
},
|
|
20
26
|
"repository": {
|
|
21
27
|
"type": "git",
|
|
@@ -28,13 +34,13 @@
|
|
|
28
34
|
},
|
|
29
35
|
"homepage": "https://github.com/dashevo/DashJS#readme",
|
|
30
36
|
"dependencies": {
|
|
31
|
-
"@dashevo/dapi-client": "0.
|
|
32
|
-
"@dashevo/dashcore-lib": "~0.19.
|
|
33
|
-
"@dashevo/dpp": "~0.
|
|
34
|
-
"@dashevo/grpc-common": "~0.
|
|
35
|
-
"@dashevo/wallet-lib": "~7.22.0-dev.
|
|
37
|
+
"@dashevo/dapi-client": "~0.22.0-dev.3",
|
|
38
|
+
"@dashevo/dashcore-lib": "~0.19.28",
|
|
39
|
+
"@dashevo/dpp": "~0.22.0-dev.3",
|
|
40
|
+
"@dashevo/grpc-common": "~0.22.0-dev.3",
|
|
41
|
+
"@dashevo/wallet-lib": "~7.22.0-dev.3",
|
|
36
42
|
"bs58": "^4.0.1",
|
|
37
|
-
"node-inspect-extracted": "1.0.
|
|
43
|
+
"node-inspect-extracted": "^1.0.8"
|
|
38
44
|
},
|
|
39
45
|
"devDependencies": {
|
|
40
46
|
"@types/chai": "^4.2.12",
|
|
@@ -47,36 +53,39 @@
|
|
|
47
53
|
"assert": "^2.0.0",
|
|
48
54
|
"browserify-zlib": "^0.2.0",
|
|
49
55
|
"buffer": "^6.0.3",
|
|
50
|
-
"chai": "^4.
|
|
56
|
+
"chai": "^4.3.4",
|
|
51
57
|
"chance": "^1.1.6",
|
|
52
58
|
"crypto-browserify": "^3.12.0",
|
|
53
59
|
"dirty-chai": "^2.0.1",
|
|
54
60
|
"dotenv-safe": "^8.2.0",
|
|
61
|
+
"events": "^3.3.0",
|
|
55
62
|
"https-browserify": "^1.0.0",
|
|
56
|
-
"karma": "^
|
|
63
|
+
"karma": "^6.3.4",
|
|
57
64
|
"karma-chai": "^0.1.0",
|
|
58
65
|
"karma-chrome-launcher": "^3.1.0",
|
|
59
|
-
"karma-firefox-launcher": "^1.
|
|
66
|
+
"karma-firefox-launcher": "^2.1.1",
|
|
60
67
|
"karma-mocha": "^2.0.1",
|
|
61
68
|
"karma-mocha-reporter": "^2.2.5",
|
|
62
69
|
"karma-webpack": "^5.0.0",
|
|
63
|
-
"mocha": "^
|
|
70
|
+
"mocha": "^9.1.2",
|
|
64
71
|
"nodemon": "^2.0.4",
|
|
65
72
|
"os-browserify": "^0.3.0",
|
|
66
73
|
"path-browserify": "^1.0.1",
|
|
67
74
|
"process": "^0.11.10",
|
|
68
75
|
"rimraf": "^3.0.2",
|
|
69
|
-
"sinon": "^
|
|
70
|
-
"sinon-chai": "^3.
|
|
76
|
+
"sinon": "^11.1.2",
|
|
77
|
+
"sinon-chai": "^3.7.0",
|
|
71
78
|
"stream-browserify": "^3.0.0",
|
|
72
79
|
"stream-http": "^3.2.0",
|
|
80
|
+
"string_decoder": "^1.3.0",
|
|
73
81
|
"ts-loader": "^8.0.2",
|
|
82
|
+
"ts-mocha": "^8.0.0",
|
|
74
83
|
"ts-mock-imports": "^1.3.0",
|
|
75
|
-
"ts-node": "^
|
|
84
|
+
"ts-node": "^10.4.0",
|
|
76
85
|
"typescript": "^3.9.5",
|
|
77
86
|
"url": "^0.11.0",
|
|
78
87
|
"util": "^0.12.4",
|
|
79
88
|
"webpack": "^5.59.1",
|
|
80
89
|
"webpack-cli": "^4.9.1"
|
|
81
90
|
}
|
|
82
|
-
}
|
|
91
|
+
}
|
|
@@ -278,7 +278,7 @@ describe('Dash - Client', function suite() {
|
|
|
278
278
|
});
|
|
279
279
|
});
|
|
280
280
|
|
|
281
|
-
describe('#platform.contracts.
|
|
281
|
+
describe('#platform.contracts.publish', () => {
|
|
282
282
|
it('should throw TransitionBroadcastError when transport resolves error', async () => {
|
|
283
283
|
const errorResponse = {
|
|
284
284
|
error: {
|
|
@@ -292,7 +292,7 @@ describe('Dash - Client', function suite() {
|
|
|
292
292
|
|
|
293
293
|
let error;
|
|
294
294
|
try {
|
|
295
|
-
await client.platform.contracts.
|
|
295
|
+
await client.platform.contracts.publish(dataContractFixture, identityFixture);
|
|
296
296
|
} catch (e) {
|
|
297
297
|
error = e;
|
|
298
298
|
}
|
|
@@ -307,7 +307,7 @@ describe('Dash - Client', function suite() {
|
|
|
307
307
|
proof: { }
|
|
308
308
|
});
|
|
309
309
|
|
|
310
|
-
await client.platform.contracts.
|
|
310
|
+
await client.platform.contracts.publish(dataContractFixture, identityFixture);
|
|
311
311
|
|
|
312
312
|
const serializedSt = dapiClientMock.platform.broadcastStateTransition.getCall(0).args[0];
|
|
313
313
|
const interceptedSt = await client.platform.dpp.stateTransition.createFromBuffer(serializedSt);
|
|
@@ -7,7 +7,8 @@ import broadcastDocument from "./methods/documents/broadcast";
|
|
|
7
7
|
import createDocument from "./methods/documents/create";
|
|
8
8
|
import getDocument from "./methods/documents/get";
|
|
9
9
|
|
|
10
|
-
import
|
|
10
|
+
import publishContract from "./methods/contracts/publish";
|
|
11
|
+
import updateContract from "./methods/contracts/update";
|
|
11
12
|
import createContract from "./methods/contracts/create";
|
|
12
13
|
import getContract from "./methods/contracts/get";
|
|
13
14
|
|
|
@@ -66,6 +67,13 @@ interface Identities {
|
|
|
66
67
|
topUp: Function,
|
|
67
68
|
}
|
|
68
69
|
|
|
70
|
+
interface DataContracts {
|
|
71
|
+
update: Function,
|
|
72
|
+
publish: Function,
|
|
73
|
+
create: Function,
|
|
74
|
+
get: Function,
|
|
75
|
+
}
|
|
76
|
+
|
|
69
77
|
/**
|
|
70
78
|
* Class for Dash Platform
|
|
71
79
|
*
|
|
@@ -93,7 +101,7 @@ export class Platform {
|
|
|
93
101
|
* @param {Function} create - create contracts which can be broadcasted
|
|
94
102
|
* @param {Function} register - register contracts on the platform
|
|
95
103
|
*/
|
|
96
|
-
public contracts:
|
|
104
|
+
public contracts: DataContracts;
|
|
97
105
|
|
|
98
106
|
/**
|
|
99
107
|
* Broadcasts state transition
|
|
@@ -121,7 +129,8 @@ export class Platform {
|
|
|
121
129
|
get: getDocument.bind(this),
|
|
122
130
|
};
|
|
123
131
|
this.contracts = {
|
|
124
|
-
|
|
132
|
+
publish: publishContract.bind(this),
|
|
133
|
+
update: updateContract.bind(this),
|
|
125
134
|
create: createContract.bind(this),
|
|
126
135
|
get: getContract.bind(this),
|
|
127
136
|
};
|
|
@@ -9,7 +9,7 @@ const ASSET_LOCK_OUTPUT_INDEX = 0;
|
|
|
9
9
|
* Creates a funding transaction for the platform identity and returns one-time key to sign the state transition
|
|
10
10
|
* @param {Platform} platform
|
|
11
11
|
* @param {number} fundingAmount - amount of dash to fund the identity's credits
|
|
12
|
-
* @return {{transaction: Transaction, privateKey: PrivateKey}} - transaction and one time private key
|
|
12
|
+
* @return {Promise<{transaction: Transaction, privateKey: PrivateKey}>} - transaction and one time private key
|
|
13
13
|
* that can be used to sign registration/top-up state transition
|
|
14
14
|
*/
|
|
15
15
|
export default async function createAssetLockTransaction(platform : Platform, fundingAmount): Promise<{ transaction: Transaction, privateKey: PrivateKey, outputIndex: number }> {
|
|
@@ -3,19 +3,19 @@ import broadcastStateTransition from "../../broadcastStateTransition";
|
|
|
3
3
|
import { signStateTransition } from "../../signStateTransition";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Publish contract onto the platform
|
|
7
7
|
*
|
|
8
8
|
* @param {Platform} this - bound instance class
|
|
9
9
|
* @param dataContract - contract
|
|
10
10
|
* @param identity - identity
|
|
11
|
-
* @return
|
|
11
|
+
* @return {DataContractCreateTransition}
|
|
12
12
|
*/
|
|
13
|
-
export default async function
|
|
13
|
+
export default async function publish(this: Platform, dataContract: any, identity: any): Promise<any> {
|
|
14
14
|
await this.initialize();
|
|
15
15
|
|
|
16
16
|
const { dpp } = this;
|
|
17
17
|
|
|
18
|
-
const dataContractCreateTransition = dpp.dataContract.
|
|
18
|
+
const dataContractCreateTransition = dpp.dataContract.createDataContractCreateTransition(dataContract);
|
|
19
19
|
|
|
20
20
|
await signStateTransition(this, dataContractCreateTransition, identity);
|
|
21
21
|
await broadcastStateTransition(this, dataContractCreateTransition);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Platform } from "../../Platform";
|
|
2
|
+
import broadcastStateTransition from "../../broadcastStateTransition";
|
|
3
|
+
import { signStateTransition } from "../../signStateTransition";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Publish contract onto the platform
|
|
7
|
+
*
|
|
8
|
+
* @param {Platform} this - bound instance class
|
|
9
|
+
* @param dataContract - contract
|
|
10
|
+
* @param identity - identity
|
|
11
|
+
* @return {DataContractUpdateTransition}
|
|
12
|
+
*/
|
|
13
|
+
export default async function update(this: Platform, dataContract: any, identity: any): Promise<any> {
|
|
14
|
+
await this.initialize();
|
|
15
|
+
|
|
16
|
+
const { dpp } = this;
|
|
17
|
+
|
|
18
|
+
dataContract.incrementVersion();
|
|
19
|
+
|
|
20
|
+
const dataContractUpdateTransition = dpp.dataContract.createDataContractUpdateTransition(dataContract);
|
|
21
|
+
|
|
22
|
+
await signStateTransition(this, dataContractUpdateTransition, identity);
|
|
23
|
+
await broadcastStateTransition(this, dataContractUpdateTransition);
|
|
24
|
+
|
|
25
|
+
return dataContractUpdateTransition;
|
|
26
|
+
}
|
|
@@ -40,10 +40,7 @@ const ensureAppContractFetched = async function (this: Platform, appName) {
|
|
|
40
40
|
const appDefinition = this.client.getApps().get(appName);
|
|
41
41
|
|
|
42
42
|
if (!appDefinition.contract) {
|
|
43
|
-
|
|
44
|
-
if (!contract) {
|
|
45
|
-
throw new Error(`Applcation ${appName} contract with ID ${appDefinition.contractId} is not found`);
|
|
46
|
-
}
|
|
43
|
+
await this.contracts.get(appDefinition.contractId);
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
46
|
}
|
package/src/SDK/Client/Platform/methods/identities/internal/createIdentityCreateTransition.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PrivateKey } from "@dashevo/dashcore-lib";
|
|
2
2
|
import { Platform } from "../../../Platform";
|
|
3
|
+
import IdentityPublicKey from "@dashevo/dpp/lib/identity/IdentityPublicKey"
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Creates a funding transaction for the platform identity and returns one-time key to sign the state transition
|
|
@@ -24,7 +25,11 @@ export default async function createIdentityCreateTransition(platform : Platform
|
|
|
24
25
|
// Create Identity
|
|
25
26
|
// @ts-ignore
|
|
26
27
|
const identity = dpp.identity.create(
|
|
27
|
-
assetLockProof, [
|
|
28
|
+
assetLockProof, [{
|
|
29
|
+
key: identityPublicKey,
|
|
30
|
+
purpose: IdentityPublicKey.PURPOSES.AUTHENTICATION,
|
|
31
|
+
securityLevel: IdentityPublicKey.SECURITY_LEVELS.MASTER
|
|
32
|
+
}]
|
|
28
33
|
);
|
|
29
34
|
|
|
30
35
|
// Create ST
|
|
@@ -11,6 +11,8 @@ export function createIdentityFixtureInAccount(account) {
|
|
|
11
11
|
id: 0,
|
|
12
12
|
type: IdentityPublicKey.TYPES.ECDSA_SECP256K1,
|
|
13
13
|
data: identityPrivateKey.toPublicKey().toBuffer(),
|
|
14
|
+
purpose: IdentityPublicKey.PURPOSES.AUTHENTICATION,
|
|
15
|
+
securityLevel: IdentityPublicKey.SECURITY_LEVELS.MASTER
|
|
14
16
|
});
|
|
15
17
|
|
|
16
18
|
account.storage.insertIdentityIdAtIndex(
|
|
@@ -20,4 +22,4 @@ export function createIdentityFixtureInAccount(account) {
|
|
|
20
22
|
);
|
|
21
23
|
|
|
22
24
|
return identityFixture;
|
|
23
|
-
}
|
|
25
|
+
}
|
|
@@ -17,26 +17,30 @@ const TxStreamDataResponseMock = require('@dashevo/wallet-lib/src/test/mocks/TxS
|
|
|
17
17
|
const TransportMock = require('@dashevo/wallet-lib/src/test/mocks/TransportMock');
|
|
18
18
|
|
|
19
19
|
function makeTxStreamEmitISLocksForTransactions(transportMock, txStreamMock) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
)
|
|
39
|
-
|
|
20
|
+
transportMock.sendTransaction.callsFake((txString) => {
|
|
21
|
+
const transaction = new Transaction(txString);
|
|
22
|
+
const isLock = createFakeInstantLock(transaction.hash);
|
|
23
|
+
|
|
24
|
+
setImmediate(() => {
|
|
25
|
+
// Emit IS lock for the transaction
|
|
26
|
+
txStreamMock.emit(
|
|
27
|
+
TxStreamMock.EVENTS.data,
|
|
28
|
+
new TxStreamDataResponseMock(
|
|
29
|
+
{ instantSendLockMessages: [isLock.toBuffer()] }
|
|
30
|
+
)
|
|
31
|
+
);
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
// Emit the same transaction back to the client so it will know about the change transaction
|
|
35
|
+
txStreamMock.emit(
|
|
36
|
+
TxStreamMock.EVENTS.data,
|
|
37
|
+
new TxStreamDataResponseMock(
|
|
38
|
+
{ rawTransactions: [transaction.toBuffer()] }
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
return transaction.hash;
|
|
43
|
+
});
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
/**
|
|
@@ -88,4 +92,4 @@ export async function createAndAttachTransportMocksToClient(client, sinon) {
|
|
|
88
92
|
makeGetIdentityRespondWithIdentity(client, dapiClientMock);
|
|
89
93
|
|
|
90
94
|
return { txStreamMock, transportMock, dapiClientMock };
|
|
91
|
-
}
|
|
95
|
+
}
|
|
@@ -2,8 +2,10 @@ import { InstantLock } from "@dashevo/dashcore-lib";
|
|
|
2
2
|
|
|
3
3
|
export function createFakeInstantLock(transactionHash: string): InstantLock {
|
|
4
4
|
return new InstantLock({
|
|
5
|
+
version: 1,
|
|
5
6
|
txid: transactionHash,
|
|
6
7
|
signature: Buffer.alloc(96).toString('hex'),
|
|
8
|
+
cyclehash: '0dc8d0df62b076a7757ab5ca07dde0f1e2bfaf83f94299fd9a77577e6cc7022e',
|
|
7
9
|
inputs: [
|
|
8
10
|
{
|
|
9
11
|
outpointHash: '6e200d059fb567ba19e92f5c2dcd3dde522fd4e0a50af223752db16158dabb1d',
|
package/webpack.base.config.js
CHANGED
|
@@ -20,18 +20,21 @@ const baseConfig = {
|
|
|
20
20
|
crypto: require.resolve('crypto-browserify'),
|
|
21
21
|
http: require.resolve('stream-http'),
|
|
22
22
|
https: require.resolve('https-browserify'),
|
|
23
|
+
buffer: require.resolve('buffer/'),
|
|
23
24
|
url: require.resolve('url/'),
|
|
24
25
|
assert: require.resolve('assert/'),
|
|
25
26
|
stream: require.resolve('stream-browserify'),
|
|
26
27
|
path: require.resolve('path-browserify'),
|
|
27
28
|
os: require.resolve('os-browserify/browser'),
|
|
28
29
|
zlib: require.resolve('browserify-zlib'),
|
|
30
|
+
events: require.resolve('events/'),
|
|
31
|
+
string_decoder: require.resolve('string_decoder/'),
|
|
29
32
|
},
|
|
30
33
|
},
|
|
31
34
|
plugins: [
|
|
32
35
|
new webpack.ProvidePlugin({
|
|
33
|
-
Buffer: ['buffer', 'Buffer'],
|
|
34
|
-
process: 'process/browser',
|
|
36
|
+
Buffer: [require.resolve('buffer/'), 'Buffer'],
|
|
37
|
+
process: require.resolve('process/browser'),
|
|
35
38
|
}),
|
|
36
39
|
],
|
|
37
40
|
output: {
|
package/webpack.config.js
CHANGED
|
@@ -1,31 +1,10 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const
|
|
2
|
+
const webpackBaseConfig = require("./webpack.base.config");
|
|
3
3
|
|
|
4
4
|
const webConfig = {
|
|
5
|
+
...webpackBaseConfig,
|
|
5
6
|
entry: './build/src/index.js',
|
|
6
|
-
mode:
|
|
7
|
-
resolve: {
|
|
8
|
-
extensions: ['.js', '.json'],
|
|
9
|
-
fallback: {
|
|
10
|
-
fs: false,
|
|
11
|
-
util: require.resolve('util/'),
|
|
12
|
-
crypto: require.resolve('crypto-browserify'),
|
|
13
|
-
http: require.resolve('stream-http'),
|
|
14
|
-
https: require.resolve('https-browserify'),
|
|
15
|
-
url: require.resolve('url/'),
|
|
16
|
-
assert: require.resolve('assert/'),
|
|
17
|
-
stream: require.resolve('stream-browserify'),
|
|
18
|
-
path: require.resolve('path-browserify'),
|
|
19
|
-
os: require.resolve('os-browserify/browser'),
|
|
20
|
-
zlib: require.resolve('browserify-zlib'),
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
plugins: [
|
|
24
|
-
new webpack.ProvidePlugin({
|
|
25
|
-
Buffer: ['buffer', 'Buffer'],
|
|
26
|
-
process: 'process/browser',
|
|
27
|
-
}),
|
|
28
|
-
],
|
|
7
|
+
mode: 'production',
|
|
29
8
|
output: {
|
|
30
9
|
path: path.resolve(__dirname, 'dist'),
|
|
31
10
|
libraryTarget: 'umd',
|
package/.editorconfig
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Bug report
|
|
3
|
-
about: Create a report to help us improve
|
|
4
|
-
title: ''
|
|
5
|
-
labels: 'bug'
|
|
6
|
-
assignees: ''
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
<!--- Provide a general summary of the issue in the Title above -->
|
|
11
|
-
|
|
12
|
-
## Expected Behavior
|
|
13
|
-
<!--- Tell us what should happen -->
|
|
14
|
-
|
|
15
|
-
## Current Behavior
|
|
16
|
-
<!--- Tell us what happens instead of the expected behavior -->
|
|
17
|
-
|
|
18
|
-
## Possible Solution
|
|
19
|
-
<!--- Not obligatory, but suggest a fix/reason for the bug -->
|
|
20
|
-
|
|
21
|
-
## Steps to Reproduce (for bugs)
|
|
22
|
-
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
|
|
23
|
-
<!--- reproduce this bug. Include code to reproduce, if relevant -->
|
|
24
|
-
1.
|
|
25
|
-
2.
|
|
26
|
-
3.
|
|
27
|
-
4.
|
|
28
|
-
|
|
29
|
-
## Context
|
|
30
|
-
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
|
31
|
-
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
|
32
|
-
|
|
33
|
-
## Your Environment
|
|
34
|
-
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
|
35
|
-
* Version used:
|
|
36
|
-
* Environment name and version (e.g. Chrome 39, node.js 5.4):
|
|
37
|
-
* Operating System and version (desktop, server, or mobile):
|
|
38
|
-
* Link to your project:
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Feature request
|
|
3
|
-
about: Suggest an idea for this project
|
|
4
|
-
title: ''
|
|
5
|
-
labels: 'enhancement'
|
|
6
|
-
assignees: ''
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
<!--- Provide a general summary of the feature request in the Title above -->
|
|
11
|
-
|
|
12
|
-
## Expected Behavior
|
|
13
|
-
<!--- A clear and concise description of what you want to happen -->
|
|
14
|
-
|
|
15
|
-
## Current Behavior
|
|
16
|
-
<!--- Explain the difference from current behavior -->
|
|
17
|
-
|
|
18
|
-
## Possible Solution
|
|
19
|
-
<!--- Suggest ideas of how to implement the addition or change -->
|
|
20
|
-
|
|
21
|
-
## Alternatives Considered
|
|
22
|
-
<!--- A clear and concise description of any alternative solutions or features you've considered -->
|
|
23
|
-
|
|
24
|
-
## Additional Context
|
|
25
|
-
<!--- Add any other context or screenshots about the feature request here. -->
|
|
26
|
-
|
|
27
|
-
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<!--- Provide a general summary of your changes in the Title above -->
|
|
2
|
-
<!--- Pull request titles must use the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) format -->
|
|
3
|
-
|
|
4
|
-
## Issue being fixed or feature implemented
|
|
5
|
-
<!--- Why is this change required? What problem does it solve? -->
|
|
6
|
-
<!--- If it fixes an open issue, please link to the issue here. -->
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## What was done?
|
|
10
|
-
<!--- Describe your changes in detail -->
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## How Has This Been Tested?
|
|
14
|
-
<!--- Please describe in detail how you tested your changes. -->
|
|
15
|
-
<!--- Include details of your testing environment, and the tests you ran to -->
|
|
16
|
-
<!--- see how your change affects other areas of the code, etc. -->
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
## Breaking Changes
|
|
20
|
-
<!--- Please describe any breaking changes your code introduces and verify that -->
|
|
21
|
-
<!--- the title includes "!" following the conventional commit type (e.g. "feat!: ..."-->
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## Checklist:
|
|
25
|
-
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
|
26
|
-
- [ ] I have performed a self-review of my own code
|
|
27
|
-
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
28
|
-
- [ ] I have added or updated relevant unit/integration/functional/e2e tests
|
|
29
|
-
- [ ] I have made corresponding changes to the documentation
|
|
30
|
-
|
|
31
|
-
**For repository code-owners and collaborators only**
|
|
32
|
-
- [ ] I have assigned this pull request to a milestone
|