dash 3.21.2 → 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.
Files changed (40) hide show
  1. package/.mocharc.yml +1 -0
  2. package/build/src/SDK/Client/Platform/createAssetLockTransaction.js +1 -1
  3. package/build/src/SDK/Client/Platform/methods/names/register.js +1 -1
  4. package/build/src/SDK/Client/Platform/methods/names/register.js.map +1 -1
  5. package/build/src/utils/createFakeIntantLock.js +2 -0
  6. package/build/src/utils/createFakeIntantLock.js.map +1 -1
  7. package/dist/dash.min.js +7 -55
  8. package/dist/dash.min.js.LICENSE.txt +47 -0
  9. package/dist/src/SDK/Client/Platform/createAssetLockTransaction.d.ts +1 -1
  10. package/dist/src/SDK/SDK.d.ts +167 -4
  11. package/docs/README.md +6 -6
  12. package/docs/_sidebar.md +8 -8
  13. package/docs/examples/pay-to-another-address.md +1 -1
  14. package/docs/examples/publishing-a-new-contract.md +1 -1
  15. package/docs/examples/receive-money-and-check-balance.md +2 -2
  16. package/docs/getting-started/core-concepts.md +2 -2
  17. package/docs/getting-started/dash-platform-applications.md +1 -1
  18. package/docs/getting-started/quickstart.md +1 -1
  19. package/docs/platform/contracts/about-contracts.md +1 -1
  20. package/docs/platform/contracts/broadcast.md +2 -2
  21. package/docs/platform/contracts/create.md +2 -2
  22. package/docs/platform/documents/broadcast.md +4 -4
  23. package/docs/platform/documents/create.md +2 -2
  24. package/docs/platform/identities/about-identity.md +1 -1
  25. package/docs/platform/identities/register.md +1 -1
  26. package/docs/platform/identities/topUp.md +1 -1
  27. package/docs/platform/names/register.md +1 -1
  28. package/karma.conf.js +4 -1
  29. package/package.json +39 -22
  30. package/src/SDK/Client/Platform/createAssetLockTransaction.ts +1 -1
  31. package/src/SDK/Client/Platform/methods/names/register.ts +1 -1
  32. package/src/utils/createFakeIntantLock.ts +2 -0
  33. package/webpack.base.config.js +23 -9
  34. package/webpack.config.js +23 -11
  35. package/.editorconfig +0 -2
  36. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
  37. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -27
  38. package/.github/PULL_REQUEST_TEMPLATE.md +0 -32
  39. package/.github/workflows/.env +0 -5
  40. package/.github/workflows/test_and_release.yml +0 -170
@@ -1,4 +1,6 @@
1
1
  const path = require('path');
2
+ const webpack = require('webpack');
3
+
2
4
  const baseConfig = {
3
5
  entry: './src/index.ts',
4
6
  module: {
@@ -10,18 +12,30 @@ const baseConfig = {
10
12
  },
11
13
  ],
12
14
  },
13
- node: {
14
- // Prevent embedded winston to throw error with FS not existing.
15
- fs: 'empty',
15
+ resolve: {
16
+ extensions: ['.ts', '.js', '.json'],
17
+ fallback: {
18
+ fs: false,
19
+ util: require.resolve('util/'),
20
+ crypto: require.resolve('crypto-browserify'),
21
+ http: require.resolve('stream-http'),
22
+ https: require.resolve('https-browserify'),
23
+ url: require.resolve('url/'),
24
+ assert: require.resolve('assert/'),
25
+ stream: require.resolve('stream-browserify'),
26
+ path: require.resolve('path-browserify'),
27
+ os: require.resolve('os-browserify/browser'),
28
+ zlib: require.resolve('browserify-zlib'),
29
+ },
16
30
  },
31
+ plugins: [
32
+ new webpack.ProvidePlugin({
33
+ Buffer: ['buffer', 'Buffer'],
34
+ process: 'process/browser',
35
+ }),
36
+ ],
17
37
  output: {
18
38
  path: path.resolve(__dirname, 'dist'),
19
39
  },
20
- resolve: {
21
- extensions: ['.ts', '.js', '.json'],
22
- alias: {
23
- 'bn.js': path.resolve(__dirname, 'node_modules', 'bn.js')
24
- }
25
- }
26
40
  }
27
41
  module.exports = baseConfig;
package/webpack.config.js CHANGED
@@ -1,13 +1,31 @@
1
1
  const path = require('path');
2
+ const webpack = require('webpack');
2
3
 
3
4
  const webConfig = {
4
5
  entry: './build/src/index.js',
5
6
  mode: "production",
6
- target: 'web',
7
- node: {
8
- // Prevent embedded winston to throw error with FS not existing.
9
- fs: 'empty',
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
+ },
10
22
  },
23
+ plugins: [
24
+ new webpack.ProvidePlugin({
25
+ Buffer: ['buffer', 'Buffer'],
26
+ process: 'process/browser',
27
+ }),
28
+ ],
11
29
  output: {
12
30
  path: path.resolve(__dirname, 'dist'),
13
31
  libraryTarget: 'umd',
@@ -16,12 +34,6 @@ const webConfig = {
16
34
  // fixes ReferenceError: window is not defined
17
35
  globalObject: "(typeof self !== 'undefined' ? self : this)"
18
36
  },
19
- resolve: {
20
- extensions: ['.js', '.json'],
21
- alias: {
22
- 'bn.js': path.resolve(__dirname, 'node_modules', 'bn.js')
23
- }
24
- },
25
37
  }
26
38
 
27
- module.exports = webConfig;
39
+ module.exports = [webConfig];
package/.editorconfig DELETED
@@ -1,2 +0,0 @@
1
- [*.{md,markdown}]
2
- trim_trailing_whitespace = false
@@ -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
@@ -1,5 +0,0 @@
1
- #DRIVE_BRANCH=v0.21-dev
2
- #DAPI_BRANCH=v0.21-dev
3
- DASHMATE_BRANCH=v0.21-dev
4
- TEST_SUITE_BRANCH=update-dependencies
5
- #LOG_LEVEL=silly
@@ -1,170 +0,0 @@
1
- name: Test and Release
2
-
3
- on:
4
- workflow_dispatch:
5
- schedule:
6
- - cron: '47 */160 * * *'
7
- release:
8
- types: [published]
9
- pull_request:
10
- branches:
11
- - master
12
- - v[0-9]+.[0-9]+-dev
13
-
14
- jobs:
15
- test:
16
- name: Run SDK tests
17
- runs-on: ubuntu-20.04
18
- timeout-minutes: 60
19
- steps:
20
- - name: Cancel previous runs
21
- uses: styfle/cancel-workflow-action@0.9.0
22
- with:
23
- access_token: ${{ github.token }}
24
-
25
- - uses: actions/checkout@v2
26
-
27
- - uses: actions/setup-node@v2
28
- with:
29
- node-version: '16'
30
-
31
- - name: Set up Docker BuildX
32
- id: buildx
33
- uses: docker/setup-buildx-action@v1
34
- with:
35
- version: v0.6.1
36
- install: true
37
- driver-opts: image=moby/buildkit:buildx-stable-1
38
-
39
- # Temporary fix until Docker Compose V2 is GA
40
- - name: Set up Docker Compose V2
41
- run: |
42
- curl https://github.com/docker/compose-cli/releases/download/v2.0.0-beta.4/docker-compose-linux-amd64 --location --create-dirs -o $HOME/.docker/cli-plugins/docker-compose
43
- chmod +x $HOME/.docker/cli-plugins/docker-compose
44
- docker version
45
- docker info
46
-
47
- # Cache for dashmate and test suite
48
- - name: Enable NPM cache
49
- uses: actions/cache@v2
50
- with:
51
- path: '~/.npm'
52
- key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
53
- restore-keys: |
54
- ${{ runner.os }}-node-
55
-
56
- - name: Enable buildkit cache
57
- uses: actions/cache@v2
58
- with:
59
- path: /tmp/buildkit-cache/buildkit-state.tar
60
- key: ${{ runner.os }}-buildkit-${{ github.sha }}
61
- restore-keys: |
62
- ${{ runner.os }}-buildkit-
63
-
64
- - name: Load buildkit state from cache
65
- uses: dashevo/gh-action-cache-buildkit-state@v1
66
- with:
67
- builder: buildx_buildkit_${{ steps.buildx.outputs.name }}0
68
- cache-path: /tmp/buildkit-cache
69
- cache-max-size: 2g
70
-
71
- - name: Check NPM package lock version is updated
72
- uses: dashevo/gh-action-check-package-lock@v1
73
-
74
- - name: Show NPM version
75
- run: npm --version
76
-
77
- - name: Install NPM dependencies
78
- run: npm ci
79
-
80
- - name: Load workflow dotenv file
81
- uses: c-py/action-dotenv-to-setenv@v3
82
- with:
83
- env-file: .github/workflows/.env
84
-
85
- - name: Set compatible branches for Platform components
86
- uses: dashevo/gh-action-platform-branches@v1
87
- id: platform-branches
88
- with:
89
- override-major-version: 0
90
- override-dashmate-branch: ${{ env.DASHMATE_BRANCH }}
91
- override-testsuite-branch: ${{ env.TEST_SUITE_BRANCH }}
92
-
93
- - name: Start Dash local network
94
- uses: dashevo/gh-action-start-local-network@v1
95
- id: start-local-network
96
- with:
97
- drive-branch: ${{ env.DRIVE_BRANCH }}
98
- dapi-branch: ${{ env.DAPI_BRANCH }}
99
- dashmate-branch: ${{ steps.platform-branches.outputs.dashmate-branch }}
100
- sdk-branch: ${{ steps.platform-branches.outputs.current-branch }}
101
-
102
- - name: Create dotenv file
103
- run: |
104
- echo "DAPI_SEED=127.0.0.1" > .env
105
- echo "FAUCET_PRIVATE_KEY=${{ steps.start-local-network.outputs.faucet-private-key }}" >> .env
106
- echo "NETWORK=regtest" >> .env
107
- echo "DPNS_CONTRACT_ID=${{ steps.start-local-network.outputs.dpns-contract-id }}" >> .env
108
-
109
- - name: Run SDK tests
110
- run: npm run test
111
-
112
- - name: Run Platform Test Suite
113
- uses: dashevo/gh-action-run-platform-test-suite@v1
114
- with:
115
- sdk-branch: ${{ steps.platform-branches.outputs.current-branch }}
116
- faucet-private-key: ${{ steps.start-local-network.outputs.faucet-private-key }}
117
- dpns-contract-id: ${{ steps.start-local-network.outputs.dpns-contract-id }}
118
- dpns-top-level-identity-id: ${{ steps.start-local-network.outputs.dpns-top-level-identity-id }}
119
- dpns-top-level-identity-private-key: ${{ steps.start-local-network.outputs.dpns-top-level-identity-private-key }}
120
- feature-flags-identity-id: ${{ steps.start-local-network.outputs.feature-flags-identity-id }}
121
- feature-flags-contract-id: ${{ steps.start-local-network.outputs.feature-flags-contract-id }}
122
- platform-test-suite-branch: ${{ steps.platform-branches.outputs.testsuite-branch }}
123
-
124
- - name: Show Docker logs
125
- if: ${{ failure() }}
126
- uses: jwalton/gh-docker-logs@v1
127
-
128
- release:
129
- name: Release NPM package
130
- runs-on: ubuntu-20.04
131
- needs: test
132
- if: ${{ github.event_name == 'release' }}
133
- steps:
134
- - uses: actions/checkout@v2
135
-
136
- - uses: actions/setup-node@v2
137
- with:
138
- node-version: '16'
139
-
140
- - name: Check package version matches tag
141
- uses: geritol/match-tag-to-package-version@0.1.0
142
- env:
143
- TAG_PREFIX: refs/tags/v
144
-
145
- - name: Enable NPM cache
146
- uses: actions/cache@v2
147
- with:
148
- path: '~/.npm'
149
- key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
150
- restore-keys: |
151
- ${{ runner.os }}-node-
152
-
153
- - name: Install NPM dependencies
154
- run: npm ci
155
-
156
- - name: Set release tag
157
- uses: actions/github-script@v3
158
- id: tag
159
- with:
160
- result-encoding: string
161
- script: |
162
- const tag = context.payload.release.tag_name;
163
- const [, major, minor] = tag.match(/^v([0-9]+)\.([0-9]+)/);
164
- return (tag.includes('dev') ? `${major}.${minor}-dev` : 'latest');
165
-
166
- - name: Publish NPM package
167
- uses: JS-DevTools/npm-publish@v1
168
- with:
169
- token: ${{ secrets.NPM_TOKEN }}
170
- tag: ${{ steps.tag.outputs.result }}