diff --git a/.gitignore b/.gitignore index 3151ca8..1c34094 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ test/**/*.js src/**/*.js src/metadata\.json +.idea +.vscode \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index b6551f5..0671b46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,8 @@ matrix: before_install: - npm install -g npm - npm install -g codacy-coverage release-it greenkeeper-lockfile ganache-cli@~6.5.1 + - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + - chmod +x ./cc-test-reporter before_script: - greenkeeper-lockfile-update @@ -22,9 +24,9 @@ before_script: - git clone https://github.com/oceanprotocol/barge - cd barge - export AQUARIUS_VERSION=v1.0.5 - - export BRIZO_VERSION=v0.7.2 - - export KEEPER_VERSION=v0.12.7 - - export EVENTS_HANDLER_VERSION=v0.3.4 + - export BRIZO_VERSION=v0.8.1 + - export KEEPER_VERSION=v0.13.2 + - export EVENTS_HANDLER_VERSION=v0.4.4 - export KEEPER_OWNER_ROLE_ADDRESS="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260" - rm -rf "${HOME}/.ocean/keeper-contracts/artifacts" - bash -x start_ocean.sh --no-commons --no-dashboard 2>&1 > start_ocean.log & @@ -37,9 +39,13 @@ script: - npm run build - npm run doc - npm run integration:cover - - npm run report-coverage after_script: + - npm run report-codacy + - ./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.unit.json coverage/unit/lcov.info # Format unit test coverage + - ./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.integration.json coverage/integration/lcov.info # Format integration test coverage + - ./cc-test-reporter sum-coverage coverage/codeclimate.*.json -p 2 # Sum both coverage parts into coverage/codeclimate.json + - if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then ./cc-test-reporter upload-coverage; fi # Upload coverage/codeclimate.json - greenkeeper-lockfile-upload notifications: diff --git a/CHANGELOG.md b/CHANGELOG.md index 51a632f..eaff098 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v1.1.0](https://github.com/oceanprotocol/squid-js/compare/v1.1.0-beta.0...v1.1.0) + +> 22 January 2020 + +- add codeclimate coverage reporting [`#359`](https://github.com/oceanprotocol/squid-js/pull/359) +- Update to keeper-contracts v0.13 [`#344`](https://github.com/oceanprotocol/squid-js/pull/344) +- Greenkeeper/typedoc 0.16.5 [`#356`](https://github.com/oceanprotocol/squid-js/pull/356) +- Update whatwg-url to the latest version 🚀 [`#349`](https://github.com/oceanprotocol/squid-js/pull/349) +- Update @types/node to the latest version 🚀 [`#348`](https://github.com/oceanprotocol/squid-js/pull/348) +- Update nyc to the latest version 🚀 [`#347`](https://github.com/oceanprotocol/squid-js/pull/347) +- chore(package): update typedoc to version 0.16.5 [`#352`](https://github.com/oceanprotocol/squid-js/issues/352) +- Fix tests. [`48c4f64`](https://github.com/oceanprotocol/squid-js/commit/48c4f6459910069c79424ac67fc6a0d28a9d1839) +- Remove all .js files that were unintentionally committed. [`7ccac88`](https://github.com/oceanprotocol/squid-js/commit/7ccac889ed20b9dabe9358e4e4989eed55245d52) +- package updates [`216ae33`](https://github.com/oceanprotocol/squid-js/commit/216ae3330e3ffa147ca0d8417a901fa9f5a0d4cf) + +#### [v1.1.0-beta.0](https://github.com/oceanprotocol/squid-js/compare/v1.0.0...v1.1.0-beta.0) + +> 17 December 2019 + +- package updates [`eb23b04`](https://github.com/oceanprotocol/squid-js/commit/eb23b04ffec69a0f9f31f09985bc1012f3a386d2) +- Release 1.1.0-beta.0 [`86c6a5a`](https://github.com/oceanprotocol/squid-js/commit/86c6a5a176203b222f2dc1f215c0c5fa6a418728) +- bump to keeper-contracts v0.13.0 [`21a0815`](https://github.com/oceanprotocol/squid-js/commit/21a08152d2a33f73b9bfc6509ef19731904bbd9b) + #### [v1.0.0](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.7...v1.0.0) > 9 December 2019 @@ -11,7 +34,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - v2 release: new DDO [`#328`](https://github.com/oceanprotocol/squid-js/pull/328) - package updates [`ccf7250`](https://github.com/oceanprotocol/squid-js/commit/ccf7250af87abf986d94c5023ac960fd155d0789) - lint fixes, bump Ocean components [`414c885`](https://github.com/oceanprotocol/squid-js/commit/414c885163325a69eb315b20f8fe3837bc557656) -- typos [`d6a233e`](https://github.com/oceanprotocol/squid-js/commit/d6a233e590631087ba1302ac44f1e597b512c34e) +- Release 1.0.0 [`df53099`](https://github.com/oceanprotocol/squid-js/commit/df530992a1e578ecb4459d54d2669972479ccb5b) #### [v1.0.0-beta.7](https://github.com/oceanprotocol/squid-js/compare/v0.8.3...v1.0.0-beta.7) diff --git a/README.md b/README.md index a038cd9..ccb053e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,8 @@ [![npm](https://img.shields.io/npm/v/@oceanprotocol/squid.svg)](https://www.npmjs.com/package/@oceanprotocol/squid) [![Travis (.com)](https://img.shields.io/travis/com/oceanprotocol/squid-js.svg)](https://travis-ci.com/oceanprotocol/squid-js) [![GitHub contributors](https://img.shields.io/github/contributors/oceanprotocol/squid-js.svg)](https://github.com/oceanprotocol/squid-js/graphs/contributors) -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/8508313231b44b0997ec84898cd6f9db)](https://app.codacy.com/app/ocean-protocol/squid-js?utm_source=github.com&utm_medium=referral&utm_content=oceanprotocol/squid-js&utm_campaign=Badge_Grade_Settings) +[![Maintainability](https://api.codeclimate.com/v1/badges/ff173cf1c7adc6b21ae5/maintainability)](https://codeclimate.com/github/oceanprotocol/squid-js/maintainability) +[![Test Coverage](https://api.codeclimate.com/v1/badges/ff173cf1c7adc6b21ae5/test_coverage)](https://codeclimate.com/github/oceanprotocol/squid-js/test_coverage) [![js oceanprotocol](https://img.shields.io/badge/js-oceanprotocol-7b1173.svg)](https://github.com/oceanprotocol/eslint-config-oceanprotocol) [![Greenkeeper badge](https://badges.greenkeeper.io/oceanprotocol/squid-js.svg)](https://greenkeeper.io/) @@ -72,6 +73,19 @@ const ocean: Ocean = await Ocean.getInstance({ For an overview of endpoint configurations making up various Ocean networks, please refer to [`.env.local.example`](https://github.com/oceanprotocol/commons/blob/master/client/.env.local.example) from commons. +Optionally, you can initialize an Aquarius connection without relying on the rest of Ocean to be loaded. This is useful for outputting asset metadata stored in Aquarius without the need to configure Web3 and all other Ocean Protocol network connections. + +```js +import { Ocean, Aquarius, Logger } from 'squid' + +const aquarius = new Aquarius('http://localhost:5000', Logger) +const asset = aquarius.retrieveDDO('did:op:e6fda48e8d814d5d9655645aac3c046cc87528dbc1a9449799e579d7b83d1360') + +const ocean = await Ocean.getInstance({ ... }) +// Aquarius will still be available under ocean.aquarius, just later +const asset = ocean.aquarius.retrieveDDO('did:op:e6fda48e8d814d5d9655645aac3c046cc87528dbc1a9449799e579d7b83d1360') +``` + ### Examples You can see how `squid-js` is used on: @@ -160,6 +174,8 @@ export SEED_WORDS="taxi music thumb unique chat sand crew more leg another off l Once everything is up, run the integration tests: ```bash +# integration tests work with the spree network and the SEED_WORDS in previous step are required. +# Make sure to reset `ETH_PORT` to 8545 (or whatever port is used in `spree1) npm run integration ``` diff --git a/integration/config.ts b/integration/config.ts index c3fa6c3..3d2bd3d 100644 --- a/integration/config.ts +++ b/integration/config.ts @@ -6,7 +6,7 @@ const configJson: Config = { aquariusUri: 'http://aquarius:5000', brizoUri: 'http://localhost:8030', secretStoreUri: 'http://localhost:12001', - brizoAddress: '0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0', + brizoAddress: '0x068Ed00cF0441e4829D9784fCBe7b9e26D4BD8d0', verbose: false } diff --git a/integration/ocean/ConsumeAsset.test.ts b/integration/ocean/ConsumeAsset.test.ts index 58e60cf..9e4c679 100644 --- a/integration/ocean/ConsumeAsset.test.ts +++ b/integration/ocean/ConsumeAsset.test.ts @@ -90,13 +90,17 @@ describe('Consume Asset', () => { accessService.index, serviceAgreementSignatureResult.signature, consumer, - publisher + config.brizoAddress, + consumer ) assert.isTrue(success) }) it('should get the agreement conditions status not fulfilled', async () => { + // Wait for the agreement event + // await ocean.keeper.agreementStoreManager + // .getAgreementCreatedEvent(serviceAgreementSignatureResult.agreementId).once() const status = await ocean.agreements.status( serviceAgreementSignatureResult.agreementId ) diff --git a/integration/ocean/ConsumeAssetBrizo.test.ts b/integration/ocean/ConsumeAssetBrizo.test.ts index 4459f1b..53c5924 100644 --- a/integration/ocean/ConsumeAssetBrizo.test.ts +++ b/integration/ocean/ConsumeAssetBrizo.test.ts @@ -39,7 +39,7 @@ describe('Consume Asset (Brizo)', () => { await consumer.authenticate() }) - it('should regiester an asset', async () => { + it('should register an asset', async () => { const steps = [] ddo = await ocean.assets .create(metadata as any, publisher) diff --git a/integration/ocean/ConsumeBigAsset.test.ts b/integration/ocean/ConsumeBigAsset.test.ts index ca2223f..b1d1f22 100644 --- a/integration/ocean/ConsumeBigAsset.test.ts +++ b/integration/ocean/ConsumeBigAsset.test.ts @@ -43,7 +43,7 @@ xdescribe('Consume Asset (Large size)', () => { } }) - it('should regiester an asset', async () => { + it('should register an asset', async () => { ddo = await ocean.assets.create(metadata as any, publisher) assert.instanceOf(ddo, DDO) diff --git a/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts b/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts index 0dd54c8..acb56f4 100644 --- a/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts +++ b/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts @@ -48,7 +48,7 @@ describe('Register Escrow Access Secret Store Template', () => { describe('Propose and approve template', () => { it('should propose the template', async () => { await keeper.templateStoreManager.proposeTemplate( - template.getAddress(), + template.getId(), consumer.getId(), true ) @@ -58,7 +58,7 @@ describe('Register Escrow Access Secret Store Template', () => { it('should approve the template', async () => { await keeper.templateStoreManager.approveTemplate( - template.getAddress(), + template.getId(), templateManagerOwner.getId(), true ) @@ -122,7 +122,9 @@ describe('Register Escrow Access Secret Store Template', () => { }) it('should have condition instances asociated', async () => { - const conditionInstances = await template.getConditions() + const conditionInstances = (await template.getConditionTypes()).map(address => + keeper.getConditionByAddress(address) + ) assert.equal(conditionInstances.length, 3, 'Expected 3 conditions.') @@ -145,14 +147,15 @@ describe('Register Escrow Access Secret Store Template', () => { }) it('should create a new agreement', async () => { - const agreement = await template.createAgreement( + const agreement = await keeper.agreementStoreManager.createAgreement( agreementId, did, - [conditionIdAccess, conditionIdLock, conditionIdEscrow], + template.getId(), + [conditionIdLock, conditionIdAccess, conditionIdEscrow], [0, 0, 0], [0, 0, 0], - consumer.getId(), - publisher.getId() + [consumer.getId(), config.brizoAddress], + consumer.getId() ) assert.isTrue(agreement.status) @@ -244,7 +247,8 @@ describe('Register Escrow Access Secret Store Template', () => { did, escrowAmount, consumer.getId(), - publisher.getId() + config.brizoAddress, + consumer.getId() ) assert.match(agreementId, /^0x[a-f0-9]{64}$/i) diff --git a/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts b/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts index f885d53..7f476fa 100644 --- a/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts +++ b/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts @@ -48,7 +48,7 @@ describe('Register Escrow Compute Execution Template', () => { describe('Propose and approve template', () => { it('should propose the template', async () => { await keeper.templateStoreManager.proposeTemplate( - template.getAddress(), + template.getId(), consumer.getId(), true ) @@ -58,7 +58,7 @@ describe('Register Escrow Compute Execution Template', () => { it('should approve the template', async () => { await keeper.templateStoreManager.approveTemplate( - template.getAddress(), + template.getId(), templateManagerOwner.getId(), true ) @@ -145,14 +145,15 @@ describe('Register Escrow Compute Execution Template', () => { }) it('should create a new agreement', async () => { - const agreement = await template.createAgreement( + const agreement = await keeper.agreementStoreManager.createAgreement( agreementId, did, - [conditionIdCompute, conditionIdLock, conditionIdEscrow], + template.getId(), + [conditionIdLock, conditionIdCompute, conditionIdEscrow], [0, 0, 0], [0, 0, 0], - consumer.getId(), - publisher.getId() + [consumer.getId(), config.brizoAddress], + consumer.getId() ) assert.isTrue(agreement.status) @@ -244,7 +245,8 @@ describe('Register Escrow Compute Execution Template', () => { did, escrowAmount, consumer.getId(), - publisher.getId() + config.brizoAddress, + consumer.getId() ) assert.match(agreementId, /^0x[a-f0-9]{64}$/i) diff --git a/integration/ocean/Signature.test.ts b/integration/ocean/Signature.test.ts index a67fe1b..44828f9 100644 --- a/integration/ocean/Signature.test.ts +++ b/integration/ocean/Signature.test.ts @@ -18,7 +18,7 @@ describe('Signature', () => { }) it('hashServiceAgreement should generate the correct signature', () => { - const templateId = `0x${'f'.repeat(40)}` + const templateId = `0x${'f'.repeat(64)}` const agreementId = `0x${'e'.repeat(64)}` const accessId = `0x${'a'.repeat(64)}` @@ -28,14 +28,14 @@ describe('Signature', () => { const hash = ocean.utils.agreements.hashServiceAgreement( templateId, agreementId, - [accessId, lockId, escrowId], + [lockId, accessId, escrowId], [0, 0, 0], [0, 0, 0] ) assert.equal( hash, - '0x67901517c18a3d23e05806fff7f04235cc8ae3b1f82345b8bfb3e4b02b5800c7', + '0x464dac3b79a47f8acad54f67a0f4473249330f025c69687531e58c2e43b36437', 'The signature is not correct.' ) }) @@ -44,7 +44,7 @@ describe('Signature', () => { const { templates } = ocean.keeper const did = `did:op:${'c'.repeat(64)}` - const templateId = `0x${'f'.repeat(40)}` + const templateId = `0x${'f'.repeat(64)}` const agreementId = `0x${'e'.repeat(64)}` const serviceAgreementTemplate = await templates.escrowAccessSecretStoreTemplate.getServiceAgreementTemplate() @@ -84,7 +84,7 @@ describe('Signature', () => { assert.equal( signature, - '0x3aa8a1c48b8e582d694bbd4ba3a29fde573b78da9720dc48baeb831b2163e1fa6e10e983882ebf8a00f4124de2505136354fd146934053f0d58bba4eced5f8d01b', + '0xa04568fccdda7e1594e3e615f8d71b14733705aabe5294af0b7f46f0aedb9d5906a2caa6142ee4de10534a47c5a7083b21b2d3e9a96ac462bc0b9d25070e981e1c', 'The signature is not correct.' ) }) diff --git a/library.json b/library.json index 1c35b85..9d0cb91 100644 --- a/library.json +++ b/library.json @@ -7,11 +7,11 @@ "dependencies": [ { "name": "keeper-contracts", - "version": "~0.12.7" + "version": "~0.13.2" }, { "name": "brizo", - "version": "~0.7.2" + "version": "~0.8.1" }, { "name": "aquarius", @@ -19,7 +19,7 @@ }, { "name": "events-handler", - "version": "~0.3.4" + "version": "~0.4.1" } ] } diff --git a/package-lock.json b/package-lock.json index 8699b2d..9caf7e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -287,9 +287,9 @@ } }, "@oceanprotocol/keeper-contracts": { - "version": "0.12.7", - "resolved": "https://registry.npmjs.org/@oceanprotocol/keeper-contracts/-/keeper-contracts-0.12.7.tgz", - "integrity": "sha512-7EUBO3iAkm78VnQHCp5pCrjZ4EQ0omg/bsWo2uiUO6oW8L4bptqSolS2b19HA1zb/ZsmJuW6e6JerPMRtQtqEg==" + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@oceanprotocol/keeper-contracts/-/keeper-contracts-0.13.2.tgz", + "integrity": "sha512-915dcnzCHEuvsmRKqVj0RxHT3T386lSJh8WREe4dsnrXHsi1ULNYxX0Ts/cvalv6bRL+aqyaZ6gN3l3nkfwEDg==" }, "@oceanprotocol/secret-store-client": { "version": "0.0.15", @@ -393,19 +393,12 @@ "defer-to-connect": "^1.0.1" } }, - "@truffle/error": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.8.tgz", - "integrity": "sha512-x55rtRuNfRO1azmZ30iR0pf0OJ6flQqbax1hJz+Avk1K5fdmOv5cr22s9qFnwTWnS6Bw0jvJEoR0ITsM7cPKtQ==", - "dev": true - }, "@truffle/hdwallet-provider": { - "version": "1.0.26", - "resolved": "https://registry.npmjs.org/@truffle/hdwallet-provider/-/hdwallet-provider-1.0.26.tgz", - "integrity": "sha512-ITEUOwT8o8FZmnAiZtFLHhTLFOlT5q/DIh9QzV+gG0GocqIY6D2CSLkhaqTn89xCGVftQfyQAFBqXfGRblNQKw==", + "version": "1.0.27", + "resolved": "https://registry.npmjs.org/@truffle/hdwallet-provider/-/hdwallet-provider-1.0.27.tgz", + "integrity": "sha512-Zj9evxhpTgWQu3XHiX6jBnINI52zT8MN5RhIKrcZCwabvCstrCiPMq0wDOuYxUVYfIeo5QvPz59O2zc5i7GFMw==", "dev": true, "requires": { - "@truffle/provider": "^0.2.3", "any-promise": "^1.3.0", "bindings": "^1.5.0", "bip39": "^2.4.2", @@ -413,7 +406,7 @@ "ethereumjs-tx": "^1.0.0", "ethereumjs-util": "^6.1.0", "ethereumjs-wallet": "^0.6.3", - "web3": "1.2.2", + "web3": "1.2.1", "web3-provider-engine": "git+https://github.com/trufflesuite/provider-engine.git#web3-one" }, "dependencies": { @@ -467,761 +460,12 @@ "safe-buffer": "^5.1.0" } }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "semver": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz", + "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==", "dev": true }, - "web3": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.2.tgz", - "integrity": "sha512-/ChbmB6qZpfGx6eNpczt5YSUBHEA5V2+iUCbn85EVb3Zv6FVxrOo5Tv7Lw0gE2tW7EEjASbCyp3mZeiZaCCngg==", - "dev": true, - "requires": { - "web3-bzz": "1.2.2", - "web3-core": "1.2.2", - "web3-eth": "1.2.2", - "web3-eth-personal": "1.2.2", - "web3-net": "1.2.2", - "web3-shh": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-bzz": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.2.tgz", - "integrity": "sha512-b1O2ObsqUN1lJxmFSjvnEC4TsaCbmh7Owj3IAIWTKqL9qhVgx7Qsu5O9cD13pBiSPNZJ68uJPaKq380QB4NWeA==", - "dev": true, - "requires": { - "@types/node": "^10.12.18", - "got": "9.6.0", - "swarm-js": "0.1.39", - "underscore": "1.9.1" - }, - "dependencies": { - "@types/node": { - "version": "10.17.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.6.tgz", - "integrity": "sha512-0a2X6cgN3RdPBL2MIlR6Lt0KlM7fOFsutuXcdglcOq6WvLnYXgPQSh0Mx6tO1KCAE8MxbHSOSTWDoUxRq+l3DA==", - "dev": true - } - } - }, - "web3-core": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.2.tgz", - "integrity": "sha512-miHAX3qUgxV+KYfaOY93Hlc3kLW2j5fH8FJy6kSxAv+d4d5aH0wwrU2IIoJylQdT+FeenQ38sgsCnFu9iZ1hCQ==", - "dev": true, - "requires": { - "@types/bn.js": "^4.11.4", - "web3-core-helpers": "1.2.2", - "web3-core-method": "1.2.2", - "web3-core-requestmanager": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-core-helpers": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.2.tgz", - "integrity": "sha512-HJrRsIGgZa1jGUIhvGz4S5Yh6wtOIo/TMIsSLe+Xay+KVnbseJpPprDI5W3s7H2ODhMQTbogmmUFquZweW2ImQ==", - "dev": true, - "requires": { - "underscore": "1.9.1", - "web3-eth-iban": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-core-method": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.2.tgz", - "integrity": "sha512-szR4fDSBxNHaF1DFqE+j6sFR/afv9Aa36OW93saHZnrh+iXSrYeUUDfugeNcRlugEKeUCkd4CZylfgbK2SKYJA==", - "dev": true, - "requires": { - "underscore": "1.9.1", - "web3-core-helpers": "1.2.2", - "web3-core-promievent": "1.2.2", - "web3-core-subscriptions": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-core-promievent": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.2.tgz", - "integrity": "sha512-tKvYeT8bkUfKABcQswK6/X79blKTKYGk949urZKcLvLDEaWrM3uuzDwdQT3BNKzQ3vIvTggFPX9BwYh0F1WwqQ==", - "dev": true, - "requires": { - "any-promise": "1.3.0", - "eventemitter3": "3.1.2" - } - }, - "web3-core-requestmanager": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.2.tgz", - "integrity": "sha512-a+gSbiBRHtHvkp78U2bsntMGYGF2eCb6219aMufuZWeAZGXJ63Wc2321PCbA8hF9cQrZI4EoZ4kVLRI4OF15Hw==", - "dev": true, - "requires": { - "underscore": "1.9.1", - "web3-core-helpers": "1.2.2", - "web3-providers-http": "1.2.2", - "web3-providers-ipc": "1.2.2", - "web3-providers-ws": "1.2.2" - } - }, - "web3-core-subscriptions": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.2.tgz", - "integrity": "sha512-QbTgigNuT4eicAWWr7ahVpJyM8GbICsR1Ys9mJqzBEwpqS+RXTRVSkwZ2IsxO+iqv6liMNwGregbJLq4urMFcQ==", - "dev": true, - "requires": { - "eventemitter3": "3.1.2", - "underscore": "1.9.1", - "web3-core-helpers": "1.2.2" - } - }, - "web3-eth": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.2.tgz", - "integrity": "sha512-UXpC74mBQvZzd4b+baD4Ocp7g+BlwxhBHumy9seyE/LMIcMlePXwCKzxve9yReNpjaU16Mmyya6ZYlyiKKV8UA==", - "dev": true, - "requires": { - "underscore": "1.9.1", - "web3-core": "1.2.2", - "web3-core-helpers": "1.2.2", - "web3-core-method": "1.2.2", - "web3-core-subscriptions": "1.2.2", - "web3-eth-abi": "1.2.2", - "web3-eth-accounts": "1.2.2", - "web3-eth-contract": "1.2.2", - "web3-eth-ens": "1.2.2", - "web3-eth-iban": "1.2.2", - "web3-eth-personal": "1.2.2", - "web3-net": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-eth-abi": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.2.tgz", - "integrity": "sha512-Yn/ZMgoOLxhTVxIYtPJ0eS6pnAnkTAaJgUJh1JhZS4ekzgswMfEYXOwpMaD5eiqPJLpuxmZFnXnBZlnQ1JMXsw==", - "dev": true, - "requires": { - "ethers": "4.0.0-beta.3", - "underscore": "1.9.1", - "web3-utils": "1.2.2" - } - }, - "web3-eth-accounts": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.2.tgz", - "integrity": "sha512-KzHOEyXOEZ13ZOkWN3skZKqSo5f4Z1ogPFNn9uZbKCz+kSp+gCAEKxyfbOsB/JMAp5h7o7pb6eYsPCUBJmFFiA==", - "dev": true, - "requires": { - "any-promise": "1.3.0", - "crypto-browserify": "3.12.0", - "eth-lib": "0.2.7", - "ethereumjs-common": "^1.3.2", - "ethereumjs-tx": "^2.1.1", - "scrypt-shim": "github:web3-js/scrypt-shim", - "underscore": "1.9.1", - "uuid": "3.3.2", - "web3-core": "1.2.2", - "web3-core-helpers": "1.2.2", - "web3-core-method": "1.2.2", - "web3-utils": "1.2.2" - }, - "dependencies": { - "ethereumjs-tx": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.1.tgz", - "integrity": "sha512-QtVriNqowCFA19X9BCRPMgdVNJ0/gMBS91TQb1DfrhsbR748g4STwxZptFAwfqehMyrF8rDwB23w87PQwru0wA==", - "dev": true, - "requires": { - "ethereumjs-common": "^1.3.1", - "ethereumjs-util": "^6.0.0" - } - } - } - }, - "web3-eth-contract": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.2.tgz", - "integrity": "sha512-EKT2yVFws3FEdotDQoNsXTYL798+ogJqR2//CaGwx3p0/RvQIgfzEwp8nbgA6dMxCsn9KOQi7OtklzpnJMkjtA==", - "dev": true, - "requires": { - "@types/bn.js": "^4.11.4", - "underscore": "1.9.1", - "web3-core": "1.2.2", - "web3-core-helpers": "1.2.2", - "web3-core-method": "1.2.2", - "web3-core-promievent": "1.2.2", - "web3-core-subscriptions": "1.2.2", - "web3-eth-abi": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-eth-ens": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.2.tgz", - "integrity": "sha512-CFjkr2HnuyMoMFBoNUWojyguD4Ef+NkyovcnUc/iAb9GP4LHohKrODG4pl76R5u61TkJGobC2ij6TyibtsyVYg==", - "dev": true, - "requires": { - "eth-ens-namehash": "2.0.8", - "underscore": "1.9.1", - "web3-core": "1.2.2", - "web3-core-helpers": "1.2.2", - "web3-core-promievent": "1.2.2", - "web3-eth-abi": "1.2.2", - "web3-eth-contract": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-eth-iban": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.2.tgz", - "integrity": "sha512-gxKXBoUhaTFHr0vJB/5sd4i8ejF/7gIsbM/VvemHT3tF5smnmY6hcwSMmn7sl5Gs+83XVb/BngnnGkf+I/rsrQ==", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "web3-utils": "1.2.2" - } - }, - "web3-eth-personal": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.2.tgz", - "integrity": "sha512-4w+GLvTlFqW3+q4xDUXvCEMU7kRZ+xm/iJC8gm1Li1nXxwwFbs+Y+KBK6ZYtoN1qqAnHR+plYpIoVo27ixI5Rg==", - "dev": true, - "requires": { - "web3-core": "1.2.2", - "web3-core-helpers": "1.2.2", - "web3-core-method": "1.2.2", - "web3-net": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-net": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.2.tgz", - "integrity": "sha512-K07j2DXq0x4UOJgae65rWZKraOznhk8v5EGSTdFqASTx7vWE/m+NqBijBYGEsQY1lSMlVaAY9UEQlcXK5HzXTw==", - "dev": true, - "requires": { - "web3-core": "1.2.2", - "web3-core-method": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-providers-http": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.2.tgz", - "integrity": "sha512-BNZ7Hguy3eBszsarH5gqr9SIZNvqk9eKwqwmGH1LQS1FL3NdoOn7tgPPdddrXec4fL94CwgNk4rCU+OjjZRNDg==", - "dev": true, - "requires": { - "web3-core-helpers": "1.2.2", - "xhr2-cookies": "1.1.0" - } - }, - "web3-providers-ipc": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.2.tgz", - "integrity": "sha512-t97w3zi5Kn/LEWGA6D9qxoO0LBOG+lK2FjlEdCwDQatffB/+vYrzZ/CLYVQSoyFZAlsDoBasVoYSWZK1n39aHA==", - "dev": true, - "requires": { - "oboe": "2.1.4", - "underscore": "1.9.1", - "web3-core-helpers": "1.2.2" - } - }, - "web3-providers-ws": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.2.tgz", - "integrity": "sha512-Wb1mrWTGMTXOpJkL0yGvL/WYLt8fUIXx8k/l52QB2IiKzvyd42dTWn4+j8IKXGSYYzOm7NMqv6nhA5VDk12VfA==", - "dev": true, - "requires": { - "underscore": "1.9.1", - "web3-core-helpers": "1.2.2", - "websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis" - } - }, - "web3-shh": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.2.tgz", - "integrity": "sha512-og258NPhlBn8yYrDWjoWBBb6zo1OlBgoWGT+LL5/LPqRbjPe09hlOYHgscAAr9zZGtohTOty7RrxYw6Z6oDWCg==", - "dev": true, - "requires": { - "web3-core": "1.2.2", - "web3-core-method": "1.2.2", - "web3-core-subscriptions": "1.2.2", - "web3-net": "1.2.2" - } - }, - "web3-utils": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", - "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "eth-lib": "0.2.7", - "ethereum-bloom-filters": "^1.0.6", - "ethjs-unit": "0.1.6", - "number-to-bn": "1.7.0", - "randombytes": "^2.1.0", - "underscore": "1.9.1", - "utf8": "3.0.0" - } - } - } - }, - "@truffle/interface-adapter": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.4.0.tgz", - "integrity": "sha512-3xCL38jOByT/CN/Sar9Yx0q3xXRzEYpd28eQfI/nTZk/+T1m+aYU7C4Dv2JSnqgB3mjQd++2rRnMYjE2uxYg5w==", - "dev": true, - "requires": { - "bn.js": "^4.11.8", - "ethers": "^4.0.32", - "lodash": "^4.17.13", - "web3": "1.2.2" - }, - "dependencies": { - "elliptic": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", - "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", - "dev": true, - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - }, - "eth-lib": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", - "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", - "dev": true, - "requires": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" - } - }, - "ethers": { - "version": "4.0.40", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.40.tgz", - "integrity": "sha512-MC9BtV7Hpq4dgFONEfanx9aU9GhhoWU270F+/wegHZXA7FR+2KXFdt36YIQYLmVY5ykUWswDxd+f9EVkIa7JOA==", - "dev": true, - "requires": { - "aes-js": "3.0.0", - "bn.js": "^4.4.0", - "elliptic": "6.5.2", - "hash.js": "1.1.3", - "js-sha3": "0.5.7", - "scrypt-js": "2.0.4", - "setimmediate": "1.0.4", - "uuid": "2.0.1", - "xmlhttprequest": "1.8.0" - } - }, - "hash.js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.0" - } - }, - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", - "dev": true - }, - "scrypt-js": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", - "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==", - "dev": true - }, - "setimmediate": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", - "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=", - "dev": true - }, - "uuid": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", - "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", - "dev": true - }, - "web3": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.2.tgz", - "integrity": "sha512-/ChbmB6qZpfGx6eNpczt5YSUBHEA5V2+iUCbn85EVb3Zv6FVxrOo5Tv7Lw0gE2tW7EEjASbCyp3mZeiZaCCngg==", - "dev": true, - "requires": { - "web3-bzz": "1.2.2", - "web3-core": "1.2.2", - "web3-eth": "1.2.2", - "web3-eth-personal": "1.2.2", - "web3-net": "1.2.2", - "web3-shh": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-bzz": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.2.tgz", - "integrity": "sha512-b1O2ObsqUN1lJxmFSjvnEC4TsaCbmh7Owj3IAIWTKqL9qhVgx7Qsu5O9cD13pBiSPNZJ68uJPaKq380QB4NWeA==", - "dev": true, - "requires": { - "@types/node": "^10.12.18", - "got": "9.6.0", - "swarm-js": "0.1.39", - "underscore": "1.9.1" - }, - "dependencies": { - "@types/node": { - "version": "10.17.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.6.tgz", - "integrity": "sha512-0a2X6cgN3RdPBL2MIlR6Lt0KlM7fOFsutuXcdglcOq6WvLnYXgPQSh0Mx6tO1KCAE8MxbHSOSTWDoUxRq+l3DA==", - "dev": true - } - } - }, - "web3-core": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.2.tgz", - "integrity": "sha512-miHAX3qUgxV+KYfaOY93Hlc3kLW2j5fH8FJy6kSxAv+d4d5aH0wwrU2IIoJylQdT+FeenQ38sgsCnFu9iZ1hCQ==", - "dev": true, - "requires": { - "@types/bn.js": "^4.11.4", - "web3-core-helpers": "1.2.2", - "web3-core-method": "1.2.2", - "web3-core-requestmanager": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-core-helpers": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.2.tgz", - "integrity": "sha512-HJrRsIGgZa1jGUIhvGz4S5Yh6wtOIo/TMIsSLe+Xay+KVnbseJpPprDI5W3s7H2ODhMQTbogmmUFquZweW2ImQ==", - "dev": true, - "requires": { - "underscore": "1.9.1", - "web3-eth-iban": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-core-method": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.2.tgz", - "integrity": "sha512-szR4fDSBxNHaF1DFqE+j6sFR/afv9Aa36OW93saHZnrh+iXSrYeUUDfugeNcRlugEKeUCkd4CZylfgbK2SKYJA==", - "dev": true, - "requires": { - "underscore": "1.9.1", - "web3-core-helpers": "1.2.2", - "web3-core-promievent": "1.2.2", - "web3-core-subscriptions": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-core-promievent": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.2.tgz", - "integrity": "sha512-tKvYeT8bkUfKABcQswK6/X79blKTKYGk949urZKcLvLDEaWrM3uuzDwdQT3BNKzQ3vIvTggFPX9BwYh0F1WwqQ==", - "dev": true, - "requires": { - "any-promise": "1.3.0", - "eventemitter3": "3.1.2" - } - }, - "web3-core-requestmanager": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.2.tgz", - "integrity": "sha512-a+gSbiBRHtHvkp78U2bsntMGYGF2eCb6219aMufuZWeAZGXJ63Wc2321PCbA8hF9cQrZI4EoZ4kVLRI4OF15Hw==", - "dev": true, - "requires": { - "underscore": "1.9.1", - "web3-core-helpers": "1.2.2", - "web3-providers-http": "1.2.2", - "web3-providers-ipc": "1.2.2", - "web3-providers-ws": "1.2.2" - } - }, - "web3-core-subscriptions": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.2.tgz", - "integrity": "sha512-QbTgigNuT4eicAWWr7ahVpJyM8GbICsR1Ys9mJqzBEwpqS+RXTRVSkwZ2IsxO+iqv6liMNwGregbJLq4urMFcQ==", - "dev": true, - "requires": { - "eventemitter3": "3.1.2", - "underscore": "1.9.1", - "web3-core-helpers": "1.2.2" - } - }, - "web3-eth": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.2.tgz", - "integrity": "sha512-UXpC74mBQvZzd4b+baD4Ocp7g+BlwxhBHumy9seyE/LMIcMlePXwCKzxve9yReNpjaU16Mmyya6ZYlyiKKV8UA==", - "dev": true, - "requires": { - "underscore": "1.9.1", - "web3-core": "1.2.2", - "web3-core-helpers": "1.2.2", - "web3-core-method": "1.2.2", - "web3-core-subscriptions": "1.2.2", - "web3-eth-abi": "1.2.2", - "web3-eth-accounts": "1.2.2", - "web3-eth-contract": "1.2.2", - "web3-eth-ens": "1.2.2", - "web3-eth-iban": "1.2.2", - "web3-eth-personal": "1.2.2", - "web3-net": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-eth-abi": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.2.tgz", - "integrity": "sha512-Yn/ZMgoOLxhTVxIYtPJ0eS6pnAnkTAaJgUJh1JhZS4ekzgswMfEYXOwpMaD5eiqPJLpuxmZFnXnBZlnQ1JMXsw==", - "dev": true, - "requires": { - "ethers": "4.0.0-beta.3", - "underscore": "1.9.1", - "web3-utils": "1.2.2" - }, - "dependencies": { - "@types/node": { - "version": "10.17.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.6.tgz", - "integrity": "sha512-0a2X6cgN3RdPBL2MIlR6Lt0KlM7fOFsutuXcdglcOq6WvLnYXgPQSh0Mx6tO1KCAE8MxbHSOSTWDoUxRq+l3DA==", - "dev": true - }, - "elliptic": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", - "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", - "dev": true, - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "inherits": "^2.0.1" - } - }, - "ethers": { - "version": "4.0.0-beta.3", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.3.tgz", - "integrity": "sha512-YYPogooSknTwvHg3+Mv71gM/3Wcrx+ZpCzarBj3mqs9njjRkrOo2/eufzhHloOCo3JSoNI4TQJJ6yU5ABm3Uog==", - "dev": true, - "requires": { - "@types/node": "^10.3.2", - "aes-js": "3.0.0", - "bn.js": "^4.4.0", - "elliptic": "6.3.3", - "hash.js": "1.1.3", - "js-sha3": "0.5.7", - "scrypt-js": "2.0.3", - "setimmediate": "1.0.4", - "uuid": "2.0.1", - "xmlhttprequest": "1.8.0" - } - }, - "scrypt-js": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", - "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=", - "dev": true - } - } - }, - "web3-eth-accounts": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.2.tgz", - "integrity": "sha512-KzHOEyXOEZ13ZOkWN3skZKqSo5f4Z1ogPFNn9uZbKCz+kSp+gCAEKxyfbOsB/JMAp5h7o7pb6eYsPCUBJmFFiA==", - "dev": true, - "requires": { - "any-promise": "1.3.0", - "crypto-browserify": "3.12.0", - "eth-lib": "0.2.7", - "ethereumjs-common": "^1.3.2", - "ethereumjs-tx": "^2.1.1", - "scrypt-shim": "github:web3-js/scrypt-shim", - "underscore": "1.9.1", - "uuid": "3.3.2", - "web3-core": "1.2.2", - "web3-core-helpers": "1.2.2", - "web3-core-method": "1.2.2", - "web3-utils": "1.2.2" - }, - "dependencies": { - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", - "dev": true - } - } - }, - "web3-eth-contract": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.2.tgz", - "integrity": "sha512-EKT2yVFws3FEdotDQoNsXTYL798+ogJqR2//CaGwx3p0/RvQIgfzEwp8nbgA6dMxCsn9KOQi7OtklzpnJMkjtA==", - "dev": true, - "requires": { - "@types/bn.js": "^4.11.4", - "underscore": "1.9.1", - "web3-core": "1.2.2", - "web3-core-helpers": "1.2.2", - "web3-core-method": "1.2.2", - "web3-core-promievent": "1.2.2", - "web3-core-subscriptions": "1.2.2", - "web3-eth-abi": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-eth-ens": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.2.tgz", - "integrity": "sha512-CFjkr2HnuyMoMFBoNUWojyguD4Ef+NkyovcnUc/iAb9GP4LHohKrODG4pl76R5u61TkJGobC2ij6TyibtsyVYg==", - "dev": true, - "requires": { - "eth-ens-namehash": "2.0.8", - "underscore": "1.9.1", - "web3-core": "1.2.2", - "web3-core-helpers": "1.2.2", - "web3-core-promievent": "1.2.2", - "web3-eth-abi": "1.2.2", - "web3-eth-contract": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-eth-iban": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.2.tgz", - "integrity": "sha512-gxKXBoUhaTFHr0vJB/5sd4i8ejF/7gIsbM/VvemHT3tF5smnmY6hcwSMmn7sl5Gs+83XVb/BngnnGkf+I/rsrQ==", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "web3-utils": "1.2.2" - } - }, - "web3-eth-personal": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.2.tgz", - "integrity": "sha512-4w+GLvTlFqW3+q4xDUXvCEMU7kRZ+xm/iJC8gm1Li1nXxwwFbs+Y+KBK6ZYtoN1qqAnHR+plYpIoVo27ixI5Rg==", - "dev": true, - "requires": { - "web3-core": "1.2.2", - "web3-core-helpers": "1.2.2", - "web3-core-method": "1.2.2", - "web3-net": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-net": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.2.tgz", - "integrity": "sha512-K07j2DXq0x4UOJgae65rWZKraOznhk8v5EGSTdFqASTx7vWE/m+NqBijBYGEsQY1lSMlVaAY9UEQlcXK5HzXTw==", - "dev": true, - "requires": { - "web3-core": "1.2.2", - "web3-core-method": "1.2.2", - "web3-utils": "1.2.2" - } - }, - "web3-providers-http": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.2.tgz", - "integrity": "sha512-BNZ7Hguy3eBszsarH5gqr9SIZNvqk9eKwqwmGH1LQS1FL3NdoOn7tgPPdddrXec4fL94CwgNk4rCU+OjjZRNDg==", - "dev": true, - "requires": { - "web3-core-helpers": "1.2.2", - "xhr2-cookies": "1.1.0" - } - }, - "web3-providers-ipc": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.2.tgz", - "integrity": "sha512-t97w3zi5Kn/LEWGA6D9qxoO0LBOG+lK2FjlEdCwDQatffB/+vYrzZ/CLYVQSoyFZAlsDoBasVoYSWZK1n39aHA==", - "dev": true, - "requires": { - "oboe": "2.1.4", - "underscore": "1.9.1", - "web3-core-helpers": "1.2.2" - } - }, - "web3-providers-ws": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.2.tgz", - "integrity": "sha512-Wb1mrWTGMTXOpJkL0yGvL/WYLt8fUIXx8k/l52QB2IiKzvyd42dTWn4+j8IKXGSYYzOm7NMqv6nhA5VDk12VfA==", - "dev": true, - "requires": { - "underscore": "1.9.1", - "web3-core-helpers": "1.2.2", - "websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis" - } - }, - "web3-shh": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.2.tgz", - "integrity": "sha512-og258NPhlBn8yYrDWjoWBBb6zo1OlBgoWGT+LL5/LPqRbjPe09hlOYHgscAAr9zZGtohTOty7RrxYw6Z6oDWCg==", - "dev": true, - "requires": { - "web3-core": "1.2.2", - "web3-core-method": "1.2.2", - "web3-core-subscriptions": "1.2.2", - "web3-net": "1.2.2" - } - }, - "web3-utils": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", - "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "eth-lib": "0.2.7", - "ethereum-bloom-filters": "^1.0.6", - "ethjs-unit": "0.1.6", - "number-to-bn": "1.7.0", - "randombytes": "^2.1.0", - "underscore": "1.9.1", - "utf8": "3.0.0" - } - } - } - }, - "@truffle/provider": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.3.tgz", - "integrity": "sha512-EsAE7eiXMlTAQBNst12fuTKddMMtqB7d9jQmVvYvq+/G3ryZCf50dTiod0lhTIh0dIQ/tirFdvBRKDfc8c+hsQ==", - "dev": true, - "requires": { - "@truffle/error": "^0.0.8", - "@truffle/interface-adapter": "^0.4.0", - "web3": "1.2.2" - }, - "dependencies": { - "eth-lib": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", - "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", - "dev": true, - "requires": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" - } - }, "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", @@ -1229,81 +473,71 @@ "dev": true }, "web3": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.2.tgz", - "integrity": "sha512-/ChbmB6qZpfGx6eNpczt5YSUBHEA5V2+iUCbn85EVb3Zv6FVxrOo5Tv7Lw0gE2tW7EEjASbCyp3mZeiZaCCngg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.1.tgz", + "integrity": "sha512-nNMzeCK0agb5i/oTWNdQ1aGtwYfXzHottFP2Dz0oGIzavPMGSKyVlr8ibVb1yK5sJBjrWVnTdGaOC2zKDFuFRw==", "dev": true, "requires": { - "web3-bzz": "1.2.2", - "web3-core": "1.2.2", - "web3-eth": "1.2.2", - "web3-eth-personal": "1.2.2", - "web3-net": "1.2.2", - "web3-shh": "1.2.2", - "web3-utils": "1.2.2" + "web3-bzz": "1.2.1", + "web3-core": "1.2.1", + "web3-eth": "1.2.1", + "web3-eth-personal": "1.2.1", + "web3-net": "1.2.1", + "web3-shh": "1.2.1", + "web3-utils": "1.2.1" } }, "web3-bzz": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.2.tgz", - "integrity": "sha512-b1O2ObsqUN1lJxmFSjvnEC4TsaCbmh7Owj3IAIWTKqL9qhVgx7Qsu5O9cD13pBiSPNZJ68uJPaKq380QB4NWeA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.1.tgz", + "integrity": "sha512-LdOO44TuYbGIPfL4ilkuS89GQovxUpmLz6C1UC7VYVVRILeZS740FVB3j9V4P4FHUk1RenaDfKhcntqgVCHtjw==", "dev": true, "requires": { - "@types/node": "^10.12.18", "got": "9.6.0", "swarm-js": "0.1.39", "underscore": "1.9.1" - }, - "dependencies": { - "@types/node": { - "version": "10.17.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.6.tgz", - "integrity": "sha512-0a2X6cgN3RdPBL2MIlR6Lt0KlM7fOFsutuXcdglcOq6WvLnYXgPQSh0Mx6tO1KCAE8MxbHSOSTWDoUxRq+l3DA==", - "dev": true - } } }, "web3-core": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.2.tgz", - "integrity": "sha512-miHAX3qUgxV+KYfaOY93Hlc3kLW2j5fH8FJy6kSxAv+d4d5aH0wwrU2IIoJylQdT+FeenQ38sgsCnFu9iZ1hCQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.1.tgz", + "integrity": "sha512-5ODwIqgl8oIg/0+Ai4jsLxkKFWJYE0uLuE1yUKHNVCL4zL6n3rFjRMpKPokd6id6nJCNgeA64KdWQ4XfpnjdMg==", "dev": true, "requires": { - "@types/bn.js": "^4.11.4", - "web3-core-helpers": "1.2.2", - "web3-core-method": "1.2.2", - "web3-core-requestmanager": "1.2.2", - "web3-utils": "1.2.2" + "web3-core-helpers": "1.2.1", + "web3-core-method": "1.2.1", + "web3-core-requestmanager": "1.2.1", + "web3-utils": "1.2.1" } }, "web3-core-helpers": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.2.tgz", - "integrity": "sha512-HJrRsIGgZa1jGUIhvGz4S5Yh6wtOIo/TMIsSLe+Xay+KVnbseJpPprDI5W3s7H2ODhMQTbogmmUFquZweW2ImQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.1.tgz", + "integrity": "sha512-Gx3sTEajD5r96bJgfuW377PZVFmXIH4TdqDhgGwd2lZQCcMi+DA4TgxJNJGxn0R3aUVzyyE76j4LBrh412mXrw==", "dev": true, "requires": { "underscore": "1.9.1", - "web3-eth-iban": "1.2.2", - "web3-utils": "1.2.2" + "web3-eth-iban": "1.2.1", + "web3-utils": "1.2.1" } }, "web3-core-method": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.2.tgz", - "integrity": "sha512-szR4fDSBxNHaF1DFqE+j6sFR/afv9Aa36OW93saHZnrh+iXSrYeUUDfugeNcRlugEKeUCkd4CZylfgbK2SKYJA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.1.tgz", + "integrity": "sha512-Ghg2WS23qi6Xj8Od3VCzaImLHseEA7/usvnOItluiIc5cKs00WYWsNy2YRStzU9a2+z8lwQywPYp0nTzR/QXdQ==", "dev": true, "requires": { "underscore": "1.9.1", - "web3-core-helpers": "1.2.2", - "web3-core-promievent": "1.2.2", - "web3-core-subscriptions": "1.2.2", - "web3-utils": "1.2.2" + "web3-core-helpers": "1.2.1", + "web3-core-promievent": "1.2.1", + "web3-core-subscriptions": "1.2.1", + "web3-utils": "1.2.1" } }, "web3-core-promievent": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.2.tgz", - "integrity": "sha512-tKvYeT8bkUfKABcQswK6/X79blKTKYGk949urZKcLvLDEaWrM3uuzDwdQT3BNKzQ3vIvTggFPX9BwYh0F1WwqQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.1.tgz", + "integrity": "sha512-IVUqgpIKoeOYblwpex4Hye6npM0aMR+kU49VP06secPeN0rHMyhGF0ZGveWBrGvf8WDPI7jhqPBFIC6Jf3Q3zw==", "dev": true, "requires": { "any-promise": "1.3.0", @@ -1311,204 +545,221 @@ } }, "web3-core-requestmanager": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.2.tgz", - "integrity": "sha512-a+gSbiBRHtHvkp78U2bsntMGYGF2eCb6219aMufuZWeAZGXJ63Wc2321PCbA8hF9cQrZI4EoZ4kVLRI4OF15Hw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.1.tgz", + "integrity": "sha512-xfknTC69RfYmLKC+83Jz73IC3/sS2ZLhGtX33D4Q5nQ8yc39ElyAolxr9sJQS8kihOcM6u4J+8gyGMqsLcpIBg==", "dev": true, "requires": { "underscore": "1.9.1", - "web3-core-helpers": "1.2.2", - "web3-providers-http": "1.2.2", - "web3-providers-ipc": "1.2.2", - "web3-providers-ws": "1.2.2" + "web3-core-helpers": "1.2.1", + "web3-providers-http": "1.2.1", + "web3-providers-ipc": "1.2.1", + "web3-providers-ws": "1.2.1" } }, "web3-core-subscriptions": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.2.tgz", - "integrity": "sha512-QbTgigNuT4eicAWWr7ahVpJyM8GbICsR1Ys9mJqzBEwpqS+RXTRVSkwZ2IsxO+iqv6liMNwGregbJLq4urMFcQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.1.tgz", + "integrity": "sha512-nmOwe3NsB8V8UFsY1r+sW6KjdOS68h8nuh7NzlWxBQT/19QSUGiERRTaZXWu5BYvo1EoZRMxCKyCQpSSXLc08g==", "dev": true, "requires": { "eventemitter3": "3.1.2", "underscore": "1.9.1", - "web3-core-helpers": "1.2.2" + "web3-core-helpers": "1.2.1" } }, "web3-eth": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.2.tgz", - "integrity": "sha512-UXpC74mBQvZzd4b+baD4Ocp7g+BlwxhBHumy9seyE/LMIcMlePXwCKzxve9yReNpjaU16Mmyya6ZYlyiKKV8UA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.1.tgz", + "integrity": "sha512-/2xly4Yry5FW1i+uygPjhfvgUP/MS/Dk+PDqmzp5M88tS86A+j8BzKc23GrlA8sgGs0645cpZK/999LpEF5UdA==", "dev": true, "requires": { "underscore": "1.9.1", - "web3-core": "1.2.2", - "web3-core-helpers": "1.2.2", - "web3-core-method": "1.2.2", - "web3-core-subscriptions": "1.2.2", - "web3-eth-abi": "1.2.2", - "web3-eth-accounts": "1.2.2", - "web3-eth-contract": "1.2.2", - "web3-eth-ens": "1.2.2", - "web3-eth-iban": "1.2.2", - "web3-eth-personal": "1.2.2", - "web3-net": "1.2.2", - "web3-utils": "1.2.2" + "web3-core": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-method": "1.2.1", + "web3-core-subscriptions": "1.2.1", + "web3-eth-abi": "1.2.1", + "web3-eth-accounts": "1.2.1", + "web3-eth-contract": "1.2.1", + "web3-eth-ens": "1.2.1", + "web3-eth-iban": "1.2.1", + "web3-eth-personal": "1.2.1", + "web3-net": "1.2.1", + "web3-utils": "1.2.1" } }, "web3-eth-abi": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.2.tgz", - "integrity": "sha512-Yn/ZMgoOLxhTVxIYtPJ0eS6pnAnkTAaJgUJh1JhZS4ekzgswMfEYXOwpMaD5eiqPJLpuxmZFnXnBZlnQ1JMXsw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.1.tgz", + "integrity": "sha512-jI/KhU2a/DQPZXHjo2GW0myEljzfiKOn+h1qxK1+Y9OQfTcBMxrQJyH5AP89O6l6NZ1QvNdq99ThAxBFoy5L+g==", "dev": true, "requires": { "ethers": "4.0.0-beta.3", "underscore": "1.9.1", - "web3-utils": "1.2.2" + "web3-utils": "1.2.1" } }, "web3-eth-accounts": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.2.tgz", - "integrity": "sha512-KzHOEyXOEZ13ZOkWN3skZKqSo5f4Z1ogPFNn9uZbKCz+kSp+gCAEKxyfbOsB/JMAp5h7o7pb6eYsPCUBJmFFiA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.1.tgz", + "integrity": "sha512-26I4qq42STQ8IeKUyur3MdQ1NzrzCqPsmzqpux0j6X/XBD7EjZ+Cs0lhGNkSKH5dI3V8CJasnQ5T1mNKeWB7nQ==", "dev": true, "requires": { "any-promise": "1.3.0", "crypto-browserify": "3.12.0", "eth-lib": "0.2.7", - "ethereumjs-common": "^1.3.2", - "ethereumjs-tx": "^2.1.1", - "scrypt-shim": "github:web3-js/scrypt-shim", + "scryptsy": "2.1.0", + "semver": "6.2.0", "underscore": "1.9.1", "uuid": "3.3.2", - "web3-core": "1.2.2", - "web3-core-helpers": "1.2.2", - "web3-core-method": "1.2.2", - "web3-utils": "1.2.2" + "web3-core": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-method": "1.2.1", + "web3-utils": "1.2.1" } }, "web3-eth-contract": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.2.tgz", - "integrity": "sha512-EKT2yVFws3FEdotDQoNsXTYL798+ogJqR2//CaGwx3p0/RvQIgfzEwp8nbgA6dMxCsn9KOQi7OtklzpnJMkjtA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.1.tgz", + "integrity": "sha512-kYFESbQ3boC9bl2rYVghj7O8UKMiuKaiMkxvRH5cEDHil8V7MGEGZNH0slSdoyeftZVlaWSMqkRP/chfnKND0g==", "dev": true, "requires": { - "@types/bn.js": "^4.11.4", "underscore": "1.9.1", - "web3-core": "1.2.2", - "web3-core-helpers": "1.2.2", - "web3-core-method": "1.2.2", - "web3-core-promievent": "1.2.2", - "web3-core-subscriptions": "1.2.2", - "web3-eth-abi": "1.2.2", - "web3-utils": "1.2.2" + "web3-core": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-method": "1.2.1", + "web3-core-promievent": "1.2.1", + "web3-core-subscriptions": "1.2.1", + "web3-eth-abi": "1.2.1", + "web3-utils": "1.2.1" } }, "web3-eth-ens": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.2.tgz", - "integrity": "sha512-CFjkr2HnuyMoMFBoNUWojyguD4Ef+NkyovcnUc/iAb9GP4LHohKrODG4pl76R5u61TkJGobC2ij6TyibtsyVYg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.1.tgz", + "integrity": "sha512-lhP1kFhqZr2nnbu3CGIFFrAnNxk2veXpOXBY48Tub37RtobDyHijHgrj+xTh+mFiPokyrapVjpFsbGa+Xzye4Q==", "dev": true, "requires": { "eth-ens-namehash": "2.0.8", "underscore": "1.9.1", - "web3-core": "1.2.2", - "web3-core-helpers": "1.2.2", - "web3-core-promievent": "1.2.2", - "web3-eth-abi": "1.2.2", - "web3-eth-contract": "1.2.2", - "web3-utils": "1.2.2" + "web3-core": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-promievent": "1.2.1", + "web3-eth-abi": "1.2.1", + "web3-eth-contract": "1.2.1", + "web3-utils": "1.2.1" } }, "web3-eth-iban": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.2.tgz", - "integrity": "sha512-gxKXBoUhaTFHr0vJB/5sd4i8ejF/7gIsbM/VvemHT3tF5smnmY6hcwSMmn7sl5Gs+83XVb/BngnnGkf+I/rsrQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.1.tgz", + "integrity": "sha512-9gkr4QPl1jCU+wkgmZ8EwODVO3ovVj6d6JKMos52ggdT2YCmlfvFVF6wlGLwi0VvNa/p+0BjJzaqxnnG/JewjQ==", "dev": true, "requires": { "bn.js": "4.11.8", - "web3-utils": "1.2.2" + "web3-utils": "1.2.1" } }, "web3-eth-personal": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.2.tgz", - "integrity": "sha512-4w+GLvTlFqW3+q4xDUXvCEMU7kRZ+xm/iJC8gm1Li1nXxwwFbs+Y+KBK6ZYtoN1qqAnHR+plYpIoVo27ixI5Rg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.1.tgz", + "integrity": "sha512-RNDVSiaSoY4aIp8+Hc7z+X72H7lMb3fmAChuSBADoEc7DsJrY/d0R5qQDK9g9t2BO8oxgLrLNyBP/9ub2Hc6Bg==", "dev": true, "requires": { - "web3-core": "1.2.2", - "web3-core-helpers": "1.2.2", - "web3-core-method": "1.2.2", - "web3-net": "1.2.2", - "web3-utils": "1.2.2" + "web3-core": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-method": "1.2.1", + "web3-net": "1.2.1", + "web3-utils": "1.2.1" } }, "web3-net": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.2.tgz", - "integrity": "sha512-K07j2DXq0x4UOJgae65rWZKraOznhk8v5EGSTdFqASTx7vWE/m+NqBijBYGEsQY1lSMlVaAY9UEQlcXK5HzXTw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.1.tgz", + "integrity": "sha512-Yt1Bs7WgnLESPe0rri/ZoPWzSy55ovioaP35w1KZydrNtQ5Yq4WcrAdhBzcOW7vAkIwrsLQsvA+hrOCy7mNauw==", "dev": true, "requires": { - "web3-core": "1.2.2", - "web3-core-method": "1.2.2", - "web3-utils": "1.2.2" + "web3-core": "1.2.1", + "web3-core-method": "1.2.1", + "web3-utils": "1.2.1" } }, "web3-providers-http": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.2.tgz", - "integrity": "sha512-BNZ7Hguy3eBszsarH5gqr9SIZNvqk9eKwqwmGH1LQS1FL3NdoOn7tgPPdddrXec4fL94CwgNk4rCU+OjjZRNDg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.1.tgz", + "integrity": "sha512-BDtVUVolT9b3CAzeGVA/np1hhn7RPUZ6YYGB/sYky+GjeO311Yoq8SRDUSezU92x8yImSC2B+SMReGhd1zL+bQ==", "dev": true, "requires": { - "web3-core-helpers": "1.2.2", + "web3-core-helpers": "1.2.1", "xhr2-cookies": "1.1.0" } }, "web3-providers-ipc": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.2.tgz", - "integrity": "sha512-t97w3zi5Kn/LEWGA6D9qxoO0LBOG+lK2FjlEdCwDQatffB/+vYrzZ/CLYVQSoyFZAlsDoBasVoYSWZK1n39aHA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.1.tgz", + "integrity": "sha512-oPEuOCwxVx8L4CPD0TUdnlOUZwGBSRKScCz/Ws2YHdr9Ium+whm+0NLmOZjkjQp5wovQbyBzNa6zJz1noFRvFA==", "dev": true, "requires": { "oboe": "2.1.4", "underscore": "1.9.1", - "web3-core-helpers": "1.2.2" + "web3-core-helpers": "1.2.1" } }, "web3-providers-ws": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.2.tgz", - "integrity": "sha512-Wb1mrWTGMTXOpJkL0yGvL/WYLt8fUIXx8k/l52QB2IiKzvyd42dTWn4+j8IKXGSYYzOm7NMqv6nhA5VDk12VfA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.1.tgz", + "integrity": "sha512-oqsQXzu+ejJACVHy864WwIyw+oB21nw/pI65/sD95Zi98+/HQzFfNcIFneF1NC4bVF3VNX4YHTNq2I2o97LAiA==", "dev": true, "requires": { "underscore": "1.9.1", - "web3-core-helpers": "1.2.2", + "web3-core-helpers": "1.2.1", "websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis" + }, + "dependencies": { + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true + }, + "websocket": { + "version": "github:web3-js/WebSocket-Node#905deb4812572b344f5801f8c9ce8bb02799d82e", + "from": "github:web3-js/WebSocket-Node#polyfill/globalThis", + "dev": true, + "requires": { + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "nan": "^2.14.0", + "typedarray-to-buffer": "^3.1.5", + "yaeti": "^0.0.6" + } + } } }, "web3-shh": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.2.tgz", - "integrity": "sha512-og258NPhlBn8yYrDWjoWBBb6zo1OlBgoWGT+LL5/LPqRbjPe09hlOYHgscAAr9zZGtohTOty7RrxYw6Z6oDWCg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.1.tgz", + "integrity": "sha512-/3Cl04nza5kuFn25bV3FJWa0s3Vafr5BlT933h26xovQ6HIIz61LmvNQlvX1AhFL+SNJOTcQmK1SM59vcyC8bA==", "dev": true, "requires": { - "web3-core": "1.2.2", - "web3-core-method": "1.2.2", - "web3-core-subscriptions": "1.2.2", - "web3-net": "1.2.2" + "web3-core": "1.2.1", + "web3-core-method": "1.2.1", + "web3-core-subscriptions": "1.2.1", + "web3-net": "1.2.1" } }, "web3-utils": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", - "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", "dev": true, "requires": { "bn.js": "4.11.8", "eth-lib": "0.2.7", - "ethereum-bloom-filters": "^1.0.6", "ethjs-unit": "0.1.6", "number-to-bn": "1.7.0", - "randombytes": "^2.1.0", + "randomhex": "0.1.5", "underscore": "1.9.1", "utf8": "3.0.0" } @@ -1532,9 +783,9 @@ } }, "@types/chai": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.6.tgz", - "integrity": "sha512-HF8faEUA4JurIm+68VaA2KedtZf5LYdXpQEAbIAN79DwWQbO82BNTksZgCH3UMqbZHXex9C6TrBfg7OUInRISQ==", + "version": "4.2.7", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.7.tgz", + "integrity": "sha512-luq8meHGYwvky0O7u0eQZdA7B4Wd9owUCqvbw2m3XCrCU8mplYOujMBbvyS547AxJkC+pGnd0Cm15eNxEUNU8g==", "dev": true }, "@types/chai-spies": { @@ -1608,12 +859,12 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.10.0.tgz", - "integrity": "sha512-rT51fNLW0u3fnDGnAHVC5nu+Das+y2CpW10yqvf6/j5xbuUV3FxA3mBaIbM24CXODXjbgUznNb4Kg9XZOUxKAw==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.12.0.tgz", + "integrity": "sha512-1t4r9rpLuEwl3hgt90jY18wJHSyb0E3orVL3DaqwmpiSDHmHiSspVsvsFF78BJ/3NNG3qmeso836jpuBWYziAA==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "2.10.0", + "@typescript-eslint/experimental-utils": "2.12.0", "eslint-utils": "^1.4.3", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", @@ -1629,32 +880,32 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.10.0.tgz", - "integrity": "sha512-FZhWq6hWWZBP76aZ7bkrfzTMP31CCefVIImrwP3giPLcoXocmLTmr92NLZxuIcTL4GTEOE33jQMWy9PwelL+yQ==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.12.0.tgz", + "integrity": "sha512-jv4gYpw5N5BrWF3ntROvCuLe1IjRenLy5+U57J24NbPGwZFAjhnM45qpq0nDH1y/AZMb3Br25YiNVwyPbz6RkA==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.10.0", + "@typescript-eslint/typescript-estree": "2.12.0", "eslint-scope": "^5.0.0" } }, "@typescript-eslint/parser": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.10.0.tgz", - "integrity": "sha512-wQNiBokcP5ZsTuB+i4BlmVWq6o+oAhd8en2eSm/EE9m7BgZUIfEeYFd6z3S+T7bgNuloeiHA1/cevvbBDLr98g==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.12.0.tgz", + "integrity": "sha512-lPdkwpdzxEfjI8TyTzZqPatkrswLSVu4bqUgnB03fHSOwpC7KSerPgJRgIAf11UGNf7HKjJV6oaPZI4AghLU6g==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.10.0", - "@typescript-eslint/typescript-estree": "2.10.0", + "@typescript-eslint/experimental-utils": "2.12.0", + "@typescript-eslint/typescript-estree": "2.12.0", "eslint-visitor-keys": "^1.1.0" } }, "@typescript-eslint/typescript-estree": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.10.0.tgz", - "integrity": "sha512-oOYnplddQNm/LGVkqbkAwx4TIBuuZ36cAQq9v3nFIU9FmhemHuVzAesMSXNQDdAzCa5bFgCrfD3JWhYVKlRN2g==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.12.0.tgz", + "integrity": "sha512-rGehVfjHEn8Frh9UW02ZZIfJs6SIIxIu/K1bbci8rFfDE/1lQ8krIJy5OXOV3DVnNdDPtoiPOdEANkLMrwXbiQ==", "dev": true, "requires": { "debug": "^4.1.1", @@ -3705,9 +2956,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001015", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001015.tgz", - "integrity": "sha512-/xL2AbW/XWHNu1gnIrO8UitBGoFthcsDgU9VLK1/dpsoxbaD5LscHozKze05R6WLsBvLhqv78dAPozMFQBYLbQ==", + "version": "1.0.30001016", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001016.tgz", + "integrity": "sha512-yYQ2QfotceRiH4U+h1Us86WJXtVHDmy3nEKIdYPsZCYnOV5/tMgGbmoIlrMzmh2VXlproqYtVaKeGDBkMZifFA==", "dev": true }, "caseless": { @@ -4333,9 +3584,9 @@ "dev": true }, "core-js": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.10.tgz", - "integrity": "sha512-I39t74+4t+zau64EN1fE5v2W31Adtc/REhzWN+gWRRXg6WH5qAsZm62DHpQ1+Yhe4047T55jvzz7MUqF/dBBlA==", + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", + "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==", "dev": true }, "core-util-is": { @@ -4654,10 +3905,18 @@ } }, "deep-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", - "dev": true + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "dev": true, + "requires": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + } }, "deep-extend": { "version": "0.6.0", @@ -5302,9 +4561,9 @@ } }, "eslint-plugin-prettier": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.1.tgz", - "integrity": "sha512-A+TZuHZ0KU0cnn56/9mfR7/KjUJ9QNVXUhwvRFSR7PGPe0zQR6PTkmyqg1AtUUEOzTqeRsUwyKFh0oVZKVCrtA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz", + "integrity": "sha512-GlolCC9y3XZfv3RQfwGew7NnuFDKsfI4lbvRK+PIIo23SFH+LemGs4cKwzAaRa+Mdb+lQO/STaIayno8T5sJJA==", "dev": true, "requires": { "prettier-linter-helpers": "^1.0.0" @@ -6916,14 +6175,15 @@ "dev": true }, "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.11.tgz", + "integrity": "sha512-+ux3lx6peh0BpvY0JebGyZoiR4D+oYzdPZMKJwkZ+sFkNJzpL7tXc/wehS49gUAxg3tmMHPHZkA8JU2rhhgDHw==", "dev": true, "optional": true, "requires": { + "bindings": "^1.5.0", "nan": "^2.12.1", - "node-pre-gyp": "^0.12.0" + "node-pre-gyp": "*" }, "dependencies": { "abbrev": { @@ -6971,7 +6231,7 @@ } }, "chownr": { - "version": "1.1.1", + "version": "1.1.3", "bundled": true, "dev": true, "optional": true @@ -7001,7 +6261,7 @@ "optional": true }, "debug": { - "version": "4.1.1", + "version": "3.2.6", "bundled": true, "dev": true, "optional": true, @@ -7028,12 +6288,12 @@ "optional": true }, "fs-minipass": { - "version": "1.2.5", + "version": "1.2.7", "bundled": true, "dev": true, "optional": true, "requires": { - "minipass": "^2.2.1" + "minipass": "^2.6.0" } }, "fs.realpath": { @@ -7059,7 +6319,7 @@ } }, "glob": { - "version": "7.1.3", + "version": "7.1.6", "bundled": true, "dev": true, "optional": true, @@ -7088,7 +6348,7 @@ } }, "ignore-walk": { - "version": "3.0.1", + "version": "3.0.3", "bundled": true, "dev": true, "optional": true, @@ -7107,7 +6367,7 @@ } }, "inherits": { - "version": "2.0.3", + "version": "2.0.4", "bundled": true, "dev": true, "optional": true @@ -7149,7 +6409,7 @@ "optional": true }, "minipass": { - "version": "2.3.5", + "version": "2.9.0", "bundled": true, "dev": true, "optional": true, @@ -7159,12 +6419,12 @@ } }, "minizlib": { - "version": "1.2.1", + "version": "1.3.3", "bundled": true, "dev": true, "optional": true, "requires": { - "minipass": "^2.2.1" + "minipass": "^2.9.0" } }, "mkdirp": { @@ -7177,24 +6437,24 @@ } }, "ms": { - "version": "2.1.1", + "version": "2.1.2", "bundled": true, "dev": true, "optional": true }, "needle": { - "version": "2.3.0", + "version": "2.4.0", "bundled": true, "dev": true, "optional": true, "requires": { - "debug": "^4.1.0", + "debug": "^3.2.6", "iconv-lite": "^0.4.4", "sax": "^1.2.4" } }, "node-pre-gyp": { - "version": "0.12.0", + "version": "0.14.0", "bundled": true, "dev": true, "optional": true, @@ -7208,7 +6468,7 @@ "rc": "^1.2.7", "rimraf": "^2.6.1", "semver": "^5.3.0", - "tar": "^4" + "tar": "^4.4.2" } }, "nopt": { @@ -7222,13 +6482,22 @@ } }, "npm-bundled": { - "version": "1.0.6", + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", "bundled": true, "dev": true, "optional": true }, "npm-packlist": { - "version": "1.4.1", + "version": "1.4.7", "bundled": true, "dev": true, "optional": true, @@ -7299,7 +6568,7 @@ "optional": true }, "process-nextick-args": { - "version": "2.0.0", + "version": "2.0.1", "bundled": true, "dev": true, "optional": true @@ -7340,7 +6609,7 @@ } }, "rimraf": { - "version": "2.6.3", + "version": "2.7.1", "bundled": true, "dev": true, "optional": true, @@ -7367,7 +6636,7 @@ "optional": true }, "semver": { - "version": "5.7.0", + "version": "5.7.1", "bundled": true, "dev": true, "optional": true @@ -7420,18 +6689,18 @@ "optional": true }, "tar": { - "version": "4.4.8", + "version": "4.4.13", "bundled": true, "dev": true, "optional": true, "requires": { "chownr": "^1.1.1", "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", "mkdirp": "^0.5.0", "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" + "yallist": "^3.0.3" } }, "util-deprecate": { @@ -7456,7 +6725,7 @@ "optional": true }, "yallist": { - "version": "3.0.3", + "version": "3.1.1", "bundled": true, "dev": true, "optional": true @@ -7922,9 +7191,9 @@ "dev": true }, "highlight.js": { - "version": "9.16.2", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.16.2.tgz", - "integrity": "sha512-feMUrVLZvjy0oC7FVJQcSQRqbBq9kwqnYE4+Kj9ZjbHh3g+BisiPgF49NyQbVLNdrL/qqZr3Ca9yOKwgn2i/tw==", + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.0.tgz", + "integrity": "sha512-A97kI1KAUzKoAiEoaGcf2O9YPS8nbDTCRFokaaeBhnqjQTvbAuAJrQMm21zw8s8xzaMtCQBtgbyGXLGxdxQyqQ==", "dev": true }, "hmac-drbg": { @@ -8261,6 +7530,12 @@ "kind-of": "^6.0.0" } }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -9371,9 +8646,9 @@ } }, "marked": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz", - "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.0.tgz", + "integrity": "sha512-MyUe+T/Pw4TZufHkzAfDj6HarCBWia2y27/bhuYkTaiUnfDYFnCP3KUN+9oM7Wi6JA2rymtVYbQu3spE0GCmxQ==", "dev": true }, "md5.js": { @@ -10343,6 +9618,12 @@ "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", "dev": true }, + "object-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.2.tgz", + "integrity": "sha512-Epah+btZd5wrrfjkJZq1AOB9O6OxUQto45hzFd7lXGrpHPGE0W1k+426yrZV+k6NJOzLNNW/nVsmZdIWsAqoOQ==", + "dev": true + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -11203,6 +10484,12 @@ "safe-buffer": "^5.1.0" } }, + "randomhex": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/randomhex/-/randomhex-0.1.5.tgz", + "integrity": "sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU=", + "dev": true + }, "range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -11529,6 +10816,49 @@ "safe-regex": "^1.1.0" } }, + "regexp.prototype.flags": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", + "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.0-next.1.tgz", + "integrity": "sha512-7MmGr03N7Rnuid6+wyhD9sHNE2n4tFSwExnU2lQl3lIo2ShXWGePY80zYaoMOmILWv57H0amMjZGHNzzGG70Rw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.0", + "string.prototype.trimright": "^2.1.0" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + } + } + }, "regexpp": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", @@ -12030,15 +11360,6 @@ "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=" }, - "scrypt-shim": { - "version": "github:web3-js/scrypt-shim#be5e616323a8b5e568788bf94d03c1b8410eac54", - "from": "github:web3-js/scrypt-shim", - "dev": true, - "requires": { - "scryptsy": "^2.1.0", - "semver": "^6.3.0" - } - }, "scrypt.js": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.3.0.tgz", @@ -12806,14 +12127,47 @@ } }, "string.prototype.trim": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", - "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.1.tgz", + "integrity": "sha512-MjGFEeqixw47dAMFMtgUro/I0+wNqZB5GKXGt1fFr24u3TzDXCPu7J9Buppzoe3r/LqkSDLDDJzE15RGWDGAVw==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.0", - "function-bind": "^1.0.2" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.0-next.1.tgz", + "integrity": "sha512-7MmGr03N7Rnuid6+wyhD9sHNE2n4tFSwExnU2lQl3lIo2ShXWGePY80zYaoMOmILWv57H0amMjZGHNzzGG70Rw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.0", + "string.prototype.trimright": "^2.1.0" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + } } }, "string.prototype.trimleft": { @@ -13028,36 +12382,52 @@ "dev": true }, "tape": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.11.0.tgz", - "integrity": "sha512-yixvDMX7q7JIs/omJSzSZrqulOV51EC9dK8dM0TzImTIkHWfe2/kFyL5v+d9C+SrCMaICk59ujsqFAVidDqDaA==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/tape/-/tape-4.12.0.tgz", + "integrity": "sha512-PWs/TopmfVeYyLNZnfKsoV160xjNq1LvX2SWzZTyhVYsDldR93p5Zp0lfmsY3BCpZdVMXBOkfYZFeScEfsFvKQ==", "dev": true, "requires": { - "deep-equal": "~1.0.1", + "deep-equal": "~1.1.1", "defined": "~1.0.0", "for-each": "~0.3.3", "function-bind": "~1.1.1", - "glob": "~7.1.4", + "glob": "~7.1.6", "has": "~1.0.3", "inherits": "~2.0.4", + "is-regex": "~1.0.5", "minimist": "~1.2.0", - "object-inspect": "~1.6.0", - "resolve": "~1.11.1", + "object-inspect": "~1.7.0", + "resolve": "~1.13.1", "resumer": "~0.0.0", - "string.prototype.trim": "~1.1.2", + "string.prototype.trim": "~1.2.1", "through": "~2.3.8" }, "dependencies": { + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, "resolve": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", - "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.13.1.tgz", + "integrity": "sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -13137,9 +12507,9 @@ } }, "terser": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.4.0.tgz", - "integrity": "sha512-oDG16n2WKm27JO8h4y/w3iqBGAOSCtq7k8dRmrn4Wf9NouL0b2WpMHGChFGZq4nFAQy1FsNJrVQHfurXOSTmOA==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.4.3.tgz", + "integrity": "sha512-0ikKraVtRDKGzHrzkCv5rUNDzqlhmhowOBqC0XqUHFpW+vJ45+20/IFBcebwKfiS2Z9fJin6Eo+F1zLZsxi8RA==", "dev": true, "requires": { "commander": "^2.20.0", @@ -13162,22 +12532,28 @@ } }, "terser-webpack-plugin": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.1.tgz", - "integrity": "sha512-ZXmmfiwtCLfz8WKZyYUuuHf3dMYEjg8NrjHMb0JqHVHVOSkzp3cW2/XG1fP3tRhqEqSzMwzzRQGtAPbs4Cncxg==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz", + "integrity": "sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA==", "dev": true, "requires": { "cacache": "^12.0.2", "find-cache-dir": "^2.1.0", "is-wsl": "^1.1.0", "schema-utils": "^1.0.0", - "serialize-javascript": "^1.7.0", + "serialize-javascript": "^2.1.2", "source-map": "^0.6.1", "terser": "^4.1.2", "webpack-sources": "^1.4.0", "worker-farm": "^1.7.0" }, "dependencies": { + "serialize-javascript": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz", + "integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==", + "dev": true + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -13514,21 +12890,21 @@ } }, "typedoc": { - "version": "0.15.3", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.15.3.tgz", - "integrity": "sha512-RGX+dgnm9fyg5KHj81/ZhMiee0FfvJnjBXedhedhMWlrtM4YRv3pn8sYCWRt5TMi1Jli3/JG224pbFo3/3uaGw==", + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.16.8.tgz", + "integrity": "sha512-KO5z33qZ/+dXY5e87YtrD6sr7/BjrD70L0EwzwvQEvS0vuzQRHbXfeeJHschYjpMp3D2BmX4bwEKUMEN8dHDAA==", "dev": true, "requires": { "@types/minimatch": "3.0.3", "fs-extra": "^8.1.0", - "handlebars": "^4.5.3", - "highlight.js": "^9.16.2", + "handlebars": "^4.7.2", + "highlight.js": "^9.17.1", "lodash": "^4.17.15", - "marked": "^0.7.0", + "marked": "^0.8.0", "minimatch": "^3.0.0", "progress": "^2.0.3", "shelljs": "^0.8.3", - "typedoc-default-themes": "^0.6.1", + "typedoc-default-themes": "^0.7.2", "typescript": "3.7.x" }, "dependencies": { @@ -13542,13 +12918,31 @@ "jsonfile": "^4.0.0", "universalify": "^0.1.0" } + }, + "handlebars": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.2.tgz", + "integrity": "sha512-4PwqDL2laXtTWZghzzCtunQUTLbo31pcCJrd/B/9JP8XbhVzpS5ZXuKqlOzsd1rtcaLo4KqAn8nl8mkknS4MHw==", + "dev": true, + "requires": { + "neo-async": "^2.6.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true } } }, "typedoc-default-themes": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.6.1.tgz", - "integrity": "sha512-z5AWKqQDz7igl9WkUuafx8cEm4MPVQGMpbWE+3lwVOaq+U4UoLKBMnpFQWh/4fqQ3bGysXpOstMxy2OOzHezyw==", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.7.2.tgz", + "integrity": "sha512-fiFKlFO6VTqjcno8w6WpTsbCgXmfPHVjnLfYkmByZE7moaz+E2DSpAT+oHtDHv7E0BM5kAhPrHJELP2J2Y2T9A==", "dev": true, "requires": { "backbone": "^1.4.0", @@ -13558,9 +12952,9 @@ } }, "typescript": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.3.tgz", - "integrity": "sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==", + "version": "3.7.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.5.tgz", + "integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==", "dev": true }, "uglify-js": { @@ -14012,6 +13406,7 @@ "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.4.tgz", "integrity": "sha512-xPXGe+w0x0t88Wj+s/dmAdASr3O9wmA9mpZRtixGZxmBexAF0MjfqYM+MS4tVl5s11hMTN3AZb8cDD4VLfC57A==", "requires": { + "@types/node": "^12.6.1", "web3-bzz": "1.2.4", "web3-core": "1.2.4", "web3-eth": "1.2.4", @@ -14019,6 +13414,13 @@ "web3-net": "1.2.4", "web3-shh": "1.2.4", "web3-utils": "1.2.4" + }, + "dependencies": { + "@types/node": { + "version": "12.12.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.24.tgz", + "integrity": "sha512-1Ciqv9pqwVtW6FsIUKSZNB82E5Cu1I2bBTj1xuIHXLe/1zYLl3956Nbhg2MzSYHVfl9/rmanjbQIb7LibfCnug==" + } } }, "web3-bzz": { @@ -14046,10 +13448,18 @@ "requires": { "@types/bignumber.js": "^5.0.0", "@types/bn.js": "^4.11.4", + "@types/node": "^12.6.1", "web3-core-helpers": "1.2.4", "web3-core-method": "1.2.4", "web3-core-requestmanager": "1.2.4", "web3-utils": "1.2.4" + }, + "dependencies": { + "@types/node": { + "version": "12.12.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.24.tgz", + "integrity": "sha512-1Ciqv9pqwVtW6FsIUKSZNB82E5Cu1I2bBTj1xuIHXLe/1zYLl3956Nbhg2MzSYHVfl9/rmanjbQIb7LibfCnug==" + } } }, "web3-core-helpers": { @@ -14216,11 +13626,19 @@ "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.4.tgz", "integrity": "sha512-5Russ7ZECwHaZXcN3DLuLS7390Vzgrzepl4D87SD6Sn1DHsCZtvfdPIYwoTmKNp69LG3mORl7U23Ga5YxqkICw==", "requires": { + "@types/node": "^12.6.1", "web3-core": "1.2.4", "web3-core-helpers": "1.2.4", "web3-core-method": "1.2.4", "web3-net": "1.2.4", "web3-utils": "1.2.4" + }, + "dependencies": { + "@types/node": { + "version": "12.12.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.24.tgz", + "integrity": "sha512-1Ciqv9pqwVtW6FsIUKSZNB82E5Cu1I2bBTj1xuIHXLe/1zYLl3956Nbhg2MzSYHVfl9/rmanjbQIb7LibfCnug==" + } } }, "web3-net": { @@ -14387,9 +13805,9 @@ "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==" }, "webpack": { - "version": "4.41.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.41.2.tgz", - "integrity": "sha512-Zhw69edTGfbz9/8JJoyRQ/pq8FYUoY0diOXqW0T6yhgdhCv6wr0hra5DwwWexNRns2Z2+gsnrNcbe9hbGBgk/A==", + "version": "4.41.3", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.41.3.tgz", + "integrity": "sha512-EcNzP9jGoxpQAXq1VOoTet0ik7/VVU1MovIfcUSAjLowc7GhcQku/sOXALvq5nPpSei2HF6VRhibeJSC3i/Law==", "dev": true, "requires": { "@webassemblyjs/ast": "1.8.5", @@ -14412,15 +13830,15 @@ "node-libs-browser": "^2.2.1", "schema-utils": "^1.0.0", "tapable": "^1.1.3", - "terser-webpack-plugin": "^1.4.1", + "terser-webpack-plugin": "^1.4.3", "watchpack": "^1.6.0", "webpack-sources": "^1.4.1" }, "dependencies": { "acorn": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", - "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", + "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==", "dev": true }, "braces": { @@ -14720,26 +14138,6 @@ } } }, - "websocket": { - "version": "github:web3-js/WebSocket-Node#905deb4812572b344f5801f8c9ce8bb02799d82e", - "from": "github:web3-js/WebSocket-Node#polyfill/globalThis", - "dev": true, - "requires": { - "debug": "^2.2.0", - "es5-ext": "^0.10.50", - "nan": "^2.14.0", - "typedarray-to-buffer": "^3.1.5", - "yaeti": "^0.0.6" - }, - "dependencies": { - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", - "dev": true - } - } - }, "whatwg-fetch": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", diff --git a/package.json b/package.json index a59d2e2..265d2c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0", + "version": "1.1.0", "description": "JavaScript client library for Ocean Protocol", "main": "./dist/node/squid.js", "typings": "./dist/node/squid.d.ts", @@ -26,10 +26,9 @@ "format": "prettier --parser typescript --ignore-path .gitignore --write '**/*.{js,jsx,ts,tsx}'", "doc": "typedoc --mode modules --out ./doc/ ./src/", "doc:json": "./scripts/typedoc.js", - "merge-coverages": "npx lcov-result-merger \"coverage/*/lcov.info\" coverage/lcov.info", - "report-coverage": "npm run report-coverage:unit && npm run report-coverage:integration", - "report-coverage:unit": "cat coverage/unit/lcov.info | codacy-coverage --token 71ef0d15f6f04ac29b31d704b28f866a", - "report-coverage:integration": "cat coverage/integration/lcov.info | codacy-coverage --token 71ef0d15f6f04ac29b31d704b28f866a", + "report-codacy": "npm run report-coverage:unit && npm run report-coverage:integration", + "report-codacy:unit": "cat coverage/unit/lcov.info | codacy-coverage --token 71ef0d15f6f04ac29b31d704b28f866a", + "report-codacy:integration": "cat coverage/integration/lcov.info | codacy-coverage --token 71ef0d15f6f04ac29b31d704b28f866a", "run": "ts-node", "release": "release-it --non-interactive", "changelog": "auto-changelog -p", @@ -52,7 +51,7 @@ "web3": "^1.2.3" }, "dependencies": { - "@oceanprotocol/keeper-contracts": "^0.12.7", + "@oceanprotocol/keeper-contracts": "^0.13.2", "@oceanprotocol/secret-store-client": "^0.0.15", "bignumber.js": "^9.0.0", "deprecated-decorator": "^0.1.6", @@ -64,14 +63,14 @@ }, "devDependencies": { "@release-it/bumper": "^1.0.5", - "@truffle/hdwallet-provider": "^1.0.26", - "@types/chai": "^4.2.6", + "@truffle/hdwallet-provider": "^1.0.27", + "@types/chai": "^4.2.7", "@types/chai-spies": "^1.0.1", "@types/mocha": "^5.2.7", "@types/node": "^13.1.0", "@types/node-fetch": "^2.5.4", - "@typescript-eslint/eslint-plugin": "^2.10.0", - "@typescript-eslint/parser": "^2.10.0", + "@typescript-eslint/eslint-plugin": "^2.12.0", + "@typescript-eslint/parser": "^2.12.0", "auto-changelog": "^1.16.2", "chai": "^4.2.0", "chai-spies": "^1.0.0", @@ -79,7 +78,7 @@ "eslint": "^6.7.2", "eslint-config-oceanprotocol": "^1.5.0", "eslint-config-prettier": "^6.7.0", - "eslint-plugin-prettier": "^3.1.1", + "eslint-plugin-prettier": "^3.1.2", "lcov-result-merger": "^3.1.0", "mocha": "^6.2.2", "mock-local-storage": "^1.1.11", @@ -88,10 +87,10 @@ "prettier": "^1.19.1", "source-map-support": "^0.5.16", "ts-node": "^8.5.4", - "typedoc": "^0.15.3", - "typescript": "^3.7.3", + "typedoc": "^0.16.8", + "typescript": "^3.7.5", "uglifyjs-webpack-plugin": "^2.2.0", - "webpack": "^4.41.2", + "webpack": "^4.41.3", "webpack-cli": "^3.3.10", "webpack-merge": "^4.2.2" }, diff --git a/scripts/typedoc.js b/scripts/typedoc.js index ddb45ce..7461019 100755 --- a/scripts/typedoc.js +++ b/scripts/typedoc.js @@ -3,7 +3,7 @@ /* eslint-disable security/detect-non-literal-fs-filename */ const fs = require('fs') -const typedoc = require('typedoc') +const TypeDoc = require('typedoc') const typescript = require('typescript') const ora = require('ora') const squidJsPackage = require('../package.json') @@ -21,7 +21,11 @@ const generateJson = () => { const spinnerTypedoc = ora('Generating TypeDoc json...').start() // Setup our TypeDoc app - const app = new typedoc.Application({ + const app = new TypeDoc.Application() + app.options.addReader(new TypeDoc.TSConfigReader()) + app.options.addReader(new TypeDoc.TypeDocReader()) + + app.bootstrap({ tsconfig: config }) diff --git a/src/aquarius/Aquarius.ts b/src/aquarius/Aquarius.ts index bb3c0b2..cd52a2f 100644 --- a/src/aquarius/Aquarius.ts +++ b/src/aquarius/Aquarius.ts @@ -1,7 +1,8 @@ import { URL } from 'whatwg-url' import { DDO } from '../ddo/DDO' import DID from '../ocean/DID' -import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' +import { Logger } from '../utils' +import { WebServiceConnector } from '../ocean/utils/WebServiceConnector' const apiPath = '/api/v1/aquarius/assets/ddo' @@ -21,25 +22,35 @@ export interface SearchQuery { } /** - * Provides a interface with Aquarius. + * Provides an interface with Aquarius. * Aquarius provides an off-chain database store for metadata about data assets. */ -export class Aquarius extends Instantiable { +export class Aquarius { + public fetch: WebServiceConnector + private logger: Logger + private aquariusUri: string + private get url() { - return this.config.aquariusUri + return this.aquariusUri } - constructor(config: InstantiableConfig) { - super() - this.setInstanceConfig(config) + /** + * Instantiate Aquarius (independently of Ocean) for off-chain interaction. + * @param {String} aquariusUri + * @param {Logger} logger + */ + constructor(aquariusUri: string, logger: Logger) { + this.fetch = new WebServiceConnector(logger) + this.logger = logger + this.aquariusUri = aquariusUri } public async getVersionInfo() { - return (await this.ocean.utils.fetch.get(this.url)).json() + return (await this.fetch.get(this.url)).json() } public async getAccessUrl(accessToken: any, payload: any): Promise { - const accessUrl: string = await this.ocean.utils.fetch + const accessUrl: string = await this.fetch .post(`${accessToken.service_endpoint}/${accessToken.resource_id}`, payload) .then((response: any): string => { if (response.ok) { @@ -69,7 +80,7 @@ export class Aquarius extends Instantiable { * @return {Promise} */ public async queryMetadata(query: SearchQuery): Promise { - const result: QueryResult = await this.ocean.utils.fetch + const result: QueryResult = await this.fetch .post(`${this.url}${apiPath}/query`, JSON.stringify(query)) .then((response: any) => { if (response.ok) { @@ -107,7 +118,8 @@ export class Aquarius extends Instantiable { ) fullUrl.searchParams.append('offset', query.offset.toString()) fullUrl.searchParams.append('page', query.page.toString()) - const result: QueryResult = await this.ocean.utils.fetch + + const result: QueryResult = await this.fetch .get(fullUrl) .then((response: any) => { if (response.ok) { @@ -138,7 +150,7 @@ export class Aquarius extends Instantiable { */ public async storeDDO(ddo: DDO): Promise { const fullUrl = `${this.url}${apiPath}` - const result: DDO = await this.ocean.utils.fetch + const result: DDO = await this.fetch .post(fullUrl, DDO.serialize(ddo)) .then((response: any) => { if (response.ok) { @@ -174,7 +186,7 @@ export class Aquarius extends Instantiable { ): Promise { did = did && DID.parse(did) const fullUrl = metadataServiceEndpoint || `${this.url}${apiPath}/${did.getDid()}` - const result = await this.ocean.utils.fetch + const result = await this.fetch .get(fullUrl) .then((response: any) => { if (response.ok) { diff --git a/src/keeper/Keeper.ts b/src/keeper/Keeper.ts index b9a023e..586c918 100644 --- a/src/keeper/Keeper.ts +++ b/src/keeper/Keeper.ts @@ -11,7 +11,6 @@ import { ComputeExecutionCondition } from './contracts/conditions' import { - AgreementTemplate, EscrowAccessSecretStoreTemplate, EscrowComputeExecutionTemplate } from './contracts/templates' @@ -25,6 +24,7 @@ import { objectPromiseAll } from '../utils' import { EventHandler } from './EventHandler' import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' +import { AgreementTemplateBase } from './contracts/templates/AgreementTemplateBase' /** * Interface with Ocean Keeper contracts. @@ -62,14 +62,7 @@ export class Keeper extends Instantiable { accessSecretStoreCondition: AccessSecretStoreCondition.getInstance( config ), - computeExecutionCondition: ComputeExecutionCondition.getInstance(config), - // Templates - escrowAccessSecretStoreTemplate: EscrowAccessSecretStoreTemplate.getInstance( - config - ), - escrowComputeExecutionTemplate: EscrowComputeExecutionTemplate.getInstance( - config - ) + computeExecutionCondition: ComputeExecutionCondition.getInstance(config) }) keeper.connected = true @@ -100,7 +93,19 @@ export class Keeper extends Instantiable { accessSecretStoreCondition: keeper.instances.accessSecretStoreCondition, computeExecutionCondition: keeper.instances.computeExecutionCondition } - // Conditions + // Templates + keeper.instances.escrowAccessSecretStoreTemplate = new EscrowAccessSecretStoreTemplate( + keeper.templateStoreManager, + keeper.agreementStoreManager, + keeper.didRegistry, + keeper.conditions + ) + keeper.instances.escrowComputeExecutionTemplate = new EscrowComputeExecutionTemplate( + keeper.templateStoreManager, + keeper.agreementStoreManager, + keeper.didRegistry, + keeper.conditions + ) keeper.templates = { escrowAccessSecretStoreTemplate: keeper.instances.escrowAccessSecretStoreTemplate, @@ -198,22 +203,22 @@ export class Keeper extends Instantiable { /** * Returns a template by name. * @param {string} name Template name. - * @return {AgreementTemplate} Agreement template instance. + * @return {AgreementTemplateBase} AgreementTemplateBase instance. */ - public getTemplateByName(name: string): AgreementTemplate { + public getTemplateByName(name: string): AgreementTemplateBase { return Object.values(this.templates).find( - template => template.contractName === name + template => template.templateName === name ) } /** * Returns a template by address. - * @param {string} address Template address. - * @return {AgreementTemplate} Agreement template instance. + * @param {string} templateId Template id (hex representation of bytes32). + * @return {AgreementTemplateBase} AgreementTemplateBase instance. */ - public getTemplateByAddress(address: string): AgreementTemplate { + public getTemplateById(templateId: string): AgreementTemplateBase { return Object.values(this.templates).find( - template => template.getAddress() === address + template => template.getId() === templateId ) } diff --git a/src/keeper/contracts/DIDRegistry.ts b/src/keeper/contracts/DIDRegistry.ts index 35e41ac..026491d 100644 --- a/src/keeper/contracts/DIDRegistry.ts +++ b/src/keeper/contracts/DIDRegistry.ts @@ -37,6 +37,11 @@ export default class DIDRegistry extends ContractBase { return this.call('isDIDProvider', [didZeroX(did), zeroX(provider)]) } + public async getDIDProviders(did: string): Promise { + const { providers } = await this.call('getDIDRegister', [didZeroX(did)]) + return providers + } + public async getAttributesByOwner(owner: string): Promise { return ( await this.getPastEvents('DIDAttributeRegistered', { diff --git a/src/keeper/contracts/conditions/ComputeExecutionCondition.ts b/src/keeper/contracts/conditions/ComputeExecutionCondition.ts index ba83313..9456c73 100644 --- a/src/keeper/contracts/conditions/ComputeExecutionCondition.ts +++ b/src/keeper/contracts/conditions/ComputeExecutionCondition.ts @@ -1,5 +1,5 @@ import { Condition } from './Condition.abstract' -import { zeroX, didZeroX, didPrefixed } from '../../../utils' +import { zeroX, didZeroX } from '../../../utils' import { InstantiableConfig } from '../../../Instantiable.abstract' export class ComputeExecutionCondition extends Condition { diff --git a/src/keeper/contracts/managers/AgreementStoreManager.ts b/src/keeper/contracts/managers/AgreementStoreManager.ts index 72bedf8..12cb125 100644 --- a/src/keeper/contracts/managers/AgreementStoreManager.ts +++ b/src/keeper/contracts/managers/AgreementStoreManager.ts @@ -15,11 +15,11 @@ export class AgreementStoreManager extends ContractBase { public static async getInstance( config: InstantiableConfig ): Promise { - const templateStoreManeger: AgreementStoreManager = new AgreementStoreManager( + const templateStoreManager: AgreementStoreManager = new AgreementStoreManager( 'AgreementStoreManager' ) - await templateStoreManeger.init(config) - return templateStoreManeger + await templateStoreManager.init(config) + return templateStoreManager } public getOwner(): Promise { @@ -44,4 +44,59 @@ export class AgreementStoreManager extends ContractBase { blockNumberUpdated: +blockNumberUpdated } as AgreementData } + + /** + * Create a agreement using EscrowComputeExecutionTemplate. + * @param {string} agreementId Generated agreement ID. + * @param {string} did Asset DID. + * @param {string} templateId Template ID. + * @param {string[]} conditionIds List of conditions IDs. + * @param {number[]} timeLocks Timelocks. + * @param {number[]} timeOuts Timeouts. + * @param {string[]} actors ETH account addresses of provider, consumer, etc. + * @param {string} from Action sender. + * + * @return {any} Transaction receipt. + */ + public async createAgreement( + agreementId: string, + did: string, + templateId: string, + conditionIds: string[], + timeLocks: number[], + timeOuts: number[], + actors: string[], + from?: string + ): Promise { + return this.sendFrom( + 'createAgreement', + [ + zeroX(agreementId), + zeroX(did), + zeroX(templateId), + conditionIds.map(zeroX), + timeLocks, + timeOuts, + actors + ], + from + ) + } + + /** + * Generates and returns the agreement creation event. + * @param {string} agreementId Agreement ID. + * @return {Event} Agreement created event. + */ + public getAgreementCreatedEvent(agreementId: string) { + return this.getEvent('AgreementCreated', { + agreementId: zeroX(agreementId) + }) + } + + public getAgreementActorAddedEvent(agreementId: string) { + return this.getEvent('AgreementActorAdded', { + agreementId: zeroX(agreementId) + }) + } } diff --git a/src/keeper/contracts/managers/TemplateStoreManager.ts b/src/keeper/contracts/managers/TemplateStoreManager.ts index 5e48c7f..9efbea2 100644 --- a/src/keeper/contracts/managers/TemplateStoreManager.ts +++ b/src/keeper/contracts/managers/TemplateStoreManager.ts @@ -14,6 +14,8 @@ export interface TemplateMetadata { owner: string lastUpdatedBy: string blockNumberUpdated: number + conditionTypes: string[] + actorTypeIds: string[] } export class TemplateStoreManager extends ContractBase { @@ -27,54 +29,83 @@ export class TemplateStoreManager extends ContractBase { return templateStoreManeger } + public generateId(templateName: string) { + const args: any = [{ type: 'string', value: templateName }] + return this.web3.utils.soliditySha3(...args) + } + public getOwner(): Promise { return this.call('owner', []) } - public async proposeTemplate(address: string, from?: string, ignoreExists?: boolean) { - const template = await this.getTemplate(address) + public async proposeTemplate( + templateId: string, + from?: string, + ignoreExists?: boolean + ) { + const template = await this.getTemplate(templateId) if (template.blockNumberUpdated !== 0) { - this.logger.warn(`Template "${address}" already exist.`) + this.logger.warn(`Template "${templateId}" already exist.`) if (!ignoreExists) { throw new Error('Template already exist.') } } else { - return this.sendFrom('proposeTemplate', [zeroX(address)], from) + return this.sendFrom('proposeTemplate', [zeroX(templateId)], from) } } public async approveTemplate( - address: string, + templateId: string, from?: string, ignoreApproved?: boolean ) { - const template = await this.getTemplate(address) + const template = await this.getTemplate(templateId) if (template.state !== TemplateState.Proposed) { - this.logger.warn(`Template "${address}" is not in "proposed" state.`) + this.logger.warn(`Template "${templateId}" is not in "proposed" state.`) if (!ignoreApproved) { throw new Error(`Template not in "proposed" state.`) } } else { - return this.sendFrom('approveTemplate', [zeroX(address)], from) + return this.sendFrom('approveTemplate', [zeroX(templateId)], from) } } - public revokeTemplate(address: string, from?: string) { - return this.sendFrom('revokeTemplate', [zeroX(address)], from) + public revokeTemplate(templateId: string, from?: string) { + return this.sendFrom('revokeTemplate', [zeroX(templateId)], from) } - public async getTemplate(address: string) { + public async getConditionTypes(templateId: string): Promise { + const { conditionTypes } = await this.getTemplate(templateId) + return conditionTypes + } + + public getConditions(conditionTypes: string[]) { + return conditionTypes.map(address => + this.ocean.keeper.getConditionByAddress(address) + ) + } + + public async getActorTypeValue(actorTypeId: string) { + const typeValue = await this.call('getTemplateActorTypeValue', [actorTypeId]) + return typeValue + } + + public async getTemplate(templateId: string) { const { state, owner, lastUpdatedBy, - blockNumberUpdated - } = await this.call('getTemplate', [zeroX(address)]) + blockNumberUpdated, + conditionTypes, + actorTypeIds + } = await this.call('getTemplate', [zeroX(templateId)]) return { state: +state, owner, lastUpdatedBy, - blockNumberUpdated: +blockNumberUpdated + blockNumberUpdated: +blockNumberUpdated, + conditionTypes, + actorTypeIds } as TemplateMetadata } } diff --git a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts deleted file mode 100644 index 6fed9cc..0000000 --- a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts +++ /dev/null @@ -1,235 +0,0 @@ -import ContractBase from '../ContractBase' -import { - Condition, - ConditionState, - conditionStateNames -} from '../conditions/Condition.abstract' -import { DDO } from '../../../ddo/DDO' -import { ServiceAgreementTemplate } from '../../../ddo/ServiceAgreementTemplate' -import { zeroX } from '../../../utils' -import { InstantiableConfig } from '../../../Instantiable.abstract' - -export interface AgreementConditionsStatus { - [condition: string]: { - condition: string - contractName: string - state: ConditionState - blocked: boolean - blockedBy: string[] - } -} - -export abstract class AgreementTemplate extends ContractBase { - public static async getInstance( - config: InstantiableConfig, - conditionName: string, - templateClass: any - ): Promise { - const condition: AgreementTemplate = new (templateClass as any)(conditionName) - await condition.init(config) - return condition - } - - protected constructor(contractName: string) { - super(contractName) - } - - public createAgreement( - agreementId: string, - did: string, - conditionIds: string[], - timeLocks: number[], - timeOuts: number[], - ...args: any[] - ) - - public createAgreement( - agreementId: string, - did: string, - conditionIds: string[], - timeLocks: number[], - timeOuts: number[], - extraArgs: any[], - from?: string - ) { - return this.sendFrom( - 'createAgreement', - [ - zeroX(agreementId), - zeroX(did), - conditionIds.map(zeroX), - timeLocks, - timeOuts, - ...extraArgs - ], - from - ) - } - - /** - * Conditions address list. - * @return {Promise} Conditions address. - */ - public getConditionTypes(): Promise { - return this.call('getConditionTypes', []) - } - - /** - * List of condition contracts. - * @return {Promise} Conditions contracts. - */ - public async getConditions(): Promise { - return (await this.getConditionTypes()).map(address => - this.ocean.keeper.getConditionByAddress(address) - ) - } - - /** - * Get agreement conditions IDs. - * @param {string} agreementId Agreement ID. - * @param {DDO} ddo DDO. - * @param {string} from Consumer address. - * @return {Promise} Condition IDs. - */ - public abstract getAgreementIdsFromDDO( - agreementId: string, - ddo: DDO, - consumer: string, - from?: string - ): Promise - - /** - * Create a new agreement using the data of a DDO. - * @param {string} agreementId Agreement ID. - * @param {DDO} ddo DDO. - * @param {string} from Creator address. - * @return {Promise} Success. - */ - public abstract createAgreementFromDDO( - agreementId: string, - ddo: DDO, - consumer: string, - from?: string - ): Promise - - public abstract async getServiceAgreementTemplate(): Promise - - public async getServiceAgreementTemplateConditions() { - const serviceAgreementTemplate = await this.getServiceAgreementTemplate() - return serviceAgreementTemplate.conditions - } - - public async getServiceAgreementTemplateConditionByRef(ref: string) { - const name = (await this.getServiceAgreementTemplateConditions()).find( - ({ name: conditionRef }) => conditionRef === ref - ).contractName - return (await this.getConditions()).find( - condition => condition.contractName === name - ) - } - - public async getServiceAgreementTemplateDependencies() { - const serviceAgreementTemplate = await this.getServiceAgreementTemplate() - return serviceAgreementTemplate.conditionDependency - } - - /** - * Returns the status of the conditions. - * @param {string} agreementId Agreement ID. - * @return {Promise} Conditions status. - */ - public async getAgreementStatus( - agreementId: string - ): Promise { - const agreementStore = this.ocean.keeper.agreementStoreManager - const conditionStore = this.ocean.keeper.conditionStoreManager - - const dependencies = await this.getServiceAgreementTemplateDependencies() - const { conditionIds } = await agreementStore.getAgreement(agreementId) - - if (!conditionIds.length) { - this.logger.error(`Agreement not creeated yet: "${agreementId}"`) - return false - } - - const conditionIdByConddition = (await this.getConditions()).reduce( - (acc, { contractName }, i) => ({ - ...acc, - [contractName]: conditionIds[i] - }), - {} - ) - - const statesPromises = Object.keys(dependencies).map(async (ref, i) => { - const { contractName } = await this.getServiceAgreementTemplateConditionByRef( - ref - ) - return { - ref, - contractName, - state: ( - await conditionStore.getCondition( - conditionIdByConddition[contractName] - ) - ).state - } - }) - const states = await Promise.all(statesPromises) - - return states.reduce((acc, { contractName, ref, state }) => { - const blockers = dependencies[ref] - .map(dependency => states.find(_ => _.ref === dependency)) - .filter(condition => condition.state !== ConditionState.Fulfilled) - return { - ...acc, - [ref]: { - condition: ref, - contractName, - state, - blocked: !!blockers.length, - blockedBy: blockers.map(_ => _.ref) - } - } - }, {}) - } - - /** - * Prints the agreement status. - * @param {string} agreementId Agreement ID. - */ - public async printAgreementStatus(agreementId: string) { - const status = await this.getAgreementStatus(agreementId) - - this.logger.bypass('-'.repeat(80)) - this.logger.bypass('Template:', this.contractName) - this.logger.bypass('Agreement ID:', agreementId) - this.logger.bypass('-'.repeat(40)) - if (!status) { - this.logger.bypass('Agreement not created yet!') - } - Object.values(status || []).forEach( - ({ condition, contractName, state, blocked, blockedBy }, i) => { - if (i) { - this.logger.bypass('-'.repeat(20)) - } - this.logger.bypass(`${condition} (${contractName})`) - this.logger.bypass(' Status:', state, `(${conditionStateNames[state]})`) - if (blocked) { - this.logger.bypass(' Blocked by:', blockedBy) - } - } - ) - this.logger.bypass('-'.repeat(80)) - } - - /** - * Generates and returns the agreement creation event. - * @param {string} agreementId Agreement ID. - * @return {Event} Agreement created event. - */ - public getAgreementCreatedEvent(agreementId: string) { - return this.getEvent('AgreementCreated', { - agreementId: zeroX(agreementId) - }) - } -} diff --git a/src/keeper/contracts/templates/AgreementTemplateBase.ts b/src/keeper/contracts/templates/AgreementTemplateBase.ts new file mode 100644 index 0000000..202c73b --- /dev/null +++ b/src/keeper/contracts/templates/AgreementTemplateBase.ts @@ -0,0 +1,314 @@ +import { + TemplateStoreManager, + AgreementStoreManager, + ConditionStoreManager +} from '../managers' +import DIDRegistry from '../DIDRegistry' +import { LockRewardCondition } from '../conditions/LockRewardCondition' +import { AccessSecretStoreCondition } from '../conditions/AccessSecretStoreCondition' +import { EscrowReward } from '../conditions/EscrowReward' +import { DDO } from '../../../ddo/DDO' +import { generateId, LoggerInstance, Logger, zeroX } from '../../../utils' + +import { + ComputeExecutionCondition, + Condition, + ConditionState, + conditionStateNames +} from '../conditions' +import { ServiceType } from '../../../ddo/Service' + +export interface Conditions { + lockRewardCondition: LockRewardCondition + accessSecretStoreCondition?: AccessSecretStoreCondition + computeExecutionCondition?: ComputeExecutionCondition + escrowReward: EscrowReward +} + +export interface AgreementConditionsStatus { + [condition: string]: { + condition: string + contractName: string + state: ConditionState + blocked: boolean + blockedBy: string[] + } +} + +export class AgreementTemplateBase { + public templateName: string + + public templateManager: TemplateStoreManager + + public agreementStoreManager: AgreementStoreManager + + public didRegistry: DIDRegistry + + public conditions: Conditions + + private logger: Logger + + public constructor( + templateManager: TemplateStoreManager, + agreementStoreManager: AgreementStoreManager, + didRegistry: DIDRegistry, + conditions: Conditions + ) { + this.templateManager = templateManager + this.agreementStoreManager = agreementStoreManager + this.didRegistry = didRegistry + this.conditions = conditions + + this.logger = LoggerInstance + this.templateName = 'invalid' + } + + public async createAgreementFromDDO( + agreementId: string, + ddo: DDO, + serviceType: ServiceType, + consumer: string, + provider: string, + from?: string + ) { + return !!(await this.createFullAgreement( + ddo.shortId(), + ddo.findServiceByType(serviceType).attributes.main.price, + consumer, + provider, + from, + agreementId + )) + } + + public async getConditionIdsFromDDO( + agreementId: string, + ddo: DDO, + consumer: string, + from?: string + ) { + return this.createFullAgreementData( + agreementId, + ddo.shortId(), + ddo.findServiceByType('metadata').attributes.main.price, + consumer + ) + } + + public getName() { + return this.templateName + } + + public getId() { + return this.templateManager.generateId(this.getName()) + } + + /** + * Create a agreement using EscrowAccessSecretStoreTemplate using only the most important information. + * @param {string} did Asset DID. + * @param {number} amount Asset price. + * @param {string} consumer ethereum address of consumer. + * @param {string} provider ethereum address of service provider (brizo address) + * @param {string} from Consumer address. + * @param {string} agreementId bytes32 agreement id. + * + * @return {Promise} Agreement ID. + */ + public async createFullAgreement( + did: string, + amount: number | string, + consumer: string, + provider: string, + from?: string, + agreementId: string = generateId() + ): Promise { + const conditionIds = await this.createFullAgreementData( + agreementId, + did, + amount, + consumer + ) + + const timeouts = [0, 0, 0] + const timelocks = [0, 0, 0] + await this.agreementStoreManager.createAgreement( + agreementId, + did, + this.getId(), + conditionIds, + timelocks, + timeouts, + [consumer, provider], + from + ) + return zeroX(agreementId) + } + + protected async createFullAgreementData( + agreementId: string, + did: string, + amount: number | string, + consumer: string + ): Promise { + return null + } + + /** + * Conditions address list. + * @return {Promise} Conditions address. + */ + public async getConditionTypes(): Promise { + return this.templateManager.getConditionTypes(this.getId()) + } + + /** + * List of condition contracts. + * @return {Promise} Conditions contracts. + */ + public async getConditions(): Promise { + return this.templateManager.getConditions(await this.getConditionTypes()) + } + + public async getServiceAgreementTemplate() { + return null + } + + public async getServiceAgreementTemplateConditions() { + const serviceAgreementTemplate = await this.getServiceAgreementTemplate() + return serviceAgreementTemplate.conditions + } + + public async getServiceAgreementTemplateConditionByRef(ref: string) { + const name = (await this.getServiceAgreementTemplateConditions()).find( + ({ name: conditionRef }) => conditionRef === ref + ).contractName + return (await this.getConditions()).find( + condition => condition.contractName === name + ) + } + + public async getServiceAgreementTemplateDependencies() { + const serviceAgreementTemplate = await this.getServiceAgreementTemplate() + return serviceAgreementTemplate.conditionDependency + } + + /** + * Returns the status of the conditions. + * @param {string} agreementId Agreement ID. + * @param {ConditionStoreManager} conditionStoreManager + * @return {Promise} Conditions status. + */ + public async getAgreementStatus( + agreementId: string, + conditionStoreManager: ConditionStoreManager + ): Promise { + const dependencies = await this.getServiceAgreementTemplateDependencies() + const { conditionIds } = await this.agreementStoreManager.getAgreement( + agreementId + ) + if (!conditionIds.length) { + // this.logger.error(`Agreement not creeated yet: "${agreementId}"`) + return false + } + + const conditionIdByCondition = (await this.getConditions()).reduce( + (acc, { contractName }, i) => ({ + ...acc, + [contractName]: conditionIds[i] + }), + {} + ) + + const statesPromises = Object.keys(dependencies).map(async (ref, i) => { + const { contractName } = await this.getServiceAgreementTemplateConditionByRef( + ref + ) + return { + ref, + contractName, + state: ( + await conditionStoreManager.getCondition( + conditionIdByCondition[contractName] + ) + ).state + } + }) + const states = await Promise.all(statesPromises) + + return states.reduce((acc, { contractName, ref, state }) => { + const blockers = dependencies[ref] + .map(dependency => states.find(_ => _.ref === dependency)) + .filter(condition => condition.state !== ConditionState.Fulfilled) + return { + ...acc, + [ref]: { + condition: ref, + contractName, + state, + blocked: !!blockers.length, + blockedBy: blockers.map(_ => _.ref) + } + } + }, {}) + } + + /** + * Prints the agreement status. + * @param {string} agreementId Agreement ID. + * @param {ConditionStoreManager} conditionStoreManager + */ + public async printAgreementStatus( + agreementId: string, + conditionStoreManager: ConditionStoreManager + ) { + const status = await this.getAgreementStatus(agreementId, conditionStoreManager) + + this.logger.bypass('-'.repeat(80)) + this.logger.bypass('Template:', this.templateName) + this.logger.bypass('Agreement ID:', agreementId) + this.logger.bypass('-'.repeat(40)) + if (!status) { + this.logger.bypass('Agreement not created yet!') + } + Object.values(status || []).forEach( + ({ condition, contractName, state, blocked, blockedBy }, i) => { + if (i) { + this.logger.bypass('-'.repeat(20)) + } + this.logger.bypass(`${condition} (${contractName})`) + this.logger.bypass(' Status:', state, `(${conditionStateNames[state]})`) + if (blocked) { + this.logger.bypass(' Blocked by:', blockedBy) + } + } + ) + this.logger.bypass('-'.repeat(80)) + } + + /** + * Generates and returns the agreement creation event. + * @param {string} agreementId Agreement ID. + * @return {Event} Agreement created event. + */ + public getAgreementCreatedEvent(agreementId: string) { + return this.agreementStoreManager.getAgreementCreatedEvent(agreementId) + } + + /** + * Return actor type ids for this template (specified by subclass) + * + */ + public async getActorTypeIds() { + const { actorTypeIds } = await this.templateManager.getTemplate(this.getId()) + return actorTypeIds + } + + /** + * Return actor types (strings) for this template (specified by subclass) + * + */ + public async getActorTypes() { + const actorTypeIds = await this.getActorTypeIds() + return actorTypeIds.map(typeId => this.templateManager.getActorTypeValue(typeId)) + } +} diff --git a/src/keeper/contracts/templates/BaseEscrowTemplate.abstract.ts b/src/keeper/contracts/templates/BaseEscrowTemplate.abstract.ts deleted file mode 100644 index 2d178d7..0000000 --- a/src/keeper/contracts/templates/BaseEscrowTemplate.abstract.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { AgreementTemplate } from './AgreementTemplate.abstract' -import { DDO } from '../../../ddo/DDO' -import { generateId, zeroX } from '../../../utils' -import { InstantiableConfig } from '../../../Instantiable.abstract' - -// import { EscrowComputeExecutionTemplateServiceAgreementTemplate } from './EscrowComputeExecutionTemplate.serviceAgreementTemplate' - -export abstract class BaseEscrowTemplate extends AgreementTemplate { - /** - * Create a agreement using EscrowComputeExecutionTemplate. - * @param {string} agreementId Generated agreement ID. - * @param {string} did Asset DID. - * @param {string[]} conditionIds List of conditions IDs. - * @param {number[]} timeLocks Timelocks. - * @param {number[]} timeOuts Timeouts. - * @param {string} accessConsumer Consumer address. - * @param {string} from Action sender. - * @param {any} Transaction receipt. - */ - public createAgreement( - agreementId: string, - did: string, - conditionIds: string[], - timeLocks: number[], - timeOuts: number[], - accessConsumer: string, - from?: string - ) { - return super.createAgreement( - agreementId, - did, - conditionIds, - timeLocks, - timeOuts, - [accessConsumer], - from - ) - } - - public async getAgreementData(agreementId: string) { - return this.call('getAgreementData', [zeroX(agreementId)]) - } -} diff --git a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.serviceAgreementTemplate.ts b/src/keeper/contracts/templates/EscrowAccess.serviceAgreementTemplate.ts similarity index 97% rename from src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.serviceAgreementTemplate.ts rename to src/keeper/contracts/templates/EscrowAccess.serviceAgreementTemplate.ts index ac26262..651ec6e 100644 --- a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.serviceAgreementTemplate.ts +++ b/src/keeper/contracts/templates/EscrowAccess.serviceAgreementTemplate.ts @@ -1,6 +1,6 @@ import { ServiceAgreementTemplate } from '../../../ddo/ServiceAgreementTemplate' -export const escrowAccessSecretStoreTemplateServiceAgreementTemplate: ServiceAgreementTemplate = { +export const escrowAccessServiceAgreementTemplate: ServiceAgreementTemplate = { contractName: 'EscrowAccessSecretStoreTemplate', events: [ { diff --git a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts index 77b6e4a..fe91cf6 100644 --- a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts +++ b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts @@ -1,113 +1,40 @@ -import { AgreementTemplate } from './AgreementTemplate.abstract' -import { BaseEscrowTemplate } from './BaseEscrowTemplate.abstract' -import { DDO } from '../../../ddo/DDO' -import { generateId, zeroX } from '../../../utils' -import { InstantiableConfig } from '../../../Instantiable.abstract' +import { AgreementTemplateBase, Conditions } from './AgreementTemplateBase' +import { escrowAccessServiceAgreementTemplate } from './EscrowAccess.serviceAgreementTemplate' +import { AgreementStoreManager, TemplateStoreManager } from '../managers' +import DIDRegistry from '../DIDRegistry' -import { escrowAccessSecretStoreTemplateServiceAgreementTemplate } from './EscrowAccessSecretStoreTemplate.serviceAgreementTemplate' - -export class EscrowAccessSecretStoreTemplate extends BaseEscrowTemplate { - public static async getInstance( - config: InstantiableConfig - ): Promise { - return AgreementTemplate.getInstance( - config, - 'EscrowAccessSecretStoreTemplate', - EscrowAccessSecretStoreTemplate - ) +export class EscrowAccessSecretStoreTemplate extends AgreementTemplateBase { + public constructor( + templateManager: TemplateStoreManager, + agreementStoreManager: AgreementStoreManager, + didRegistry: DIDRegistry, + conditions: Conditions + ) { + super(templateManager, agreementStoreManager, didRegistry, conditions) + this.templateName = 'EscrowAccessSecretStoreTemplate' } public async getServiceAgreementTemplate() { - return escrowAccessSecretStoreTemplateServiceAgreementTemplate + return escrowAccessServiceAgreementTemplate } - public async createAgreementFromDDO( - agreementId: string, - ddo: DDO, - consumer: string, - from?: string - ) { - return !!(await this.createFullAgreement( - ddo.shortId(), - ddo.findServiceByType('metadata').attributes.main.price, - consumer, - from, - agreementId - )) - } - - public async getAgreementIdsFromDDO( - agreementId: string, - ddo: DDO, - consumer: string, - from?: string - ) { - const { - accessSecretStoreConditionId, - lockRewardConditionId, - escrowRewardId - } = await this.createFullAgreementData( - agreementId, - ddo.shortId(), - ddo.findServiceByType('metadata').attributes.main.price, - consumer - ) - return [accessSecretStoreConditionId, lockRewardConditionId, escrowRewardId] - } - - /** - * Create a agreement using EscrowAccessSecretStoreTemplate using only the most important information. - * @param {string} did Asset DID. - * @param {number} amount Asset price. - * @param {string} from Consumer address. - * @return {Promise} Agreement ID. - */ - public async createFullAgreement( - did: string, - amount: number | string, - consumer: string, - from?: string, - agreementId: string = generateId() - ): Promise { - const { - accessSecretStoreConditionId, - lockRewardConditionId, - escrowRewardId - } = await this.createFullAgreementData(agreementId, did, amount, consumer) - - await this.createAgreement( - agreementId, - did, - [accessSecretStoreConditionId, lockRewardConditionId, escrowRewardId], - [0, 0, 0], - [0, 0, 0], - consumer, - from - ) - - return zeroX(agreementId) - } - - private async createFullAgreementData( + protected async createFullAgreementData( agreementId: string, did: string, amount: number | string, consumer: string ) { - const { didRegistry, conditions } = this.ocean.keeper - const { - accessSecretStoreCondition, lockRewardCondition, + accessSecretStoreCondition, escrowReward - } = conditions - - const publisher = await didRegistry.getDIDOwner(did) + } = this.conditions + const publisher = await this.didRegistry.getDIDOwner(did) const lockRewardConditionId = await lockRewardCondition.generateIdHash( agreementId, await escrowReward.getAddress(), - amount + String(amount) ) const accessSecretStoreConditionId = await accessSecretStoreCondition.generateIdHash( agreementId, @@ -122,11 +49,6 @@ export class EscrowAccessSecretStoreTemplate extends BaseEscrowTemplate { lockRewardConditionId, accessSecretStoreConditionId ) - - return { - lockRewardConditionId, - accessSecretStoreConditionId, - escrowRewardId - } + return [lockRewardConditionId, accessSecretStoreConditionId, escrowRewardId] } } diff --git a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts b/src/keeper/contracts/templates/EscrowCompute.serviceAgreementTemplate.ts similarity index 97% rename from src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts rename to src/keeper/contracts/templates/EscrowCompute.serviceAgreementTemplate.ts index 149ac2e..732c20d 100644 --- a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts +++ b/src/keeper/contracts/templates/EscrowCompute.serviceAgreementTemplate.ts @@ -1,6 +1,6 @@ import { ServiceAgreementTemplate } from '../../../ddo/ServiceAgreementTemplate' -export const escrowComputeExecutionTemplateServiceAgreementTemplate: ServiceAgreementTemplate = { +export const escrowComputeServiceAgreementTemplate: ServiceAgreementTemplate = { contractName: 'EscrowComputeExecutionTemplate', events: [ { diff --git a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts index b1e3c3e..3720514 100644 --- a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts +++ b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts @@ -1,108 +1,36 @@ -import { AgreementTemplate } from './AgreementTemplate.abstract' -import { BaseEscrowTemplate } from './BaseEscrowTemplate.abstract' -import { DDO } from '../../../ddo/DDO' -import { generateId, zeroX } from '../../../utils' -import { InstantiableConfig } from '../../../Instantiable.abstract' +import { AgreementTemplateBase, Conditions } from './AgreementTemplateBase' +import { escrowComputeServiceAgreementTemplate } from './EscrowCompute.serviceAgreementTemplate' +import { AgreementStoreManager, TemplateStoreManager } from '../managers' +import DIDRegistry from '../DIDRegistry' -import { escrowComputeExecutionTemplateServiceAgreementTemplate } from './EscrowComputeExecutionTemplate.serviceAgreementTemplate' - -export class EscrowComputeExecutionTemplate extends BaseEscrowTemplate { - public static async getInstance( - config: InstantiableConfig - ): Promise { - return AgreementTemplate.getInstance( - config, - 'EscrowComputeExecutionTemplate', - EscrowComputeExecutionTemplate - ) +export class EscrowComputeExecutionTemplate extends AgreementTemplateBase { + public constructor( + templateManager: TemplateStoreManager, + agreementStoreManager: AgreementStoreManager, + didRegistry: DIDRegistry, + conditions: Conditions + ) { + super(templateManager, agreementStoreManager, didRegistry, conditions) + this.templateName = 'EscrowComputeExecutionTemplate' } public async getServiceAgreementTemplate() { - return escrowComputeExecutionTemplateServiceAgreementTemplate + return escrowComputeServiceAgreementTemplate } - public async createAgreementFromDDO( - agreementId: string, - ddo: DDO, - consumer: string, - from?: string - ) { - return !!(await this.createFullAgreement( - ddo.shortId(), - ddo.findServiceByType('metadata').attributes.main.price, - consumer, - from, - agreementId - )) - } - - public async getAgreementIdsFromDDO( - agreementId: string, - ddo: DDO, - consumer: string, - from?: string - ) { - const { - computeExecutionConditionId, - lockRewardConditionId, - escrowRewardId - } = await this.createFullAgreementData( - agreementId, - ddo.shortId(), - ddo.findServiceByType('metadata').attributes.main.price, - consumer - ) - return [computeExecutionConditionId, lockRewardConditionId, escrowRewardId] - } - - /** - * Create a agreement using EscrowAccess____SecretStoreTemplate using only the most important information. - * @param {string} did Asset DID. - * @param {number} amount Asset price. - * @param {string} from Consumer address. - * @return {Promise} Agreement ID. - */ - public async createFullAgreement( - did: string, - amount: number | string, - consumer: string, - from?: string, - agreementId: string = generateId() - ): Promise { - const { - computeExecutionConditionId, - lockRewardConditionId, - escrowRewardId - } = await this.createFullAgreementData(agreementId, did, amount, consumer) - - await this.createAgreement( - agreementId, - did, - [computeExecutionConditionId, lockRewardConditionId, escrowRewardId], - [0, 0, 0], - [0, 0, 0], - consumer, - from - ) - - return zeroX(agreementId) - } - - private async createFullAgreementData( + protected async createFullAgreementData( agreementId: string, did: string, amount: number | string, consumer: string ) { - const { didRegistry, conditions } = this.ocean.keeper - const { - computeExecutionCondition, lockRewardCondition, + computeExecutionCondition, escrowReward - } = conditions + } = this.conditions - const publisher = await didRegistry.getDIDOwner(did) + const publisher = await this.didRegistry.getDIDOwner(did) const lockRewardConditionId = await lockRewardCondition.generateIdHash( agreementId, @@ -122,11 +50,6 @@ export class EscrowComputeExecutionTemplate extends BaseEscrowTemplate { lockRewardConditionId, computeExecutionConditionId ) - - return { - lockRewardConditionId, - computeExecutionConditionId, - escrowRewardId - } + return [lockRewardConditionId, computeExecutionConditionId, escrowRewardId] } } diff --git a/src/keeper/contracts/templates/index.ts b/src/keeper/contracts/templates/index.ts index b8c2746..ea6d954 100644 --- a/src/keeper/contracts/templates/index.ts +++ b/src/keeper/contracts/templates/index.ts @@ -1,4 +1,3 @@ -export * from './AgreementTemplate.abstract' -export { BaseEscrowTemplate } from './BaseEscrowTemplate.abstract' +export * from './AgreementTemplateBase' export { EscrowAccessSecretStoreTemplate } from './EscrowAccessSecretStoreTemplate' export { EscrowComputeExecutionTemplate } from './EscrowComputeExecutionTemplate' diff --git a/src/ocean/Ocean.ts b/src/ocean/Ocean.ts index 38d7e99..c31a077 100644 --- a/src/ocean/Ocean.ts +++ b/src/ocean/Ocean.ts @@ -38,10 +38,14 @@ export class Ocean extends Instantiable { } instance.setInstanceConfig(instanceConfig) + instance.utils = await OceanUtils.getInstance(instanceConfig) instance.keeper = await Keeper.getInstance(instanceConfig) instance.brizo = new Brizo(instanceConfig) - instance.aquarius = new Aquarius(instanceConfig) + instance.aquarius = new Aquarius( + instanceConfig.config.aquariusUri, + instanceConfig.logger + ) instance.accounts = await OceanAccounts.getInstance(instanceConfig) instance.auth = await OceanAuth.getInstance(instanceConfig) @@ -52,8 +56,6 @@ export class Ocean extends Instantiable { instance.tokens = await OceanTokens.getInstance(instanceConfig) instance.versions = await OceanVersions.getInstance(instanceConfig) - instance.utils = await OceanUtils.getInstance(instanceConfig) - return instance } diff --git a/src/ocean/OceanAgreements.ts b/src/ocean/OceanAgreements.ts index 2d83d07..8cf8247 100644 --- a/src/ocean/OceanAgreements.ts +++ b/src/ocean/OceanAgreements.ts @@ -3,7 +3,7 @@ import Account from './Account' import DID from './DID' import { zeroX, didPrefixed } from '../utils' import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' -import { AgreementConditionsStatus } from '../keeper/contracts/templates/AgreementTemplate.abstract' +import { AgreementConditionsStatus } from '../keeper/contracts/templates/AgreementTemplateBase' import { ConditionState } from '../keeper/contracts/conditions/Condition.abstract' import { OceanAgreementsConditions } from './OceanAgreementsConditions' @@ -57,7 +57,7 @@ export class OceanAgreements extends Instantiable { .serviceAgreementTemplate.contractName const agreementConditionsIds = await this.ocean.keeper .getTemplateByName(templateName) - .getAgreementIdsFromDDO(agreementId, ddo, consumer.getId(), consumer.getId()) + .getConditionIdsFromDDO(agreementId, ddo, consumer.getId(), consumer.getId()) const signature = await this.ocean.utils.agreements.signServiceAgreement( ddo, @@ -106,7 +106,8 @@ export class OceanAgreements extends Instantiable { * @param {number} index Service index. * @param {string} signature Service agreement signature. * @param {Account} consumer Consumer account. - * @param {Account} publisher Publisher account. + * @param {string} provider ethereum address of service provider + * @param {Account} from account of party creating the agreement (usually the consumer). * @return {Promise} */ public async create( @@ -115,18 +116,23 @@ export class OceanAgreements extends Instantiable { index: number, signature: string, consumer: Account, - publisher: Account + provider: string, + from: Account ) { const d: DID = DID.parse(did) const ddo = await this.ocean.aquarius.retrieveDDO(d) - - const templateName = ddo.findServiceById<'access'>(index).attributes - .serviceAgreementTemplate.contractName - await this.ocean.keeper + const service = ddo.findServiceById(index) + const templateName = service.attributes.serviceAgreementTemplate.contractName + return this.ocean.keeper .getTemplateByName(templateName) - .createAgreementFromDDO(agreementId, ddo, consumer.getId(), publisher.getId()) - - return true + .createAgreementFromDDO( + agreementId, + ddo, + service.type, + consumer.getId(), + provider, + from.getId() + ) } /** @@ -149,9 +155,17 @@ export class OceanAgreements extends Instantiable { const { templateId } = await this.ocean.keeper.agreementStoreManager.getAgreement( agreementId ) + + if (templateId === `0x${'0'.repeat(64)}`) { + this.logger.error( + `agreement ${agreementId} is not found, templateId is ${templateId}` + ) + return + } + const fullStatus = await this.ocean.keeper - .getTemplateByAddress(templateId) - .getAgreementStatus(agreementId) + .getTemplateById(templateId) + .getAgreementStatus(agreementId, this.ocean.keeper.conditionStoreManager) if (!fullStatus) { return diff --git a/src/ocean/OceanAssets.ts b/src/ocean/OceanAssets.ts index 9193500..d6b4370 100644 --- a/src/ocean/OceanAssets.ts +++ b/src/ocean/OceanAssets.ts @@ -56,7 +56,8 @@ export class OceanAssets extends Instantiable { /** * Creates a new DDO. * @param {MetaData} metadata DDO metadata. - * @param {Account} publisher Publisher account. + * @param {Account} publisher Publisher account. + * @param {list} services list of Service description documents * @return {Promise} */ public create( @@ -106,7 +107,7 @@ export class OceanAssets extends Instantiable { { type: 'access', serviceEndpoint: this.ocean.brizo.getConsumeEndpoint(), - templateId: templates.escrowAccessSecretStoreTemplate.getAddress(), + templateId: templates.escrowAccessSecretStoreTemplate.getId(), attributes: { main: { creator: publisher.getId(), @@ -285,12 +286,14 @@ export class OceanAssets extends Instantiable { * @param {string} did Decentralized ID. * @param {number} index Service index. * @param {Account} consumerAccount Consumer account. + * @param {string} provider ethereum address of service provider (optional) * @return {Promise} Returns Agreement ID */ public order( did: string, index: number, consumerAccount: Account + provider?: string ): SubscribablePromise { return new SubscribablePromise(async observer => { const oceanAgreements = this.ocean.agreements @@ -344,12 +347,23 @@ export class OceanAssets extends Instantiable { observer.next(OrderProgressStep.CreatingAgreement) this.logger.log('Creating agreement') + + // Get provider from didRegistry if not given in arguments + let _provider = provider + if (!provider) { + const providers = await keeper.didRegistry.getDIDProviders(ddo.shortId()) + if (providers) { + _provider = providers[0] + } + } + await oceanAgreements.create( did, agreementId, index, undefined, consumerAccount, + _provider, consumerAccount ) this.logger.log('Agreement created') diff --git a/src/ocean/utils/OceanUtils.ts b/src/ocean/utils/OceanUtils.ts index 2d5a0a2..581398b 100644 --- a/src/ocean/utils/OceanUtils.ts +++ b/src/ocean/utils/OceanUtils.ts @@ -16,9 +16,13 @@ export class OceanUtils extends Instantiable { const instance = new OceanUtils() instance.setInstanceConfig(config) - instance.agreements = new ServiceAgreement(config) - instance.signature = new SignatureUtils(config) - instance.fetch = new WebServiceConnector(config) + instance.agreements = new ServiceAgreement( + config.ocean, + config.logger, + config.web3 + ) + instance.signature = new SignatureUtils(config.web3, config.logger) + instance.fetch = new WebServiceConnector(config.logger) return instance } diff --git a/src/ocean/utils/ServiceAgreement.ts b/src/ocean/utils/ServiceAgreement.ts index 91fd685..55995e1 100644 --- a/src/ocean/utils/ServiceAgreement.ts +++ b/src/ocean/utils/ServiceAgreement.ts @@ -2,13 +2,18 @@ import { ServiceAgreementTemplateCondition } from '../../ddo/ServiceAgreementTem import { DDO } from '../../ddo/DDO' import { ServiceAccess } from '../../ddo/Service' import Account from '../Account' -import { zeroX } from '../../utils' -import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' +import { zeroX, Logger } from '../../utils' +import { Ocean } from '../../squid' +import Web3 from 'web3' -export class ServiceAgreement extends Instantiable { - constructor(config: InstantiableConfig) { - super() - this.setInstanceConfig(config) +export class ServiceAgreement { + private ocean: Ocean + private logger: Logger + private web3: Web3 + constructor(ocean: Ocean, logger: Logger, web3: Web3) { + this.ocean = ocean + this.logger = logger + this.web3 = web3 } public async signServiceAgreement( @@ -76,7 +81,7 @@ export class ServiceAgreement extends Instantiable { timeouts: number[] ): string { const args: any = [ - { type: 'address', value: zeroX(serviceAgreementTemplateId) }, + { type: 'bytes32', value: zeroX(serviceAgreementTemplateId) }, { type: 'bytes32[]', value: valueHashes.map(zeroX) }, { type: 'uint256[]', value: timelocks }, { type: 'uint256[]', value: timeouts }, diff --git a/src/ocean/utils/SignatureUtils.ts b/src/ocean/utils/SignatureUtils.ts index b37a27e..9da6072 100644 --- a/src/ocean/utils/SignatureUtils.ts +++ b/src/ocean/utils/SignatureUtils.ts @@ -1,9 +1,13 @@ -import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' +import Web3 from 'web3' +import { Logger } from '../../utils' -export class SignatureUtils extends Instantiable { - constructor(config: InstantiableConfig) { - super() - this.setInstanceConfig(config) +export class SignatureUtils { + private web3: Web3 + private logger: Logger + + constructor(web3: Web3, logger: Logger) { + this.web3 = web3 + this.logger = logger } public async signText( diff --git a/src/ocean/utils/WebServiceConnector.ts b/src/ocean/utils/WebServiceConnector.ts index 001322d..d34e6fe 100644 --- a/src/ocean/utils/WebServiceConnector.ts +++ b/src/ocean/utils/WebServiceConnector.ts @@ -1,6 +1,6 @@ import { BodyInit, RequestInit, Response } from 'node-fetch' import fs from 'fs' -import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' +import { Logger } from '../../utils' const fetch = require('node-fetch') import save = require('save-file') @@ -8,10 +8,10 @@ import save = require('save-file') /** * Provides a common interface to web services. */ -export class WebServiceConnector extends Instantiable { - constructor(config: InstantiableConfig) { - super() - this.setInstanceConfig(config) +export class WebServiceConnector { + public logger: Logger + constructor(logger: Logger) { + this.logger = logger } public post(url: string, payload: BodyInit): Promise { diff --git a/src/squid.ts b/src/squid.ts index 973039f..2709151 100644 --- a/src/squid.ts +++ b/src/squid.ts @@ -4,6 +4,7 @@ import DID from './ocean/DID' import { Ocean } from './ocean/Ocean' import { LoggerInstance as Logger } from './utils/Logger' import Keeper from './keeper/Keeper' +import { Aquarius } from './aquarius/Aquarius' import * as templates from './keeper/contracts/templates' import * as conditions from './keeper/contracts/conditions' @@ -21,7 +22,17 @@ export { OceanPlatformVersions } from './ocean/OceanVersions' -export { AgreementTemplate } from './keeper/contracts/templates' export { Condition, ConditionState } from './keeper/contracts/conditions' -export { Ocean, Account, Config, DID, Logger, Keeper, conditions, templates, utils } +export { + Ocean, + Account, + Config, + DID, + Logger, + Keeper, + Aquarius, + conditions, + templates, + utils +} diff --git a/test/aquarius/Aquarius.test.ts b/test/aquarius/Aquarius.test.ts index 7cce648..0927779 100644 --- a/test/aquarius/Aquarius.test.ts +++ b/test/aquarius/Aquarius.test.ts @@ -5,6 +5,7 @@ import { Aquarius, SearchQuery } from '../../src/aquarius/Aquarius' import { DDO } from '../../src/ddo/DDO' import DID from '../../src/ocean/DID' import config from '../config' +import { LoggerInstance } from '../../src/utils' use(spies) @@ -53,7 +54,7 @@ describe('Aquarius', () => { } as SearchQuery it('should query metadata', async () => { - spy.on(ocean.utils.fetch, 'post', () => reponsify(getResults([new DDO()]))) + spy.on(aquarius.fetch, 'post', () => reponsify(getResults([new DDO()]))) const result = await aquarius.queryMetadata(query) assert.typeOf(result.results, 'array') @@ -64,7 +65,7 @@ describe('Aquarius', () => { }) it('should query metadata and return real ddo', async () => { - spy.on(ocean.utils.fetch, 'post', () => reponsify(getResults([new DDO()]))) + spy.on(aquarius.fetch, 'post', () => reponsify(getResults([new DDO()]))) const result = await aquarius.queryMetadata(query) assert.typeOf(result.results, 'array') @@ -87,7 +88,7 @@ describe('Aquarius', () => { } as SearchQuery it('should query metadata by text', async () => { - spy.on(ocean.utils.fetch, 'get', () => reponsify(getResults([new DDO()]))) + spy.on(aquarius.fetch, 'get', () => reponsify(getResults([new DDO()]))) const result = await aquarius.queryMetadataByText(query) assert.typeOf(result.results, 'array') @@ -97,8 +98,20 @@ describe('Aquarius', () => { assert.equal(result.totalResults, 1) }) + it('should query metadata by text with a new instance', async () => { + const aquariusNew = new Aquarius(config.aquariusUri, LoggerInstance) + spy.on(aquariusNew.fetch, 'get', () => reponsify(getResults([new DDO()]))) + + const result = await aquariusNew.queryMetadataByText(query) + assert.typeOf(result.results, 'array') + assert.lengthOf(result.results, 1) + assert.equal(result.page, 0) + assert.equal(result.totalPages, 1) + assert.equal(result.totalResults, 1) + }) + it('should query metadata and return real ddo', async () => { - spy.on(ocean.utils.fetch, 'get', () => reponsify(getResults([new DDO()]))) + spy.on(aquarius.fetch, 'get', () => reponsify(getResults([new DDO()]))) const result = await aquarius.queryMetadataByText(query) assert.typeOf(result.results, 'array') @@ -114,7 +127,7 @@ describe('Aquarius', () => { id: did.getId() }) - spy.on(ocean.utils.fetch, 'post', () => reponsify(ddo)) + spy.on(aquarius.fetch, 'post', () => reponsify(ddo)) const result: DDO = await aquarius.storeDDO(ddo) assert(result) @@ -129,8 +142,8 @@ describe('Aquarius', () => { id: did.getId() }) - spy.on(ocean.utils.fetch, 'post', () => reponsify(ddo)) - spy.on(ocean.utils.fetch, 'get', () => reponsify(ddo)) + spy.on(aquarius.fetch, 'post', () => reponsify(ddo)) + spy.on(aquarius.fetch, 'get', () => reponsify(ddo)) const storageResult: DDO = await aquarius.storeDDO(ddo) assert(storageResult) diff --git a/test/ddo/DDO.test.ts b/test/ddo/DDO.test.ts index c46afb3..3747834 100644 --- a/test/ddo/DDO.test.ts +++ b/test/ddo/DDO.test.ts @@ -1,6 +1,5 @@ import { assert, expect, spy, use } from 'chai' import spies from 'chai-spies' -import Web3 from 'web3' import { DDO } from '../../src/ddo/DDO' import { Service } from '../../src/ddo/Service' @@ -164,13 +163,11 @@ describe('DDO', () => { ] }) - let web3: Web3 let ocean: Ocean beforeEach(async () => { await TestContractHandler.prepareContracts() ocean = await Ocean.getInstance(config) - ;({ web3 } = ocean as any) }) afterEach(() => { diff --git a/test/keeper/TestContractHandler.ts b/test/keeper/TestContractHandler.ts index edf73c9..5487204 100644 --- a/test/keeper/TestContractHandler.ts +++ b/test/keeper/TestContractHandler.ts @@ -87,9 +87,8 @@ export default class TestContractHandler extends ContractHandler { didRegistry.options.address ] ) - // Conditions - const lockRewardCondition = await TestContractHandler.deployContract( + const lockCondition = await TestContractHandler.deployContract( 'LockRewardCondition', deployerAddress, [ @@ -98,7 +97,7 @@ export default class TestContractHandler extends ContractHandler { token.options.address ] ) - const accessSecretStoreCondition = await TestContractHandler.deployContract( + const accessCondition = await TestContractHandler.deployContract( 'AccessSecretStoreCondition', deployerAddress, [ @@ -107,9 +106,8 @@ export default class TestContractHandler extends ContractHandler { agreementStoreManager.options.address ] ) - // Conditions rewards - const escrowReward = await TestContractHandler.deployContract( + const escrowCondition = await TestContractHandler.deployContract( 'EscrowReward', deployerAddress, [ @@ -118,20 +116,7 @@ export default class TestContractHandler extends ContractHandler { token.options.address ] ) - - // Templates - await TestContractHandler.deployContract( - 'EscrowAccessSecretStoreTemplate', - deployerAddress, - [ - deployerAddress, - agreementStoreManager.options.address, - didRegistry.options.address, - accessSecretStoreCondition.options.address, - lockRewardCondition.options.address, - escrowReward.options.address - ] - ) + Logger.log(lockCondition, accessCondition, escrowCondition) } private static async deployContract( diff --git a/test/keeper/templates/EscrowAccessSecretStoreTemplate.test.ts b/test/keeper/templates/EscrowAccessSecretStoreTemplate.test.ts deleted file mode 100644 index 1518423..0000000 --- a/test/keeper/templates/EscrowAccessSecretStoreTemplate.test.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { assert } from 'chai' -import { EscrowAccessSecretStoreTemplate } from '../../../src/keeper/contracts/templates' -import config from '../../config' -import TestContractHandler from '../TestContractHandler' -import { Ocean } from '../../../src/ocean/Ocean' - -let condition: EscrowAccessSecretStoreTemplate - -describe('EscrowAccessSecretStoreTemplate', () => { - before(async () => { - const ocean: Ocean = await Ocean.getInstance(config) - await TestContractHandler.prepareContracts() - condition = ocean.keeper.templates.escrowAccessSecretStoreTemplate - }) - - // describe("#hashValues()", () => { - // it("should hash the values", async () => { - // const address = `0x${"a".repeat(40)}` - // const hash = await condition.hashValues(address, 15) - - // assert.match(hash, /^0x[a-f0-9]{64}$/i) - // }) - // }) -})