Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
09e74cd
Public exports in index.ts
teogeb Mar 2, 2021
8e0b2b8
Export parameter/return types for public methods
teogeb Mar 2, 2021
8622c98
string -> EthereumAddress
teogeb Mar 2, 2021
d53efc0
Remove obsolete config option
teogeb Mar 2, 2021
579b683
Merge branch '5.x' into export-public-types
teogeb Mar 3, 2021
d61902a
Strip internal methods/field from TS definitions
teogeb Mar 3, 2021
2e5d2fa
Merge branch '5.x' into export-public-types
teogeb Mar 3, 2021
988ceab
Update imports
teogeb Mar 3, 2021
b6edfb8
Re-add webpack export default CommonJS interop workaround.
timoxley Mar 3, 2021
1c4be12
Support for require('streamr-client') syntax
teogeb Mar 4, 2021
d7b872d
Explicit config for browser
teogeb Mar 4, 2021
84baf34
Revert "Explicit config for browser"
teogeb Mar 4, 2021
38a2c45
Use streamr-docker-dev-action@v1.0.0-alpha.3 over alpha.2 to get ifco…
timoxley Mar 4, 2021
de6fa52
Debug
teogeb Mar 5, 2021
074df02
Debug
teogeb Mar 5, 2021
c73e5c8
Debug
teogeb Mar 5, 2021
b42bc05
Debug
teogeb Mar 5, 2021
799ade1
Revert debugs
teogeb Mar 5, 2021
509e746
Use java8 to run streamr-client-testing
teogeb Mar 5, 2021
e5dc738
Debug: explicit config for browser
teogeb Mar 5, 2021
02caa7f
Drop support for require('streamr-client') -> use import instead
teogeb Mar 8, 2021
f2f08ed
Remove ErrorCode.ts
teogeb Mar 8, 2021
d4d9c6c
Export Todo type
teogeb Mar 8, 2021
f6d84cc
createStream doesn't require all StreamProperties
teogeb Mar 8, 2021
263dd12
export Stream.Field type
teogeb Mar 8, 2021
70ec4a4
Hide client.session
teogeb Mar 8, 2021
7674733
Simplify usage of StreamrClientOptions:
teogeb Mar 8, 2021
2076b90
Add tests around various client export/import methods.
timoxley Mar 8, 2021
ec1296a
Ignore test/exports/dist. Clean test/exports/dist before testing.
timoxley Mar 8, 2021
fb4401b
Fix benchmark script.
timoxley Mar 8, 2021
14b4687
Add comments, slightly reorganise test/exports.
timoxley Mar 8, 2021
2502787
Remove npm v7 lockfile version, regenerate using npm v6.
timoxley Mar 8, 2021
9c8a16f
Fixes for node v14. Just vendor quick-lru for now.
timoxley Mar 8, 2021
9cb560a
Fix vendor script.
timoxley Mar 9, 2021
28f80d7
Run vendor script before eslint.
timoxley Mar 9, 2021
d49657b
Include vendor in tsconfig.
timoxley Mar 9, 2021
c117e49
Remove vendor before build.
timoxley Mar 9, 2021
9e74d90
Fix npm link, fix vendor script.
timoxley Mar 9, 2021
ac087d5
Run vendor script after install.
timoxley Mar 9, 2021
f9c6d1a
Run test types after build in CI.
timoxley Mar 9, 2021
15ce740
Debug test-types failure.
timoxley Mar 9, 2021
8ad474a
Fix test-types failure.
timoxley Mar 9, 2021
769542e
Fix test-types failure.
timoxley Mar 9, 2021
26a3414
Vendoring package.json seems to break webpack or babel. Just exclude it.
timoxley Mar 9, 2021
03fe518
Fix vendor script.
timoxley Mar 9, 2021
88a5383
Fix vendor script.
timoxley Mar 9, 2021
5e22862
Update DU factory addresses (dev environment)
teogeb Mar 10, 2021
d5fd552
WIP: calculate code hash in JS
jtakalai Mar 10, 2021
320c763
Naming
teogeb Mar 10, 2021
792799e
Configure dev environment values for dataUnionTemplateMainnetAddress …
teogeb Mar 10, 2021
68164dd
List DU addresses
teogeb Mar 10, 2021
0af8a42
Consistent naming for DU address configs
teogeb Mar 10, 2021
1c2c29a
Fix eslint
teogeb Mar 10, 2021
01dfee4
DU production config
teogeb Mar 10, 2021
daae35d
Naming
teogeb Mar 10, 2021
def765f
Fix eslint
teogeb Mar 10, 2021
2b49d52
Don't fail vendor script if quick-lru file exists.
timoxley Mar 10, 2021
cf31462
Don't fail vendor script if quick-lru file exists.
timoxley Mar 10, 2021
263d733
Merge dataUnion client options
teogeb Mar 10, 2021
b022f84
Modify getSidechainAmb() to be compatible with the new DU contract (t…
teogeb Mar 10, 2021
4c36d40
payForSignatureTransport -> freeWithdraw and reversed the boolean
teogeb Mar 11, 2021
90a3adb
All dataUnion parameters are optional in StreamrClientOptions
teogeb Mar 11, 2021
e990e56
Remove scripts from package.json when copying it into dist.
timoxley Mar 11, 2021
0603dd9
Fix error messages
teogeb Mar 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = {
plugins: [
"add-module-exports",
['@babel/plugin-transform-runtime', {
corejs: false,
corejs: 3,
helpers: true,
regenerator: false
}],
Expand Down
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ test/legacy/**
src/shim/**
test/unit/StubbedStreamrClient.js
streamr-docker-dev/**
vendor/**
test/exports/**
37 changes: 29 additions & 8 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ jobs:
run: npm ci
- name: npm run eslint
run: npm run eslint
- name: test-types
run: npm run test-types

test:
name: Test Unit using Node ${{ matrix.node-version }}
Expand Down Expand Up @@ -107,7 +105,7 @@ jobs:
- name: npm ci
run: npm ci
- name: Start Streamr Docker Stack
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.2
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.3
with:
services-to-start: "mysql redis engine-and-editor cassandra parity-node0 parity-sidechain-node0 bridge broker-node-storage-1 nginx smtp"
- name: Run Test
Expand All @@ -129,7 +127,7 @@ jobs:
- name: npm ci
run: npm ci
- name: Start Streamr Docker Stack
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.2
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.3
with:
services-to-start: "mysql redis engine-and-editor cassandra parity-node0 parity-sidechain-node0 bridge broker-node-storage-1 nginx smtp"
- uses: nick-invision/retry@v2
Expand All @@ -140,6 +138,26 @@ jobs:
retry_on: error
command: npm run test-flakey || echo "::warning::Flakey Tests Failed"

test-exports:
name: Test Exports using Node 14.x
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14.x"
- uses: actions/download-artifact@v2
with:
name: build
path: dist
- name: npm ci
run: npm ci
- name: test-types
run: npm run test-types
- name: npm run test-exports
run: npm run test-exports

browser:
name: Test Browser using Node 14.x
runs-on: ubuntu-latest
Expand All @@ -156,7 +174,7 @@ jobs:
- name: npm ci
run: npm ci
- name: Start Streamr Docker Stack
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.2
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.3
with:
services-to-start: "mysql redis engine-and-editor cassandra parity-node0 parity-sidechain-node0 bridge broker-node-storage-1 nginx smtp"

Expand Down Expand Up @@ -186,7 +204,7 @@ jobs:
name: build
path: dist
- name: Start Streamr Docker Stack
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.2
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.3
with:
services-to-start: "mysql redis engine-and-editor cassandra parity-node0 parity-sidechain-node0 bridge broker-node-storage-1 nginx smtp"
- name: npm ci
Expand Down Expand Up @@ -233,17 +251,20 @@ jobs:
name: build
path: dist
- name: Start Streamr Docker Stack
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.2
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.3
with:
services-to-start: "mysql redis engine-and-editor cassandra parity-node0 parity-sidechain-node0 bridge broker-node-storage-1 nginx smtp"
- name: npm ci
run: npm ci
- name: npm link
run: npm link
run: cd dist && npm link
- uses: actions/checkout@v2
with:
repository: streamr-dev/streamr-client-testing
path: streamr-client-testing
- uses: actions/setup-java@v1
with:
java-version: '8'
- name: setup-client-testing
working-directory: streamr-client-testing
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ examples/webpack/dist/*
reports
tests_outputbenchmarks.txt
tests_output
test/exports/dist
test/exports/package-lock.json
vendor
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ const client = new StreamrClient({
})
```

When using Node.js remember to require the library with:
When using Node.js remember to import the library with:

```js
const StreamrClient = require('streamr-client')
import { StreamrClient } from 'streamr-client';
```

### Subscribing to real-time events in a stream
Expand Down Expand Up @@ -329,11 +329,15 @@ This library provides functions for working with Data Unions. To get a DataUnion
TODO: All `options`-parameters should be documented (see TypeScript interfaces for the definitions)

These DataUnion-specific options are used from `StreamrClient` options:
| Property | Default | Description |
| :----------------------- | :----------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------- |
| tokenAddress | 0x0Cf0Ee637<br>88A0849fE52<br>97F3407f701<br>E122cC023 | Token used by the DU |
| factoryMainnetAddress | TODO | Data Union factory that creates a new Data Union |
| minimumWithdrawTokenWei | 1000000 | Threshold value set in AMB configs, smallest token amount that can pass over the bridge |
| Property | Default | Description |
| :---------------------------------- | :----------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------- |
| tokenAddress | 0x0Cf0Ee637<br>88A0849fE52<br>97F3407f701<br>E122cC023 | Token used by the DU |
| dataUnion.minimumWithdrawTokenWei | 1000000 | Threshold value set in AMB configs, smallest token amount that can pass over the bridge |
| dataUnion.freeWithdraw | false | true = someone else pays for the gas when transporting the withdraw tx to mainnet; false = client does the transport as self-service and pays the mainnet gas costs |
| dataUnion.factoryMainnetAddress | TODO | Data Union factory that creates a new Data Union |
| dataUnion.factorySidechainAddress | TODO | |
| dataUnion.templateMainnetAddress | TODO | |
| dataUnion.templateSidechainAddress | TODO | |


### Admin Functions
Expand Down
15 changes: 15 additions & 0 deletions copy-package.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const fs = require('fs')
// eslint-disable-next-line
const pkg = Object.assign({}, require('./package.json'))

delete pkg.scripts

try {
fs.mkdirSync('./dist/')
} catch (err) {
if (err.code !== 'EEXIST') {
throw err
}
}

fs.writeFileSync('./dist/package.json', JSON.stringify(pkg, null, 2))
2 changes: 1 addition & 1 deletion examples/node/node-example-produce.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const StreamrClient = require('streamr-client')
import { StreamrClient } from 'streamr-client';

// Create the client and supply either an API key or an Ethereum private key to authenticate
const client = new StreamrClient({
Expand Down
2 changes: 1 addition & 1 deletion examples/node/node-example-subscribe.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const StreamrClient = require('streamr-client')
import { StreamrClient } from 'streamr-client';

// Create the client and supply either an API key or an Ethereum private key to authenticate
const client = new StreamrClient({
Expand Down
80 changes: 40 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading