From 3f90ab2ef0545878e518d9ff2513bac29e29c1f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Guti=C3=A9rrez?= Date: Thu, 1 Aug 2019 15:24:17 +0200 Subject: [PATCH 01/56] Added initial Computing service definition. --- src/ddo/ComputingProvider.ts | 25 +++++++++++++++++++++++++ src/ddo/Service.ts | 11 +++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/ddo/ComputingProvider.ts diff --git a/src/ddo/ComputingProvider.ts b/src/ddo/ComputingProvider.ts new file mode 100644 index 0000000..dc9b2f6 --- /dev/null +++ b/src/ddo/ComputingProvider.ts @@ -0,0 +1,25 @@ +export interface Provider { + type: string + description: string + environment: { + cluster: { + type: string + url: string + } + supportedContainers: { + image: string + tag: string + checksum: string + }[] + supportedServers: { + serverId: string + serverType: string + price: string + cpu: string + gpu: string + memory: string + disk: string + maxExecutionTime: number + }[] + } +} diff --git a/src/ddo/Service.ts b/src/ddo/Service.ts index d510a0c..ce08832 100644 --- a/src/ddo/Service.ts +++ b/src/ddo/Service.ts @@ -1,11 +1,13 @@ import { MetaData } from './MetaData' import { ServiceAgreementTemplate } from './ServiceAgreementTemplate' +import { Provider } from './ComputingProvider' export type ServiceType = | 'Authorization' | 'Metadata' | 'Access' | 'Compute' + | 'Computing' | 'FitchainCompute' export interface ServiceCommon { @@ -34,6 +36,13 @@ export interface ServiceAccess extends ServiceCommon { serviceAgreementTemplate?: ServiceAgreementTemplate } +export interface ServiceComputing extends ServiceCommon { + type: 'Computing' + templateId?: string + provider?: Provider + serviceAgreementTemplate?: ServiceAgreementTemplate +} + export interface ServiceCompute extends ServiceCommon { templateId?: string } @@ -44,6 +53,8 @@ export type Service< ? ServiceAuthorization : T extends 'Metadata' ? ServiceMetadata + : T extends 'Computing' + ? ServiceComputing : T extends 'Access' ? ServiceAccess : T extends 'Compute' From ba542f299abe99a77812f229c1b6881e482d59d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Guti=C3=A9rrez?= Date: Wed, 7 Aug 2019 12:17:56 +0200 Subject: [PATCH 02/56] Add initial workflow definition. --- src/ddo/MetaData.ts | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/ddo/MetaData.ts b/src/ddo/MetaData.ts index 1ee420a..2b316ea 100644 --- a/src/ddo/MetaData.ts +++ b/src/ddo/MetaData.ts @@ -1,3 +1,44 @@ +export interface StageRequirements { + computeServiceId?: string + serviceDefinitionId?: string + serverId?: string + serverInstances?: string + container: { + image: string + tag: string + checksum: string + } +} + +export interface StageInput { + index: number + id: string +} + +export interface StageTransformation { + id: string +} + +export interface StageOutput { + metadataUrl: string + secretStoreUrl: string + accessProxyUrl: string + metadata: MetaDataBase +} + +export interface Stage { + index: number + stageType?: string + requirements: StageRequirements + input: StageInput + transformation: StageTransformation + output: StageOutput +} + +export interface Workflow { + stages: Stage[] +} + export interface File { /** * File name. @@ -199,6 +240,8 @@ export interface MetaDataBase { checksum?: string encryptedFiles?: any + + workflow?: Workflow } /** From 07d17fe32e5c214662f7cd1b5e40f99ce8823d89 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 15 Aug 2019 13:23:56 +0200 Subject: [PATCH 03/56] update metadata to OEP-8 v0.4 --- integration/ocean/AssetOwners.test.ts | 2 +- integration/ocean/ConsumeAsset.test.ts | 8 +- integration/ocean/ConsumeAssetBrizo.test.ts | 2 +- integration/ocean/ConsumeBigAsset.test.ts | 6 +- integration/ocean/SearchAsset.test.ts | 2 +- integration/ocean/Signature.test.ts | 2 +- integration/ocean/Versions.test.ts | 2 +- integration/utils/ddo-metadata-generator.ts | 43 ++-- src/ddo/DDO.ts | 8 +- src/ddo/MetaData.ts | 198 ++++++++++-------- .../EscrowAccessSecretStoreTemplate.ts | 4 +- src/ocean/OceanAssets.ts | 16 +- src/utils/DDOHelpers.ts | 2 +- test/ddo/DDO.test.ts | 60 +++--- test/testdata/ddo.json | 56 +++-- 15 files changed, 221 insertions(+), 190 deletions(-) diff --git a/integration/ocean/AssetOwners.test.ts b/integration/ocean/AssetOwners.test.ts index 03165df..eb514e9 100644 --- a/integration/ocean/AssetOwners.test.ts +++ b/integration/ocean/AssetOwners.test.ts @@ -72,7 +72,7 @@ describe('Asset Owners', () => { // Granting access try { await account2.requestTokens( - +metadata.base.price * + +metadata.main.price * 10 ** -(await ocean.keeper.token.decimals()) ) } catch {} diff --git a/integration/ocean/ConsumeAsset.test.ts b/integration/ocean/ConsumeAsset.test.ts index 7635e22..bca25c0 100644 --- a/integration/ocean/ConsumeAsset.test.ts +++ b/integration/ocean/ConsumeAsset.test.ts @@ -31,7 +31,7 @@ describe('Consume Asset', () => { } }) - it('should regiester a asset', async () => { + it('should register an asset', async () => { ddo = await ocean.assets.create(metadata as any, publisher) assert.isDefined(ddo, 'Register has not returned a DDO') @@ -50,7 +50,7 @@ describe('Consume Asset', () => { it('should be able to request tokens for consumer', async () => { const initialBalance = (await consumer.getBalance()).ocn const claimedTokens = - +metadata.base.price * 10 ** -(await ocean.keeper.token.decimals()) + +metadata.main.price * 10 ** -(await ocean.keeper.token.decimals()) try { await consumer.requestTokens(claimedTokens) @@ -115,7 +115,7 @@ describe('Consume Asset', () => { it('should lock the payment by the consumer', async () => { const paid = await ocean.agreements.conditions.lockReward( serviceAgreementSignatureResult.agreementId, - ddo.findServiceByType('Metadata').metadata.base.price, + ddo.findServiceByType('Metadata').metadata.main.price, consumer ) @@ -182,7 +182,7 @@ describe('Consume Asset', () => { ) }) - it('should consume and store one assets', async () => { + it('should consume and store one asset', async () => { const accessService = ddo.findServiceByType('Access') const folder = '/tmp/ocean/squid-js-2' diff --git a/integration/ocean/ConsumeAssetBrizo.test.ts b/integration/ocean/ConsumeAssetBrizo.test.ts index fe82d10..dac6736 100644 --- a/integration/ocean/ConsumeAssetBrizo.test.ts +++ b/integration/ocean/ConsumeAssetBrizo.test.ts @@ -54,7 +54,7 @@ describe('Consume Asset (Brizo)', () => { try { await consumer.requestTokens( - +metadata.base.price * + +metadata.main.price * 10 ** -(await ocean.keeper.token.decimals()) ) } catch {} diff --git a/integration/ocean/ConsumeBigAsset.test.ts b/integration/ocean/ConsumeBigAsset.test.ts index 19d07ef..3580207 100644 --- a/integration/ocean/ConsumeBigAsset.test.ts +++ b/integration/ocean/ConsumeBigAsset.test.ts @@ -30,8 +30,8 @@ xdescribe('Consume Asset (Large size)', () => { } metadata = { ...baseMetadata, - base: { - ...baseMetadata.base, + main: { + ...baseMetadata.main, files: [ { url: 'https://speed.hetzner.de/1GB.bin' @@ -52,7 +52,7 @@ xdescribe('Consume Asset (Large size)', () => { try { await consumer.requestTokens( - +metadata.base.price * + +metadata.main.price * 10 ** -(await ocean.keeper.token.decimals()) ) } catch {} diff --git a/integration/ocean/SearchAsset.test.ts b/integration/ocean/SearchAsset.test.ts index 640f7d5..dc30fc3 100644 --- a/integration/ocean/SearchAsset.test.ts +++ b/integration/ocean/SearchAsset.test.ts @@ -45,7 +45,7 @@ describe('Search Asset', () => { } }) - it('should regiester some a asset', async () => { + it('should register an asset', async () => { assert.instanceOf( await ocean.assets.create( metadataGenerator('Test1') as any, diff --git a/integration/ocean/Signature.test.ts b/integration/ocean/Signature.test.ts index e2dc6e1..e78b39d 100644 --- a/integration/ocean/Signature.test.ts +++ b/integration/ocean/Signature.test.ts @@ -64,7 +64,7 @@ describe('Signature', () => { { type: 'Metadata', metadata: { - base: { + main: { price: 10 } } diff --git a/integration/ocean/Versions.test.ts b/integration/ocean/Versions.test.ts index 621b8f6..5021171 100644 --- a/integration/ocean/Versions.test.ts +++ b/integration/ocean/Versions.test.ts @@ -11,7 +11,7 @@ describe('Versions', () => { ocean = await Ocean.getInstance(config) }) - it('should returns the versions', async () => { + it('should return the versions', async () => { const versions = await ocean.versions.get() assert.equal(versions.aquarius.status, OceanPlatformTechStatus.Working) diff --git a/integration/utils/ddo-metadata-generator.ts b/integration/utils/ddo-metadata-generator.ts index f7db412..57311d2 100644 --- a/integration/utils/ddo-metadata-generator.ts +++ b/integration/utils/ddo-metadata-generator.ts @@ -1,15 +1,30 @@ import { MetaData } from '../../src' // @oceanprotocol/squid const metadata: Partial = { - base: { + main: { name: undefined, type: 'dataset', - description: - 'Weather information of UK including temperature and humidity', dateCreated: '2012-10-10T17:00:00Z', datePublished: '2012-10-10T17:00:00Z', author: 'Met Office', license: 'CC-BY', + price: '21' + '0'.repeat(18), + files: [ + { + index: 0, + url: + 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/package.json' + }, + { + index: 1, + url: + 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/README.md' + } + ] + }, + additionalInformation: { + description: + 'Weather information of UK including temperature and humidity', copyrightHolder: 'Met Office', workExample: '423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68', @@ -27,20 +42,7 @@ const metadata: Partial = { ], inLanguage: 'en', categories: ['Economy', 'Data Science'], - tags: ['weather', 'uk', '2011', 'temperature', 'humidity'], - price: '21' + '0'.repeat(18), - files: [ - { - index: 0, - url: - 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/package.json' - }, - { - index: 1, - url: - 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/README.md' - } - ] + tags: ['weather', 'uk', '2011', 'temperature', 'humidity'] } } @@ -49,10 +51,13 @@ export const generateMetadata = ( price?: number ): Partial => ({ ...metadata, - base: { - ...metadata.base, + main: { + ...metadata.main, name, price: (price || 21) + '0'.repeat(18) + }, + additionalInformation: { + ...metadata.additionalInformation } }) diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 6baf9a2..9736d07 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -102,7 +102,7 @@ export class DDO { */ public getChecksum(): string { const { metadata } = this.findServiceByType('Metadata') - const { files, name, author, license } = metadata.base + const { files, name, author, license } = metadata.main const values = [ ...(files || []).map(({ checksum }) => checksum).filter(_ => !!_), @@ -121,7 +121,7 @@ export class DDO { * Generates proof using personal sing. * @param {Web3} web3 Web3 instance. * @param {string} publicKey Public key to be used on personal sign. - * @param {string} password Password if it's requirted. + * @param {string} password Password if it's required. * @return {Promise} Proof object. */ public async generateProof( @@ -150,11 +150,11 @@ export class DDO { */ public addChecksum(): void { const metadataService = this.findServiceByType('Metadata') - if (metadataService.metadata.base.checksum) { + if (metadataService.metadata.main.checksum) { LoggerInstance.log('Checksum already exists') return } - metadataService.metadata.base.checksum = this.getChecksum() + metadataService.metadata.main.checksum = this.getChecksum() } /** diff --git a/src/ddo/MetaData.ts b/src/ddo/MetaData.ts index 2b316ea..fe192b0 100644 --- a/src/ddo/MetaData.ts +++ b/src/ddo/MetaData.ts @@ -1,8 +1,4 @@ export interface StageRequirements { - computeServiceId?: string - serviceDefinitionId?: string - serverId?: string - serverInstances?: string container: { image: string tag: string @@ -23,7 +19,7 @@ export interface StageOutput { metadataUrl: string secretStoreUrl: string accessProxyUrl: string - metadata: MetaDataBase + metadata: MetaDataMain } export interface Stage { @@ -39,6 +35,38 @@ export interface Workflow { stages: Stage[] } +export interface Algorithm { + language: string + format?: string + version?: string + entrypoint: string + requirements: { + requirement: string + version: string + } +} + +export interface ServiceDefinition { + auth: { + type: string + user?: string + password?: string + token?: string + } + endpoints: { + index: number + url: string + method: string + contentTypes: string[] + } +} + +export interface Service { + spec?: string + specChecksum?: string + definition: ServiceDefinition +} + export interface File { /** * File name. @@ -105,10 +133,10 @@ export interface File { } /** - * Base attributes of Assets Metadata. - * @see https://github.com/oceanprotocol/OEPs/tree/master/8#base-attributes + * Main attributes of assets metadata. + * @see https://github.com/oceanprotocol/OEPs/tree/master/8 */ -export interface MetaDataBase { +export interface MetaDataMain { /** * Descriptive name of the Asset. * @type {string} @@ -124,14 +152,6 @@ export interface MetaDataBase { */ type: 'dataset' | 'algorithm' | 'container' | 'workflow' | 'other' - /** - * Details of what the resource is. For a dataset, this attribute - * explains what the data represents and what it can be used for. - * @type {string} - * @example "Weather information of UK including temperature and humidity" - */ - description?: string - /** * The date on which the asset was created by the originator in * ISO 8601 format, Coordinated Universal Time. @@ -164,6 +184,83 @@ export interface MetaDataBase { */ license: string + /** + * Price of the asset. + * @type {string} + * @example "1000000000000000000" + */ + price: string + + /** + * Array of File objects including the encrypted file urls and some additional information. + * @type {File[]} + */ + files: File[] + + /** + * SHA3 hash of concatenated values: [list of all file checksums] + name + author + license + did + * @type {string} + */ + checksum?: string + + encryptedFiles?: any + + encryptedService?: any + + workflow?: Workflow + + algorithm?: Algorithm + + service?: Service +} + +/** + * Curation attributes of Assets Metadata. + * @see https://github.com/oceanprotocol/OEPs/tree/master/8 + */ +export interface Curation { + /** + * Decimal value between 0 and 1. 0 is the default value. + * @type {number} + * @example 0.93 + */ + rating: number + + /** + * Number of votes. 0 is the default value. + * @type {number} + * @example 123 + */ + numVotes: number + + /** + * Schema applied to calculate the rating. + * @type {string} + * @example "Binary Voting" + */ + schema?: string + + /** + * Flag unsuitable content. + * @type {boolean} + * @example true + */ + isListed?: boolean +} + +/** + * Additional Information of Assets Metadata. + * @see https://github.com/oceanprotocol/OEPs/tree/master/8#additional-information + */ +export interface AdditionalInformation { + /** + * Details of what the resource is. For a dataset, this attribute + * explains what the data represents and what it can be used for. + * @type {string} + * @example "Weather information of UK including temperature and humidity" + */ + description?: string + /** * The party holding the legal copyright. Empty by default. * @type {string} @@ -220,62 +317,6 @@ export interface MetaDataBase { */ tags?: string[] - /** - * Price of the asset. - * @type {string} - * @example "1000000000000000000" - */ - price: string - - /** - * Array of File objects including the encrypted file urls and some additional information. - * @type {File[]} - */ - files: File[] - - /** - * SHA3 hash of concatenated values: [list of all file checksums] + name + author + license + did - * @type {string} - */ - checksum?: string - - encryptedFiles?: any - - workflow?: Workflow -} - -/** - * Curation attributes of Assets Metadata. - * @see https://github.com/oceanprotocol/OEPs/tree/master/8#curation-attributes - */ -export interface Curation { - /** - * Decimal value between 0 and 1. 0 is the default value. - * @type {number} - * @example 0.93 - */ - rating: number - - /** - * Number of votes. 0 is the default value. - * @type {number} - * @example 123 - */ - numVotes: number - - /** - * Schema applied to calculate the rating. - * @type {string} - * @example "Binary Voting" - */ - schema?: string -} - -/** - * Additional Information of Assets Metadata. - * @see https://github.com/oceanprotocol/OEPs/tree/master/8#additional-information - */ -export interface AdditionalInformation { /** * An indication of update latency - i.e. How often are updates expected (seldom, * annually, quarterly, etc.), or is the resource static that is never expected @@ -283,28 +324,21 @@ export interface AdditionalInformation { * @type {string} * @example "yearly" */ - updateFrequency: string + updateFrequency?: string /** * A link to machine-readable structured markup (such as ttl/json-ld/rdf) * describing the dataset. * @type {StructuredMarkup[]} */ - structuredMarkup: { + structuredMarkup?: { uri: string mediaType: string }[] - - /** - * Checksum of attributes to be able to compare if there are changes in - * the asset that you are purchasing. - * @type {string} - */ - checksum: string } export interface MetaData { + main: MetaDataMain additionalInformation?: AdditionalInformation - base: MetaDataBase curation?: Curation } diff --git a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts index c5a256a..2c4dcc1 100644 --- a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts +++ b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts @@ -59,7 +59,7 @@ export class EscrowAccessSecretStoreTemplate extends AgreementTemplate { ) { return !!(await this.createFullAgreement( ddo.shortId(), - ddo.findServiceByType('Metadata').metadata.base.price, + ddo.findServiceByType('Metadata').metadata.main.price, consumer, from, agreementId @@ -79,7 +79,7 @@ export class EscrowAccessSecretStoreTemplate extends AgreementTemplate { } = await this.createFullAgreementData( agreementId, ddo.shortId(), - ddo.findServiceByType('Metadata').metadata.base.price, + ddo.findServiceByType('Metadata').metadata.main.price, consumer ) return [ diff --git a/src/ocean/OceanAssets.ts b/src/ocean/OceanAssets.ts index 0ec933c..f45c7eb 100644 --- a/src/ocean/OceanAssets.ts +++ b/src/ocean/OceanAssets.ts @@ -81,7 +81,7 @@ export class OceanAssets extends Instantiable { observer.next(CreateProgressStep.EncryptingFiles) const encryptedFiles = await this.ocean.secretStore.encrypt( did.getId(), - metadata.base.files, + metadata.main.files, publisher ) this.logger.log('Files encrypted') @@ -135,11 +135,11 @@ export class OceanAssets extends Instantiable { // Overwrites defaults ...metadata, // Cleaning not needed information - base: { - ...metadata.base, + main: { + ...metadata.main, contentUrls: undefined, encryptedFiles, - files: metadata.base.files.map( + files: metadata.main.files.map( (file, index) => ({ ...file, index, @@ -165,7 +165,7 @@ export class OceanAssets extends Instantiable { })) as Service[] }) - // Overwritte initial service agreement conditions + // Overwrite initial service agreement conditions const rawConditions = await templates.escrowAccessSecretStoreTemplate.getServiceAgreementTemplateConditions() const conditions = fillConditionsWithDDO(rawConditions, ddo) serviceAgreementTemplate.conditions = conditions @@ -237,7 +237,7 @@ export class OceanAssets extends Instantiable { const accessService = ddo.findServiceById(serviceDefinitionId) - const { files } = metadata.base + const { files } = metadata.main const { serviceEndpoint } = accessService @@ -265,7 +265,7 @@ export class OceanAssets extends Instantiable { } else { const files = await this.ocean.secretStore.decrypt( did, - ddo.findServiceByType('Metadata').metadata.base.encryptedFiles, + ddo.findServiceByType('Metadata').metadata.main.encryptedFiles, consumerAccount, ddo.findServiceByType('Authorization').serviceEndpoint ) @@ -327,7 +327,7 @@ export class OceanAssets extends Instantiable { observer.next(OrderProgressStep.LockingPayment) const paid = await oceanAgreements.conditions.lockReward( agreementId, - metadata.base.price, + metadata.main.price, consumer ) observer.next(OrderProgressStep.LockedPayment) diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index 3a27c1a..1a68198 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -13,7 +13,7 @@ function fillParameterWithDDO( case 'amount': case 'price': return String( - ddo.findServiceByType('Metadata').metadata.base.price + ddo.findServiceByType('Metadata').metadata.main.price ) case 'assetId': case 'documentId': diff --git a/test/ddo/DDO.test.ts b/test/ddo/DDO.test.ts index 0a35b82..20b7726 100644 --- a/test/ddo/DDO.test.ts +++ b/test/ddo/DDO.test.ts @@ -91,41 +91,13 @@ describe('DDO', () => { serviceEndpoint: 'http://myaquarius.org/api/v1/provider/assets/metadata/{did}', metadata: { - base: { + main: { name: 'UK Weather information 2011', type: 'dataset', - description: - 'Weather information of UK including temperature and humidity', dateCreated: '2012-10-10T17:00:000Z', datePublished: '2012-10-10T17:00:000Z', author: 'Met Office', license: 'CC-BY', - copyrightHolder: 'Met Office', - workExample: - '423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68', - links: [ - { - sample1: - 'http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-daily/' - }, - { - sample2: - 'http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-averages-25km/' - }, - { - fieldsDescription: - 'http://data.ceda.ac.uk/badc/ukcp09/' - } - ], - inLanguage: 'en', - categories: ['Economy', 'Data Science'], - tags: [ - 'weather', - 'uk', - '2011', - 'temperature', - 'humidity' - ], price: 10, files: [ { @@ -152,7 +124,35 @@ describe('DDO', () => { schema: 'Binary Voting' }, additionalInformation: { - updateFrecuency: 'yearly', + description: + 'Weather information of UK including temperature and humidity', + copyrightHolder: 'Met Office', + workExample: + '423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68', + links: [ + { + sample1: + 'http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-daily/' + }, + { + sample2: + 'http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-averages-25km/' + }, + { + fieldsDescription: + 'http://data.ceda.ac.uk/badc/ukcp09/' + } + ], + inLanguage: 'en', + categories: ['Economy', 'Data Science'], + tags: [ + 'weather', + 'uk', + '2011', + 'temperature', + 'humidity' + ], + updateFrequency: 'yearly', structuredMarkup: [ { uri: diff --git a/test/testdata/ddo.json b/test/testdata/ddo.json index cd53e6b..1388d2b 100644 --- a/test/testdata/ddo.json +++ b/test/testdata/ddo.json @@ -58,9 +58,7 @@ }, "events": { "PaymentLocked": { - "actorType": [ - "publisher" - ], + "actorType": ["publisher"], "handlers": [ { "moduleName": "accessControl", @@ -84,9 +82,7 @@ }, "events": { "PaymentReleased": { - "actorType": [ - "publisher" - ], + "actorType": ["publisher"], "handlers": [ { "moduleName": "serviceAgreement", @@ -110,9 +106,7 @@ }, "events": { "AccessGranted": { - "actorType": [ - "consumer" - ], + "actorType": ["consumer"], "handlers": [ { "moduleName": "asset", @@ -136,9 +130,7 @@ }, "events": { "PaymentRefund": { - "actorType": [ - "consumer" - ], + "actorType": ["consumer"], "handlers": [ { "moduleName": "serviceAgreement", @@ -165,26 +157,34 @@ "base": { "name": "UK Weather information 2011", "type": "dataset", - "description": "Weather information of UK including temperature and humidity", "dateCreated": "2012-10-10T17:00:000Z", "author": "Met Office", "license": "CC-BY", + "price": 10, + "files": [ + { + "index": 0, + "url": "https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip", + "checksum": "085340abffh21495345af97c6b0e761", + "contentLength": 12324 + }, + { + "url": "https://testocnfiles.blob.core.windows.net/testfiles/testzkp2.zip" + } + ] + }, + "curation": { + "rating": 0.93, + "numVotes": 123, + "schema": "Binary Voting" + }, + "additionalInformation": { + "description": "Weather information of UK including temperature and humidity", "copyrightHolder": "Met Office", "workExample": "423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68", "contentUrls": [ "https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip" ], - "files": [ - { - "index": 0, - "url": "https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip", - "checksum": "085340abffh21495345af97c6b0e761", - "contentLength": 12324 - }, - { - "url": "https://testocnfiles.blob.core.windows.net/testfiles/testzkp2.zip" - } - ], "links": [ { "name": "Sample of Asset Data", @@ -200,14 +200,6 @@ "inLanguage": "en", "categories": ["Economy", "Data Science"], "tags": ["weather", "uk", "2011", "temperature", "humidity"], - "price": 10 - }, - "curation": { - "rating": 0.93, - "numVotes": 123, - "schema": "Binary Voting" - }, - "additionalInformation": { "updateFrequency": "yearly", "structuredMarkup": [ { From b1ff2e7a270ff3c1fe0a45d2abea4844cbc18cab Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 16 Aug 2019 14:12:31 +0200 Subject: [PATCH 04/56] lowercase service type values --- .travis.yml | 2 +- integration/config.ts | 2 +- integration/ocean/AssetOwners.test.ts | 2 +- integration/ocean/ConsumeAsset.test.ts | 14 ++++----- integration/ocean/ConsumeAssetBrizo.test.ts | 4 +-- integration/ocean/ConsumeBigAsset.test.ts | 4 +-- integration/ocean/Signature.test.ts | 4 +-- library.json | 2 +- src/ddo/DDO.ts | 4 +-- src/ddo/Service.ts | 30 +++++++++---------- .../EscrowAccessSecretStoreTemplate.ts | 4 +-- src/ocean/OceanAgreements.ts | 4 +-- src/ocean/OceanAssets.ts | 16 +++++----- src/utils/DDOHelpers.ts | 2 +- test/ddo/DDO.test.ts | 6 ++-- test/testdata/ddo.json | 6 ++-- 16 files changed, 53 insertions(+), 53 deletions(-) diff --git a/.travis.yml b/.travis.yml index c4e5824..22da3e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ before_script: - ganache-cli --port 18545 > ganache-cli.log & - git clone https://github.com/oceanprotocol/barge - cd barge - - export AQUARIUS_VERSION=v0.3.8 + - export AQUARIUS_VERSION=v0.4.1 - export BRIZO_VERSION=v0.4.5 - export KEEPER_VERSION=v0.12.7 - export EVENTS_HANDLER_VERSION=v0.1.2 diff --git a/integration/config.ts b/integration/config.ts index d01da08..1cfbab5 100644 --- a/integration/config.ts +++ b/integration/config.ts @@ -3,7 +3,7 @@ const HDWalletProvider = require('@truffle/hdwallet-provider') const configJson: Config = { nodeUri: 'http://localhost:8545', - aquariusUri: 'http://172.15.0.15:5000', + aquariusUri: 'http://aquarius:5000', brizoUri: 'http://localhost:8030', secretStoreUri: 'http://localhost:12001', brizoAddress: '0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0', diff --git a/integration/ocean/AssetOwners.test.ts b/integration/ocean/AssetOwners.test.ts index eb514e9..cef85a5 100644 --- a/integration/ocean/AssetOwners.test.ts +++ b/integration/ocean/AssetOwners.test.ts @@ -79,7 +79,7 @@ describe('Asset Owners', () => { await ocean.assets.order( ddo.id, - ddo.findServiceByType('Access').serviceDefinitionId, + ddo.findServiceByType('access').serviceDefinitionId, account2 ) // Access granted diff --git a/integration/ocean/ConsumeAsset.test.ts b/integration/ocean/ConsumeAsset.test.ts index bca25c0..105d72b 100644 --- a/integration/ocean/ConsumeAsset.test.ts +++ b/integration/ocean/ConsumeAsset.test.ts @@ -42,8 +42,8 @@ describe('Consume Asset', () => { 'Default authentication not added' ) assert.isDefined( - ddo.findServiceByType('Access'), - "DDO Access service doesn't exist" + ddo.findServiceByType('access'), + "DDO access service doesn't exist" ) }) @@ -64,7 +64,7 @@ describe('Consume Asset', () => { }) it('should sign the service agreement', async () => { - const accessService = ddo.findServiceByType('Access') + const accessService = ddo.findServiceByType('access') serviceAgreementSignatureResult = await ocean.agreements.prepare( ddo.id, @@ -86,7 +86,7 @@ describe('Consume Asset', () => { }) it('should execute the service agreement', async () => { - const accessService = ddo.findServiceByType('Access') + const accessService = ddo.findServiceByType('access') const success = await ocean.agreements.create( ddo.id, @@ -115,7 +115,7 @@ describe('Consume Asset', () => { it('should lock the payment by the consumer', async () => { const paid = await ocean.agreements.conditions.lockReward( serviceAgreementSignatureResult.agreementId, - ddo.findServiceByType('Metadata').metadata.main.price, + ddo.findServiceByType('metadata').metadata.main.price, consumer ) @@ -156,7 +156,7 @@ describe('Consume Asset', () => { }) it('should consume and store the assets', async () => { - const accessService = ddo.findServiceByType('Access') + const accessService = ddo.findServiceByType('access') const folder = '/tmp/ocean/squid-js-1' const path = await ocean.assets.consume( @@ -183,7 +183,7 @@ describe('Consume Asset', () => { }) it('should consume and store one asset', async () => { - const accessService = ddo.findServiceByType('Access') + const accessService = ddo.findServiceByType('access') const folder = '/tmp/ocean/squid-js-2' const path = await ocean.assets.consume( diff --git a/integration/ocean/ConsumeAssetBrizo.test.ts b/integration/ocean/ConsumeAssetBrizo.test.ts index dac6736..4d48411 100644 --- a/integration/ocean/ConsumeAssetBrizo.test.ts +++ b/integration/ocean/ConsumeAssetBrizo.test.ts @@ -50,7 +50,7 @@ describe('Consume Asset (Brizo)', () => { }) it('should order the asset', async () => { - const accessService = ddo.findServiceByType('Access') + const accessService = ddo.findServiceByType('access') try { await consumer.requestTokens( @@ -69,7 +69,7 @@ describe('Consume Asset (Brizo)', () => { }) it('should consume and store the assets', async () => { - const accessService = ddo.findServiceByType('Access') + const accessService = ddo.findServiceByType('access') const folder = '/tmp/ocean/squid-js' const path = await ocean.assets.consume( diff --git a/integration/ocean/ConsumeBigAsset.test.ts b/integration/ocean/ConsumeBigAsset.test.ts index 3580207..3210409 100644 --- a/integration/ocean/ConsumeBigAsset.test.ts +++ b/integration/ocean/ConsumeBigAsset.test.ts @@ -48,7 +48,7 @@ xdescribe('Consume Asset (Large size)', () => { }) it('should order the asset', async () => { - const accessService = ddo.findServiceByType('Access') + const accessService = ddo.findServiceByType('access') try { await consumer.requestTokens( @@ -67,7 +67,7 @@ xdescribe('Consume Asset (Large size)', () => { }) it('should consume and store the assets', async () => { - const accessService = ddo.findServiceByType('Access') + const accessService = ddo.findServiceByType('access') const folder = '/tmp/ocean/squid-js' const path = await ocean.assets.consume( diff --git a/integration/ocean/Signature.test.ts b/integration/ocean/Signature.test.ts index e78b39d..9a46c52 100644 --- a/integration/ocean/Signature.test.ts +++ b/integration/ocean/Signature.test.ts @@ -54,7 +54,7 @@ describe('Signature', () => { id: did, service: [ { - type: 'Access', + type: 'access', purchaseEndpoint: undefined, serviceEndpoint: undefined, serviceDefinitionId, @@ -62,7 +62,7 @@ describe('Signature', () => { serviceAgreementTemplate } as any, { - type: 'Metadata', + type: 'metadata', metadata: { main: { price: 10 diff --git a/library.json b/library.json index e47fbfa..8693fee 100644 --- a/library.json +++ b/library.json @@ -15,7 +15,7 @@ }, { "name": "aquarius", - "version": "~0.3.8" + "version": "~0.4.1" }, { "name": "events-handler", diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 9736d07..3010933 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -101,7 +101,7 @@ export class DDO { * @return {string[]} DDO checksum. */ public getChecksum(): string { - const { metadata } = this.findServiceByType('Metadata') + const { metadata } = this.findServiceByType('metadata') const { files, name, author, license } = metadata.main const values = [ @@ -149,7 +149,7 @@ export class DDO { * Generated and adds the checksum. */ public addChecksum(): void { - const metadataService = this.findServiceByType('Metadata') + const metadataService = this.findServiceByType('metadata') if (metadataService.metadata.main.checksum) { LoggerInstance.log('Checksum already exists') return diff --git a/src/ddo/Service.ts b/src/ddo/Service.ts index ce08832..f463464 100644 --- a/src/ddo/Service.ts +++ b/src/ddo/Service.ts @@ -3,12 +3,12 @@ import { ServiceAgreementTemplate } from './ServiceAgreementTemplate' import { Provider } from './ComputingProvider' export type ServiceType = - | 'Authorization' - | 'Metadata' - | 'Access' - | 'Compute' - | 'Computing' - | 'FitchainCompute' + | 'authorization' + | 'metadata' + | 'access' + | 'compute' + | 'computing' + | 'fitchainCompute' export interface ServiceCommon { type: ServiceType @@ -17,17 +17,17 @@ export interface ServiceCommon { } export interface ServiceAuthorization extends ServiceCommon { - type: 'Authorization' + type: 'authorization' service: 'SecretStore' | 'None' | 'RSAES-OAEP' } export interface ServiceMetadata extends ServiceCommon { - type: 'Metadata' + type: 'metadata' metadata: MetaData } export interface ServiceAccess extends ServiceCommon { - type: 'Access' + type: 'access' name?: string description?: string creator?: string @@ -37,7 +37,7 @@ export interface ServiceAccess extends ServiceCommon { } export interface ServiceComputing extends ServiceCommon { - type: 'Computing' + type: 'computing' templateId?: string provider?: Provider serviceAgreementTemplate?: ServiceAgreementTemplate @@ -49,15 +49,15 @@ export interface ServiceCompute extends ServiceCommon { export type Service< T extends ServiceType | 'default' = 'default' -> = T extends 'Authorization' +> = T extends 'authorization' ? ServiceAuthorization - : T extends 'Metadata' + : T extends 'metadata' ? ServiceMetadata - : T extends 'Computing' + : T extends 'computing' ? ServiceComputing - : T extends 'Access' + : T extends 'access' ? ServiceAccess - : T extends 'Compute' + : T extends 'compute' ? ServiceCompute : T extends 'default' ? ServiceCommon diff --git a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts index 2c4dcc1..1aa7164 100644 --- a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts +++ b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts @@ -59,7 +59,7 @@ export class EscrowAccessSecretStoreTemplate extends AgreementTemplate { ) { return !!(await this.createFullAgreement( ddo.shortId(), - ddo.findServiceByType('Metadata').metadata.main.price, + ddo.findServiceByType('metadata').metadata.main.price, consumer, from, agreementId @@ -79,7 +79,7 @@ export class EscrowAccessSecretStoreTemplate extends AgreementTemplate { } = await this.createFullAgreementData( agreementId, ddo.shortId(), - ddo.findServiceByType('Metadata').metadata.main.price, + ddo.findServiceByType('metadata').metadata.main.price, consumer ) return [ diff --git a/src/ocean/OceanAgreements.ts b/src/ocean/OceanAgreements.ts index 0bae3ea..71b5b42 100644 --- a/src/ocean/OceanAgreements.ts +++ b/src/ocean/OceanAgreements.ts @@ -55,7 +55,7 @@ export class OceanAgreements extends Instantiable { const ddo = await this.ocean.aquarius.retrieveDDO(d) const agreementId: string = zeroX(generateId()) - const templateName = ddo.findServiceByType('Access') + const templateName = ddo.findServiceByType('access') .serviceAgreementTemplate.contractName const agreementConditionsIds = await this.ocean.keeper .getTemplateByName(templateName) @@ -129,7 +129,7 @@ export class OceanAgreements extends Instantiable { const d: DID = DID.parse(did) const ddo = await this.ocean.aquarius.retrieveDDO(d) - const templateName = ddo.findServiceById<'Access'>(serviceDefinitionId) + const templateName = ddo.findServiceById<'access'>(serviceDefinitionId) .serviceAgreementTemplate.contractName await this.ocean.keeper .getTemplateByName(templateName) diff --git a/src/ocean/OceanAssets.ts b/src/ocean/OceanAssets.ts index f45c7eb..dc0d3e3 100644 --- a/src/ocean/OceanAssets.ts +++ b/src/ocean/OceanAssets.ts @@ -110,7 +110,7 @@ export class OceanAssets extends Instantiable { ], service: [ { - type: 'Access', + type: 'access', creator: '', purchaseEndpoint: this.ocean.brizo.getPurchaseEndpoint(), serviceEndpoint: this.ocean.brizo.getConsumeEndpoint(), @@ -119,12 +119,12 @@ export class OceanAssets extends Instantiable { serviceAgreementTemplate }, { - type: 'Authorization', + type: 'authorization', service: 'SecretStore', serviceEndpoint: secretStoreUri }, { - type: 'Metadata', + type: 'metadata', serviceEndpoint, metadata: { // Default values @@ -233,7 +233,7 @@ export class OceanAssets extends Instantiable { useSecretStore?: boolean ): Promise { const ddo = await this.resolve(did) - const { metadata } = ddo.findServiceByType('Metadata') + const { metadata } = ddo.findServiceByType('metadata') const accessService = ddo.findServiceById(serviceDefinitionId) @@ -265,9 +265,9 @@ export class OceanAssets extends Instantiable { } else { const files = await this.ocean.secretStore.decrypt( did, - ddo.findServiceByType('Metadata').metadata.main.encryptedFiles, + ddo.findServiceByType('metadata').metadata.main.encryptedFiles, consumerAccount, - ddo.findServiceByType('Authorization').serviceEndpoint + ddo.findServiceByType('authorization').serviceEndpoint ) const downloads = files .filter(({ index: i }) => index === -1 || index === i) @@ -304,7 +304,7 @@ export class OceanAssets extends Instantiable { const ddo = await this.resolve(did) const { keeper } = this.ocean - const templateName = ddo.findServiceByType('Access') + const templateName = ddo.findServiceByType('access') .serviceAgreementTemplate.contractName const template = keeper.getTemplateByName(templateName) const accessCondition = keeper.conditions.accessSecretStoreCondition @@ -316,7 +316,7 @@ export class OceanAssets extends Instantiable { this.logger.log('Agreement initialized') observer.next(OrderProgressStep.AgreementInitialized) - const { metadata } = ddo.findServiceByType('Metadata') + const { metadata } = ddo.findServiceByType('metadata') this.logger.log('Locking payment') diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index 1a68198..67a2475 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -13,7 +13,7 @@ function fillParameterWithDDO( case 'amount': case 'price': return String( - ddo.findServiceByType('Metadata').metadata.main.price + ddo.findServiceByType('metadata').metadata.main.price ) case 'assetId': case 'documentId': diff --git a/test/ddo/DDO.test.ts b/test/ddo/DDO.test.ts index 20b7726..bb7e248 100644 --- a/test/ddo/DDO.test.ts +++ b/test/ddo/DDO.test.ts @@ -77,17 +77,17 @@ describe('DDO', () => { serviceEndpoint: 'https://bops.example.com/enterprise/' }, { - type: 'Consume', + type: 'consume', serviceEndpoint: 'http://mybrizo.org/api/v1/brizo/services/consume?pubKey={pubKey}&serviceId={serviceId}&url={url}' }, { - type: 'Compute', + type: 'compute', serviceEndpoint: 'http://mybrizo.org/api/v1/brizo/services/compute?pubKey={pubKey}&serviceId={serviceId}&algo={algo}&container={container}' }, { - type: 'Metadata', + type: 'metadata', serviceEndpoint: 'http://myaquarius.org/api/v1/provider/assets/metadata/{did}', metadata: { diff --git a/test/testdata/ddo.json b/test/testdata/ddo.json index 1388d2b..fd48c2e 100644 --- a/test/testdata/ddo.json +++ b/test/testdata/ddo.json @@ -39,7 +39,7 @@ }, "service": [ { - "type": "Access", + "type": "access", "serviceDefinitionId": "0", "serviceEndpoint": "http://mybrizo.org/api/v1/brizo/services/consume?pubKey=${pubKey}&serviceId={serviceId}&url={url}", "purchaseEndpoint": "http://mybrizo.org/api/v1/brizo/services/access/purchase?", @@ -144,13 +144,13 @@ ] }, { - "type": "CloudCompute", + "type": "compute", "serviceDefinitionId": "1", "serviceEndpoint": "http://mybrizo.org/api/v1/brizo/services/compute?pubKey=${pubKey}&serviceId={serviceId}&algo={algo}&container={container}", "templateId": "044852b2a670ade5407e78fb2863c51000000000000000000000000000000002" }, { - "type": "Metadata", + "type": "metadata", "serviceDefinitionId": "2", "serviceEndpoint": "http://myaquarius.org/api/v1/provider/assets/metadata/{did}", "metadata": { From b15022a4c1ea302cf3dc5576f7db9f5ba0f0bf72 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 16 Aug 2019 14:43:34 +0200 Subject: [PATCH 05/56] test against latest Node.js --- .travis.yml | 2 +- integration/config.ts | 2 +- src/ocean/utils/ServiceAgreement.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 22da3e2..c1d64af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ dist: xenial sudo: required language: node_js node_js: - - '11' + - '12' services: - docker diff --git a/integration/config.ts b/integration/config.ts index 1cfbab5..d01da08 100644 --- a/integration/config.ts +++ b/integration/config.ts @@ -3,7 +3,7 @@ const HDWalletProvider = require('@truffle/hdwallet-provider') const configJson: Config = { nodeUri: 'http://localhost:8545', - aquariusUri: 'http://aquarius:5000', + aquariusUri: 'http://172.15.0.15:5000', brizoUri: 'http://localhost:8030', secretStoreUri: 'http://localhost:12001', brizoAddress: '0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0', diff --git a/src/ocean/utils/ServiceAgreement.ts b/src/ocean/utils/ServiceAgreement.ts index 37f12a4..b520a34 100644 --- a/src/ocean/utils/ServiceAgreement.ts +++ b/src/ocean/utils/ServiceAgreement.ts @@ -18,7 +18,7 @@ export class ServiceAgreement extends Instantiable { agreementConditionsIds: string[], consumer: Account ): Promise { - const service = ddo.findServiceById<'Access'>(serviceDefinitionId) + const service = ddo.findServiceById<'access'>(serviceDefinitionId) const timelockValues: number[] = this.getTimeValuesFromService( service, 'timelock' From e253e4c0bb289703c9e362e8f7c45fab779c6766 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 16 Aug 2019 16:12:42 +0200 Subject: [PATCH 06/56] more DDO structure updates --- integration/ocean/AssetOwners.test.ts | 4 ++- integration/ocean/ConsumeAsset.test.ts | 10 +++--- integration/ocean/ConsumeAssetBrizo.test.ts | 4 +-- integration/ocean/ConsumeBigAsset.test.ts | 4 +-- integration/ocean/Signature.test.ts | 8 ++--- integration/utils/ddo-metadata-generator.ts | 2 ++ src/brizo/Brizo.ts | 6 ++-- src/ddo/DDO.ts | 20 +++++------ src/ddo/Service.ts | 4 +-- .../EscrowAccessSecretStoreTemplate.ts | 4 +-- src/ocean/OceanAgreements.ts | 20 +++++------ src/ocean/OceanAssets.ts | 34 +++++++++---------- src/ocean/utils/ServiceAgreement.ts | 4 +-- src/utils/DDOHelpers.ts | 2 +- test/ddo/DDO.test.ts | 10 ++++-- test/mocks/Brizo.mock.ts | 2 +- test/testdata/ddo.json | 10 +++--- 17 files changed, 77 insertions(+), 71 deletions(-) diff --git a/integration/ocean/AssetOwners.test.ts b/integration/ocean/AssetOwners.test.ts index cef85a5..01c73be 100644 --- a/integration/ocean/AssetOwners.test.ts +++ b/integration/ocean/AssetOwners.test.ts @@ -77,9 +77,11 @@ describe('Asset Owners', () => { ) } catch {} + const accessService = ddo.findServiceByType('access') + await ocean.assets.order( ddo.id, - ddo.findServiceByType('access').serviceDefinitionId, + accessService.index, account2 ) // Access granted diff --git a/integration/ocean/ConsumeAsset.test.ts b/integration/ocean/ConsumeAsset.test.ts index 105d72b..debfdf5 100644 --- a/integration/ocean/ConsumeAsset.test.ts +++ b/integration/ocean/ConsumeAsset.test.ts @@ -68,7 +68,7 @@ describe('Consume Asset', () => { serviceAgreementSignatureResult = await ocean.agreements.prepare( ddo.id, - accessService.serviceDefinitionId, + accessService.index, consumer ) @@ -91,7 +91,7 @@ describe('Consume Asset', () => { const success = await ocean.agreements.create( ddo.id, serviceAgreementSignatureResult.agreementId, - accessService.serviceDefinitionId, + accessService.index, serviceAgreementSignatureResult.signature, consumer, publisher @@ -115,7 +115,7 @@ describe('Consume Asset', () => { it('should lock the payment by the consumer', async () => { const paid = await ocean.agreements.conditions.lockReward( serviceAgreementSignatureResult.agreementId, - ddo.findServiceByType('metadata').metadata.main.price, + ddo.findServiceByType('metadata').attributes.main.price, consumer ) @@ -162,7 +162,7 @@ describe('Consume Asset', () => { const path = await ocean.assets.consume( serviceAgreementSignatureResult.agreementId, ddo.id, - accessService.serviceDefinitionId, + accessService.index, consumer, folder ) @@ -189,7 +189,7 @@ describe('Consume Asset', () => { const path = await ocean.assets.consume( serviceAgreementSignatureResult.agreementId, ddo.id, - accessService.serviceDefinitionId, + accessService.index, consumer, folder, 1 diff --git a/integration/ocean/ConsumeAssetBrizo.test.ts b/integration/ocean/ConsumeAssetBrizo.test.ts index 4d48411..c2beb4f 100644 --- a/integration/ocean/ConsumeAssetBrizo.test.ts +++ b/integration/ocean/ConsumeAssetBrizo.test.ts @@ -61,7 +61,7 @@ describe('Consume Asset (Brizo)', () => { const steps = [] agreementId = await ocean.assets - .order(ddo.id, accessService.serviceDefinitionId, consumer) + .order(ddo.id, accessService.index, consumer) .next(step => steps.push(step)) assert.isDefined(agreementId) @@ -75,7 +75,7 @@ describe('Consume Asset (Brizo)', () => { const path = await ocean.assets.consume( agreementId, ddo.id, - accessService.serviceDefinitionId, + accessService.index, consumer, folder ) diff --git a/integration/ocean/ConsumeBigAsset.test.ts b/integration/ocean/ConsumeBigAsset.test.ts index 3210409..7522aa0 100644 --- a/integration/ocean/ConsumeBigAsset.test.ts +++ b/integration/ocean/ConsumeBigAsset.test.ts @@ -59,7 +59,7 @@ xdescribe('Consume Asset (Large size)', () => { agreementId = await ocean.assets.order( ddo.id, - accessService.serviceDefinitionId, + accessService.index, consumer ) @@ -73,7 +73,7 @@ xdescribe('Consume Asset (Large size)', () => { const path = await ocean.assets.consume( agreementId, ddo.id, - accessService.serviceDefinitionId, + accessService.index, consumer, folder ) diff --git a/integration/ocean/Signature.test.ts b/integration/ocean/Signature.test.ts index 9a46c52..6a66394 100644 --- a/integration/ocean/Signature.test.ts +++ b/integration/ocean/Signature.test.ts @@ -46,7 +46,6 @@ describe('Signature', () => { const did = `did:op:${'c'.repeat(64)}` const templateId = `0x${'f'.repeat(40)}` const agreementId = `0x${'e'.repeat(64)}` - const serviceDefinitionId = '0' const serviceAgreementTemplate = await templates.escrowAccessSecretStoreTemplate.getServiceAgreementTemplate() @@ -55,15 +54,16 @@ describe('Signature', () => { service: [ { type: 'access', + index: 0, purchaseEndpoint: undefined, serviceEndpoint: undefined, - serviceDefinitionId, templateId, serviceAgreementTemplate } as any, { type: 'metadata', - metadata: { + index: 1, + attributes: { main: { price: 10 } @@ -74,7 +74,7 @@ describe('Signature', () => { const signature = await ocean.utils.agreements.signServiceAgreement( ddo, - serviceDefinitionId, + 0, agreementId, [ `0x${'1'.repeat(64)}`, diff --git a/integration/utils/ddo-metadata-generator.ts b/integration/utils/ddo-metadata-generator.ts index 57311d2..c1d9af2 100644 --- a/integration/utils/ddo-metadata-generator.ts +++ b/integration/utils/ddo-metadata-generator.ts @@ -12,11 +12,13 @@ const metadata: Partial = { files: [ { index: 0, + contentType: 'application/json', url: 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/package.json' }, { index: 1, + contentType: 'text/plain', url: 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/README.md' } diff --git a/src/brizo/Brizo.ts b/src/brizo/Brizo.ts index 62628d7..6251e35 100644 --- a/src/brizo/Brizo.ts +++ b/src/brizo/Brizo.ts @@ -37,7 +37,7 @@ export class Brizo extends Instantiable { public getComputeEndpoint( pubKey: string, - serviceId: string, + serviceIndex: number, _notUsed: string, container: string ) { @@ -47,14 +47,14 @@ export class Brizo extends Instantiable { public async initializeServiceAgreement( did: string, serviceAgreementId: string, - serviceDefinitionId: string, + serviceIndex: number, signature: string, consumerAddress: string ): Promise { const args = { did, serviceAgreementId, - serviceDefinitionId, + serviceIndex, signature, consumerAddress } diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 3010933..11d2271 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -63,19 +63,19 @@ export class DDO { } /** - * Finds a service of a DDO by ID. - * @param {string} serviceDefinitionId Service ID. + * Finds a service of a DDO by index. + * @param {number} Service index. * @return {Service} Service. */ public findServiceById( - serviceDefinitionId: string + index: number ): Service { - if (!serviceDefinitionId) { - throw new Error('serviceDefinitionId not set') + if (!index) { + throw new Error('index is not set') } const service = this.service.find( - s => s.serviceDefinitionId === serviceDefinitionId + s => s.index === index ) return service as Service @@ -101,8 +101,8 @@ export class DDO { * @return {string[]} DDO checksum. */ public getChecksum(): string { - const { metadata } = this.findServiceByType('metadata') - const { files, name, author, license } = metadata.main + const { attributes } = this.findServiceByType('metadata') + const { files, name, author, license } = attributes.main const values = [ ...(files || []).map(({ checksum }) => checksum).filter(_ => !!_), @@ -150,11 +150,11 @@ export class DDO { */ public addChecksum(): void { const metadataService = this.findServiceByType('metadata') - if (metadataService.metadata.main.checksum) { + if (metadataService.attributes.main.checksum) { LoggerInstance.log('Checksum already exists') return } - metadataService.metadata.main.checksum = this.getChecksum() + metadataService.attributes.main.checksum = this.getChecksum() } /** diff --git a/src/ddo/Service.ts b/src/ddo/Service.ts index f463464..8d28a5b 100644 --- a/src/ddo/Service.ts +++ b/src/ddo/Service.ts @@ -12,7 +12,7 @@ export type ServiceType = export interface ServiceCommon { type: ServiceType - serviceDefinitionId?: string + index: number serviceEndpoint?: string } @@ -23,7 +23,7 @@ export interface ServiceAuthorization extends ServiceCommon { export interface ServiceMetadata extends ServiceCommon { type: 'metadata' - metadata: MetaData + attributes: MetaData } export interface ServiceAccess extends ServiceCommon { diff --git a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts index 1aa7164..c7adcac 100644 --- a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts +++ b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts @@ -59,7 +59,7 @@ export class EscrowAccessSecretStoreTemplate extends AgreementTemplate { ) { return !!(await this.createFullAgreement( ddo.shortId(), - ddo.findServiceByType('metadata').metadata.main.price, + ddo.findServiceByType('metadata').attributes.main.price, consumer, from, agreementId @@ -79,7 +79,7 @@ export class EscrowAccessSecretStoreTemplate extends AgreementTemplate { } = await this.createFullAgreementData( agreementId, ddo.shortId(), - ddo.findServiceByType('metadata').metadata.main.price, + ddo.findServiceByType('metadata').attributes.main.price, consumer ) return [ diff --git a/src/ocean/OceanAgreements.ts b/src/ocean/OceanAgreements.ts index 71b5b42..3fc8dce 100644 --- a/src/ocean/OceanAgreements.ts +++ b/src/ocean/OceanAgreements.ts @@ -42,13 +42,13 @@ export class OceanAgreements extends Instantiable { /** * Creates a consumer signature for the specified asset service. * @param {string} did Decentralized ID. - * @param {string} serviceDefinitionId Service definition ID. + * @param {number} index Service index. * @param {Account} consumer Consumer account. * @return {Promise} Agreement ID and signaturee. */ public async prepare( did: string, - serviceDefinitionId: string, + index: number, consumer: Account ): Promise { const d: DID = DID.parse(did as string) @@ -68,7 +68,7 @@ export class OceanAgreements extends Instantiable { const signature = await this.ocean.utils.agreements.signServiceAgreement( ddo, - serviceDefinitionId, + index, agreementId, agreementConditionsIds, consumer @@ -80,21 +80,21 @@ export class OceanAgreements extends Instantiable { /** * Submit a service agreement to the publisher to create the agreement on-chain. * @param {string} did Decentralized ID. - * @param {string} serviceDefinitionId Service definition ID. + * @param {number} index Service index. * @param {Account} consumer Consumer account. * @return {Promise} */ public async send( did: string, agreementId: string, - serviceDefinitionId: string, + index: number, signature: string, consumer: Account ): Promise { const result = await this.ocean.brizo.initializeServiceAgreement( didPrefixed(did), zeroX(agreementId), - serviceDefinitionId, + index, zeroX(signature), consumer.getId() ) @@ -112,7 +112,7 @@ export class OceanAgreements extends Instantiable { * in this method before submitting on-chain. * @param {string} did Decentralized ID. * @param {string} agreementId Service agreement ID. - * @param {string} serviceDefinitionId Service definition ID. + * @param {number} index Service index. * @param {string} signature Service agreement signature. * @param {Account} consumer Consumer account. * @param {Account} publisher Publisher account. @@ -121,7 +121,7 @@ export class OceanAgreements extends Instantiable { public async create( did: string, agreementId: string, - serviceDefinitionId: string, + index: number, signature: string, consumer: Account, publisher: Account @@ -129,7 +129,7 @@ export class OceanAgreements extends Instantiable { const d: DID = DID.parse(did) const ddo = await this.ocean.aquarius.retrieveDDO(d) - const templateName = ddo.findServiceById<'access'>(serviceDefinitionId) + const templateName = ddo.findServiceById<'access'>(index) .serviceAgreementTemplate.contractName await this.ocean.keeper .getTemplateByName(templateName) @@ -145,9 +145,7 @@ export class OceanAgreements extends Instantiable { /** * Get the status of a service agreement. - * @param {string} did Decentralized ID. * @param {string} agreementId Service agreement ID. - * @param {string} serviceDefinitionId Service definition ID. * @param {boolean} extended Returns a complete status with dependencies. * @return {Promise} */ diff --git a/src/ocean/OceanAssets.ts b/src/ocean/OceanAssets.ts index dc0d3e3..fe39dca 100644 --- a/src/ocean/OceanAssets.ts +++ b/src/ocean/OceanAssets.ts @@ -91,7 +91,7 @@ export class OceanAssets extends Instantiable { const serviceEndpoint = this.ocean.aquarius.getServiceEndpoint(did) - let serviceDefinitionIdCount = 0 + let indexCount = 0 // create ddo itself const ddo: DDO = new DDO({ id: did.getDid(), @@ -126,7 +126,7 @@ export class OceanAssets extends Instantiable { { type: 'metadata', serviceEndpoint, - metadata: { + attributes: { // Default values curation: { rating: 0, @@ -158,10 +158,10 @@ export class OceanAssets extends Instantiable { list.findIndex(({ type: t }) => t === type) === i ) .reverse() - // Adding ID + // Adding index .map(_ => ({ ..._, - serviceDefinitionId: String(serviceDefinitionIdCount++) + index: indexCount++ })) as Service[] }) @@ -206,7 +206,7 @@ export class OceanAssets extends Instantiable { public async consume( agreementId: string, did: string, - serviceDefinitionId: string, + serviceIndex: number, consumerAccount: Account, resultPath: string, index?: number, @@ -216,7 +216,7 @@ export class OceanAssets extends Instantiable { public async consume( agreementId: string, did: string, - serviceDefinitionId: string, + serviceIndex: number, consumerAccount: Account, resultPath?: undefined | null, index?: number, @@ -226,18 +226,18 @@ export class OceanAssets extends Instantiable { public async consume( agreementId: string, did: string, - serviceDefinitionId: string, + serviceIndex: number, consumerAccount: Account, resultPath?: string, index: number = -1, useSecretStore?: boolean ): Promise { const ddo = await this.resolve(did) - const { metadata } = ddo.findServiceByType('metadata') + const { attributes } = ddo.findServiceByType('metadata') - const accessService = ddo.findServiceById(serviceDefinitionId) + const accessService = ddo.findServiceById(serviceIndex) - const { files } = metadata.main + const { files } = attributes.main const { serviceEndpoint } = accessService @@ -250,7 +250,7 @@ export class OceanAssets extends Instantiable { this.logger.log('Consuming files') resultPath = resultPath - ? `${resultPath}/datafile.${ddo.shortId()}.${serviceDefinitionId}/` + ? `${resultPath}/datafile.${ddo.shortId()}.${serviceIndex}/` : undefined if (!useSecretStore) { @@ -265,7 +265,7 @@ export class OceanAssets extends Instantiable { } else { const files = await this.ocean.secretStore.decrypt( did, - ddo.findServiceByType('metadata').metadata.main.encryptedFiles, + ddo.findServiceByType('metadata').attributes.main.encryptedFiles, consumerAccount, ddo.findServiceByType('authorization').serviceEndpoint ) @@ -288,13 +288,13 @@ export class OceanAssets extends Instantiable { * Start the purchase/order of an asset's service. Starts by signing the service agreement * then sends the request to the publisher via the service endpoint (Brizo http service). * @param {string} did Decentralized ID. - * @param {string} serviceDefinitionId Service definition ID. + * @param {number} index Service index. * @param {Account} consumer Consumer account. * @return {Promise} Returns Agreement ID */ public order( did: string, - serviceDefinitionId: string, + index: number, consumer: Account ): SubscribablePromise { return new SubscribablePromise(async observer => { @@ -316,7 +316,7 @@ export class OceanAssets extends Instantiable { this.logger.log('Agreement initialized') observer.next(OrderProgressStep.AgreementInitialized) - const { metadata } = ddo.findServiceByType('metadata') + const { attributes } = ddo.findServiceByType('metadata') this.logger.log('Locking payment') @@ -327,7 +327,7 @@ export class OceanAssets extends Instantiable { observer.next(OrderProgressStep.LockingPayment) const paid = await oceanAgreements.conditions.lockReward( agreementId, - metadata.main.price, + attributes.main.price, consumer ) observer.next(OrderProgressStep.LockedPayment) @@ -352,7 +352,7 @@ export class OceanAssets extends Instantiable { await oceanAgreements.create( did, agreementId, - serviceDefinitionId, + index, undefined, consumer, consumer diff --git a/src/ocean/utils/ServiceAgreement.ts b/src/ocean/utils/ServiceAgreement.ts index b520a34..c634aed 100644 --- a/src/ocean/utils/ServiceAgreement.ts +++ b/src/ocean/utils/ServiceAgreement.ts @@ -13,12 +13,12 @@ export class ServiceAgreement extends Instantiable { public async signServiceAgreement( ddo: DDO, - serviceDefinitionId: string, + index: number, serviceAgreementId: string, agreementConditionsIds: string[], consumer: Account ): Promise { - const service = ddo.findServiceById<'access'>(serviceDefinitionId) + const service = ddo.findServiceById<'access'>(index) const timelockValues: number[] = this.getTimeValuesFromService( service, 'timelock' diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index 67a2475..a326825 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -13,7 +13,7 @@ function fillParameterWithDDO( case 'amount': case 'price': return String( - ddo.findServiceByType('metadata').metadata.main.price + ddo.findServiceByType('metadata').attributes.main.price ) case 'assetId': case 'documentId': diff --git a/test/ddo/DDO.test.ts b/test/ddo/DDO.test.ts index bb7e248..ee4a134 100644 --- a/test/ddo/DDO.test.ts +++ b/test/ddo/DDO.test.ts @@ -88,9 +88,10 @@ describe('DDO', () => { }, { type: 'metadata', + index: 0, serviceEndpoint: 'http://myaquarius.org/api/v1/provider/assets/metadata/{did}', - metadata: { + attributes: { main: { name: 'UK Weather information 2011', type: 'dataset', @@ -104,16 +105,19 @@ describe('DDO', () => { index: 0, checksum: 'efb2c764274b745f5fc37f97c6b0e761', contentLength: 4535431, + contentType: 'application/json', resourceId: 'access-log2018-02-13-15-17-29-18386C502CAEA932' }, { index: 1, checksum: '085340abffh21495345af97c6b0e761', - contentLength: 12324 + contentLength: 12324, + contentType: 'application/json' }, { - index: 2 + index: 2, + contentType: '' } ], checksum: '' diff --git a/test/mocks/Brizo.mock.ts b/test/mocks/Brizo.mock.ts index da8f96e..7efe47b 100644 --- a/test/mocks/Brizo.mock.ts +++ b/test/mocks/Brizo.mock.ts @@ -4,7 +4,7 @@ export default class BrizoMock extends Brizo { public async initializeServiceAgreement( did: string, serviceAgreementId: string, - serviceDefinitionId: string, + index: number, signature: string, consumerPublicKey: string ): Promise { diff --git a/test/testdata/ddo.json b/test/testdata/ddo.json index fd48c2e..2e75886 100644 --- a/test/testdata/ddo.json +++ b/test/testdata/ddo.json @@ -40,7 +40,7 @@ "service": [ { "type": "access", - "serviceDefinitionId": "0", + "index": 0, "serviceEndpoint": "http://mybrizo.org/api/v1/brizo/services/consume?pubKey=${pubKey}&serviceId={serviceId}&url={url}", "purchaseEndpoint": "http://mybrizo.org/api/v1/brizo/services/access/purchase?", "templateId": "044852b2a670ade5407e78fb2863c51000000000000000000000000000000000", @@ -145,16 +145,16 @@ }, { "type": "compute", - "serviceDefinitionId": "1", + "index": 1, "serviceEndpoint": "http://mybrizo.org/api/v1/brizo/services/compute?pubKey=${pubKey}&serviceId={serviceId}&algo={algo}&container={container}", "templateId": "044852b2a670ade5407e78fb2863c51000000000000000000000000000000002" }, { "type": "metadata", - "serviceDefinitionId": "2", + "index": 2, "serviceEndpoint": "http://myaquarius.org/api/v1/provider/assets/metadata/{did}", - "metadata": { - "base": { + "attributes": { + "main": { "name": "UK Weather information 2011", "type": "dataset", "dateCreated": "2012-10-10T17:00:000Z", From 36a77c0d0bd65d0599ce72d4761421526ff68c03 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 16 Aug 2019 17:00:14 +0200 Subject: [PATCH 07/56] linting fixes --- integration/ocean/AssetOwners.test.ts | 8 ++------ src/ddo/DDO.ts | 8 ++------ src/ocean/OceanAssets.ts | 3 ++- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/integration/ocean/AssetOwners.test.ts b/integration/ocean/AssetOwners.test.ts index 01c73be..487c923 100644 --- a/integration/ocean/AssetOwners.test.ts +++ b/integration/ocean/AssetOwners.test.ts @@ -77,13 +77,9 @@ describe('Asset Owners', () => { ) } catch {} - const accessService = ddo.findServiceByType('access') + const { index } = ddo.findServiceByType('access') - await ocean.assets.order( - ddo.id, - accessService.index, - account2 - ) + await ocean.assets.order(ddo.id, index, account2) // Access granted const { length: finalLength2 } = await ocean.assets.consumerAssets( diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 11d2271..d7788a8 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -67,16 +67,12 @@ export class DDO { * @param {number} Service index. * @return {Service} Service. */ - public findServiceById( - index: number - ): Service { + public findServiceById(index: number): Service { if (!index) { throw new Error('index is not set') } - const service = this.service.find( - s => s.index === index - ) + const service = this.service.find(s => s.index === index) return service as Service } diff --git a/src/ocean/OceanAssets.ts b/src/ocean/OceanAssets.ts index fe39dca..16a55e1 100644 --- a/src/ocean/OceanAssets.ts +++ b/src/ocean/OceanAssets.ts @@ -265,7 +265,8 @@ export class OceanAssets extends Instantiable { } else { const files = await this.ocean.secretStore.decrypt( did, - ddo.findServiceByType('metadata').attributes.main.encryptedFiles, + ddo.findServiceByType('metadata').attributes.main + .encryptedFiles, consumerAccount, ddo.findServiceByType('authorization').serviceEndpoint ) From 1f6e57fb603a63e91f8584506e95695e52a393af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Guti=C3=A9rrez?= Date: Thu, 5 Sep 2019 13:32:56 +0200 Subject: [PATCH 08/56] Add ComputeExecutionCondition. --- src/keeper/Keeper.ts | 11 ++++- .../conditions/ComputeExecutionCondition.ts | 44 +++++++++++++++++++ src/keeper/contracts/conditions/index.ts | 1 + src/ocean/OceanAgreementsConditions.ts | 28 ++++++++++++ 4 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 src/keeper/contracts/conditions/ComputeExecutionCondition.ts diff --git a/src/keeper/Keeper.ts b/src/keeper/Keeper.ts index 6e729d5..0ab24d8 100644 --- a/src/keeper/Keeper.ts +++ b/src/keeper/Keeper.ts @@ -7,7 +7,8 @@ import { Condition, LockRewardCondition, EscrowReward, - AccessSecretStoreCondition + AccessSecretStoreCondition, + ComputeExecutionCondition } from './contracts/conditions' import { AgreementTemplate, @@ -66,6 +67,9 @@ export class Keeper extends Instantiable { accessSecretStoreCondition: AccessSecretStoreCondition.getInstance( config ), + computeExecutionCondition: ComputeExecutionCondition.getInstance( + config + ), // Templates escrowAccessSecretStoreTemplate: EscrowAccessSecretStoreTemplate.getInstance( config @@ -98,7 +102,9 @@ export class Keeper extends Instantiable { lockRewardCondition: keeper.instances.lockRewardCondition, escrowReward: keeper.instances.escrowReward, accessSecretStoreCondition: - keeper.instances.accessSecretStoreCondition + keeper.instances.accessSecretStoreCondition, + computeExecutionCondition: + keeper.instances.computeExecutionCondition } // Conditions keeper.templates = { @@ -163,6 +169,7 @@ export class Keeper extends Instantiable { lockRewardCondition: LockRewardCondition escrowReward: EscrowReward accessSecretStoreCondition: AccessSecretStoreCondition + computeExecutionCondition: ComputeExecutionCondition } /** diff --git a/src/keeper/contracts/conditions/ComputeExecutionCondition.ts b/src/keeper/contracts/conditions/ComputeExecutionCondition.ts new file mode 100644 index 0000000..24bf07c --- /dev/null +++ b/src/keeper/contracts/conditions/ComputeExecutionCondition.ts @@ -0,0 +1,44 @@ +import { Condition } from './Condition.abstract' +import { zeroX, didZeroX, didPrefixed } from '../../../utils' +import { InstantiableConfig } from '../../../Instantiable.abstract' + +export class ComputeExecutionCondition extends Condition { + public static async getInstance( + config: InstantiableConfig + ): Promise { + return Condition.getInstance( + config, + 'ComputeExecutionCondition', + ComputeExecutionCondition + ) + } + + public hashValues(did: string, computeConsumer: string) { + return super.hashValues(didZeroX(did), zeroX(computeConsumer)) + } + + public fulfill( + agreementId: string, + did: string, + computeConsumer: string, + from?: string + ) { + return super.fulfill( + agreementId, + [didZeroX(did), computeConsumer].map(zeroX), + from + ) + } + + public wasComputeTriggered( + did: string, + computeConsumer: string, + from?: string + ) { + return this.call( + 'wasComputeTriggered', + [didZeroX(did), computeConsumer].map(zeroX), + from + ) + } +} diff --git a/src/keeper/contracts/conditions/index.ts b/src/keeper/contracts/conditions/index.ts index aac7d24..7f78dab 100644 --- a/src/keeper/contracts/conditions/index.ts +++ b/src/keeper/contracts/conditions/index.ts @@ -2,3 +2,4 @@ export * from './Condition.abstract' export { AccessSecretStoreCondition } from './AccessSecretStoreCondition' export { EscrowReward } from './EscrowReward' export { LockRewardCondition } from './LockRewardCondition' +export { ComputeExecutionCondition } from './ComputeExecutionCondition' diff --git a/src/ocean/OceanAgreementsConditions.ts b/src/ocean/OceanAgreementsConditions.ts index 9643bb5..3e9bed7 100644 --- a/src/ocean/OceanAgreementsConditions.ts +++ b/src/ocean/OceanAgreementsConditions.ts @@ -83,6 +83,34 @@ export class OceanAgreementsConditions extends Instantiable { } } + /** + * Authorize the consumer defined in the agreement to execute a remote service associated with this asset. + * @param {string} agreementId Agreement ID. + * @param {string} did Asset ID. + * @param {string} grantee Consumer address. + * @param {Account} from Account of sender. + */ + public async grantServiceExecution( + agreementId: string, + did: string, + grantee: string, + from?: Account + ) { + try { + const { computeExecutionCondition } = this.ocean.keeper.conditions + + const receipt = await computeExecutionCondition.fulfill( + agreementId, + did, + grantee, + from && from.getId() + ) + return !!receipt.events.Fulfilled + } catch { + return false + } + } + /** * Transfer the escrow or locked tokens from the LockRewardCondition contract to the publisher's account. * This should be allowed after access has been given to the consumer and the asset data is downloaded. From 8761d2e08758dc963c6d3720a02d9c223940f8a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Guti=C3=A9rrez?= Date: Thu, 5 Sep 2019 13:33:49 +0200 Subject: [PATCH 09/56] Add EscrowComputeExecutionTemplate. --- src/keeper/Keeper.ts | 12 +- .../templates/BaseEscrowTemplate.abstract.ts | 43 ++++++ .../EscrowAccessSecretStoreTemplate.ts | 38 +---- ...cutionTemplate.serviceAgreementTemplate.ts | 142 +++++++++++++++++ .../EscrowComputeExecutionTemplate.ts | 145 ++++++++++++++++++ src/keeper/contracts/templates/index.ts | 4 + 6 files changed, 345 insertions(+), 39 deletions(-) create mode 100644 src/keeper/contracts/templates/BaseEscrowTemplate.abstract.ts create mode 100644 src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts create mode 100644 src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts diff --git a/src/keeper/Keeper.ts b/src/keeper/Keeper.ts index 0ab24d8..14860da 100644 --- a/src/keeper/Keeper.ts +++ b/src/keeper/Keeper.ts @@ -12,7 +12,8 @@ import { } from './contracts/conditions' import { AgreementTemplate, - EscrowAccessSecretStoreTemplate + EscrowAccessSecretStoreTemplate, + EscrowComputeExecutionTemplate } from './contracts/templates' import { TemplateStoreManager, @@ -73,6 +74,9 @@ export class Keeper extends Instantiable { // Templates escrowAccessSecretStoreTemplate: EscrowAccessSecretStoreTemplate.getInstance( config + ), + escrowComputeExecutionTemplate: EscrowComputeExecutionTemplate.getInstance( + config ) }) @@ -109,9 +113,10 @@ export class Keeper extends Instantiable { // Conditions keeper.templates = { escrowAccessSecretStoreTemplate: - keeper.instances.escrowAccessSecretStoreTemplate + keeper.instances.escrowAccessSecretStoreTemplate, + escrowComputeExecutionTemplate: + keeper.instances.escrowComputeExecutionTemplate } - // Utils keeper.utils = { eventHandler: new EventHandler(config) @@ -177,6 +182,7 @@ export class Keeper extends Instantiable { */ public templates: { escrowAccessSecretStoreTemplate: EscrowAccessSecretStoreTemplate + escrowComputeExecutionTemplate: EscrowComputeExecutionTemplate } /** diff --git a/src/keeper/contracts/templates/BaseEscrowTemplate.abstract.ts b/src/keeper/contracts/templates/BaseEscrowTemplate.abstract.ts new file mode 100644 index 0000000..2d178d7 --- /dev/null +++ b/src/keeper/contracts/templates/BaseEscrowTemplate.abstract.ts @@ -0,0 +1,43 @@ +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.ts b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts index c7adcac..09e7a9d 100644 --- a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts +++ b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts @@ -1,11 +1,12 @@ 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 { escrowAccessSecretStoreTemplateServiceAgreementTemplate } from './EscrowAccessSecretStoreTemplate.serviceAgreementTemplate' -export class EscrowAccessSecretStoreTemplate extends AgreementTemplate { +export class EscrowAccessSecretStoreTemplate extends BaseEscrowTemplate { public static async getInstance( config: InstantiableConfig ): Promise { @@ -20,37 +21,6 @@ export class EscrowAccessSecretStoreTemplate extends AgreementTemplate { return escrowAccessSecretStoreTemplateServiceAgreementTemplate } - /** - * Create a agreement using EscrowAccessSecretStoreTemplate. - * @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 createAgreementFromDDO( agreementId: string, ddo: DDO, @@ -172,8 +142,4 @@ export class EscrowAccessSecretStoreTemplate extends AgreementTemplate { escrowRewardId } } - - public async getAgreementData(agreementId: string) { - return this.call('getAgreementData', [zeroX(agreementId)]) - } } diff --git a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts new file mode 100644 index 0000000..149ac2e --- /dev/null +++ b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts @@ -0,0 +1,142 @@ +import { ServiceAgreementTemplate } from '../../../ddo/ServiceAgreementTemplate' + +export const escrowComputeExecutionTemplateServiceAgreementTemplate: ServiceAgreementTemplate = { + contractName: 'EscrowComputeExecutionTemplate', + events: [ + { + name: 'AgreementCreated', + actorType: 'consumer', + handler: { + moduleName: 'serviceExecutionTemplate', + functionName: 'fulfillLockRewardCondition', + version: '0.1' + } + } + ], + fulfillmentOrder: [ + 'lockReward.fulfill', + 'serviceExecution.fulfill', + 'escrowReward.fulfill' + ], + conditionDependency: { + lockReward: [], + serviceExecution: [], + escrowReward: ['lockReward', 'serviceExecution'] + }, + conditions: [ + { + name: 'lockReward', + timelock: 0, + timeout: 0, + contractName: 'LockRewardCondition', + functionName: 'fulfill', + parameters: [ + { + name: '_rewardAddress', + type: 'address', + value: '' + }, + { + name: '_amount', + type: 'uint256', + value: '' + } + ], + events: [ + { + name: 'Fulfilled', + actorType: 'publisher', + handler: { + moduleName: 'lockRewardCondition', + functionName: 'fulfillServiceExecutionCondition', + version: '0.1' + } + } + ] + }, + { + name: 'serviceExecution', + timelock: 0, + timeout: 0, + contractName: 'ComputeExecutionCondition', + functionName: 'fulfill', + parameters: [ + { + name: '_documentId', + type: 'bytes32', + value: '' + }, + { + name: '_grantee', + type: 'address', + value: '' + } + ], + events: [ + { + name: 'Fulfilled', + actorType: 'publisher', + handler: { + moduleName: 'serviceExecution', + functionName: 'fulfillServiceExecutionCondition', + version: '0.1' + } + }, + { + name: 'TimedOut', + actorType: 'consumer', + handler: { + moduleName: 'serviceExec', + functionName: 'fulfillServiceExecutionCondition', + version: '0.1' + } + } + ] + }, + { + name: 'escrowReward', + timelock: 0, + timeout: 0, + contractName: 'EscrowReward', + functionName: 'fulfill', + parameters: [ + { + name: '_amount', + type: 'uint256', + value: '' + }, + { + name: '_receiver', + type: 'address', + value: '' + }, + { + name: '_sender', + type: 'address', + value: '' + }, + { + name: '_lockCondition', + type: 'bytes32', + value: '' + }, + { + name: '_releaseCondition', + type: 'bytes32', + value: '' + } + ], + events: [ + { + name: 'Fulfilled', + actorType: 'publisher', + handler: { + moduleName: 'escrowRewardCondition', + functionName: 'verifyRewardTokens', + version: '0.1' + } + } + ] + } + ] +} diff --git a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts new file mode 100644 index 0000000..862fd15 --- /dev/null +++ b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts @@ -0,0 +1,145 @@ +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 { escrowComputeExecutionTemplateServiceAgreementTemplate } from './EscrowComputeExecutionTemplate.serviceAgreementTemplate' + +export class EscrowComputeExecutionTemplate extends BaseEscrowTemplate { + public static async getInstance( + config: InstantiableConfig + ): Promise { + return AgreementTemplate.getInstance( + config, + 'EscrowComputeExecutionTemplate', + EscrowComputeExecutionTemplate + ) + } + + public async getServiceAgreementTemplate() { + return escrowComputeExecutionTemplateServiceAgreementTemplate + } + + public async createAgreementFromDDO( + agreementId: string, + ddo: DDO, + consumer: string, + from?: string + ) { + return !!(await this.createFullAgreement( + ddo.shortId(), + ddo.findServiceByType('Metadata').metadata.base.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').metadata.base.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( + agreementId: string, + did: string, + amount: number | string, + consumer: string + ) { + const { didRegistry, conditions } = this.ocean.keeper + + const { + computeExecutionCondition, + lockRewardCondition, + escrowReward + } = conditions + + const publisher = await didRegistry.getDIDOwner(did) + + const lockRewardConditionId = await lockRewardCondition.generateIdHash( + agreementId, + await escrowReward.getAddress(), + amount + ) + const computeExecutionConditionId = await computeExecutionCondition.generateIdHash( + agreementId, + did, + consumer + ) + const escrowRewardId = await escrowReward.generateIdHash( + agreementId, + String(amount), + publisher, + consumer, + lockRewardConditionId, + computeExecutionConditionId + ) + + return { + lockRewardConditionId, + computeExecutionConditionId, + escrowRewardId + } + } +} diff --git a/src/keeper/contracts/templates/index.ts b/src/keeper/contracts/templates/index.ts index fa38234..d4126fa 100644 --- a/src/keeper/contracts/templates/index.ts +++ b/src/keeper/contracts/templates/index.ts @@ -1,4 +1,8 @@ export * from './AgreementTemplate.abstract' +export { BaseEscrowTemplate } from './BaseEscrowTemplate.abstract' export { EscrowAccessSecretStoreTemplate } from './EscrowAccessSecretStoreTemplate' +export { + EscrowComputeExecutionTemplate +} from './EscrowComputeExecutionTemplate' From c140ce75e95abb2f76dfdc9a383b97e7048fcb38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Guti=C3=A9rrez?= Date: Thu, 5 Sep 2019 13:34:07 +0200 Subject: [PATCH 10/56] Cover EscrowComputeExecutionTemplate with integration tests. --- ...sterEscrowComputeExecutionTemplate.test.ts | 304 ++++++++++++++++++ 1 file changed, 304 insertions(+) create mode 100644 integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts diff --git a/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts b/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts new file mode 100644 index 0000000..0979804 --- /dev/null +++ b/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts @@ -0,0 +1,304 @@ +import { assert } from 'chai' + +import { config } from '../config' + +import { Ocean, templates, conditions, utils, Account, Keeper } from '../../src' // @oceanprotocol/squid + +const { + LockRewardCondition, + EscrowReward, + ComputeExecutionCondition +} = conditions + +describe('Register Escrow Compute Execution Template', () => { + let ocean: Ocean + let keeper: Keeper + + let template: templates.EscrowComputeExecutionTemplate + + const url = 'https://example.com/did/ocean/test-attr-example.txt' + const checksum = 'b'.repeat(32) + let escrowAmount = 12 + + let templateManagerOwner: Account + let publisher: Account + let consumer: Account + + let computeExecutionCondition: conditions.ComputeExecutionCondition + let lockRewardCondition: conditions.LockRewardCondition + let escrowReward: conditions.EscrowReward + + before(async () => { + ocean = await Ocean.getInstance(config) + keeper = ocean.keeper + + template = keeper.templates.escrowComputeExecutionTemplate + + // Accounts + templateManagerOwner = (await ocean.accounts.list())[0] + publisher = (await ocean.accounts.list())[1] + consumer = (await ocean.accounts.list())[2] + + // Conditions + computeExecutionCondition = keeper.conditions.computeExecutionCondition + lockRewardCondition = keeper.conditions.lockRewardCondition + escrowReward = keeper.conditions.escrowReward + + if (!ocean.keeper.dispenser) { + escrowAmount = 0 + } + }) + + describe('Propose and approve template', () => { + it('should propose the template', async () => { + await keeper.templateStoreManager.proposeTemplate( + template.getAddress(), + consumer.getId(), + true + ) + // TODO: Use a event to detect template mined + await new Promise(resolve => setTimeout(resolve, 2 * 1000)) + }) + + it('should approve the template', async () => { + await keeper.templateStoreManager.approveTemplate( + template.getAddress(), + templateManagerOwner.getId(), + true + ) + // TODO: Use a event to detect template mined + await new Promise(resolve => setTimeout(resolve, 2 * 1000)) + }) + }) + + describe('Full flow', () => { + const agreementId = `0x${utils.generateId()}` + const did = `0x${utils.generateId()}` + + let conditionIdCompute: string + let conditionIdLock: string + let conditionIdEscrow: string + + it('should register a DID', async () => { + await keeper.didRegistry.registerAttribute( + did, + checksum, + [], + url, + publisher.getId() + ) + }) + + it('should generate the condition IDs', async () => { + conditionIdCompute = await computeExecutionCondition.generateIdHash( + agreementId, + did, + consumer.getId() + ) + conditionIdLock = await lockRewardCondition.generateIdHash( + agreementId, + await escrowReward.getAddress(), + escrowAmount + ) + conditionIdEscrow = await escrowReward.generateIdHash( + agreementId, + escrowAmount, + publisher.getId(), + consumer.getId(), + conditionIdLock, + conditionIdCompute + ) + }) + + it('should have conditions types', async () => { + const conditionTypes = await template.getConditionTypes() + + assert.equal(conditionTypes.length, 3, 'Expected 3 conditions.') + assert.deepEqual( + [...conditionTypes].sort(), + [ + computeExecutionCondition.getAddress(), + escrowReward.getAddress(), + lockRewardCondition.getAddress() + ].sort(), + "The conditions doesn't match" + ) + }) + + it('should have condition instances asociated', async () => { + const conditionInstances = await template.getConditions() + + assert.equal(conditionInstances.length, 3, 'Expected 3 conditions.') + + const conditionClasses = [ + ComputeExecutionCondition, + EscrowReward, + LockRewardCondition + ] + conditionClasses.forEach(conditionClass => { + if ( + !conditionInstances.find( + condition => condition instanceof conditionClass + ) + ) { + throw new Error( + `${conditionClass.name} is not part of the conditions.` + ) + } + }) + }) + + it('should create a new agreement', async () => { + const agreement = await template.createAgreement( + agreementId, + did, + [conditionIdCompute, conditionIdLock, conditionIdEscrow], + [0, 0, 0], + [0, 0, 0], + consumer.getId(), + publisher.getId() + ) + + assert.isTrue(agreement.status) + }) + + it('should not trigger the compute', async () => { + const computeTriggered = await computeExecutionCondition.wasComputeTriggered( + did, + consumer.getId() + ) + + assert.isFalse(computeTriggered, 'Compute has been triggered.') + }) + + it('should fulfill LockRewardCondition', async () => { + try { + await consumer.requestTokens(escrowAmount) + } catch {} + + await keeper.token.approve( + lockRewardCondition.getAddress(), + escrowAmount, + consumer.getId() + ) + + const fulfill = await lockRewardCondition.fulfill( + agreementId, + escrowReward.getAddress(), + escrowAmount, + consumer.getId() + ) + + assert.isDefined(fulfill.events.Fulfilled, 'Not Fulfilled event.') + }) + + it('should fulfill ComputeExecutionCondition', async () => { + const fulfill = await computeExecutionCondition.fulfill( + agreementId, + did, + consumer.getId(), + publisher.getId() + ) + + assert.isDefined(fulfill.events.Fulfilled, 'Not Fulfilled event.') + }) + + it('should fulfill EscrowReward', async () => { + const fulfill = await escrowReward.fulfill( + agreementId, + escrowAmount, + publisher.getId(), + consumer.getId(), + conditionIdLock, + conditionIdCompute, + consumer.getId() + ) + + assert.isDefined(fulfill.events.Fulfilled, 'Not Fulfilled event.') + }) + + it('should grant the access to the consumer', async () => { + const computeTriggered = await computeExecutionCondition.wasComputeTriggered( + did, + consumer.getId() + ) + + assert.isTrue(computeTriggered, 'Compute has not been triggered.') + }) + }) + + describe('Short flow', () => { + const did = utils.generateId() + + let agreementId + + it('should register a DID', async () => { + // This part is executed inside Ocean.assets.create() + await keeper.didRegistry.registerAttribute( + did, + checksum, + [], + url, + publisher.getId() + ) + }) + + it('should create a new agreement (short way)', async () => { + agreementId = await template.createFullAgreement( + did, + escrowAmount, + consumer.getId(), + publisher.getId() + ) + + assert.match(agreementId, /^0x[a-f0-9]{64}$/i) + }) + + it('should not grant the access to the consumer', async () => { + const computeTriggered = await computeExecutionCondition.wasComputeTriggered( + did, + consumer.getId() + ) + + assert.isFalse(computeTriggered, 'Compute has been triggered.') + }) + + it('should fulfill the conditions from consumer side', async () => { + try { + await consumer.requestTokens(escrowAmount) + } catch {} + + await ocean.agreements.conditions.lockReward( + agreementId, + escrowAmount, + consumer + ) + }) + + it('should fulfill the conditions from computing side', async () => { + await ocean.agreements.conditions.grantServiceExecution( + agreementId, + did, + consumer.getId(), + publisher + ) + await ocean.agreements.conditions.releaseReward( + agreementId, + escrowAmount, + did, + consumer.getId(), + publisher.getId(), + publisher + ) + }) + + it('should grant the access to the consumer', async () => { + const computeTriggered = await computeExecutionCondition.wasComputeTriggered( + did, + consumer.getId() + ) + + assert.isTrue(computeTriggered, 'Compute has not been triggered.') + }) + }) +}) From 13e43d7b4021b356646c279a95e4fcdb07924ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Guti=C3=A9rrez?= Date: Thu, 5 Sep 2019 13:34:36 +0200 Subject: [PATCH 11/56] Inlcude new methods on DIDRegistry. --- src/keeper/contracts/DIDRegistry.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/keeper/contracts/DIDRegistry.ts b/src/keeper/contracts/DIDRegistry.ts index eca2cb4..96c55df 100644 --- a/src/keeper/contracts/DIDRegistry.ts +++ b/src/keeper/contracts/DIDRegistry.ts @@ -65,4 +65,30 @@ export default class DIDRegistry extends ContractBase { }) )[0] } + + public async grantPermission( + did: string, + grantee: string, + ownerAddress: string + ) { + return this.send('grantPermission', ownerAddress, [ + zeroX(did), + zeroX(grantee) + ]) + } + + public async revokePermission( + did: string, + grantee: string, + ownerAddress: string + ) { + return this.send('revokePermission', ownerAddress, [ + zeroX(did), + zeroX(grantee) + ]) + } + + public async getPermission(did: string, grantee: string): Promise { + return this.call('getPermission', [didZeroX(did), zeroX(grantee)]) + } } From 3d7d1f3972a665ccce4a1d712077435c1cd87459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Guti=C3=A9rrez?= Date: Mon, 9 Sep 2019 12:18:54 +0200 Subject: [PATCH 12/56] Change linter config. --- .prettierrc | 1 + integration/config.ts | 7 +- integration/ocean/AssetOwners.test.ts | 30 ++--- integration/ocean/ConsumeAsset.test.ts | 52 ++------ integration/ocean/ConsumeAssetBrizo.test.ts | 27 +--- integration/ocean/ConsumeBigAsset.test.ts | 19 +-- ...terEscrowAccessSecretStoreTemplate.test.ts | 105 +++------------- ...sterEscrowComputeExecutionTemplate.test.ts | 102 +++------------ integration/ocean/SearchAsset.test.ts | 61 ++------- integration/ocean/SecretStore.test.ts | 6 +- integration/ocean/Signature.test.ts | 6 +- integration/utils/ddo-metadata-generator.ts | 20 +-- plugins/add-vendors-plugin.js | 35 +++--- scripts/typedoc.js | 5 +- src/Instantiable.abstract.ts | 8 +- src/aquarius/Aquarius.ts | 72 ++--------- src/brizo/Brizo.ts | 30 +---- src/ddo/DDO.ts | 26 +--- src/ddo/PublicKey.ts | 6 +- src/ddo/Service.ts | 12 +- src/keeper/ContractEvent.ts | 4 +- src/keeper/ContractHandler.ts | 50 ++------ src/keeper/EventHandler.ts | 11 +- src/keeper/Keeper.ts | 58 +++------ src/keeper/Web3Provider.ts | 6 +- src/keeper/contracts/ContractBase.ts | 78 +++--------- src/keeper/contracts/DIDRegistry.ts | 55 ++------- src/keeper/contracts/Dispenser.ts | 9 +- src/keeper/contracts/GenericContract.ts | 5 +- src/keeper/contracts/Token.ts | 8 +- .../conditions/AccessSecretStoreCondition.ts | 33 +---- .../conditions/ComputeExecutionCondition.ts | 35 +----- .../conditions/Condition.abstract.ts | 7 +- .../contracts/conditions/EscrowReward.ts | 16 +-- .../conditions/LockRewardCondition.ts | 23 +--- .../managers/AgreementStoreManager.ts | 20 +-- .../managers/ConditionStoreManager.ts | 21 +--- .../managers/TemplateStoreManager.ts | 31 +---- .../templates/AgreementTemplate.abstract.ts | 71 +++-------- .../templates/BaseEscrowTemplate.abstract.ts | 10 +- ...tStoreTemplate.serviceAgreementTemplate.ts | 6 +- .../EscrowAccessSecretStoreTemplate.ts | 62 ++-------- ...cutionTemplate.serviceAgreementTemplate.ts | 6 +- .../EscrowComputeExecutionTemplate.ts | 62 ++-------- src/keeper/contracts/templates/index.ts | 8 +- src/ocean/Account.ts | 8 +- src/ocean/Ocean.ts | 9 +- src/ocean/OceanAccounts.ts | 13 +- src/ocean/OceanAgreements.ts | 58 ++------- src/ocean/OceanAgreementsConditions.ts | 61 ++------- src/ocean/OceanAssets.ts | 102 ++++----------- src/ocean/OceanAuth.ts | 18 +-- src/ocean/OceanSecretStore.ts | 43 ++----- src/ocean/OceanTokens.ts | 10 +- src/ocean/OceanVersions.ts | 17 +-- src/ocean/utils/OceanUtils.ts | 4 +- src/ocean/utils/ServiceAgreement.ts | 15 +-- src/ocean/utils/SignatureUtils.ts | 11 +- src/ocean/utils/WebServiceConnector.ts | 14 +-- src/squid.ts | 12 +- src/utils/ConversionTypeHelpers.ts | 22 +--- src/utils/DDOHelpers.ts | 9 +- src/utils/PromiseResolver.ts | 4 +- src/utils/SubscribableObserver.ts | 10 +- src/utils/SubscribablePromise.ts | 13 +- test/aquarius/Aquarius.test.ts | 28 ++--- test/ddo/DDO.test.ts | 62 +++------- test/keeper/ContractBase.test.ts | 16 +-- test/keeper/ContractEvent.test.ts | 21 +--- test/keeper/DIDRegistry.test.ts | 30 +---- test/keeper/EventHandler.test.ts | 12 +- test/keeper/TestContractHandler.ts | 116 ++++++------------ .../AccessSecretStoreCondition.test.ts | 3 +- test/keeper/conditions/EscrowReward.test.ts | 28 +---- .../conditions/LockRewardCondition.test.ts | 3 +- test/mocks/WebServiceConnector.mock.ts | 4 +- test/ocean/Account.test.ts | 10 +- test/ocean/OceanAuth.test.ts | 6 +- test/ocean/OceanSecretStore.test.ts | 12 +- test/ocean/utils/SignatureUtils.test.ts | 23 +--- test/utils/ConversionTypeHelpers.test.ts | 7 +- 81 files changed, 460 insertions(+), 1699 deletions(-) diff --git a/.prettierrc b/.prettierrc index 910ce78..9311b5b 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,6 @@ { "semi": false, "singleQuote": true, + "printWidth": 120, "trailingComma": "none" } diff --git a/integration/config.ts b/integration/config.ts index d01da08..c203a24 100644 --- a/integration/config.ts +++ b/integration/config.ts @@ -44,12 +44,7 @@ if (process.env.SEED_WORDS) { const seedphrase = process.env.SEED_WORDS // @ts-ignore - configJson.web3Provider = new HDWalletProvider( - seedphrase, - configJson.nodeUri, - 0, - 5 - ) + configJson.web3Provider = new HDWalletProvider(seedphrase, configJson.nodeUri, 0, 5) } export const config: Config & { forceVerbose: Config } = configJson as any diff --git a/integration/ocean/AssetOwners.test.ts b/integration/ocean/AssetOwners.test.ts index 487c923..dbdd624 100644 --- a/integration/ocean/AssetOwners.test.ts +++ b/integration/ocean/AssetOwners.test.ts @@ -32,49 +32,35 @@ describe('Asset Owners', () => { it('should set the provider of an asset', async () => { const ddo = await ocean.assets.create(metadata as any, account1) - const isProvider = await ocean.keeper.didRegistry.isDIDProvider( - ddo.id, - config.brizoAddress - ) + const isProvider = await ocean.keeper.didRegistry.isDIDProvider(ddo.id, config.brizoAddress) assert.isTrue(isProvider) }) it('should get the assets owned by a user', async () => { - const { length: initialLength } = await ocean.assets.ownerAssets( - account2.getId() - ) + const { length: initialLength } = await ocean.assets.ownerAssets(account2.getId()) await ocean.assets.create(metadata as any, account1) await ocean.assets.create(metadata as any, account1) await ocean.assets.create(metadata as any, account2) - const { length: finalLength } = await ocean.assets.ownerAssets( - account2.getId() - ) + const { length: finalLength } = await ocean.assets.ownerAssets(account2.getId()) assert.equal(finalLength - initialLength, 1) }) it('should get the assets that can be consumed by a user', async () => { - const { length: initialLength } = await ocean.assets.consumerAssets( - account2.getId() - ) + const { length: initialLength } = await ocean.assets.consumerAssets(account2.getId()) const ddo = await ocean.assets.create(metadata as any, account1) - const { length: finalLength1 } = await ocean.assets.consumerAssets( - account2.getId() - ) + const { length: finalLength1 } = await ocean.assets.consumerAssets(account2.getId()) assert.equal(finalLength1 - initialLength, 0) // Granting access try { - await account2.requestTokens( - +metadata.main.price * - 10 ** -(await ocean.keeper.token.decimals()) - ) + await account2.requestTokens(+metadata.main.price * 10 ** -(await ocean.keeper.token.decimals())) } catch {} const { index } = ddo.findServiceByType('access') @@ -82,9 +68,7 @@ describe('Asset Owners', () => { await ocean.assets.order(ddo.id, index, account2) // Access granted - const { length: finalLength2 } = await ocean.assets.consumerAssets( - account2.getId() - ) + const { length: finalLength2 } = await ocean.assets.consumerAssets(account2.getId()) assert.equal(finalLength2 - initialLength, 1) }) }) diff --git a/integration/ocean/ConsumeAsset.test.ts b/integration/ocean/ConsumeAsset.test.ts index debfdf5..992441f 100644 --- a/integration/ocean/ConsumeAsset.test.ts +++ b/integration/ocean/ConsumeAsset.test.ts @@ -36,53 +36,29 @@ describe('Consume Asset', () => { assert.isDefined(ddo, 'Register has not returned a DDO') assert.match(ddo.id, /^did:op:[a-f0-9]{64}$/, 'DDO id is not valid') - assert.isAtLeast( - ddo.authentication.length, - 1, - 'Default authentication not added' - ) - assert.isDefined( - ddo.findServiceByType('access'), - "DDO access service doesn't exist" - ) + assert.isAtLeast(ddo.authentication.length, 1, 'Default authentication not added') + assert.isDefined(ddo.findServiceByType('access'), "DDO access service doesn't exist") }) it('should be able to request tokens for consumer', async () => { const initialBalance = (await consumer.getBalance()).ocn - const claimedTokens = - +metadata.main.price * 10 ** -(await ocean.keeper.token.decimals()) + const claimedTokens = +metadata.main.price * 10 ** -(await ocean.keeper.token.decimals()) try { await consumer.requestTokens(claimedTokens) } catch {} - assert.equal( - (await consumer.getBalance()).ocn, - initialBalance + claimedTokens, - 'OCN Tokens not delivered' - ) + assert.equal((await consumer.getBalance()).ocn, initialBalance + claimedTokens, 'OCN Tokens not delivered') }) it('should sign the service agreement', async () => { const accessService = ddo.findServiceByType('access') - serviceAgreementSignatureResult = await ocean.agreements.prepare( - ddo.id, - accessService.index, - consumer - ) + serviceAgreementSignatureResult = await ocean.agreements.prepare(ddo.id, accessService.index, consumer) const { agreementId, signature } = serviceAgreementSignatureResult - assert.match( - agreementId, - /^0x[a-f0-9]{64}$/, - 'Service agreement ID seems not valid' - ) - assert.match( - signature, - /^0x[a-f0-9]{130}$/, - 'Service agreement signature seems not valid' - ) + assert.match(agreementId, /^0x[a-f0-9]{64}$/, 'Service agreement ID seems not valid') + assert.match(signature, /^0x[a-f0-9]{130}$/, 'Service agreement signature seems not valid') }) it('should execute the service agreement', async () => { @@ -101,9 +77,7 @@ describe('Consume Asset', () => { }) it('should get the agreement conditions status not fulfilled', async () => { - const status = await ocean.agreements.status( - serviceAgreementSignatureResult.agreementId - ) + const status = await ocean.agreements.status(serviceAgreementSignatureResult.agreementId) assert.deepEqual(status, { lockReward: ConditionState.Unfulfilled, @@ -144,9 +118,7 @@ describe('Consume Asset', () => { }) it('should get the agreement conditions status fulfilled', async () => { - const status = await ocean.agreements.status( - serviceAgreementSignatureResult.agreementId - ) + const status = await ocean.agreements.status(serviceAgreementSignatureResult.agreementId) assert.deepEqual(status, { lockReward: ConditionState.Fulfilled, @@ -175,11 +147,7 @@ describe('Consume Asset', () => { }) }) - assert.deepEqual( - files, - ['README.md', 'package.json'], - 'Stored files are not correct.' - ) + assert.deepEqual(files, ['README.md', 'package.json'], 'Stored files are not correct.') }) it('should consume and store one asset', async () => { diff --git a/integration/ocean/ConsumeAssetBrizo.test.ts b/integration/ocean/ConsumeAssetBrizo.test.ts index c2beb4f..6b965dd 100644 --- a/integration/ocean/ConsumeAssetBrizo.test.ts +++ b/integration/ocean/ConsumeAssetBrizo.test.ts @@ -41,9 +41,7 @@ describe('Consume Asset (Brizo)', () => { it('should regiester an asset', async () => { const steps = [] - ddo = await ocean.assets - .create(metadata as any, publisher) - .next(step => steps.push(step)) + ddo = await ocean.assets.create(metadata as any, publisher).next(step => steps.push(step)) assert.instanceOf(ddo, DDO) assert.deepEqual(steps, [0, 1, 2, 3, 4, 5, 6, 7]) @@ -53,16 +51,11 @@ describe('Consume Asset (Brizo)', () => { const accessService = ddo.findServiceByType('access') try { - await consumer.requestTokens( - +metadata.main.price * - 10 ** -(await ocean.keeper.token.decimals()) - ) + await consumer.requestTokens(+metadata.main.price * 10 ** -(await ocean.keeper.token.decimals())) } catch {} const steps = [] - agreementId = await ocean.assets - .order(ddo.id, accessService.index, consumer) - .next(step => steps.push(step)) + agreementId = await ocean.assets.order(ddo.id, accessService.index, consumer).next(step => steps.push(step)) assert.isDefined(agreementId) assert.deepEqual(steps, [0, 1, 2, 3]) @@ -72,13 +65,7 @@ describe('Consume Asset (Brizo)', () => { const accessService = ddo.findServiceByType('access') const folder = '/tmp/ocean/squid-js' - const path = await ocean.assets.consume( - agreementId, - ddo.id, - accessService.index, - consumer, - folder - ) + const path = await ocean.assets.consume(agreementId, ddo.id, accessService.index, consumer, folder) assert.include(path, folder, 'The storage path is not correct.') @@ -88,10 +75,6 @@ describe('Consume Asset (Brizo)', () => { }) }) - assert.deepEqual( - files, - ['README.md', 'package.json'], - 'Stored files are not correct.' - ) + assert.deepEqual(files, ['README.md', 'package.json'], 'Stored files are not correct.') }) }) diff --git a/integration/ocean/ConsumeBigAsset.test.ts b/integration/ocean/ConsumeBigAsset.test.ts index 7522aa0..3c33bd7 100644 --- a/integration/ocean/ConsumeBigAsset.test.ts +++ b/integration/ocean/ConsumeBigAsset.test.ts @@ -51,17 +51,10 @@ xdescribe('Consume Asset (Large size)', () => { const accessService = ddo.findServiceByType('access') try { - await consumer.requestTokens( - +metadata.main.price * - 10 ** -(await ocean.keeper.token.decimals()) - ) + await consumer.requestTokens(+metadata.main.price * 10 ** -(await ocean.keeper.token.decimals())) } catch {} - agreementId = await ocean.assets.order( - ddo.id, - accessService.index, - consumer - ) + agreementId = await ocean.assets.order(ddo.id, accessService.index, consumer) assert.isDefined(agreementId) }) @@ -70,13 +63,7 @@ xdescribe('Consume Asset (Large size)', () => { const accessService = ddo.findServiceByType('access') const folder = '/tmp/ocean/squid-js' - const path = await ocean.assets.consume( - agreementId, - ddo.id, - accessService.index, - consumer, - folder - ) + const path = await ocean.assets.consume(agreementId, ddo.id, accessService.index, consumer, folder) assert.include(path, folder, 'The storage path is not correct.') diff --git a/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts b/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts index 9aae941..03193a0 100644 --- a/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts +++ b/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts @@ -4,11 +4,7 @@ import { config } from '../config' import { Ocean, templates, conditions, utils, Account, Keeper } from '../../src' // @oceanprotocol/squid -const { - LockRewardCondition, - EscrowReward, - AccessSecretStoreCondition -} = conditions +const { LockRewardCondition, EscrowReward, AccessSecretStoreCondition } = conditions describe('Register Escrow Access Secret Store Template', () => { let ocean: Ocean @@ -40,8 +36,7 @@ describe('Register Escrow Access Secret Store Template', () => { consumer = (await ocean.accounts.list())[2] // Conditions - accessSecretStoreCondition = - keeper.conditions.accessSecretStoreCondition + accessSecretStoreCondition = keeper.conditions.accessSecretStoreCondition lockRewardCondition = keeper.conditions.lockRewardCondition escrowReward = keeper.conditions.escrowReward @@ -52,21 +47,13 @@ describe('Register Escrow Access Secret Store Template', () => { describe('Propose and approve template', () => { it('should propose the template', async () => { - await keeper.templateStoreManager.proposeTemplate( - template.getAddress(), - consumer.getId(), - true - ) + await keeper.templateStoreManager.proposeTemplate(template.getAddress(), consumer.getId(), true) // TODO: Use a event to detect template mined await new Promise(resolve => setTimeout(resolve, 2 * 1000)) }) it('should approve the template', async () => { - await keeper.templateStoreManager.approveTemplate( - template.getAddress(), - templateManagerOwner.getId(), - true - ) + await keeper.templateStoreManager.approveTemplate(template.getAddress(), templateManagerOwner.getId(), true) // TODO: Use a event to detect template mined await new Promise(resolve => setTimeout(resolve, 2 * 1000)) }) @@ -81,21 +68,11 @@ describe('Register Escrow Access Secret Store Template', () => { let conditionIdEscrow: string it('should register a DID', async () => { - await keeper.didRegistry.registerAttribute( - did, - checksum, - [], - url, - publisher.getId() - ) + await keeper.didRegistry.registerAttribute(did, checksum, [], url, publisher.getId()) }) it('should generate the condition IDs', async () => { - conditionIdAccess = await accessSecretStoreCondition.generateIdHash( - agreementId, - did, - consumer.getId() - ) + conditionIdAccess = await accessSecretStoreCondition.generateIdHash(agreementId, did, consumer.getId()) conditionIdLock = await lockRewardCondition.generateIdHash( agreementId, await escrowReward.getAddress(), @@ -131,20 +108,10 @@ describe('Register Escrow Access Secret Store Template', () => { assert.equal(conditionInstances.length, 3, 'Expected 3 conditions.') - const conditionClasses = [ - AccessSecretStoreCondition, - EscrowReward, - LockRewardCondition - ] + const conditionClasses = [AccessSecretStoreCondition, EscrowReward, LockRewardCondition] conditionClasses.forEach(conditionClass => { - if ( - !conditionInstances.find( - condition => condition instanceof conditionClass - ) - ) { - throw new Error( - `${conditionClass.name} is not part of the conditions.` - ) + if (!conditionInstances.find(condition => condition instanceof conditionClass)) { + throw new Error(`${conditionClass.name} is not part of the conditions.`) } }) }) @@ -164,10 +131,7 @@ describe('Register Escrow Access Secret Store Template', () => { }) it('should not grant the access to the consumer', async () => { - const accessGranted = await accessSecretStoreCondition.checkPermissions( - consumer.getId(), - did - ) + const accessGranted = await accessSecretStoreCondition.checkPermissions(consumer.getId(), did) assert.isFalse(accessGranted, 'Consumer has been granted.') }) @@ -177,11 +141,7 @@ describe('Register Escrow Access Secret Store Template', () => { await consumer.requestTokens(escrowAmount) } catch {} - await keeper.token.approve( - lockRewardCondition.getAddress(), - escrowAmount, - consumer.getId() - ) + await keeper.token.approve(lockRewardCondition.getAddress(), escrowAmount, consumer.getId()) const fulfill = await lockRewardCondition.fulfill( agreementId, @@ -219,10 +179,7 @@ describe('Register Escrow Access Secret Store Template', () => { }) it('should grant the access to the consumer', async () => { - const accessGranted = await accessSecretStoreCondition.checkPermissions( - consumer.getId(), - did - ) + const accessGranted = await accessSecretStoreCondition.checkPermissions(consumer.getId(), did) assert.isTrue(accessGranted, 'Consumer has not been granted.') }) @@ -235,31 +192,17 @@ describe('Register Escrow Access Secret Store Template', () => { it('should register a DID', async () => { // This part is executed inside Ocean.assets.create() - await keeper.didRegistry.registerAttribute( - did, - checksum, - [], - url, - publisher.getId() - ) + await keeper.didRegistry.registerAttribute(did, checksum, [], url, publisher.getId()) }) it('should create a new agreement (short way)', async () => { - agreementId = await template.createFullAgreement( - did, - escrowAmount, - consumer.getId(), - publisher.getId() - ) + agreementId = await template.createFullAgreement(did, escrowAmount, consumer.getId(), publisher.getId()) assert.match(agreementId, /^0x[a-f0-9]{64}$/i) }) it('should not grant the access to the consumer', async () => { - const accessGranted = await accessSecretStoreCondition.checkPermissions( - consumer.getId(), - did - ) + const accessGranted = await accessSecretStoreCondition.checkPermissions(consumer.getId(), did) assert.isFalse(accessGranted, 'Consumer has been granted.') }) @@ -269,20 +212,11 @@ describe('Register Escrow Access Secret Store Template', () => { await consumer.requestTokens(escrowAmount) } catch {} - await ocean.agreements.conditions.lockReward( - agreementId, - escrowAmount, - consumer - ) + await ocean.agreements.conditions.lockReward(agreementId, escrowAmount, consumer) }) it('should fulfill the conditions from publisher side', async () => { - await ocean.agreements.conditions.grantAccess( - agreementId, - did, - consumer.getId(), - publisher - ) + await ocean.agreements.conditions.grantAccess(agreementId, did, consumer.getId(), publisher) await ocean.agreements.conditions.releaseReward( agreementId, escrowAmount, @@ -294,10 +228,7 @@ describe('Register Escrow Access Secret Store Template', () => { }) it('should grant the access to the consumer', async () => { - const accessGranted = await accessSecretStoreCondition.checkPermissions( - consumer.getId(), - did - ) + const accessGranted = await accessSecretStoreCondition.checkPermissions(consumer.getId(), did) assert.isTrue(accessGranted, 'Consumer has not been granted.') }) diff --git a/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts b/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts index 0979804..5cc6151 100644 --- a/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts +++ b/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts @@ -4,11 +4,7 @@ import { config } from '../config' import { Ocean, templates, conditions, utils, Account, Keeper } from '../../src' // @oceanprotocol/squid -const { - LockRewardCondition, - EscrowReward, - ComputeExecutionCondition -} = conditions +const { LockRewardCondition, EscrowReward, ComputeExecutionCondition } = conditions describe('Register Escrow Compute Execution Template', () => { let ocean: Ocean @@ -51,21 +47,13 @@ describe('Register Escrow Compute Execution Template', () => { describe('Propose and approve template', () => { it('should propose the template', async () => { - await keeper.templateStoreManager.proposeTemplate( - template.getAddress(), - consumer.getId(), - true - ) + await keeper.templateStoreManager.proposeTemplate(template.getAddress(), consumer.getId(), true) // TODO: Use a event to detect template mined await new Promise(resolve => setTimeout(resolve, 2 * 1000)) }) it('should approve the template', async () => { - await keeper.templateStoreManager.approveTemplate( - template.getAddress(), - templateManagerOwner.getId(), - true - ) + await keeper.templateStoreManager.approveTemplate(template.getAddress(), templateManagerOwner.getId(), true) // TODO: Use a event to detect template mined await new Promise(resolve => setTimeout(resolve, 2 * 1000)) }) @@ -80,21 +68,11 @@ describe('Register Escrow Compute Execution Template', () => { let conditionIdEscrow: string it('should register a DID', async () => { - await keeper.didRegistry.registerAttribute( - did, - checksum, - [], - url, - publisher.getId() - ) + await keeper.didRegistry.registerAttribute(did, checksum, [], url, publisher.getId()) }) it('should generate the condition IDs', async () => { - conditionIdCompute = await computeExecutionCondition.generateIdHash( - agreementId, - did, - consumer.getId() - ) + conditionIdCompute = await computeExecutionCondition.generateIdHash(agreementId, did, consumer.getId()) conditionIdLock = await lockRewardCondition.generateIdHash( agreementId, await escrowReward.getAddress(), @@ -130,20 +108,10 @@ describe('Register Escrow Compute Execution Template', () => { assert.equal(conditionInstances.length, 3, 'Expected 3 conditions.') - const conditionClasses = [ - ComputeExecutionCondition, - EscrowReward, - LockRewardCondition - ] + const conditionClasses = [ComputeExecutionCondition, EscrowReward, LockRewardCondition] conditionClasses.forEach(conditionClass => { - if ( - !conditionInstances.find( - condition => condition instanceof conditionClass - ) - ) { - throw new Error( - `${conditionClass.name} is not part of the conditions.` - ) + if (!conditionInstances.find(condition => condition instanceof conditionClass)) { + throw new Error(`${conditionClass.name} is not part of the conditions.`) } }) }) @@ -163,10 +131,7 @@ describe('Register Escrow Compute Execution Template', () => { }) it('should not trigger the compute', async () => { - const computeTriggered = await computeExecutionCondition.wasComputeTriggered( - did, - consumer.getId() - ) + const computeTriggered = await computeExecutionCondition.wasComputeTriggered(did, consumer.getId()) assert.isFalse(computeTriggered, 'Compute has been triggered.') }) @@ -176,11 +141,7 @@ describe('Register Escrow Compute Execution Template', () => { await consumer.requestTokens(escrowAmount) } catch {} - await keeper.token.approve( - lockRewardCondition.getAddress(), - escrowAmount, - consumer.getId() - ) + await keeper.token.approve(lockRewardCondition.getAddress(), escrowAmount, consumer.getId()) const fulfill = await lockRewardCondition.fulfill( agreementId, @@ -218,10 +179,7 @@ describe('Register Escrow Compute Execution Template', () => { }) it('should grant the access to the consumer', async () => { - const computeTriggered = await computeExecutionCondition.wasComputeTriggered( - did, - consumer.getId() - ) + const computeTriggered = await computeExecutionCondition.wasComputeTriggered(did, consumer.getId()) assert.isTrue(computeTriggered, 'Compute has not been triggered.') }) @@ -234,31 +192,17 @@ describe('Register Escrow Compute Execution Template', () => { it('should register a DID', async () => { // This part is executed inside Ocean.assets.create() - await keeper.didRegistry.registerAttribute( - did, - checksum, - [], - url, - publisher.getId() - ) + await keeper.didRegistry.registerAttribute(did, checksum, [], url, publisher.getId()) }) it('should create a new agreement (short way)', async () => { - agreementId = await template.createFullAgreement( - did, - escrowAmount, - consumer.getId(), - publisher.getId() - ) + agreementId = await template.createFullAgreement(did, escrowAmount, consumer.getId(), publisher.getId()) assert.match(agreementId, /^0x[a-f0-9]{64}$/i) }) it('should not grant the access to the consumer', async () => { - const computeTriggered = await computeExecutionCondition.wasComputeTriggered( - did, - consumer.getId() - ) + const computeTriggered = await computeExecutionCondition.wasComputeTriggered(did, consumer.getId()) assert.isFalse(computeTriggered, 'Compute has been triggered.') }) @@ -268,20 +212,11 @@ describe('Register Escrow Compute Execution Template', () => { await consumer.requestTokens(escrowAmount) } catch {} - await ocean.agreements.conditions.lockReward( - agreementId, - escrowAmount, - consumer - ) + await ocean.agreements.conditions.lockReward(agreementId, escrowAmount, consumer) }) it('should fulfill the conditions from computing side', async () => { - await ocean.agreements.conditions.grantServiceExecution( - agreementId, - did, - consumer.getId(), - publisher - ) + await ocean.agreements.conditions.grantServiceExecution(agreementId, did, consumer.getId(), publisher) await ocean.agreements.conditions.releaseReward( agreementId, escrowAmount, @@ -293,10 +228,7 @@ describe('Register Escrow Compute Execution Template', () => { }) it('should grant the access to the consumer', async () => { - const computeTriggered = await computeExecutionCondition.wasComputeTriggered( - did, - consumer.getId() - ) + const computeTriggered = await computeExecutionCondition.wasComputeTriggered(did, consumer.getId()) assert.isTrue(computeTriggered, 'Compute has not been triggered.') }) diff --git a/integration/ocean/SearchAsset.test.ts b/integration/ocean/SearchAsset.test.ts index dc30fc3..e66efa1 100644 --- a/integration/ocean/SearchAsset.test.ts +++ b/integration/ocean/SearchAsset.test.ts @@ -15,8 +15,7 @@ describe('Search Asset', () => { .toString(36) .substr(2) let price - const metadataGenerator = (name: string) => - generateMetadata(`${name}${testHash}`, price) + const metadataGenerator = (name: string) => generateMetadata(`${name}${testHash}`, price) let test1length let test2length @@ -35,10 +34,8 @@ describe('Search Asset', () => { assert.isArray(ddos, 'A search should return an array') test1length = ddos.length - test2length = (await ocean.assets.search(`Test2${testHash}`)).results - .length - test3length = (await ocean.assets.search(`Test3${testHash}`)).results - .length + test2length = (await ocean.assets.search(`Test2${testHash}`)).results.length + test3length = (await ocean.assets.search(`Test3${testHash}`)).results.length if (!ocean.keeper.dispenser) { price = 0 @@ -46,46 +43,20 @@ describe('Search Asset', () => { }) it('should register an asset', async () => { - assert.instanceOf( - await ocean.assets.create( - metadataGenerator('Test1') as any, - publisher - ), - DDO - ) - assert.instanceOf( - await ocean.assets.create( - metadataGenerator('Test2') as any, - publisher - ), - DDO - ) - assert.instanceOf( - await ocean.assets.create( - metadataGenerator('Test2') as any, - publisher - ), - DDO - ) - assert.instanceOf( - await ocean.assets.create( - metadataGenerator('Test3') as any, - publisher - ), - DDO - ) + assert.instanceOf(await ocean.assets.create(metadataGenerator('Test1') as any, publisher), DDO) + assert.instanceOf(await ocean.assets.create(metadataGenerator('Test2') as any, publisher), DDO) + assert.instanceOf(await ocean.assets.create(metadataGenerator('Test2') as any, publisher), DDO) + assert.instanceOf(await ocean.assets.create(metadataGenerator('Test3') as any, publisher), DDO) }) it('should search by text and see the increment of DDOs', async () => { assert.equal( - (await ocean.assets.search(`Test2${testHash}`)).results.length - - test2length, + (await ocean.assets.search(`Test2${testHash}`)).results.length - test2length, 2, 'Something was wrong searching the assets' ) assert.equal( - (await ocean.assets.search(`Test3${testHash}`)).results.length - - test3length, + (await ocean.assets.search(`Test3${testHash}`)).results.length - test3length, 1, 'Something was wrong searching the assets' ) @@ -94,14 +65,8 @@ describe('Search Asset', () => { it('should return a list of DDOs', async () => { const { results: ddos } = await ocean.assets.search(`Test1${testHash}`) - assert.equal( - ddos.length - test1length, - 1, - 'Something was wrong searching the assets' - ) - ddos.map(ddo => - assert.instanceOf(ddo, DDO, 'The DDO is not an instance of a DDO') - ) + assert.equal(ddos.length - test1length, 1, 'Something was wrong searching the assets') + ddos.map(ddo => assert.instanceOf(ddo, DDO, 'The DDO is not an instance of a DDO')) }) it('should be able to do a query to get a list of DDOs', async () => { @@ -117,8 +82,6 @@ describe('Search Asset', () => { }) assert.equal(ddos.length, 1, 'Something was wrong searching the assets') - ddos.map(ddo => - assert.instanceOf(ddo, DDO, 'The DDO is not an instance of a DDO') - ) + ddos.map(ddo => assert.instanceOf(ddo, DDO, 'The DDO is not an instance of a DDO')) }) }) diff --git a/integration/ocean/SecretStore.test.ts b/integration/ocean/SecretStore.test.ts index 375f377..91e578b 100644 --- a/integration/ocean/SecretStore.test.ts +++ b/integration/ocean/SecretStore.test.ts @@ -21,11 +21,7 @@ describe('Secret Store', () => { }) it('should encrypt a text', async () => { - encryptedContent = await ocean.secretStore.encrypt( - did.getId(), - content, - account - ) + encryptedContent = await ocean.secretStore.encrypt(did.getId(), content, account) assert.isDefined(encryptedContent) assert.match(encryptedContent, /^0x[a-f0-9]{76}$/i) diff --git a/integration/ocean/Signature.test.ts b/integration/ocean/Signature.test.ts index 6a66394..b83b6c4 100644 --- a/integration/ocean/Signature.test.ts +++ b/integration/ocean/Signature.test.ts @@ -76,11 +76,7 @@ describe('Signature', () => { ddo, 0, agreementId, - [ - `0x${'1'.repeat(64)}`, - `0x${'2'.repeat(64)}`, - `0x${'3'.repeat(64)}` - ], + [`0x${'1'.repeat(64)}`, `0x${'2'.repeat(64)}`, `0x${'3'.repeat(64)}`], consumer ) diff --git a/integration/utils/ddo-metadata-generator.ts b/integration/utils/ddo-metadata-generator.ts index c1d9af2..59f29f0 100644 --- a/integration/utils/ddo-metadata-generator.ts +++ b/integration/utils/ddo-metadata-generator.ts @@ -13,23 +13,19 @@ const metadata: Partial = { { index: 0, contentType: 'application/json', - url: - 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/package.json' + url: 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/package.json' }, { index: 1, contentType: 'text/plain', - url: - 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/README.md' + url: 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/README.md' } ] }, additionalInformation: { - description: - 'Weather information of UK including temperature and humidity', + description: 'Weather information of UK including temperature and humidity', copyrightHolder: 'Met Office', - workExample: - '423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68', + workExample: '423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68', links: [ { name: 'Sample of Asset Data', @@ -48,10 +44,7 @@ const metadata: Partial = { } } -export const generateMetadata = ( - name: string, - price?: number -): Partial => ({ +export const generateMetadata = (name: string, price?: number): Partial => ({ ...metadata, main: { ...metadata.main, @@ -63,5 +56,4 @@ export const generateMetadata = ( } }) -export const getMetadata = (price?: number) => - generateMetadata('TestAsset', price) +export const getMetadata = (price?: number) => generateMetadata('TestAsset', price) diff --git a/plugins/add-vendors-plugin.js b/plugins/add-vendors-plugin.js index be75bcd..72540b4 100644 --- a/plugins/add-vendors-plugin.js +++ b/plugins/add-vendors-plugin.js @@ -6,26 +6,23 @@ module.exports = class AddVendorsPlugin { } apply(compiler) { - compiler.hooks.emit.tapAsync( - `AddVendorsPlugin ${this.base}`, - (compilation, callback) => { - const main = compilation.assets[`main.${this.base}`] - const mainMap = compilation.assets[`main.${this.base}.map`] - const vendor = compilation.assets[`vendors.${this.base}`] + compiler.hooks.emit.tapAsync(`AddVendorsPlugin ${this.base}`, (compilation, callback) => { + const main = compilation.assets[`main.${this.base}`] + const mainMap = compilation.assets[`main.${this.base}.map`] + const vendor = compilation.assets[`vendors.${this.base}`] - if (main && vendor) { - const compiledAsset = new ConcatSource(main.children[0]) - compiledAsset.add(vendor) - compiledAsset.add(main.children[1]) - compilation.assets = {} - compilation.assets[this.base] = compiledAsset - } else if (main && mainMap) { - compilation.assets = {} - compilation.assets[this.base] = main - compilation.assets[`${this.base}.map`] = mainMap - } - callback() + if (main && vendor) { + const compiledAsset = new ConcatSource(main.children[0]) + compiledAsset.add(vendor) + compiledAsset.add(main.children[1]) + compilation.assets = {} + compilation.assets[this.base] = compiledAsset + } else if (main && mainMap) { + compilation.assets = {} + compilation.assets[this.base] = main + compilation.assets[`${this.base}.map`] = mainMap } - ) + callback() + }) } } diff --git a/scripts/typedoc.js b/scripts/typedoc.js index 849c79b..ddb45ce 100755 --- a/scripts/typedoc.js +++ b/scripts/typedoc.js @@ -15,10 +15,7 @@ const outPath = './dist/squid-js.json' const files = ['./src/squid.ts'] // specifically point to tsconfig, otherwise TypeDoc fails -const config = typescript.findConfigFile( - './tsconfig.js', - typescript.sys.fileExists -) +const config = typescript.findConfigFile('./tsconfig.js', typescript.sys.fileExists) const generateJson = () => { const spinnerTypedoc = ora('Generating TypeDoc json...').start() diff --git a/src/Instantiable.abstract.ts b/src/Instantiable.abstract.ts index 3171831..91e90c2 100644 --- a/src/Instantiable.abstract.ts +++ b/src/Instantiable.abstract.ts @@ -11,9 +11,7 @@ export interface InstantiableConfig { logger?: Logger } -export function generateIntantiableConfigFromConfig( - config: Config -): Partial { +export function generateIntantiableConfigFromConfig(config: Config): Partial { const logLevel = typeof config.verbose !== 'number' ? config.verbose @@ -68,9 +66,7 @@ export abstract class Instantiable { public static async getInstance(...args: any[]): Promise public static async getInstance(config: InstantiableConfig): Promise { - LoggerInstance.warn( - 'getInstance() methods has needs to be added to child class.' - ) + LoggerInstance.warn('getInstance() methods has needs to be added to child class.') } protected static setInstanceConfig( diff --git a/src/aquarius/Aquarius.ts b/src/aquarius/Aquarius.ts index 81b315d..d385db5 100644 --- a/src/aquarius/Aquarius.ts +++ b/src/aquarius/Aquarius.ts @@ -40,33 +40,20 @@ export class Aquarius extends Instantiable { public async getAccessUrl(accessToken: any, payload: any): Promise { const accessUrl: string = await this.ocean.utils.fetch - .post( - `${accessToken.service_endpoint}/${accessToken.resource_id}`, - payload - ) + .post(`${accessToken.service_endpoint}/${accessToken.resource_id}`, payload) .then((response: any): string => { if (response.ok) { return response.text() } - this.logger.error( - 'Failed: ', - response.status, - response.statusText - ) + this.logger.error('Failed: ', response.status, response.statusText) return null }) .then((consumptionUrl: string): string => { - this.logger.error( - 'Success accessing consume endpoint: ', - consumptionUrl - ) + this.logger.error('Success accessing consume endpoint: ', consumptionUrl) return consumptionUrl }) .catch(error => { - this.logger.error( - 'Error fetching the data asset consumption url: ', - error - ) + this.logger.error('Error fetching the data asset consumption url: ', error) return null }) @@ -85,11 +72,7 @@ export class Aquarius extends Instantiable { if (response.ok) { return response.json() as DDO[] } - this.logger.error( - 'queryMetadata failed:', - response.status, - response.statusText - ) + this.logger.error('queryMetadata failed:', response.status, response.statusText) return this.transformResult() }) .then(results => { @@ -111,10 +94,7 @@ export class Aquarius extends Instantiable { public async queryMetadataByText(query: SearchQuery): Promise { const fullUrl = new URL(`${this.url}${apiPath}/query`) fullUrl.searchParams.append('text', query.text) - fullUrl.searchParams.append( - 'sort', - decodeURIComponent(JSON.stringify(query.sort)) - ) + fullUrl.searchParams.append('sort', decodeURIComponent(JSON.stringify(query.sort))) fullUrl.searchParams.append('offset', query.offset.toString()) fullUrl.searchParams.append('page', query.page.toString()) const result: QueryResult = await this.ocean.utils.fetch @@ -123,21 +103,14 @@ export class Aquarius extends Instantiable { if (response.ok) { return response.json() as DDO[] } - this.logger.log( - 'queryMetadataByText failed:', - response.status, - response.statusText - ) + this.logger.log('queryMetadataByText failed:', response.status, response.statusText) return this.transformResult() }) .then(results => { return this.transformResult(results) }) .catch(error => { - this.logger.error( - 'Error fetching querying metadata by text: ', - error - ) + this.logger.error('Error fetching querying metadata by text: ', error) return this.transformResult() }) @@ -157,12 +130,7 @@ export class Aquarius extends Instantiable { if (response.ok) { return response.json() } - this.logger.error( - 'storeDDO failed:', - response.status, - response.statusText, - ddo - ) + this.logger.error('storeDDO failed:', response.status, response.statusText, ddo) return null as DDO }) .then((response: DDO) => { @@ -181,25 +149,16 @@ export class Aquarius extends Instantiable { * @param {DID | string} did DID of the asset. * @return {Promise} DDO of the asset. */ - public async retrieveDDO( - did: DID | string, - metadataServiceEndpoint?: string - ): Promise { + public async retrieveDDO(did: DID | string, metadataServiceEndpoint?: string): Promise { did = did && DID.parse(did) - const fullUrl = - metadataServiceEndpoint || `${this.url}${apiPath}/${did.getDid()}` + const fullUrl = metadataServiceEndpoint || `${this.url}${apiPath}/${did.getDid()}` const result = await this.ocean.utils.fetch .get(fullUrl) .then((response: any) => { if (response.ok) { return response.json() } - this.logger.log( - 'retrieveDDO failed:', - response.status, - response.statusText, - did - ) + this.logger.log('retrieveDDO failed:', response.status, response.statusText, did) return null as DDO }) .then((response: DDO) => { @@ -222,12 +181,7 @@ export class Aquarius extends Instantiable { } private transformResult( - { - results, - page, - total_pages: totalPages, - total_results: totalResults - }: any = { + { results, page, total_pages: totalPages, total_results: totalResults }: any = { result: [], page: 0, total_pages: 0, // eslint-disable-line @typescript-eslint/camelcase diff --git a/src/brizo/Brizo.ts b/src/brizo/Brizo.ts index 6251e35..b20a041 100644 --- a/src/brizo/Brizo.ts +++ b/src/brizo/Brizo.ts @@ -35,12 +35,7 @@ export class Brizo extends Instantiable { return `${this.url}${apiPath}/publish` } - public getComputeEndpoint( - pubKey: string, - serviceIndex: number, - _notUsed: string, - container: string - ) { + public getComputeEndpoint(pubKey: string, serviceIndex: number, _notUsed: string, container: string) { return `${this.url}${apiPath}/compute` } @@ -60,10 +55,7 @@ export class Brizo extends Instantiable { } try { - return await this.ocean.utils.fetch.post( - this.getPurchaseEndpoint(), - decodeURI(JSON.stringify(args)) - ) + return await this.ocean.utils.fetch.post(this.getPurchaseEndpoint(), decodeURI(JSON.stringify(args))) } catch (e) { this.logger.error(e) throw new Error('HTTP request failed') @@ -80,10 +72,7 @@ export class Brizo extends Instantiable { ): Promise { const signature = (await account.getToken()) || - (await this.ocean.utils.signature.signText( - noZeroX(agreementId), - account.getId() - )) + (await this.ocean.utils.signature.signText(noZeroX(agreementId), account.getId())) const filesPromises = files .filter((_, i) => index === -1 || i === index) .map(async ({ index: i }) => { @@ -94,11 +83,7 @@ export class Brizo extends Instantiable { consumeUrl += `&signature=${signature}` try { - await this.ocean.utils.fetch.downloadFile( - consumeUrl, - destination, - i - ) + await this.ocean.utils.fetch.downloadFile(consumeUrl, destination, i) } catch (e) { this.logger.error('Error consuming assets') this.logger.error(e) @@ -109,12 +94,7 @@ export class Brizo extends Instantiable { return destination } - public async encrypt( - did: string, - signature: string, - document: any, - publisher: string - ): Promise { + public async encrypt(did: string, signature: string, document: any, publisher: string): Promise { const args = { documentId: did, signature, diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index d7788a8..a92e04b 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -52,9 +52,7 @@ export class DDO { public constructor(ddo: Partial = {}) { Object.assign(this, ddo, { - created: - (ddo && ddo.created) || - new Date().toISOString().replace(/\.[0-9]{3}/, '') + created: (ddo && ddo.created) || new Date().toISOString().replace(/\.[0-9]{3}/, '') }) } @@ -82,9 +80,7 @@ export class DDO { * @param {string} serviceType Service type. * @return {Service} Service. */ - public findServiceByType( - serviceType: T - ): Service { + public findServiceByType(serviceType: T): Service { if (!serviceType) { throw new Error('serviceType not set') } @@ -120,18 +116,10 @@ export class DDO { * @param {string} password Password if it's required. * @return {Promise} Proof object. */ - public async generateProof( - ocean: Ocean, - publicKey: string, - password?: string - ): Promise { + public async generateProof(ocean: Ocean, publicKey: string, password?: string): Promise { const checksum = this.getChecksum() - const signature = await ocean.utils.signature.signText( - checksum, - publicKey, - password - ) + const signature = await ocean.utils.signature.signText(checksum, publicKey, password) return { created: new Date().toISOString().replace(/\.[0-9]{3}/, ''), @@ -160,11 +148,7 @@ export class DDO { * @param {string} password Password if it's requirted. * @return {Promise} Proof object. */ - public async addProof( - web3: Web3, - publicKey: string, - password?: string - ): Promise { + public async addProof(web3: Web3, publicKey: string, password?: string): Promise { if (this.proof) { throw new Error('Proof already exists') } diff --git a/src/ddo/PublicKey.ts b/src/ddo/PublicKey.ts index 0f05fa2..73c851b 100644 --- a/src/ddo/PublicKey.ts +++ b/src/ddo/PublicKey.ts @@ -13,11 +13,7 @@ export interface PublicKey { * Type of key. * @type {string} */ - type: - | 'Ed25519VerificationKey2018' - | 'RsaVerificationKey2018' - | 'EdDsaSAPublicKeySecp256k1' - | 'EthereumECDSAKey' + type: 'Ed25519VerificationKey2018' | 'RsaVerificationKey2018' | 'EdDsaSAPublicKeySecp256k1' | 'EthereumECDSAKey' /** * Key owner. diff --git a/src/ddo/Service.ts b/src/ddo/Service.ts index 8d28a5b..fcdb410 100644 --- a/src/ddo/Service.ts +++ b/src/ddo/Service.ts @@ -2,13 +2,7 @@ import { MetaData } from './MetaData' import { ServiceAgreementTemplate } from './ServiceAgreementTemplate' import { Provider } from './ComputingProvider' -export type ServiceType = - | 'authorization' - | 'metadata' - | 'access' - | 'compute' - | 'computing' - | 'fitchainCompute' +export type ServiceType = 'authorization' | 'metadata' | 'access' | 'compute' | 'computing' | 'fitchainCompute' export interface ServiceCommon { type: ServiceType @@ -47,9 +41,7 @@ export interface ServiceCompute extends ServiceCommon { templateId?: string } -export type Service< - T extends ServiceType | 'default' = 'default' -> = T extends 'authorization' +export type Service = T extends 'authorization' ? ServiceAuthorization : T extends 'metadata' ? ServiceMetadata diff --git a/src/keeper/ContractEvent.ts b/src/keeper/ContractEvent.ts index 9deb54b..048f1c0 100644 --- a/src/keeper/ContractEvent.ts +++ b/src/keeper/ContractEvent.ts @@ -17,9 +17,7 @@ export class ContractEvent { private filter: { [key: string]: any } ) {} - public subscribe( - callback: (events: any[]) => void - ): ContractEventSubscription { + public subscribe(callback: (events: any[]) => void): ContractEventSubscription { const onEvent = async (blockNumber: number) => { const events = await this.contract.getEventData(this.eventName, { filter: this.filter, diff --git a/src/keeper/ContractHandler.ts b/src/keeper/ContractHandler.ts index de1d5ea..ac9f071 100644 --- a/src/keeper/ContractHandler.ts +++ b/src/keeper/ContractHandler.ts @@ -6,25 +6,15 @@ export default class ContractHandler extends Instantiable { return ContractHandler.contracts.get(this.getHash(what, networkId)) } - protected static setContract( - what: string, - networkId: number, - contractInstance: Contract - ) { - ContractHandler.contracts.set( - this.getHash(what, networkId), - contractInstance - ) + protected static setContract(what: string, networkId: number, contractInstance: Contract) { + ContractHandler.contracts.set(this.getHash(what, networkId), contractInstance) } protected static hasContract(what: string, networkId: number): boolean { return ContractHandler.contracts.has(this.getHash(what, networkId)) } - private static contracts: Map = new Map< - string, - Contract - >() + private static contracts: Map = new Map() private static getHash(what: string, networkId: number): string { return `${what}/#${networkId}` @@ -35,17 +25,11 @@ export default class ContractHandler extends Instantiable { this.setInstanceConfig(config) } - public async get( - what: string, - optional: boolean = false - ): Promise { + public async get(what: string, optional: boolean = false): Promise { const where = (await this.ocean.keeper.getNetworkName()).toLowerCase() const networkId = await this.ocean.keeper.getNetworkId() try { - return ( - ContractHandler.getContract(what, networkId) || - (await this.load(what, where, networkId)) - ) + return ContractHandler.getContract(what, networkId) || (await this.load(what, where, networkId)) } catch (err) { if (!optional) { this.logger.error('Failed to load', what, 'from', where, err) @@ -54,34 +38,18 @@ export default class ContractHandler extends Instantiable { } } - private async load( - what: string, - where: string, - networkId: number - ): Promise { + private async load(what: string, where: string, networkId: number): Promise { this.logger.debug('Loading', what, 'from', where) const artifact = require(`@oceanprotocol/keeper-contracts/artifacts/${what}.${where}.json`) // Logger.log('Loaded artifact', artifact) const code = await this.web3.eth.getCode(artifact.address) if (code === '0x0') { // no code in the blockchain dude - throw new Error( - `No code deployed at address ${artifact.address}, sorry.` - ) + throw new Error(`No code deployed at address ${artifact.address}, sorry.`) } - const contract = new this.web3.eth.Contract( - artifact.abi, - artifact.address - ) + const contract = new this.web3.eth.Contract(artifact.abi, artifact.address) - this.logger.debug( - 'Getting instance of', - what, - 'from', - where, - 'at address', - artifact.address - ) + this.logger.debug('Getting instance of', what, 'from', where, 'at address', artifact.address) ContractHandler.setContract(what, networkId, contract) return ContractHandler.getContract(what, networkId) } diff --git a/src/keeper/EventHandler.ts b/src/keeper/EventHandler.ts index add7efd..4272ee9 100644 --- a/src/keeper/EventHandler.ts +++ b/src/keeper/EventHandler.ts @@ -41,11 +41,7 @@ export class EventHandler extends Instantiable { } } - public getEvent( - contract: ContractBase, - eventName: string, - filter: { [key: string]: any } - ) { + public getEvent(contract: ContractBase, eventName: string, filter: { [key: string]: any }) { return new ContractEvent(this, contract, eventName, filter) } @@ -65,9 +61,6 @@ export class EventHandler extends Instantiable { this.events.forEach(fn => fn(this.lastBlock + 1)) this.lastBlock = blockNumber } - this.lastTimeout = global.setTimeout( - () => this.checkBlock(true, n++), - this.interval - ) + this.lastTimeout = global.setTimeout(() => this.checkBlock(true, n++), this.interval) } } diff --git a/src/keeper/Keeper.ts b/src/keeper/Keeper.ts index 14860da..111419f 100644 --- a/src/keeper/Keeper.ts +++ b/src/keeper/Keeper.ts @@ -15,11 +15,7 @@ import { EscrowAccessSecretStoreTemplate, EscrowComputeExecutionTemplate } from './contracts/templates' -import { - TemplateStoreManager, - AgreementStoreManager, - ConditionStoreManager -} from './contracts/managers' +import { TemplateStoreManager, AgreementStoreManager, ConditionStoreManager } from './contracts/managers' import { objectPromiseAll } from '../utils' import { EventHandler } from './EventHandler' @@ -38,9 +34,7 @@ export class Keeper extends Instantiable { * Returns Keeper instance. * @return {Promise} */ - public static async getInstance( - config: InstantiableConfig - ): Promise { + public static async getInstance(config: InstantiableConfig): Promise { const keeper = new Keeper() keeper.setInstanceConfig(config) @@ -56,28 +50,16 @@ export class Keeper extends Instantiable { didRegistry: DIDRegistry.getInstance(config), // Managers templateStoreManager: TemplateStoreManager.getInstance(config), - agreementStoreManager: AgreementStoreManager.getInstance( - config - ), - conditionStoreManager: ConditionStoreManager.getInstance( - config - ), + agreementStoreManager: AgreementStoreManager.getInstance(config), + conditionStoreManager: ConditionStoreManager.getInstance(config), // Conditions lockRewardCondition: LockRewardCondition.getInstance(config), escrowReward: EscrowReward.getInstance(config), - accessSecretStoreCondition: AccessSecretStoreCondition.getInstance( - config - ), - computeExecutionCondition: ComputeExecutionCondition.getInstance( - config - ), + accessSecretStoreCondition: AccessSecretStoreCondition.getInstance(config), + computeExecutionCondition: ComputeExecutionCondition.getInstance(config), // Templates - escrowAccessSecretStoreTemplate: EscrowAccessSecretStoreTemplate.getInstance( - config - ), - escrowComputeExecutionTemplate: EscrowComputeExecutionTemplate.getInstance( - config - ) + escrowAccessSecretStoreTemplate: EscrowAccessSecretStoreTemplate.getInstance(config), + escrowComputeExecutionTemplate: EscrowComputeExecutionTemplate.getInstance(config) }) keeper.connected = true @@ -105,17 +87,13 @@ export class Keeper extends Instantiable { keeper.conditions = { lockRewardCondition: keeper.instances.lockRewardCondition, escrowReward: keeper.instances.escrowReward, - accessSecretStoreCondition: - keeper.instances.accessSecretStoreCondition, - computeExecutionCondition: - keeper.instances.computeExecutionCondition + accessSecretStoreCondition: keeper.instances.accessSecretStoreCondition, + computeExecutionCondition: keeper.instances.computeExecutionCondition } // Conditions keeper.templates = { - escrowAccessSecretStoreTemplate: - keeper.instances.escrowAccessSecretStoreTemplate, - escrowComputeExecutionTemplate: - keeper.instances.escrowComputeExecutionTemplate + escrowAccessSecretStoreTemplate: keeper.instances.escrowAccessSecretStoreTemplate, + escrowComputeExecutionTemplate: keeper.instances.escrowComputeExecutionTemplate } // Utils keeper.utils = { @@ -200,9 +178,7 @@ export class Keeper extends Instantiable { * @return {Condition} Condition instance. */ public getConditionByAddress(address: string): Condition { - return Object.values(this.conditions).find( - condition => condition.getAddress() === address - ) + return Object.values(this.conditions).find(condition => condition.getAddress() === address) } /** @@ -211,9 +187,7 @@ export class Keeper extends Instantiable { * @return {AgreementTemplate} Agreement template instance. */ public getTemplateByName(name: string): AgreementTemplate { - return Object.values(this.templates).find( - template => template.contractName === name - ) + return Object.values(this.templates).find(template => template.contractName === name) } /** @@ -222,9 +196,7 @@ export class Keeper extends Instantiable { * @return {AgreementTemplate} Agreement template instance. */ public getTemplateByAddress(address: string): AgreementTemplate { - return Object.values(this.templates).find( - template => template.getAddress() === address - ) + return Object.values(this.templates).find(template => template.getAddress() === address) } /** diff --git a/src/keeper/Web3Provider.ts b/src/keeper/Web3Provider.ts index a5b7daa..54cb392 100644 --- a/src/keeper/Web3Provider.ts +++ b/src/keeper/Web3Provider.ts @@ -7,10 +7,6 @@ export default class Web3Provider { * @return {Web3} */ public static getWeb3(config: Partial = {}): Web3 { - return new Web3( - config.web3Provider || - Web3.givenProvider || - new Web3.providers.HttpProvider(config.nodeUri) - ) + return new Web3(config.web3Provider || Web3.givenProvider || new Web3.providers.HttpProvider(config.nodeUri)) } } diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index 572790d..589ab6e 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -22,9 +22,7 @@ export abstract class ContractBase extends Instantiable { public async getEventData(eventName: string, options: any) { if (!this.contract.events[eventName]) { - throw new Error( - `Event "${eventName}" not found on contract "${this.contractName}"` - ) + throw new Error(`Event "${eventName}" not found on contract "${this.contractName}"`) } return this.contract.getPastEvents(eventName, options) } @@ -54,10 +52,7 @@ export abstract class ContractBase extends Instantiable { protected async init(config: InstantiableConfig) { this.setInstanceConfig(config) const contractHandler = new ContractHandler(config) - this.contract = await contractHandler.get( - this.contractName, - this.optional - ) + this.contract = await contractHandler.get(this.contractName, this.optional) } protected async getFromAddress(from?: string): Promise { @@ -67,24 +62,14 @@ export abstract class ContractBase extends Instantiable { return from } - protected async sendFrom( - name: string, - args: any[], - from?: string - ): Promise { + protected async sendFrom(name: string, args: any[], from?: string): Promise { from = await this.getFromAddress(from) return this.send(name, from, args) } - protected async send( - name: string, - from: string, - args: any[] - ): Promise { + protected async send(name: string, from: string, args: any[]): Promise { if (!this.contract.methods[name]) { - throw new Error( - `Method "${name}" is not part of contract "${this.contractName}"` - ) + throw new Error(`Method "${name}" is not part of contract "${this.contractName}"`) } // Logger.log(name, args) const method = this.contract.methods[name] @@ -99,62 +84,41 @@ export abstract class ContractBase extends Instantiable { }) return tx } catch (err) { - const mappedArgs = this.searchMethod(name, args).inputs.map( - (input, i) => { - return { - name: input.name, - value: args[i] - } + const mappedArgs = this.searchMethod(name, args).inputs.map((input, i) => { + return { + name: input.name, + value: args[i] } - ) + }) this.logger.error('-'.repeat(40)) - this.logger.error( - `Sending transaction "${name}" on contract "${this.contractName}" failed.` - ) + this.logger.error(`Sending transaction "${name}" on contract "${this.contractName}" failed.`) this.logger.error(`Error: ${err.message}`) this.logger.error(`From: ${from}`) - this.logger.error( - `Parameters: ${JSON.stringify(mappedArgs, null, 2)}` - ) + this.logger.error(`Parameters: ${JSON.stringify(mappedArgs, null, 2)}`) this.logger.error('-'.repeat(40)) throw err } } - protected async call( - name: string, - args: any[], - from?: string - ): Promise { + protected async call(name: string, args: any[], from?: string): Promise { if (!this.contract.methods[name]) { - throw new Error( - `Method ${name} is not part of contract ${this.contractName}` - ) + throw new Error(`Method ${name} is not part of contract ${this.contractName}`) } // Logger.log(name) try { const method = this.contract.methods[name](...args) return method.call(from ? { from } : null) } catch (err) { - this.logger.error( - `Calling method "${name}" on contract "${this.contractName}" failed. Args: ${args}`, - err - ) + this.logger.error(`Calling method "${name}" on contract "${this.contractName}" failed. Args: ${args}`, err) throw err } } protected getEvent(eventName: string, filter: { [key: string]: any }) { if (!this.contract.events[eventName]) { - throw new Error( - `Event ${eventName} is not part of contract ${this.contractName}` - ) + throw new Error(`Event ${eventName} is not part of contract ${this.contractName}`) } - return this.ocean.keeper.utils.eventHandler.getEvent( - this, - eventName, - filter - ) + return this.ocean.keeper.utils.eventHandler.getEvent(this, eventName, filter) } private searchMethod(methodName: string, args: any[] = []) { @@ -164,13 +128,9 @@ export abstract class ContractBase extends Instantiable { signature: (method as any).signature })) .filter((method: any) => method.name === methodName) - const foundMethod = - methods.find(({ inputs }) => inputs.length === args.length) || - methods[0] + const foundMethod = methods.find(({ inputs }) => inputs.length === args.length) || methods[0] if (!foundMethod) { - throw new Error( - `Method "${methodName}" is not part of contract "${this.contractName}"` - ) + throw new Error(`Method "${methodName}" is not part of contract "${this.contractName}"`) } return foundMethod } diff --git a/src/keeper/contracts/DIDRegistry.ts b/src/keeper/contracts/DIDRegistry.ts index 96c55df..90e6883 100644 --- a/src/keeper/contracts/DIDRegistry.ts +++ b/src/keeper/contracts/DIDRegistry.ts @@ -3,9 +3,7 @@ import { zeroX, didPrefixed, didZeroX } from '../../utils' import { InstantiableConfig } from '../../Instantiable.abstract' export default class DIDRegistry extends ContractBase { - public static async getInstance( - config: InstantiableConfig - ): Promise { + public static async getInstance(config: InstantiableConfig): Promise { const didRegistry: DIDRegistry = new DIDRegistry('DIDRegistry') await didRegistry.init(config) return didRegistry @@ -18,12 +16,7 @@ export default class DIDRegistry extends ContractBase { value: string, ownerAddress: string ) { - return this.send('registerAttribute', ownerAddress, [ - zeroX(did), - zeroX(checksum), - providers.map(zeroX), - value - ]) + return this.send('registerAttribute', ownerAddress, [zeroX(did), zeroX(checksum), providers.map(zeroX), value]) } public async getDIDOwner(did: string): Promise { @@ -46,46 +39,22 @@ export default class DIDRegistry extends ContractBase { .map(didPrefixed) } - public async getAttributesByDid( - did: string - ): Promise<{ did: string; serviceEndpoint: string; checksum: string }> { + public async getAttributesByDid(did: string): Promise<{ did: string; serviceEndpoint: string; checksum: string }> { return (await this.getPastEvents('DIDAttributeRegistered', { _did: didZeroX(did) - })).map( - ({ - returnValues: { - _did, - _checksum: checksum, - _value: serviceEndpoint - } - }) => ({ - did: didPrefixed(_did), - serviceEndpoint, - checksum - }) - )[0] + })).map(({ returnValues: { _did, _checksum: checksum, _value: serviceEndpoint } }) => ({ + did: didPrefixed(_did), + serviceEndpoint, + checksum + }))[0] } - public async grantPermission( - did: string, - grantee: string, - ownerAddress: string - ) { - return this.send('grantPermission', ownerAddress, [ - zeroX(did), - zeroX(grantee) - ]) + public async grantPermission(did: string, grantee: string, ownerAddress: string) { + return this.send('grantPermission', ownerAddress, [zeroX(did), zeroX(grantee)]) } - public async revokePermission( - did: string, - grantee: string, - ownerAddress: string - ) { - return this.send('revokePermission', ownerAddress, [ - zeroX(did), - zeroX(grantee) - ]) + public async revokePermission(did: string, grantee: string, ownerAddress: string) { + return this.send('revokePermission', ownerAddress, [zeroX(did), zeroX(grantee)]) } public async getPermission(did: string, grantee: string): Promise { diff --git a/src/keeper/contracts/Dispenser.ts b/src/keeper/contracts/Dispenser.ts index e14363f..8897dcb 100644 --- a/src/keeper/contracts/Dispenser.ts +++ b/src/keeper/contracts/Dispenser.ts @@ -2,18 +2,13 @@ import ContractBase from './ContractBase' import { InstantiableConfig } from '../../Instantiable.abstract' export default class Dispenser extends ContractBase { - public static async getInstance( - config: InstantiableConfig - ): Promise { + public static async getInstance(config: InstantiableConfig): Promise { const dispenser: Dispenser = new Dispenser('Dispenser', true) await dispenser.init(config) return dispenser } - public async requestTokens( - amount: number | string, - receiverAddress: string - ) { + public async requestTokens(amount: number | string, receiverAddress: string) { return this.send('requestTokens', receiverAddress, [String(amount)]) } } diff --git a/src/keeper/contracts/GenericContract.ts b/src/keeper/contracts/GenericContract.ts index 4413616..4979597 100644 --- a/src/keeper/contracts/GenericContract.ts +++ b/src/keeper/contracts/GenericContract.ts @@ -2,10 +2,7 @@ import ContractBase from './ContractBase' import { InstantiableConfig } from '../../Instantiable.abstract' export default class GenericContract extends ContractBase { - public static async getInstance( - config: InstantiableConfig, - contractName: string - ): Promise { + public static async getInstance(config: InstantiableConfig, contractName: string): Promise { const contract: GenericContract = new GenericContract(contractName) await contract.init(config) return contract diff --git a/src/keeper/contracts/Token.ts b/src/keeper/contracts/Token.ts index b008c37..5644fd3 100644 --- a/src/keeper/contracts/Token.ts +++ b/src/keeper/contracts/Token.ts @@ -3,9 +3,7 @@ import ContractBase from './ContractBase' import { InstantiableConfig } from '../../Instantiable.abstract' export default class OceanToken extends ContractBase { - public static async getInstance( - config: InstantiableConfig - ): Promise { + public static async getInstance(config: InstantiableConfig): Promise { const token: OceanToken = new OceanToken('OceanToken') await token.init(config) return token @@ -20,9 +18,7 @@ export default class OceanToken extends ContractBase { } public async balanceOf(address: string): Promise { - return this.call('balanceOf', [address]).then((balance: string) => - new BigNumber(balance).toNumber() - ) + return this.call('balanceOf', [address]).then((balance: string) => new BigNumber(balance).toNumber()) } public async transfer(to: string, amount: number, from: string) { diff --git a/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts b/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts index 337d25d..a9f733e 100644 --- a/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts +++ b/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts @@ -3,44 +3,23 @@ import { zeroX, didZeroX, didPrefixed } from '../../../utils' import { InstantiableConfig } from '../../../Instantiable.abstract' export class AccessSecretStoreCondition extends Condition { - public static async getInstance( - config: InstantiableConfig - ): Promise { - return Condition.getInstance( - config, - 'AccessSecretStoreCondition', - AccessSecretStoreCondition - ) + public static async getInstance(config: InstantiableConfig): Promise { + return Condition.getInstance(config, 'AccessSecretStoreCondition', AccessSecretStoreCondition) } public hashValues(did: string, grantee: string) { return super.hashValues(didZeroX(did), zeroX(grantee)) } - public fulfill( - agreementId: string, - did: string, - grantee: string, - from?: string - ) { - return super.fulfill( - agreementId, - [didZeroX(did), grantee].map(zeroX), - from - ) + public fulfill(agreementId: string, did: string, grantee: string, from?: string) { + return super.fulfill(agreementId, [didZeroX(did), grantee].map(zeroX), from) } public checkPermissions(grantee: string, did: string, from?: string) { - return this.call( - 'checkPermissions', - [grantee, didZeroX(did)].map(zeroX), - from - ) + return this.call('checkPermissions', [grantee, didZeroX(did)].map(zeroX), from) } - public async getGrantedDidByConsumer( - consumer: string - ): Promise<{ did: string; agreementId: string }[]> { + public async getGrantedDidByConsumer(consumer: string): Promise<{ did: string; agreementId: string }[]> { return (await this.getPastEvents('Fulfilled', { _grantee: zeroX(consumer) })).map(({ returnValues }) => ({ diff --git a/src/keeper/contracts/conditions/ComputeExecutionCondition.ts b/src/keeper/contracts/conditions/ComputeExecutionCondition.ts index 24bf07c..10f2173 100644 --- a/src/keeper/contracts/conditions/ComputeExecutionCondition.ts +++ b/src/keeper/contracts/conditions/ComputeExecutionCondition.ts @@ -3,42 +3,19 @@ import { zeroX, didZeroX, didPrefixed } from '../../../utils' import { InstantiableConfig } from '../../../Instantiable.abstract' export class ComputeExecutionCondition extends Condition { - public static async getInstance( - config: InstantiableConfig - ): Promise { - return Condition.getInstance( - config, - 'ComputeExecutionCondition', - ComputeExecutionCondition - ) + public static async getInstance(config: InstantiableConfig): Promise { + return Condition.getInstance(config, 'ComputeExecutionCondition', ComputeExecutionCondition) } public hashValues(did: string, computeConsumer: string) { return super.hashValues(didZeroX(did), zeroX(computeConsumer)) } - public fulfill( - agreementId: string, - did: string, - computeConsumer: string, - from?: string - ) { - return super.fulfill( - agreementId, - [didZeroX(did), computeConsumer].map(zeroX), - from - ) + public fulfill(agreementId: string, did: string, computeConsumer: string, from?: string) { + return super.fulfill(agreementId, [didZeroX(did), computeConsumer].map(zeroX), from) } - public wasComputeTriggered( - did: string, - computeConsumer: string, - from?: string - ) { - return this.call( - 'wasComputeTriggered', - [didZeroX(did), computeConsumer].map(zeroX), - from - ) + public wasComputeTriggered(did: string, computeConsumer: string, from?: string) { + return this.call('wasComputeTriggered', [didZeroX(did), computeConsumer].map(zeroX), from) } } diff --git a/src/keeper/contracts/conditions/Condition.abstract.ts b/src/keeper/contracts/conditions/Condition.abstract.ts index 8fd2df4..ffc2151 100644 --- a/src/keeper/contracts/conditions/Condition.abstract.ts +++ b/src/keeper/contracts/conditions/Condition.abstract.ts @@ -9,12 +9,7 @@ export enum ConditionState { Aborted = 3 } -export const conditionStateNames = [ - 'Uninitialized', - 'Unfulfilled', - 'Fulfilled', - 'Aborted' -] +export const conditionStateNames = ['Uninitialized', 'Unfulfilled', 'Fulfilled', 'Aborted'] export abstract class Condition extends ContractBase { public static async getInstance( diff --git a/src/keeper/contracts/conditions/EscrowReward.ts b/src/keeper/contracts/conditions/EscrowReward.ts index 67a0922..afe0e8e 100644 --- a/src/keeper/contracts/conditions/EscrowReward.ts +++ b/src/keeper/contracts/conditions/EscrowReward.ts @@ -3,9 +3,7 @@ import { zeroX } from '../../../utils' import { InstantiableConfig } from '../../../Instantiable.abstract' export class EscrowReward extends Condition { - public static async getInstance( - config: InstantiableConfig - ): Promise { + public static async getInstance(config: InstantiableConfig): Promise { return Condition.getInstance(config, 'EscrowReward', EscrowReward) } @@ -16,10 +14,7 @@ export class EscrowReward extends Condition { lockCondition: string, releaseCondition: string ) { - return super.hashValues( - amount, - ...[receiver, sender, lockCondition, releaseCondition].map(zeroX) - ) + return super.hashValues(amount, ...[receiver, sender, lockCondition, releaseCondition].map(zeroX)) } public fulfill( @@ -33,12 +28,7 @@ export class EscrowReward extends Condition { ) { return super.fulfill( agreementId, - [ - amount, - ...[receiver, sender, lockCondition, releaseCondition].map( - zeroX - ) - ], + [amount, ...[receiver, sender, lockCondition, releaseCondition].map(zeroX)], from ) } diff --git a/src/keeper/contracts/conditions/LockRewardCondition.ts b/src/keeper/contracts/conditions/LockRewardCondition.ts index 338bcc2..dd2e5a9 100644 --- a/src/keeper/contracts/conditions/LockRewardCondition.ts +++ b/src/keeper/contracts/conditions/LockRewardCondition.ts @@ -3,30 +3,15 @@ import { zeroX } from '../../../utils' import { InstantiableConfig } from '../../../Instantiable.abstract' export class LockRewardCondition extends Condition { - public static async getInstance( - config: InstantiableConfig - ): Promise { - return Condition.getInstance( - config, - 'LockRewardCondition', - LockRewardCondition - ) + public static async getInstance(config: InstantiableConfig): Promise { + return Condition.getInstance(config, 'LockRewardCondition', LockRewardCondition) } public hashValues(rewardAddress: string, amount: number | string) { return super.hashValues(zeroX(rewardAddress), String(amount)) } - public fulfill( - agreementId: string, - rewardAddress: string, - amount: number | string, - from?: string - ) { - return super.fulfill( - agreementId, - [zeroX(rewardAddress), String(amount)], - from - ) + public fulfill(agreementId: string, rewardAddress: string, amount: number | string, from?: string) { + return super.fulfill(agreementId, [zeroX(rewardAddress), String(amount)], from) } } diff --git a/src/keeper/contracts/managers/AgreementStoreManager.ts b/src/keeper/contracts/managers/AgreementStoreManager.ts index 72bedf8..98c015a 100644 --- a/src/keeper/contracts/managers/AgreementStoreManager.ts +++ b/src/keeper/contracts/managers/AgreementStoreManager.ts @@ -12,12 +12,8 @@ export interface AgreementData { } export class AgreementStoreManager extends ContractBase { - public static async getInstance( - config: InstantiableConfig - ): Promise { - const templateStoreManeger: AgreementStoreManager = new AgreementStoreManager( - 'AgreementStoreManager' - ) + public static async getInstance(config: InstantiableConfig): Promise { + const templateStoreManeger: AgreementStoreManager = new AgreementStoreManager('AgreementStoreManager') await templateStoreManeger.init(config) return templateStoreManeger } @@ -27,14 +23,10 @@ export class AgreementStoreManager extends ContractBase { } public async getAgreement(agreementId: string) { - const { - did, - didOwner, - templateId, - conditionIds, - lastUpdatedBy, - blockNumberUpdated - } = await this.call('getAgreement', [zeroX(agreementId)]) + const { did, didOwner, templateId, conditionIds, lastUpdatedBy, blockNumberUpdated } = await this.call( + 'getAgreement', + [zeroX(agreementId)] + ) return { did, didOwner, diff --git a/src/keeper/contracts/managers/ConditionStoreManager.ts b/src/keeper/contracts/managers/ConditionStoreManager.ts index e521cff..44ab8e8 100644 --- a/src/keeper/contracts/managers/ConditionStoreManager.ts +++ b/src/keeper/contracts/managers/ConditionStoreManager.ts @@ -14,12 +14,8 @@ export interface ConditionData { } export class ConditionStoreManager extends ContractBase { - public static async getInstance( - config: InstantiableConfig - ): Promise { - const templateStoreManeger: ConditionStoreManager = new ConditionStoreManager( - 'ConditionStoreManager' - ) + public static async getInstance(config: InstantiableConfig): Promise { + const templateStoreManeger: ConditionStoreManager = new ConditionStoreManager('ConditionStoreManager') await templateStoreManeger.init(config) return templateStoreManeger } @@ -29,15 +25,10 @@ export class ConditionStoreManager extends ContractBase { } public async getCondition(conditionId: string) { - const { - typeRef, - state, - timeLock, - timeOut, - blockNumber, - lastUpdatedBy, - blockNumberUpdated - } = await this.call('getCondition', [zeroX(conditionId)]) + const { typeRef, state, timeLock, timeOut, blockNumber, lastUpdatedBy, blockNumberUpdated } = await this.call( + 'getCondition', + [zeroX(conditionId)] + ) return { typeRef, state: +state, diff --git a/src/keeper/contracts/managers/TemplateStoreManager.ts b/src/keeper/contracts/managers/TemplateStoreManager.ts index 9df4be3..86fa5de 100644 --- a/src/keeper/contracts/managers/TemplateStoreManager.ts +++ b/src/keeper/contracts/managers/TemplateStoreManager.ts @@ -17,12 +17,8 @@ export interface TemplateMetadata { } export class TemplateStoreManager extends ContractBase { - public static async getInstance( - config: InstantiableConfig - ): Promise { - const templateStoreManeger: TemplateStoreManager = new TemplateStoreManager( - 'TemplateStoreManager' - ) + public static async getInstance(config: InstantiableConfig): Promise { + const templateStoreManeger: TemplateStoreManager = new TemplateStoreManager('TemplateStoreManager') await templateStoreManeger.init(config) return templateStoreManeger } @@ -31,11 +27,7 @@ export class TemplateStoreManager extends ContractBase { return this.call('owner', []) } - public async proposeTemplate( - address: string, - from?: string, - ignoreExists?: boolean - ) { + public async proposeTemplate(address: string, from?: string, ignoreExists?: boolean) { const template = await this.getTemplate(address) if (template.blockNumberUpdated !== 0) { this.logger.warn(`Template "${address}" already exist.`) @@ -47,16 +39,10 @@ export class TemplateStoreManager extends ContractBase { } } - public async approveTemplate( - address: string, - from?: string, - ignoreApproved?: boolean - ) { + public async approveTemplate(address: string, from?: string, ignoreApproved?: boolean) { const template = await this.getTemplate(address) if (template.state !== TemplateState.Proposed) { - this.logger.warn( - `Template "${address}" is not in "proposed" state.` - ) + this.logger.warn(`Template "${address}" is not in "proposed" state.`) if (!ignoreApproved) { throw new Error(`Template not in "proposed" state.`) } @@ -70,12 +56,7 @@ export class TemplateStoreManager extends ContractBase { } public async getTemplate(address: string) { - const { - state, - owner, - lastUpdatedBy, - blockNumberUpdated - } = await this.call('getTemplate', [zeroX(address)]) + const { state, owner, lastUpdatedBy, blockNumberUpdated } = await this.call('getTemplate', [zeroX(address)]) return { state: +state, owner, diff --git a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts index d502652..38cc3bd 100644 --- a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts +++ b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts @@ -1,9 +1,5 @@ import ContractBase from '../ContractBase' -import { - Condition, - ConditionState, - conditionStateNames -} from '../conditions/Condition.abstract' +import { Condition, ConditionState, conditionStateNames } from '../conditions/Condition.abstract' import { DDO } from '../../../ddo/DDO' import { ServiceAgreementTemplate } from '../../../ddo/ServiceAgreementTemplate' import { zeroX } from '../../../utils' @@ -25,9 +21,7 @@ export abstract class AgreementTemplate extends ContractBase { conditionName: string, templateClass: any ): Promise { - const condition: AgreementTemplate = new (templateClass as any)( - conditionName - ) + const condition: AgreementTemplate = new (templateClass as any)(conditionName) await condition.init(config) return condition } @@ -56,14 +50,7 @@ export abstract class AgreementTemplate extends ContractBase { ) { return this.sendFrom( 'createAgreement', - [ - zeroX(agreementId), - zeroX(did), - conditionIds.map(zeroX), - timeLocks, - timeOuts, - ...extraArgs - ], + [zeroX(agreementId), zeroX(did), conditionIds.map(zeroX), timeLocks, timeOuts, ...extraArgs], from ) } @@ -81,9 +68,7 @@ export abstract class AgreementTemplate extends ContractBase { * @return {Promise} Conditions contracts. */ public async getConditions(): Promise { - return (await this.getConditionTypes()).map(address => - this.ocean.keeper.getConditionByAddress(address) - ) + return (await this.getConditionTypes()).map(address => this.ocean.keeper.getConditionByAddress(address)) } /** @@ -114,9 +99,7 @@ export abstract class AgreementTemplate extends ContractBase { from?: string ): Promise - public abstract async getServiceAgreementTemplate(): Promise< - ServiceAgreementTemplate - > + public abstract async getServiceAgreementTemplate(): Promise public async getServiceAgreementTemplateConditions() { const serviceAgreementTemplate = await this.getServiceAgreementTemplate() @@ -127,9 +110,7 @@ export abstract class AgreementTemplate extends ContractBase { const name = (await this.getServiceAgreementTemplateConditions()).find( ({ name: conditionRef }) => conditionRef === ref ).contractName - return (await this.getConditions()).find( - condition => condition.contractName === name - ) + return (await this.getConditions()).find(condition => condition.contractName === name) } public async getServiceAgreementTemplateDependencies() { @@ -142,9 +123,7 @@ export abstract class AgreementTemplate extends ContractBase { * @param {string} agreementId Agreement ID. * @return {Promise} Conditions status. */ - public async getAgreementStatus( - agreementId: string - ): Promise { + public async getAgreementStatus(agreementId: string): Promise { const agreementStore = this.ocean.keeper.agreementStoreManager const conditionStore = this.ocean.keeper.conditionStoreManager @@ -165,15 +144,11 @@ export abstract class AgreementTemplate extends ContractBase { ) const statesPromises = Object.keys(dependencies).map(async (ref, i) => { - const { - contractName - } = await this.getServiceAgreementTemplateConditionByRef(ref) + const { contractName } = await this.getServiceAgreementTemplateConditionByRef(ref) return { ref, contractName, - state: (await conditionStore.getCondition( - conditionIdByConddition[contractName] - )).state + state: (await conditionStore.getCondition(conditionIdByConddition[contractName])).state } }) const states = await Promise.all(statesPromises) @@ -181,9 +156,7 @@ export abstract class AgreementTemplate extends ContractBase { return states.reduce((acc, { contractName, ref, state }) => { const blockers = dependencies[ref] .map(dependency => states.find(_ => _.ref === dependency)) - .filter( - condition => condition.state !== ConditionState.Fulfilled - ) + .filter(condition => condition.state !== ConditionState.Fulfilled) return { ...acc, [ref]: { @@ -211,22 +184,16 @@ export abstract class AgreementTemplate extends ContractBase { 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) - } + 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)) } diff --git a/src/keeper/contracts/templates/BaseEscrowTemplate.abstract.ts b/src/keeper/contracts/templates/BaseEscrowTemplate.abstract.ts index 2d178d7..1d3b31d 100644 --- a/src/keeper/contracts/templates/BaseEscrowTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseEscrowTemplate.abstract.ts @@ -26,15 +26,7 @@ export abstract class BaseEscrowTemplate extends AgreementTemplate { accessConsumer: string, from?: string ) { - return super.createAgreement( - agreementId, - did, - conditionIds, - timeLocks, - timeOuts, - [accessConsumer], - from - ) + return super.createAgreement(agreementId, did, conditionIds, timeLocks, timeOuts, [accessConsumer], from) } public async getAgreementData(agreementId: string) { diff --git a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.serviceAgreementTemplate.ts b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.serviceAgreementTemplate.ts index ac26262..b9c4f69 100644 --- a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.serviceAgreementTemplate.ts +++ b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.serviceAgreementTemplate.ts @@ -13,11 +13,7 @@ export const escrowAccessSecretStoreTemplateServiceAgreementTemplate: ServiceAgr } } ], - fulfillmentOrder: [ - 'lockReward.fulfill', - 'accessSecretStore.fulfill', - 'escrowReward.fulfill' - ], + fulfillmentOrder: ['lockReward.fulfill', 'accessSecretStore.fulfill', 'escrowReward.fulfill'], conditionDependency: { lockReward: [], accessSecretStore: [], diff --git a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts index 09e7a9d..4aa6c8c 100644 --- a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts +++ b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts @@ -7,26 +7,15 @@ import { InstantiableConfig } from '../../../Instantiable.abstract' import { escrowAccessSecretStoreTemplateServiceAgreementTemplate } from './EscrowAccessSecretStoreTemplate.serviceAgreementTemplate' export class EscrowAccessSecretStoreTemplate extends BaseEscrowTemplate { - public static async getInstance( - config: InstantiableConfig - ): Promise { - return AgreementTemplate.getInstance( - config, - 'EscrowAccessSecretStoreTemplate', - EscrowAccessSecretStoreTemplate - ) + public static async getInstance(config: InstantiableConfig): Promise { + return AgreementTemplate.getInstance(config, 'EscrowAccessSecretStoreTemplate', EscrowAccessSecretStoreTemplate) } public async getServiceAgreementTemplate() { return escrowAccessSecretStoreTemplateServiceAgreementTemplate } - public async createAgreementFromDDO( - agreementId: string, - ddo: DDO, - consumer: string, - from?: string - ) { + public async createAgreementFromDDO(agreementId: string, ddo: DDO, consumer: string, from?: string) { return !!(await this.createFullAgreement( ddo.shortId(), ddo.findServiceByType('metadata').attributes.main.price, @@ -36,12 +25,7 @@ export class EscrowAccessSecretStoreTemplate extends BaseEscrowTemplate { )) } - public async getAgreementIdsFromDDO( - agreementId: string, - ddo: DDO, - consumer: string, - from?: string - ) { + public async getAgreementIdsFromDDO(agreementId: string, ddo: DDO, consumer: string, from?: string) { const { accessSecretStoreConditionId, lockRewardConditionId, @@ -52,11 +36,7 @@ export class EscrowAccessSecretStoreTemplate extends BaseEscrowTemplate { ddo.findServiceByType('metadata').attributes.main.price, consumer ) - return [ - accessSecretStoreConditionId, - lockRewardConditionId, - escrowRewardId - ] + return [accessSecretStoreConditionId, lockRewardConditionId, escrowRewardId] } /** @@ -77,21 +57,12 @@ export class EscrowAccessSecretStoreTemplate extends BaseEscrowTemplate { accessSecretStoreConditionId, lockRewardConditionId, escrowRewardId - } = await this.createFullAgreementData( - agreementId, - did, - amount, - consumer - ) + } = await this.createFullAgreementData(agreementId, did, amount, consumer) await this.createAgreement( agreementId, did, - [ - accessSecretStoreConditionId, - lockRewardConditionId, - escrowRewardId - ], + [accessSecretStoreConditionId, lockRewardConditionId, escrowRewardId], [0, 0, 0], [0, 0, 0], consumer, @@ -101,19 +72,10 @@ export class EscrowAccessSecretStoreTemplate extends BaseEscrowTemplate { return zeroX(agreementId) } - private async createFullAgreementData( - agreementId: string, - did: string, - amount: number | string, - consumer: string - ) { + private async createFullAgreementData(agreementId: string, did: string, amount: number | string, consumer: string) { const { didRegistry, conditions } = this.ocean.keeper - const { - accessSecretStoreCondition, - lockRewardCondition, - escrowReward - } = conditions + const { accessSecretStoreCondition, lockRewardCondition, escrowReward } = conditions const publisher = await didRegistry.getDIDOwner(did) @@ -122,11 +84,7 @@ export class EscrowAccessSecretStoreTemplate extends BaseEscrowTemplate { await escrowReward.getAddress(), amount ) - const accessSecretStoreConditionId = await accessSecretStoreCondition.generateIdHash( - agreementId, - did, - consumer - ) + const accessSecretStoreConditionId = await accessSecretStoreCondition.generateIdHash(agreementId, did, consumer) const escrowRewardId = await escrowReward.generateIdHash( agreementId, String(amount), diff --git a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts index 149ac2e..f0019bf 100644 --- a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts +++ b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts @@ -13,11 +13,7 @@ export const escrowComputeExecutionTemplateServiceAgreementTemplate: ServiceAgre } } ], - fulfillmentOrder: [ - 'lockReward.fulfill', - 'serviceExecution.fulfill', - 'escrowReward.fulfill' - ], + fulfillmentOrder: ['lockReward.fulfill', 'serviceExecution.fulfill', 'escrowReward.fulfill'], conditionDependency: { lockReward: [], serviceExecution: [], diff --git a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts index 862fd15..28c023e 100644 --- a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts +++ b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts @@ -7,26 +7,15 @@ import { InstantiableConfig } from '../../../Instantiable.abstract' import { escrowComputeExecutionTemplateServiceAgreementTemplate } from './EscrowComputeExecutionTemplate.serviceAgreementTemplate' export class EscrowComputeExecutionTemplate extends BaseEscrowTemplate { - public static async getInstance( - config: InstantiableConfig - ): Promise { - return AgreementTemplate.getInstance( - config, - 'EscrowComputeExecutionTemplate', - EscrowComputeExecutionTemplate - ) + public static async getInstance(config: InstantiableConfig): Promise { + return AgreementTemplate.getInstance(config, 'EscrowComputeExecutionTemplate', EscrowComputeExecutionTemplate) } public async getServiceAgreementTemplate() { return escrowComputeExecutionTemplateServiceAgreementTemplate } - public async createAgreementFromDDO( - agreementId: string, - ddo: DDO, - consumer: string, - from?: string - ) { + public async createAgreementFromDDO(agreementId: string, ddo: DDO, consumer: string, from?: string) { return !!(await this.createFullAgreement( ddo.shortId(), ddo.findServiceByType('Metadata').metadata.base.price, @@ -36,12 +25,7 @@ export class EscrowComputeExecutionTemplate extends BaseEscrowTemplate { )) } - public async getAgreementIdsFromDDO( - agreementId: string, - ddo: DDO, - consumer: string, - from?: string - ) { + public async getAgreementIdsFromDDO(agreementId: string, ddo: DDO, consumer: string, from?: string) { const { computeExecutionConditionId, lockRewardConditionId, @@ -52,11 +36,7 @@ export class EscrowComputeExecutionTemplate extends BaseEscrowTemplate { ddo.findServiceByType('Metadata').metadata.base.price, consumer ) - return [ - computeExecutionConditionId, - lockRewardConditionId, - escrowRewardId - ] + return [computeExecutionConditionId, lockRewardConditionId, escrowRewardId] } /** @@ -77,21 +57,12 @@ export class EscrowComputeExecutionTemplate extends BaseEscrowTemplate { computeExecutionConditionId, lockRewardConditionId, escrowRewardId - } = await this.createFullAgreementData( - agreementId, - did, - amount, - consumer - ) + } = await this.createFullAgreementData(agreementId, did, amount, consumer) await this.createAgreement( agreementId, did, - [ - computeExecutionConditionId, - lockRewardConditionId, - escrowRewardId - ], + [computeExecutionConditionId, lockRewardConditionId, escrowRewardId], [0, 0, 0], [0, 0, 0], consumer, @@ -101,19 +72,10 @@ export class EscrowComputeExecutionTemplate extends BaseEscrowTemplate { return zeroX(agreementId) } - private async createFullAgreementData( - agreementId: string, - did: string, - amount: number | string, - consumer: string - ) { + private async createFullAgreementData(agreementId: string, did: string, amount: number | string, consumer: string) { const { didRegistry, conditions } = this.ocean.keeper - const { - computeExecutionCondition, - lockRewardCondition, - escrowReward - } = conditions + const { computeExecutionCondition, lockRewardCondition, escrowReward } = conditions const publisher = await didRegistry.getDIDOwner(did) @@ -122,11 +84,7 @@ export class EscrowComputeExecutionTemplate extends BaseEscrowTemplate { await escrowReward.getAddress(), amount ) - const computeExecutionConditionId = await computeExecutionCondition.generateIdHash( - agreementId, - did, - consumer - ) + const computeExecutionConditionId = await computeExecutionCondition.generateIdHash(agreementId, did, consumer) const escrowRewardId = await escrowReward.generateIdHash( agreementId, String(amount), diff --git a/src/keeper/contracts/templates/index.ts b/src/keeper/contracts/templates/index.ts index d4126fa..b8c2746 100644 --- a/src/keeper/contracts/templates/index.ts +++ b/src/keeper/contracts/templates/index.ts @@ -1,8 +1,4 @@ export * from './AgreementTemplate.abstract' export { BaseEscrowTemplate } from './BaseEscrowTemplate.abstract' -export { - EscrowAccessSecretStoreTemplate -} from './EscrowAccessSecretStoreTemplate' -export { - EscrowComputeExecutionTemplate -} from './EscrowComputeExecutionTemplate' +export { EscrowAccessSecretStoreTemplate } from './EscrowAccessSecretStoreTemplate' +export { EscrowComputeExecutionTemplate } from './EscrowComputeExecutionTemplate' diff --git a/src/ocean/Account.ts b/src/ocean/Account.ts index b33e4ec..801766f 100644 --- a/src/ocean/Account.ts +++ b/src/ocean/Account.ts @@ -87,11 +87,9 @@ export default class Account extends Instantiable { * @return {Promise} */ public async getEtherBalance(): Promise { - return this.web3.eth - .getBalance(this.id, 'latest') - .then((balance: string): number => { - return new BigNumber(balance).toNumber() - }) + return this.web3.eth.getBalance(this.id, 'latest').then((balance: string): number => { + return new BigNumber(balance).toNumber() + }) } /** diff --git a/src/ocean/Ocean.ts b/src/ocean/Ocean.ts index 958b600..8bb6fa8 100644 --- a/src/ocean/Ocean.ts +++ b/src/ocean/Ocean.ts @@ -14,10 +14,7 @@ import Keeper from '../keeper/Keeper' import { Config } from '../models/Config' -import { - Instantiable, - generateIntantiableConfigFromConfig -} from '../Instantiable.abstract' +import { Instantiable, generateIntantiableConfigFromConfig } from '../Instantiable.abstract' /** * Main interface for Ocean Protocol. @@ -46,9 +43,7 @@ export class Ocean extends Instantiable { instance.auth = await OceanAuth.getInstance(instanceConfig) instance.assets = await OceanAssets.getInstance(instanceConfig) instance.agreements = await OceanAgreements.getInstance(instanceConfig) - instance.secretStore = await OceanSecretStore.getInstance( - instanceConfig - ) + instance.secretStore = await OceanSecretStore.getInstance(instanceConfig) instance.tokens = await OceanTokens.getInstance(instanceConfig) instance.versions = await OceanVersions.getInstance(instanceConfig) diff --git a/src/ocean/OceanAccounts.ts b/src/ocean/OceanAccounts.ts index 3a99046..a2178a3 100644 --- a/src/ocean/OceanAccounts.ts +++ b/src/ocean/OceanAccounts.ts @@ -10,9 +10,7 @@ export class OceanAccounts extends Instantiable { * Returns the instance of OceanAccounts. * @return {Promise} */ - public static async getInstance( - config: InstantiableConfig - ): Promise { + public static async getInstance(config: InstantiableConfig): Promise { const instance = new OceanAccounts() instance.setInstanceConfig(config) @@ -27,9 +25,7 @@ export class OceanAccounts extends Instantiable { // retrieve eth accounts const ethAccounts: string[] = await this.web3.eth.getAccounts() - const accountPromises = ethAccounts.map( - address => new Account(address, this.instanceConfig) - ) + const accountPromises = ethAccounts.map(address => new Account(address, this.instanceConfig)) return Promise.all(accountPromises) } @@ -48,10 +44,7 @@ export class OceanAccounts extends Instantiable { * @param {number} amount Token amount. * @return {Promise} Success. */ - public async requestTokens( - account: Account, - amount: number - ): Promise { + public async requestTokens(account: Account, amount: number): Promise { try { await account.requestTokens(amount) return true diff --git a/src/ocean/OceanAgreements.ts b/src/ocean/OceanAgreements.ts index 3fc8dce..1e91dbd 100644 --- a/src/ocean/OceanAgreements.ts +++ b/src/ocean/OceanAgreements.ts @@ -21,14 +21,10 @@ export class OceanAgreements extends Instantiable { * Returns the instance of OceanAgreements. * @return {Promise} */ - public static async getInstance( - config: InstantiableConfig - ): Promise { + public static async getInstance(config: InstantiableConfig): Promise { const instance = new OceanAgreements() instance.setInstanceConfig(config) - instance.conditions = await OceanAgreementsConditions.getInstance( - config - ) + instance.conditions = await OceanAgreementsConditions.getInstance(config) return instance } @@ -46,25 +42,15 @@ export class OceanAgreements extends Instantiable { * @param {Account} consumer Consumer account. * @return {Promise} Agreement ID and signaturee. */ - public async prepare( - did: string, - index: number, - consumer: Account - ): Promise { + public async prepare(did: string, index: number, consumer: Account): Promise { const d: DID = DID.parse(did as string) const ddo = await this.ocean.aquarius.retrieveDDO(d) const agreementId: string = zeroX(generateId()) - const templateName = ddo.findServiceByType('access') - .serviceAgreementTemplate.contractName + const templateName = ddo.findServiceByType('access').serviceAgreementTemplate.contractName const agreementConditionsIds = await this.ocean.keeper .getTemplateByName(templateName) - .getAgreementIdsFromDDO( - agreementId, - ddo, - consumer.getId(), - consumer.getId() - ) + .getAgreementIdsFromDDO(agreementId, ddo, consumer.getId(), consumer.getId()) const signature = await this.ocean.utils.agreements.signServiceAgreement( ddo, @@ -100,9 +86,7 @@ export class OceanAgreements extends Instantiable { ) if (!result.ok) { - throw new Error( - 'Error on initialize agreement: ' + (await result.text()) - ) + throw new Error('Error on initialize agreement: ' + (await result.text())) } } @@ -129,16 +113,10 @@ export class OceanAgreements extends Instantiable { const d: DID = DID.parse(did) const ddo = await this.ocean.aquarius.retrieveDDO(d) - const templateName = ddo.findServiceById<'access'>(index) - .serviceAgreementTemplate.contractName + const templateName = ddo.findServiceById<'access'>(index).serviceAgreementTemplate.contractName await this.ocean.keeper .getTemplateByName(templateName) - .createAgreementFromDDO( - agreementId, - ddo, - consumer.getId(), - publisher.getId() - ) + .createAgreementFromDDO(agreementId, ddo, consumer.getId(), publisher.getId()) return true } @@ -149,25 +127,13 @@ export class OceanAgreements extends Instantiable { * @param {boolean} extended Returns a complete status with dependencies. * @return {Promise} */ - public async status( - agreementId: string, - extended?: false - ): Promise<{ [condition: string]: ConditionState }> + public async status(agreementId: string, extended?: false): Promise<{ [condition: string]: ConditionState }> - public async status( - agreementId: string, - extended: true - ): Promise + public async status(agreementId: string, extended: true): Promise public async status(agreementId: string, extended: boolean = false) { - const { - templateId - } = await this.ocean.keeper.agreementStoreManager.getAgreement( - agreementId - ) - const fullStatus = await this.ocean.keeper - .getTemplateByAddress(templateId) - .getAgreementStatus(agreementId) + const { templateId } = await this.ocean.keeper.agreementStoreManager.getAgreement(agreementId) + const fullStatus = await this.ocean.keeper.getTemplateByAddress(templateId).getAgreementStatus(agreementId) if (!fullStatus) { return diff --git a/src/ocean/OceanAgreementsConditions.ts b/src/ocean/OceanAgreementsConditions.ts index 3e9bed7..743f177 100644 --- a/src/ocean/OceanAgreementsConditions.ts +++ b/src/ocean/OceanAgreementsConditions.ts @@ -9,9 +9,7 @@ export class OceanAgreementsConditions extends Instantiable { * Returns the instance of OceanAgreementsConditions. * @return {Promise} */ - public static async getInstance( - config: InstantiableConfig - ): Promise { + public static async getInstance(config: InstantiableConfig): Promise { const instance = new OceanAgreementsConditions() instance.setInstanceConfig(config) @@ -25,22 +23,11 @@ export class OceanAgreementsConditions extends Instantiable { * @param {number} amount Asset amount. * @param {Account} from Account of sender. */ - public async lockReward( - agreementId: string, - amount: number | string, - from?: Account - ) { - const { - lockRewardCondition, - escrowReward - } = this.ocean.keeper.conditions + public async lockReward(agreementId: string, amount: number | string, from?: Account) { + const { lockRewardCondition, escrowReward } = this.ocean.keeper.conditions try { - await this.ocean.keeper.token.approve( - lockRewardCondition.getAddress(), - amount, - from.getId() - ) + await this.ocean.keeper.token.approve(lockRewardCondition.getAddress(), amount, from.getId()) const receipt = await lockRewardCondition.fulfill( agreementId, @@ -62,21 +49,11 @@ export class OceanAgreementsConditions extends Instantiable { * @param {string} grantee Consumer address. * @param {Account} from Account of sender. */ - public async grantAccess( - agreementId: string, - did: string, - grantee: string, - from?: Account - ) { + public async grantAccess(agreementId: string, did: string, grantee: string, from?: Account) { try { const { accessSecretStoreCondition } = this.ocean.keeper.conditions - const receipt = await accessSecretStoreCondition.fulfill( - agreementId, - did, - grantee, - from && from.getId() - ) + const receipt = await accessSecretStoreCondition.fulfill(agreementId, did, grantee, from && from.getId()) return !!receipt.events.Fulfilled } catch { return false @@ -90,21 +67,11 @@ export class OceanAgreementsConditions extends Instantiable { * @param {string} grantee Consumer address. * @param {Account} from Account of sender. */ - public async grantServiceExecution( - agreementId: string, - did: string, - grantee: string, - from?: Account - ) { + public async grantServiceExecution(agreementId: string, did: string, grantee: string, from?: Account) { try { const { computeExecutionCondition } = this.ocean.keeper.conditions - const receipt = await computeExecutionCondition.fulfill( - agreementId, - did, - grantee, - from && from.getId() - ) + const receipt = await computeExecutionCondition.fulfill(agreementId, did, grantee, from && from.getId()) return !!receipt.events.Fulfilled } catch { return false @@ -133,17 +100,9 @@ export class OceanAgreementsConditions extends Instantiable { from?: Account ) { try { - const { - escrowReward, - accessSecretStoreCondition, - lockRewardCondition - } = this.ocean.keeper.conditions + const { escrowReward, accessSecretStoreCondition, lockRewardCondition } = this.ocean.keeper.conditions - const conditionIdAccess = await accessSecretStoreCondition.generateIdHash( - agreementId, - did, - consumer - ) + const conditionIdAccess = await accessSecretStoreCondition.generateIdHash(agreementId, did, consumer) const conditionIdLock = await lockRewardCondition.generateIdHash( agreementId, escrowReward.getAddress(), diff --git a/src/ocean/OceanAssets.ts b/src/ocean/OceanAssets.ts index 16a55e1..83df452 100644 --- a/src/ocean/OceanAssets.ts +++ b/src/ocean/OceanAssets.ts @@ -4,12 +4,7 @@ import { MetaData } from '../ddo/MetaData' import { Service } from '../ddo/Service' import Account from './Account' import DID from './DID' -import { - fillConditionsWithDDO, - SubscribablePromise, - generateId, - zeroX -} from '../utils' +import { fillConditionsWithDDO, SubscribablePromise, generateId, zeroX } from '../utils' import { Instantiable, InstantiableConfig } from '../Instantiable.abstract' export enum CreateProgressStep { @@ -38,9 +33,7 @@ export class OceanAssets extends Instantiable { * Returns the instance of OceanAssets. * @return {Promise} */ - public static async getInstance( - config: InstantiableConfig - ): Promise { + public static async getInstance(config: InstantiableConfig): Promise { const instance = new OceanAssets() instance.setInstanceConfig(config) @@ -53,9 +46,7 @@ export class OceanAssets extends Instantiable { * @return {Promise} */ public async resolve(did: string): Promise { - const { - serviceEndpoint - } = await this.ocean.keeper.didRegistry.getAttributesByDid(did) + const { serviceEndpoint } = await this.ocean.keeper.didRegistry.getAttributesByDid(did) return this.ocean.aquarius.retrieveDDOByUrl(serviceEndpoint) } @@ -79,11 +70,7 @@ export class OceanAssets extends Instantiable { this.logger.log('Encrypting files') observer.next(CreateProgressStep.EncryptingFiles) - const encryptedFiles = await this.ocean.secretStore.encrypt( - did.getId(), - metadata.main.files, - publisher - ) + const encryptedFiles = await this.ocean.secretStore.encrypt(did.getId(), metadata.main.files, publisher) this.logger.log('Files encrypted') observer.next(CreateProgressStep.FilesEncrypted) @@ -139,13 +126,11 @@ export class OceanAssets extends Instantiable { ...metadata.main, contentUrls: undefined, encryptedFiles, - files: metadata.main.files.map( - (file, index) => ({ - ...file, - index, - url: undefined - }) - ) + files: metadata.main.files.map((file, index) => ({ + ...file, + index, + url: undefined + })) } as any } }, @@ -153,10 +138,7 @@ export class OceanAssets extends Instantiable { ] // Remove duplications .reverse() - .filter( - ({ type }, i, list) => - list.findIndex(({ type: t }) => t === type) === i - ) + .filter(({ type }, i, list) => list.findIndex(({ type: t }) => t === type) === i) .reverse() // Adding index .map(_ => ({ @@ -173,11 +155,7 @@ export class OceanAssets extends Instantiable { ddo.addChecksum() this.logger.log('Generating proof') observer.next(CreateProgressStep.GeneratingProof) - await ddo.addProof( - this.ocean, - publisher.getId(), - publisher.getPassword() - ) + await ddo.addProof(this.ocean, publisher.getId(), publisher.getPassword()) this.logger.log('Proof generated') observer.next(CreateProgressStep.ProofGenerated) @@ -242,16 +220,12 @@ export class OceanAssets extends Instantiable { const { serviceEndpoint } = accessService if (!serviceEndpoint) { - throw new Error( - 'Consume asset failed, service definition is missing the `serviceEndpoint`.' - ) + throw new Error('Consume asset failed, service definition is missing the `serviceEndpoint`.') } this.logger.log('Consuming files') - resultPath = resultPath - ? `${resultPath}/datafile.${ddo.shortId()}.${serviceIndex}/` - : undefined + resultPath = resultPath ? `${resultPath}/datafile.${ddo.shortId()}.${serviceIndex}/` : undefined if (!useSecretStore) { await this.ocean.brizo.consumeService( @@ -265,16 +239,13 @@ export class OceanAssets extends Instantiable { } else { const files = await this.ocean.secretStore.decrypt( did, - ddo.findServiceByType('metadata').attributes.main - .encryptedFiles, + ddo.findServiceByType('metadata').attributes.main.encryptedFiles, consumerAccount, ddo.findServiceByType('authorization').serviceEndpoint ) const downloads = files .filter(({ index: i }) => index === -1 || index === i) - .map(({ url, index: i }) => - this.ocean.utils.fetch.downloadFile(url, resultPath, i) - ) + .map(({ url, index: i }) => this.ocean.utils.fetch.downloadFile(url, resultPath, i)) await Promise.all(downloads) } this.logger.log('Files consumed') @@ -293,11 +264,7 @@ export class OceanAssets extends Instantiable { * @param {Account} consumer Consumer account. * @return {Promise} Returns Agreement ID */ - public order( - did: string, - index: number, - consumer: Account - ): SubscribablePromise { + public order(did: string, index: number, consumer: Account): SubscribablePromise { return new SubscribablePromise(async observer => { const oceanAgreements = this.ocean.agreements @@ -305,8 +272,7 @@ export class OceanAssets extends Instantiable { const ddo = await this.resolve(did) const { keeper } = this.ocean - const templateName = ddo.findServiceByType('access') - .serviceAgreementTemplate.contractName + const templateName = ddo.findServiceByType('access').serviceAgreementTemplate.contractName const template = keeper.getTemplateByName(templateName) const accessCondition = keeper.conditions.accessSecretStoreCondition @@ -321,16 +287,10 @@ export class OceanAssets extends Instantiable { this.logger.log('Locking payment') - const accessGranted = accessCondition - .getConditionFulfilledEvent(agreementId) - .once() + const accessGranted = accessCondition.getConditionFulfilledEvent(agreementId).once() observer.next(OrderProgressStep.LockingPayment) - const paid = await oceanAgreements.conditions.lockReward( - agreementId, - attributes.main.price, - consumer - ) + const paid = await oceanAgreements.conditions.lockReward(agreementId, attributes.main.price, consumer) observer.next(OrderProgressStep.LockedPayment) if (paid) { @@ -350,14 +310,7 @@ export class OceanAssets extends Instantiable { observer.next(OrderProgressStep.CreatingAgreement) this.logger.log('Creating agreement') - await oceanAgreements.create( - did, - agreementId, - index, - undefined, - consumer, - consumer - ) + await oceanAgreements.create(did, agreementId, index, undefined, consumer, consumer) this.logger.log('Agreement created') try { @@ -379,15 +332,10 @@ export class OceanAssets extends Instantiable { const ddo = await this.resolve(did) const checksum = ddo.getChecksum() const { creator, signatureValue } = ddo.proof - const signer = await this.ocean.utils.signature.verifyText( - checksum, - signatureValue - ) + const signer = await this.ocean.utils.signature.verifyText(checksum, signatureValue) if (signer.toLowerCase() !== creator.toLowerCase()) { - this.logger.warn( - `Owner of ${ddo.id} doesn't match. Expected ${creator} instead of ${signer}.` - ) + this.logger.warn(`Owner of ${ddo.id} doesn't match. Expected ${creator} instead of ${signer}.`) } return creator @@ -408,9 +356,9 @@ export class OceanAssets extends Instantiable { * @return {Promise} List of DIDs. */ public async consumerAssets(consumer: string) { - return (await this.ocean.keeper.conditions.accessSecretStoreCondition.getGrantedDidByConsumer( - consumer - )).map(({ did }) => did) + return (await this.ocean.keeper.conditions.accessSecretStoreCondition.getGrantedDidByConsumer(consumer)).map( + ({ did }) => did + ) } /** diff --git a/src/ocean/OceanAuth.ts b/src/ocean/OceanAuth.ts index 4350d18..4764206 100644 --- a/src/ocean/OceanAuth.ts +++ b/src/ocean/OceanAuth.ts @@ -13,9 +13,7 @@ export class OceanAuth extends Instantiable { * Returns the instance of OceanAuth. * @return {Promise} */ - public static async getInstance( - config: InstantiableConfig - ): Promise { + public static async getInstance(config: InstantiableConfig): Promise { const instance = new OceanAuth() instance.setInstanceConfig(config) @@ -32,11 +30,7 @@ export class OceanAuth extends Instantiable { const message = `${this.getMessage()}\n${time}` try { - const signature = await this.ocean.utils.signature.signText( - message, - account.getId(), - account.getPassword() - ) + const signature = await this.ocean.utils.signature.signText(message, account.getId(), account.getPassword()) return `${signature}-${time}` } catch { @@ -59,9 +53,7 @@ export class OceanAuth extends Instantiable { return `0x${'0'.repeat(40)}` } - return this.web3.utils.toChecksumAddress( - await this.ocean.utils.signature.verifyText(message, signature) - ) + return this.web3.utils.toChecksumAddress(await this.ocean.utils.signature.verifyText(message, signature)) } /** @@ -129,9 +121,7 @@ export class OceanAuth extends Instantiable { try { localStorage.getItem('') } catch { - throw new Error( - 'LocalStorage is not supported. This feature is only available on browsers.' - ) + throw new Error('LocalStorage is not supported. This feature is only available on browsers.') } return localStorage } diff --git a/src/ocean/OceanSecretStore.ts b/src/ocean/OceanSecretStore.ts index 7cf5954..a76dfeb 100644 --- a/src/ocean/OceanSecretStore.ts +++ b/src/ocean/OceanSecretStore.ts @@ -13,9 +13,7 @@ export class OceanSecretStore extends Instantiable { * Returns the instance of OceanSecretStore. * @return {Promise} */ - public static async getInstance( - config: InstantiableConfig - ): Promise { + public static async getInstance(config: InstantiableConfig): Promise { const instance = new OceanSecretStore() instance.setInstanceConfig(config) @@ -30,25 +28,12 @@ export class OceanSecretStore extends Instantiable { * @param {string} publisher Publisher account. * @return {Promise} Encrypted text. */ - public async encrypt( - did: string, - document: any, - publisher: Account - ): Promise { + public async encrypt(did: string, document: any, publisher: Account): Promise { const signature = (await publisher.getToken()) || - (await this.ocean.utils.signature.signText( - noDidPrefixed(did), - publisher.getId(), - publisher.getPassword() - )) + (await this.ocean.utils.signature.signText(noDidPrefixed(did), publisher.getId(), publisher.getPassword())) - return this.ocean.brizo.encrypt( - noDidPrefixed(did), - signature, - document, - publisher.getId() - ) + return this.ocean.brizo.encrypt(noDidPrefixed(did), signature, document, publisher.getId()) } /** @@ -59,16 +44,8 @@ export class OceanSecretStore extends Instantiable { * @param {string} consumer cONSUMER account. * @return {Promise} Encrypted text. */ - public async decrypt( - did: string, - content: string, - consumer?: Account, - secretStoreUrl?: string - ): Promise { - return this.getSecretStoreByAccount( - consumer, - secretStoreUrl - ).decryptDocument(noDidPrefixed(did), content) + public async decrypt(did: string, content: string, consumer?: Account, secretStoreUrl?: string): Promise { + return this.getSecretStoreByAccount(consumer, secretStoreUrl).decryptDocument(noDidPrefixed(did), content) } private getSecretStoreByAccount(account: Account, secretStoreUrl?: string) { @@ -86,13 +63,7 @@ export class OceanSecretStore extends Instantiable { } private getSecretStore(config: SecretStoreConfig): SecretStore { - const { - secretStoreUri, - parityUri, - password, - address, - threshold - } = config + const { secretStoreUri, parityUri, password, address, threshold } = config config = { secretStoreUri, parityUri, password, address, threshold } return new SecretStore(config) diff --git a/src/ocean/OceanTokens.ts b/src/ocean/OceanTokens.ts index 66bab1a..38a16f5 100644 --- a/src/ocean/OceanTokens.ts +++ b/src/ocean/OceanTokens.ts @@ -9,9 +9,7 @@ export class OceanTokens extends Instantiable { * Returns the instance of OceanTokens. * @return {Promise} */ - public static async getInstance( - config: InstantiableConfig - ): Promise { + public static async getInstance(config: InstantiableConfig): Promise { const instance = new OceanTokens() instance.setInstanceConfig(config) @@ -25,11 +23,7 @@ export class OceanTokens extends Instantiable { * @param {Account} from Sender account address. * @return {Promise} Success, */ - public async transfer( - to: string, - amount: number, - from: Account - ): Promise { + public async transfer(to: string, amount: number, from: Account): Promise { this.ocean.keeper.token.transfer(to, amount, from.getId()) return true } diff --git a/src/ocean/OceanVersions.ts b/src/ocean/OceanVersions.ts index e88dbc5..143e19d 100644 --- a/src/ocean/OceanVersions.ts +++ b/src/ocean/OceanVersions.ts @@ -42,9 +42,7 @@ export class OceanVersions extends Instantiable { * Returns the instance of OceanVersions. * @return {Promise} */ - public static async getInstance( - config: InstantiableConfig - ): Promise { + public static async getInstance(config: InstantiableConfig): Promise { const instance = new OceanVersions() instance.setInstanceConfig(config) @@ -99,10 +97,7 @@ export class OceanVersions extends Instantiable { // Aquarius try { - const { - software: name, - version - } = await this.ocean.aquarius.getVersionInfo() + const { software: name, version } = await this.ocean.aquarius.getVersionInfo() versions.aquarius = { name, status: OceanPlatformTechStatus.Working, @@ -124,9 +119,7 @@ export class OceanVersions extends Instantiable { .reduce((acc, network) => ({ ...acc, [network]: true }), {}) let contractStatus = true - const contractList = techs - .map(({ contracts }) => contracts) - .filter(_ => !!_) + const contractList = techs.map(({ contracts }) => contracts).filter(_ => !!_) Array.from(contractList.map(Object.keys)) .reduce((acc, _) => [...acc, ..._], []) .filter((_, i, list) => list.indexOf(_) === i) @@ -146,9 +139,7 @@ export class OceanVersions extends Instantiable { }) versions.status = { - ok: !techs.find( - ({ status }) => status !== OceanPlatformTechStatus.Working - ), + ok: !techs.find(({ status }) => status !== OceanPlatformTechStatus.Working), network: Object.keys(networks).length === 1, contracts: contractStatus } diff --git a/src/ocean/utils/OceanUtils.ts b/src/ocean/utils/OceanUtils.ts index af4ca02..2d5a0a2 100644 --- a/src/ocean/utils/OceanUtils.ts +++ b/src/ocean/utils/OceanUtils.ts @@ -12,9 +12,7 @@ export class OceanUtils extends Instantiable { * Returns the instance of OceanUtils. * @return {Promise} */ - public static async getInstance( - config: InstantiableConfig - ): Promise { + public static async getInstance(config: InstantiableConfig): Promise { const instance = new OceanUtils() instance.setInstanceConfig(config) diff --git a/src/ocean/utils/ServiceAgreement.ts b/src/ocean/utils/ServiceAgreement.ts index c634aed..e8d9a07 100644 --- a/src/ocean/utils/ServiceAgreement.ts +++ b/src/ocean/utils/ServiceAgreement.ts @@ -19,14 +19,8 @@ export class ServiceAgreement extends Instantiable { consumer: Account ): Promise { const service = ddo.findServiceById<'access'>(index) - const timelockValues: number[] = this.getTimeValuesFromService( - service, - 'timelock' - ) - const timeoutValues: number[] = this.getTimeValuesFromService( - service, - 'timeout' - ) + const timelockValues: number[] = this.getTimeValuesFromService(service, 'timelock') + const timeoutValues: number[] = this.getTimeValuesFromService(service, 'timeout') if (!service.templateId) { throw new Error('TemplateId not found in DDO.') @@ -89,10 +83,7 @@ export class ServiceAgreement extends Instantiable { return this.web3.utils.soliditySha3(...args).toString('hex') } - private getTimeValuesFromService( - service: ServiceAccess, - type: 'timeout' | 'timelock' - ): number[] { + private getTimeValuesFromService(service: ServiceAccess, type: 'timeout' | 'timelock'): number[] { const timeoutValues: number[] = service.serviceAgreementTemplate.conditions.map( (condition: ServiceAgreementTemplateCondition) => condition[type] ) diff --git a/src/ocean/utils/SignatureUtils.ts b/src/ocean/utils/SignatureUtils.ts index 42f63c1..c77a3cc 100644 --- a/src/ocean/utils/SignatureUtils.ts +++ b/src/ocean/utils/SignatureUtils.ts @@ -6,15 +6,8 @@ export class SignatureUtils extends Instantiable { this.setInstanceConfig(config) } - public async signText( - text: string, - publicKey: string, - password?: string - ): Promise { - const isMetaMask = - this.web3 && - this.web3.currentProvider && - this.web3.currentProvider.isMetaMask + public async signText(text: string, publicKey: string, password?: string): Promise { + const isMetaMask = this.web3 && this.web3.currentProvider && this.web3.currentProvider.isMetaMask try { return await this.web3.eth.personal.sign(text, publicKey, password) } catch (e) { diff --git a/src/ocean/utils/WebServiceConnector.ts b/src/ocean/utils/WebServiceConnector.ts index 8b16bb6..aa50450 100644 --- a/src/ocean/utils/WebServiceConnector.ts +++ b/src/ocean/utils/WebServiceConnector.ts @@ -43,20 +43,14 @@ export class WebServiceConnector extends Instantiable { }) } - public async downloadFile( - url: string, - destination?: string, - index?: number - ): Promise { + public async downloadFile(url: string, destination?: string, index?: number): Promise { const response = await this.get(url) if (!response.ok) { throw new Error('Response error.') } let filename try { - filename = response.headers - .get('content-disposition') - .match(/attachment;filename=(.+)/)[1] + filename = response.headers.get('content-disposition').match(/attachment;filename=(.+)/)[1] } catch { try { filename = url.split('/').pop() @@ -69,9 +63,7 @@ export class WebServiceConnector extends Instantiable { // eslint-disable-next-line no-async-promise-executor await new Promise(async (resolve, reject) => { fs.mkdirSync(destination, { recursive: true }) - const fileStream = fs.createWriteStream( - `${destination}${filename}` - ) + const fileStream = fs.createWriteStream(`${destination}${filename}`) response.body.pipe(fileStream) response.body.on('error', reject) fileStream.on('finish', resolve) diff --git a/src/squid.ts b/src/squid.ts index 190ba5f..973039f 100644 --- a/src/squid.ts +++ b/src/squid.ts @@ -24,14 +24,4 @@ export { 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, conditions, templates, utils } diff --git a/src/utils/ConversionTypeHelpers.ts b/src/utils/ConversionTypeHelpers.ts index 48c0bca..1560dc3 100644 --- a/src/utils/ConversionTypeHelpers.ts +++ b/src/utils/ConversionTypeHelpers.ts @@ -4,11 +4,7 @@ import { LoggerInstance } from './Logger' export const zeroX = (input: string) => zeroXTransformer(input, true) export const noZeroX = (input: string) => zeroXTransformer(input, false) export function zeroXTransformer(input: string = '', zeroOutput: boolean) { - const { valid, output } = inputMatch( - input, - /^(?:0x)*([a-f0-9]+)$/i, - 'zeroXTransformer' - ) + const { valid, output } = inputMatch(input, /^(?:0x)*([a-f0-9]+)$/i, 'zeroXTransformer') return (zeroOutput && valid ? '0x' : '') + output } @@ -16,11 +12,7 @@ export function zeroXTransformer(input: string = '', zeroOutput: boolean) { export const didPrefixed = (input: string) => didTransformer(input, true) export const noDidPrefixed = (input: string) => didTransformer(input, false) export function didTransformer(input: string = '', prefixOutput: boolean) { - const { valid, output } = inputMatch( - input, - /^(?:0x|did:op:)*([a-f0-9]{64})$/i, - 'didTransformer' - ) + const { valid, output } = inputMatch(input, /^(?:0x|did:op:)*([a-f0-9]{64})$/i, 'didTransformer') return (prefixOutput && valid ? 'did:op:' : '') + output } @@ -28,17 +20,11 @@ export function didTransformer(input: string = '', prefixOutput: boolean) { export const didZeroX = (input: string) => zeroX(didTransformer(input, false)) // Shared functions -function inputMatch( - input: string, - regexp: RegExp, - conversorName: string -): { valid: boolean; output: string } { +function inputMatch(input: string, regexp: RegExp, conversorName: string): { valid: boolean; output: string } { if (typeof input !== 'string') { LoggerInstance.debug('Not input string:') LoggerInstance.debug(input) - throw new Error( - `[${conversorName}] Expected string, input type: ${typeof input}` - ) + throw new Error(`[${conversorName}] Expected string, input type: ${typeof input}`) } const match = input.match(regexp) if (!match) { diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index a326825..bb59480 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -1,8 +1,5 @@ import { DDO } from '../ddo/DDO' -import { - ServiceAgreementTemplateCondition, - ServiceAgreementTemplateParameter -} from '../ddo/ServiceAgreementTemplate' +import { ServiceAgreementTemplateCondition, ServiceAgreementTemplateParameter } from '../ddo/ServiceAgreementTemplate' function fillParameterWithDDO( parameter: ServiceAgreementTemplateParameter, @@ -12,9 +9,7 @@ function fillParameterWithDDO( switch (name) { case 'amount': case 'price': - return String( - ddo.findServiceByType('metadata').attributes.main.price - ) + return String(ddo.findServiceByType('metadata').attributes.main.price) case 'assetId': case 'documentId': case 'documentKeyId': diff --git a/src/utils/PromiseResolver.ts b/src/utils/PromiseResolver.ts index 7b589e7..9e099dd 100644 --- a/src/utils/PromiseResolver.ts +++ b/src/utils/PromiseResolver.ts @@ -8,9 +8,7 @@ const zipObject = (keys = [], values = []) => { ) } -export const objectPromiseAll = async (obj: { - [key: string]: Promise -}) => { +export const objectPromiseAll = async (obj: { [key: string]: Promise }) => { const keys = Object.keys(obj) const result = await Promise.all(Object.values(obj)) return zipObject(keys, result) diff --git a/src/utils/SubscribableObserver.ts b/src/utils/SubscribableObserver.ts index 8cf9cde..a554bcc 100644 --- a/src/utils/SubscribableObserver.ts +++ b/src/utils/SubscribableObserver.ts @@ -7,11 +7,7 @@ export class SubscribableObserver { onError?: (error: any) => void }>() - public subscribe( - onNext?: (next: T) => void, - onComplete?: (complete: P) => void, - onError?: (error: any) => void - ) { + public subscribe(onNext?: (next: T) => void, onComplete?: (complete: P) => void, onError?: (error: any) => void) { if (this.completed) { throw new Error('Observer completed.') } @@ -40,9 +36,7 @@ export class SubscribableObserver { private emit(type: 'onNext' | 'onComplete' | 'onError', value: any) { Array.from(this.subscriptions) .map(subscription => subscription[type]) - .filter( - (callback: any) => callback && typeof callback === 'function' - ) + .filter((callback: any) => callback && typeof callback === 'function') .forEach((callback: any) => callback(value)) } diff --git a/src/utils/SubscribablePromise.ts b/src/utils/SubscribablePromise.ts index 8ff0d12..1ff71fb 100644 --- a/src/utils/SubscribablePromise.ts +++ b/src/utils/SubscribablePromise.ts @@ -12,9 +12,7 @@ export class SubscribablePromise { this ) - constructor( - executor: (observer: SubscribableObserver) => void | Promise

- ) { + constructor(executor: (observer: SubscribableObserver) => void | Promise

) { // Defear setTimeout(() => this.init(executor), 1) } @@ -28,10 +26,7 @@ export class SubscribablePromise { return this } - public then( - onfulfilled?: (value: P) => any, - onrejected?: (error: any) => any - ) { + public then(onfulfilled?: (value: P) => any, onrejected?: (error: any) => any) { return Object.assign(this.promise.then(onfulfilled, onrejected), this) } @@ -43,9 +38,7 @@ export class SubscribablePromise { return Object.assign(this.promise.finally(onfinally), this) } - private init( - executor: (observer: SubscribableObserver) => void | Promise

- ) { + private init(executor: (observer: SubscribableObserver) => void | Promise

) { const execution = executor(this.observer) Promise.resolve(execution as any) diff --git a/test/aquarius/Aquarius.test.ts b/test/aquarius/Aquarius.test.ts index 5723f2c..b74a00c 100644 --- a/test/aquarius/Aquarius.test.ts +++ b/test/aquarius/Aquarius.test.ts @@ -17,12 +17,12 @@ describe('Aquarius', () => { let ocean: Ocean let aquarius: Aquarius /* eslint-disable @typescript-eslint/camelcase */ - const getResults = ( - results: DDO[], - page = 0, - total_pages = 1, - total_results = 1 - ) => ({ results, page, total_pages, total_results }) + const getResults = (results: DDO[], page = 0, total_pages = 1, total_results = 1) => ({ + results, + page, + total_pages, + total_results + }) /* eslint-enable @typescript-eslint/camelcase */ beforeEach(async () => { @@ -48,9 +48,7 @@ describe('Aquarius', () => { } as SearchQuery it('should query metadata', async () => { - spy.on(ocean.utils.fetch, 'post', () => - reponsify(getResults([new DDO()])) - ) + spy.on(ocean.utils.fetch, 'post', () => reponsify(getResults([new DDO()]))) const result = await aquarius.queryMetadata(query) assert.typeOf(result.results, 'array') @@ -61,9 +59,7 @@ describe('Aquarius', () => { }) it('should query metadata and return real ddo', async () => { - spy.on(ocean.utils.fetch, 'post', () => - reponsify(getResults([new DDO()])) - ) + spy.on(ocean.utils.fetch, 'post', () => reponsify(getResults([new DDO()]))) const result = await aquarius.queryMetadata(query) assert.typeOf(result.results, 'array') @@ -86,9 +82,7 @@ describe('Aquarius', () => { } as SearchQuery it('should query metadata by text', async () => { - spy.on(ocean.utils.fetch, 'get', () => - reponsify(getResults([new DDO()])) - ) + spy.on(ocean.utils.fetch, 'get', () => reponsify(getResults([new DDO()]))) const result = await aquarius.queryMetadataByText(query) assert.typeOf(result.results, 'array') @@ -99,9 +93,7 @@ describe('Aquarius', () => { }) it('should query metadata and return real ddo', async () => { - spy.on(ocean.utils.fetch, 'get', () => - reponsify(getResults([new DDO()])) - ) + spy.on(ocean.utils.fetch, 'get', () => reponsify(getResults([new DDO()]))) const result = await aquarius.queryMetadataByText(query) assert.typeOf(result.results, 'array') diff --git a/test/ddo/DDO.test.ts b/test/ddo/DDO.test.ts index ee4a134..5b8ae3f 100644 --- a/test/ddo/DDO.test.ts +++ b/test/ddo/DDO.test.ts @@ -46,8 +46,7 @@ describe('DDO', () => { }, { type: 'CredentialRepositoryService', - serviceEndpoint: - 'https://repository.example.com/service/8377464' + serviceEndpoint: 'https://repository.example.com/service/8377464' }, { type: 'XdiService', @@ -55,8 +54,7 @@ describe('DDO', () => { }, { type: 'HubService', - serviceEndpoint: - 'https://hub.example.com/.identity/did:op:0123456789abcdef/' + serviceEndpoint: 'https://hub.example.com/.identity/did:op:0123456789abcdef/' }, { type: 'MessagingService', @@ -89,8 +87,7 @@ describe('DDO', () => { { type: 'metadata', index: 0, - serviceEndpoint: - 'http://myaquarius.org/api/v1/provider/assets/metadata/{did}', + serviceEndpoint: 'http://myaquarius.org/api/v1/provider/assets/metadata/{did}', attributes: { main: { name: 'UK Weather information 2011', @@ -106,8 +103,7 @@ describe('DDO', () => { checksum: 'efb2c764274b745f5fc37f97c6b0e761', contentLength: 4535431, contentType: 'application/json', - resourceId: - 'access-log2018-02-13-15-17-29-18386C502CAEA932' + resourceId: 'access-log2018-02-13-15-17-29-18386C502CAEA932' }, { index: 1, @@ -128,11 +124,9 @@ describe('DDO', () => { schema: 'Binary Voting' }, additionalInformation: { - description: - 'Weather information of UK including temperature and humidity', + description: 'Weather information of UK including temperature and humidity', copyrightHolder: 'Met Office', - workExample: - '423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68', + workExample: '423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68', links: [ { sample1: @@ -143,29 +137,20 @@ describe('DDO', () => { 'http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-averages-25km/' }, { - fieldsDescription: - 'http://data.ceda.ac.uk/badc/ukcp09/' + fieldsDescription: 'http://data.ceda.ac.uk/badc/ukcp09/' } ], inLanguage: 'en', categories: ['Economy', 'Data Science'], - tags: [ - 'weather', - 'uk', - '2011', - 'temperature', - 'humidity' - ], + tags: ['weather', 'uk', '2011', 'temperature', 'humidity'], updateFrequency: 'yearly', structuredMarkup: [ { - uri: - 'http://skos.um.es/unescothes/C01194/jsonld', + uri: 'http://skos.um.es/unescothes/C01194/jsonld', mediaType: 'application/ld+json' }, { - uri: - 'http://skos.um.es/unescothes/C01194/turtle', + uri: 'http://skos.um.es/unescothes/C01194/turtle', mediaType: 'text/turtle' } ] @@ -234,10 +219,7 @@ describe('DDO', () => { assert.instanceOf(ddo, DDO) assert.equal(ddo.id, testDDO.id) - assert.equal( - ddo.publicKey[0].publicKeyPem, - testDDO.publicKey[0].publicKeyPem - ) + assert.equal(ddo.publicKey[0].publicKeyPem, testDDO.publicKey[0].publicKeyPem) }) it('should properly deserialize from json file', async () => { @@ -245,10 +227,7 @@ describe('DDO', () => { assert(ddo) assert.equal(ddo.id, jsonDDO.id) - assert.equal( - ddo.publicKey[0].publicKeyPem, - jsonDDO.publicKey[0].publicKeyPem - ) + assert.equal(ddo.publicKey[0].publicKeyPem, jsonDDO.publicKey[0].publicKeyPem) }) }) @@ -257,10 +236,7 @@ describe('DDO', () => { const ddo = new DDO(testDDO) const checksum = ddo.getChecksum() - assert.equal( - checksum, - '0x15f27a7a3c7b15d2b06dec7347c6b8da168adddd7df51a8ebbbe87b59b80049b' - ) + assert.equal(checksum, '0x15f27a7a3c7b15d2b06dec7347c6b8da168adddd7df51a8ebbbe87b59b80049b') }) }) @@ -269,11 +245,7 @@ describe('DDO', () => { const signature = `0x${'a'.repeat(130)}` it('should properly generate the proof', async () => { - const signTextSpy = spy.on( - ocean.utils.signature, - 'signText', - () => signature - ) + const signTextSpy = spy.on(ocean.utils.signature, 'signText', () => signature) const ddo = new DDO(testDDO) const checksum = ddo.getChecksum() const proof = await ddo.generateProof(ocean, publicKey) @@ -298,11 +270,7 @@ describe('DDO', () => { signaturValue: 'test' } as any const ddo = new DDO(testDDO) - const generateProofSpy = spy.on( - ddo, - 'generateProof', - () => fakeProof - ) + const generateProofSpy = spy.on(ddo, 'generateProof', () => fakeProof) await ddo.addProof(web3, publicKey) assert.equal(ddo.proof, fakeProof) diff --git a/test/keeper/ContractBase.test.ts b/test/keeper/ContractBase.test.ts index f1c7dc6..53bc69b 100644 --- a/test/keeper/ContractBase.test.ts +++ b/test/keeper/ContractBase.test.ts @@ -30,11 +30,9 @@ describe('ContractWrapperBase', () => { }) it('should fail to call on an unknown contract function', done => { - wrappedContract - .sendMock('balanceOfxxx', '0x00', ['0x00']) - .catch(() => { - done() - }) + wrappedContract.sendMock('balanceOfxxx', '0x00', ['0x00']).catch(() => { + done() + }) }) it('should fail to call on an contract function with wrong set of parameters', done => { @@ -46,11 +44,9 @@ describe('ContractWrapperBase', () => { describe('#send()', () => { it('should fail to call on an unknown contract function', done => { - wrappedContract - .sendMock('transferxxx', accounts[0].getId(), []) - .catch(() => { - done() - }) + wrappedContract.sendMock('transferxxx', accounts[0].getId(), []).catch(() => { + done() + }) }) }) diff --git a/test/keeper/ContractEvent.test.ts b/test/keeper/ContractEvent.test.ts index 238015a..e858894 100644 --- a/test/keeper/ContractEvent.test.ts +++ b/test/keeper/ContractEvent.test.ts @@ -17,17 +17,12 @@ describe('ContractEvent', () => { eventHandler = new EventHandler((ocean as any).instanceConfig) account = (await ocean.accounts.list())[0].getId() - executeTransaction = () => - ocean.keeper.dispenser.requestTokens(10, account) + executeTransaction = () => ocean.keeper.dispenser.requestTokens(10, account) }) describe('#subscribe()', () => { it('should be able to listen to events', async () => { - const event = eventHandler.getEvent( - ocean.keeper.token, - 'Transfer', - { to: account } - ) + const event = eventHandler.getEvent(ocean.keeper.token, 'Transfer', { to: account }) let validResolve = false let subscription: ContractEventSubscription @@ -57,11 +52,7 @@ describe('ContractEvent', () => { describe('#once()', () => { it('should listen to event only once', async () => { const to = account - const event = eventHandler.getEvent( - ocean.keeper.token, - 'Transfer', - { to } - ) + const event = eventHandler.getEvent(ocean.keeper.token, 'Transfer', { to }) let canBeRejected = false const waitUntilEvent = new Promise((resolve, reject) => { @@ -85,11 +76,7 @@ describe('ContractEvent', () => { it('should get the event like a promise', async () => { const to = account - const event = eventHandler.getEvent( - ocean.keeper.token, - 'Transfer', - { to } - ) + const event = eventHandler.getEvent(ocean.keeper.token, 'Transfer', { to }) const waitUntilEvent = event.once() diff --git a/test/keeper/DIDRegistry.test.ts b/test/keeper/DIDRegistry.test.ts index cbfa7b0..d1a2e34 100644 --- a/test/keeper/DIDRegistry.test.ts +++ b/test/keeper/DIDRegistry.test.ts @@ -21,13 +21,7 @@ describe('DIDRegistry', () => { const ownerAccount: Account = (await ocean.accounts.list())[0] const did = generateId() const data = 'my nice provider, is nice' - const receipt = await didRegistry.registerAttribute( - did, - `0123456789abcdef`, - [], - data, - ownerAccount.getId() - ) + const receipt = await didRegistry.registerAttribute(did, `0123456789abcdef`, [], data, ownerAccount.getId()) assert(receipt.status) assert(receipt.events.DIDAttributeRegistered) }) @@ -38,13 +32,7 @@ describe('DIDRegistry', () => { { // register the first attribute const data = 'my nice provider, is nice' - await didRegistry.registerAttribute( - did, - '0123456789abcdef', - [], - data, - ownerAccount.getId() - ) + await didRegistry.registerAttribute(did, '0123456789abcdef', [], data, ownerAccount.getId()) } { // register the second attribute with the same did @@ -67,21 +55,11 @@ describe('DIDRegistry', () => { const ownerAccount: Account = (await ocean.accounts.list())[0] const did = generateId() const data = 'my nice provider, is nice' - await didRegistry.registerAttribute( - did, - '0123456789abcdef', - [], - data, - ownerAccount.getId() - ) + await didRegistry.registerAttribute(did, '0123456789abcdef', [], data, ownerAccount.getId()) const owner = await didRegistry.getDIDOwner(did) - assert.equal( - owner, - ownerAccount.getId(), - `Got ${owner} but expected ${ownerAccount.getId()}` - ) + assert.equal(owner, ownerAccount.getId(), `Got ${owner} but expected ${ownerAccount.getId()}`) }) it('should get 0x0 for a not registered did', async () => { diff --git a/test/keeper/EventHandler.test.ts b/test/keeper/EventHandler.test.ts index 47bc21a..c8c54e5 100644 --- a/test/keeper/EventHandler.test.ts +++ b/test/keeper/EventHandler.test.ts @@ -27,11 +27,7 @@ describe('EventHandler', () => { assert.isDefined(subscription) const countAfter = eventHandler.count - assert.equal( - countBefore + 1, - countAfter, - 'The event seems not added.' - ) + assert.equal(countBefore + 1, countAfter, 'The event seems not added.') subscription.unsubscribe() }) @@ -58,11 +54,7 @@ describe('EventHandler', () => { eventHandler.unsubscribe(callback) const countAfter = eventHandler.count - assert.equal( - countBefore, - countAfter, - 'The event seems not removed.' - ) + assert.equal(countBefore, countAfter, 'The event seems not removed.') }) }) diff --git a/test/keeper/TestContractHandler.ts b/test/keeper/TestContractHandler.ts index 46ded50..bc955d6 100644 --- a/test/keeper/TestContractHandler.ts +++ b/test/keeper/TestContractHandler.ts @@ -20,33 +20,23 @@ export default class TestContractHandler extends ContractHandler { Logger.log('Trying to deploy contracts') // Libraries - const epochLibrary = await TestContractHandler.deployContract( - 'EpochLibrary', - deployerAddress - ) - const didRegistryLibrary = await TestContractHandler.deployContract( - 'DIDRegistryLibrary', - deployerAddress - ) + const epochLibrary = await TestContractHandler.deployContract('EpochLibrary', deployerAddress) + const didRegistryLibrary = await TestContractHandler.deployContract('DIDRegistryLibrary', deployerAddress) // Contracts - const token = await TestContractHandler.deployContract( - 'OceanToken', + const token = await TestContractHandler.deployContract('OceanToken', deployerAddress, [ deployerAddress, - [deployerAddress, deployerAddress] - ) + deployerAddress + ]) - const dispenser = await TestContractHandler.deployContract( - 'Dispenser', - deployerAddress, - [token.options.address, deployerAddress] - ) + const dispenser = await TestContractHandler.deployContract('Dispenser', deployerAddress, [ + token.options.address, + deployerAddress + ]) // Add dispenser as Token minter if (!token.$initialized) { - await token.methods - .addMinter(dispenser.options.address) - .send({ from: deployerAddress }) + await token.methods.addMinter(dispenser.options.address).send({ from: deployerAddress }) } const didRegistry = await TestContractHandler.deployContract( @@ -59,11 +49,9 @@ export default class TestContractHandler extends ContractHandler { ) // Managers - const templateStoreManager = await TestContractHandler.deployContract( - 'TemplateStoreManager', - deployerAddress, - [deployerAddress] - ) + const templateStoreManager = await TestContractHandler.deployContract('TemplateStoreManager', deployerAddress, [ + deployerAddress + ]) const conditionStoreManager = await TestContractHandler.deployContract( 'ConditionStoreManager', deployerAddress, @@ -84,49 +72,33 @@ export default class TestContractHandler extends ContractHandler { ) // Conditions - const lockRewardCondition = await TestContractHandler.deployContract( - 'LockRewardCondition', + const lockRewardCondition = await TestContractHandler.deployContract('LockRewardCondition', deployerAddress, [ deployerAddress, - [ - deployerAddress, - conditionStoreManager.options.address, - token.options.address - ] - ) + conditionStoreManager.options.address, + token.options.address + ]) const accessSecretStoreCondition = await TestContractHandler.deployContract( 'AccessSecretStoreCondition', deployerAddress, - [ - deployerAddress, - conditionStoreManager.options.address, - agreementStoreManager.options.address - ] + [deployerAddress, conditionStoreManager.options.address, agreementStoreManager.options.address] ) // Conditions rewards - const escrowReward = await TestContractHandler.deployContract( - 'EscrowReward', + const escrowReward = await TestContractHandler.deployContract('EscrowReward', deployerAddress, [ deployerAddress, - [ - deployerAddress, - conditionStoreManager.options.address, - token.options.address - ] - ) + conditionStoreManager.options.address, + token.options.address + ]) // Templates - await TestContractHandler.deployContract( - 'EscrowAccessSecretStoreTemplate', + await TestContractHandler.deployContract('EscrowAccessSecretStoreTemplate', deployerAddress, [ deployerAddress, - [ - deployerAddress, - agreementStoreManager.options.address, - didRegistry.options.address, - accessSecretStoreCondition.options.address, - lockRewardCondition.options.address, - escrowReward.options.address - ] - ) + agreementStoreManager.options.address, + didRegistry.options.address, + accessSecretStoreCondition.options.address, + lockRewardCondition.options.address, + escrowReward.options.address + ]) } private static async deployContract( @@ -156,10 +128,7 @@ export default class TestContractHandler extends ContractHandler { gasPrice: 10000000000 } const artifact = require(`@oceanprotocol/keeper-contracts/artifacts/${name}.development.json`) - const tempContract = new web3.eth.Contract( - artifact.abi, - artifact.address - ) + const tempContract = new web3.eth.Contract(artifact.abi, artifact.address) const isZos = !!tempContract.methods.initialize Logger.debug({ @@ -176,42 +145,27 @@ export default class TestContractHandler extends ContractHandler { contractInstance = await tempContract .deploy({ - data: TestContractHandler.replaceTokens( - artifact.bytecode.toString(), - tokens - ), + data: TestContractHandler.replaceTokens(artifact.bytecode.toString(), tokens), arguments: isZos ? undefined : args }) .send(sendConfig) if (isZos) { - await contractInstance.methods - .initialize(...args) - .send(sendConfig) + await contractInstance.methods.initialize(...args).send(sendConfig) } contractInstance.testContract = true ContractHandler.setContract(name, where, contractInstance) // Logger.log("Deployed", name, "at", contractInstance.options.address); } catch (err) { - Logger.error( - 'Deployment failed for', - name, - 'with args', - JSON.stringify(args, null, 2), - err.message - ) + Logger.error('Deployment failed for', name, 'with args', JSON.stringify(args, null, 2), err.message) throw err } return contractInstance } - private static replaceTokens( - bytecode: string, - tokens: { [name: string]: string } - ): string { + private static replaceTokens(bytecode: string, tokens: { [name: string]: string }): string { return Object.entries(tokens).reduce( - (acc, [token, address]) => - acc.replace(new RegExp(`_+${token}_+`, 'g'), address.substr(2)), + (acc, [token, address]) => acc.replace(new RegExp(`_+${token}_+`, 'g'), address.substr(2)), bytecode ) } diff --git a/test/keeper/conditions/AccessSecretStoreCondition.test.ts b/test/keeper/conditions/AccessSecretStoreCondition.test.ts index 47040ab..dba04cb 100644 --- a/test/keeper/conditions/AccessSecretStoreCondition.test.ts +++ b/test/keeper/conditions/AccessSecretStoreCondition.test.ts @@ -13,8 +13,7 @@ describe('AccessSecretStoreCondition', () => { before(async () => { await TestContractHandler.prepareContracts() - condition = (await Ocean.getInstance(config)).keeper.conditions - .accessSecretStoreCondition + condition = (await Ocean.getInstance(config)).keeper.conditions.accessSecretStoreCondition }) describe('#hashValues()', () => { diff --git a/test/keeper/conditions/EscrowReward.test.ts b/test/keeper/conditions/EscrowReward.test.ts index 361b59c..5a6aaa1 100644 --- a/test/keeper/conditions/EscrowReward.test.ts +++ b/test/keeper/conditions/EscrowReward.test.ts @@ -21,27 +21,13 @@ describe('EscrowReward', () => { await TestContractHandler.prepareContracts() condition = keeper.conditions.escrowReward - lockCondition = await keeper.conditions.lockRewardCondition.generateIdHash( - agreementId, - publisher, - amount - ) - releaseCondition = await keeper.conditions.accessSecretStoreCondition.generateIdHash( - agreementId, - did, - consumer - ) + lockCondition = await keeper.conditions.lockRewardCondition.generateIdHash(agreementId, publisher, amount) + releaseCondition = await keeper.conditions.accessSecretStoreCondition.generateIdHash(agreementId, did, consumer) }) describe('#hashValues()', () => { it('should hash the values', async () => { - const hash = await condition.hashValues( - amount, - consumer, - publisher, - lockCondition, - releaseCondition - ) + const hash = await condition.hashValues(amount, consumer, publisher, lockCondition, releaseCondition) assert.match(hash, /^0x[a-f0-9]{64}$/i) }) @@ -49,13 +35,7 @@ describe('EscrowReward', () => { describe('#generateId()', () => { it('should generate an ID', async () => { - const hash = await condition.hashValues( - amount, - consumer, - publisher, - lockCondition, - releaseCondition - ) + const hash = await condition.hashValues(amount, consumer, publisher, lockCondition, releaseCondition) const id = await condition.generateId(agreementId, hash) assert.match(id, /^0x[a-f0-9]{64}$/i) diff --git a/test/keeper/conditions/LockRewardCondition.test.ts b/test/keeper/conditions/LockRewardCondition.test.ts index 6b70668..5c05261 100644 --- a/test/keeper/conditions/LockRewardCondition.test.ts +++ b/test/keeper/conditions/LockRewardCondition.test.ts @@ -13,8 +13,7 @@ describe('LockRewardCondition', () => { before(async () => { await TestContractHandler.prepareContracts() - condition = (await Ocean.getInstance(config)).keeper.conditions - .lockRewardCondition + condition = (await Ocean.getInstance(config)).keeper.conditions.lockRewardCondition }) describe('#hashValues()', () => { diff --git a/test/mocks/WebServiceConnector.mock.ts b/test/mocks/WebServiceConnector.mock.ts index 1a7ac55..e303b62 100644 --- a/test/mocks/WebServiceConnector.mock.ts +++ b/test/mocks/WebServiceConnector.mock.ts @@ -15,9 +15,7 @@ export default class WebServiceConnectorMock extends WebServiceConnector { return this.returnData ? this.returnData : {} }, text: () => { - return this.returnData - ? JSON.stringify(this.returnData.toString()) - : '' + return this.returnData ? JSON.stringify(this.returnData.toString()) : '' } }) }) diff --git a/test/ocean/Account.test.ts b/test/ocean/Account.test.ts index 031acd0..af45da9 100644 --- a/test/ocean/Account.test.ts +++ b/test/ocean/Account.test.ts @@ -39,10 +39,7 @@ describe('Account', () => { const balance = await account.getEtherBalance() const web3 = Web3Provider.getWeb3() - assert( - Number(web3.utils.toWei('100', 'ether')) === balance, - `ether did not match ${balance}` - ) + assert(Number(web3.utils.toWei('100', 'ether')) === balance, `ether did not match ${balance}`) }) }) @@ -52,10 +49,7 @@ describe('Account', () => { const balance = await account.getBalance() const web3 = Web3Provider.getWeb3() - assert( - Number(web3.utils.toWei('100', 'ether')) === balance.eth, - `ether did not match ${balance.eth}` - ) + assert(Number(web3.utils.toWei('100', 'ether')) === balance.eth, `ether did not match ${balance.eth}`) assert(balance.ocn === 0, `tokens did not match ${balance.ocn}`) }) }) diff --git a/test/ocean/OceanAuth.test.ts b/test/ocean/OceanAuth.test.ts index 5f07e78..3293038 100644 --- a/test/ocean/OceanAuth.test.ts +++ b/test/ocean/OceanAuth.test.ts @@ -54,11 +54,7 @@ describe('OceanAuth', () => { describe('#store()', () => { it('should sign and store the token', async () => { - const writeTokenSpy = spy.on( - oceanAuth as any, - 'writeToken', - () => {} - ) + const writeTokenSpy = spy.on(oceanAuth as any, 'writeToken', () => {}) await oceanAuth.store(account) diff --git a/test/ocean/OceanSecretStore.test.ts b/test/ocean/OceanSecretStore.test.ts index b6d02d7..fea4f58 100644 --- a/test/ocean/OceanSecretStore.test.ts +++ b/test/ocean/OceanSecretStore.test.ts @@ -27,17 +27,9 @@ describe('OceanSecretStore', () => { describe('#encrypt()', () => { it('should encrypt a content', async () => { - const secretStoreEncryptSpy = spy.on( - ocean.brizo, - 'encrypt', - () => 'encryptedResult' - ) + const secretStoreEncryptSpy = spy.on(ocean.brizo, 'encrypt', () => 'encryptedResult') - const result = await oceanSecretStore.encrypt( - did, - 'test', - accounts[0] - ) + const result = await oceanSecretStore.encrypt(did, 'test', accounts[0]) expect(secretStoreEncryptSpy).to.have.been.called.with(did, 'test') diff --git a/test/ocean/utils/SignatureUtils.test.ts b/test/ocean/utils/SignatureUtils.test.ts index 3751e36..1e6e699 100644 --- a/test/ocean/utils/SignatureUtils.test.ts +++ b/test/ocean/utils/SignatureUtils.test.ts @@ -38,33 +38,18 @@ describe('SignatureUtils', () => { }) it('should sign a text as expected using password', async () => { - const signed = await ocean.utils.signature.signText( - text, - publicKey, - 'test' - ) + const signed = await ocean.utils.signature.signText(text, publicKey, 'test') assert.equal(signed, signature) - expect(personalSignSpy).to.have.been.called.with( - text, - publicKey, - 'test' - ) + expect(personalSignSpy).to.have.been.called.with(text, publicKey, 'test') }) }) describe('#verifyText', () => { it('should recover the privateKey of a signed message', async () => { - const personalRecoverSpy = spy.on( - web3.eth.personal, - 'ecRecover', - () => publicKey - ) + const personalRecoverSpy = spy.on(web3.eth.personal, 'ecRecover', () => publicKey) - const verifiedPublicKey = await ocean.utils.signature.verifyText( - text, - signature - ) + const verifiedPublicKey = await ocean.utils.signature.verifyText(text, signature) assert.equal(publicKey, verifiedPublicKey) expect(personalRecoverSpy).to.have.been.called.with(text, signature) diff --git a/test/utils/ConversionTypeHelpers.test.ts b/test/utils/ConversionTypeHelpers.test.ts index 3fbf19b..423dc7b 100644 --- a/test/utils/ConversionTypeHelpers.test.ts +++ b/test/utils/ConversionTypeHelpers.test.ts @@ -1,10 +1,5 @@ import { assert } from 'chai' -import { - zeroX, - noZeroX, - didPrefixed, - noDidPrefixed -} from '../../src/utils/ConversionTypeHelpers' +import { zeroX, noZeroX, didPrefixed, noDidPrefixed } from '../../src/utils/ConversionTypeHelpers' describe('ConversionTypeHelpers', () => { describe('#zeroXTransformer()', () => { From e3a7c54c6a9adf9ee53fe494f3e6ef24626f6b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Guti=C3=A9rrez?= Date: Fri, 13 Sep 2019 13:38:23 +0200 Subject: [PATCH 13/56] Update DDO service schema. --- integration/ocean/AuthenticationToken.test.ts | 6 +++ integration/ocean/Signature.test.ts | 4 +- integration/ocean/Versions.test.ts | 3 +- package-lock.json | 43 ++++++------------- src/ddo/DDO.ts | 2 +- src/ddo/MetaData.ts | 3 +- src/ddo/Service.ts | 21 ++++++--- .../EscrowComputeExecutionTemplate.ts | 4 +- src/ocean/OceanAgreements.ts | 4 +- src/ocean/OceanAssets.ts | 23 ++++++---- src/ocean/OceanVersions.ts | 1 + src/ocean/utils/ServiceAgreement.ts | 2 +- 12 files changed, 62 insertions(+), 54 deletions(-) diff --git a/integration/ocean/AuthenticationToken.test.ts b/integration/ocean/AuthenticationToken.test.ts index c93d8ea..9c0f601 100644 --- a/integration/ocean/AuthenticationToken.test.ts +++ b/integration/ocean/AuthenticationToken.test.ts @@ -19,6 +19,12 @@ describe('Authentication Token', () => { ;[account1, account2] = await ocean.accounts.list() }) + after(async () => { + try { + localStorage.clear() + } catch {} + }) + it('should generate a token', async () => { const token = await ocean.auth.get(account1) diff --git a/integration/ocean/Signature.test.ts b/integration/ocean/Signature.test.ts index b83b6c4..a67fe1b 100644 --- a/integration/ocean/Signature.test.ts +++ b/integration/ocean/Signature.test.ts @@ -58,7 +58,9 @@ describe('Signature', () => { purchaseEndpoint: undefined, serviceEndpoint: undefined, templateId, - serviceAgreementTemplate + attributes: { + serviceAgreementTemplate + } } as any, { type: 'metadata', diff --git a/integration/ocean/Versions.test.ts b/integration/ocean/Versions.test.ts index 5021171..8b64c32 100644 --- a/integration/ocean/Versions.test.ts +++ b/integration/ocean/Versions.test.ts @@ -11,7 +11,8 @@ describe('Versions', () => { ocean = await Ocean.getInstance(config) }) - it('should return the versions', async () => { + // TODO: enable again after new versions of Brizo + xit('should return the versions', async () => { const versions = await ocean.versions.get() assert.equal(versions.aquarius.status, OceanPlatformTechStatus.Working) diff --git a/package-lock.json b/package-lock.json index ccec525..4937901 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5829,8 +5829,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -5851,14 +5850,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5873,20 +5870,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -6003,8 +5997,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -6016,7 +6009,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -6031,7 +6023,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -6039,14 +6030,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -6065,7 +6054,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -6146,8 +6134,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -6159,7 +6146,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -6245,8 +6231,7 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -6282,7 +6267,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -6302,7 +6286,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -6346,14 +6329,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, @@ -12534,7 +12515,7 @@ "requires": { "underscore": "1.9.1", "web3-core-helpers": "1.2.1", - "websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis" + "websocket": "github:web3-js/WebSocket-Node#905deb4812572b344f5801f8c9ce8bb02799d82e" } }, "web3-shh": { diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index a92e04b..ddf2551 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -66,7 +66,7 @@ export class DDO { * @return {Service} Service. */ public findServiceById(index: number): Service { - if (!index) { + if (isNaN(index)) { throw new Error('index is not set') } diff --git a/src/ddo/MetaData.ts b/src/ddo/MetaData.ts index fe192b0..57af3b7 100644 --- a/src/ddo/MetaData.ts +++ b/src/ddo/MetaData.ts @@ -203,8 +203,6 @@ export interface MetaDataMain { */ checksum?: string - encryptedFiles?: any - encryptedService?: any workflow?: Workflow @@ -339,6 +337,7 @@ export interface AdditionalInformation { export interface MetaData { main: MetaDataMain + encryptedFiles?: string additionalInformation?: AdditionalInformation curation?: Curation } diff --git a/src/ddo/Service.ts b/src/ddo/Service.ts index fcdb410..6942c3d 100644 --- a/src/ddo/Service.ts +++ b/src/ddo/Service.ts @@ -8,6 +8,9 @@ export interface ServiceCommon { type: ServiceType index: number serviceEndpoint?: string + attributes: any & { + main: { [key: string]: any } + } } export interface ServiceAuthorization extends ServiceCommon { @@ -22,12 +25,20 @@ export interface ServiceMetadata extends ServiceCommon { export interface ServiceAccess extends ServiceCommon { type: 'access' - name?: string - description?: string - creator?: string templateId?: string - purchaseEndpoint?: string - serviceAgreementTemplate?: ServiceAgreementTemplate + attributes: { + main: { + creator: string + name: string + datePublished: string + price: string + timeout: number + } + serviceAgreementTemplate?: ServiceAgreementTemplate + additionalInformation: { + description: string + } + } } export interface ServiceComputing extends ServiceCommon { diff --git a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts index 28c023e..e758d5c 100644 --- a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts +++ b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts @@ -18,7 +18,7 @@ export class EscrowComputeExecutionTemplate extends BaseEscrowTemplate { public async createAgreementFromDDO(agreementId: string, ddo: DDO, consumer: string, from?: string) { return !!(await this.createFullAgreement( ddo.shortId(), - ddo.findServiceByType('Metadata').metadata.base.price, + ddo.findServiceByType('metadata').attributes.main.price, consumer, from, agreementId @@ -33,7 +33,7 @@ export class EscrowComputeExecutionTemplate extends BaseEscrowTemplate { } = await this.createFullAgreementData( agreementId, ddo.shortId(), - ddo.findServiceByType('Metadata').metadata.base.price, + ddo.findServiceByType('metadata').attributes.main.price, consumer ) return [computeExecutionConditionId, lockRewardConditionId, escrowRewardId] diff --git a/src/ocean/OceanAgreements.ts b/src/ocean/OceanAgreements.ts index 1e91dbd..e028899 100644 --- a/src/ocean/OceanAgreements.ts +++ b/src/ocean/OceanAgreements.ts @@ -47,7 +47,7 @@ export class OceanAgreements extends Instantiable { const ddo = await this.ocean.aquarius.retrieveDDO(d) const agreementId: string = zeroX(generateId()) - const templateName = ddo.findServiceByType('access').serviceAgreementTemplate.contractName + const templateName = ddo.findServiceByType('access').attributes.serviceAgreementTemplate.contractName const agreementConditionsIds = await this.ocean.keeper .getTemplateByName(templateName) .getAgreementIdsFromDDO(agreementId, ddo, consumer.getId(), consumer.getId()) @@ -113,7 +113,7 @@ export class OceanAgreements extends Instantiable { const d: DID = DID.parse(did) const ddo = await this.ocean.aquarius.retrieveDDO(d) - const templateName = ddo.findServiceById<'access'>(index).serviceAgreementTemplate.contractName + const templateName = ddo.findServiceById<'access'>(index).attributes.serviceAgreementTemplate.contractName await this.ocean.keeper .getTemplateByName(templateName) .createAgreementFromDDO(agreementId, ddo, consumer.getId(), publisher.getId()) diff --git a/src/ocean/OceanAssets.ts b/src/ocean/OceanAssets.ts index 83df452..032d2a0 100644 --- a/src/ocean/OceanAssets.ts +++ b/src/ocean/OceanAssets.ts @@ -98,17 +98,24 @@ export class OceanAssets extends Instantiable { service: [ { type: 'access', - creator: '', - purchaseEndpoint: this.ocean.brizo.getPurchaseEndpoint(), serviceEndpoint: this.ocean.brizo.getConsumeEndpoint(), - name: 'dataAssetAccessServiceAgreement', templateId: templates.escrowAccessSecretStoreTemplate.getAddress(), - serviceAgreementTemplate + attributes: { + main: { + creator: publisher.getId(), + datePublished: metadata.main.datePublished, + name: 'dataAssetAccessServiceAgreement', + price: metadata.main.price, + timeout: 3600 + }, + serviceAgreementTemplate + } }, { type: 'authorization', service: 'SecretStore', - serviceEndpoint: secretStoreUri + serviceEndpoint: secretStoreUri, + attributes: { main: {} } }, { type: 'metadata', @@ -121,11 +128,11 @@ export class OceanAssets extends Instantiable { }, // Overwrites defaults ...metadata, + encryptedFiles, // Cleaning not needed information main: { ...metadata.main, contentUrls: undefined, - encryptedFiles, files: metadata.main.files.map((file, index) => ({ ...file, index, @@ -239,7 +246,7 @@ export class OceanAssets extends Instantiable { } else { const files = await this.ocean.secretStore.decrypt( did, - ddo.findServiceByType('metadata').attributes.main.encryptedFiles, + ddo.findServiceByType('metadata').attributes.encryptedFiles, consumerAccount, ddo.findServiceByType('authorization').serviceEndpoint ) @@ -272,7 +279,7 @@ export class OceanAssets extends Instantiable { const ddo = await this.resolve(did) const { keeper } = this.ocean - const templateName = ddo.findServiceByType('access').serviceAgreementTemplate.contractName + const templateName = ddo.findServiceByType('access').attributes.serviceAgreementTemplate.contractName const template = keeper.getTemplateByName(templateName) const accessCondition = keeper.conditions.accessSecretStoreCondition diff --git a/src/ocean/OceanVersions.ts b/src/ocean/OceanVersions.ts index 143e19d..9c1f048 100644 --- a/src/ocean/OceanVersions.ts +++ b/src/ocean/OceanVersions.ts @@ -133,6 +133,7 @@ export class OceanVersions extends Instantiable { return } if (address !== _) { + this.logger.warn(`Error on contract ${name}`) contractStatus = false } }) diff --git a/src/ocean/utils/ServiceAgreement.ts b/src/ocean/utils/ServiceAgreement.ts index e8d9a07..90c7985 100644 --- a/src/ocean/utils/ServiceAgreement.ts +++ b/src/ocean/utils/ServiceAgreement.ts @@ -84,7 +84,7 @@ export class ServiceAgreement extends Instantiable { } private getTimeValuesFromService(service: ServiceAccess, type: 'timeout' | 'timelock'): number[] { - const timeoutValues: number[] = service.serviceAgreementTemplate.conditions.map( + const timeoutValues: number[] = service.attributes.serviceAgreementTemplate.conditions.map( (condition: ServiceAgreementTemplateCondition) => condition[type] ) From 5f365c4df000f60e23e48cab2edd51c4afc50fb2 Mon Sep 17 00:00:00 2001 From: Aitor Date: Fri, 20 Sep 2019 11:41:03 +0200 Subject: [PATCH 14/56] using events-handler 0.1.2 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c1d64af..96c099c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,8 +21,8 @@ before_script: - ganache-cli --port 18545 > ganache-cli.log & - git clone https://github.com/oceanprotocol/barge - cd barge - - export AQUARIUS_VERSION=v0.4.1 - - export BRIZO_VERSION=v0.4.5 + - export AQUARIUS_VERSION=v0.4.2 + - export BRIZO_VERSION=v0.5.2 - export KEEPER_VERSION=v0.12.7 - export EVENTS_HANDLER_VERSION=v0.1.2 - export KEEPER_OWNER_ROLE_ADDRESS="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260" From b5cb17ef1bd39e354f2b9d846aec504ab7d88405 Mon Sep 17 00:00:00 2001 From: Aitor Date: Fri, 20 Sep 2019 11:50:20 +0200 Subject: [PATCH 15/56] events handler 0.2.0 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 96c099c..351c7c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_script: - export AQUARIUS_VERSION=v0.4.2 - export BRIZO_VERSION=v0.5.2 - export KEEPER_VERSION=v0.12.7 - - export EVENTS_HANDLER_VERSION=v0.1.2 + - export EVENTS_HANDLER_VERSION=v0.2.0 - 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 & From f30ae3e9196880b50f65dd3fba0e017be7456e24 Mon Sep 17 00:00:00 2001 From: Aitor Date: Fri, 20 Sep 2019 12:14:17 +0200 Subject: [PATCH 16/56] increasing iterations --- scripts/keeper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/keeper.sh b/scripts/keeper.sh index 779af73..2c56a03 100755 --- a/scripts/keeper.sh +++ b/scripts/keeper.sh @@ -9,7 +9,7 @@ printf '\n\e[33m◯ Waiting for contracts to be generated...\e[0m\n' mkdir -p artifacts -until [ $COMMAND_STATUS -eq 0 ] || [ $RETRY_COUNT -eq 120 ]; do +until [ $COMMAND_STATUS -eq 0 ] || [ $RETRY_COUNT -eq 240 ]; do keeper_contracts_docker_id=$(docker container ls | grep keeper-contracts | awk '{print $1}') docker cp "${keeper_contracts_docker_id}":/keeper-contracts/artifacts/ready ./artifacts/ > /dev/null 2>&1 COMMAND_STATUS=$? From 91784c4cdfa8185be647e7f8a9329e265efc169d Mon Sep 17 00:00:00 2001 From: Enrique Ruiz Date: Fri, 20 Sep 2019 12:48:17 +0200 Subject: [PATCH 17/56] Modify script to get the artifacts --- scripts/keeper.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/keeper.sh b/scripts/keeper.sh index 2c56a03..440bdfe 100755 --- a/scripts/keeper.sh +++ b/scripts/keeper.sh @@ -9,12 +9,12 @@ printf '\n\e[33m◯ Waiting for contracts to be generated...\e[0m\n' mkdir -p artifacts -until [ $COMMAND_STATUS -eq 0 ] || [ $RETRY_COUNT -eq 240 ]; do +until [ $COMMAND_STATUS -eq 0 ] || [ $RETRY_COUNT -eq 120 ]; do keeper_contracts_docker_id=$(docker container ls | grep keeper-contracts | awk '{print $1}') - docker cp "${keeper_contracts_docker_id}":/keeper-contracts/artifacts/ready ./artifacts/ > /dev/null 2>&1 + docker cp ${keeper_contracts_docker_id}:/keeper-contracts/artifacts/ready ./artifacts/ COMMAND_STATUS=$? sleep 5 - (( RETRY_COUNT=RETRY_COUNT+1 )) + let RETRY_COUNT=RETRY_COUNT+1 done printf '\e[32m✔ Found new contract artifacts.\e[0m\n' From fde779c4efbaf7e1c8dbf710d5c056bdf926c3b4 Mon Sep 17 00:00:00 2001 From: Enrique Ruiz Date: Fri, 20 Sep 2019 12:50:55 +0200 Subject: [PATCH 18/56] Update travis.yml --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 351c7c2..75954bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,12 @@ before_script: - rm -rf "${HOME}/.ocean/keeper-contracts/artifacts" - bash -x start_ocean.sh --no-commons --no-dashboard 2>&1 > start_ocean.log & - cd .. + - | + for i in $(seq 1 50); do + sleep 5 + [ -f "${HOME}/.ocean/keeper-contracts/artifacts/ready" ] && break + done + ls -la "${HOME}/.ocean/keeper-contracts/artifacts/" script: - npm run lint From e4afe9d737499c98ea6a7665021e7da5ff77a05f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Guti=C3=A9rrez?= Date: Tue, 24 Sep 2019 16:34:13 +0200 Subject: [PATCH 19/56] Release 1.0.0-beta.0 --- CHANGELOG.md | 20 +++++++++++++++++++- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05742b3..b54a9bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,22 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - added xDai [`#336`](https://github.com/oceanprotocol/squid-js/pull/336) +#### [v1.0.0-beta.0](https://github.com/oceanprotocol/squid-js/compare/v0.7.3...v1.0.0-beta.0) + +> 24 September 2019 + +- Update ora to the latest version 🚀 [`#318`](https://github.com/oceanprotocol/squid-js/pull/318) +- chore(package): update lockfile package-lock.json [`710e4d5`](https://github.com/oceanprotocol/squid-js/commit/710e4d52e6a1ab5c39e2f67b0072aa61ae1e0ca9) +- Update travis.yml [`a19911a`](https://github.com/oceanprotocol/squid-js/commit/a19911ad84d36b0eca0b5601b2210cd39549ddb6) +- Modify script to get the artifacts [`093ce43`](https://github.com/oceanprotocol/squid-js/commit/093ce43c0663481b97a6737925ce6290fab9fa6d) + #### [v0.8.2](https://github.com/oceanprotocol/squid-js/compare/v0.8.1...v0.8.2) > 7 November 2019 - hot fix: revert esModuleInterop [`#329`](https://github.com/oceanprotocol/squid-js/pull/329) +- chore(package): update lockfile package-lock.json [`710e4d5`](https://github.com/oceanprotocol/squid-js/commit/710e4d52e6a1ab5c39e2f67b0072aa61ae1e0ca9) +- Update travis.yml [`a19911a`](https://github.com/oceanprotocol/squid-js/commit/a19911ad84d36b0eca0b5601b2210cd39549ddb6) - revert esModuleInterop [`27f0734`](https://github.com/oceanprotocol/squid-js/commit/27f0734f226f705ba20bed119b3e61398cb36474) - Release 0.8.2 [`f595561`](https://github.com/oceanprotocol/squid-js/commit/f595561524abbf361ebe501108c2e558a836b6c5) @@ -166,13 +177,20 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Add integration test for Auth module. [`4d73eb8`](https://github.com/oceanprotocol/squid-js/commit/4d73eb869705a26bf8a04da7acaba220fbe9a83a) - Improve Config comments. [`23d4749`](https://github.com/oceanprotocol/squid-js/commit/23d4749b122f8aafddaacb6f1a2fada6db9b55ab) -#### [v0.5.14](https://github.com/oceanprotocol/squid-js/compare/v0.5.12...v0.5.14) +#### [v0.5.14](https://github.com/oceanprotocol/squid-js/compare/v0.5.13...v0.5.14) > 31 May 2019 - Report the asset creation progress. [`7d94cf2`](https://github.com/oceanprotocol/squid-js/commit/7d94cf2b6c299a2a26fd3179917b73bde6912380) +- Bump version 0.5.13 -> 0.5.14. [`325e339`](https://github.com/oceanprotocol/squid-js/commit/325e339b5615b3bdc6539b43c83f5c6a54c82688) + +#### [v0.5.13](https://github.com/oceanprotocol/squid-js/compare/v0.5.12...v0.5.13) + +> 31 May 2019 + - Change the type of the price of an asset to string. [`6fe8430`](https://github.com/oceanprotocol/squid-js/commit/6fe8430b0839b1c719473a14c56cc4eb8adad7c5) - Fix integration tests. [`172967c`](https://github.com/oceanprotocol/squid-js/commit/172967c35290f5843ffaa1ad1e3c872006f6faf9) +- Bump version 0.5.12 -> 0.5.13. [`8d16608`](https://github.com/oceanprotocol/squid-js/commit/8d166088c2f4eb9f0c500515dbb995e0a824d086) #### [v0.5.12](https://github.com/oceanprotocol/squid-js/compare/v0.5.11...v0.5.12) diff --git a/package-lock.json b/package-lock.json index 4937901..71b3793 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "0.8.3", + "version": "1.0.0-beta.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c41cc1d..0d914dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "0.8.3", + "version": "1.0.0-beta.0", "description": "JavaScript client library for Ocean Protocol", "main": "./dist/node/squid.js", "typings": "./dist/node/squid.d.ts", From 476a624e8934a3c2fd66ff9f789707f0053c9c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Guti=C3=A9rrez?= Date: Thu, 26 Sep 2019 14:59:05 +0200 Subject: [PATCH 20/56] Add integration test about adding permissions on DIDRegistry. --- integration/ocean/AssetOwners.test.ts | 10 ++++++++++ src/keeper/contracts/DIDRegistry.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/integration/ocean/AssetOwners.test.ts b/integration/ocean/AssetOwners.test.ts index dbdd624..1eea73a 100644 --- a/integration/ocean/AssetOwners.test.ts +++ b/integration/ocean/AssetOwners.test.ts @@ -37,6 +37,16 @@ describe('Asset Owners', () => { assert.isTrue(isProvider) }) + it('should be added correctly a permission on an asset', async () => { + const ddo = await ocean.assets.create(metadata as any, account1) + + assert.isFalse(await ocean.keeper.didRegistry.getPermission(ddo.id, account2.getId())) + + await ocean.keeper.didRegistry.grantPermission(ddo.id, account2.getId(), account1.getId()) + + assert.isTrue(await ocean.keeper.didRegistry.getPermission(ddo.id, account2.getId())) + }) + it('should get the assets owned by a user', async () => { const { length: initialLength } = await ocean.assets.ownerAssets(account2.getId()) diff --git a/src/keeper/contracts/DIDRegistry.ts b/src/keeper/contracts/DIDRegistry.ts index 90e6883..13f29e1 100644 --- a/src/keeper/contracts/DIDRegistry.ts +++ b/src/keeper/contracts/DIDRegistry.ts @@ -50,7 +50,7 @@ export default class DIDRegistry extends ContractBase { } public async grantPermission(did: string, grantee: string, ownerAddress: string) { - return this.send('grantPermission', ownerAddress, [zeroX(did), zeroX(grantee)]) + return this.send('grantPermission', ownerAddress, [didZeroX(did), zeroX(grantee)]) } public async revokePermission(did: string, grantee: string, ownerAddress: string) { From 5617af28918cc7e777bb3d0ba45e99f89c7adecf Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 7 Nov 2019 11:59:09 +0100 Subject: [PATCH 21/56] run against all latest v2 components --- .travis.yml | 10 +---- library.json | 6 +-- package-lock.json | 96 ++++++++++++++++++++++++++++------------------- package.json | 10 ++--- 4 files changed, 68 insertions(+), 54 deletions(-) diff --git a/.travis.yml b/.travis.yml index 75954bf..e7186d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,19 +22,13 @@ before_script: - git clone https://github.com/oceanprotocol/barge - cd barge - export AQUARIUS_VERSION=v0.4.2 - - export BRIZO_VERSION=v0.5.2 + - export BRIZO_VERSION=v0.6.0 - export KEEPER_VERSION=v0.12.7 - - export EVENTS_HANDLER_VERSION=v0.2.0 + - export EVENTS_HANDLER_VERSION=v0.3.0 - 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 & - cd .. - - | - for i in $(seq 1 50); do - sleep 5 - [ -f "${HOME}/.ocean/keeper-contracts/artifacts/ready" ] && break - done - ls -la "${HOME}/.ocean/keeper-contracts/artifacts/" script: - npm run lint diff --git a/library.json b/library.json index 8693fee..8565812 100644 --- a/library.json +++ b/library.json @@ -11,15 +11,15 @@ }, { "name": "brizo", - "version": "~0.4.5" + "version": "~0.6.0" }, { "name": "aquarius", - "version": "~0.4.1" + "version": "~0.4.2" }, { "name": "events-handler", - "version": "~0.1.2" + "version": "~0.3.0" } ] } diff --git a/package-lock.json b/package-lock.json index 71b3793..4557499 100644 --- a/package-lock.json +++ b/package-lock.json @@ -723,9 +723,9 @@ "dev": true }, "@types/node": { - "version": "12.12.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.5.tgz", - "integrity": "sha512-KEjODidV4XYUlJBF3XdjSH5FWoMCtO0utnhtdLf1AgeuZLOrRbvmU/gaRCVg7ZaQDjVf3l84egiY0mRNe5xE4A==", + "version": "12.12.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.6.tgz", + "integrity": "sha512-FjsYUPzEJdGXjwKqSpE0/9QEh6kzhTAeObA54rn6j3rR4C/mzpI9L0KNfoeASSPMMdxIsoJuCLDWcM/rVjIsSA==", "dev": true }, "@types/node-fetch": { @@ -738,12 +738,12 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.6.0.tgz", - "integrity": "sha512-iCcXREU4RciLmLniwKLRPCOFVXrkF7z27XuHq5DrykpREv/mz6ztKAyLg2fdkM0hQC7659p5ZF5uStH7uzAJ/w==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.6.1.tgz", + "integrity": "sha512-Z0rddsGqioKbvqfohg7BwkFC3PuNLsB+GE9QkFza7tiDzuHoy0y823Y+oGNDzxNZrYyLjqkZtCTl4vCqOmEN4g==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "2.6.0", + "@typescript-eslint/experimental-utils": "2.6.1", "eslint-utils": "^1.4.2", "functional-red-black-tree": "^1.0.1", "regexpp": "^2.0.1", @@ -751,25 +751,25 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.6.0.tgz", - "integrity": "sha512-34BAFpNOwHXeqT+AvdalLxOvcPYnCxA5JGmBAFL64RGMdP0u65rXjii7l/nwpgk5aLEE1LaqF+SsCU0/Cb64xA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.6.1.tgz", + "integrity": "sha512-EVrrUhl5yBt7fC7c62lWmriq4MIc49zpN3JmrKqfiFXPXCM5ErfEcZYfKOhZXkW6MBjFcJ5kGZqu1b+lyyExUw==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.6.0", + "@typescript-eslint/typescript-estree": "2.6.1", "eslint-scope": "^5.0.0" } }, "@typescript-eslint/parser": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.6.0.tgz", - "integrity": "sha512-AvLejMmkcjRTJ2KD72v565W4slSrrzUIzkReu1JN34b8JnsEsxx7S9Xx/qXEuMQas0mkdUfETr0j3zOhq2DIqQ==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.6.1.tgz", + "integrity": "sha512-PDPkUkZ4c7yA+FWqigjwf3ngPUgoLaGjMlFh6TRtbjhqxFBnkElDfckSjm98q9cMr4xRzZ15VrS/xKm6QHYf0w==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.6.0", - "@typescript-eslint/typescript-estree": "2.6.0", + "@typescript-eslint/experimental-utils": "2.6.1", + "@typescript-eslint/typescript-estree": "2.6.1", "eslint-visitor-keys": "^1.1.0" }, "dependencies": { @@ -782,16 +782,17 @@ } }, "@typescript-eslint/typescript-estree": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.6.0.tgz", - "integrity": "sha512-A3lSBVIdj2Gp0lFEL6in2eSPqJ33uAc3Ko+Y4brhjkxzjbzLnwBH22CwsW2sCo+iwogfIyvb56/AJri15H0u5Q==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.6.1.tgz", + "integrity": "sha512-+sTnssW6bcbDZKE8Ce7VV6LdzkQz2Bxk7jzk1J8H1rovoTxnm6iXvYIyncvNsaB/kBCOM63j/LNJfm27bNdUoA==", "dev": true, "requires": { "debug": "^4.1.1", "glob": "^7.1.4", "is-glob": "^4.0.1", "lodash.unescape": "4.0.1", - "semver": "^6.3.0" + "semver": "^6.3.0", + "tsutils": "^3.17.1" }, "dependencies": { "debug": { @@ -5829,7 +5830,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -5850,12 +5852,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5870,17 +5874,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -5997,7 +6004,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -6009,6 +6017,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -6023,6 +6032,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -6030,12 +6040,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -6054,6 +6066,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -6134,7 +6147,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -6146,6 +6160,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -6231,7 +6246,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -6267,6 +6283,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -6286,6 +6303,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -6329,12 +6347,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -8683,9 +8703,9 @@ "integrity": "sha512-w22rOL5ZYu6HbUehB5deurghGM0hS/xBVyHMGKOuQctkk93J9z9VEOhDsiWrXOprVNQpP9uzGKdl8v9mFspKuw==" }, "mock-local-storage": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/mock-local-storage/-/mock-local-storage-1.1.8.tgz", - "integrity": "sha512-x/LPtSBqSROQGjJn60Fp0+rgOHZuuQZysgeSYfhG2l/moD0LLW60bKi4KpmCnNs9S3l0cbS5cmzQFzeKDL7RaQ==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/mock-local-storage/-/mock-local-storage-1.1.10.tgz", + "integrity": "sha512-k/eauqgWiUeVOE80uioaTJmF2O41EYxZcac2OYbEvz1q1smCykYitKr0cqFbJmtIUSxGhh38cHjKtNCvpsR7Sw==", "dev": true, "requires": { "core-js": "^0.8.3", @@ -11780,9 +11800,9 @@ } }, "typescript": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.4.tgz", - "integrity": "sha512-unoCll1+l+YK4i4F8f22TaNVPRHcD9PA3yCuZ8g5e0qGqlVlJ/8FSateOLLSagn+Yg5+ZwuPkL8LFUc0Jcvksg==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.2.tgz", + "integrity": "sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ==", "dev": true }, "uglify-js": { @@ -12515,7 +12535,7 @@ "requires": { "underscore": "1.9.1", "web3-core-helpers": "1.2.1", - "websocket": "github:web3-js/WebSocket-Node#905deb4812572b344f5801f8c9ce8bb02799d82e" + "websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis" } }, "web3-shh": { diff --git a/package.json b/package.json index 0d914dc..9a7ad74 100644 --- a/package.json +++ b/package.json @@ -68,10 +68,10 @@ "@types/chai": "^4.2.4", "@types/chai-spies": "^1.0.1", "@types/mocha": "^5.2.7", - "@types/node": "^12.12.5", + "@types/node": "^12.12.6", "@types/node-fetch": "^2.5.3", - "@typescript-eslint/eslint-plugin": "^2.6.0", - "@typescript-eslint/parser": "^2.6.0", + "@typescript-eslint/eslint-plugin": "^2.6.1", + "@typescript-eslint/parser": "^2.6.1", "auto-changelog": "^1.16.2", "chai": "^4.2.0", "chai-spies": "^1.0.0", @@ -82,14 +82,14 @@ "eslint-plugin-prettier": "^3.1.1", "lcov-result-merger": "^3.1.0", "mocha": "^6.2.2", - "mock-local-storage": "^1.1.8", + "mock-local-storage": "^1.1.10", "nyc": "^14.1.1", "ora": "^4.0.2", "prettier": "^1.18.2", "source-map-support": "^0.5.16", "ts-node": "^8.4.1", "typedoc": "^0.15.0", - "typescript": "^3.6.4", + "typescript": "^3.7.2", "uglifyjs-webpack-plugin": "^2.2.0", "webpack": "^4.41.2", "webpack-cli": "^3.3.10", From a06adcca1e18406ea7f24ac23d65c59382aa7990 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 7 Nov 2019 13:12:54 +0100 Subject: [PATCH 22/56] keeper script tweaks --- scripts/keeper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/keeper.sh b/scripts/keeper.sh index 440bdfe..9d14fdf 100755 --- a/scripts/keeper.sh +++ b/scripts/keeper.sh @@ -11,10 +11,10 @@ mkdir -p artifacts until [ $COMMAND_STATUS -eq 0 ] || [ $RETRY_COUNT -eq 120 ]; do keeper_contracts_docker_id=$(docker container ls | grep keeper-contracts | awk '{print $1}') - docker cp ${keeper_contracts_docker_id}:/keeper-contracts/artifacts/ready ./artifacts/ + docker cp ${keeper_contracts_docker_id}:/keeper-contracts/artifacts/ready ./artifacts/ > /dev/null 2>&1 COMMAND_STATUS=$? sleep 5 - let RETRY_COUNT=RETRY_COUNT+1 + (( RETRY_COUNT=RETRY_COUNT+1 )) done printf '\e[32m✔ Found new contract artifacts.\e[0m\n' From afbea6372e461e4d6535fa4d5d6b63297f329b9b Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 7 Nov 2019 16:29:59 +0100 Subject: [PATCH 23/56] Release 1.0.0-beta.1 --- CHANGELOG.md | 22 ++++++---------------- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b54a9bb..e9219ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,22 +10,19 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - added xDai [`#336`](https://github.com/oceanprotocol/squid-js/pull/336) -#### [v1.0.0-beta.0](https://github.com/oceanprotocol/squid-js/compare/v0.7.3...v1.0.0-beta.0) +#### [v1.0.0-beta.1](https://github.com/oceanprotocol/squid-js/compare/v0.8.2...v1.0.0-beta.1) -> 24 September 2019 +> 7 November 2019 -- Update ora to the latest version 🚀 [`#318`](https://github.com/oceanprotocol/squid-js/pull/318) -- chore(package): update lockfile package-lock.json [`710e4d5`](https://github.com/oceanprotocol/squid-js/commit/710e4d52e6a1ab5c39e2f67b0072aa61ae1e0ca9) -- Update travis.yml [`a19911a`](https://github.com/oceanprotocol/squid-js/commit/a19911ad84d36b0eca0b5601b2210cd39549ddb6) -- Modify script to get the artifacts [`093ce43`](https://github.com/oceanprotocol/squid-js/commit/093ce43c0663481b97a6737925ce6290fab9fa6d) +- Change linter config. [`1a2b5cf`](https://github.com/oceanprotocol/squid-js/commit/1a2b5cfa1661978ae2b36e73e2a9ab9dcefc8a94) +- update metadata to OEP-8 v0.4 [`b1adbf0`](https://github.com/oceanprotocol/squid-js/commit/b1adbf0c8a358718269e5c08defb7db8c0d63484) +- Add EscrowComputeExecutionTemplate. [`7d90b75`](https://github.com/oceanprotocol/squid-js/commit/7d90b75408b679dcffa5d089c243e2963ccb2bd1) #### [v0.8.2](https://github.com/oceanprotocol/squid-js/compare/v0.8.1...v0.8.2) > 7 November 2019 - hot fix: revert esModuleInterop [`#329`](https://github.com/oceanprotocol/squid-js/pull/329) -- chore(package): update lockfile package-lock.json [`710e4d5`](https://github.com/oceanprotocol/squid-js/commit/710e4d52e6a1ab5c39e2f67b0072aa61ae1e0ca9) -- Update travis.yml [`a19911a`](https://github.com/oceanprotocol/squid-js/commit/a19911ad84d36b0eca0b5601b2210cd39549ddb6) - revert esModuleInterop [`27f0734`](https://github.com/oceanprotocol/squid-js/commit/27f0734f226f705ba20bed119b3e61398cb36474) - Release 0.8.2 [`f595561`](https://github.com/oceanprotocol/squid-js/commit/f595561524abbf361ebe501108c2e558a836b6c5) @@ -177,20 +174,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Add integration test for Auth module. [`4d73eb8`](https://github.com/oceanprotocol/squid-js/commit/4d73eb869705a26bf8a04da7acaba220fbe9a83a) - Improve Config comments. [`23d4749`](https://github.com/oceanprotocol/squid-js/commit/23d4749b122f8aafddaacb6f1a2fada6db9b55ab) -#### [v0.5.14](https://github.com/oceanprotocol/squid-js/compare/v0.5.13...v0.5.14) +#### [v0.5.14](https://github.com/oceanprotocol/squid-js/compare/v0.5.12...v0.5.14) > 31 May 2019 - Report the asset creation progress. [`7d94cf2`](https://github.com/oceanprotocol/squid-js/commit/7d94cf2b6c299a2a26fd3179917b73bde6912380) -- Bump version 0.5.13 -> 0.5.14. [`325e339`](https://github.com/oceanprotocol/squid-js/commit/325e339b5615b3bdc6539b43c83f5c6a54c82688) - -#### [v0.5.13](https://github.com/oceanprotocol/squid-js/compare/v0.5.12...v0.5.13) - -> 31 May 2019 - - Change the type of the price of an asset to string. [`6fe8430`](https://github.com/oceanprotocol/squid-js/commit/6fe8430b0839b1c719473a14c56cc4eb8adad7c5) - Fix integration tests. [`172967c`](https://github.com/oceanprotocol/squid-js/commit/172967c35290f5843ffaa1ad1e3c872006f6faf9) -- Bump version 0.5.12 -> 0.5.13. [`8d16608`](https://github.com/oceanprotocol/squid-js/commit/8d166088c2f4eb9f0c500515dbb995e0a824d086) #### [v0.5.12](https://github.com/oceanprotocol/squid-js/compare/v0.5.11...v0.5.12) diff --git a/package-lock.json b/package-lock.json index 4557499..0c64517 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0-beta.0", + "version": "1.0.0-beta.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9a7ad74..b0661ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0-beta.0", + "version": "1.0.0-beta.1", "description": "JavaScript client library for Ocean Protocol", "main": "./dist/node/squid.js", "typings": "./dist/node/squid.d.ts", From 6706b099074faf5fbf53ec05dec0d42db6e2e5f9 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 12 Nov 2019 12:47:21 +0100 Subject: [PATCH 24/56] test against Aquarius v1.0.0 --- .travis.yml | 2 +- library.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e7186d1..ef93bf5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ before_script: - ganache-cli --port 18545 > ganache-cli.log & - git clone https://github.com/oceanprotocol/barge - cd barge - - export AQUARIUS_VERSION=v0.4.2 + - export AQUARIUS_VERSION=v1.0.0 - export BRIZO_VERSION=v0.6.0 - export KEEPER_VERSION=v0.12.7 - export EVENTS_HANDLER_VERSION=v0.3.0 diff --git a/library.json b/library.json index 8565812..20183b5 100644 --- a/library.json +++ b/library.json @@ -15,7 +15,7 @@ }, { "name": "aquarius", - "version": "~0.4.2" + "version": "~1.0.0" }, { "name": "events-handler", From 1091665b1758075f0cbc9db2894d14d018369495 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 12 Nov 2019 13:01:44 +0100 Subject: [PATCH 25/56] wait for ocean/Aquarius before running unit tests --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ef93bf5..8221c45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,10 +32,10 @@ before_script: script: - npm run lint + - ./scripts/keeper.sh - export ETH_PORT=18545; npm run test:cover - npm run build - npm run doc - - ./scripts/keeper.sh - npm run integration:cover - npm run report-coverage From b9b63dabe9e03e0640563dca3a3d9191f08d8005 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 12 Nov 2019 13:24:36 +0100 Subject: [PATCH 26/56] DDO updates, contentLength as string --- src/ddo/MetaData.ts | 24 +++++++++--------------- test/ddo/DDO.test.ts | 4 ++-- test/testdata/ddo.json | 6 ++---- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/ddo/MetaData.ts b/src/ddo/MetaData.ts index 57af3b7..6a40258 100644 --- a/src/ddo/MetaData.ts +++ b/src/ddo/MetaData.ts @@ -84,7 +84,14 @@ export interface File { * File index. * @type {number} */ - index?: number + index: number + + /** + * File format, if applicable. + * @type {string} + * @example "text/csv" + */ + contentType: string /** * File checksum. @@ -102,7 +109,7 @@ export interface File { * File content length. * @type {[type]} */ - contentLength?: number + contentLength?: string /** * Resource ID (depending on the source). @@ -123,13 +130,6 @@ export interface File { * @example "zip" */ compression?: string - - /** - * File format, if applicable. - * @type {string} - * @example "text/csv" - */ - contentType?: string } /** @@ -197,12 +197,6 @@ export interface MetaDataMain { */ files: File[] - /** - * SHA3 hash of concatenated values: [list of all file checksums] + name + author + license + did - * @type {string} - */ - checksum?: string - encryptedService?: any workflow?: Workflow diff --git a/test/ddo/DDO.test.ts b/test/ddo/DDO.test.ts index 5b8ae3f..f4a0b31 100644 --- a/test/ddo/DDO.test.ts +++ b/test/ddo/DDO.test.ts @@ -101,14 +101,14 @@ describe('DDO', () => { { index: 0, checksum: 'efb2c764274b745f5fc37f97c6b0e761', - contentLength: 4535431, + contentLength: '4535431', contentType: 'application/json', resourceId: 'access-log2018-02-13-15-17-29-18386C502CAEA932' }, { index: 1, checksum: '085340abffh21495345af97c6b0e761', - contentLength: 12324, + contentLength: '12324', contentType: 'application/json' }, { diff --git a/test/testdata/ddo.json b/test/testdata/ddo.json index 2e75886..e8b6a2e 100644 --- a/test/testdata/ddo.json +++ b/test/testdata/ddo.json @@ -166,7 +166,7 @@ "index": 0, "url": "https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip", "checksum": "085340abffh21495345af97c6b0e761", - "contentLength": 12324 + "contentLength": "12324" }, { "url": "https://testocnfiles.blob.core.windows.net/testfiles/testzkp2.zip" @@ -182,9 +182,7 @@ "description": "Weather information of UK including temperature and humidity", "copyrightHolder": "Met Office", "workExample": "423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68", - "contentUrls": [ - "https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip" - ], + "contentUrls": ["https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip"], "links": [ { "name": "Sample of Asset Data", From 75a0de1b2c00f7cf67565fe15b17dceb0c3cd691 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 12 Nov 2019 14:21:29 +0100 Subject: [PATCH 27/56] remove ddo.addChecksum --- integration/ocean/ConsumeBigAsset.test.ts | 6 +----- src/ddo/DDO.ts | 15 +-------------- src/ocean/OceanAssets.ts | 1 - test/ddo/DDO.test.ts | 5 ++--- 4 files changed, 4 insertions(+), 23 deletions(-) diff --git a/integration/ocean/ConsumeBigAsset.test.ts b/integration/ocean/ConsumeBigAsset.test.ts index 3c33bd7..f82a7f5 100644 --- a/integration/ocean/ConsumeBigAsset.test.ts +++ b/integration/ocean/ConsumeBigAsset.test.ts @@ -32,11 +32,7 @@ xdescribe('Consume Asset (Large size)', () => { ...baseMetadata, main: { ...baseMetadata.main, - files: [ - { - url: 'https://speed.hetzner.de/1GB.bin' - } - ] + files: [{ index: 0, contentType: 'hello/hello', url: 'https://speed.hetzner.de/1GB.bin' }] } } }) diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index ddf2551..4f91528 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -1,6 +1,5 @@ import * as Web3 from 'web3' import Web3Provider from '../keeper/Web3Provider' -import LoggerInstance from '../utils/Logger' import { Ocean } from '../ocean/Ocean' import { Authentication } from './Authentication' import { Proof } from './Proof' @@ -129,23 +128,11 @@ export class DDO { } } - /** - * Generated and adds the checksum. - */ - public addChecksum(): void { - const metadataService = this.findServiceByType('metadata') - if (metadataService.attributes.main.checksum) { - LoggerInstance.log('Checksum already exists') - return - } - metadataService.attributes.main.checksum = this.getChecksum() - } - /** * Generates and adds a proof using personal sing on the DDO. * @param {Web3} web3 Web3 instance. * @param {string} publicKey Public key to be used on personal sign. - * @param {string} password Password if it's requirted. + * @param {string} password Password if it's required. * @return {Promise} Proof object. */ public async addProof(web3: Web3, publicKey: string, password?: string): Promise { diff --git a/src/ocean/OceanAssets.ts b/src/ocean/OceanAssets.ts index 032d2a0..c366700 100644 --- a/src/ocean/OceanAssets.ts +++ b/src/ocean/OceanAssets.ts @@ -159,7 +159,6 @@ export class OceanAssets extends Instantiable { const conditions = fillConditionsWithDDO(rawConditions, ddo) serviceAgreementTemplate.conditions = conditions - ddo.addChecksum() this.logger.log('Generating proof') observer.next(CreateProgressStep.GeneratingProof) await ddo.addProof(this.ocean, publisher.getId(), publisher.getPassword()) diff --git a/test/ddo/DDO.test.ts b/test/ddo/DDO.test.ts index f4a0b31..2e1a0b7 100644 --- a/test/ddo/DDO.test.ts +++ b/test/ddo/DDO.test.ts @@ -96,7 +96,7 @@ describe('DDO', () => { datePublished: '2012-10-10T17:00:000Z', author: 'Met Office', license: 'CC-BY', - price: 10, + price: '10', files: [ { index: 0, @@ -115,8 +115,7 @@ describe('DDO', () => { index: 2, contentType: '' } - ], - checksum: '' + ] }, curation: { rating: 0.93, From 5a49cf01f97996f4c039fb46d0ea0ac191b45999 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 12 Nov 2019 14:30:15 +0100 Subject: [PATCH 28/56] remove legacy contentUrls for good --- src/ocean/OceanAssets.ts | 5 ++--- test/testdata/ddo.json | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ocean/OceanAssets.ts b/src/ocean/OceanAssets.ts index c366700..18a989a 100644 --- a/src/ocean/OceanAssets.ts +++ b/src/ocean/OceanAssets.ts @@ -132,7 +132,6 @@ export class OceanAssets extends Instantiable { // Cleaning not needed information main: { ...metadata.main, - contentUrls: undefined, files: metadata.main.files.map((file, index) => ({ ...file, index, @@ -352,7 +351,7 @@ export class OceanAssets extends Instantiable { * @param {string} owner Owner address. * @return {Promise} List of DIDs. */ - public async ownerAssets(owner: string) { + public async ownerAssets(owner: string): Promise { return this.ocean.keeper.didRegistry.getAttributesByOwner(owner) } @@ -361,7 +360,7 @@ export class OceanAssets extends Instantiable { * @param {string} consumer Consumer address. * @return {Promise} List of DIDs. */ - public async consumerAssets(consumer: string) { + public async consumerAssets(consumer: string): Promise { return (await this.ocean.keeper.conditions.accessSecretStoreCondition.getGrantedDidByConsumer(consumer)).map( ({ did }) => did ) diff --git a/test/testdata/ddo.json b/test/testdata/ddo.json index e8b6a2e..8cffe79 100644 --- a/test/testdata/ddo.json +++ b/test/testdata/ddo.json @@ -182,7 +182,6 @@ "description": "Weather information of UK including temperature and humidity", "copyrightHolder": "Met Office", "workExample": "423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68", - "contentUrls": ["https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip"], "links": [ { "name": "Sample of Asset Data", From 3cc93c8afec9b184d1e0da0a700cffe5a8ba78d0 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 12 Nov 2019 16:22:40 +0100 Subject: [PATCH 29/56] Release 1.0.0-beta.2 --- CHANGELOG.md | 8 ++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9219ae..f32c205 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,14 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - added xDai [`#336`](https://github.com/oceanprotocol/squid-js/pull/336) +#### [v1.0.0-beta.2](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.1...v1.0.0-beta.2) + +> 12 November 2019 + +- DDO updates, contentLength as string [`ae62a49`](https://github.com/oceanprotocol/squid-js/commit/ae62a49902aa71fbfdfb69180ee4467fab68930a) +- remove ddo.addChecksum [`e2e95c4`](https://github.com/oceanprotocol/squid-js/commit/e2e95c469c1c0738fee01722ce8967c08aacde82) +- remove legacy contentUrls for good [`1162609`](https://github.com/oceanprotocol/squid-js/commit/11626093b8a60af65535b9bf59fd895fe7548544) + #### [v1.0.0-beta.1](https://github.com/oceanprotocol/squid-js/compare/v0.8.2...v1.0.0-beta.1) > 7 November 2019 diff --git a/package-lock.json b/package-lock.json index 0c64517..dc97f3a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0-beta.1", + "version": "1.0.0-beta.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b0661ee..0fd674f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0-beta.1", + "version": "1.0.0-beta.2", "description": "JavaScript client library for Ocean Protocol", "main": "./dist/node/squid.js", "typings": "./dist/node/squid.d.ts", From bd1b0d16d0a8a998608e2f7d72f9b8ee07fa662d Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 12 Nov 2019 16:35:42 +0100 Subject: [PATCH 30/56] file.index typing fix --- src/ddo/MetaData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ddo/MetaData.ts b/src/ddo/MetaData.ts index 6a40258..f16bae6 100644 --- a/src/ddo/MetaData.ts +++ b/src/ddo/MetaData.ts @@ -84,7 +84,7 @@ export interface File { * File index. * @type {number} */ - index: number + index?: number /** * File format, if applicable. From 7975f07670d03066e7d08445a97e730c725c5019 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 12 Nov 2019 16:42:25 +0100 Subject: [PATCH 31/56] Release 1.0.0-beta.3 --- CHANGELOG.md | 8 +++++++- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f32c205..8b70fce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,13 +10,19 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - added xDai [`#336`](https://github.com/oceanprotocol/squid-js/pull/336) +#### [v1.0.0-beta.3](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.2...v1.0.0-beta.3) + +> 12 November 2019 + +- file.index typing fix [`22b0ecb`](https://github.com/oceanprotocol/squid-js/commit/22b0ecb33c580b2b00a08b212cc1fac46c1e39ad) + #### [v1.0.0-beta.2](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.1...v1.0.0-beta.2) > 12 November 2019 - DDO updates, contentLength as string [`ae62a49`](https://github.com/oceanprotocol/squid-js/commit/ae62a49902aa71fbfdfb69180ee4467fab68930a) - remove ddo.addChecksum [`e2e95c4`](https://github.com/oceanprotocol/squid-js/commit/e2e95c469c1c0738fee01722ce8967c08aacde82) -- remove legacy contentUrls for good [`1162609`](https://github.com/oceanprotocol/squid-js/commit/11626093b8a60af65535b9bf59fd895fe7548544) +- Release 1.0.0-beta.2 [`dafb5c4`](https://github.com/oceanprotocol/squid-js/commit/dafb5c491ab61a06760e46504bc26cd7b49e0ad2) #### [v1.0.0-beta.1](https://github.com/oceanprotocol/squid-js/compare/v0.8.2...v1.0.0-beta.1) diff --git a/package-lock.json b/package-lock.json index dc97f3a..424f271 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0-beta.2", + "version": "1.0.0-beta.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0fd674f..d964941 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0-beta.2", + "version": "1.0.0-beta.3", "description": "JavaScript client library for Ocean Protocol", "main": "./dist/node/squid.js", "typings": "./dist/node/squid.d.ts", From f3df816e89661ba6e9f82f82dc6c505b8559e34b Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 13 Nov 2019 15:55:26 +0100 Subject: [PATCH 32/56] test against Aquarius v1.0.1 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8221c45..41a732f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ before_script: - ganache-cli --port 18545 > ganache-cli.log & - git clone https://github.com/oceanprotocol/barge - cd barge - - export AQUARIUS_VERSION=v1.0.0 + - export AQUARIUS_VERSION=v1.0.1 - export BRIZO_VERSION=v0.6.0 - export KEEPER_VERSION=v0.12.7 - export EVENTS_HANDLER_VERSION=v0.3.0 From 347915a41eb881469a82fe03b569605d477ec72c Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 13 Nov 2019 15:37:03 +0100 Subject: [PATCH 33/56] add ocean.assets.transferOwnership() --- src/keeper/contracts/DIDRegistry.ts | 5 +++++ src/ocean/OceanAssets.ts | 12 ++++++++++++ test/keeper/DIDRegistry.test.ts | 20 +++++++++++++++++++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/keeper/contracts/DIDRegistry.ts b/src/keeper/contracts/DIDRegistry.ts index 13f29e1..a790b20 100644 --- a/src/keeper/contracts/DIDRegistry.ts +++ b/src/keeper/contracts/DIDRegistry.ts @@ -1,3 +1,4 @@ +import { TransactionReceipt } from 'web3-core' import ContractBase from './ContractBase' import { zeroX, didPrefixed, didZeroX } from '../../utils' import { InstantiableConfig } from '../../Instantiable.abstract' @@ -60,4 +61,8 @@ export default class DIDRegistry extends ContractBase { public async getPermission(did: string, grantee: string): Promise { return this.call('getPermission', [didZeroX(did), zeroX(grantee)]) } + + public async transferDIDOwnership(did: string, owner: string, newOwner: string): Promise { + return this.send('transferDIDOwnership', owner, [zeroX(did), zeroX(newOwner)]) + } } diff --git a/src/ocean/OceanAssets.ts b/src/ocean/OceanAssets.ts index 18a989a..dff3a96 100644 --- a/src/ocean/OceanAssets.ts +++ b/src/ocean/OceanAssets.ts @@ -1,3 +1,4 @@ +import { TransactionReceipt } from 'web3-core' import { SearchQuery } from '../aquarius/Aquarius' import { DDO } from '../ddo/DDO' import { MetaData } from '../ddo/MetaData' @@ -355,6 +356,17 @@ export class OceanAssets extends Instantiable { return this.ocean.keeper.didRegistry.getAttributesByOwner(owner) } + /** + * Transfer ownership of an asset. + * @param {string} did Asset DID. + * @param {string} owner Ethereum address of the current owner of the DID. + * @param {string} newOwner Ethereum address of the new owner of the DID. + * @return {Promise} Returns Web3 transaction receipt. + */ + public async transferOwnership(did: string, owner: string, newOwner: string): Promise { + return this.ocean.keeper.didRegistry.transferDIDOwnership(did, owner, newOwner) + } + /** * Returns the assets of a consumer. * @param {string} consumer Consumer address. diff --git a/test/keeper/DIDRegistry.test.ts b/test/keeper/DIDRegistry.test.ts index d1a2e34..581c81b 100644 --- a/test/keeper/DIDRegistry.test.ts +++ b/test/keeper/DIDRegistry.test.ts @@ -13,7 +13,7 @@ describe('DIDRegistry', () => { before(async () => { await TestContractHandler.prepareContracts() ocean = await Ocean.getInstance(config) - didRegistry = ocean.keeper.didRegistry + ;({ didRegistry } = ocean.keeper) }) describe('#registerAttribute()', () => { @@ -67,4 +67,22 @@ describe('DIDRegistry', () => { assert.equal(owner, `0x${'0'.repeat(40)}`) }) }) + + describe('#transferDIDOwnership()', () => { + it('should be able to transfer ownership', async () => { + // create and register DID + const ownerAccount: Account = (await ocean.accounts.list())[0] + const did = generateId() + const data = 'my nice provider, is nice' + await didRegistry.registerAttribute(did, '0123456789abcdef', [], data, ownerAccount.getId()) + + // transfer + const newOwnerAccount: Account = (await ocean.accounts.list())[1] + await didRegistry.transferDIDOwnership(did, ownerAccount.getId(), newOwnerAccount.getId()) + + // check + const newOwner = await didRegistry.getDIDOwner(did) + assert.equal(newOwner, newOwnerAccount.getId(), `Got ${newOwner} but expected ${newOwnerAccount.getId()}`) + }) + }) }) From b31a661dcbf0c56f34fac1813a4cc03d2f30d3d1 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 13 Nov 2019 16:48:53 +0100 Subject: [PATCH 34/56] transferOwnership fixes, add integration test --- integration/ocean/AssetOwners.test.ts | 10 ++++++++++ src/keeper/contracts/DIDRegistry.ts | 8 ++++++-- src/ocean/OceanAssets.ts | 6 +++--- test/keeper/DIDRegistry.test.ts | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/integration/ocean/AssetOwners.test.ts b/integration/ocean/AssetOwners.test.ts index 1eea73a..74704da 100644 --- a/integration/ocean/AssetOwners.test.ts +++ b/integration/ocean/AssetOwners.test.ts @@ -81,4 +81,14 @@ describe('Asset Owners', () => { const { length: finalLength2 } = await ocean.assets.consumerAssets(account2.getId()) assert.equal(finalLength2 - initialLength, 1) }) + + it('should be able to transfer ownership', async () => { + const { id } = await ocean.assets.create(metadata as any, account1) + + // transfer + await ocean.assets.transferOwnership(id, account2.getId()) + const newOwner = await ocean.keeper.didRegistry.getDIDOwner(id) + + assert.equal(newOwner, account2.getId()) + }) }) diff --git a/src/keeper/contracts/DIDRegistry.ts b/src/keeper/contracts/DIDRegistry.ts index a790b20..ecb0768 100644 --- a/src/keeper/contracts/DIDRegistry.ts +++ b/src/keeper/contracts/DIDRegistry.ts @@ -62,7 +62,11 @@ export default class DIDRegistry extends ContractBase { return this.call('getPermission', [didZeroX(did), zeroX(grantee)]) } - public async transferDIDOwnership(did: string, owner: string, newOwner: string): Promise { - return this.send('transferDIDOwnership', owner, [zeroX(did), zeroX(newOwner)]) + public async transferDIDOwnership( + did: string, + newOwnerAddress: string, + ownerAddress: string + ): Promise { + return this.send('transferDIDOwnership', ownerAddress, [didZeroX(did), newOwnerAddress]) } } diff --git a/src/ocean/OceanAssets.ts b/src/ocean/OceanAssets.ts index dff3a96..d94f1e6 100644 --- a/src/ocean/OceanAssets.ts +++ b/src/ocean/OceanAssets.ts @@ -359,12 +359,12 @@ export class OceanAssets extends Instantiable { /** * Transfer ownership of an asset. * @param {string} did Asset DID. - * @param {string} owner Ethereum address of the current owner of the DID. * @param {string} newOwner Ethereum address of the new owner of the DID. * @return {Promise} Returns Web3 transaction receipt. */ - public async transferOwnership(did: string, owner: string, newOwner: string): Promise { - return this.ocean.keeper.didRegistry.transferDIDOwnership(did, owner, newOwner) + public async transferOwnership(did: string, newOwner: string): Promise { + const owner = await this.ocean.assets.owner(did) + return this.ocean.keeper.didRegistry.transferDIDOwnership(did, newOwner, owner) } /** diff --git a/test/keeper/DIDRegistry.test.ts b/test/keeper/DIDRegistry.test.ts index 581c81b..0b467c9 100644 --- a/test/keeper/DIDRegistry.test.ts +++ b/test/keeper/DIDRegistry.test.ts @@ -78,7 +78,7 @@ describe('DIDRegistry', () => { // transfer const newOwnerAccount: Account = (await ocean.accounts.list())[1] - await didRegistry.transferDIDOwnership(did, ownerAccount.getId(), newOwnerAccount.getId()) + await didRegistry.transferDIDOwnership(did, newOwnerAccount.getId(), ownerAccount.getId()) // check const newOwner = await didRegistry.getDIDOwner(did) From 6111c33a0cd1ba612b32c2da1d4469a6f5203bb6 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 14 Nov 2019 11:57:53 +0100 Subject: [PATCH 35/56] search test tweaks --- test/ocean/Ocean.test.ts | 30 --------------------- test/ocean/OceanAssets.test.ts | 48 ++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 30 deletions(-) create mode 100644 test/ocean/OceanAssets.test.ts diff --git a/test/ocean/Ocean.test.ts b/test/ocean/Ocean.test.ts index 456676a..9e86979 100644 --- a/test/ocean/Ocean.test.ts +++ b/test/ocean/Ocean.test.ts @@ -1,7 +1,6 @@ import { assert, spy, use } from 'chai' import * as spies from 'chai-spies' -import { SearchQuery } from '../../src/aquarius/Aquarius' import Account from '../../src/ocean/Account' import { Ocean } from '../../src/ocean/Ocean' import config from '../config' @@ -41,33 +40,4 @@ describe('Ocean', () => { assert(typeof accs[0].getId() === 'string') }) }) - - describe('#searchAssets()', () => { - it('should search for assets', async () => { - const query = { - offset: 100, - page: 1, - query: { - value: 1 - }, - sort: { - value: 1 - }, - text: 'Office' - } as SearchQuery - - const assets = await ocean.assets.query(query) - - assert(assets) - }) - }) - - describe('#searchAssetsByText()', () => { - it('should search for assets', async () => { - const text = 'office' - const assets = await ocean.assets.search(text) - - assert(assets) - }) - }) }) diff --git a/test/ocean/OceanAssets.test.ts b/test/ocean/OceanAssets.test.ts new file mode 100644 index 0000000..32a0a52 --- /dev/null +++ b/test/ocean/OceanAssets.test.ts @@ -0,0 +1,48 @@ +import { assert, spy, use } from 'chai' +import * as spies from 'chai-spies' + +import { SearchQuery } from '../../src/aquarius/Aquarius' +import { Ocean } from '../../src/ocean/Ocean' +import config from '../config' + +use(spies) + +let ocean: Ocean + +describe('OceanAssets', () => { + before(async () => { + ocean = await Ocean.getInstance(config) + }) + + afterEach(() => { + spy.restore() + }) + + describe('#query()', () => { + it('should search for assets', async () => { + const query: SearchQuery = { + offset: 100, + page: 1, + query: { + text: 'Office' + }, + sort: { + created: -1 + } + } as SearchQuery + + const assets = await ocean.assets.query(query) + + assert(assets) + }) + }) + + describe('#search()', () => { + it('should search for assets', async () => { + const text = 'office' + const assets = await ocean.assets.search(text) + + assert(assets) + }) + }) +}) From 9f210b3a139cf0b3d092356bcc94a1a5830f1db2 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 14 Nov 2019 12:17:42 +0100 Subject: [PATCH 36/56] noZeroX the new owner address --- src/keeper/contracts/DIDRegistry.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/keeper/contracts/DIDRegistry.ts b/src/keeper/contracts/DIDRegistry.ts index ecb0768..f061128 100644 --- a/src/keeper/contracts/DIDRegistry.ts +++ b/src/keeper/contracts/DIDRegistry.ts @@ -1,6 +1,6 @@ import { TransactionReceipt } from 'web3-core' import ContractBase from './ContractBase' -import { zeroX, didPrefixed, didZeroX } from '../../utils' +import { zeroX, noZeroX, didPrefixed, didZeroX } from '../../utils' import { InstantiableConfig } from '../../Instantiable.abstract' export default class DIDRegistry extends ContractBase { @@ -67,6 +67,6 @@ export default class DIDRegistry extends ContractBase { newOwnerAddress: string, ownerAddress: string ): Promise { - return this.send('transferDIDOwnership', ownerAddress, [didZeroX(did), newOwnerAddress]) + return this.send('transferDIDOwnership', ownerAddress, [didZeroX(did), noZeroX(newOwnerAddress)]) } } From 68bad2464ca0bea2ec48699f658c8fefe7496bb4 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 14 Nov 2019 14:15:41 +0100 Subject: [PATCH 37/56] bump to Aquarius v1.0.2 --- .travis.yml | 2 +- library.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 41a732f..a5d34b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ before_script: - ganache-cli --port 18545 > ganache-cli.log & - git clone https://github.com/oceanprotocol/barge - cd barge - - export AQUARIUS_VERSION=v1.0.1 + - export AQUARIUS_VERSION=v1.0.2 - export BRIZO_VERSION=v0.6.0 - export KEEPER_VERSION=v0.12.7 - export EVENTS_HANDLER_VERSION=v0.3.0 diff --git a/library.json b/library.json index 20183b5..8bd5808 100644 --- a/library.json +++ b/library.json @@ -15,7 +15,7 @@ }, { "name": "aquarius", - "version": "~1.0.0" + "version": "~1.0.2" }, { "name": "events-handler", From d69cccf9012cd14734c1d68311df89ea6f0af05c Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 14 Nov 2019 14:50:23 +0100 Subject: [PATCH 38/56] Release 1.0.0-beta.4 --- CHANGELOG.md | 10 ++++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b70fce..b3eedad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,20 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - added xDai [`#336`](https://github.com/oceanprotocol/squid-js/pull/336) +#### [v1.0.0-beta.4](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.3...v1.0.0-beta.4) + +> 14 November 2019 + +- v2: add transferOwnership method [`#332`](https://github.com/oceanprotocol/squid-js/pull/332) +- search test tweaks [`3920d62`](https://github.com/oceanprotocol/squid-js/commit/3920d62ef9dd7f608b235982e34fb7a0c95c12d7) +- add ocean.assets.transferOwnership() [`e1ef7b0`](https://github.com/oceanprotocol/squid-js/commit/e1ef7b0f17c2f7d7bcc642b4fc1719acd0652a66) +- transferOwnership fixes, add integration test [`d3f9520`](https://github.com/oceanprotocol/squid-js/commit/d3f9520a5b4ad97c033d6fe212d538eae2758fd7) + #### [v1.0.0-beta.3](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.2...v1.0.0-beta.3) > 12 November 2019 +- Release 1.0.0-beta.3 [`e2151ec`](https://github.com/oceanprotocol/squid-js/commit/e2151ec72f54d8b83b7345b042199c44210c9e88) - file.index typing fix [`22b0ecb`](https://github.com/oceanprotocol/squid-js/commit/22b0ecb33c580b2b00a08b212cc1fac46c1e39ad) #### [v1.0.0-beta.2](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.1...v1.0.0-beta.2) diff --git a/package-lock.json b/package-lock.json index 424f271..937548a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0-beta.3", + "version": "1.0.0-beta.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d964941..00bbe98 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0-beta.3", + "version": "1.0.0-beta.4", "description": "JavaScript client library for Ocean Protocol", "main": "./dist/node/squid.js", "typings": "./dist/node/squid.d.ts", From 2fd4e94f295091be8b2d701af4aa9349880ac4ee Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 11 Nov 2019 12:27:18 +0100 Subject: [PATCH 39/56] refactoring for web3.js 1.2.2 --- integration/config.ts | 4 +- integration/tsconfig.json | 3 +- package-lock.json | 365 +++++++++++++----------- package.json | 4 +- src/Instantiable.abstract.ts | 2 +- src/ddo/DDO.ts | 9 +- src/keeper/Keeper.ts | 2 +- src/keeper/Web3Provider.ts | 6 +- src/ocean/utils/ServiceAgreement.ts | 4 +- src/ocean/utils/SignatureUtils.ts | 2 +- src/ocean/utils/WebServiceConnector.ts | 8 +- test/Squid.test.ts | 2 +- test/aquarius/Aquarius.test.ts | 2 +- test/ddo/DDO.test.ts | 6 +- test/keeper/EventHandler.test.ts | 2 +- test/keeper/TestContractHandler.ts | 19 +- test/ocean/DID.test.ts | 2 +- test/ocean/Ocean.test.ts | 2 +- test/ocean/OceanAccounts.test.ts | 2 +- test/ocean/OceanAuth.test.ts | 2 +- test/ocean/OceanSecretStore.test.ts | 2 +- test/ocean/utils/SignatureUtils.test.ts | 6 +- test/tsconfig.json | 3 +- test/utils/SubscribableObserver.test.ts | 2 +- test/utils/SubscribablePromise.test.ts | 2 +- tsconfig.json | 1 + 26 files changed, 256 insertions(+), 208 deletions(-) diff --git a/integration/config.ts b/integration/config.ts index c203a24..c3fa6c3 100644 --- a/integration/config.ts +++ b/integration/config.ts @@ -1,9 +1,9 @@ import { Config } from '../src' -const HDWalletProvider = require('@truffle/hdwallet-provider') +import HDWalletProvider from '@truffle/hdwallet-provider' const configJson: Config = { nodeUri: 'http://localhost:8545', - aquariusUri: 'http://172.15.0.15:5000', + aquariusUri: 'http://aquarius:5000', brizoUri: 'http://localhost:8030', secretStoreUri: 'http://localhost:12001', brizoAddress: '0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0', diff --git a/integration/tsconfig.json b/integration/tsconfig.json index c94dc11..68cc3b6 100644 --- a/integration/tsconfig.json +++ b/integration/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "resolveJsonModule": true, "lib": ["es6", "es7", "dom"], - "noUnusedLocals": true + "noUnusedLocals": true, + "esModuleInterop": true } } diff --git a/package-lock.json b/package-lock.json index 937548a..f1c5148 100644 --- a/package-lock.json +++ b/package-lock.json @@ -171,13 +171,6 @@ "integrity": "sha512-5yNNA+qdjut9/nMiFKJd4D4io+GhzdfvdqVd5YMkgT9RV1qDosGj6NVsKArYay6g+tQH7pCJ6Y1FiAbhaaFB9g==", "requires": { "node-fetch": "^2.6.0" - }, - "dependencies": { - "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" - } } }, "@octokit/endpoint": { @@ -666,6 +659,14 @@ } } }, + "@types/bn.js": { + "version": "4.11.5", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.5.tgz", + "integrity": "sha512-AEAZcIZga0JgVMHNtl1CprA/hXX7/wPt79AgR4XqaDt7jyj3QWYw6LPoOiznPtugDmlubUnAahMs2PFxGcQrng==", + "requires": { + "@types/node": "*" + } + }, "@types/chai": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.4.tgz", @@ -725,8 +726,7 @@ "@types/node": { "version": "12.12.6", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.6.tgz", - "integrity": "sha512-FjsYUPzEJdGXjwKqSpE0/9QEh6kzhTAeObA54rn6j3rR4C/mzpI9L0KNfoeASSPMMdxIsoJuCLDWcM/rVjIsSA==", - "dev": true + "integrity": "sha512-FjsYUPzEJdGXjwKqSpE0/9QEh6kzhTAeObA54rn6j3rR4C/mzpI9L0KNfoeASSPMMdxIsoJuCLDWcM/rVjIsSA==" }, "@types/node-fetch": { "version": "2.5.3", @@ -2290,7 +2290,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dev": true, "requires": { "file-uri-to-path": "1.0.0" } @@ -2312,7 +2311,6 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", - "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -3810,7 +3808,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", - "dev": true, "requires": { "browserify-aes": "^1.0.6", "create-hash": "^1.1.2", @@ -4796,6 +4793,21 @@ } } }, + "ethereum-bloom-filters": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.6.tgz", + "integrity": "sha512-dE9CGNzgOOsdh7msZirvv8qjHtnHpvBlKe2647kM8v+yeF71IRso55jpojemvHV+jMjr48irPWxMRaHuOWzAFA==", + "requires": { + "js-sha3": "^0.8.0" + }, + "dependencies": { + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + } + } + }, "ethereum-common": { "version": "0.0.18", "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", @@ -4902,14 +4914,21 @@ "ethereumjs-common": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.3.2.tgz", - "integrity": "sha512-GkltYRIqBLzaZLmF/K3E+g9lZ4O4FL+TtpisAlD3N+UVlR+mrtoG+TvxavqVa6PwOY4nKIEMe5pl6MrTio3Lww==", - "dev": true + "integrity": "sha512-GkltYRIqBLzaZLmF/K3E+g9lZ4O4FL+TtpisAlD3N+UVlR+mrtoG+TvxavqVa6PwOY4nKIEMe5pl6MrTio3Lww==" + }, + "ethereumjs-tx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.1.tgz", + "integrity": "sha512-QtVriNqowCFA19X9BCRPMgdVNJ0/gMBS91TQb1DfrhsbR748g4STwxZptFAwfqehMyrF8rDwB23w87PQwru0wA==", + "requires": { + "ethereumjs-common": "^1.3.1", + "ethereumjs-util": "^6.0.0" + } }, "ethereumjs-util": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", - "dev": true, "requires": { "bn.js": "^4.11.0", "create-hash": "^1.1.2", @@ -5102,7 +5121,6 @@ "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", - "dev": true, "requires": { "is-hex-prefixed": "1.0.0", "strip-hex-prefix": "1.0.0" @@ -5534,8 +5552,7 @@ "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, "fill-range": { "version": "4.0.0", @@ -7797,7 +7814,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "dev": true, "requires": { "bindings": "^1.2.1", "inherits": "^2.0.3", @@ -9801,7 +9817,8 @@ "randomhex": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/randomhex/-/randomhex-0.1.5.tgz", - "integrity": "sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU=" + "integrity": "sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU=", + "dev": true }, "range-parser": { "version": "1.2.1", @@ -10360,7 +10377,6 @@ "version": "2.2.3", "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz", "integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==", - "dev": true, "requires": { "bn.js": "^4.11.1", "safe-buffer": "^5.1.1" @@ -10472,6 +10488,21 @@ "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", + "requires": { + "scryptsy": "^2.1.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + } + } + }, "scrypt.js": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.3.0.tgz", @@ -10502,7 +10533,6 @@ "version": "3.7.1", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz", "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", - "dev": true, "requires": { "bindings": "^1.5.0", "bip66": "^1.1.5", @@ -10517,8 +10547,7 @@ "nan": { "version": "2.14.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", - "dev": true + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" } } }, @@ -12228,139 +12257,151 @@ } }, "web3": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.1.tgz", - "integrity": "sha512-nNMzeCK0agb5i/oTWNdQ1aGtwYfXzHottFP2Dz0oGIzavPMGSKyVlr8ibVb1yK5sJBjrWVnTdGaOC2zKDFuFRw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.2.tgz", + "integrity": "sha512-/ChbmB6qZpfGx6eNpczt5YSUBHEA5V2+iUCbn85EVb3Zv6FVxrOo5Tv7Lw0gE2tW7EEjASbCyp3mZeiZaCCngg==", "requires": { - "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" + "@types/node": "^12.6.1", + "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.1", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.1.tgz", - "integrity": "sha512-LdOO44TuYbGIPfL4ilkuS89GQovxUpmLz6C1UC7VYVVRILeZS740FVB3j9V4P4FHUk1RenaDfKhcntqgVCHtjw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.2.tgz", + "integrity": "sha512-b1O2ObsqUN1lJxmFSjvnEC4TsaCbmh7Owj3IAIWTKqL9qhVgx7Qsu5O9cD13pBiSPNZJ68uJPaKq380QB4NWeA==", "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.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.5.tgz", + "integrity": "sha512-RElZIr/7JreF1eY6oD5RF3kpmdcreuQPjg5ri4oQ5g9sq7YWU8HkfB3eH8GwAwxf5OaCh0VPi7r4N/yoTGelrA==" + } } }, "web3-core": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.1.tgz", - "integrity": "sha512-5ODwIqgl8oIg/0+Ai4jsLxkKFWJYE0uLuE1yUKHNVCL4zL6n3rFjRMpKPokd6id6nJCNgeA64KdWQ4XfpnjdMg==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.2.tgz", + "integrity": "sha512-miHAX3qUgxV+KYfaOY93Hlc3kLW2j5fH8FJy6kSxAv+d4d5aH0wwrU2IIoJylQdT+FeenQ38sgsCnFu9iZ1hCQ==", "requires": { - "web3-core-helpers": "1.2.1", - "web3-core-method": "1.2.1", - "web3-core-requestmanager": "1.2.1", - "web3-utils": "1.2.1" + "@types/bn.js": "^4.11.4", + "@types/node": "^12.6.1", + "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.1", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.1.tgz", - "integrity": "sha512-Gx3sTEajD5r96bJgfuW377PZVFmXIH4TdqDhgGwd2lZQCcMi+DA4TgxJNJGxn0R3aUVzyyE76j4LBrh412mXrw==", + "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==", "requires": { "underscore": "1.9.1", - "web3-eth-iban": "1.2.1", - "web3-utils": "1.2.1" + "web3-eth-iban": "1.2.2", + "web3-utils": "1.2.2" } }, "web3-core-method": { - "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==", + "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==", "requires": { "underscore": "1.9.1", - "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-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.1", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.1.tgz", - "integrity": "sha512-IVUqgpIKoeOYblwpex4Hye6npM0aMR+kU49VP06secPeN0rHMyhGF0ZGveWBrGvf8WDPI7jhqPBFIC6Jf3Q3zw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.2.tgz", + "integrity": "sha512-tKvYeT8bkUfKABcQswK6/X79blKTKYGk949urZKcLvLDEaWrM3uuzDwdQT3BNKzQ3vIvTggFPX9BwYh0F1WwqQ==", "requires": { "any-promise": "1.3.0", "eventemitter3": "3.1.2" } }, "web3-core-requestmanager": { - "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==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.2.tgz", + "integrity": "sha512-a+gSbiBRHtHvkp78U2bsntMGYGF2eCb6219aMufuZWeAZGXJ63Wc2321PCbA8hF9cQrZI4EoZ4kVLRI4OF15Hw==", "requires": { "underscore": "1.9.1", - "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-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.1", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.1.tgz", - "integrity": "sha512-nmOwe3NsB8V8UFsY1r+sW6KjdOS68h8nuh7NzlWxBQT/19QSUGiERRTaZXWu5BYvo1EoZRMxCKyCQpSSXLc08g==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.2.tgz", + "integrity": "sha512-QbTgigNuT4eicAWWr7ahVpJyM8GbICsR1Ys9mJqzBEwpqS+RXTRVSkwZ2IsxO+iqv6liMNwGregbJLq4urMFcQ==", "requires": { "eventemitter3": "3.1.2", "underscore": "1.9.1", - "web3-core-helpers": "1.2.1" + "web3-core-helpers": "1.2.2" } }, "web3-eth": { - "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==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.2.tgz", + "integrity": "sha512-UXpC74mBQvZzd4b+baD4Ocp7g+BlwxhBHumy9seyE/LMIcMlePXwCKzxve9yReNpjaU16Mmyya6ZYlyiKKV8UA==", "requires": { "underscore": "1.9.1", - "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-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.1", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.1.tgz", - "integrity": "sha512-jI/KhU2a/DQPZXHjo2GW0myEljzfiKOn+h1qxK1+Y9OQfTcBMxrQJyH5AP89O6l6NZ1QvNdq99ThAxBFoy5L+g==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.2.tgz", + "integrity": "sha512-Yn/ZMgoOLxhTVxIYtPJ0eS6pnAnkTAaJgUJh1JhZS4ekzgswMfEYXOwpMaD5eiqPJLpuxmZFnXnBZlnQ1JMXsw==", "requires": { "ethers": "4.0.0-beta.3", "underscore": "1.9.1", - "web3-utils": "1.2.1" + "web3-utils": "1.2.2" } }, "web3-eth-accounts": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.1.tgz", - "integrity": "sha512-26I4qq42STQ8IeKUyur3MdQ1NzrzCqPsmzqpux0j6X/XBD7EjZ+Cs0lhGNkSKH5dI3V8CJasnQ5T1mNKeWB7nQ==", + "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==", "requires": { "any-promise": "1.3.0", "crypto-browserify": "3.12.0", "eth-lib": "0.2.7", - "scryptsy": "2.1.0", - "semver": "6.2.0", + "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.1", - "web3-core-helpers": "1.2.1", - "web3-core-method": "1.2.1", - "web3-utils": "1.2.1" + "web3-core": "1.2.2", + "web3-core-helpers": "1.2.2", + "web3-core-method": "1.2.2", + "web3-utils": "1.2.2" }, "dependencies": { "eth-lib": { @@ -12373,11 +12414,6 @@ "xhr-request-promise": "^0.1.2" } }, - "semver": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz", - "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==" - }, "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", @@ -12386,64 +12422,66 @@ } }, "web3-eth-contract": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.1.tgz", - "integrity": "sha512-kYFESbQ3boC9bl2rYVghj7O8UKMiuKaiMkxvRH5cEDHil8V7MGEGZNH0slSdoyeftZVlaWSMqkRP/chfnKND0g==", + "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==", "requires": { + "@types/bn.js": "^4.11.4", "underscore": "1.9.1", - "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-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.1", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.1.tgz", - "integrity": "sha512-lhP1kFhqZr2nnbu3CGIFFrAnNxk2veXpOXBY48Tub37RtobDyHijHgrj+xTh+mFiPokyrapVjpFsbGa+Xzye4Q==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.2.tgz", + "integrity": "sha512-CFjkr2HnuyMoMFBoNUWojyguD4Ef+NkyovcnUc/iAb9GP4LHohKrODG4pl76R5u61TkJGobC2ij6TyibtsyVYg==", "requires": { "eth-ens-namehash": "2.0.8", "underscore": "1.9.1", - "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-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.1", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.1.tgz", - "integrity": "sha512-9gkr4QPl1jCU+wkgmZ8EwODVO3ovVj6d6JKMos52ggdT2YCmlfvFVF6wlGLwi0VvNa/p+0BjJzaqxnnG/JewjQ==", + "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==", "requires": { "bn.js": "4.11.8", - "web3-utils": "1.2.1" + "web3-utils": "1.2.2" } }, "web3-eth-personal": { - "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==", + "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==", "requires": { - "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" + "@types/node": "^12.6.1", + "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.1", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.1.tgz", - "integrity": "sha512-Yt1Bs7WgnLESPe0rri/ZoPWzSy55ovioaP35w1KZydrNtQ5Yq4WcrAdhBzcOW7vAkIwrsLQsvA+hrOCy7mNauw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.2.tgz", + "integrity": "sha512-K07j2DXq0x4UOJgae65rWZKraOznhk8v5EGSTdFqASTx7vWE/m+NqBijBYGEsQY1lSMlVaAY9UEQlcXK5HzXTw==", "requires": { - "web3-core": "1.2.1", - "web3-core-method": "1.2.1", - "web3-utils": "1.2.1" + "web3-core": "1.2.2", + "web3-core-method": "1.2.2", + "web3-utils": "1.2.2" } }, "web3-provider-engine": { @@ -12510,55 +12548,56 @@ } }, "web3-providers-http": { - "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==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.2.tgz", + "integrity": "sha512-BNZ7Hguy3eBszsarH5gqr9SIZNvqk9eKwqwmGH1LQS1FL3NdoOn7tgPPdddrXec4fL94CwgNk4rCU+OjjZRNDg==", "requires": { - "web3-core-helpers": "1.2.1", + "web3-core-helpers": "1.2.2", "xhr2-cookies": "1.1.0" } }, "web3-providers-ipc": { - "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==", + "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==", "requires": { "oboe": "2.1.4", "underscore": "1.9.1", - "web3-core-helpers": "1.2.1" + "web3-core-helpers": "1.2.2" } }, "web3-providers-ws": { - "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==", + "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==", "requires": { "underscore": "1.9.1", - "web3-core-helpers": "1.2.1", + "web3-core-helpers": "1.2.2", "websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis" } }, "web3-shh": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.1.tgz", - "integrity": "sha512-/3Cl04nza5kuFn25bV3FJWa0s3Vafr5BlT933h26xovQ6HIIz61LmvNQlvX1AhFL+SNJOTcQmK1SM59vcyC8bA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.2.tgz", + "integrity": "sha512-og258NPhlBn8yYrDWjoWBBb6zo1OlBgoWGT+LL5/LPqRbjPe09hlOYHgscAAr9zZGtohTOty7RrxYw6Z6oDWCg==", "requires": { - "web3-core": "1.2.1", - "web3-core-method": "1.2.1", - "web3-core-subscriptions": "1.2.1", - "web3-net": "1.2.1" + "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.1", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", - "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", + "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", "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", - "randomhex": "0.1.5", + "randombytes": "^2.1.0", "underscore": "1.9.1", "utf8": "3.0.0" }, diff --git a/package.json b/package.json index 00bbe98..f685f71 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ }, "homepage": "https://github.com/oceanprotocol/squid-js#readme", "peerDependencies": { - "web3": "^1.2.0" + "web3": "^1.2.2" }, "dependencies": { "@oceanprotocol/keeper-contracts": "^0.12.7", @@ -59,7 +59,7 @@ "node-fetch": "^2.6.0", "save-file": "^2.3.1", "uuid": "^3.3.3", - "web3": "1.2.1", + "web3": "^1.2.2", "whatwg-url": "^7.1.0" }, "devDependencies": { diff --git a/src/Instantiable.abstract.ts b/src/Instantiable.abstract.ts index 91e90c2..5eb3a92 100644 --- a/src/Instantiable.abstract.ts +++ b/src/Instantiable.abstract.ts @@ -1,4 +1,4 @@ -import * as Web3 from 'web3' +import Web3 from 'web3' import Config from './models/Config' import { Logger, LoggerInstance, LogLevel } from './utils' import Web3Provider from './keeper/Web3Provider' diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 4f91528..da8be37 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -1,4 +1,3 @@ -import * as Web3 from 'web3' import Web3Provider from '../keeper/Web3Provider' import { Ocean } from '../ocean/Ocean' import { Authentication } from './Authentication' @@ -110,7 +109,7 @@ export class DDO { /** * Generates proof using personal sing. - * @param {Web3} web3 Web3 instance. + * @param {Ocean} ocean Ocean instance. * @param {string} publicKey Public key to be used on personal sign. * @param {string} password Password if it's required. * @return {Promise} Proof object. @@ -130,15 +129,15 @@ export class DDO { /** * Generates and adds a proof using personal sing on the DDO. - * @param {Web3} web3 Web3 instance. + * @param {Ocean} ocean Ocean instance. * @param {string} publicKey Public key to be used on personal sign. * @param {string} password Password if it's required. * @return {Promise} Proof object. */ - public async addProof(web3: Web3, publicKey: string, password?: string): Promise { + public async addProof(ocean: Ocean, publicKey: string, password?: string): Promise { if (this.proof) { throw new Error('Proof already exists') } - this.proof = await this.generateProof(web3, publicKey, password) + this.proof = await this.generateProof(ocean, publicKey, password) } } diff --git a/src/keeper/Keeper.ts b/src/keeper/Keeper.ts index 111419f..7ded91a 100644 --- a/src/keeper/Keeper.ts +++ b/src/keeper/Keeper.ts @@ -212,7 +212,7 @@ export class Keeper extends Instantiable { * @return {Promise} Network name. */ public getNetworkName(): Promise { - return this.web3.eth.net.getId().then(networkId => { + return this.web3.eth.net.getId().then((networkId: number) => { switch (networkId) { case 1: return 'Main' diff --git a/src/keeper/Web3Provider.ts b/src/keeper/Web3Provider.ts index 54cb392..e57870b 100644 --- a/src/keeper/Web3Provider.ts +++ b/src/keeper/Web3Provider.ts @@ -1,4 +1,4 @@ -import * as Web3 from 'web3' +import Web3 from 'web3' import Config from '../models/Config' export default class Web3Provider { @@ -7,6 +7,8 @@ export default class Web3Provider { * @return {Web3} */ public static getWeb3(config: Partial = {}): Web3 { - return new Web3(config.web3Provider || Web3.givenProvider || new Web3.providers.HttpProvider(config.nodeUri)) + return new Web3( + config.web3Provider || (Web3 as any).givenProvider || new Web3.providers.HttpProvider(config.nodeUri) + ) } } diff --git a/src/ocean/utils/ServiceAgreement.ts b/src/ocean/utils/ServiceAgreement.ts index 90c7985..9c12559 100644 --- a/src/ocean/utils/ServiceAgreement.ts +++ b/src/ocean/utils/ServiceAgreement.ts @@ -72,7 +72,7 @@ export class ServiceAgreement extends Instantiable { timelocks: number[], timeouts: number[] ): string { - const args = [ + const args: any = [ { type: 'address', value: zeroX(serviceAgreementTemplateId) }, { type: 'bytes32[]', value: valueHashes.map(zeroX) }, { type: 'uint256[]', value: timelocks }, @@ -80,7 +80,7 @@ export class ServiceAgreement extends Instantiable { { type: 'bytes32', value: zeroX(serviceAgreementId) } ] - return this.web3.utils.soliditySha3(...args).toString('hex') + return this.web3.utils.soliditySha3(...args) } private getTimeValuesFromService(service: ServiceAccess, type: 'timeout' | 'timelock'): number[] { diff --git a/src/ocean/utils/SignatureUtils.ts b/src/ocean/utils/SignatureUtils.ts index c77a3cc..1fcdafc 100644 --- a/src/ocean/utils/SignatureUtils.ts +++ b/src/ocean/utils/SignatureUtils.ts @@ -7,7 +7,7 @@ export class SignatureUtils extends Instantiable { } public async signText(text: string, publicKey: string, password?: string): Promise { - const isMetaMask = this.web3 && this.web3.currentProvider && this.web3.currentProvider.isMetaMask + const isMetaMask = this.web3 && this.web3.currentProvider && (this.web3.currentProvider as any).isMetaMask try { return await this.web3.eth.personal.sign(text, publicKey, password) } catch (e) { diff --git a/src/ocean/utils/WebServiceConnector.ts b/src/ocean/utils/WebServiceConnector.ts index aa50450..2fab2fe 100644 --- a/src/ocean/utils/WebServiceConnector.ts +++ b/src/ocean/utils/WebServiceConnector.ts @@ -1,8 +1,8 @@ -import fetch, { BodyInit, RequestInit, Response } from 'node-fetch' -import * as fs from 'fs' - +import { BodyInit, RequestInit, Response } from 'node-fetch' +import fs from 'fs' import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract' +const fetch = require('node-fetch') import save = require('save-file') /** @@ -48,7 +48,7 @@ export class WebServiceConnector extends Instantiable { if (!response.ok) { throw new Error('Response error.') } - let filename + let filename: string try { filename = response.headers.get('content-disposition').match(/attachment;filename=(.+)/)[1] } catch { diff --git a/test/Squid.test.ts b/test/Squid.test.ts index cb8ac0d..b82ee4d 100644 --- a/test/Squid.test.ts +++ b/test/Squid.test.ts @@ -1,4 +1,4 @@ -import * as assert from 'assert' +import assert from 'assert' import * as squid from '../src/squid' describe('Squid', () => { diff --git a/test/aquarius/Aquarius.test.ts b/test/aquarius/Aquarius.test.ts index b74a00c..3714fc3 100644 --- a/test/aquarius/Aquarius.test.ts +++ b/test/aquarius/Aquarius.test.ts @@ -1,5 +1,5 @@ import { assert, spy, use } from 'chai' -import * as spies from 'chai-spies' +import spies from 'chai-spies' import { Ocean } from '../../src/ocean/Ocean' import { Aquarius, SearchQuery } from '../../src/aquarius/Aquarius' import { DDO } from '../../src/ddo/DDO' diff --git a/test/ddo/DDO.test.ts b/test/ddo/DDO.test.ts index 2e1a0b7..98c02af 100644 --- a/test/ddo/DDO.test.ts +++ b/test/ddo/DDO.test.ts @@ -1,6 +1,6 @@ import { assert, expect, spy, use } from 'chai' -import * as spies from 'chai-spies' -import * as Web3 from 'web3' +import spies from 'chai-spies' +import Web3 from 'web3' import { DDO } from '../../src/ddo/DDO' import { Service } from '../../src/ddo/Service' @@ -270,7 +270,7 @@ describe('DDO', () => { } as any const ddo = new DDO(testDDO) const generateProofSpy = spy.on(ddo, 'generateProof', () => fakeProof) - await ddo.addProof(web3, publicKey) + await ddo.addProof(ocean, publicKey) assert.equal(ddo.proof, fakeProof) expect(generateProofSpy).to.have.been.called.with(publicKey) diff --git a/test/keeper/EventHandler.test.ts b/test/keeper/EventHandler.test.ts index c8c54e5..7e40e33 100644 --- a/test/keeper/EventHandler.test.ts +++ b/test/keeper/EventHandler.test.ts @@ -1,5 +1,5 @@ import { assert, expect, spy, use } from 'chai' -import * as spies from 'chai-spies' +import spies from 'chai-spies' import { EventHandler } from '../../src/keeper/EventHandler' import { Ocean } from '../../src/ocean/Ocean' import config from '../config' diff --git a/test/keeper/TestContractHandler.ts b/test/keeper/TestContractHandler.ts index bc955d6..f4e1853 100644 --- a/test/keeper/TestContractHandler.ts +++ b/test/keeper/TestContractHandler.ts @@ -1,9 +1,14 @@ -import Contract from 'web3-eth-contract' +import { Contract } from 'web3-eth-contract' import ContractHandler from '../../src/keeper/ContractHandler' import Web3Provider from '../../src/keeper/Web3Provider' import Logger from '../../src/utils/Logger' import config from '../config' +interface ContractTest extends Contract { + testContract?: boolean + $initialized?: boolean +} + export default class TestContractHandler extends ContractHandler { public static async prepareContracts() { const web3 = Web3Provider.getWeb3(config) @@ -106,26 +111,26 @@ export default class TestContractHandler extends ContractHandler { from: string, args: any[] = [], tokens: { [name: string]: string } = {} - ): Promise { + ): Promise { const where = this.networkId // dont redeploy if there is already something loaded if (TestContractHandler.hasContract(name, where)) { - const contract = await ContractHandler.getContract(name, where) + const contract: ContractTest = await ContractHandler.getContract(name, where) if (contract.testContract) { - return { ...contract, $initialized: true } + return { ...contract, $initialized: true } as any } } const web3 = Web3Provider.getWeb3(config) - let contractInstance: Contract + let contractInstance: ContractTest try { Logger.log('Deploying', name) const sendConfig = { from, gas: 3000000, - gasPrice: 10000000000 + gasPrice: String(10000000000) } const artifact = require(`@oceanprotocol/keeper-contracts/artifacts/${name}.development.json`) const tempContract = new web3.eth.Contract(artifact.abi, artifact.address) @@ -154,7 +159,7 @@ export default class TestContractHandler extends ContractHandler { } contractInstance.testContract = true ContractHandler.setContract(name, where, contractInstance) - // Logger.log("Deployed", name, "at", contractInstance.options.address); + // Logger.log('Deployed', name, 'at', contractInstance.options.address) } catch (err) { Logger.error('Deployment failed for', name, 'with args', JSON.stringify(args, null, 2), err.message) throw err diff --git a/test/ocean/DID.test.ts b/test/ocean/DID.test.ts index c391973..a75f6b8 100644 --- a/test/ocean/DID.test.ts +++ b/test/ocean/DID.test.ts @@ -1,4 +1,4 @@ -import * as assert from 'assert' +import assert from 'assert' import DID from '../../src/ocean/DID' describe('DID', () => { diff --git a/test/ocean/Ocean.test.ts b/test/ocean/Ocean.test.ts index 9e86979..acc5f4a 100644 --- a/test/ocean/Ocean.test.ts +++ b/test/ocean/Ocean.test.ts @@ -1,5 +1,5 @@ import { assert, spy, use } from 'chai' -import * as spies from 'chai-spies' +import spies from 'chai-spies' import Account from '../../src/ocean/Account' import { Ocean } from '../../src/ocean/Ocean' diff --git a/test/ocean/OceanAccounts.test.ts b/test/ocean/OceanAccounts.test.ts index f403286..ba68775 100644 --- a/test/ocean/OceanAccounts.test.ts +++ b/test/ocean/OceanAccounts.test.ts @@ -1,5 +1,5 @@ import { assert, spy, use } from 'chai' -import * as spies from 'chai-spies' +import spies from 'chai-spies' import config from '../config' import Account from '../../src/ocean/Account' diff --git a/test/ocean/OceanAuth.test.ts b/test/ocean/OceanAuth.test.ts index 3293038..7c22ccc 100644 --- a/test/ocean/OceanAuth.test.ts +++ b/test/ocean/OceanAuth.test.ts @@ -1,5 +1,5 @@ import { assert, expect, spy, use } from 'chai' -import * as spies from 'chai-spies' +import spies from 'chai-spies' import config from '../config' import Account from '../../src/ocean/Account' diff --git a/test/ocean/OceanSecretStore.test.ts b/test/ocean/OceanSecretStore.test.ts index fea4f58..36edcfd 100644 --- a/test/ocean/OceanSecretStore.test.ts +++ b/test/ocean/OceanSecretStore.test.ts @@ -1,5 +1,5 @@ import { assert, expect, spy, use } from 'chai' -import * as spies from 'chai-spies' +import spies from 'chai-spies' import Account from '../../src/ocean/Account' import { Ocean } from '../../src/ocean/Ocean' diff --git a/test/ocean/utils/SignatureUtils.test.ts b/test/ocean/utils/SignatureUtils.test.ts index 1e6e699..4b27e71 100644 --- a/test/ocean/utils/SignatureUtils.test.ts +++ b/test/ocean/utils/SignatureUtils.test.ts @@ -1,6 +1,6 @@ import { assert, expect, spy, use } from 'chai' -import * as spies from 'chai-spies' - +import spies from 'chai-spies' +import Web3 from 'web3' import config from '../../config' import { Ocean } from '../../../src/ocean/Ocean' @@ -11,7 +11,7 @@ describe('SignatureUtils', () => { const publicKey = `0x${'a'.repeat(40)}` const text = '0123456789abcde' const signature = `0x${'a'.repeat(130)}` - let web3 + let web3: Web3 let ocean: Ocean before(async () => { diff --git a/test/tsconfig.json b/test/tsconfig.json index f38bc65..14083c9 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "resolveJsonModule": true, "lib": ["es6", "es7"], - "noUnusedLocals": true + "noUnusedLocals": true, + "esModuleInterop": true } } diff --git a/test/utils/SubscribableObserver.test.ts b/test/utils/SubscribableObserver.test.ts index 97c52f4..592b3c3 100644 --- a/test/utils/SubscribableObserver.test.ts +++ b/test/utils/SubscribableObserver.test.ts @@ -1,5 +1,5 @@ import { assert, expect, spy, use } from 'chai' -import * as spies from 'chai-spies' +import spies from 'chai-spies' import { SubscribableObserver } from '../../src/utils/SubscribableObserver' diff --git a/test/utils/SubscribablePromise.test.ts b/test/utils/SubscribablePromise.test.ts index 82778d6..ad7a4f8 100644 --- a/test/utils/SubscribablePromise.test.ts +++ b/test/utils/SubscribablePromise.test.ts @@ -1,5 +1,5 @@ import { assert, expect, spy, use } from 'chai' -import * as spies from 'chai-spies' +import spies from 'chai-spies' import { SubscribablePromise } from '../../src/utils/SubscribablePromise' diff --git a/tsconfig.json b/tsconfig.json index e81d391..3624d65 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "resolveJsonModule": true, "moduleResolution": "node", + "esModuleInterop": true, "lib": ["es2017", "es6", "es7", "dom"], "declaration": true, "module": "commonjs", From c122e06871b1d48a27e5c5afeb83d1e130dcf2f1 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 12 Nov 2019 11:28:18 +0100 Subject: [PATCH 40/56] add allowSyntheticDefaultImports --- integration/tsconfig.json | 3 ++- src/keeper/contracts/ContractBase.ts | 2 +- test/keeper/TestContractHandler.ts | 3 ++- test/tsconfig.json | 3 ++- tsconfig.json | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/integration/tsconfig.json b/integration/tsconfig.json index 68cc3b6..7286bef 100644 --- a/integration/tsconfig.json +++ b/integration/tsconfig.json @@ -3,6 +3,7 @@ "resolveJsonModule": true, "lib": ["es6", "es7", "dom"], "noUnusedLocals": true, - "esModuleInterop": true + "esModuleInterop": true, + "allowSyntheticDefaultImports": true } } diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index 589ab6e..0cac800 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -15,7 +15,7 @@ export abstract class ContractBase extends Instantiable { return this.contract.options.address } - constructor(contractName, private optional: boolean = false) { + constructor(contractName: string, private optional: boolean = false) { super() this.contractName = contractName } diff --git a/test/keeper/TestContractHandler.ts b/test/keeper/TestContractHandler.ts index f4e1853..39a2025 100644 --- a/test/keeper/TestContractHandler.ts +++ b/test/keeper/TestContractHandler.ts @@ -130,8 +130,9 @@ export default class TestContractHandler extends ContractHandler { const sendConfig = { from, gas: 3000000, - gasPrice: String(10000000000) + gasPrice: '10000000000' } + // eslint-disable-next-line security/detect-non-literal-require const artifact = require(`@oceanprotocol/keeper-contracts/artifacts/${name}.development.json`) const tempContract = new web3.eth.Contract(artifact.abi, artifact.address) const isZos = !!tempContract.methods.initialize diff --git a/test/tsconfig.json b/test/tsconfig.json index 14083c9..606f325 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -3,6 +3,7 @@ "resolveJsonModule": true, "lib": ["es6", "es7"], "noUnusedLocals": true, - "esModuleInterop": true + "esModuleInterop": true, + "allowSyntheticDefaultImports": true } } diff --git a/tsconfig.json b/tsconfig.json index 3624d65..91114cb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,7 @@ "resolveJsonModule": true, "moduleResolution": "node", "esModuleInterop": true, + "allowSyntheticDefaultImports": true, "lib": ["es2017", "es6", "es7", "dom"], "declaration": true, "module": "commonjs", From 7067b89fdc30b536c0768dd0b4f097fa24266bee Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 14 Nov 2019 17:43:20 +0100 Subject: [PATCH 41/56] web3.js v1.2.3 --- package-lock.json | 343 +++++++++++++++++++------------------ package.json | 4 +- src/keeper/Web3Provider.ts | 4 +- 3 files changed, 180 insertions(+), 171 deletions(-) diff --git a/package-lock.json b/package-lock.json index f1c5148..0523199 100644 --- a/package-lock.json +++ b/package-lock.json @@ -659,6 +659,14 @@ } } }, + "@types/bignumber.js": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/bignumber.js/-/bignumber.js-5.0.0.tgz", + "integrity": "sha512-0DH7aPGCClywOFaxxjE6UwpN2kQYe9LwuDQMv+zYA97j5GkOMo8e66LYT+a8JYU7jfmUFRZLa9KycxHDsKXJCA==", + "requires": { + "bignumber.js": "*" + } + }, "@types/bn.js": { "version": "4.11.5", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.5.tgz", @@ -827,6 +835,41 @@ } } }, + "@web3-js/scrypt-shim": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@web3-js/scrypt-shim/-/scrypt-shim-0.1.0.tgz", + "integrity": "sha512-ZtZeWCc/s0nMcdx/+rZwY1EcuRdemOK9ag21ty9UsHkFxsNb/AaoucUz0iPuyGe0Ku+PFuRmWZG7Z7462p9xPw==", + "requires": { + "scryptsy": "^2.1.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + } + } + }, + "@web3-js/websocket": { + "version": "1.0.30", + "resolved": "https://registry.npmjs.org/@web3-js/websocket/-/websocket-1.0.30.tgz", + "integrity": "sha512-fDwrD47MiDrzcJdSeTLF75aCcxVVt8B1N74rA+vh2XCAvFy4tEWJjtnUtj2QG7/zlQ6g9cQ88bZFBxwd9/FmtA==", + "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==" + } + } + }, "@webassemblyjs/ast": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", @@ -10488,21 +10531,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", - "requires": { - "scryptsy": "^2.1.0", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - } - } - }, "scrypt.js": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.3.0.tgz", @@ -12257,24 +12285,24 @@ } }, "web3": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.2.tgz", - "integrity": "sha512-/ChbmB6qZpfGx6eNpczt5YSUBHEA5V2+iUCbn85EVb3Zv6FVxrOo5Tv7Lw0gE2tW7EEjASbCyp3mZeiZaCCngg==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.3.tgz", + "integrity": "sha512-DXOn7GWnbZywc7V8+l2qtDBXzT/xEp83rZveZ9V9dQzs+6GpHiqZlOCybTTFv7YqMTtQAJjTgaBuLDVB6CLrjg==", "requires": { "@types/node": "^12.6.1", - "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.3", + "web3-core": "1.2.3", + "web3-eth": "1.2.3", + "web3-eth-personal": "1.2.3", + "web3-net": "1.2.3", + "web3-shh": "1.2.3", + "web3-utils": "1.2.3" } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.3.tgz", + "integrity": "sha512-8UWbAkyrHsMxUorKbQ6zxeTFtk1sLJIGajnTdRhGgZ4QAswIgVhN5U+PooYlW4oHDeUvpWc7eW+k9hqYyev3Mg==", "requires": { "@types/node": "^10.12.18", "got": "9.6.0", @@ -12290,118 +12318,119 @@ } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.3.tgz", + "integrity": "sha512-BaK645qANHYm8+4wLFS0LSBf1oAdLcoTssfT3MPSEGnrNN1yXCpHlODjwvQAm1ycwjJp58HeUBQJ/2XO5QGo5Q==", "requires": { + "@types/bignumber.js": "^5.0.0", "@types/bn.js": "^4.11.4", "@types/node": "^12.6.1", - "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.3", + "web3-core-method": "1.2.3", + "web3-core-requestmanager": "1.2.3", + "web3-utils": "1.2.3" } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.3.tgz", + "integrity": "sha512-+lJqZBpkciHdxLB20UThXfCnoDekek15a5wrqt/PEhBN+s+RJNaFRLQQFauA5YTF6ATTP/8cGZJ3RMClM1Q4og==", "requires": { "underscore": "1.9.1", - "web3-eth-iban": "1.2.2", - "web3-utils": "1.2.2" + "web3-eth-iban": "1.2.3", + "web3-utils": "1.2.3" } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.3.tgz", + "integrity": "sha512-cXqQYYsiSvIXzzrjC7kQvp0U6o6TjeTmKraNF6r4A6ZOqxeMEqD3BVve5rK/RCcoyFJUKDFjOo3MP/gCNOkp4g==", "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.3", + "web3-core-promievent": "1.2.3", + "web3-core-subscriptions": "1.2.3", + "web3-utils": "1.2.3" } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.3.tgz", + "integrity": "sha512-LX9aI/7QIHZtUPL1aD0meWFArG+cylqJbSq7WHR44MsrsnM0wtcOl8KmcaFtihb/LcCchvAokCcv74ElFYc6DA==", "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==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.3.tgz", + "integrity": "sha512-KVHfi9xyqjFRp7UQg79ynE4tIBBZ/w0ygXCFAkyypUxXWSOAO8+q5cj5BSuGbxVsQEnCAixX/MhpXaykpzTB+g==", "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.3", + "web3-providers-http": "1.2.3", + "web3-providers-ipc": "1.2.3", + "web3-providers-ws": "1.2.3" } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.3.tgz", + "integrity": "sha512-cD3h6ZZ3w9Bop16fNQURVBAb1401b4cFVmQH7rurHwVGQrRHWqLRNktmjdARZ9xKZWyscpeOuQyqVpC9lFtJkA==", "requires": { "eventemitter3": "3.1.2", "underscore": "1.9.1", - "web3-core-helpers": "1.2.2" + "web3-core-helpers": "1.2.3" } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.3.tgz", + "integrity": "sha512-0jWHyqLY8r3LvuQjeCQRfYaOvOKg482l7g9KGpGJ14vJPE+6zOJY/NYFGJoGsgro04qHCH9pIdy7D/nw2II7ow==", "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.3", + "web3-core-helpers": "1.2.3", + "web3-core-method": "1.2.3", + "web3-core-subscriptions": "1.2.3", + "web3-eth-abi": "1.2.3", + "web3-eth-accounts": "1.2.3", + "web3-eth-contract": "1.2.3", + "web3-eth-ens": "1.2.3", + "web3-eth-iban": "1.2.3", + "web3-eth-personal": "1.2.3", + "web3-net": "1.2.3", + "web3-utils": "1.2.3" } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.3.tgz", + "integrity": "sha512-43xj554x8F4HOXxPh9XYXlm3KalbqHVjs5wxlVtlsRqi0R60sweWCY9fBOgZHeiW89rBbPkaGxJ09bd4OVw96A==", "requires": { "ethers": "4.0.0-beta.3", "underscore": "1.9.1", - "web3-utils": "1.2.2" + "web3-utils": "1.2.3" } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.3.tgz", + "integrity": "sha512-jdH6MbyinMPjBXbQKg79csoP1zjAVG1CXpvpZ2IZNqABZNdd0cGISAMbW8qduT3KD7mpyZGUKqeXXp66Hp9U3g==", "requires": { + "@web3-js/scrypt-shim": "^0.1.0", "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" + "web3-core": "1.2.3", + "web3-core-helpers": "1.2.3", + "web3-core-method": "1.2.3", + "web3-utils": "1.2.3" }, "dependencies": { "eth-lib": { @@ -12422,66 +12451,66 @@ } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.3.tgz", + "integrity": "sha512-phbnPQNTX27n/eG0yzGwkAt4sEWYWBnIMbb+h2F1FvfT4gOp1+bllZy7kK5lVnBs+oJtPaSRlalxDkt9qw+0og==", "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.3", + "web3-core-helpers": "1.2.3", + "web3-core-method": "1.2.3", + "web3-core-promievent": "1.2.3", + "web3-core-subscriptions": "1.2.3", + "web3-eth-abi": "1.2.3", + "web3-utils": "1.2.3" } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.3.tgz", + "integrity": "sha512-jTlm9BGS3zVZBUHxHyCpe5yiyVhqkDTaZa4fQW1jQcTN2RFQNEb0nKQECO2O6+DLAitkwCTZx72F8PIp4uKjAg==", "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.3", + "web3-core-helpers": "1.2.3", + "web3-core-promievent": "1.2.3", + "web3-eth-abi": "1.2.3", + "web3-eth-contract": "1.2.3", + "web3-utils": "1.2.3" } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.3.tgz", + "integrity": "sha512-2AUlDwkafWdQTQ/sesfQiMyY8xUOYjplDBTZWhN8smwLTeYGiJsYfQ6ghtGgIzWGIAAi21AtwwARkxZyqIEHDg==", "requires": { "bn.js": "4.11.8", - "web3-utils": "1.2.2" + "web3-utils": "1.2.3" } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.3.tgz", + "integrity": "sha512-UufRCHOF4SXnxQ3HecAzcwp3fonJS+125dOAYSoCJsqsmt+lx32SxaTa6N4KGntFPjlmC8rK9l1qXnpdQtGgqA==", "requires": { "@types/node": "^12.6.1", - "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.3", + "web3-core-helpers": "1.2.3", + "web3-core-method": "1.2.3", + "web3-net": "1.2.3", + "web3-utils": "1.2.3" } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.3.tgz", + "integrity": "sha512-Uz9e35PaQnuSJ9rIq+ky5sUiA77H+oDelFhXku2GpC2mhZjnJBCh2wzk4avt0PrUybOXdHaYLQTXeF8pr+9zuA==", "requires": { - "web3-core": "1.2.2", - "web3-core-method": "1.2.2", - "web3-utils": "1.2.2" + "web3-core": "1.2.3", + "web3-core-method": "1.2.3", + "web3-utils": "1.2.3" } }, "web3-provider-engine": { @@ -12548,49 +12577,49 @@ } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.3.tgz", + "integrity": "sha512-+hyNHYmXLp18AQ++uqomgYBtQC6OLiWPjEiKYVAGT64ABfeKf+VjELc1p5PU7apVHbkU51U5srcB/A5QBFdZXQ==", "requires": { - "web3-core-helpers": "1.2.2", + "web3-core-helpers": "1.2.3", "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.3", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.3.tgz", + "integrity": "sha512-x12wlL32X+LYS0N59d5yXxfZOmD94G9e9jloAjSNr5Lfe40BGGdvNSSZ4MJj1vnkVQ2ArYvoJWkhIu+d9IADUg==", "requires": { "oboe": "2.1.4", "underscore": "1.9.1", - "web3-core-helpers": "1.2.2" + "web3-core-helpers": "1.2.3" } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.3.tgz", + "integrity": "sha512-3q1A+EFrpEKy/aSB8DnAJRm5PEeM4TvOolKwPq6bxMnr1VG2LKxbryD07yKnpmPgxFuPYVHmVsHL5veAkAPPYg==", "requires": { + "@web3-js/websocket": "^1.0.29", "underscore": "1.9.1", - "web3-core-helpers": "1.2.2", - "websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis" + "web3-core-helpers": "1.2.3" } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.3.tgz", + "integrity": "sha512-6ajA6hzjEjm4TmQSuprkEqpNg0Npt97XmCA2MUzC3EoJ7XMGcHZ6XieL6aMcb2VqoZ6+IWcrxcBgZJTV5KEs0w==", "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.3", + "web3-core-method": "1.2.3", + "web3-core-subscriptions": "1.2.3", + "web3-net": "1.2.3" } }, "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.3", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.3.tgz", + "integrity": "sha512-9fmtlXuBuVNUyguUX9dHAXL3fGkvR3jySVVTN3qDudO4DTpmQRZCtJdDzVtYK5KDyQJg1j9GaaJ0zASjXixLSg==", "requires": { "bn.js": "4.11.8", "eth-lib": "0.2.7", @@ -12831,24 +12860,6 @@ } } }, - "websocket": { - "version": "github:web3-js/WebSocket-Node#905deb4812572b344f5801f8c9ce8bb02799d82e", - "from": "github:web3-js/WebSocket-Node#polyfill/globalThis", - "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==" - } - } - }, "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 f685f71..4509daf 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ }, "homepage": "https://github.com/oceanprotocol/squid-js#readme", "peerDependencies": { - "web3": "^1.2.2" + "web3": "^1.2.3" }, "dependencies": { "@oceanprotocol/keeper-contracts": "^0.12.7", @@ -59,7 +59,7 @@ "node-fetch": "^2.6.0", "save-file": "^2.3.1", "uuid": "^3.3.3", - "web3": "^1.2.2", + "web3": "^1.2.3", "whatwg-url": "^7.1.0" }, "devDependencies": { diff --git a/src/keeper/Web3Provider.ts b/src/keeper/Web3Provider.ts index e57870b..2b62b37 100644 --- a/src/keeper/Web3Provider.ts +++ b/src/keeper/Web3Provider.ts @@ -7,8 +7,6 @@ export default class Web3Provider { * @return {Web3} */ public static getWeb3(config: Partial = {}): Web3 { - return new Web3( - config.web3Provider || (Web3 as any).givenProvider || new Web3.providers.HttpProvider(config.nodeUri) - ) + return new Web3(config.web3Provider || Web3.givenProvider || new Web3.providers.HttpProvider(config.nodeUri)) } } From 0552bcc577fb83a5e9d683cb23dcbdfd23f0fa1c Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 14 Nov 2019 19:42:36 +0100 Subject: [PATCH 42/56] fresh package-lock --- package-lock.json | 5710 +++++++++++------ src/keeper/contracts/DIDRegistry.ts | 16 +- .../conditions/AccessSecretStoreCondition.ts | 8 +- .../managers/AgreementStoreManager.ts | 12 +- .../managers/ConditionStoreManager.ts | 13 +- test/ocean/OceanAssets.test.ts | 2 +- 6 files changed, 3749 insertions(+), 2012 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0523199..93986be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,99 +5,114 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", "dev": true, "requires": { "@babel/highlight": "^7.0.0" } }, "@babel/generator": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.4.tgz", - "integrity": "sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.2.tgz", + "integrity": "sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ==", "dev": true, "requires": { - "@babel/types": "^7.4.4", + "@babel/types": "^7.7.2", "jsesc": "^2.5.1", - "lodash": "^4.17.11", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" + "lodash": "^4.17.13", + "source-map": "^0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + } } }, "@babel/helper-function-name": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", - "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", + "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.0.0", - "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" } }, "@babel/helper-get-function-arity": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", - "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", + "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", "dev": true, "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.7.0" } }, "@babel/helper-split-export-declaration": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", - "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", + "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", "dev": true, "requires": { - "@babel/types": "^7.4.4" + "@babel/types": "^7.7.0" } }, "@babel/highlight": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", "dev": true, "requires": { "chalk": "^2.0.0", "esutils": "^2.0.2", "js-tokens": "^4.0.0" + }, + "dependencies": { + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + } } }, "@babel/parser": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.5.tgz", - "integrity": "sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.3.tgz", + "integrity": "sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A==", "dev": true }, "@babel/template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", - "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.4.4", - "@babel/types": "^7.4.4" + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" } }, "@babel/traverse": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.5.tgz", - "integrity": "sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.2.tgz", + "integrity": "sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.4.4", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.4.5", - "@babel/types": "^7.4.4", + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.2", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/types": "^7.7.2", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.11" + "lodash": "^4.17.13" }, "dependencies": { "debug": { @@ -109,6 +124,12 @@ "ms": "^2.1.1" } }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -118,14 +139,22 @@ } }, "@babel/types": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz", - "integrity": "sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", "dev": true, "requires": { "esutils": "^2.0.2", - "lodash": "^4.17.11", + "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + } } }, "@iarna/toml": { @@ -174,72 +203,39 @@ } }, "@octokit/endpoint": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.5.0.tgz", - "integrity": "sha512-TXYS6zXeBImNB9BVj+LneMDqXX+H0exkOpyXobvp92O3B1348QsKnNioISFKgOMsb3ibZvQGwCdpiwQd3KAjIA==", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.5.1.tgz", + "integrity": "sha512-nBFhRUb5YzVTCX/iAK1MgQ4uWo89Gu0TH00qQHoYRCsE12dWcG1OiLd7v2EIo2+tpUKPMOQ62QFy9hy9Vg2ULg==", "dev": true, "requires": { - "@octokit/types": "^1.0.0", + "@octokit/types": "^2.0.0", "is-plain-object": "^3.0.0", "universal-user-agent": "^4.0.0" - }, - "dependencies": { - "is-plain-object": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", - "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", - "dev": true, - "requires": { - "isobject": "^4.0.0" - } - }, - "isobject": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", - "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", - "dev": true - } } }, "@octokit/request": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.3.0.tgz", - "integrity": "sha512-mMIeNrtYyNEIYNsKivDyUAukBkw0M5ckyJX56xoFRXSasDPCloIXaQOnaKNopzQ8dIOvpdq1ma8gmrS+h6O2OQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.3.1.tgz", + "integrity": "sha512-5/X0AL1ZgoU32fAepTfEoggFinO3rxsMLtzhlUX+RctLrusn/CApJuGFCd0v7GMFhF+8UiCsTTfsu7Fh1HnEJg==", "dev": true, "requires": { "@octokit/endpoint": "^5.5.0", "@octokit/request-error": "^1.0.1", - "@octokit/types": "^1.0.0", + "@octokit/types": "^2.0.0", "deprecation": "^2.0.0", "is-plain-object": "^3.0.0", "node-fetch": "^2.3.0", "once": "^1.4.0", "universal-user-agent": "^4.0.0" - }, - "dependencies": { - "is-plain-object": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", - "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", - "dev": true, - "requires": { - "isobject": "^4.0.0" - } - }, - "isobject": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", - "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", - "dev": true - } } }, "@octokit/request-error": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.0.4.tgz", - "integrity": "sha512-L4JaJDXn8SGT+5G0uX79rZLv0MNJmfGa4vb4vy1NnpjSnWDLJRy6m90udGwvMmavwsStgbv2QNkPzzTCMmL+ig==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.0.tgz", + "integrity": "sha512-DNBhROBYjjV/I9n7A8kVkmQNkqFAMem90dSxqvPq57e2hBr7mNTX98y3R2zDpqMQHVRpBDjsvsfIGgBzy+4PAg==", "dev": true, "requires": { + "@octokit/types": "^2.0.0", "deprecation": "^2.0.0", "once": "^1.4.0" } @@ -265,12 +261,12 @@ } }, "@octokit/types": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-1.1.0.tgz", - "integrity": "sha512-t4ZD74UnNVMq6kZBDZceflRKK3q4o5PoCKMAGht0RK84W57tqonqKL3vCxJHtbGExdan9RwV8r7VJBZxIM1O7Q==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.0.1.tgz", + "integrity": "sha512-YDYgV6nCzdGdOm7wy43Ce8SQ3M5DMKegB8E5sTB/1xrxOdo2yS/KgUgML2N2ZGD621mkbdrAglwTyA4NDOlFFA==", "dev": true, "requires": { - "@types/node": "^12.11.1" + "@types/node": ">= 8" } }, "@release-it/bumper": { @@ -300,12 +296,19 @@ "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.23", - "resolved": "https://registry.npmjs.org/@truffle/hdwallet-provider/-/hdwallet-provider-1.0.23.tgz", - "integrity": "sha512-p+imSJ9TystP8JnabDmJ/wJ+YrCmMzuN6heTDRWJvqwsewmE71WLI4UCtvyPM9j3Nkjjlhn3zApSzjUdANCdRg==", + "version": "1.0.25", + "resolved": "https://registry.npmjs.org/@truffle/hdwallet-provider/-/hdwallet-provider-1.0.25.tgz", + "integrity": "sha512-0HNVe7m1koA4e4wgHp+tHKzbZtUmY7LMP8AGj9PN6I9/EU5zeHmAcZSStzwWAFywOp6ZQ3g8NNeqThraryqdaA==", "dev": true, "requires": { + "@truffle/provider": "^0.2.2", "any-promise": "^1.3.0", "bindings": "^1.5.0", "bip39": "^2.4.2", @@ -313,7 +316,7 @@ "ethereumjs-tx": "^1.0.0", "ethereumjs-util": "^6.1.0", "ethereumjs-wallet": "^0.6.3", - "web3": "1.2.1", + "web3": "1.2.2", "web3-provider-engine": "git+https://github.com/trufflesuite/provider-engine.git#web3-one" }, "dependencies": { @@ -355,17 +358,17 @@ } } }, - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", - "dev": true - }, - "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 + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "dev": true, + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } }, "uuid": { "version": "3.3.2", @@ -374,71 +377,83 @@ "dev": true }, "web3": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.1.tgz", - "integrity": "sha512-nNMzeCK0agb5i/oTWNdQ1aGtwYfXzHottFP2Dz0oGIzavPMGSKyVlr8ibVb1yK5sJBjrWVnTdGaOC2zKDFuFRw==", + "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.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" + "@types/node": "^12.6.1", + "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.1", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.1.tgz", - "integrity": "sha512-LdOO44TuYbGIPfL4ilkuS89GQovxUpmLz6C1UC7VYVVRILeZS740FVB3j9V4P4FHUk1RenaDfKhcntqgVCHtjw==", + "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.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.5.tgz", + "integrity": "sha512-RElZIr/7JreF1eY6oD5RF3kpmdcreuQPjg5ri4oQ5g9sq7YWU8HkfB3eH8GwAwxf5OaCh0VPi7r4N/yoTGelrA==", + "dev": true + } } }, "web3-core": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.1.tgz", - "integrity": "sha512-5ODwIqgl8oIg/0+Ai4jsLxkKFWJYE0uLuE1yUKHNVCL4zL6n3rFjRMpKPokd6id6nJCNgeA64KdWQ4XfpnjdMg==", + "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": { - "web3-core-helpers": "1.2.1", - "web3-core-method": "1.2.1", - "web3-core-requestmanager": "1.2.1", - "web3-utils": "1.2.1" + "@types/bn.js": "^4.11.4", + "@types/node": "^12.6.1", + "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.1", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.1.tgz", - "integrity": "sha512-Gx3sTEajD5r96bJgfuW377PZVFmXIH4TdqDhgGwd2lZQCcMi+DA4TgxJNJGxn0R3aUVzyyE76j4LBrh412mXrw==", + "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.1", - "web3-utils": "1.2.1" + "web3-eth-iban": "1.2.2", + "web3-utils": "1.2.2" } }, "web3-core-method": { - "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==", + "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.1", - "web3-core-promievent": "1.2.1", - "web3-core-subscriptions": "1.2.1", - "web3-utils": "1.2.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.1", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.1.tgz", - "integrity": "sha512-IVUqgpIKoeOYblwpex4Hye6npM0aMR+kU49VP06secPeN0rHMyhGF0ZGveWBrGvf8WDPI7jhqPBFIC6Jf3Q3zw==", + "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", @@ -446,215 +461,987 @@ } }, "web3-core-requestmanager": { - "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==", + "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.1", - "web3-providers-http": "1.2.1", - "web3-providers-ipc": "1.2.1", - "web3-providers-ws": "1.2.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.1", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.1.tgz", - "integrity": "sha512-nmOwe3NsB8V8UFsY1r+sW6KjdOS68h8nuh7NzlWxBQT/19QSUGiERRTaZXWu5BYvo1EoZRMxCKyCQpSSXLc08g==", + "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.1" + "web3-core-helpers": "1.2.2" } }, "web3-eth": { - "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==", + "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.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-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.1", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.1.tgz", - "integrity": "sha512-jI/KhU2a/DQPZXHjo2GW0myEljzfiKOn+h1qxK1+Y9OQfTcBMxrQJyH5AP89O6l6NZ1QvNdq99ThAxBFoy5L+g==", + "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.1" + "web3-utils": "1.2.2" } }, "web3-eth-accounts": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.1.tgz", - "integrity": "sha512-26I4qq42STQ8IeKUyur3MdQ1NzrzCqPsmzqpux0j6X/XBD7EjZ+Cs0lhGNkSKH5dI3V8CJasnQ5T1mNKeWB7nQ==", + "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", - "scryptsy": "2.1.0", - "semver": "6.2.0", + "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.1", - "web3-core-helpers": "1.2.1", - "web3-core-method": "1.2.1", - "web3-utils": "1.2.1" + "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.1", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.1.tgz", - "integrity": "sha512-kYFESbQ3boC9bl2rYVghj7O8UKMiuKaiMkxvRH5cEDHil8V7MGEGZNH0slSdoyeftZVlaWSMqkRP/chfnKND0g==", + "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.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-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.1", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.1.tgz", - "integrity": "sha512-lhP1kFhqZr2nnbu3CGIFFrAnNxk2veXpOXBY48Tub37RtobDyHijHgrj+xTh+mFiPokyrapVjpFsbGa+Xzye4Q==", + "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.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-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.1", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.1.tgz", - "integrity": "sha512-9gkr4QPl1jCU+wkgmZ8EwODVO3ovVj6d6JKMos52ggdT2YCmlfvFVF6wlGLwi0VvNa/p+0BjJzaqxnnG/JewjQ==", + "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.1" + "web3-utils": "1.2.2" } }, "web3-eth-personal": { - "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==", + "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.1", - "web3-core-helpers": "1.2.1", - "web3-core-method": "1.2.1", - "web3-net": "1.2.1", - "web3-utils": "1.2.1" + "@types/node": "^12.6.1", + "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.1", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.1.tgz", - "integrity": "sha512-Yt1Bs7WgnLESPe0rri/ZoPWzSy55ovioaP35w1KZydrNtQ5Yq4WcrAdhBzcOW7vAkIwrsLQsvA+hrOCy7mNauw==", + "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.1", - "web3-core-method": "1.2.1", - "web3-utils": "1.2.1" + "web3-core": "1.2.2", + "web3-core-method": "1.2.2", + "web3-utils": "1.2.2" } }, "web3-providers-http": { - "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==", + "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.1", + "web3-core-helpers": "1.2.2", "xhr2-cookies": "1.1.0" } }, "web3-providers-ipc": { - "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==", + "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.1" + "web3-core-helpers": "1.2.2" } }, "web3-providers-ws": { - "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==", + "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.1", + "web3-core-helpers": "1.2.2", "websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis" } }, "web3-shh": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.1.tgz", - "integrity": "sha512-/3Cl04nza5kuFn25bV3FJWa0s3Vafr5BlT933h26xovQ6HIIz61LmvNQlvX1AhFL+SNJOTcQmK1SM59vcyC8bA==", + "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.1", - "web3-core-method": "1.2.1", - "web3-core-subscriptions": "1.2.1", - "web3-net": "1.2.1" + "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.1", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", - "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "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", - "randomhex": "0.1.5", + "randombytes": "^2.1.0", "underscore": "1.9.1", "utf8": "3.0.0" } + } + } + }, + "@truffle/interface-adapter": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.3.3.tgz", + "integrity": "sha512-l3I4WFTfnBSIfG96IOBRtAIE6AHDAxcOUJE7W5zh9hocQwzQlGWc2yEyyTcLa0656TTM8RxaZZ2S/KdHHMvCaw==", + "dev": true, + "requires": { + "bn.js": "^4.11.8", + "ethers": "^4.0.32", + "lodash": "^4.17.13", + "web3": "1.2.2" + }, + "dependencies": { + "@types/node": { + "version": "10.17.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.5.tgz", + "integrity": "sha512-RElZIr/7JreF1eY6oD5RF3kpmdcreuQPjg5ri4oQ5g9sq7YWU8HkfB3eH8GwAwxf5OaCh0VPi7r4N/yoTGelrA==", + "dev": true }, - "websocket": { - "version": "github:web3-js/WebSocket-Node#905deb4812572b344f5801f8c9ce8bb02799d82e", - "from": "github:web3-js/WebSocket-Node#polyfill/globalThis", + "elliptic": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", + "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", "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" + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "inherits": "^2.0.1" + } + }, + "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" + }, + "dependencies": { + "elliptic": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.1.tgz", + "integrity": "sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==", + "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" + } + } + } + }, + "ethers": { + "version": "4.0.39", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.39.tgz", + "integrity": "sha512-QVtC8TTUgTrnlQjQvdFJ7fkSWKwp8HVTbKRmrdbVryrPzJHMTf3WSeRNvLF2enGyAFtyHJyFNnjN0fSshcEr9w==", + "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.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": { + "@types/node": "^12.6.1", + "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" + }, + "dependencies": { + "@types/node": { + "version": "12.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.7.tgz", + "integrity": "sha512-E6Zn0rffhgd130zbCbAr/JdXfXkoOUFAKNs/rF8qnafSJ8KYaA/j3oz7dcwal+lYjLA7xvdd5J4wdYpCTlP8+w==", + "dev": true + } + } + }, + "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" + } + }, + "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", + "@types/node": "^12.6.1", + "web3-core-helpers": "1.2.2", + "web3-core-method": "1.2.2", + "web3-core-requestmanager": "1.2.2", + "web3-utils": "1.2.2" + }, + "dependencies": { + "@types/node": { + "version": "12.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.7.tgz", + "integrity": "sha512-E6Zn0rffhgd130zbCbAr/JdXfXkoOUFAKNs/rF8qnafSJ8KYaA/j3oz7dcwal+lYjLA7xvdd5J4wdYpCTlP8+w==", + "dev": true + } + } + }, + "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": { + "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": { + "@types/node": "^12.6.1", + "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" + }, + "dependencies": { + "@types/node": { + "version": "12.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.7.tgz", + "integrity": "sha512-E6Zn0rffhgd130zbCbAr/JdXfXkoOUFAKNs/rF8qnafSJ8KYaA/j3oz7dcwal+lYjLA7xvdd5J4wdYpCTlP8+w==", + "dev": true + } + } + }, + "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.2", + "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.2.tgz", + "integrity": "sha512-0lN23hJzM6cb1IK4ZjRPHDEdwtcpRwhsfBLLOAzlOFlnFvCHlQWnb7K71mCE9LXrKqjQRDF1vjUpeiKccwoN8Q==", + "dev": true, + "requires": { + "@truffle/error": "^0.0.8", + "@truffle/interface-adapter": "^0.3.3", + "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", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "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": { + "@types/node": "^12.6.1", + "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.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.5.tgz", + "integrity": "sha512-RElZIr/7JreF1eY6oD5RF3kpmdcreuQPjg5ri4oQ5g9sq7YWU8HkfB3eH8GwAwxf5OaCh0VPi7r4N/yoTGelrA==", + "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", + "@types/node": "^12.6.1", + "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" + } + }, + "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": { + "@types/node": "^12.6.1", + "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" } } } @@ -676,9 +1463,9 @@ } }, "@types/chai": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.4.tgz", - "integrity": "sha512-7qvf9F9tMTzo0akeswHPGqgUx/gIaJqrOEET/FCD8CFRkSUHlygQiM5yB6OvjrtdxBVLSyw7COJubsFYs0683g==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.5.tgz", + "integrity": "sha512-YvbLiIc0DbbhiANrfVObdkLEHJksQZVq0Uvfg550SRAKVYaEJy+V70j65BVe2WNp6E3HtKsUczeijHFCjba3og==", "dev": true }, "@types/chai-spies": { @@ -690,6 +1477,12 @@ "@types/chai": "*" } }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, "@types/eslint-visitor-keys": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", @@ -732,9 +1525,9 @@ "dev": true }, "@types/node": { - "version": "12.12.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.6.tgz", - "integrity": "sha512-FjsYUPzEJdGXjwKqSpE0/9QEh6kzhTAeObA54rn6j3rR4C/mzpI9L0KNfoeASSPMMdxIsoJuCLDWcM/rVjIsSA==" + "version": "12.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.7.tgz", + "integrity": "sha512-E6Zn0rffhgd130zbCbAr/JdXfXkoOUFAKNs/rF8qnafSJ8KYaA/j3oz7dcwal+lYjLA7xvdd5J4wdYpCTlP8+w==" }, "@types/node-fetch": { "version": "2.5.3", @@ -746,12 +1539,12 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.6.1.tgz", - "integrity": "sha512-Z0rddsGqioKbvqfohg7BwkFC3PuNLsB+GE9QkFza7tiDzuHoy0y823Y+oGNDzxNZrYyLjqkZtCTl4vCqOmEN4g==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.7.0.tgz", + "integrity": "sha512-H5G7yi0b0FgmqaEUpzyBlVh0d9lq4cWG2ap0RKa6BkF3rpBb6IrAoubt1NWh9R2kRs/f0k6XwRDiDz3X/FqXhQ==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "2.6.1", + "@typescript-eslint/experimental-utils": "2.7.0", "eslint-utils": "^1.4.2", "functional-red-black-tree": "^1.0.1", "regexpp": "^2.0.1", @@ -759,40 +1552,32 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.6.1.tgz", - "integrity": "sha512-EVrrUhl5yBt7fC7c62lWmriq4MIc49zpN3JmrKqfiFXPXCM5ErfEcZYfKOhZXkW6MBjFcJ5kGZqu1b+lyyExUw==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.7.0.tgz", + "integrity": "sha512-9/L/OJh2a5G2ltgBWJpHRfGnt61AgDeH6rsdg59BH0naQseSwR7abwHq3D5/op0KYD/zFT4LS5gGvWcMmegTEg==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.6.1", + "@typescript-eslint/typescript-estree": "2.7.0", "eslint-scope": "^5.0.0" } }, "@typescript-eslint/parser": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.6.1.tgz", - "integrity": "sha512-PDPkUkZ4c7yA+FWqigjwf3ngPUgoLaGjMlFh6TRtbjhqxFBnkElDfckSjm98q9cMr4xRzZ15VrS/xKm6QHYf0w==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.7.0.tgz", + "integrity": "sha512-ctC0g0ZvYclxMh/xI+tyqP0EC2fAo6KicN9Wm2EIao+8OppLfxji7KAGJosQHSGBj3TcqUrA96AjgXuKa5ob2g==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.6.1", - "@typescript-eslint/typescript-estree": "2.6.1", + "@typescript-eslint/experimental-utils": "2.7.0", + "@typescript-eslint/typescript-estree": "2.7.0", "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", - "dev": true - } } }, "@typescript-eslint/typescript-estree": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.6.1.tgz", - "integrity": "sha512-+sTnssW6bcbDZKE8Ce7VV6LdzkQz2Bxk7jzk1J8H1rovoTxnm6iXvYIyncvNsaB/kBCOM63j/LNJfm27bNdUoA==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.7.0.tgz", + "integrity": "sha512-vVCE/DY72N4RiJ/2f10PTyYekX2OLaltuSIBqeHYI44GQ940VCYioInIb8jKMrK9u855OEJdFC+HmWAZTnC+Ag==", "dev": true, "requires": { "debug": "^4.1.1", @@ -812,26 +1597,11 @@ "ms": "^2.1.1" } }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true } } }, @@ -842,13 +1612,6 @@ "requires": { "scryptsy": "^2.1.0", "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - } } }, "@web3-js/websocket": { @@ -1094,9 +1857,9 @@ "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=" }, "ajv": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", "requires": { "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", @@ -1125,10 +1888,16 @@ "string-width": "^3.0.0" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "string-width": { @@ -1141,15 +1910,6 @@ "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^5.1.0" } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } } } }, @@ -1169,9 +1929,9 @@ } }, "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, "ansi-styles": { @@ -1196,6 +1956,133 @@ "requires": { "micromatch": "^3.1.4", "normalize-path": "^2.1.1" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } } }, "append-buffer": { @@ -1433,15 +2320,15 @@ "dev": true }, "core-js": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.3.5.tgz", - "integrity": "sha512-0J3K+Par/ZydhKg8pEiTcK/9d65/nqJOzY62uMkjeBmt05fDOt/khUVjDdh8TpeIuGQDy1yLDDCjiWN/8pFIuw==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.4.1.tgz", + "integrity": "sha512-KX/dnuY/J8FtEwbnrzmAjUYgLqtk+cxM86hfG60LGiW3MmltIc2yAmDgBgEkfm0blZhUrdr1Zd84J2Y14mLxzg==", "dev": true }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "regenerator-runtime": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", + "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==", "dev": true } } @@ -1492,12 +2379,6 @@ "supports-color": "^2.0.0" } }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true - }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -1542,12 +2423,6 @@ "source-map": "^0.5.7" }, "dependencies": { - "json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true - }, "slash": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", @@ -2073,6 +2948,14 @@ "browserslist": "^3.2.6", "invariant": "^2.2.2", "semver": "^5.3.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "babel-register": { @@ -2090,12 +2973,6 @@ "source-map-support": "^0.4.15" }, "dependencies": { - "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==", - "dev": true - }, "source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", @@ -2115,20 +2992,6 @@ "requires": { "core-js": "^2.4.0", "regenerator-runtime": "^0.11.0" - }, - "dependencies": { - "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==", - "dev": true - }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true - } } }, "babel-template": { @@ -2159,14 +3022,6 @@ "globals": "^9.18.0", "invariant": "^2.2.2", "lodash": "^4.17.4" - }, - "dependencies": { - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", - "dev": true - } } }, "babel-types": { @@ -2179,14 +3034,6 @@ "esutils": "^2.0.2", "lodash": "^4.17.4", "to-fast-properties": "^1.0.3" - }, - "dependencies": { - "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", - "dev": true - } } }, "babelify": { @@ -2244,43 +3091,11 @@ "pascalcase": "^0.1.1" }, "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true } } }, @@ -2368,9 +3183,9 @@ } }, "bluebird": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", - "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==" + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.1.tgz", + "integrity": "sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg==" }, "bn.js": { "version": "4.11.8", @@ -2410,10 +3225,16 @@ "widest-line": "^2.0.0" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "string-width": { @@ -2427,15 +3248,6 @@ "strip-ansi": "^5.1.0" } }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, "type-fest": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", @@ -2455,32 +3267,12 @@ } }, "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "fill-range": "^7.0.1" } }, "brorand": { @@ -2672,9 +3464,9 @@ "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" }, "cacache": { - "version": "12.0.2", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.2.tgz", - "integrity": "sha512-ifKgxH2CKhJEg6tNdAwziu6Q33EvuG26tYcda6PT3WKisZcYDXsnEdnRv67Po3yCzFfaSoMjGZzJyD2c3DT1dg==", + "version": "12.0.3", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.3.tgz", + "integrity": "sha512-kqdmfXEGFepesTuROHMs3MpFLWrPkSSpRqOw80RCflZXy/khxaArvFrQ7uJxSUduzAufc6G0g1VUCOZXxWavPw==", "dev": true, "requires": { "bluebird": "^3.5.5", @@ -2702,12 +3494,6 @@ "requires": { "yallist": "^3.0.2" } - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "dev": true } } }, @@ -2726,6 +3512,14 @@ "to-object-path": "^0.3.0", "union-value": "^1.0.0", "unset-value": "^1.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } } }, "cacheable-request": { @@ -2754,20 +3548,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==" - }, - "normalize-url": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.3.0.tgz", - "integrity": "sha512-0NLtR71o4k6GLP+mr6Ty34c5GA6CMoEsncKJxvQd8NzPxaHRJNnb5gZE8R1XF4CPIS7QPHLJ74IFszwtNVAHVQ==" - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } } } }, @@ -2798,6 +3578,12 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true } } }, @@ -2832,9 +3618,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001006", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001006.tgz", - "integrity": "sha512-MXnUVX27aGs/QINz+QG1sWSLDr3P1A3Hq5EUWoIt0T7K24DuvMxZEnh3Y5aHlJW6Bz2aApJdSewdYLd8zQnUuw==", + "version": "1.0.30001010", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001010.tgz", + "integrity": "sha512-RA5GH9YjFNea4ZQszdWgh2SC+dpLiRAg4VDQS2b5JRI45OxmbGrYocYHTa9x0bKMQUE7uvHkNPNffUr+pCxSGw==", "dev": true }, "caseless": { @@ -2931,13 +3717,94 @@ "upath": "^1.1.1" }, "dependencies": { - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "is-extglob": "^2.1.1" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" } }, "normalize-path": { @@ -2945,13 +3812,23 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } } } }, "chownr": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==" + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.3.tgz", + "integrity": "sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==" }, "chrome-trace-event": { "version": "1.0.2", @@ -2997,6 +3874,75 @@ "requires": { "is-descriptor": "^0.1.0" } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true } } }, @@ -3028,20 +3974,45 @@ "dev": true }, "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } } }, "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", "dev": true }, "clone-buffer": { @@ -3075,12 +4046,6 @@ "readable-stream": "^2.3.5" } }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, "coinstring": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/coinstring/-/coinstring-2.3.0.tgz", @@ -3208,6 +4173,13 @@ "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", "requires": { "safe-buffer": "5.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } } }, "content-type": { @@ -3216,12 +4188,20 @@ "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" }, "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", "dev": true, "requires": { "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } } }, "cookie": { @@ -3260,9 +4240,9 @@ "dev": true }, "core-js": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-0.8.4.tgz", - "integrity": "sha1-wiZl8eDRucPF4bCNq9HxCGleT88=", + "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==", "dev": true }, "core-util-is": { @@ -3319,6 +4299,12 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true } } }, @@ -3437,6 +4423,14 @@ "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "crypto-browserify": { @@ -3464,9 +4458,9 @@ "dev": true }, "cyclist": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", - "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", + "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", "dev": true }, "d": { @@ -3637,20 +4631,12 @@ "dev": true, "requires": { "clone": "^1.0.2" - }, - "dependencies": { - "clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true - } } }, "defer-to-connect": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.0.2.tgz", - "integrity": "sha512-k09hcQcTDY+cwgiwa6PYKLm3jlagNzQ+RSvhjzESOGOx+MNOuXkxTfEvPrO1IOQ81tArCFYQgi631clB70RpQw==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.0.tgz", + "integrity": "sha512-WE2sZoctWm/v4smfCAdjYbrfS55JiMRdlY9ZubFhsYbteCK9+BvAx4YV7nPjYM6ZnX5BcoVKwfmyx9sIFTgQMQ==" }, "deferred-leveldown": { "version": "1.2.2", @@ -3665,49 +4651,18 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, "requires": { "object-keys": "^1.0.12" } }, "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } + "is-descriptor": "^1.0.0" } }, "defined": { @@ -3748,9 +4703,9 @@ "dev": true }, "des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", "requires": { "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0" @@ -3808,14 +4763,6 @@ "dev": true, "requires": { "path-type": "^4.0.0" - }, - "dependencies": { - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - } } }, "doctrine": { @@ -3894,15 +4841,15 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "electron-to-chromium": { - "version": "1.3.296", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.296.tgz", - "integrity": "sha512-s5hv+TSJSVRsxH190De66YHb50pBGTweT9XGWYu/LMR20KX6TsjFzObo36CjVAzM+PUeeKSBRtm/mISlCzeojQ==", + "version": "1.3.306", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.306.tgz", + "integrity": "sha512-frDqXvrIROoYvikSKTIKbHbzO6M3/qC6kCIt/1FOa9kALe++c4VAJnwjSFvf1tYLEUsP2n9XZ4XSCyqc3l7A/A==", "dev": true }, "elliptic": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz", - "integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.1.tgz", + "integrity": "sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==", "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -3914,9 +4861,9 @@ } }, "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "emojis-list": { @@ -3940,9 +4887,9 @@ } }, "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "requires": { "once": "^1.4.0" } @@ -3989,22 +4936,28 @@ } }, "es-abstract": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", - "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.16.0.tgz", + "integrity": "sha512-xdQnfykZ9JMEiasTAJZJdMWCQ1Vm00NBw79/AWi7ELfZuuPCSOMDZbT9mkOfSctVtfhb+sAAzrm+j//GjjLHLg==", + "dev": true, "requires": { "es-to-primitive": "^1.2.0", "function-bind": "^1.1.1", "has": "^1.0.3", + "has-symbols": "^1.0.0", "is-callable": "^1.1.4", "is-regex": "^1.0.4", - "object-keys": "^1.0.12" + "object-inspect": "^1.6.0", + "object-keys": "^1.1.1", + "string.prototype.trimleft": "^2.1.0", + "string.prototype.trimright": "^2.1.0" } }, "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, "requires": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -4012,13 +4965,13 @@ } }, "es5-ext": { - "version": "0.10.50", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz", - "integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==", + "version": "0.10.52", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.52.tgz", + "integrity": "sha512-bWCbE9fbpYQY4CU6hJbJ1vSz70EClMlDgJ7BmwI+zEJhxrwjesZRPglGJlsZhu0334U3hI+gaspwksH9IGD6ag==", "requires": { "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.1", - "next-tick": "^1.0.0" + "es6-symbol": "~3.1.2", + "next-tick": "~1.0.0" } }, "es6-error": { @@ -4038,12 +4991,12 @@ } }, "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", "requires": { - "d": "1", - "es5-ext": "~0.10.14" + "d": "^1.0.1", + "ext": "^1.1.2" } }, "escape-html": { @@ -4102,12 +5055,6 @@ "v8-compile-cache": "^2.0.3" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -4117,30 +5064,12 @@ "ms": "^2.1.1" } }, - "eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - }, - "eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, - "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -4148,45 +5077,27 @@ "dev": true }, "import-fresh": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", - "integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", "dev": true, "requires": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, "strip-json-comments": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", @@ -4222,21 +5133,21 @@ } }, "eslint-config-standard": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.0.0.tgz", - "integrity": "sha512-bV6e2LFvJEetrLjVAy4KWPOUsIhPWr040c649MigTPR6yUtaGuOt6CEAyNeez2lRiC+2+vjGWa02byjs25EB3A==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.1.0.tgz", + "integrity": "sha512-EF6XkrrGVbvv8hL/kYa/m6vnvmUT+K82pJJc4JJVMM6+Qgqh0pnwprSxdduDLB9p/7bIxD+YV5O0wfb8lmcPbA==", "dev": true }, "eslint-config-standard-jsx": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-8.0.0.tgz", - "integrity": "sha512-Abs/WP+638KfkHI1J961yAztpMhYFvEMTqD4GMUZObAO9yOmLaQZlJY6xke1ty1+zhY4G58AuvHo3ht6avAEVQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-8.1.0.tgz", + "integrity": "sha512-ULVC8qH8qCqbU792ZOO6DaiaZyHNS/5CZt3hKqHkEhVlhPEPN3nfBqqxJCyp59XrjIBZPu1chMYe9T2DXZ7TMw==", "dev": true }, "eslint-config-standard-react": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-standard-react/-/eslint-config-standard-react-9.0.0.tgz", - "integrity": "sha512-nyjOpp1QpagJUyJyzbaGQN7UPgCv+O1gwtGn/R41nqquL6M5jlrNEMRbMgXg33pczi1Oh0E0b7SikGJ+WgVYFg==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard-react/-/eslint-config-standard-react-9.2.0.tgz", + "integrity": "sha512-u+KRP2uCtthZ/W4DlLWCC59GZNV/y9k9yicWWammgTs/Omh8ZUUPF3EnYm81MAcbkYQq2Wg0oxutAhi/FQ8mIw==", "dev": true, "requires": { "eslint-config-standard-jsx": "^8.0.0" @@ -4260,69 +5171,15 @@ "requires": { "debug": "^2.6.8", "pkg-dir": "^2.0.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - } - } } }, "eslint-plugin-es": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.4.0.tgz", - "integrity": "sha512-XfFmgFdIUDgvaRAlaXUkxrRg5JSADoRC8IkKLc/cISeR3yHVMefFHQZpcyXXEUUPHfy5DwviBcrfqlyqEwlQVw==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.4.1.tgz", + "integrity": "sha512-5fa/gR2yR3NxQf+UXkeLeP8FBBl6tSgdrAz1+cF84v1FMM4twGwQoqTnn+QxFLcPOrF4pdKEJKDB/q9GoyJrCA==", "dev": true, "requires": { - "eslint-utils": "^1.3.0", + "eslint-utils": "^1.4.2", "regexpp": "^2.0.1" } }, @@ -4354,129 +5211,21 @@ "esutils": "^2.0.2", "isarray": "^1.0.0" } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "strip-bom": "^3.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", - "dev": true, - "requires": { - "pify": "^2.0.0" - } - }, - "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", - "dev": true, - "requires": { - "load-json-file": "^2.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" - } - }, - "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" - } } } }, "eslint-plugin-node": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-9.1.0.tgz", - "integrity": "sha512-ZwQYGm6EoV2cfLpE1wxJWsfnKUIXfM/KM09/TlorkukgCAwmkgajEJnPCmyzoFPQQkmvo5DrW/nyKutNIw36Mw==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-9.2.0.tgz", + "integrity": "sha512-2abNmzAH/JpxI4gEOwd6K8wZIodK3BmHbTxz4s79OIYwwIt2gkpEXlAouJXu4H1c9ySTnRso0tsuthSOZbUMlA==", "dev": true, "requires": { - "eslint-plugin-es": "^1.4.0", - "eslint-utils": "^1.3.1", + "eslint-plugin-es": "^1.4.1", + "eslint-utils": "^1.4.2", "ignore": "^5.1.1", "minimatch": "^3.0.4", "resolve": "^1.10.1", "semver": "^6.1.0" - }, - "dependencies": { - "ignore": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", - "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", - "dev": true - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } } }, "eslint-plugin-prettier": { @@ -4495,20 +5244,20 @@ "dev": true }, "eslint-plugin-react": { - "version": "7.14.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.14.3.tgz", - "integrity": "sha512-EzdyyBWC4Uz2hPYBiEJrKCUi2Fn+BJ9B/pJQcjw5X+x/H2Nm59S4MJIvL4O5NEE0+WbnQwEBxWY03oUk+Bc3FA==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.16.0.tgz", + "integrity": "sha512-GacBAATewhhptbK3/vTP09CbFrgUJmBSaaRcWdbQLFvUZy9yVcQxigBNHGPU/KE2AyHpzj3AWXpxoMTsIDiHug==", "dev": true, "requires": { "array-includes": "^3.0.3", "doctrine": "^2.1.0", "has": "^1.0.3", - "jsx-ast-utils": "^2.1.0", + "jsx-ast-utils": "^2.2.1", "object.entries": "^1.1.0", "object.fromentries": "^2.0.0", "object.values": "^1.1.0", "prop-types": "^15.7.2", - "resolve": "^1.10.1" + "resolve": "^1.12.0" }, "dependencies": { "doctrine": { @@ -4548,18 +5297,18 @@ } }, "eslint-utils": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.2.tgz", - "integrity": "sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", "dev": true, "requires": { - "eslint-visitor-keys": "^1.0.0" + "eslint-visitor-keys": "^1.1.0" } }, "eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", "dev": true }, "espree": { @@ -4571,14 +5320,6 @@ "acorn": "^7.1.0", "acorn-jsx": "^5.1.0", "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", - "dev": true - } } }, "esprima": { @@ -4612,9 +5353,9 @@ "dev": true }, "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, "etag": { @@ -4661,6 +5402,18 @@ "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "dev": true, + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } } } }, @@ -4737,6 +5490,18 @@ "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "dev": true, + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } } } }, @@ -4788,6 +5553,18 @@ "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "dev": true, + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } } } }, @@ -4809,6 +5586,12 @@ "through2": "^2.0.3" }, "dependencies": { + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, "ethereumjs-tx": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz", @@ -4833,6 +5616,18 @@ "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "dev": true, + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } } } }, @@ -4897,6 +5692,18 @@ "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "dev": true, + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } } } }, @@ -4951,13 +5758,25 @@ "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "dev": true, + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } } } }, "ethereumjs-common": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.3.2.tgz", - "integrity": "sha512-GkltYRIqBLzaZLmF/K3E+g9lZ4O4FL+TtpisAlD3N+UVlR+mrtoG+TvxavqVa6PwOY4nKIEMe5pl6MrTio3Lww==" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.4.0.tgz", + "integrity": "sha512-ser2SAplX/YI5W2AnzU8wmSjKRy4KQd4uxInJ36BzjS3m18E/B9QedPUIresZN1CSEQb/RgNQ2gN7C/XbpTafA==" }, "ethereumjs-tx": { "version": "2.1.1", @@ -4969,16 +5788,16 @@ } }, "ethereumjs-util": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", - "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", + "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", "requires": { + "@types/bn.js": "^4.11.3", "bn.js": "^4.11.0", "create-hash": "^1.1.2", "ethjs-util": "0.1.6", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", + "keccak": "^2.0.0", + "rlp": "^2.2.3", "secp256k1": "^3.0.1" } }, @@ -5002,14 +5821,14 @@ }, "dependencies": { "ethereumjs-block": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.0.tgz", - "integrity": "sha512-Ye+uG/L2wrp364Zihdlr/GfC3ft+zG8PdHcRtsBFNNH1CkOhxOwdB8friBU85n89uRZ9eIMAywCq0F4CwT1wAw==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.1.tgz", + "integrity": "sha512-ze8I1844m5oKZL7hiHuezRcPzqdi4Iv0ssqQyuRaJ9Je0/YCYfXobJHvNLnex2ETgs5JypicdtLYrCNWdgcLvg==", "dev": true, "requires": { "async": "^2.0.1", "ethereumjs-common": "^1.1.0", - "ethereumjs-tx": "^1.2.2", + "ethereumjs-tx": "^2.1.1", "ethereumjs-util": "^5.0.0", "merkle-patricia-tree": "^2.1.2" }, @@ -5031,31 +5850,16 @@ } } }, - "ethereumjs-tx": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz", - "integrity": "sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA==", + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", "dev": true, "requires": { - "ethereum-common": "^0.0.18", - "ethereumjs-util": "^5.0.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", - "dev": true, - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - } + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" } } } @@ -5103,9 +5907,9 @@ }, "dependencies": { "@types/node": { - "version": "10.17.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.0.tgz", - "integrity": "sha512-wuJwN2KV4tIRz1bu9vq5kSPasJ8IsEjZaP1ZR7KlmdUZvGF/rXy8DmXOVwUD0kAtvtJ7aqMKPqUXC0NUTDbrDg==" + "version": "10.17.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.5.tgz", + "integrity": "sha512-RElZIr/7JreF1eY6oD5RF3kpmdcreuQPjg5ri4oQ5g9sq7YWU8HkfB3eH8GwAwxf5OaCh0VPi7r4N/yoTGelrA==" }, "elliptic": { "version": "6.3.3", @@ -5202,27 +6006,6 @@ "p-finally": "^1.0.0", "signal-exit": "^3.0.0", "strip-eof": "^1.0.0" - }, - "dependencies": { - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } } }, "expand-brackets": { @@ -5257,6 +6040,69 @@ "requires": { "is-extendable": "^0.1.0" } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true } } }, @@ -5304,6 +6150,28 @@ "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "ext": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.2.0.tgz", + "integrity": "sha512-0ccUQK/9e3NreLFg6K6np8aPyRgwycx+oFGtfx1dSp7Wj00Ozw9r05FgBRlzjf2XBM7LAzwgLyDscRrtSU91hA==", + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==" + } } }, "extend": { @@ -5329,6 +6197,21 @@ "requires": { "is-plain-object": "^2.0.4" } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true } } }, @@ -5359,15 +6242,6 @@ "to-regex": "^3.0.1" }, "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, "extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", @@ -5376,35 +6250,6 @@ "requires": { "is-extendable": "^0.1.0" } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } } } }, @@ -5444,69 +6289,6 @@ "glob-parent": "^5.1.0", "merge2": "^1.3.0", "micromatch": "^4.0.2" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - } } }, "fast-json-stable-stringify": { @@ -5598,26 +6380,12 @@ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "to-regex-range": "^5.0.1" } }, "finalhandler": { @@ -5645,6 +6413,25 @@ "pkg-dir": "^3.0.0" }, "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, "make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", @@ -5655,21 +6442,52 @@ "semver": "^5.6.0" } }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true } } }, "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { - "locate-path": "^3.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, "findup-sync": { @@ -5684,13 +6502,129 @@ "resolve-dir": "^1.0.1" }, "dependencies": { - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "is-extglob": "^2.1.1" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" } } } @@ -5743,6 +6677,7 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, "requires": { "is-callable": "^1.1.3" } @@ -6421,7 +7356,8 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "functional-red-black-tree": { "version": "1.0.1", @@ -6448,9 +7384,12 @@ "dev": true }, "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "requires": { + "pump": "^3.0.0" + } }, "get-value": { "version": "2.0.6", @@ -6486,9 +7425,9 @@ } }, "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -6500,13 +7439,12 @@ } }, "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", "dev": true, "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" + "is-glob": "^4.0.1" } }, "glob-stream": { @@ -6525,6 +7463,27 @@ "remove-trailing-separator": "^1.0.1", "to-absolute-glob": "^2.0.0", "unique-stream": "^2.0.2" + }, + "dependencies": { + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } } }, "global": { @@ -6581,9 +7540,9 @@ } }, "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", "dev": true }, "globby": { @@ -6618,44 +7577,12 @@ "p-cancelable": "^1.0.0", "to-readable-stream": "^1.0.0", "url-parse-lax": "^3.0.0" - }, - "dependencies": { - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "requires": { - "pump": "^3.0.0" - } - }, - "prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "url-parse-lax": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", - "requires": { - "prepend-http": "^2.0.0" - } - } } }, "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" }, "graceful-readlink": { "version": "1.0.1", @@ -6669,9 +7596,9 @@ "dev": true }, "handlebars": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.1.tgz", - "integrity": "sha512-C29UoFzHe9yM61lOsIlCE5/mQVGrnIOrOq7maQl76L7tYPCgC1og0Ajt6uWnX4ZTxBPnjw+CUvawphwCfJgUnA==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.2.tgz", + "integrity": "sha512-29Zxv/cynYB7mkT1rVWQnV7mGX6v7H/miQ6dbEpYTKq5eJBN7PsRB+ViYJlcT6JINTSu4dVB9kOqEun78h6Exg==", "dev": true, "requires": { "neo-async": "^2.6.0", @@ -6706,6 +7633,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -6741,7 +7669,8 @@ "has-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true }, "has-to-string-tag-x": { "version": "1.4.1", @@ -6760,6 +7689,14 @@ "get-value": "^2.0.6", "has-values": "^1.0.0", "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } } }, "has-values": { @@ -6778,6 +7715,26 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "kind-of": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", @@ -6840,9 +7797,9 @@ "dev": true }, "highlight.js": { - "version": "9.15.8", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.15.8.tgz", - "integrity": "sha512-RrapkKQWwE+wKdF73VsOa2RQdIoO3mxwJ4P8mhbI6KYJUraUHRKM5w5zQQKXNk0xNL4UVRdulV9SBJcmzJNzVA==", + "version": "9.16.2", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.16.2.tgz", + "integrity": "sha512-feMUrVLZvjy0oC7FVJQcSQRqbBq9kwqnYE4+Kj9ZjbHh3g+BisiPgF49NyQbVLNdrL/qqZr3Ca9yOKwgn2i/tw==", "dev": true }, "hmac-drbg": { @@ -6875,9 +7832,9 @@ } }, "hosted-git-info": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", + "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", "dev": true }, "http-cache-semantics": { @@ -6895,6 +7852,13 @@ "setprototypeof": "1.1.1", "statuses": ">= 1.5.0 < 2", "toidentifier": "1.0.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } } }, "http-https": { @@ -6981,14 +7945,6 @@ "requires": { "caller-path": "^2.0.0", "resolve-from": "^3.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - } } }, "import-from": { @@ -7022,6 +7978,51 @@ "requires": { "pkg-dir": "^3.0.0", "resolve-cwd": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + } } }, "imurmurhash": { @@ -7047,9 +8048,9 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ini": { "version": "1.3.5", @@ -7076,46 +8077,6 @@ "string-width": "^4.1.0", "strip-ansi": "^5.1.0", "through": "^2.3.6" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.1.0.tgz", - "integrity": "sha512-NrX+1dVVh+6Y9dnQ19pR0pP4FiEIlUvdTGn8pw6CKTNq5sgib2nIhmUNT5TAmhWmvKr3WcxBcP3E8nWezuipuQ==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^5.2.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } } }, "interpret": { @@ -7155,29 +8116,12 @@ } }, "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "kind-of": "^6.0.0" } }, "is-arrayish": { @@ -7206,14 +8150,15 @@ "integrity": "sha1-o9fZb+HD/wZex84nwsIea6ksGDI=" }, "is-buffer": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", - "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==" }, "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true }, "is-ci": { "version": "2.0.0", @@ -7225,53 +8170,29 @@ } }, "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "kind-of": "^6.0.0" } }, "is-date-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true }, "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "is-directory": { @@ -7308,9 +8229,9 @@ "dev": true }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "is-function": { @@ -7319,12 +8240,12 @@ "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=" }, "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "dev": true, "requires": { - "is-extglob": "^2.1.0" + "is-extglob": "^2.1.1" } }, "is-hex-prefixed": { @@ -7366,30 +8287,10 @@ "dev": true }, "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true }, "is-obj": { "version": "1.0.1", @@ -7417,12 +8318,12 @@ "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" }, "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", + "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", "dev": true, "requires": { - "isobject": "^3.0.1" + "isobject": "^4.0.0" } }, "is-promise": { @@ -7435,6 +8336,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, "requires": { "has": "^1.0.1" } @@ -7477,6 +8379,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, "requires": { "has-symbols": "^1.0.0" } @@ -7537,9 +8440,9 @@ "dev": true }, "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", + "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", "dev": true }, "isstream": { @@ -7575,14 +8478,6 @@ "@babel/types": "^7.4.0", "istanbul-lib-coverage": "^2.0.5", "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.1.tgz", - "integrity": "sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ==", - "dev": true - } } }, "istanbul-lib-report": { @@ -7612,6 +8507,12 @@ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, "supports-color": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", @@ -7667,6 +8568,12 @@ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -7705,9 +8612,9 @@ "integrity": "sha1-W4n3enR3Z5h39YxKB1JAk0sflcA=" }, "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true }, "js-yaml": { @@ -7726,9 +8633,9 @@ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true }, "json-buffer": { @@ -7802,21 +8709,10 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } - } + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true }, "jsonfile": { "version": "4.0.0", @@ -7844,9 +8740,9 @@ } }, "jsx-ast-utils": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.2.1.tgz", - "integrity": "sha512-v3FxCcAf20DayI+uxnCuw795+oOIkVu6EnJ1+kSzhqqTZHNkTZ7B66ZgLp4oLJ/gbA64cI0B7WRoHZMSRdyVRQ==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.2.3.tgz", + "integrity": "sha512-EdIHFMm+1BPynpKOpdPqiOsvnIrInRGJD7bzPZdPkjitQEqpdpUuFpq4T0npZFKTiB3RhWFdGN+oqOJIdhDhQA==", "dev": true, "requires": { "array-includes": "^3.0.3", @@ -7854,9 +8750,9 @@ } }, "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.0.0.tgz", + "integrity": "sha512-rKe/lRr0KGhjoz97cwg+oeT1Rj/Y4cjae6glArioUC8JBF9ROGZctwIaaruM7d7naovME4Q8WcQSO908A8qcyQ==", "requires": { "bindings": "^1.2.1", "inherits": "^2.0.3", @@ -8072,22 +8968,25 @@ } }, "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", + "parse-json": "^2.2.0", + "pify": "^2.0.0", "strip-bom": "^3.0.0" }, "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } } } }, @@ -8106,16 +9005,32 @@ "big.js": "^5.2.2", "emojis-list": "^2.0.0", "json5": "^1.0.1" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } } }, "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^4.1.0" } }, "lodash": { @@ -8208,6 +9123,14 @@ "requires": { "pseudomap": "^1.0.2", "yallist": "^2.1.2" + }, + "dependencies": { + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + } } }, "ltgt": { @@ -8217,9 +9140,9 @@ "dev": true }, "lunr": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.6.tgz", - "integrity": "sha512-swStvEyDqQ85MGpABCMBclZcLI/pBIlu8FFDtmX197+oEgKloJ67QnB+Tidh0340HmLMs39c4GrkPY3cmkXp6Q==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.8.tgz", + "integrity": "sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg==", "dev": true }, "macos-release": { @@ -8333,6 +9256,12 @@ "requires": { "xtend": "~4.0.0" } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true } } }, @@ -8410,6 +9339,18 @@ "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "dev": true, + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } } } }, @@ -8419,24 +9360,13 @@ "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" }, "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", "dev": true, "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" + "braces": "^3.0.1", + "picomatch": "^2.0.5" } }, "miller-rabin": { @@ -8454,16 +9384,16 @@ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" }, "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + "version": "1.42.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz", + "integrity": "sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ==" }, "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "version": "2.1.25", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.25.tgz", + "integrity": "sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg==", "requires": { - "mime-db": "1.40.0" + "mime-db": "1.42.0" } }, "mimic-fn": { @@ -8516,13 +9446,6 @@ "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" - }, - "dependencies": { - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" - } } }, "minizlib": { @@ -8549,18 +9472,6 @@ "pumpify": "^1.3.3", "stream-each": "^1.1.0", "through2": "^2.0.0" - }, - "dependencies": { - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } } }, "mixin-deep": { @@ -8581,6 +9492,21 @@ "requires": { "is-plain-object": "^2.0.4" } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true } } }, @@ -8631,23 +9557,6 @@ "yargs-unparser": "1.6.0" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, "debug": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", @@ -8657,6 +9566,15 @@ "ms": "^2.1.1" } }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, "glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", @@ -8671,6 +9589,16 @@ "path-is-absolute": "^1.0.0" } }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", @@ -8686,25 +9614,20 @@ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "p-limit": "^2.0.0" } }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true }, "supports-color": { "version": "6.0.0", @@ -8715,35 +9638,6 @@ "has-flag": "^3.0.0" } }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "yargs": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", - "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.1" - } - }, "yargs-parser": { "version": "13.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", @@ -8757,9 +9651,9 @@ } }, "mock-fs": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.10.1.tgz", - "integrity": "sha512-w22rOL5ZYu6HbUehB5deurghGM0hS/xBVyHMGKOuQctkk93J9z9VEOhDsiWrXOprVNQpP9uzGKdl8v9mFspKuw==" + "version": "4.10.3", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.10.3.tgz", + "integrity": "sha512-bcukePBvuA3qovmq0Qtqu9+1APCIGkFHnsozrPIVromt5XFGGgkQSfaN0H6RI8gStHkO/hRgimvS3tooNes4pQ==" }, "mock-local-storage": { "version": "1.1.10", @@ -8769,6 +9663,14 @@ "requires": { "core-js": "^0.8.3", "global": "^4.3.2" + }, + "dependencies": { + "core-js": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-0.8.4.tgz", + "integrity": "sha1-wiZl8eDRucPF4bCNq9HxCGleT88=", + "dev": true + } } }, "move-concurrently": { @@ -8823,6 +9725,24 @@ "regex-not": "^1.0.0", "snapdragon": "^0.8.1", "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } } }, "natural-compare": { @@ -8867,6 +9787,14 @@ "requires": { "object.getownpropertydescriptors": "^2.0.3", "semver": "^5.7.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "node-fetch": { @@ -8906,9 +9834,9 @@ }, "dependencies": { "buffer": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", - "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", "dev": true, "requires": { "base64-js": "^1.0.2", @@ -8940,6 +9868,14 @@ "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "normalize-path": { @@ -8952,10 +9888,9 @@ } }, "normalize-url": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz", - "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==", - "dev": true + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==" }, "now-and-later": { "version": "2.0.1", @@ -9030,6 +9965,25 @@ "yargs-parser": "^13.0.0" }, "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, "make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", @@ -9040,11 +9994,48 @@ "semver": "^5.6.0" } }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } }, @@ -9078,12 +10069,49 @@ "is-descriptor": "^0.1.0" } }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -9104,7 +10132,8 @@ "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true }, "object-visit": { "version": "1.0.1", @@ -9113,6 +10142,14 @@ "dev": true, "requires": { "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } } }, "object.assign": { @@ -9140,15 +10177,15 @@ } }, "object.fromentries": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.0.tgz", - "integrity": "sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.1.tgz", + "integrity": "sha512-PUQv8Hbg3j2QX0IQYv3iAGCbGcu4yY4KQ92/dhA4sFSixBmSmp13UpDLs6jGK8rBtbmhNNIK99LD2k293jpiGA==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.11.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.15.0", "function-bind": "^1.1.1", - "has": "^1.0.1" + "has": "^1.0.3" } }, "object.getownpropertydescriptors": { @@ -9168,6 +10205,14 @@ "dev": true, "requires": { "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } } }, "object.values": { @@ -9232,55 +10277,77 @@ } }, "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, "requires": { "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", + "fast-levenshtein": "~2.0.6", "levn": "~0.3.0", "prelude-ls": "~1.1.2", "type-check": "~0.3.2", - "wordwrap": "~1.0.0" - }, - "dependencies": { - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - } + "word-wrap": "~1.2.3" } }, "ora": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/ora/-/ora-4.0.2.tgz", - "integrity": "sha512-YUOZbamht5mfLxPmk4M35CD/5DuOkAacxlEUbStVXpBAt4fyhBf+vZHI/HRkI++QUp3sNoeA2Gw4C+hi4eGSig==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/ora/-/ora-4.0.3.tgz", + "integrity": "sha512-fnDebVFyz309A73cqCipVL1fBZewq4vwgSHfxh43vVy31mbyoQ8sCH3Oeaog/owYOs/lLlGVPCISQonTneg6Pg==", "dev": true, "requires": { - "chalk": "^2.4.2", + "chalk": "^3.0.0", "cli-cursor": "^3.1.0", "cli-spinners": "^2.2.0", "is-interactive": "^1.0.0", "log-symbols": "^3.0.0", - "strip-ansi": "^5.2.0", + "mute-stream": "0.0.8", + "strip-ansi": "^6.0.0", "wcwidth": "^1.0.1" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "ansi-styles": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.0.tgz", + "integrity": "sha512-7kFQgnEaMdRtwf6uSfUnVr9gSGC7faurn+J/Mv90/W+iTtN0405/nLdopfMWwchyxhbGYl6TC4Sccn9TUkGAgg==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.0" } } } @@ -9356,21 +10423,21 @@ "dev": true }, "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", "dev": true, "requires": { "p-try": "^2.0.0" } }, "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "p-limit": "^2.2.0" } }, "p-timeout": { @@ -9409,14 +10476,6 @@ "registry-auth-token": "^4.0.0", "registry-url": "^5.0.0", "semver": "^6.2.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } } }, "pako": { @@ -9426,12 +10485,12 @@ "dev": true }, "parallel-transform": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", - "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", "dev": true, "requires": { - "cyclist": "~0.2.2", + "cyclist": "^1.0.1", "inherits": "^2.0.3", "readable-stream": "^2.1.5" } @@ -9454,9 +10513,9 @@ } }, "parse-asn1": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", - "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", + "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", "requires": { "asn1.js": "^4.0.0", "browserify-aes": "^1.0.0", @@ -9473,13 +10532,9 @@ "dev": true }, "parse-headers": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.2.tgz", - "integrity": "sha512-/LypJhzFmyBIDYP9aDVgeyEb5sQfbfY5mnDq4hVhlQ69js87wXfmEI5V3xI6vvXasqebp0oCytYFLxsBVfCzSg==", - "requires": { - "for-each": "^0.3.3", - "string.prototype.trim": "^1.1.2" - } + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.3.tgz", + "integrity": "sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA==" }, "parse-json": { "version": "4.0.0", @@ -9517,6 +10572,14 @@ "normalize-url": "^3.3.0", "parse-path": "^4.0.0", "protocols": "^1.4.0" + }, + "dependencies": { + "normalize-url": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz", + "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==", + "dev": true + } } }, "parseurl": { @@ -9543,9 +10606,9 @@ "dev": true }, "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "path-is-absolute": { @@ -9578,21 +10641,10 @@ "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" }, "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true }, "pathval": { "version": "1.1.0", @@ -9623,9 +10675,9 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, "picomatch": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", - "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.1.1.tgz", + "integrity": "sha512-OYMyqkKzK7blWO/+XZYP6w8hH0LDvkBvdvKukti+7kqYFCiEAk+gI3DWnryapc0Dau05ugGTy0foQ6mqn4AHYA==", "dev": true }, "pify": { @@ -9647,12 +10699,63 @@ } }, "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", "dev": true, "requires": { - "find-up": "^3.0.0" + "find-up": "^2.1.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } } }, "posix-character-classes": { @@ -9674,14 +10777,14 @@ "dev": true }, "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" }, "prettier": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", - "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", "dev": true }, "prettier-linter-helpers": { @@ -9705,9 +10808,9 @@ "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=" }, "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "progress": { "version": "2.0.3", @@ -9788,10 +10891,9 @@ } }, "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -9806,6 +10908,18 @@ "duplexify": "^3.6.0", "inherits": "^2.0.3", "pump": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } } }, "punycode": { @@ -9857,12 +10971,6 @@ "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", @@ -9900,30 +11008,92 @@ } }, "react-is": { - "version": "16.9.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.9.0.tgz", - "integrity": "sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==", + "version": "16.11.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.11.0.tgz", + "integrity": "sha512-gbBVYR2p8mnriqAwWx9LbuUrShnAuSCNnuPGyc7GJrMVQtPDAh8iLpv7FRuMPFb56KkaVZIYSz1PrjI9q0QPCw==", "dev": true }, "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", "dev": true, "requires": { - "load-json-file": "^4.0.0", + "load-json-file": "^2.0.0", "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" + "path-type": "^2.0.0" + }, + "dependencies": { + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + } } }, "read-pkg-up": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", - "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", "dev": true, "requires": { - "find-up": "^3.0.0", - "read-pkg": "^3.0.0" + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } } }, "readable-stream": { @@ -9938,6 +11108,13 @@ "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } } }, "readdirp": { @@ -9949,6 +11126,133 @@ "graceful-fs": "^4.1.11", "micromatch": "^3.1.10", "readable-stream": "^2.0.2" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } } }, "rechoir": { @@ -9967,9 +11271,9 @@ "dev": true }, "regenerator-runtime": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", - "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", "dev": true }, "regenerator-transform": { @@ -10042,14 +11346,6 @@ "dev": true, "requires": { "jsesc": "~0.5.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - } } }, "release-it": { @@ -10097,16 +11393,6 @@ "ms": "^2.1.1" } }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, "form-data": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", @@ -10118,13 +11404,19 @@ "mime-types": "^2.1.12" } }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "dev": true + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", "dev": true, "requires": { - "p-locate": "^4.1.0" + "mime-db": "1.40.0" } }, "ms": { @@ -10133,35 +11425,19 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "ora": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/ora/-/ora-4.0.2.tgz", + "integrity": "sha512-YUOZbamht5mfLxPmk4M35CD/5DuOkAacxlEUbStVXpBAt4fyhBf+vZHI/HRkI++QUp3sNoeA2Gw4C+hi4eGSig==", "dev": true, "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "yargs-parser": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.0.tgz", - "integrity": "sha512-xLTUnCMc4JhxrPEPUYD5IBR1mWCK/aT6+RJ/K29JY2y1vD+FhtgKK0AXRWvI262q3QSffAQuTouFIKUuHX89wQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "chalk": "^2.4.2", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.2.0", + "is-interactive": "^1.0.0", + "log-symbols": "^3.0.0", + "strip-ansi": "^5.2.0", + "wcwidth": "^1.0.1" } } } @@ -10284,9 +11560,9 @@ "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.12.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", + "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -10299,14 +11575,6 @@ "dev": true, "requires": { "resolve-from": "^3.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - } } }, "resolve-dir": { @@ -10333,9 +11601,9 @@ } }, "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", "dev": true }, "resolve-options": { @@ -10417,12 +11685,11 @@ } }, "rlp": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz", - "integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.4.tgz", + "integrity": "sha512-fdq2yYCWpAQBhwkZv+Z8o/Z4sPmYm1CUq6P7n6lVTOdb949CnqA0sndXal5C1NleSVSZm6q5F3iEbauyVln/iw==", "requires": { - "bn.js": "^4.11.1", - "safe-buffer": "^5.1.1" + "bn.js": "^4.11.1" } }, "run-async": { @@ -10465,9 +11732,9 @@ } }, "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" }, "safe-event-emitter": { "version": "1.0.1", @@ -10531,6 +11798,15 @@ "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", @@ -10594,10 +11870,9 @@ "dev": true }, "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, "semver-diff": { "version": "2.1.0", @@ -10606,6 +11881,14 @@ "dev": true, "requires": { "semver": "^5.0.3" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "send": { @@ -10636,9 +11919,9 @@ } }, "serialize-javascript": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.7.0.tgz", - "integrity": "sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.9.1.tgz", + "integrity": "sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==", "dev": true }, "serve-static": { @@ -10696,6 +11979,21 @@ "requires": { "is-extendable": "^0.1.0" } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true } } }, @@ -10793,6 +12091,14 @@ "ansi-styles": "^3.2.0", "astral-regex": "^1.0.0", "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } } }, "snapdragon": { @@ -10828,6 +12134,69 @@ "requires": { "is-extendable": "^0.1.0" } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true } } }, @@ -10842,43 +12211,11 @@ "snapdragon-util": "^3.0.1" }, "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true } } }, @@ -10958,9 +12295,9 @@ "dev": true }, "spawn-wrap": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.2.tgz", - "integrity": "sha512-vMwR3OmmDhnxCVxM8M+xO/FtIp6Ju/mNaDfCMMW7FDcLRTPFWUswec4LXJHTJE2hwTI9O0YBfygu4DalFl7Ylg==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.3.tgz", + "integrity": "sha512-IgB8md0QW/+tWqcavuFgKYR/qIRvJkRLPJDFaoXtLLUaVcCDK0+HeFTkmQHj3eprcYhc+gOl0aEA1w7qZlYezw==", "dev": true, "requires": { "foreground-child": "^1.5.6", @@ -10998,9 +12335,9 @@ } }, "spdx-license-ids": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", - "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "dev": true }, "split-string": { @@ -11061,6 +12398,69 @@ "requires": { "is-descriptor": "^0.1.0" } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true } } }, @@ -11123,22 +12523,55 @@ } }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } } }, "string.prototype.trim": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.0.tgz", - "integrity": "sha512-9EIjYD/WdlvLpn987+ctkLf0FfvBefOCuiEr2henD8X+7jfwPnyvTdmW8OJhj5p+M0/96mBdynLWkxUr+rHlpg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", + "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.0", + "function-bind": "^1.0.2" + } + }, + "string.prototype.trimleft": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", + "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", + "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", + "dev": true, "requires": { "define-properties": "^1.1.3", - "es-abstract": "^1.13.0", "function-bind": "^1.1.1" } }, @@ -11148,15 +12581,30 @@ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^4.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + } } }, "strip-bom": { @@ -11229,6 +12677,11 @@ "xhr-request-promise": "^0.1.2" }, "dependencies": { + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, "got": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", @@ -11254,6 +12707,19 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==" + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" + }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "requires": { + "prepend-http": "^1.0.1" + } } } }, @@ -11269,22 +12735,16 @@ "string-width": "^3.0.0" }, "dependencies": { - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "string-width": { @@ -11297,15 +12757,6 @@ "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^5.1.0" } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } } } }, @@ -11336,27 +12787,19 @@ "through": "~2.3.8" }, "dependencies": { - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, - "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=", + "resolve": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", + "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.0", - "function-bind": "^1.0.2" + "path-parse": "^1.0.6" } } } @@ -11373,13 +12816,6 @@ "mkdirp": "^0.5.0", "safe-buffer": "^5.1.2", "yallist": "^3.0.3" - }, - "dependencies": { - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" - } } }, "tar-stream": { @@ -11430,13 +12866,19 @@ "signal-exit": "^3.0.0", "strip-eof": "^1.0.0" } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true } } }, "terser": { - "version": "4.3.9", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.3.9.tgz", - "integrity": "sha512-NFGMpHjlzmyOtPL+fDw3G7+6Ueh/sz4mkaUYa4lJCxOPTNzd0Uj0aZJOmsDYoSQyfuVoWDMSWTPU3huyOm2zdA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.4.0.tgz", + "integrity": "sha512-oDG16n2WKm27JO8h4y/w3iqBGAOSCtq7k8dRmrn4Wf9NouL0b2WpMHGChFGZq4nFAQy1FsNJrVQHfurXOSTmOA==", "dev": true, "requires": { "commander": "^2.20.0", @@ -11493,6 +12935,90 @@ "minimatch": "^3.0.4", "read-pkg-up": "^4.0.0", "require-main-filename": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", + "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "dev": true, + "requires": { + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" + } + } } }, "text-table": { @@ -11588,9 +13114,9 @@ "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==" }, "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", "dev": true }, "to-object-path": { @@ -11634,16 +13160,33 @@ "extend-shallow": "^3.0.2", "regex-not": "^1.0.2", "safe-regex": "^1.1.0" + }, + "dependencies": { + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } } }, "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" + "is-number": "^7.0.0" } }, "to-through": { @@ -11691,9 +13234,9 @@ "dev": true }, "ts-node": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.4.1.tgz", - "integrity": "sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.5.0.tgz", + "integrity": "sha512-fbG32iZEupNV2E2Fd2m2yt1TdAwR3GTCrJQBHDevIiEBNy1A8kqnyl1fv7jmRmmbtcapFab2glZXHJvfD1ed0Q==", "dev": true, "requires": { "arg": "^4.1.0", @@ -11746,9 +13289,9 @@ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, "type": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/type/-/type-1.0.3.tgz", - "integrity": "sha512-51IMtNfVcee8+9GJvj0spSuFcZHe9vSib6Xtgsny1Km9ugyz2mbS08I3rsUIRYgJohFRFU1160sgRodYz378Hg==" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" }, "type-check": { "version": "0.3.2", @@ -11795,22 +13338,22 @@ } }, "typedoc": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.15.0.tgz", - "integrity": "sha512-NOtfq5Tis4EFt+J2ozhVq9RCeUnfEYMFKoU6nCXCXUULJz1UQynOM+yH3TkfZCPLzigbqB0tQYGVlktUWweKlw==", + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.15.2.tgz", + "integrity": "sha512-K2nFEtyDQTVdXOzYtECw3TwuT3lM91Zc0dzGSLuor5R8qzZbwqBoCw7xYGVBow6+mEZAvKGznLFsl7FzG+wAgQ==", "dev": true, "requires": { "@types/minimatch": "3.0.3", "fs-extra": "^8.1.0", - "handlebars": "^4.1.2", - "highlight.js": "^9.15.8", + "handlebars": "^4.5.1", + "highlight.js": "^9.16.2", "lodash": "^4.17.15", "marked": "^0.7.0", "minimatch": "^3.0.0", "progress": "^2.0.3", "shelljs": "^0.8.3", - "typedoc-default-themes": "^0.6.0", - "typescript": "3.5.x" + "typedoc-default-themes": "^0.6.1", + "typescript": "3.7.x" }, "dependencies": { "fs-extra": { @@ -11823,36 +13366,18 @@ "jsonfile": "^4.0.0", "universalify": "^0.1.0" } - }, - "graceful-fs": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz", - "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==", - "dev": true - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - }, - "typescript": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", - "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", - "dev": true } } }, "typedoc-default-themes": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.6.0.tgz", - "integrity": "sha512-MdTROOojxod78CEv22rIA69o7crMPLnVZPefuDLt/WepXqJwgiSu8Xxq+H36x0Jj3YGc7lOglI2vPJ2GhoOybw==", + "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==", "dev": true, "requires": { "backbone": "^1.4.0", "jquery": "^3.4.1", - "lunr": "^2.3.6", + "lunr": "^2.3.8", "underscore": "^1.9.1" } }, @@ -11863,19 +13388,19 @@ "dev": true }, "uglify-js": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", - "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", + "version": "3.6.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.9.tgz", + "integrity": "sha512-pcnnhaoG6RtrvHJ1dFncAe8Od6Nuy30oaJ82ts6//sGSXOP5UjBMEthiProjXmMNHOfd93sqlkztifFMcb+4yw==", "dev": true, "requires": { - "commander": "~2.20.0", + "commander": "~2.20.3", "source-map": "~0.6.1" }, "dependencies": { "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "source-map": { @@ -12047,13 +13572,19 @@ "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true } } }, "upath": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", - "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", "dev": true }, "update-notifier": { @@ -12115,11 +13646,11 @@ "dev": true }, "url-parse-lax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", "requires": { - "prepend-http": "^1.0.1" + "prepend-http": "^2.0.0" } }, "url-set-query": { @@ -12150,6 +13681,14 @@ "dev": true, "requires": { "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } } }, "util-deprecate": { @@ -12216,6 +13755,14 @@ "cloneable-readable": "^1.0.0", "remove-trailing-separator": "^1.0.1", "replace-ext": "^1.0.0" + }, + "dependencies": { + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + } } }, "vinyl-fs": { @@ -12259,9 +13806,9 @@ } }, "vm-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", - "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", "dev": true }, "watchpack": { @@ -12540,6 +14087,12 @@ "xtend": "^4.0.1" }, "dependencies": { + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, "ethereumjs-tx": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz", @@ -12565,6 +14118,18 @@ "secp256k1": "^3.0.1" } }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "dev": true, + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + }, "ws": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", @@ -12685,16 +14250,43 @@ "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==", "dev": true }, - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" } }, "eslint-scope": { @@ -12706,6 +14298,92 @@ "esrecurse": "^4.1.0", "estraverse": "^4.1.1" } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } } } }, @@ -12728,23 +14406,12 @@ "yargs": "13.2.4" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, "enhanced-resolve": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz", @@ -12756,6 +14423,46 @@ "tapable": "^1.0.0" } }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -12767,15 +14474,6 @@ "strip-ansi": "^5.1.0" } }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, "supports-color": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", @@ -12791,17 +14489,6 @@ "integrity": "sha512-CNmdbwQMBjwr9Gsmohvm0pbL954tJrNzf6gWL3K+QMQf00PF7ERGrEiLgjuU3mKreLC2MeGhUsNV9ybTbLgd3w==", "dev": true }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, "yargs": { "version": "13.2.4", "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", @@ -12860,6 +14547,26 @@ } } }, + "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", @@ -12898,6 +14605,39 @@ "dev": true, "requires": { "string-width": "^1.0.2 || 2" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, "widest-line": { @@ -12907,6 +14647,39 @@ "dev": true, "requires": { "string-width": "^2.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, "window-size": { @@ -12919,42 +14692,28 @@ "is-number": "^3.0.0" }, "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { - "is-descriptor": "^1.0.0" + "kind-of": "^3.0.2" } }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" + "is-buffer": "^1.1.5" } } } @@ -12968,6 +14727,12 @@ "execa": "^1.0.0" } }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", @@ -12984,48 +14749,37 @@ } }, "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" }, "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true }, "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" } } } @@ -13062,6 +14816,13 @@ "async-limiter": "~1.0.0", "safe-buffer": "~5.1.0", "ultron": "~1.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } } }, "xdg-basedir": { @@ -13117,9 +14878,9 @@ "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" }, "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" }, "y18n": { "version": "4.0.0", @@ -13133,34 +14894,72 @@ "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" }, "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "yargs": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", - "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", "dev": true, "requires": { - "cliui": "^4.0.0", + "cliui": "^5.0.0", "find-up": "^3.0.0", "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.0.0" + "yargs-parser": "^13.1.1" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, "string-width": { @@ -13174,21 +14973,22 @@ "strip-ansi": "^5.1.0" } }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } } } }, "yargs-parser": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", - "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.0.tgz", + "integrity": "sha512-xLTUnCMc4JhxrPEPUYD5IBR1mWCK/aT6+RJ/K29JY2y1vD+FhtgKK0AXRWvI262q3QSffAQuTouFIKUuHX89wQ==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -13204,84 +15004,6 @@ "flat": "^4.1.0", "lodash": "^4.17.15", "yargs": "^13.3.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "yargs": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", - "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.1" - } - }, - "yargs-parser": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", - "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } } }, "yauzl": { diff --git a/src/keeper/contracts/DIDRegistry.ts b/src/keeper/contracts/DIDRegistry.ts index f061128..a2e02c2 100644 --- a/src/keeper/contracts/DIDRegistry.ts +++ b/src/keeper/contracts/DIDRegistry.ts @@ -33,17 +33,21 @@ export default class DIDRegistry extends ContractBase { } public async getAttributesByOwner(owner: string): Promise { - return (await this.getPastEvents('DIDAttributeRegistered', { - _owner: zeroX(owner) - })) + return ( + await this.getPastEvents('DIDAttributeRegistered', { + _owner: zeroX(owner) + }) + ) .map(({ returnValues }) => returnValues._did) .map(didPrefixed) } public async getAttributesByDid(did: string): Promise<{ did: string; serviceEndpoint: string; checksum: string }> { - return (await this.getPastEvents('DIDAttributeRegistered', { - _did: didZeroX(did) - })).map(({ returnValues: { _did, _checksum: checksum, _value: serviceEndpoint } }) => ({ + return ( + await this.getPastEvents('DIDAttributeRegistered', { + _did: didZeroX(did) + }) + ).map(({ returnValues: { _did, _checksum: checksum, _value: serviceEndpoint } }) => ({ did: didPrefixed(_did), serviceEndpoint, checksum diff --git a/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts b/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts index a9f733e..4a11585 100644 --- a/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts +++ b/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts @@ -20,9 +20,11 @@ export class AccessSecretStoreCondition extends Condition { } public async getGrantedDidByConsumer(consumer: string): Promise<{ did: string; agreementId: string }[]> { - return (await this.getPastEvents('Fulfilled', { - _grantee: zeroX(consumer) - })).map(({ returnValues }) => ({ + return ( + await this.getPastEvents('Fulfilled', { + _grantee: zeroX(consumer) + }) + ).map(({ returnValues }) => ({ did: didPrefixed(returnValues._documentId), agreementId: zeroX(returnValues._agreementId) })) diff --git a/src/keeper/contracts/managers/AgreementStoreManager.ts b/src/keeper/contracts/managers/AgreementStoreManager.ts index 98c015a..5cd04cb 100644 --- a/src/keeper/contracts/managers/AgreementStoreManager.ts +++ b/src/keeper/contracts/managers/AgreementStoreManager.ts @@ -23,10 +23,14 @@ export class AgreementStoreManager extends ContractBase { } public async getAgreement(agreementId: string) { - const { did, didOwner, templateId, conditionIds, lastUpdatedBy, blockNumberUpdated } = await this.call( - 'getAgreement', - [zeroX(agreementId)] - ) + const { + did, + didOwner, + templateId, + conditionIds, + lastUpdatedBy, + blockNumberUpdated + } = await this.call('getAgreement', [zeroX(agreementId)]) return { did, didOwner, diff --git a/src/keeper/contracts/managers/ConditionStoreManager.ts b/src/keeper/contracts/managers/ConditionStoreManager.ts index 44ab8e8..996ba39 100644 --- a/src/keeper/contracts/managers/ConditionStoreManager.ts +++ b/src/keeper/contracts/managers/ConditionStoreManager.ts @@ -25,10 +25,15 @@ export class ConditionStoreManager extends ContractBase { } public async getCondition(conditionId: string) { - const { typeRef, state, timeLock, timeOut, blockNumber, lastUpdatedBy, blockNumberUpdated } = await this.call( - 'getCondition', - [zeroX(conditionId)] - ) + const { + typeRef, + state, + timeLock, + timeOut, + blockNumber, + lastUpdatedBy, + blockNumberUpdated + } = await this.call('getCondition', [zeroX(conditionId)]) return { typeRef, state: +state, diff --git a/test/ocean/OceanAssets.test.ts b/test/ocean/OceanAssets.test.ts index 32a0a52..7e60c02 100644 --- a/test/ocean/OceanAssets.test.ts +++ b/test/ocean/OceanAssets.test.ts @@ -1,5 +1,5 @@ import { assert, spy, use } from 'chai' -import * as spies from 'chai-spies' +import spies from 'chai-spies' import { SearchQuery } from '../../src/aquarius/Aquarius' import { Ocean } from '../../src/ocean/Ocean' From 143fcbecf3661d6a0da7f7d44f74d82caca41ad1 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 15 Nov 2019 00:00:10 +0100 Subject: [PATCH 43/56] tweak printWidth --- .prettierrc | 2 +- integration/ocean/AssetOwners.test.ts | 35 ++++-- integration/ocean/ConsumeAsset.test.ts | 46 ++++++-- integration/ocean/ConsumeAssetBrizo.test.ts | 26 ++++- integration/ocean/ConsumeBigAsset.test.ts | 20 +++- ...terEscrowAccessSecretStoreTemplate.test.ts | 96 +++++++++++++--- ...sterEscrowComputeExecutionTemplate.test.ts | 96 +++++++++++++--- integration/ocean/SearchAsset.test.ts | 37 ++++-- integration/utils/ddo-metadata-generator.ts | 6 +- plugins/add-vendors-plugin.js | 35 +++--- src/Instantiable.abstract.ts | 4 +- src/aquarius/Aquarius.ts | 41 +++++-- src/brizo/Brizo.ts | 24 +++- src/ddo/DDO.ts | 21 +++- src/ddo/PublicKey.ts | 6 +- src/ddo/Service.ts | 12 +- src/keeper/ContractHandler.ts | 26 ++++- src/keeper/EventHandler.ts | 11 +- src/keeper/Keeper.ts | 36 ++++-- src/keeper/Web3Provider.ts | 6 +- src/keeper/contracts/ContractBase.ts | 46 ++++++-- src/keeper/contracts/DIDRegistry.ts | 30 +++-- src/keeper/contracts/GenericContract.ts | 5 +- src/keeper/contracts/Token.ts | 4 +- .../conditions/AccessSecretStoreCondition.ts | 20 +++- .../conditions/ComputeExecutionCondition.ts | 29 ++++- .../conditions/Condition.abstract.ts | 7 +- .../contracts/conditions/EscrowReward.ts | 5 +- .../conditions/LockRewardCondition.ts | 11 +- .../managers/AgreementStoreManager.ts | 8 +- .../managers/ConditionStoreManager.ts | 8 +- .../managers/TemplateStoreManager.ts | 21 +++- .../templates/AgreementTemplate.abstract.ts | 57 +++++++--- .../templates/BaseEscrowTemplate.abstract.ts | 10 +- ...tStoreTemplate.serviceAgreementTemplate.ts | 6 +- .../EscrowAccessSecretStoreTemplate.ts | 43 +++++-- ...cutionTemplate.serviceAgreementTemplate.ts | 6 +- .../EscrowComputeExecutionTemplate.ts | 43 +++++-- src/ocean/Account.ts | 8 +- src/ocean/Ocean.ts | 5 +- src/ocean/OceanAccounts.ts | 4 +- src/ocean/OceanAgreements.ts | 34 ++++-- src/ocean/OceanAgreementsConditions.ts | 56 +++++++-- src/ocean/OceanAssets.ts | 77 ++++++++++--- src/ocean/OceanAuth.ts | 14 ++- src/ocean/OceanSecretStore.ts | 35 +++++- src/ocean/utils/ServiceAgreement.ts | 10 +- src/ocean/utils/SignatureUtils.ts | 11 +- src/ocean/utils/WebServiceConnector.ts | 10 +- src/utils/ConversionTypeHelpers.ts | 18 ++- src/utils/DDOHelpers.ts | 5 +- src/utils/SubscribableObserver.ts | 6 +- test/aquarius/Aquarius.test.ts | 7 +- test/ddo/DDO.test.ts | 20 +++- test/keeper/ContractEvent.test.ts | 4 +- test/keeper/DIDRegistry.test.ts | 50 ++++++-- test/keeper/TestContractHandler.ts | 107 ++++++++++++------ .../AccessSecretStoreCondition.test.ts | 3 +- test/keeper/conditions/EscrowReward.test.ts | 28 ++++- .../conditions/LockRewardCondition.test.ts | 3 +- test/mocks/WebServiceConnector.mock.ts | 4 +- test/ocean/Account.test.ts | 10 +- test/ocean/OceanSecretStore.test.ts | 6 +- test/ocean/utils/SignatureUtils.test.ts | 11 +- test/utils/ConversionTypeHelpers.test.ts | 7 +- 65 files changed, 1185 insertions(+), 313 deletions(-) diff --git a/.prettierrc b/.prettierrc index 9311b5b..b037fe9 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,6 @@ { "semi": false, "singleQuote": true, - "printWidth": 120, + "printWidth": 90, "trailingComma": "none" } diff --git a/integration/ocean/AssetOwners.test.ts b/integration/ocean/AssetOwners.test.ts index 74704da..5133513 100644 --- a/integration/ocean/AssetOwners.test.ts +++ b/integration/ocean/AssetOwners.test.ts @@ -32,7 +32,10 @@ describe('Asset Owners', () => { it('should set the provider of an asset', async () => { const ddo = await ocean.assets.create(metadata as any, account1) - const isProvider = await ocean.keeper.didRegistry.isDIDProvider(ddo.id, config.brizoAddress) + const isProvider = await ocean.keeper.didRegistry.isDIDProvider( + ddo.id, + config.brizoAddress + ) assert.isTrue(isProvider) }) @@ -40,11 +43,19 @@ describe('Asset Owners', () => { it('should be added correctly a permission on an asset', async () => { const ddo = await ocean.assets.create(metadata as any, account1) - assert.isFalse(await ocean.keeper.didRegistry.getPermission(ddo.id, account2.getId())) + assert.isFalse( + await ocean.keeper.didRegistry.getPermission(ddo.id, account2.getId()) + ) - await ocean.keeper.didRegistry.grantPermission(ddo.id, account2.getId(), account1.getId()) + await ocean.keeper.didRegistry.grantPermission( + ddo.id, + account2.getId(), + account1.getId() + ) - assert.isTrue(await ocean.keeper.didRegistry.getPermission(ddo.id, account2.getId())) + assert.isTrue( + await ocean.keeper.didRegistry.getPermission(ddo.id, account2.getId()) + ) }) it('should get the assets owned by a user', async () => { @@ -61,16 +72,22 @@ describe('Asset Owners', () => { }) it('should get the assets that can be consumed by a user', async () => { - const { length: initialLength } = await ocean.assets.consumerAssets(account2.getId()) + const { length: initialLength } = await ocean.assets.consumerAssets( + account2.getId() + ) const ddo = await ocean.assets.create(metadata as any, account1) - const { length: finalLength1 } = await ocean.assets.consumerAssets(account2.getId()) + const { length: finalLength1 } = await ocean.assets.consumerAssets( + account2.getId() + ) assert.equal(finalLength1 - initialLength, 0) // Granting access try { - await account2.requestTokens(+metadata.main.price * 10 ** -(await ocean.keeper.token.decimals())) + await account2.requestTokens( + +metadata.main.price * 10 ** -(await ocean.keeper.token.decimals()) + ) } catch {} const { index } = ddo.findServiceByType('access') @@ -78,7 +95,9 @@ describe('Asset Owners', () => { await ocean.assets.order(ddo.id, index, account2) // Access granted - const { length: finalLength2 } = await ocean.assets.consumerAssets(account2.getId()) + const { length: finalLength2 } = await ocean.assets.consumerAssets( + account2.getId() + ) assert.equal(finalLength2 - initialLength, 1) }) diff --git a/integration/ocean/ConsumeAsset.test.ts b/integration/ocean/ConsumeAsset.test.ts index 992441f..58e60cf 100644 --- a/integration/ocean/ConsumeAsset.test.ts +++ b/integration/ocean/ConsumeAsset.test.ts @@ -37,28 +37,48 @@ describe('Consume Asset', () => { assert.isDefined(ddo, 'Register has not returned a DDO') assert.match(ddo.id, /^did:op:[a-f0-9]{64}$/, 'DDO id is not valid') assert.isAtLeast(ddo.authentication.length, 1, 'Default authentication not added') - assert.isDefined(ddo.findServiceByType('access'), "DDO access service doesn't exist") + assert.isDefined( + ddo.findServiceByType('access'), + "DDO access service doesn't exist" + ) }) it('should be able to request tokens for consumer', async () => { const initialBalance = (await consumer.getBalance()).ocn - const claimedTokens = +metadata.main.price * 10 ** -(await ocean.keeper.token.decimals()) + const claimedTokens = + +metadata.main.price * 10 ** -(await ocean.keeper.token.decimals()) try { await consumer.requestTokens(claimedTokens) } catch {} - assert.equal((await consumer.getBalance()).ocn, initialBalance + claimedTokens, 'OCN Tokens not delivered') + assert.equal( + (await consumer.getBalance()).ocn, + initialBalance + claimedTokens, + 'OCN Tokens not delivered' + ) }) it('should sign the service agreement', async () => { const accessService = ddo.findServiceByType('access') - serviceAgreementSignatureResult = await ocean.agreements.prepare(ddo.id, accessService.index, consumer) + serviceAgreementSignatureResult = await ocean.agreements.prepare( + ddo.id, + accessService.index, + consumer + ) const { agreementId, signature } = serviceAgreementSignatureResult - assert.match(agreementId, /^0x[a-f0-9]{64}$/, 'Service agreement ID seems not valid') - assert.match(signature, /^0x[a-f0-9]{130}$/, 'Service agreement signature seems not valid') + assert.match( + agreementId, + /^0x[a-f0-9]{64}$/, + 'Service agreement ID seems not valid' + ) + assert.match( + signature, + /^0x[a-f0-9]{130}$/, + 'Service agreement signature seems not valid' + ) }) it('should execute the service agreement', async () => { @@ -77,7 +97,9 @@ describe('Consume Asset', () => { }) it('should get the agreement conditions status not fulfilled', async () => { - const status = await ocean.agreements.status(serviceAgreementSignatureResult.agreementId) + const status = await ocean.agreements.status( + serviceAgreementSignatureResult.agreementId + ) assert.deepEqual(status, { lockReward: ConditionState.Unfulfilled, @@ -118,7 +140,9 @@ describe('Consume Asset', () => { }) it('should get the agreement conditions status fulfilled', async () => { - const status = await ocean.agreements.status(serviceAgreementSignatureResult.agreementId) + const status = await ocean.agreements.status( + serviceAgreementSignatureResult.agreementId + ) assert.deepEqual(status, { lockReward: ConditionState.Fulfilled, @@ -147,7 +171,11 @@ describe('Consume Asset', () => { }) }) - assert.deepEqual(files, ['README.md', 'package.json'], 'Stored files are not correct.') + assert.deepEqual( + files, + ['README.md', 'package.json'], + 'Stored files are not correct.' + ) }) it('should consume and store one asset', async () => { diff --git a/integration/ocean/ConsumeAssetBrizo.test.ts b/integration/ocean/ConsumeAssetBrizo.test.ts index 6b965dd..4459f1b 100644 --- a/integration/ocean/ConsumeAssetBrizo.test.ts +++ b/integration/ocean/ConsumeAssetBrizo.test.ts @@ -41,7 +41,9 @@ describe('Consume Asset (Brizo)', () => { it('should regiester an asset', async () => { const steps = [] - ddo = await ocean.assets.create(metadata as any, publisher).next(step => steps.push(step)) + ddo = await ocean.assets + .create(metadata as any, publisher) + .next(step => steps.push(step)) assert.instanceOf(ddo, DDO) assert.deepEqual(steps, [0, 1, 2, 3, 4, 5, 6, 7]) @@ -51,11 +53,15 @@ describe('Consume Asset (Brizo)', () => { const accessService = ddo.findServiceByType('access') try { - await consumer.requestTokens(+metadata.main.price * 10 ** -(await ocean.keeper.token.decimals())) + await consumer.requestTokens( + +metadata.main.price * 10 ** -(await ocean.keeper.token.decimals()) + ) } catch {} const steps = [] - agreementId = await ocean.assets.order(ddo.id, accessService.index, consumer).next(step => steps.push(step)) + agreementId = await ocean.assets + .order(ddo.id, accessService.index, consumer) + .next(step => steps.push(step)) assert.isDefined(agreementId) assert.deepEqual(steps, [0, 1, 2, 3]) @@ -65,7 +71,13 @@ describe('Consume Asset (Brizo)', () => { const accessService = ddo.findServiceByType('access') const folder = '/tmp/ocean/squid-js' - const path = await ocean.assets.consume(agreementId, ddo.id, accessService.index, consumer, folder) + const path = await ocean.assets.consume( + agreementId, + ddo.id, + accessService.index, + consumer, + folder + ) assert.include(path, folder, 'The storage path is not correct.') @@ -75,6 +87,10 @@ describe('Consume Asset (Brizo)', () => { }) }) - assert.deepEqual(files, ['README.md', 'package.json'], 'Stored files are not correct.') + assert.deepEqual( + files, + ['README.md', 'package.json'], + 'Stored files are not correct.' + ) }) }) diff --git a/integration/ocean/ConsumeBigAsset.test.ts b/integration/ocean/ConsumeBigAsset.test.ts index f82a7f5..ca2223f 100644 --- a/integration/ocean/ConsumeBigAsset.test.ts +++ b/integration/ocean/ConsumeBigAsset.test.ts @@ -32,7 +32,13 @@ xdescribe('Consume Asset (Large size)', () => { ...baseMetadata, main: { ...baseMetadata.main, - files: [{ index: 0, contentType: 'hello/hello', url: 'https://speed.hetzner.de/1GB.bin' }] + files: [ + { + index: 0, + contentType: 'hello/hello', + url: 'https://speed.hetzner.de/1GB.bin' + } + ] } } }) @@ -47,7 +53,9 @@ xdescribe('Consume Asset (Large size)', () => { const accessService = ddo.findServiceByType('access') try { - await consumer.requestTokens(+metadata.main.price * 10 ** -(await ocean.keeper.token.decimals())) + await consumer.requestTokens( + +metadata.main.price * 10 ** -(await ocean.keeper.token.decimals()) + ) } catch {} agreementId = await ocean.assets.order(ddo.id, accessService.index, consumer) @@ -59,7 +67,13 @@ xdescribe('Consume Asset (Large size)', () => { const accessService = ddo.findServiceByType('access') const folder = '/tmp/ocean/squid-js' - const path = await ocean.assets.consume(agreementId, ddo.id, accessService.index, consumer, folder) + const path = await ocean.assets.consume( + agreementId, + ddo.id, + accessService.index, + consumer, + folder + ) assert.include(path, folder, 'The storage path is not correct.') diff --git a/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts b/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts index 03193a0..0dd54c8 100644 --- a/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts +++ b/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts @@ -47,13 +47,21 @@ describe('Register Escrow Access Secret Store Template', () => { describe('Propose and approve template', () => { it('should propose the template', async () => { - await keeper.templateStoreManager.proposeTemplate(template.getAddress(), consumer.getId(), true) + await keeper.templateStoreManager.proposeTemplate( + template.getAddress(), + consumer.getId(), + true + ) // TODO: Use a event to detect template mined await new Promise(resolve => setTimeout(resolve, 2 * 1000)) }) it('should approve the template', async () => { - await keeper.templateStoreManager.approveTemplate(template.getAddress(), templateManagerOwner.getId(), true) + await keeper.templateStoreManager.approveTemplate( + template.getAddress(), + templateManagerOwner.getId(), + true + ) // TODO: Use a event to detect template mined await new Promise(resolve => setTimeout(resolve, 2 * 1000)) }) @@ -68,11 +76,21 @@ describe('Register Escrow Access Secret Store Template', () => { let conditionIdEscrow: string it('should register a DID', async () => { - await keeper.didRegistry.registerAttribute(did, checksum, [], url, publisher.getId()) + await keeper.didRegistry.registerAttribute( + did, + checksum, + [], + url, + publisher.getId() + ) }) it('should generate the condition IDs', async () => { - conditionIdAccess = await accessSecretStoreCondition.generateIdHash(agreementId, did, consumer.getId()) + conditionIdAccess = await accessSecretStoreCondition.generateIdHash( + agreementId, + did, + consumer.getId() + ) conditionIdLock = await lockRewardCondition.generateIdHash( agreementId, await escrowReward.getAddress(), @@ -108,10 +126,20 @@ describe('Register Escrow Access Secret Store Template', () => { assert.equal(conditionInstances.length, 3, 'Expected 3 conditions.') - const conditionClasses = [AccessSecretStoreCondition, EscrowReward, LockRewardCondition] + const conditionClasses = [ + AccessSecretStoreCondition, + EscrowReward, + LockRewardCondition + ] conditionClasses.forEach(conditionClass => { - if (!conditionInstances.find(condition => condition instanceof conditionClass)) { - throw new Error(`${conditionClass.name} is not part of the conditions.`) + if ( + !conditionInstances.find( + condition => condition instanceof conditionClass + ) + ) { + throw new Error( + `${conditionClass.name} is not part of the conditions.` + ) } }) }) @@ -131,7 +159,10 @@ describe('Register Escrow Access Secret Store Template', () => { }) it('should not grant the access to the consumer', async () => { - const accessGranted = await accessSecretStoreCondition.checkPermissions(consumer.getId(), did) + const accessGranted = await accessSecretStoreCondition.checkPermissions( + consumer.getId(), + did + ) assert.isFalse(accessGranted, 'Consumer has been granted.') }) @@ -141,7 +172,11 @@ describe('Register Escrow Access Secret Store Template', () => { await consumer.requestTokens(escrowAmount) } catch {} - await keeper.token.approve(lockRewardCondition.getAddress(), escrowAmount, consumer.getId()) + await keeper.token.approve( + lockRewardCondition.getAddress(), + escrowAmount, + consumer.getId() + ) const fulfill = await lockRewardCondition.fulfill( agreementId, @@ -179,7 +214,10 @@ describe('Register Escrow Access Secret Store Template', () => { }) it('should grant the access to the consumer', async () => { - const accessGranted = await accessSecretStoreCondition.checkPermissions(consumer.getId(), did) + const accessGranted = await accessSecretStoreCondition.checkPermissions( + consumer.getId(), + did + ) assert.isTrue(accessGranted, 'Consumer has not been granted.') }) @@ -192,17 +230,31 @@ describe('Register Escrow Access Secret Store Template', () => { it('should register a DID', async () => { // This part is executed inside Ocean.assets.create() - await keeper.didRegistry.registerAttribute(did, checksum, [], url, publisher.getId()) + await keeper.didRegistry.registerAttribute( + did, + checksum, + [], + url, + publisher.getId() + ) }) it('should create a new agreement (short way)', async () => { - agreementId = await template.createFullAgreement(did, escrowAmount, consumer.getId(), publisher.getId()) + agreementId = await template.createFullAgreement( + did, + escrowAmount, + consumer.getId(), + publisher.getId() + ) assert.match(agreementId, /^0x[a-f0-9]{64}$/i) }) it('should not grant the access to the consumer', async () => { - const accessGranted = await accessSecretStoreCondition.checkPermissions(consumer.getId(), did) + const accessGranted = await accessSecretStoreCondition.checkPermissions( + consumer.getId(), + did + ) assert.isFalse(accessGranted, 'Consumer has been granted.') }) @@ -212,11 +264,20 @@ describe('Register Escrow Access Secret Store Template', () => { await consumer.requestTokens(escrowAmount) } catch {} - await ocean.agreements.conditions.lockReward(agreementId, escrowAmount, consumer) + await ocean.agreements.conditions.lockReward( + agreementId, + escrowAmount, + consumer + ) }) it('should fulfill the conditions from publisher side', async () => { - await ocean.agreements.conditions.grantAccess(agreementId, did, consumer.getId(), publisher) + await ocean.agreements.conditions.grantAccess( + agreementId, + did, + consumer.getId(), + publisher + ) await ocean.agreements.conditions.releaseReward( agreementId, escrowAmount, @@ -228,7 +289,10 @@ describe('Register Escrow Access Secret Store Template', () => { }) it('should grant the access to the consumer', async () => { - const accessGranted = await accessSecretStoreCondition.checkPermissions(consumer.getId(), did) + const accessGranted = await accessSecretStoreCondition.checkPermissions( + consumer.getId(), + did + ) assert.isTrue(accessGranted, 'Consumer has not been granted.') }) diff --git a/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts b/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts index 5cc6151..f885d53 100644 --- a/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts +++ b/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts @@ -47,13 +47,21 @@ describe('Register Escrow Compute Execution Template', () => { describe('Propose and approve template', () => { it('should propose the template', async () => { - await keeper.templateStoreManager.proposeTemplate(template.getAddress(), consumer.getId(), true) + await keeper.templateStoreManager.proposeTemplate( + template.getAddress(), + consumer.getId(), + true + ) // TODO: Use a event to detect template mined await new Promise(resolve => setTimeout(resolve, 2 * 1000)) }) it('should approve the template', async () => { - await keeper.templateStoreManager.approveTemplate(template.getAddress(), templateManagerOwner.getId(), true) + await keeper.templateStoreManager.approveTemplate( + template.getAddress(), + templateManagerOwner.getId(), + true + ) // TODO: Use a event to detect template mined await new Promise(resolve => setTimeout(resolve, 2 * 1000)) }) @@ -68,11 +76,21 @@ describe('Register Escrow Compute Execution Template', () => { let conditionIdEscrow: string it('should register a DID', async () => { - await keeper.didRegistry.registerAttribute(did, checksum, [], url, publisher.getId()) + await keeper.didRegistry.registerAttribute( + did, + checksum, + [], + url, + publisher.getId() + ) }) it('should generate the condition IDs', async () => { - conditionIdCompute = await computeExecutionCondition.generateIdHash(agreementId, did, consumer.getId()) + conditionIdCompute = await computeExecutionCondition.generateIdHash( + agreementId, + did, + consumer.getId() + ) conditionIdLock = await lockRewardCondition.generateIdHash( agreementId, await escrowReward.getAddress(), @@ -108,10 +126,20 @@ describe('Register Escrow Compute Execution Template', () => { assert.equal(conditionInstances.length, 3, 'Expected 3 conditions.') - const conditionClasses = [ComputeExecutionCondition, EscrowReward, LockRewardCondition] + const conditionClasses = [ + ComputeExecutionCondition, + EscrowReward, + LockRewardCondition + ] conditionClasses.forEach(conditionClass => { - if (!conditionInstances.find(condition => condition instanceof conditionClass)) { - throw new Error(`${conditionClass.name} is not part of the conditions.`) + if ( + !conditionInstances.find( + condition => condition instanceof conditionClass + ) + ) { + throw new Error( + `${conditionClass.name} is not part of the conditions.` + ) } }) }) @@ -131,7 +159,10 @@ describe('Register Escrow Compute Execution Template', () => { }) it('should not trigger the compute', async () => { - const computeTriggered = await computeExecutionCondition.wasComputeTriggered(did, consumer.getId()) + const computeTriggered = await computeExecutionCondition.wasComputeTriggered( + did, + consumer.getId() + ) assert.isFalse(computeTriggered, 'Compute has been triggered.') }) @@ -141,7 +172,11 @@ describe('Register Escrow Compute Execution Template', () => { await consumer.requestTokens(escrowAmount) } catch {} - await keeper.token.approve(lockRewardCondition.getAddress(), escrowAmount, consumer.getId()) + await keeper.token.approve( + lockRewardCondition.getAddress(), + escrowAmount, + consumer.getId() + ) const fulfill = await lockRewardCondition.fulfill( agreementId, @@ -179,7 +214,10 @@ describe('Register Escrow Compute Execution Template', () => { }) it('should grant the access to the consumer', async () => { - const computeTriggered = await computeExecutionCondition.wasComputeTriggered(did, consumer.getId()) + const computeTriggered = await computeExecutionCondition.wasComputeTriggered( + did, + consumer.getId() + ) assert.isTrue(computeTriggered, 'Compute has not been triggered.') }) @@ -192,17 +230,31 @@ describe('Register Escrow Compute Execution Template', () => { it('should register a DID', async () => { // This part is executed inside Ocean.assets.create() - await keeper.didRegistry.registerAttribute(did, checksum, [], url, publisher.getId()) + await keeper.didRegistry.registerAttribute( + did, + checksum, + [], + url, + publisher.getId() + ) }) it('should create a new agreement (short way)', async () => { - agreementId = await template.createFullAgreement(did, escrowAmount, consumer.getId(), publisher.getId()) + agreementId = await template.createFullAgreement( + did, + escrowAmount, + consumer.getId(), + publisher.getId() + ) assert.match(agreementId, /^0x[a-f0-9]{64}$/i) }) it('should not grant the access to the consumer', async () => { - const computeTriggered = await computeExecutionCondition.wasComputeTriggered(did, consumer.getId()) + const computeTriggered = await computeExecutionCondition.wasComputeTriggered( + did, + consumer.getId() + ) assert.isFalse(computeTriggered, 'Compute has been triggered.') }) @@ -212,11 +264,20 @@ describe('Register Escrow Compute Execution Template', () => { await consumer.requestTokens(escrowAmount) } catch {} - await ocean.agreements.conditions.lockReward(agreementId, escrowAmount, consumer) + await ocean.agreements.conditions.lockReward( + agreementId, + escrowAmount, + consumer + ) }) it('should fulfill the conditions from computing side', async () => { - await ocean.agreements.conditions.grantServiceExecution(agreementId, did, consumer.getId(), publisher) + await ocean.agreements.conditions.grantServiceExecution( + agreementId, + did, + consumer.getId(), + publisher + ) await ocean.agreements.conditions.releaseReward( agreementId, escrowAmount, @@ -228,7 +289,10 @@ describe('Register Escrow Compute Execution Template', () => { }) it('should grant the access to the consumer', async () => { - const computeTriggered = await computeExecutionCondition.wasComputeTriggered(did, consumer.getId()) + const computeTriggered = await computeExecutionCondition.wasComputeTriggered( + did, + consumer.getId() + ) assert.isTrue(computeTriggered, 'Compute has not been triggered.') }) diff --git a/integration/ocean/SearchAsset.test.ts b/integration/ocean/SearchAsset.test.ts index e66efa1..ec6b8b9 100644 --- a/integration/ocean/SearchAsset.test.ts +++ b/integration/ocean/SearchAsset.test.ts @@ -15,7 +15,8 @@ describe('Search Asset', () => { .toString(36) .substr(2) let price - const metadataGenerator = (name: string) => generateMetadata(`${name}${testHash}`, price) + const metadataGenerator = (name: string) => + generateMetadata(`${name}${testHash}`, price) let test1length let test2length @@ -43,10 +44,22 @@ describe('Search Asset', () => { }) it('should register an asset', async () => { - assert.instanceOf(await ocean.assets.create(metadataGenerator('Test1') as any, publisher), DDO) - assert.instanceOf(await ocean.assets.create(metadataGenerator('Test2') as any, publisher), DDO) - assert.instanceOf(await ocean.assets.create(metadataGenerator('Test2') as any, publisher), DDO) - assert.instanceOf(await ocean.assets.create(metadataGenerator('Test3') as any, publisher), DDO) + assert.instanceOf( + await ocean.assets.create(metadataGenerator('Test1') as any, publisher), + DDO + ) + assert.instanceOf( + await ocean.assets.create(metadataGenerator('Test2') as any, publisher), + DDO + ) + assert.instanceOf( + await ocean.assets.create(metadataGenerator('Test2') as any, publisher), + DDO + ) + assert.instanceOf( + await ocean.assets.create(metadataGenerator('Test3') as any, publisher), + DDO + ) }) it('should search by text and see the increment of DDOs', async () => { @@ -65,8 +78,14 @@ describe('Search Asset', () => { it('should return a list of DDOs', async () => { const { results: ddos } = await ocean.assets.search(`Test1${testHash}`) - assert.equal(ddos.length - test1length, 1, 'Something was wrong searching the assets') - ddos.map(ddo => assert.instanceOf(ddo, DDO, 'The DDO is not an instance of a DDO')) + assert.equal( + ddos.length - test1length, + 1, + 'Something was wrong searching the assets' + ) + ddos.map(ddo => + assert.instanceOf(ddo, DDO, 'The DDO is not an instance of a DDO') + ) }) it('should be able to do a query to get a list of DDOs', async () => { @@ -82,6 +101,8 @@ describe('Search Asset', () => { }) assert.equal(ddos.length, 1, 'Something was wrong searching the assets') - ddos.map(ddo => assert.instanceOf(ddo, DDO, 'The DDO is not an instance of a DDO')) + ddos.map(ddo => + assert.instanceOf(ddo, DDO, 'The DDO is not an instance of a DDO') + ) }) }) diff --git a/integration/utils/ddo-metadata-generator.ts b/integration/utils/ddo-metadata-generator.ts index 59f29f0..8608aad 100644 --- a/integration/utils/ddo-metadata-generator.ts +++ b/integration/utils/ddo-metadata-generator.ts @@ -13,12 +13,14 @@ const metadata: Partial = { { index: 0, contentType: 'application/json', - url: 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/package.json' + url: + 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/package.json' }, { index: 1, contentType: 'text/plain', - url: 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/README.md' + url: + 'https://raw.githubusercontent.com/oceanprotocol/squid-js/master/README.md' } ] }, diff --git a/plugins/add-vendors-plugin.js b/plugins/add-vendors-plugin.js index 72540b4..be75bcd 100644 --- a/plugins/add-vendors-plugin.js +++ b/plugins/add-vendors-plugin.js @@ -6,23 +6,26 @@ module.exports = class AddVendorsPlugin { } apply(compiler) { - compiler.hooks.emit.tapAsync(`AddVendorsPlugin ${this.base}`, (compilation, callback) => { - const main = compilation.assets[`main.${this.base}`] - const mainMap = compilation.assets[`main.${this.base}.map`] - const vendor = compilation.assets[`vendors.${this.base}`] + compiler.hooks.emit.tapAsync( + `AddVendorsPlugin ${this.base}`, + (compilation, callback) => { + const main = compilation.assets[`main.${this.base}`] + const mainMap = compilation.assets[`main.${this.base}.map`] + const vendor = compilation.assets[`vendors.${this.base}`] - if (main && vendor) { - const compiledAsset = new ConcatSource(main.children[0]) - compiledAsset.add(vendor) - compiledAsset.add(main.children[1]) - compilation.assets = {} - compilation.assets[this.base] = compiledAsset - } else if (main && mainMap) { - compilation.assets = {} - compilation.assets[this.base] = main - compilation.assets[`${this.base}.map`] = mainMap + if (main && vendor) { + const compiledAsset = new ConcatSource(main.children[0]) + compiledAsset.add(vendor) + compiledAsset.add(main.children[1]) + compilation.assets = {} + compilation.assets[this.base] = compiledAsset + } else if (main && mainMap) { + compilation.assets = {} + compilation.assets[this.base] = main + compilation.assets[`${this.base}.map`] = mainMap + } + callback() } - callback() - }) + ) } } diff --git a/src/Instantiable.abstract.ts b/src/Instantiable.abstract.ts index 5eb3a92..32a3255 100644 --- a/src/Instantiable.abstract.ts +++ b/src/Instantiable.abstract.ts @@ -11,7 +11,9 @@ export interface InstantiableConfig { logger?: Logger } -export function generateIntantiableConfigFromConfig(config: Config): Partial { +export function generateIntantiableConfigFromConfig( + config: Config +): Partial { const logLevel = typeof config.verbose !== 'number' ? config.verbose diff --git a/src/aquarius/Aquarius.ts b/src/aquarius/Aquarius.ts index d385db5..bb3c0b2 100644 --- a/src/aquarius/Aquarius.ts +++ b/src/aquarius/Aquarius.ts @@ -53,7 +53,10 @@ export class Aquarius extends Instantiable { return consumptionUrl }) .catch(error => { - this.logger.error('Error fetching the data asset consumption url: ', error) + this.logger.error( + 'Error fetching the data asset consumption url: ', + error + ) return null }) @@ -72,7 +75,11 @@ export class Aquarius extends Instantiable { if (response.ok) { return response.json() as DDO[] } - this.logger.error('queryMetadata failed:', response.status, response.statusText) + this.logger.error( + 'queryMetadata failed:', + response.status, + response.statusText + ) return this.transformResult() }) .then(results => { @@ -94,7 +101,10 @@ export class Aquarius extends Instantiable { public async queryMetadataByText(query: SearchQuery): Promise { const fullUrl = new URL(`${this.url}${apiPath}/query`) fullUrl.searchParams.append('text', query.text) - fullUrl.searchParams.append('sort', decodeURIComponent(JSON.stringify(query.sort))) + fullUrl.searchParams.append( + 'sort', + decodeURIComponent(JSON.stringify(query.sort)) + ) fullUrl.searchParams.append('offset', query.offset.toString()) fullUrl.searchParams.append('page', query.page.toString()) const result: QueryResult = await this.ocean.utils.fetch @@ -103,7 +113,11 @@ export class Aquarius extends Instantiable { if (response.ok) { return response.json() as DDO[] } - this.logger.log('queryMetadataByText failed:', response.status, response.statusText) + this.logger.log( + 'queryMetadataByText failed:', + response.status, + response.statusText + ) return this.transformResult() }) .then(results => { @@ -130,7 +144,12 @@ export class Aquarius extends Instantiable { if (response.ok) { return response.json() } - this.logger.error('storeDDO failed:', response.status, response.statusText, ddo) + this.logger.error( + 'storeDDO failed:', + response.status, + response.statusText, + ddo + ) return null as DDO }) .then((response: DDO) => { @@ -149,7 +168,10 @@ export class Aquarius extends Instantiable { * @param {DID | string} did DID of the asset. * @return {Promise} DDO of the asset. */ - public async retrieveDDO(did: DID | string, metadataServiceEndpoint?: string): Promise { + public async retrieveDDO( + did: DID | string, + metadataServiceEndpoint?: string + ): Promise { did = did && DID.parse(did) const fullUrl = metadataServiceEndpoint || `${this.url}${apiPath}/${did.getDid()}` const result = await this.ocean.utils.fetch @@ -158,7 +180,12 @@ export class Aquarius extends Instantiable { if (response.ok) { return response.json() } - this.logger.log('retrieveDDO failed:', response.status, response.statusText, did) + this.logger.log( + 'retrieveDDO failed:', + response.status, + response.statusText, + did + ) return null as DDO }) .then((response: DDO) => { diff --git a/src/brizo/Brizo.ts b/src/brizo/Brizo.ts index b20a041..6dd6055 100644 --- a/src/brizo/Brizo.ts +++ b/src/brizo/Brizo.ts @@ -35,7 +35,12 @@ export class Brizo extends Instantiable { return `${this.url}${apiPath}/publish` } - public getComputeEndpoint(pubKey: string, serviceIndex: number, _notUsed: string, container: string) { + public getComputeEndpoint( + pubKey: string, + serviceIndex: number, + _notUsed: string, + container: string + ) { return `${this.url}${apiPath}/compute` } @@ -55,7 +60,10 @@ export class Brizo extends Instantiable { } try { - return await this.ocean.utils.fetch.post(this.getPurchaseEndpoint(), decodeURI(JSON.stringify(args))) + return await this.ocean.utils.fetch.post( + this.getPurchaseEndpoint(), + decodeURI(JSON.stringify(args)) + ) } catch (e) { this.logger.error(e) throw new Error('HTTP request failed') @@ -72,7 +80,10 @@ export class Brizo extends Instantiable { ): Promise { const signature = (await account.getToken()) || - (await this.ocean.utils.signature.signText(noZeroX(agreementId), account.getId())) + (await this.ocean.utils.signature.signText( + noZeroX(agreementId), + account.getId() + )) const filesPromises = files .filter((_, i) => index === -1 || i === index) .map(async ({ index: i }) => { @@ -94,7 +105,12 @@ export class Brizo extends Instantiable { return destination } - public async encrypt(did: string, signature: string, document: any, publisher: string): Promise { + public async encrypt( + did: string, + signature: string, + document: any, + publisher: string + ): Promise { const args = { documentId: did, signature, diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index da8be37..4692294 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -50,7 +50,8 @@ export class DDO { public constructor(ddo: Partial = {}) { Object.assign(this, ddo, { - created: (ddo && ddo.created) || new Date().toISOString().replace(/\.[0-9]{3}/, '') + created: + (ddo && ddo.created) || new Date().toISOString().replace(/\.[0-9]{3}/, '') }) } @@ -114,10 +115,18 @@ export class DDO { * @param {string} password Password if it's required. * @return {Promise} Proof object. */ - public async generateProof(ocean: Ocean, publicKey: string, password?: string): Promise { + public async generateProof( + ocean: Ocean, + publicKey: string, + password?: string + ): Promise { const checksum = this.getChecksum() - const signature = await ocean.utils.signature.signText(checksum, publicKey, password) + const signature = await ocean.utils.signature.signText( + checksum, + publicKey, + password + ) return { created: new Date().toISOString().replace(/\.[0-9]{3}/, ''), @@ -134,7 +143,11 @@ export class DDO { * @param {string} password Password if it's required. * @return {Promise} Proof object. */ - public async addProof(ocean: Ocean, publicKey: string, password?: string): Promise { + public async addProof( + ocean: Ocean, + publicKey: string, + password?: string + ): Promise { if (this.proof) { throw new Error('Proof already exists') } diff --git a/src/ddo/PublicKey.ts b/src/ddo/PublicKey.ts index 73c851b..0f05fa2 100644 --- a/src/ddo/PublicKey.ts +++ b/src/ddo/PublicKey.ts @@ -13,7 +13,11 @@ export interface PublicKey { * Type of key. * @type {string} */ - type: 'Ed25519VerificationKey2018' | 'RsaVerificationKey2018' | 'EdDsaSAPublicKeySecp256k1' | 'EthereumECDSAKey' + type: + | 'Ed25519VerificationKey2018' + | 'RsaVerificationKey2018' + | 'EdDsaSAPublicKeySecp256k1' + | 'EthereumECDSAKey' /** * Key owner. diff --git a/src/ddo/Service.ts b/src/ddo/Service.ts index 6942c3d..8cdad3b 100644 --- a/src/ddo/Service.ts +++ b/src/ddo/Service.ts @@ -2,7 +2,13 @@ import { MetaData } from './MetaData' import { ServiceAgreementTemplate } from './ServiceAgreementTemplate' import { Provider } from './ComputingProvider' -export type ServiceType = 'authorization' | 'metadata' | 'access' | 'compute' | 'computing' | 'fitchainCompute' +export type ServiceType = + | 'authorization' + | 'metadata' + | 'access' + | 'compute' + | 'computing' + | 'fitchainCompute' export interface ServiceCommon { type: ServiceType @@ -52,7 +58,9 @@ export interface ServiceCompute extends ServiceCommon { templateId?: string } -export type Service = T extends 'authorization' +export type Service< + T extends ServiceType | 'default' = 'default' +> = T extends 'authorization' ? ServiceAuthorization : T extends 'metadata' ? ServiceMetadata diff --git a/src/keeper/ContractHandler.ts b/src/keeper/ContractHandler.ts index ac9f071..eeadca9 100644 --- a/src/keeper/ContractHandler.ts +++ b/src/keeper/ContractHandler.ts @@ -6,7 +6,11 @@ export default class ContractHandler extends Instantiable { return ContractHandler.contracts.get(this.getHash(what, networkId)) } - protected static setContract(what: string, networkId: number, contractInstance: Contract) { + protected static setContract( + what: string, + networkId: number, + contractInstance: Contract + ) { ContractHandler.contracts.set(this.getHash(what, networkId), contractInstance) } @@ -29,7 +33,10 @@ export default class ContractHandler extends Instantiable { const where = (await this.ocean.keeper.getNetworkName()).toLowerCase() const networkId = await this.ocean.keeper.getNetworkId() try { - return ContractHandler.getContract(what, networkId) || (await this.load(what, where, networkId)) + return ( + ContractHandler.getContract(what, networkId) || + (await this.load(what, where, networkId)) + ) } catch (err) { if (!optional) { this.logger.error('Failed to load', what, 'from', where, err) @@ -38,7 +45,11 @@ export default class ContractHandler extends Instantiable { } } - private async load(what: string, where: string, networkId: number): Promise { + private async load( + what: string, + where: string, + networkId: number + ): Promise { this.logger.debug('Loading', what, 'from', where) const artifact = require(`@oceanprotocol/keeper-contracts/artifacts/${what}.${where}.json`) // Logger.log('Loaded artifact', artifact) @@ -49,7 +60,14 @@ export default class ContractHandler extends Instantiable { } const contract = new this.web3.eth.Contract(artifact.abi, artifact.address) - this.logger.debug('Getting instance of', what, 'from', where, 'at address', artifact.address) + this.logger.debug( + 'Getting instance of', + what, + 'from', + where, + 'at address', + artifact.address + ) ContractHandler.setContract(what, networkId, contract) return ContractHandler.getContract(what, networkId) } diff --git a/src/keeper/EventHandler.ts b/src/keeper/EventHandler.ts index 4272ee9..add7efd 100644 --- a/src/keeper/EventHandler.ts +++ b/src/keeper/EventHandler.ts @@ -41,7 +41,11 @@ export class EventHandler extends Instantiable { } } - public getEvent(contract: ContractBase, eventName: string, filter: { [key: string]: any }) { + public getEvent( + contract: ContractBase, + eventName: string, + filter: { [key: string]: any } + ) { return new ContractEvent(this, contract, eventName, filter) } @@ -61,6 +65,9 @@ export class EventHandler extends Instantiable { this.events.forEach(fn => fn(this.lastBlock + 1)) this.lastBlock = blockNumber } - this.lastTimeout = global.setTimeout(() => this.checkBlock(true, n++), this.interval) + this.lastTimeout = global.setTimeout( + () => this.checkBlock(true, n++), + this.interval + ) } } diff --git a/src/keeper/Keeper.ts b/src/keeper/Keeper.ts index 7ded91a..b9a023e 100644 --- a/src/keeper/Keeper.ts +++ b/src/keeper/Keeper.ts @@ -15,7 +15,11 @@ import { EscrowAccessSecretStoreTemplate, EscrowComputeExecutionTemplate } from './contracts/templates' -import { TemplateStoreManager, AgreementStoreManager, ConditionStoreManager } from './contracts/managers' +import { + TemplateStoreManager, + AgreementStoreManager, + ConditionStoreManager +} from './contracts/managers' import { objectPromiseAll } from '../utils' import { EventHandler } from './EventHandler' @@ -55,11 +59,17 @@ export class Keeper extends Instantiable { // Conditions lockRewardCondition: LockRewardCondition.getInstance(config), escrowReward: EscrowReward.getInstance(config), - accessSecretStoreCondition: AccessSecretStoreCondition.getInstance(config), + accessSecretStoreCondition: AccessSecretStoreCondition.getInstance( + config + ), computeExecutionCondition: ComputeExecutionCondition.getInstance(config), // Templates - escrowAccessSecretStoreTemplate: EscrowAccessSecretStoreTemplate.getInstance(config), - escrowComputeExecutionTemplate: EscrowComputeExecutionTemplate.getInstance(config) + escrowAccessSecretStoreTemplate: EscrowAccessSecretStoreTemplate.getInstance( + config + ), + escrowComputeExecutionTemplate: EscrowComputeExecutionTemplate.getInstance( + config + ) }) keeper.connected = true @@ -92,8 +102,10 @@ export class Keeper extends Instantiable { } // Conditions keeper.templates = { - escrowAccessSecretStoreTemplate: keeper.instances.escrowAccessSecretStoreTemplate, - escrowComputeExecutionTemplate: keeper.instances.escrowComputeExecutionTemplate + escrowAccessSecretStoreTemplate: + keeper.instances.escrowAccessSecretStoreTemplate, + escrowComputeExecutionTemplate: + keeper.instances.escrowComputeExecutionTemplate } // Utils keeper.utils = { @@ -178,7 +190,9 @@ export class Keeper extends Instantiable { * @return {Condition} Condition instance. */ public getConditionByAddress(address: string): Condition { - return Object.values(this.conditions).find(condition => condition.getAddress() === address) + return Object.values(this.conditions).find( + condition => condition.getAddress() === address + ) } /** @@ -187,7 +201,9 @@ export class Keeper extends Instantiable { * @return {AgreementTemplate} Agreement template instance. */ public getTemplateByName(name: string): AgreementTemplate { - return Object.values(this.templates).find(template => template.contractName === name) + return Object.values(this.templates).find( + template => template.contractName === name + ) } /** @@ -196,7 +212,9 @@ export class Keeper extends Instantiable { * @return {AgreementTemplate} Agreement template instance. */ public getTemplateByAddress(address: string): AgreementTemplate { - return Object.values(this.templates).find(template => template.getAddress() === address) + return Object.values(this.templates).find( + template => template.getAddress() === address + ) } /** diff --git a/src/keeper/Web3Provider.ts b/src/keeper/Web3Provider.ts index 2b62b37..faf7ad7 100644 --- a/src/keeper/Web3Provider.ts +++ b/src/keeper/Web3Provider.ts @@ -7,6 +7,10 @@ export default class Web3Provider { * @return {Web3} */ public static getWeb3(config: Partial = {}): Web3 { - return new Web3(config.web3Provider || Web3.givenProvider || new Web3.providers.HttpProvider(config.nodeUri)) + return new Web3( + config.web3Provider || + Web3.givenProvider || + new Web3.providers.HttpProvider(config.nodeUri) + ) } } diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index 0cac800..8a4f107 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -22,7 +22,9 @@ export abstract class ContractBase extends Instantiable { public async getEventData(eventName: string, options: any) { if (!this.contract.events[eventName]) { - throw new Error(`Event "${eventName}" not found on contract "${this.contractName}"`) + throw new Error( + `Event "${eventName}" not found on contract "${this.contractName}"` + ) } return this.contract.getPastEvents(eventName, options) } @@ -62,14 +64,24 @@ export abstract class ContractBase extends Instantiable { return from } - protected async sendFrom(name: string, args: any[], from?: string): Promise { + protected async sendFrom( + name: string, + args: any[], + from?: string + ): Promise { from = await this.getFromAddress(from) return this.send(name, from, args) } - protected async send(name: string, from: string, args: any[]): Promise { + protected async send( + name: string, + from: string, + args: any[] + ): Promise { if (!this.contract.methods[name]) { - throw new Error(`Method "${name}" is not part of contract "${this.contractName}"`) + throw new Error( + `Method "${name}" is not part of contract "${this.contractName}"` + ) } // Logger.log(name, args) const method = this.contract.methods[name] @@ -91,7 +103,9 @@ export abstract class ContractBase extends Instantiable { } }) this.logger.error('-'.repeat(40)) - this.logger.error(`Sending transaction "${name}" on contract "${this.contractName}" failed.`) + this.logger.error( + `Sending transaction "${name}" on contract "${this.contractName}" failed.` + ) this.logger.error(`Error: ${err.message}`) this.logger.error(`From: ${from}`) this.logger.error(`Parameters: ${JSON.stringify(mappedArgs, null, 2)}`) @@ -100,7 +114,11 @@ export abstract class ContractBase extends Instantiable { } } - protected async call(name: string, args: any[], from?: string): Promise { + protected async call( + name: string, + args: any[], + from?: string + ): Promise { if (!this.contract.methods[name]) { throw new Error(`Method ${name} is not part of contract ${this.contractName}`) } @@ -109,14 +127,19 @@ export abstract class ContractBase extends Instantiable { const method = this.contract.methods[name](...args) return method.call(from ? { from } : null) } catch (err) { - this.logger.error(`Calling method "${name}" on contract "${this.contractName}" failed. Args: ${args}`, err) + this.logger.error( + `Calling method "${name}" on contract "${this.contractName}" failed. Args: ${args}`, + err + ) throw err } } protected getEvent(eventName: string, filter: { [key: string]: any }) { if (!this.contract.events[eventName]) { - throw new Error(`Event ${eventName} is not part of contract ${this.contractName}`) + throw new Error( + `Event ${eventName} is not part of contract ${this.contractName}` + ) } return this.ocean.keeper.utils.eventHandler.getEvent(this, eventName, filter) } @@ -128,9 +151,12 @@ export abstract class ContractBase extends Instantiable { signature: (method as any).signature })) .filter((method: any) => method.name === methodName) - const foundMethod = methods.find(({ inputs }) => inputs.length === args.length) || methods[0] + const foundMethod = + methods.find(({ inputs }) => inputs.length === args.length) || methods[0] if (!foundMethod) { - throw new Error(`Method "${methodName}" is not part of contract "${this.contractName}"`) + throw new Error( + `Method "${methodName}" is not part of contract "${this.contractName}"` + ) } return foundMethod } diff --git a/src/keeper/contracts/DIDRegistry.ts b/src/keeper/contracts/DIDRegistry.ts index a2e02c2..35e41ac 100644 --- a/src/keeper/contracts/DIDRegistry.ts +++ b/src/keeper/contracts/DIDRegistry.ts @@ -17,7 +17,12 @@ export default class DIDRegistry extends ContractBase { value: string, ownerAddress: string ) { - return this.send('registerAttribute', ownerAddress, [zeroX(did), zeroX(checksum), providers.map(zeroX), value]) + return this.send('registerAttribute', ownerAddress, [ + zeroX(did), + zeroX(checksum), + providers.map(zeroX), + value + ]) } public async getDIDOwner(did: string): Promise { @@ -42,16 +47,22 @@ export default class DIDRegistry extends ContractBase { .map(didPrefixed) } - public async getAttributesByDid(did: string): Promise<{ did: string; serviceEndpoint: string; checksum: string }> { + public async getAttributesByDid( + did: string + ): Promise<{ did: string; serviceEndpoint: string; checksum: string }> { return ( await this.getPastEvents('DIDAttributeRegistered', { _did: didZeroX(did) }) - ).map(({ returnValues: { _did, _checksum: checksum, _value: serviceEndpoint } }) => ({ - did: didPrefixed(_did), - serviceEndpoint, - checksum - }))[0] + ).map( + ({ + returnValues: { _did, _checksum: checksum, _value: serviceEndpoint } + }) => ({ + did: didPrefixed(_did), + serviceEndpoint, + checksum + }) + )[0] } public async grantPermission(did: string, grantee: string, ownerAddress: string) { @@ -71,6 +82,9 @@ export default class DIDRegistry extends ContractBase { newOwnerAddress: string, ownerAddress: string ): Promise { - return this.send('transferDIDOwnership', ownerAddress, [didZeroX(did), noZeroX(newOwnerAddress)]) + return this.send('transferDIDOwnership', ownerAddress, [ + didZeroX(did), + noZeroX(newOwnerAddress) + ]) } } diff --git a/src/keeper/contracts/GenericContract.ts b/src/keeper/contracts/GenericContract.ts index 4979597..4413616 100644 --- a/src/keeper/contracts/GenericContract.ts +++ b/src/keeper/contracts/GenericContract.ts @@ -2,7 +2,10 @@ import ContractBase from './ContractBase' import { InstantiableConfig } from '../../Instantiable.abstract' export default class GenericContract extends ContractBase { - public static async getInstance(config: InstantiableConfig, contractName: string): Promise { + public static async getInstance( + config: InstantiableConfig, + contractName: string + ): Promise { const contract: GenericContract = new GenericContract(contractName) await contract.init(config) return contract diff --git a/src/keeper/contracts/Token.ts b/src/keeper/contracts/Token.ts index 5644fd3..5a8d96b 100644 --- a/src/keeper/contracts/Token.ts +++ b/src/keeper/contracts/Token.ts @@ -18,7 +18,9 @@ export default class OceanToken extends ContractBase { } public async balanceOf(address: string): Promise { - return this.call('balanceOf', [address]).then((balance: string) => new BigNumber(balance).toNumber()) + return this.call('balanceOf', [address]).then((balance: string) => + new BigNumber(balance).toNumber() + ) } public async transfer(to: string, amount: number, from: string) { diff --git a/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts b/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts index 4a11585..e0ce615 100644 --- a/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts +++ b/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts @@ -3,8 +3,14 @@ import { zeroX, didZeroX, didPrefixed } from '../../../utils' import { InstantiableConfig } from '../../../Instantiable.abstract' export class AccessSecretStoreCondition extends Condition { - public static async getInstance(config: InstantiableConfig): Promise { - return Condition.getInstance(config, 'AccessSecretStoreCondition', AccessSecretStoreCondition) + public static async getInstance( + config: InstantiableConfig + ): Promise { + return Condition.getInstance( + config, + 'AccessSecretStoreCondition', + AccessSecretStoreCondition + ) } public hashValues(did: string, grantee: string) { @@ -16,10 +22,16 @@ export class AccessSecretStoreCondition extends Condition { } public checkPermissions(grantee: string, did: string, from?: string) { - return this.call('checkPermissions', [grantee, didZeroX(did)].map(zeroX), from) + return this.call( + 'checkPermissions', + [grantee, didZeroX(did)].map(zeroX), + from + ) } - public async getGrantedDidByConsumer(consumer: string): Promise<{ did: string; agreementId: string }[]> { + public async getGrantedDidByConsumer( + consumer: string + ): Promise<{ did: string; agreementId: string }[]> { return ( await this.getPastEvents('Fulfilled', { _grantee: zeroX(consumer) diff --git a/src/keeper/contracts/conditions/ComputeExecutionCondition.ts b/src/keeper/contracts/conditions/ComputeExecutionCondition.ts index 10f2173..ba83313 100644 --- a/src/keeper/contracts/conditions/ComputeExecutionCondition.ts +++ b/src/keeper/contracts/conditions/ComputeExecutionCondition.ts @@ -3,19 +3,38 @@ import { zeroX, didZeroX, didPrefixed } from '../../../utils' import { InstantiableConfig } from '../../../Instantiable.abstract' export class ComputeExecutionCondition extends Condition { - public static async getInstance(config: InstantiableConfig): Promise { - return Condition.getInstance(config, 'ComputeExecutionCondition', ComputeExecutionCondition) + public static async getInstance( + config: InstantiableConfig + ): Promise { + return Condition.getInstance( + config, + 'ComputeExecutionCondition', + ComputeExecutionCondition + ) } public hashValues(did: string, computeConsumer: string) { return super.hashValues(didZeroX(did), zeroX(computeConsumer)) } - public fulfill(agreementId: string, did: string, computeConsumer: string, from?: string) { - return super.fulfill(agreementId, [didZeroX(did), computeConsumer].map(zeroX), from) + public fulfill( + agreementId: string, + did: string, + computeConsumer: string, + from?: string + ) { + return super.fulfill( + agreementId, + [didZeroX(did), computeConsumer].map(zeroX), + from + ) } public wasComputeTriggered(did: string, computeConsumer: string, from?: string) { - return this.call('wasComputeTriggered', [didZeroX(did), computeConsumer].map(zeroX), from) + return this.call( + 'wasComputeTriggered', + [didZeroX(did), computeConsumer].map(zeroX), + from + ) } } diff --git a/src/keeper/contracts/conditions/Condition.abstract.ts b/src/keeper/contracts/conditions/Condition.abstract.ts index ffc2151..8fd2df4 100644 --- a/src/keeper/contracts/conditions/Condition.abstract.ts +++ b/src/keeper/contracts/conditions/Condition.abstract.ts @@ -9,7 +9,12 @@ export enum ConditionState { Aborted = 3 } -export const conditionStateNames = ['Uninitialized', 'Unfulfilled', 'Fulfilled', 'Aborted'] +export const conditionStateNames = [ + 'Uninitialized', + 'Unfulfilled', + 'Fulfilled', + 'Aborted' +] export abstract class Condition extends ContractBase { public static async getInstance( diff --git a/src/keeper/contracts/conditions/EscrowReward.ts b/src/keeper/contracts/conditions/EscrowReward.ts index afe0e8e..234a99e 100644 --- a/src/keeper/contracts/conditions/EscrowReward.ts +++ b/src/keeper/contracts/conditions/EscrowReward.ts @@ -14,7 +14,10 @@ export class EscrowReward extends Condition { lockCondition: string, releaseCondition: string ) { - return super.hashValues(amount, ...[receiver, sender, lockCondition, releaseCondition].map(zeroX)) + return super.hashValues( + amount, + ...[receiver, sender, lockCondition, releaseCondition].map(zeroX) + ) } public fulfill( diff --git a/src/keeper/contracts/conditions/LockRewardCondition.ts b/src/keeper/contracts/conditions/LockRewardCondition.ts index dd2e5a9..b07e258 100644 --- a/src/keeper/contracts/conditions/LockRewardCondition.ts +++ b/src/keeper/contracts/conditions/LockRewardCondition.ts @@ -3,7 +3,9 @@ import { zeroX } from '../../../utils' import { InstantiableConfig } from '../../../Instantiable.abstract' export class LockRewardCondition extends Condition { - public static async getInstance(config: InstantiableConfig): Promise { + public static async getInstance( + config: InstantiableConfig + ): Promise { return Condition.getInstance(config, 'LockRewardCondition', LockRewardCondition) } @@ -11,7 +13,12 @@ export class LockRewardCondition extends Condition { return super.hashValues(zeroX(rewardAddress), String(amount)) } - public fulfill(agreementId: string, rewardAddress: string, amount: number | string, from?: string) { + public fulfill( + agreementId: string, + rewardAddress: string, + amount: number | string, + from?: string + ) { return super.fulfill(agreementId, [zeroX(rewardAddress), String(amount)], from) } } diff --git a/src/keeper/contracts/managers/AgreementStoreManager.ts b/src/keeper/contracts/managers/AgreementStoreManager.ts index 5cd04cb..72bedf8 100644 --- a/src/keeper/contracts/managers/AgreementStoreManager.ts +++ b/src/keeper/contracts/managers/AgreementStoreManager.ts @@ -12,8 +12,12 @@ export interface AgreementData { } export class AgreementStoreManager extends ContractBase { - public static async getInstance(config: InstantiableConfig): Promise { - const templateStoreManeger: AgreementStoreManager = new AgreementStoreManager('AgreementStoreManager') + public static async getInstance( + config: InstantiableConfig + ): Promise { + const templateStoreManeger: AgreementStoreManager = new AgreementStoreManager( + 'AgreementStoreManager' + ) await templateStoreManeger.init(config) return templateStoreManeger } diff --git a/src/keeper/contracts/managers/ConditionStoreManager.ts b/src/keeper/contracts/managers/ConditionStoreManager.ts index 996ba39..e521cff 100644 --- a/src/keeper/contracts/managers/ConditionStoreManager.ts +++ b/src/keeper/contracts/managers/ConditionStoreManager.ts @@ -14,8 +14,12 @@ export interface ConditionData { } export class ConditionStoreManager extends ContractBase { - public static async getInstance(config: InstantiableConfig): Promise { - const templateStoreManeger: ConditionStoreManager = new ConditionStoreManager('ConditionStoreManager') + public static async getInstance( + config: InstantiableConfig + ): Promise { + const templateStoreManeger: ConditionStoreManager = new ConditionStoreManager( + 'ConditionStoreManager' + ) await templateStoreManeger.init(config) return templateStoreManeger } diff --git a/src/keeper/contracts/managers/TemplateStoreManager.ts b/src/keeper/contracts/managers/TemplateStoreManager.ts index 86fa5de..5e48c7f 100644 --- a/src/keeper/contracts/managers/TemplateStoreManager.ts +++ b/src/keeper/contracts/managers/TemplateStoreManager.ts @@ -17,8 +17,12 @@ export interface TemplateMetadata { } export class TemplateStoreManager extends ContractBase { - public static async getInstance(config: InstantiableConfig): Promise { - const templateStoreManeger: TemplateStoreManager = new TemplateStoreManager('TemplateStoreManager') + public static async getInstance( + config: InstantiableConfig + ): Promise { + const templateStoreManeger: TemplateStoreManager = new TemplateStoreManager( + 'TemplateStoreManager' + ) await templateStoreManeger.init(config) return templateStoreManeger } @@ -39,7 +43,11 @@ export class TemplateStoreManager extends ContractBase { } } - public async approveTemplate(address: string, from?: string, ignoreApproved?: boolean) { + public async approveTemplate( + address: string, + from?: string, + ignoreApproved?: boolean + ) { const template = await this.getTemplate(address) if (template.state !== TemplateState.Proposed) { this.logger.warn(`Template "${address}" is not in "proposed" state.`) @@ -56,7 +64,12 @@ export class TemplateStoreManager extends ContractBase { } public async getTemplate(address: string) { - const { state, owner, lastUpdatedBy, blockNumberUpdated } = await this.call('getTemplate', [zeroX(address)]) + const { + state, + owner, + lastUpdatedBy, + blockNumberUpdated + } = await this.call('getTemplate', [zeroX(address)]) return { state: +state, owner, diff --git a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts index 38cc3bd..6fed9cc 100644 --- a/src/keeper/contracts/templates/AgreementTemplate.abstract.ts +++ b/src/keeper/contracts/templates/AgreementTemplate.abstract.ts @@ -1,5 +1,9 @@ import ContractBase from '../ContractBase' -import { Condition, ConditionState, conditionStateNames } from '../conditions/Condition.abstract' +import { + Condition, + ConditionState, + conditionStateNames +} from '../conditions/Condition.abstract' import { DDO } from '../../../ddo/DDO' import { ServiceAgreementTemplate } from '../../../ddo/ServiceAgreementTemplate' import { zeroX } from '../../../utils' @@ -50,7 +54,14 @@ export abstract class AgreementTemplate extends ContractBase { ) { return this.sendFrom( 'createAgreement', - [zeroX(agreementId), zeroX(did), conditionIds.map(zeroX), timeLocks, timeOuts, ...extraArgs], + [ + zeroX(agreementId), + zeroX(did), + conditionIds.map(zeroX), + timeLocks, + timeOuts, + ...extraArgs + ], from ) } @@ -68,7 +79,9 @@ export abstract class AgreementTemplate extends ContractBase { * @return {Promise} Conditions contracts. */ public async getConditions(): Promise { - return (await this.getConditionTypes()).map(address => this.ocean.keeper.getConditionByAddress(address)) + return (await this.getConditionTypes()).map(address => + this.ocean.keeper.getConditionByAddress(address) + ) } /** @@ -110,7 +123,9 @@ export abstract class AgreementTemplate extends ContractBase { const name = (await this.getServiceAgreementTemplateConditions()).find( ({ name: conditionRef }) => conditionRef === ref ).contractName - return (await this.getConditions()).find(condition => condition.contractName === name) + return (await this.getConditions()).find( + condition => condition.contractName === name + ) } public async getServiceAgreementTemplateDependencies() { @@ -123,7 +138,9 @@ export abstract class AgreementTemplate extends ContractBase { * @param {string} agreementId Agreement ID. * @return {Promise} Conditions status. */ - public async getAgreementStatus(agreementId: string): Promise { + public async getAgreementStatus( + agreementId: string + ): Promise { const agreementStore = this.ocean.keeper.agreementStoreManager const conditionStore = this.ocean.keeper.conditionStoreManager @@ -144,11 +161,17 @@ export abstract class AgreementTemplate extends ContractBase { ) const statesPromises = Object.keys(dependencies).map(async (ref, i) => { - const { contractName } = await this.getServiceAgreementTemplateConditionByRef(ref) + const { contractName } = await this.getServiceAgreementTemplateConditionByRef( + ref + ) return { ref, contractName, - state: (await conditionStore.getCondition(conditionIdByConddition[contractName])).state + state: ( + await conditionStore.getCondition( + conditionIdByConddition[contractName] + ) + ).state } }) const states = await Promise.all(statesPromises) @@ -184,16 +207,18 @@ export abstract class AgreementTemplate extends ContractBase { 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)) + 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(`${condition} (${contractName})`) - this.logger.bypass(' Status:', state, `(${conditionStateNames[state]})`) - if (blocked) { - this.logger.bypass(' Blocked by:', blockedBy) - } - }) + ) this.logger.bypass('-'.repeat(80)) } diff --git a/src/keeper/contracts/templates/BaseEscrowTemplate.abstract.ts b/src/keeper/contracts/templates/BaseEscrowTemplate.abstract.ts index 1d3b31d..2d178d7 100644 --- a/src/keeper/contracts/templates/BaseEscrowTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseEscrowTemplate.abstract.ts @@ -26,7 +26,15 @@ export abstract class BaseEscrowTemplate extends AgreementTemplate { accessConsumer: string, from?: string ) { - return super.createAgreement(agreementId, did, conditionIds, timeLocks, timeOuts, [accessConsumer], from) + return super.createAgreement( + agreementId, + did, + conditionIds, + timeLocks, + timeOuts, + [accessConsumer], + from + ) } public async getAgreementData(agreementId: string) { diff --git a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.serviceAgreementTemplate.ts b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.serviceAgreementTemplate.ts index b9c4f69..ac26262 100644 --- a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.serviceAgreementTemplate.ts +++ b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.serviceAgreementTemplate.ts @@ -13,7 +13,11 @@ export const escrowAccessSecretStoreTemplateServiceAgreementTemplate: ServiceAgr } } ], - fulfillmentOrder: ['lockReward.fulfill', 'accessSecretStore.fulfill', 'escrowReward.fulfill'], + fulfillmentOrder: [ + 'lockReward.fulfill', + 'accessSecretStore.fulfill', + 'escrowReward.fulfill' + ], conditionDependency: { lockReward: [], accessSecretStore: [], diff --git a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts index 4aa6c8c..77b6e4a 100644 --- a/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts +++ b/src/keeper/contracts/templates/EscrowAccessSecretStoreTemplate.ts @@ -7,15 +7,26 @@ import { InstantiableConfig } from '../../../Instantiable.abstract' import { escrowAccessSecretStoreTemplateServiceAgreementTemplate } from './EscrowAccessSecretStoreTemplate.serviceAgreementTemplate' export class EscrowAccessSecretStoreTemplate extends BaseEscrowTemplate { - public static async getInstance(config: InstantiableConfig): Promise { - return AgreementTemplate.getInstance(config, 'EscrowAccessSecretStoreTemplate', EscrowAccessSecretStoreTemplate) + public static async getInstance( + config: InstantiableConfig + ): Promise { + return AgreementTemplate.getInstance( + config, + 'EscrowAccessSecretStoreTemplate', + EscrowAccessSecretStoreTemplate + ) } public async getServiceAgreementTemplate() { return escrowAccessSecretStoreTemplateServiceAgreementTemplate } - public async createAgreementFromDDO(agreementId: string, ddo: DDO, consumer: string, from?: string) { + public async createAgreementFromDDO( + agreementId: string, + ddo: DDO, + consumer: string, + from?: string + ) { return !!(await this.createFullAgreement( ddo.shortId(), ddo.findServiceByType('metadata').attributes.main.price, @@ -25,7 +36,12 @@ export class EscrowAccessSecretStoreTemplate extends BaseEscrowTemplate { )) } - public async getAgreementIdsFromDDO(agreementId: string, ddo: DDO, consumer: string, from?: string) { + public async getAgreementIdsFromDDO( + agreementId: string, + ddo: DDO, + consumer: string, + from?: string + ) { const { accessSecretStoreConditionId, lockRewardConditionId, @@ -72,10 +88,19 @@ export class EscrowAccessSecretStoreTemplate extends BaseEscrowTemplate { return zeroX(agreementId) } - private async createFullAgreementData(agreementId: string, did: string, amount: number | string, consumer: string) { + private async createFullAgreementData( + agreementId: string, + did: string, + amount: number | string, + consumer: string + ) { const { didRegistry, conditions } = this.ocean.keeper - const { accessSecretStoreCondition, lockRewardCondition, escrowReward } = conditions + const { + accessSecretStoreCondition, + lockRewardCondition, + escrowReward + } = conditions const publisher = await didRegistry.getDIDOwner(did) @@ -84,7 +109,11 @@ export class EscrowAccessSecretStoreTemplate extends BaseEscrowTemplate { await escrowReward.getAddress(), amount ) - const accessSecretStoreConditionId = await accessSecretStoreCondition.generateIdHash(agreementId, did, consumer) + const accessSecretStoreConditionId = await accessSecretStoreCondition.generateIdHash( + agreementId, + did, + consumer + ) const escrowRewardId = await escrowReward.generateIdHash( agreementId, String(amount), diff --git a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts index f0019bf..149ac2e 100644 --- a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts +++ b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.serviceAgreementTemplate.ts @@ -13,7 +13,11 @@ export const escrowComputeExecutionTemplateServiceAgreementTemplate: ServiceAgre } } ], - fulfillmentOrder: ['lockReward.fulfill', 'serviceExecution.fulfill', 'escrowReward.fulfill'], + fulfillmentOrder: [ + 'lockReward.fulfill', + 'serviceExecution.fulfill', + 'escrowReward.fulfill' + ], conditionDependency: { lockReward: [], serviceExecution: [], diff --git a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts index e758d5c..b1e3c3e 100644 --- a/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts +++ b/src/keeper/contracts/templates/EscrowComputeExecutionTemplate.ts @@ -7,15 +7,26 @@ import { InstantiableConfig } from '../../../Instantiable.abstract' import { escrowComputeExecutionTemplateServiceAgreementTemplate } from './EscrowComputeExecutionTemplate.serviceAgreementTemplate' export class EscrowComputeExecutionTemplate extends BaseEscrowTemplate { - public static async getInstance(config: InstantiableConfig): Promise { - return AgreementTemplate.getInstance(config, 'EscrowComputeExecutionTemplate', EscrowComputeExecutionTemplate) + public static async getInstance( + config: InstantiableConfig + ): Promise { + return AgreementTemplate.getInstance( + config, + 'EscrowComputeExecutionTemplate', + EscrowComputeExecutionTemplate + ) } public async getServiceAgreementTemplate() { return escrowComputeExecutionTemplateServiceAgreementTemplate } - public async createAgreementFromDDO(agreementId: string, ddo: DDO, consumer: string, from?: string) { + public async createAgreementFromDDO( + agreementId: string, + ddo: DDO, + consumer: string, + from?: string + ) { return !!(await this.createFullAgreement( ddo.shortId(), ddo.findServiceByType('metadata').attributes.main.price, @@ -25,7 +36,12 @@ export class EscrowComputeExecutionTemplate extends BaseEscrowTemplate { )) } - public async getAgreementIdsFromDDO(agreementId: string, ddo: DDO, consumer: string, from?: string) { + public async getAgreementIdsFromDDO( + agreementId: string, + ddo: DDO, + consumer: string, + from?: string + ) { const { computeExecutionConditionId, lockRewardConditionId, @@ -72,10 +88,19 @@ export class EscrowComputeExecutionTemplate extends BaseEscrowTemplate { return zeroX(agreementId) } - private async createFullAgreementData(agreementId: string, did: string, amount: number | string, consumer: string) { + private async createFullAgreementData( + agreementId: string, + did: string, + amount: number | string, + consumer: string + ) { const { didRegistry, conditions } = this.ocean.keeper - const { computeExecutionCondition, lockRewardCondition, escrowReward } = conditions + const { + computeExecutionCondition, + lockRewardCondition, + escrowReward + } = conditions const publisher = await didRegistry.getDIDOwner(did) @@ -84,7 +109,11 @@ export class EscrowComputeExecutionTemplate extends BaseEscrowTemplate { await escrowReward.getAddress(), amount ) - const computeExecutionConditionId = await computeExecutionCondition.generateIdHash(agreementId, did, consumer) + const computeExecutionConditionId = await computeExecutionCondition.generateIdHash( + agreementId, + did, + consumer + ) const escrowRewardId = await escrowReward.generateIdHash( agreementId, String(amount), diff --git a/src/ocean/Account.ts b/src/ocean/Account.ts index 801766f..b33e4ec 100644 --- a/src/ocean/Account.ts +++ b/src/ocean/Account.ts @@ -87,9 +87,11 @@ export default class Account extends Instantiable { * @return {Promise} */ public async getEtherBalance(): Promise { - return this.web3.eth.getBalance(this.id, 'latest').then((balance: string): number => { - return new BigNumber(balance).toNumber() - }) + return this.web3.eth + .getBalance(this.id, 'latest') + .then((balance: string): number => { + return new BigNumber(balance).toNumber() + }) } /** diff --git a/src/ocean/Ocean.ts b/src/ocean/Ocean.ts index 8bb6fa8..1bfead7 100644 --- a/src/ocean/Ocean.ts +++ b/src/ocean/Ocean.ts @@ -14,7 +14,10 @@ import Keeper from '../keeper/Keeper' import { Config } from '../models/Config' -import { Instantiable, generateIntantiableConfigFromConfig } from '../Instantiable.abstract' +import { + Instantiable, + generateIntantiableConfigFromConfig +} from '../Instantiable.abstract' /** * Main interface for Ocean Protocol. diff --git a/src/ocean/OceanAccounts.ts b/src/ocean/OceanAccounts.ts index a2178a3..ba9ba54 100644 --- a/src/ocean/OceanAccounts.ts +++ b/src/ocean/OceanAccounts.ts @@ -25,7 +25,9 @@ export class OceanAccounts extends Instantiable { // retrieve eth accounts const ethAccounts: string[] = await this.web3.eth.getAccounts() - const accountPromises = ethAccounts.map(address => new Account(address, this.instanceConfig)) + const accountPromises = ethAccounts.map( + address => new Account(address, this.instanceConfig) + ) return Promise.all(accountPromises) } diff --git a/src/ocean/OceanAgreements.ts b/src/ocean/OceanAgreements.ts index e028899..2d83d07 100644 --- a/src/ocean/OceanAgreements.ts +++ b/src/ocean/OceanAgreements.ts @@ -21,7 +21,9 @@ export class OceanAgreements extends Instantiable { * Returns the instance of OceanAgreements. * @return {Promise} */ - public static async getInstance(config: InstantiableConfig): Promise { + public static async getInstance( + config: InstantiableConfig + ): Promise { const instance = new OceanAgreements() instance.setInstanceConfig(config) instance.conditions = await OceanAgreementsConditions.getInstance(config) @@ -42,12 +44,17 @@ export class OceanAgreements extends Instantiable { * @param {Account} consumer Consumer account. * @return {Promise} Agreement ID and signaturee. */ - public async prepare(did: string, index: number, consumer: Account): Promise { + public async prepare( + did: string, + index: number, + consumer: Account + ): Promise { const d: DID = DID.parse(did as string) const ddo = await this.ocean.aquarius.retrieveDDO(d) const agreementId: string = zeroX(generateId()) - const templateName = ddo.findServiceByType('access').attributes.serviceAgreementTemplate.contractName + const templateName = ddo.findServiceByType('access').attributes + .serviceAgreementTemplate.contractName const agreementConditionsIds = await this.ocean.keeper .getTemplateByName(templateName) .getAgreementIdsFromDDO(agreementId, ddo, consumer.getId(), consumer.getId()) @@ -113,7 +120,8 @@ export class OceanAgreements extends Instantiable { const d: DID = DID.parse(did) const ddo = await this.ocean.aquarius.retrieveDDO(d) - const templateName = ddo.findServiceById<'access'>(index).attributes.serviceAgreementTemplate.contractName + const templateName = ddo.findServiceById<'access'>(index).attributes + .serviceAgreementTemplate.contractName await this.ocean.keeper .getTemplateByName(templateName) .createAgreementFromDDO(agreementId, ddo, consumer.getId(), publisher.getId()) @@ -127,13 +135,23 @@ export class OceanAgreements extends Instantiable { * @param {boolean} extended Returns a complete status with dependencies. * @return {Promise} */ - public async status(agreementId: string, extended?: false): Promise<{ [condition: string]: ConditionState }> + public async status( + agreementId: string, + extended?: false + ): Promise<{ [condition: string]: ConditionState }> - public async status(agreementId: string, extended: true): Promise + public async status( + agreementId: string, + extended: true + ): Promise public async status(agreementId: string, extended: boolean = false) { - const { templateId } = await this.ocean.keeper.agreementStoreManager.getAgreement(agreementId) - const fullStatus = await this.ocean.keeper.getTemplateByAddress(templateId).getAgreementStatus(agreementId) + const { templateId } = await this.ocean.keeper.agreementStoreManager.getAgreement( + agreementId + ) + const fullStatus = await this.ocean.keeper + .getTemplateByAddress(templateId) + .getAgreementStatus(agreementId) if (!fullStatus) { return diff --git a/src/ocean/OceanAgreementsConditions.ts b/src/ocean/OceanAgreementsConditions.ts index 743f177..5fd67da 100644 --- a/src/ocean/OceanAgreementsConditions.ts +++ b/src/ocean/OceanAgreementsConditions.ts @@ -9,7 +9,9 @@ export class OceanAgreementsConditions extends Instantiable { * Returns the instance of OceanAgreementsConditions. * @return {Promise} */ - public static async getInstance(config: InstantiableConfig): Promise { + public static async getInstance( + config: InstantiableConfig + ): Promise { const instance = new OceanAgreementsConditions() instance.setInstanceConfig(config) @@ -23,11 +25,19 @@ export class OceanAgreementsConditions extends Instantiable { * @param {number} amount Asset amount. * @param {Account} from Account of sender. */ - public async lockReward(agreementId: string, amount: number | string, from?: Account) { + public async lockReward( + agreementId: string, + amount: number | string, + from?: Account + ) { const { lockRewardCondition, escrowReward } = this.ocean.keeper.conditions try { - await this.ocean.keeper.token.approve(lockRewardCondition.getAddress(), amount, from.getId()) + await this.ocean.keeper.token.approve( + lockRewardCondition.getAddress(), + amount, + from.getId() + ) const receipt = await lockRewardCondition.fulfill( agreementId, @@ -49,11 +59,21 @@ export class OceanAgreementsConditions extends Instantiable { * @param {string} grantee Consumer address. * @param {Account} from Account of sender. */ - public async grantAccess(agreementId: string, did: string, grantee: string, from?: Account) { + public async grantAccess( + agreementId: string, + did: string, + grantee: string, + from?: Account + ) { try { const { accessSecretStoreCondition } = this.ocean.keeper.conditions - const receipt = await accessSecretStoreCondition.fulfill(agreementId, did, grantee, from && from.getId()) + const receipt = await accessSecretStoreCondition.fulfill( + agreementId, + did, + grantee, + from && from.getId() + ) return !!receipt.events.Fulfilled } catch { return false @@ -67,11 +87,21 @@ export class OceanAgreementsConditions extends Instantiable { * @param {string} grantee Consumer address. * @param {Account} from Account of sender. */ - public async grantServiceExecution(agreementId: string, did: string, grantee: string, from?: Account) { + public async grantServiceExecution( + agreementId: string, + did: string, + grantee: string, + from?: Account + ) { try { const { computeExecutionCondition } = this.ocean.keeper.conditions - const receipt = await computeExecutionCondition.fulfill(agreementId, did, grantee, from && from.getId()) + const receipt = await computeExecutionCondition.fulfill( + agreementId, + did, + grantee, + from && from.getId() + ) return !!receipt.events.Fulfilled } catch { return false @@ -100,9 +130,17 @@ export class OceanAgreementsConditions extends Instantiable { from?: Account ) { try { - const { escrowReward, accessSecretStoreCondition, lockRewardCondition } = this.ocean.keeper.conditions + const { + escrowReward, + accessSecretStoreCondition, + lockRewardCondition + } = this.ocean.keeper.conditions - const conditionIdAccess = await accessSecretStoreCondition.generateIdHash(agreementId, did, consumer) + const conditionIdAccess = await accessSecretStoreCondition.generateIdHash( + agreementId, + did, + consumer + ) const conditionIdLock = await lockRewardCondition.generateIdHash( agreementId, escrowReward.getAddress(), diff --git a/src/ocean/OceanAssets.ts b/src/ocean/OceanAssets.ts index d94f1e6..e983fc7 100644 --- a/src/ocean/OceanAssets.ts +++ b/src/ocean/OceanAssets.ts @@ -47,7 +47,9 @@ export class OceanAssets extends Instantiable { * @return {Promise} */ public async resolve(did: string): Promise { - const { serviceEndpoint } = await this.ocean.keeper.didRegistry.getAttributesByDid(did) + const { + serviceEndpoint + } = await this.ocean.keeper.didRegistry.getAttributesByDid(did) return this.ocean.aquarius.retrieveDDOByUrl(serviceEndpoint) } @@ -71,7 +73,11 @@ export class OceanAssets extends Instantiable { this.logger.log('Encrypting files') observer.next(CreateProgressStep.EncryptingFiles) - const encryptedFiles = await this.ocean.secretStore.encrypt(did.getId(), metadata.main.files, publisher) + const encryptedFiles = await this.ocean.secretStore.encrypt( + did.getId(), + metadata.main.files, + publisher + ) this.logger.log('Files encrypted') observer.next(CreateProgressStep.FilesEncrypted) @@ -145,7 +151,10 @@ export class OceanAssets extends Instantiable { ] // Remove duplications .reverse() - .filter(({ type }, i, list) => list.findIndex(({ type: t }) => t === type) === i) + .filter( + ({ type }, i, list) => + list.findIndex(({ type: t }) => t === type) === i + ) .reverse() // Adding index .map(_ => ({ @@ -226,12 +235,16 @@ export class OceanAssets extends Instantiable { const { serviceEndpoint } = accessService if (!serviceEndpoint) { - throw new Error('Consume asset failed, service definition is missing the `serviceEndpoint`.') + throw new Error( + 'Consume asset failed, service definition is missing the `serviceEndpoint`.' + ) } this.logger.log('Consuming files') - resultPath = resultPath ? `${resultPath}/datafile.${ddo.shortId()}.${serviceIndex}/` : undefined + resultPath = resultPath + ? `${resultPath}/datafile.${ddo.shortId()}.${serviceIndex}/` + : undefined if (!useSecretStore) { await this.ocean.brizo.consumeService( @@ -251,7 +264,9 @@ export class OceanAssets extends Instantiable { ) const downloads = files .filter(({ index: i }) => index === -1 || index === i) - .map(({ url, index: i }) => this.ocean.utils.fetch.downloadFile(url, resultPath, i)) + .map(({ url, index: i }) => + this.ocean.utils.fetch.downloadFile(url, resultPath, i) + ) await Promise.all(downloads) } this.logger.log('Files consumed') @@ -270,7 +285,11 @@ export class OceanAssets extends Instantiable { * @param {Account} consumer Consumer account. * @return {Promise} Returns Agreement ID */ - public order(did: string, index: number, consumer: Account): SubscribablePromise { + public order( + did: string, + index: number, + consumer: Account + ): SubscribablePromise { return new SubscribablePromise(async observer => { const oceanAgreements = this.ocean.agreements @@ -278,7 +297,8 @@ export class OceanAssets extends Instantiable { const ddo = await this.resolve(did) const { keeper } = this.ocean - const templateName = ddo.findServiceByType('access').attributes.serviceAgreementTemplate.contractName + const templateName = ddo.findServiceByType('access').attributes + .serviceAgreementTemplate.contractName const template = keeper.getTemplateByName(templateName) const accessCondition = keeper.conditions.accessSecretStoreCondition @@ -293,10 +313,16 @@ export class OceanAssets extends Instantiable { this.logger.log('Locking payment') - const accessGranted = accessCondition.getConditionFulfilledEvent(agreementId).once() + const accessGranted = accessCondition + .getConditionFulfilledEvent(agreementId) + .once() observer.next(OrderProgressStep.LockingPayment) - const paid = await oceanAgreements.conditions.lockReward(agreementId, attributes.main.price, consumer) + const paid = await oceanAgreements.conditions.lockReward( + agreementId, + attributes.main.price, + consumer + ) observer.next(OrderProgressStep.LockedPayment) if (paid) { @@ -316,7 +342,14 @@ export class OceanAssets extends Instantiable { observer.next(OrderProgressStep.CreatingAgreement) this.logger.log('Creating agreement') - await oceanAgreements.create(did, agreementId, index, undefined, consumer, consumer) + await oceanAgreements.create( + did, + agreementId, + index, + undefined, + consumer, + consumer + ) this.logger.log('Agreement created') try { @@ -338,10 +371,15 @@ export class OceanAssets extends Instantiable { const ddo = await this.resolve(did) const checksum = ddo.getChecksum() const { creator, signatureValue } = ddo.proof - const signer = await this.ocean.utils.signature.verifyText(checksum, signatureValue) + const signer = await this.ocean.utils.signature.verifyText( + checksum, + signatureValue + ) if (signer.toLowerCase() !== creator.toLowerCase()) { - this.logger.warn(`Owner of ${ddo.id} doesn't match. Expected ${creator} instead of ${signer}.`) + this.logger.warn( + `Owner of ${ddo.id} doesn't match. Expected ${creator} instead of ${signer}.` + ) } return creator @@ -362,7 +400,10 @@ export class OceanAssets extends Instantiable { * @param {string} newOwner Ethereum address of the new owner of the DID. * @return {Promise} Returns Web3 transaction receipt. */ - public async transferOwnership(did: string, newOwner: string): Promise { + public async transferOwnership( + did: string, + newOwner: string + ): Promise { const owner = await this.ocean.assets.owner(did) return this.ocean.keeper.didRegistry.transferDIDOwnership(did, newOwner, owner) } @@ -373,9 +414,11 @@ export class OceanAssets extends Instantiable { * @return {Promise} List of DIDs. */ public async consumerAssets(consumer: string): Promise { - return (await this.ocean.keeper.conditions.accessSecretStoreCondition.getGrantedDidByConsumer(consumer)).map( - ({ did }) => did - ) + return ( + await this.ocean.keeper.conditions.accessSecretStoreCondition.getGrantedDidByConsumer( + consumer + ) + ).map(({ did }) => did) } /** diff --git a/src/ocean/OceanAuth.ts b/src/ocean/OceanAuth.ts index 4764206..20f0905 100644 --- a/src/ocean/OceanAuth.ts +++ b/src/ocean/OceanAuth.ts @@ -30,7 +30,11 @@ export class OceanAuth extends Instantiable { const message = `${this.getMessage()}\n${time}` try { - const signature = await this.ocean.utils.signature.signText(message, account.getId(), account.getPassword()) + const signature = await this.ocean.utils.signature.signText( + message, + account.getId(), + account.getPassword() + ) return `${signature}-${time}` } catch { @@ -53,7 +57,9 @@ export class OceanAuth extends Instantiable { return `0x${'0'.repeat(40)}` } - return this.web3.utils.toChecksumAddress(await this.ocean.utils.signature.verifyText(message, signature)) + return this.web3.utils.toChecksumAddress( + await this.ocean.utils.signature.verifyText(message, signature) + ) } /** @@ -121,7 +127,9 @@ export class OceanAuth extends Instantiable { try { localStorage.getItem('') } catch { - throw new Error('LocalStorage is not supported. This feature is only available on browsers.') + throw new Error( + 'LocalStorage is not supported. This feature is only available on browsers.' + ) } return localStorage } diff --git a/src/ocean/OceanSecretStore.ts b/src/ocean/OceanSecretStore.ts index a76dfeb..f06f90e 100644 --- a/src/ocean/OceanSecretStore.ts +++ b/src/ocean/OceanSecretStore.ts @@ -13,7 +13,9 @@ export class OceanSecretStore extends Instantiable { * Returns the instance of OceanSecretStore. * @return {Promise} */ - public static async getInstance(config: InstantiableConfig): Promise { + public static async getInstance( + config: InstantiableConfig + ): Promise { const instance = new OceanSecretStore() instance.setInstanceConfig(config) @@ -28,12 +30,25 @@ export class OceanSecretStore extends Instantiable { * @param {string} publisher Publisher account. * @return {Promise} Encrypted text. */ - public async encrypt(did: string, document: any, publisher: Account): Promise { + public async encrypt( + did: string, + document: any, + publisher: Account + ): Promise { const signature = (await publisher.getToken()) || - (await this.ocean.utils.signature.signText(noDidPrefixed(did), publisher.getId(), publisher.getPassword())) + (await this.ocean.utils.signature.signText( + noDidPrefixed(did), + publisher.getId(), + publisher.getPassword() + )) - return this.ocean.brizo.encrypt(noDidPrefixed(did), signature, document, publisher.getId()) + return this.ocean.brizo.encrypt( + noDidPrefixed(did), + signature, + document, + publisher.getId() + ) } /** @@ -44,8 +59,16 @@ export class OceanSecretStore extends Instantiable { * @param {string} consumer cONSUMER account. * @return {Promise} Encrypted text. */ - public async decrypt(did: string, content: string, consumer?: Account, secretStoreUrl?: string): Promise { - return this.getSecretStoreByAccount(consumer, secretStoreUrl).decryptDocument(noDidPrefixed(did), content) + public async decrypt( + did: string, + content: string, + consumer?: Account, + secretStoreUrl?: string + ): Promise { + return this.getSecretStoreByAccount(consumer, secretStoreUrl).decryptDocument( + noDidPrefixed(did), + content + ) } private getSecretStoreByAccount(account: Account, secretStoreUrl?: string) { diff --git a/src/ocean/utils/ServiceAgreement.ts b/src/ocean/utils/ServiceAgreement.ts index 9c12559..91fd685 100644 --- a/src/ocean/utils/ServiceAgreement.ts +++ b/src/ocean/utils/ServiceAgreement.ts @@ -19,7 +19,10 @@ export class ServiceAgreement extends Instantiable { consumer: Account ): Promise { const service = ddo.findServiceById<'access'>(index) - const timelockValues: number[] = this.getTimeValuesFromService(service, 'timelock') + const timelockValues: number[] = this.getTimeValuesFromService( + service, + 'timelock' + ) const timeoutValues: number[] = this.getTimeValuesFromService(service, 'timeout') if (!service.templateId) { @@ -83,7 +86,10 @@ export class ServiceAgreement extends Instantiable { return this.web3.utils.soliditySha3(...args) } - private getTimeValuesFromService(service: ServiceAccess, type: 'timeout' | 'timelock'): number[] { + private getTimeValuesFromService( + service: ServiceAccess, + type: 'timeout' | 'timelock' + ): number[] { const timeoutValues: number[] = service.attributes.serviceAgreementTemplate.conditions.map( (condition: ServiceAgreementTemplateCondition) => condition[type] ) diff --git a/src/ocean/utils/SignatureUtils.ts b/src/ocean/utils/SignatureUtils.ts index 1fcdafc..b37a27e 100644 --- a/src/ocean/utils/SignatureUtils.ts +++ b/src/ocean/utils/SignatureUtils.ts @@ -6,8 +6,15 @@ export class SignatureUtils extends Instantiable { this.setInstanceConfig(config) } - public async signText(text: string, publicKey: string, password?: string): Promise { - const isMetaMask = this.web3 && this.web3.currentProvider && (this.web3.currentProvider as any).isMetaMask + public async signText( + text: string, + publicKey: string, + password?: string + ): Promise { + const isMetaMask = + this.web3 && + this.web3.currentProvider && + (this.web3.currentProvider as any).isMetaMask try { return await this.web3.eth.personal.sign(text, publicKey, password) } catch (e) { diff --git a/src/ocean/utils/WebServiceConnector.ts b/src/ocean/utils/WebServiceConnector.ts index 2fab2fe..37a07b9 100644 --- a/src/ocean/utils/WebServiceConnector.ts +++ b/src/ocean/utils/WebServiceConnector.ts @@ -43,14 +43,20 @@ export class WebServiceConnector extends Instantiable { }) } - public async downloadFile(url: string, destination?: string, index?: number): Promise { + public async downloadFile( + url: string, + destination?: string, + index?: number + ): Promise { const response = await this.get(url) if (!response.ok) { throw new Error('Response error.') } let filename: string try { - filename = response.headers.get('content-disposition').match(/attachment;filename=(.+)/)[1] + filename = response.headers + .get('content-disposition') + .match(/attachment;filename=(.+)/)[1] } catch { try { filename = url.split('/').pop() diff --git a/src/utils/ConversionTypeHelpers.ts b/src/utils/ConversionTypeHelpers.ts index 1560dc3..15f743a 100644 --- a/src/utils/ConversionTypeHelpers.ts +++ b/src/utils/ConversionTypeHelpers.ts @@ -4,7 +4,11 @@ import { LoggerInstance } from './Logger' export const zeroX = (input: string) => zeroXTransformer(input, true) export const noZeroX = (input: string) => zeroXTransformer(input, false) export function zeroXTransformer(input: string = '', zeroOutput: boolean) { - const { valid, output } = inputMatch(input, /^(?:0x)*([a-f0-9]+)$/i, 'zeroXTransformer') + const { valid, output } = inputMatch( + input, + /^(?:0x)*([a-f0-9]+)$/i, + 'zeroXTransformer' + ) return (zeroOutput && valid ? '0x' : '') + output } @@ -12,7 +16,11 @@ export function zeroXTransformer(input: string = '', zeroOutput: boolean) { export const didPrefixed = (input: string) => didTransformer(input, true) export const noDidPrefixed = (input: string) => didTransformer(input, false) export function didTransformer(input: string = '', prefixOutput: boolean) { - const { valid, output } = inputMatch(input, /^(?:0x|did:op:)*([a-f0-9]{64})$/i, 'didTransformer') + const { valid, output } = inputMatch( + input, + /^(?:0x|did:op:)*([a-f0-9]{64})$/i, + 'didTransformer' + ) return (prefixOutput && valid ? 'did:op:' : '') + output } @@ -20,7 +28,11 @@ export function didTransformer(input: string = '', prefixOutput: boolean) { export const didZeroX = (input: string) => zeroX(didTransformer(input, false)) // Shared functions -function inputMatch(input: string, regexp: RegExp, conversorName: string): { valid: boolean; output: string } { +function inputMatch( + input: string, + regexp: RegExp, + conversorName: string +): { valid: boolean; output: string } { if (typeof input !== 'string') { LoggerInstance.debug('Not input string:') LoggerInstance.debug(input) diff --git a/src/utils/DDOHelpers.ts b/src/utils/DDOHelpers.ts index bb59480..327be5f 100644 --- a/src/utils/DDOHelpers.ts +++ b/src/utils/DDOHelpers.ts @@ -1,5 +1,8 @@ import { DDO } from '../ddo/DDO' -import { ServiceAgreementTemplateCondition, ServiceAgreementTemplateParameter } from '../ddo/ServiceAgreementTemplate' +import { + ServiceAgreementTemplateCondition, + ServiceAgreementTemplateParameter +} from '../ddo/ServiceAgreementTemplate' function fillParameterWithDDO( parameter: ServiceAgreementTemplateParameter, diff --git a/src/utils/SubscribableObserver.ts b/src/utils/SubscribableObserver.ts index a554bcc..efeb411 100644 --- a/src/utils/SubscribableObserver.ts +++ b/src/utils/SubscribableObserver.ts @@ -7,7 +7,11 @@ export class SubscribableObserver { onError?: (error: any) => void }>() - public subscribe(onNext?: (next: T) => void, onComplete?: (complete: P) => void, onError?: (error: any) => void) { + public subscribe( + onNext?: (next: T) => void, + onComplete?: (complete: P) => void, + onError?: (error: any) => void + ) { if (this.completed) { throw new Error('Observer completed.') } diff --git a/test/aquarius/Aquarius.test.ts b/test/aquarius/Aquarius.test.ts index 3714fc3..7cce648 100644 --- a/test/aquarius/Aquarius.test.ts +++ b/test/aquarius/Aquarius.test.ts @@ -17,7 +17,12 @@ describe('Aquarius', () => { let ocean: Ocean let aquarius: Aquarius /* eslint-disable @typescript-eslint/camelcase */ - const getResults = (results: DDO[], page = 0, total_pages = 1, total_results = 1) => ({ + const getResults = ( + results: DDO[], + page = 0, + total_pages = 1, + total_results = 1 + ) => ({ results, page, total_pages, diff --git a/test/ddo/DDO.test.ts b/test/ddo/DDO.test.ts index 98c02af..c46afb3 100644 --- a/test/ddo/DDO.test.ts +++ b/test/ddo/DDO.test.ts @@ -54,7 +54,8 @@ describe('DDO', () => { }, { type: 'HubService', - serviceEndpoint: 'https://hub.example.com/.identity/did:op:0123456789abcdef/' + serviceEndpoint: + 'https://hub.example.com/.identity/did:op:0123456789abcdef/' }, { type: 'MessagingService', @@ -87,7 +88,8 @@ describe('DDO', () => { { type: 'metadata', index: 0, - serviceEndpoint: 'http://myaquarius.org/api/v1/provider/assets/metadata/{did}', + serviceEndpoint: + 'http://myaquarius.org/api/v1/provider/assets/metadata/{did}', attributes: { main: { name: 'UK Weather information 2011', @@ -103,7 +105,8 @@ describe('DDO', () => { checksum: 'efb2c764274b745f5fc37f97c6b0e761', contentLength: '4535431', contentType: 'application/json', - resourceId: 'access-log2018-02-13-15-17-29-18386C502CAEA932' + resourceId: + 'access-log2018-02-13-15-17-29-18386C502CAEA932' }, { index: 1, @@ -123,9 +126,11 @@ describe('DDO', () => { schema: 'Binary Voting' }, additionalInformation: { - description: 'Weather information of UK including temperature and humidity', + description: + 'Weather information of UK including temperature and humidity', copyrightHolder: 'Met Office', - workExample: '423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68', + workExample: + '423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68', links: [ { sample1: @@ -235,7 +240,10 @@ describe('DDO', () => { const ddo = new DDO(testDDO) const checksum = ddo.getChecksum() - assert.equal(checksum, '0x15f27a7a3c7b15d2b06dec7347c6b8da168adddd7df51a8ebbbe87b59b80049b') + assert.equal( + checksum, + '0x15f27a7a3c7b15d2b06dec7347c6b8da168adddd7df51a8ebbbe87b59b80049b' + ) }) }) diff --git a/test/keeper/ContractEvent.test.ts b/test/keeper/ContractEvent.test.ts index e858894..db0999b 100644 --- a/test/keeper/ContractEvent.test.ts +++ b/test/keeper/ContractEvent.test.ts @@ -22,7 +22,9 @@ describe('ContractEvent', () => { describe('#subscribe()', () => { it('should be able to listen to events', async () => { - const event = eventHandler.getEvent(ocean.keeper.token, 'Transfer', { to: account }) + const event = eventHandler.getEvent(ocean.keeper.token, 'Transfer', { + to: account + }) let validResolve = false let subscription: ContractEventSubscription diff --git a/test/keeper/DIDRegistry.test.ts b/test/keeper/DIDRegistry.test.ts index 0b467c9..537e950 100644 --- a/test/keeper/DIDRegistry.test.ts +++ b/test/keeper/DIDRegistry.test.ts @@ -21,7 +21,13 @@ describe('DIDRegistry', () => { const ownerAccount: Account = (await ocean.accounts.list())[0] const did = generateId() const data = 'my nice provider, is nice' - const receipt = await didRegistry.registerAttribute(did, `0123456789abcdef`, [], data, ownerAccount.getId()) + const receipt = await didRegistry.registerAttribute( + did, + `0123456789abcdef`, + [], + data, + ownerAccount.getId() + ) assert(receipt.status) assert(receipt.events.DIDAttributeRegistered) }) @@ -32,7 +38,13 @@ describe('DIDRegistry', () => { { // register the first attribute const data = 'my nice provider, is nice' - await didRegistry.registerAttribute(did, '0123456789abcdef', [], data, ownerAccount.getId()) + await didRegistry.registerAttribute( + did, + '0123456789abcdef', + [], + data, + ownerAccount.getId() + ) } { // register the second attribute with the same did @@ -55,11 +67,21 @@ describe('DIDRegistry', () => { const ownerAccount: Account = (await ocean.accounts.list())[0] const did = generateId() const data = 'my nice provider, is nice' - await didRegistry.registerAttribute(did, '0123456789abcdef', [], data, ownerAccount.getId()) + await didRegistry.registerAttribute( + did, + '0123456789abcdef', + [], + data, + ownerAccount.getId() + ) const owner = await didRegistry.getDIDOwner(did) - assert.equal(owner, ownerAccount.getId(), `Got ${owner} but expected ${ownerAccount.getId()}`) + assert.equal( + owner, + ownerAccount.getId(), + `Got ${owner} but expected ${ownerAccount.getId()}` + ) }) it('should get 0x0 for a not registered did', async () => { @@ -74,15 +96,29 @@ describe('DIDRegistry', () => { const ownerAccount: Account = (await ocean.accounts.list())[0] const did = generateId() const data = 'my nice provider, is nice' - await didRegistry.registerAttribute(did, '0123456789abcdef', [], data, ownerAccount.getId()) + await didRegistry.registerAttribute( + did, + '0123456789abcdef', + [], + data, + ownerAccount.getId() + ) // transfer const newOwnerAccount: Account = (await ocean.accounts.list())[1] - await didRegistry.transferDIDOwnership(did, newOwnerAccount.getId(), ownerAccount.getId()) + await didRegistry.transferDIDOwnership( + did, + newOwnerAccount.getId(), + ownerAccount.getId() + ) // check const newOwner = await didRegistry.getDIDOwner(did) - assert.equal(newOwner, newOwnerAccount.getId(), `Got ${newOwner} but expected ${newOwnerAccount.getId()}`) + assert.equal( + newOwner, + newOwnerAccount.getId(), + `Got ${newOwner} but expected ${newOwnerAccount.getId()}` + ) }) }) }) diff --git a/test/keeper/TestContractHandler.ts b/test/keeper/TestContractHandler.ts index 39a2025..edf73c9 100644 --- a/test/keeper/TestContractHandler.ts +++ b/test/keeper/TestContractHandler.ts @@ -25,23 +25,33 @@ export default class TestContractHandler extends ContractHandler { Logger.log('Trying to deploy contracts') // Libraries - const epochLibrary = await TestContractHandler.deployContract('EpochLibrary', deployerAddress) - const didRegistryLibrary = await TestContractHandler.deployContract('DIDRegistryLibrary', deployerAddress) + const epochLibrary = await TestContractHandler.deployContract( + 'EpochLibrary', + deployerAddress + ) + const didRegistryLibrary = await TestContractHandler.deployContract( + 'DIDRegistryLibrary', + deployerAddress + ) // Contracts - const token = await TestContractHandler.deployContract('OceanToken', deployerAddress, [ + const token = await TestContractHandler.deployContract( + 'OceanToken', deployerAddress, - deployerAddress - ]) + [deployerAddress, deployerAddress] + ) - const dispenser = await TestContractHandler.deployContract('Dispenser', deployerAddress, [ - token.options.address, - deployerAddress - ]) + const dispenser = await TestContractHandler.deployContract( + 'Dispenser', + deployerAddress, + [token.options.address, deployerAddress] + ) // Add dispenser as Token minter if (!token.$initialized) { - await token.methods.addMinter(dispenser.options.address).send({ from: deployerAddress }) + await token.methods + .addMinter(dispenser.options.address) + .send({ from: deployerAddress }) } const didRegistry = await TestContractHandler.deployContract( @@ -54,9 +64,11 @@ export default class TestContractHandler extends ContractHandler { ) // Managers - const templateStoreManager = await TestContractHandler.deployContract('TemplateStoreManager', deployerAddress, [ - deployerAddress - ]) + const templateStoreManager = await TestContractHandler.deployContract( + 'TemplateStoreManager', + deployerAddress, + [deployerAddress] + ) const conditionStoreManager = await TestContractHandler.deployContract( 'ConditionStoreManager', deployerAddress, @@ -77,33 +89,49 @@ export default class TestContractHandler extends ContractHandler { ) // Conditions - const lockRewardCondition = await TestContractHandler.deployContract('LockRewardCondition', deployerAddress, [ + const lockRewardCondition = await TestContractHandler.deployContract( + 'LockRewardCondition', deployerAddress, - conditionStoreManager.options.address, - token.options.address - ]) + [ + deployerAddress, + conditionStoreManager.options.address, + token.options.address + ] + ) const accessSecretStoreCondition = await TestContractHandler.deployContract( 'AccessSecretStoreCondition', deployerAddress, - [deployerAddress, conditionStoreManager.options.address, agreementStoreManager.options.address] + [ + deployerAddress, + conditionStoreManager.options.address, + agreementStoreManager.options.address + ] ) // Conditions rewards - const escrowReward = await TestContractHandler.deployContract('EscrowReward', deployerAddress, [ + const escrowReward = await TestContractHandler.deployContract( + 'EscrowReward', deployerAddress, - conditionStoreManager.options.address, - token.options.address - ]) + [ + deployerAddress, + conditionStoreManager.options.address, + token.options.address + ] + ) // Templates - await TestContractHandler.deployContract('EscrowAccessSecretStoreTemplate', deployerAddress, [ + await TestContractHandler.deployContract( + 'EscrowAccessSecretStoreTemplate', deployerAddress, - agreementStoreManager.options.address, - didRegistry.options.address, - accessSecretStoreCondition.options.address, - lockRewardCondition.options.address, - escrowReward.options.address - ]) + [ + deployerAddress, + agreementStoreManager.options.address, + didRegistry.options.address, + accessSecretStoreCondition.options.address, + lockRewardCondition.options.address, + escrowReward.options.address + ] + ) } private static async deployContract( @@ -151,7 +179,10 @@ export default class TestContractHandler extends ContractHandler { contractInstance = await tempContract .deploy({ - data: TestContractHandler.replaceTokens(artifact.bytecode.toString(), tokens), + data: TestContractHandler.replaceTokens( + artifact.bytecode.toString(), + tokens + ), arguments: isZos ? undefined : args }) .send(sendConfig) @@ -162,16 +193,26 @@ export default class TestContractHandler extends ContractHandler { ContractHandler.setContract(name, where, contractInstance) // Logger.log('Deployed', name, 'at', contractInstance.options.address) } catch (err) { - Logger.error('Deployment failed for', name, 'with args', JSON.stringify(args, null, 2), err.message) + Logger.error( + 'Deployment failed for', + name, + 'with args', + JSON.stringify(args, null, 2), + err.message + ) throw err } return contractInstance } - private static replaceTokens(bytecode: string, tokens: { [name: string]: string }): string { + private static replaceTokens( + bytecode: string, + tokens: { [name: string]: string } + ): string { return Object.entries(tokens).reduce( - (acc, [token, address]) => acc.replace(new RegExp(`_+${token}_+`, 'g'), address.substr(2)), + (acc, [token, address]) => + acc.replace(new RegExp(`_+${token}_+`, 'g'), address.substr(2)), bytecode ) } diff --git a/test/keeper/conditions/AccessSecretStoreCondition.test.ts b/test/keeper/conditions/AccessSecretStoreCondition.test.ts index dba04cb..47040ab 100644 --- a/test/keeper/conditions/AccessSecretStoreCondition.test.ts +++ b/test/keeper/conditions/AccessSecretStoreCondition.test.ts @@ -13,7 +13,8 @@ describe('AccessSecretStoreCondition', () => { before(async () => { await TestContractHandler.prepareContracts() - condition = (await Ocean.getInstance(config)).keeper.conditions.accessSecretStoreCondition + condition = (await Ocean.getInstance(config)).keeper.conditions + .accessSecretStoreCondition }) describe('#hashValues()', () => { diff --git a/test/keeper/conditions/EscrowReward.test.ts b/test/keeper/conditions/EscrowReward.test.ts index 5a6aaa1..361b59c 100644 --- a/test/keeper/conditions/EscrowReward.test.ts +++ b/test/keeper/conditions/EscrowReward.test.ts @@ -21,13 +21,27 @@ describe('EscrowReward', () => { await TestContractHandler.prepareContracts() condition = keeper.conditions.escrowReward - lockCondition = await keeper.conditions.lockRewardCondition.generateIdHash(agreementId, publisher, amount) - releaseCondition = await keeper.conditions.accessSecretStoreCondition.generateIdHash(agreementId, did, consumer) + lockCondition = await keeper.conditions.lockRewardCondition.generateIdHash( + agreementId, + publisher, + amount + ) + releaseCondition = await keeper.conditions.accessSecretStoreCondition.generateIdHash( + agreementId, + did, + consumer + ) }) describe('#hashValues()', () => { it('should hash the values', async () => { - const hash = await condition.hashValues(amount, consumer, publisher, lockCondition, releaseCondition) + const hash = await condition.hashValues( + amount, + consumer, + publisher, + lockCondition, + releaseCondition + ) assert.match(hash, /^0x[a-f0-9]{64}$/i) }) @@ -35,7 +49,13 @@ describe('EscrowReward', () => { describe('#generateId()', () => { it('should generate an ID', async () => { - const hash = await condition.hashValues(amount, consumer, publisher, lockCondition, releaseCondition) + const hash = await condition.hashValues( + amount, + consumer, + publisher, + lockCondition, + releaseCondition + ) const id = await condition.generateId(agreementId, hash) assert.match(id, /^0x[a-f0-9]{64}$/i) diff --git a/test/keeper/conditions/LockRewardCondition.test.ts b/test/keeper/conditions/LockRewardCondition.test.ts index 5c05261..6b70668 100644 --- a/test/keeper/conditions/LockRewardCondition.test.ts +++ b/test/keeper/conditions/LockRewardCondition.test.ts @@ -13,7 +13,8 @@ describe('LockRewardCondition', () => { before(async () => { await TestContractHandler.prepareContracts() - condition = (await Ocean.getInstance(config)).keeper.conditions.lockRewardCondition + condition = (await Ocean.getInstance(config)).keeper.conditions + .lockRewardCondition }) describe('#hashValues()', () => { diff --git a/test/mocks/WebServiceConnector.mock.ts b/test/mocks/WebServiceConnector.mock.ts index e303b62..1a7ac55 100644 --- a/test/mocks/WebServiceConnector.mock.ts +++ b/test/mocks/WebServiceConnector.mock.ts @@ -15,7 +15,9 @@ export default class WebServiceConnectorMock extends WebServiceConnector { return this.returnData ? this.returnData : {} }, text: () => { - return this.returnData ? JSON.stringify(this.returnData.toString()) : '' + return this.returnData + ? JSON.stringify(this.returnData.toString()) + : '' } }) }) diff --git a/test/ocean/Account.test.ts b/test/ocean/Account.test.ts index af45da9..031acd0 100644 --- a/test/ocean/Account.test.ts +++ b/test/ocean/Account.test.ts @@ -39,7 +39,10 @@ describe('Account', () => { const balance = await account.getEtherBalance() const web3 = Web3Provider.getWeb3() - assert(Number(web3.utils.toWei('100', 'ether')) === balance, `ether did not match ${balance}`) + assert( + Number(web3.utils.toWei('100', 'ether')) === balance, + `ether did not match ${balance}` + ) }) }) @@ -49,7 +52,10 @@ describe('Account', () => { const balance = await account.getBalance() const web3 = Web3Provider.getWeb3() - assert(Number(web3.utils.toWei('100', 'ether')) === balance.eth, `ether did not match ${balance.eth}`) + assert( + Number(web3.utils.toWei('100', 'ether')) === balance.eth, + `ether did not match ${balance.eth}` + ) assert(balance.ocn === 0, `tokens did not match ${balance.ocn}`) }) }) diff --git a/test/ocean/OceanSecretStore.test.ts b/test/ocean/OceanSecretStore.test.ts index 36edcfd..7e813cc 100644 --- a/test/ocean/OceanSecretStore.test.ts +++ b/test/ocean/OceanSecretStore.test.ts @@ -27,7 +27,11 @@ describe('OceanSecretStore', () => { describe('#encrypt()', () => { it('should encrypt a content', async () => { - const secretStoreEncryptSpy = spy.on(ocean.brizo, 'encrypt', () => 'encryptedResult') + const secretStoreEncryptSpy = spy.on( + ocean.brizo, + 'encrypt', + () => 'encryptedResult' + ) const result = await oceanSecretStore.encrypt(did, 'test', accounts[0]) diff --git a/test/ocean/utils/SignatureUtils.test.ts b/test/ocean/utils/SignatureUtils.test.ts index 4b27e71..3bbdfcf 100644 --- a/test/ocean/utils/SignatureUtils.test.ts +++ b/test/ocean/utils/SignatureUtils.test.ts @@ -47,9 +47,16 @@ describe('SignatureUtils', () => { describe('#verifyText', () => { it('should recover the privateKey of a signed message', async () => { - const personalRecoverSpy = spy.on(web3.eth.personal, 'ecRecover', () => publicKey) + const personalRecoverSpy = spy.on( + web3.eth.personal, + 'ecRecover', + () => publicKey + ) - const verifiedPublicKey = await ocean.utils.signature.verifyText(text, signature) + const verifiedPublicKey = await ocean.utils.signature.verifyText( + text, + signature + ) assert.equal(publicKey, verifiedPublicKey) expect(personalRecoverSpy).to.have.been.called.with(text, signature) diff --git a/test/utils/ConversionTypeHelpers.test.ts b/test/utils/ConversionTypeHelpers.test.ts index 423dc7b..3fbf19b 100644 --- a/test/utils/ConversionTypeHelpers.test.ts +++ b/test/utils/ConversionTypeHelpers.test.ts @@ -1,5 +1,10 @@ import { assert } from 'chai' -import { zeroX, noZeroX, didPrefixed, noDidPrefixed } from '../../src/utils/ConversionTypeHelpers' +import { + zeroX, + noZeroX, + didPrefixed, + noDidPrefixed +} from '../../src/utils/ConversionTypeHelpers' describe('ConversionTypeHelpers', () => { describe('#zeroXTransformer()', () => { From e2f752a264bf5e09b76f37214f1c476e39697ac3 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 15 Nov 2019 00:22:28 +0100 Subject: [PATCH 44/56] Release 1.0.0-beta.5 --- CHANGELOG.md | 11 ++++++++++- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3eedad..d136ee7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,14 +10,23 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - added xDai [`#336`](https://github.com/oceanprotocol/squid-js/pull/336) +#### [v1.0.0-beta.5](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.4...v1.0.0-beta.5) + +> 14 November 2019 + +- v2: Web3.js 1.2.3 [`#331`](https://github.com/oceanprotocol/squid-js/pull/331) +- fresh package-lock [`350f831`](https://github.com/oceanprotocol/squid-js/commit/350f8317ce51ec77121a47e5b36d5febe6daf0e5) +- tweak printWidth [`e1c934f`](https://github.com/oceanprotocol/squid-js/commit/e1c934f5783c3517165af0b51aa957bd4a3853e1) +- web3.js v1.2.3 [`b50cede`](https://github.com/oceanprotocol/squid-js/commit/b50cede2309104066c1683027916aa85b1a96e04) + #### [v1.0.0-beta.4](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.3...v1.0.0-beta.4) > 14 November 2019 - v2: add transferOwnership method [`#332`](https://github.com/oceanprotocol/squid-js/pull/332) +- refactoring for web3.js 1.2.2 [`cc54ccb`](https://github.com/oceanprotocol/squid-js/commit/cc54ccb172e0ccd0b9aee7ceb1244d8d135a8c10) - search test tweaks [`3920d62`](https://github.com/oceanprotocol/squid-js/commit/3920d62ef9dd7f608b235982e34fb7a0c95c12d7) - add ocean.assets.transferOwnership() [`e1ef7b0`](https://github.com/oceanprotocol/squid-js/commit/e1ef7b0f17c2f7d7bcc642b4fc1719acd0652a66) -- transferOwnership fixes, add integration test [`d3f9520`](https://github.com/oceanprotocol/squid-js/commit/d3f9520a5b4ad97c033d6fe212d538eae2758fd7) #### [v1.0.0-beta.3](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.2...v1.0.0-beta.3) diff --git a/package-lock.json b/package-lock.json index 93986be..20515ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0-beta.4", + "version": "1.0.0-beta.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4509daf..0e1dc7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0-beta.4", + "version": "1.0.0-beta.5", "description": "JavaScript client library for Ocean Protocol", "main": "./dist/node/squid.js", "typings": "./dist/node/squid.d.ts", From 2d971cbd10418d2209cf06fced658aff7a57610a Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 15 Nov 2019 11:09:08 +0100 Subject: [PATCH 45/56] add migration guide --- MIGRATION.md | 179 +++++++++++++++++++++++++++++++++++++++++++++ README.md | 8 ++ SQUID_INTERFACE.md | 1 - 3 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 MIGRATION.md delete mode 100644 SQUID_INTERFACE.md diff --git a/MIGRATION.md b/MIGRATION.md new file mode 100644 index 0000000..3adf787 --- /dev/null +++ b/MIGRATION.md @@ -0,0 +1,179 @@ +# Migration Guide + +Instructions on how to migrate between breaking versions. + +## 0.8.3 → 1.0.0 + +### DDO structure + +The whole structure of the DDO has been changed based on [OEP-12](https://github.com/oceanprotocol/OEPs/tree/master/12) and [OEP-8 v0.4](https://github.com/oceanprotocol/OEPs/tree/master/8/v0.4) to better accomodate the DDOs to hold additional services, like execution of workflows and algorithms. + +For migrating we only have to deal with the `metadata` service holding the asset metadata, which was restructured too: + +old: + +```json +{ + "service": [ + { + "serviceDefinitionId": "0", + "serviceEndpoint": "http://localhost:5000/api/v1/aquarius/assets/ddo/{did}", + "type": "Metadata", + "metadata": { + "base": { + "name": "Madrid Weather forecast", + "description": "Wheater forecast of Europe/Madrid in XML format", + "dateCreated": "2019-05-16T12:36:14.535Z", + "author": "Norwegian Meteorological Institute", + "type": "dataset", + "license": "Public Domain", + "price": "123000000000000000000", + "copyrightHolder": "Norwegian Meteorological Institute", + "files": [ + { + "index": 0, + "url": "https://example-url.net/weather/forecast/madrid/350750305731.xml", + "contentLength": 1000, + "contentType": "text/xml", + "compression": "none" + } + ], + "categories": ["Other"], + "links": [], + "tags": [] + }, + "additionalInformation": { + "updateFrequency": null, + "structuredMarkup": [] + } + } + } + ] +} +``` + +NEW. Where `main` now holds the non-changable attributes only, everything else has been moved to `additionalInformation`. Likewise, `serviceDefinitionId` is now `index`: + +```json +{ + "service": [ + { + "index": 0, + "serviceEndpoint": "http://localhost:5000/api/v1/aquarius/assets/ddo/{did}", + "type": "metadata", + "attributes": { + "main": { + "name": "Madrid Weather forecast", + "dateCreated": "2019-05-16T12:36:14.535Z", + "author": "Norwegian Meteorological Institute", + "type": "dataset", + "license": "Public Domain", + "price": "123000000000000000000", + "files": [ + { + "index": 0, + "url": "https://example-url.net/weather/forecast/madrid/350750305731.xml", + "contentLength": "1000", + "contentType": "text/xml", + "compression": "none" + } + ] + }, + "additionalInformation": { + "description": "Weather forecast of Europe/Madrid in XML format", + "copyrightHolder": "Norwegian Meteorological Institute", + "categories": ["Other"], + "links": [], + "tags": [], + "updateFrequency": null, + "structuredMarkup": [] + } + } + } + ] +} +``` + +Those changes require updates to your code whenever you fetch or create a new DDO as outlined below. + +### Lowercase service names + +All the service names are now in lowercase: + +old: + +```js +const service = ddo.findServiceByType('Access') +``` + +NEW: + +```js +const service = ddo.findServiceByType('access') +``` + +### Accessing new metadata structure + +Typically you would grab and restructure asset metadata for display. This works the same as before but the key names have changed: + +old: + +```js +const { metadata } = ddo.findServiceByType('Metadata') +const { base, additionalInformation } = metadata +console.log(base.price) +console.log(base.description) +``` + +NEW: + +```js +const { attributes } = ddo.findServiceByType('metadata') +const { main, additionalInformation } = attributes +console.log(main.price) +console.log(additionalInformation.description) +``` + +### `service.serviceDefinitionId` → `service.index` + +old: + +```js +await ocean.assets.order(ddo.id, service.serviceDefinitionId, accounts[0]) +``` + +NEW: + +```js +await ocean.assets.order(ddo.id, service.index, accounts[0]) +``` + +### File attribute changes + +In the file attributes, the `contentLength` is now a string. + +old: + +```json +"files": [ + { + "index": 0, + "url": "https://example-url.net/weather/forecast/madrid/350750305731.xml", + "contentLength": 1000, + "contentType": "text/xml" + } +] +``` + +NEW: + +```json +"files": [ + { + "index": 0, + "url": "https://example-url.net/weather/forecast/madrid/350750305731.xml", + "contentLength": "1000", + "contentType": "text/xml" + } +] +``` diff --git a/README.md b/README.md index abe63a6..a038cd9 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ - [Get started](#get-started) - [Examples](#examples) - [Documentation](#documentation) + - [Migration Guide](#migration-guide) - [Development](#development) - [Testing](#testing) - [Unit Tests](#unit-tests) @@ -75,6 +76,7 @@ For an overview of endpoint configurations making up various Ocean networks, ple You can see how `squid-js` is used on: +- [Docs: React Tutorial](https://docs.oceanprotocol.com/tutorials/react-setup/) - [Integration test](/src/integration/ocean/) - [Tuna](https://github.com/oceanprotocol/tuna/tree/develop/node) @@ -89,6 +91,12 @@ Alternatively, you can generate the raw TypeDoc documentation locally by running npm run doc ``` +### Migration Guide + +Instructions on how to migrate between breaking versions: + +- [Migration Guide](MIGRATION.md) + ## Development To start development you need to: diff --git a/SQUID_INTERFACE.md b/SQUID_INTERFACE.md deleted file mode 100644 index 40abec7..0000000 --- a/SQUID_INTERFACE.md +++ /dev/null @@ -1 +0,0 @@ -this document has been moved to [here](https://github.com/oceanprotocol/dev-ocean/blob/master/doc/architecture/squid.md). From 8c8306de2ea50e59a8c88133ca4e6bad6304ee16 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 15 Nov 2019 11:18:23 +0100 Subject: [PATCH 46/56] add required component versions to migration guide --- MIGRATION.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 3adf787..461fdfe 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -2,9 +2,18 @@ Instructions on how to migrate between breaking versions. -## 0.8.3 → 1.0.0 +## v0.8.3 → v1.0.0 -### DDO structure +### Ocean Protocol Components Requirements + +squid-js v1.0.0 only works against: + +- Aquarius v1.0.2+ +- Brizo v0.7.0+ +- Events Handler v0.3.0+ +- Keeper Contracts v0.12.7+ + +### DDO Structure The whole structure of the DDO has been changed based on [OEP-12](https://github.com/oceanprotocol/OEPs/tree/master/12) and [OEP-8 v0.4](https://github.com/oceanprotocol/OEPs/tree/master/8/v0.4) to better accomodate the DDOs to hold additional services, like execution of workflows and algorithms. @@ -96,7 +105,7 @@ NEW. Where `main` now holds the non-changable attributes only, everything else h Those changes require updates to your code whenever you fetch or create a new DDO as outlined below. -### Lowercase service names +### Lowercase Service Names All the service names are now in lowercase: @@ -112,7 +121,7 @@ NEW: const service = ddo.findServiceByType('access') ``` -### Accessing new metadata structure +### Accessing New Metadata Structure Typically you would grab and restructure asset metadata for display. This works the same as before but the key names have changed: @@ -148,7 +157,7 @@ NEW: await ocean.assets.order(ddo.id, service.index, accounts[0]) ``` -### File attribute changes +### File Attribute Changes In the file attributes, the `contentLength` is now a string. From 83689c52886f28986e78698c217eb065c38da9ac Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 15 Nov 2019 11:30:00 +0100 Subject: [PATCH 47/56] bump packages --- package-lock.json | 268 +++++++++++++++++++++++----------------------- package.json | 18 ++-- 2 files changed, 143 insertions(+), 143 deletions(-) diff --git a/package-lock.json b/package-lock.json index 20515ea..1606680 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13234,9 +13234,9 @@ "dev": true }, "ts-node": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.5.0.tgz", - "integrity": "sha512-fbG32iZEupNV2E2Fd2m2yt1TdAwR3GTCrJQBHDevIiEBNy1A8kqnyl1fv7jmRmmbtcapFab2glZXHJvfD1ed0Q==", + "version": "8.5.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.5.2.tgz", + "integrity": "sha512-W1DK/a6BGoV/D4x/SXXm6TSQx6q3blECUzd5TN+j56YEMX3yPVMpHsICLedUw3DvGF3aTQ8hfdR9AKMaHjIi+A==", "dev": true, "requires": { "arg": "^4.1.0", @@ -13832,24 +13832,24 @@ } }, "web3": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.3.tgz", - "integrity": "sha512-DXOn7GWnbZywc7V8+l2qtDBXzT/xEp83rZveZ9V9dQzs+6GpHiqZlOCybTTFv7YqMTtQAJjTgaBuLDVB6CLrjg==", + "version": "1.2.4", + "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.3", - "web3-core": "1.2.3", - "web3-eth": "1.2.3", - "web3-eth-personal": "1.2.3", - "web3-net": "1.2.3", - "web3-shh": "1.2.3", - "web3-utils": "1.2.3" + "web3-bzz": "1.2.4", + "web3-core": "1.2.4", + "web3-eth": "1.2.4", + "web3-eth-personal": "1.2.4", + "web3-net": "1.2.4", + "web3-shh": "1.2.4", + "web3-utils": "1.2.4" } }, "web3-bzz": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.3.tgz", - "integrity": "sha512-8UWbAkyrHsMxUorKbQ6zxeTFtk1sLJIGajnTdRhGgZ4QAswIgVhN5U+PooYlW4oHDeUvpWc7eW+k9hqYyev3Mg==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.4.tgz", + "integrity": "sha512-MqhAo/+0iQSMBtt3/QI1rU83uvF08sYq8r25+OUZ+4VtihnYsmkkca+rdU0QbRyrXY2/yGIpI46PFdh0khD53A==", "requires": { "@types/node": "^10.12.18", "got": "9.6.0", @@ -13865,106 +13865,106 @@ } }, "web3-core": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.3.tgz", - "integrity": "sha512-BaK645qANHYm8+4wLFS0LSBf1oAdLcoTssfT3MPSEGnrNN1yXCpHlODjwvQAm1ycwjJp58HeUBQJ/2XO5QGo5Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.4.tgz", + "integrity": "sha512-CHc27sMuET2cs1IKrkz7xzmTdMfZpYswe7f0HcuyneTwS1yTlTnHyqjAaTy0ZygAb/x4iaVox+Gvr4oSAqSI+A==", "requires": { "@types/bignumber.js": "^5.0.0", "@types/bn.js": "^4.11.4", "@types/node": "^12.6.1", - "web3-core-helpers": "1.2.3", - "web3-core-method": "1.2.3", - "web3-core-requestmanager": "1.2.3", - "web3-utils": "1.2.3" + "web3-core-helpers": "1.2.4", + "web3-core-method": "1.2.4", + "web3-core-requestmanager": "1.2.4", + "web3-utils": "1.2.4" } }, "web3-core-helpers": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.3.tgz", - "integrity": "sha512-+lJqZBpkciHdxLB20UThXfCnoDekek15a5wrqt/PEhBN+s+RJNaFRLQQFauA5YTF6ATTP/8cGZJ3RMClM1Q4og==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.4.tgz", + "integrity": "sha512-U7wbsK8IbZvF3B7S+QMSNP0tni/6VipnJkB0tZVEpHEIV2WWeBHYmZDnULWcsS/x/jn9yKhJlXIxWGsEAMkjiw==", "requires": { "underscore": "1.9.1", - "web3-eth-iban": "1.2.3", - "web3-utils": "1.2.3" + "web3-eth-iban": "1.2.4", + "web3-utils": "1.2.4" } }, "web3-core-method": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.3.tgz", - "integrity": "sha512-cXqQYYsiSvIXzzrjC7kQvp0U6o6TjeTmKraNF6r4A6ZOqxeMEqD3BVve5rK/RCcoyFJUKDFjOo3MP/gCNOkp4g==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.4.tgz", + "integrity": "sha512-8p9kpL7di2qOVPWgcM08kb+yKom0rxRCMv6m/K+H+yLSxev9TgMbCgMSbPWAHlyiF3SJHw7APFKahK5Z+8XT5A==", "requires": { "underscore": "1.9.1", - "web3-core-helpers": "1.2.3", - "web3-core-promievent": "1.2.3", - "web3-core-subscriptions": "1.2.3", - "web3-utils": "1.2.3" + "web3-core-helpers": "1.2.4", + "web3-core-promievent": "1.2.4", + "web3-core-subscriptions": "1.2.4", + "web3-utils": "1.2.4" } }, "web3-core-promievent": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.3.tgz", - "integrity": "sha512-LX9aI/7QIHZtUPL1aD0meWFArG+cylqJbSq7WHR44MsrsnM0wtcOl8KmcaFtihb/LcCchvAokCcv74ElFYc6DA==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.4.tgz", + "integrity": "sha512-gEUlm27DewUsfUgC3T8AxkKi8Ecx+e+ZCaunB7X4Qk3i9F4C+5PSMGguolrShZ7Zb6717k79Y86f3A00O0VAZw==", "requires": { "any-promise": "1.3.0", "eventemitter3": "3.1.2" } }, "web3-core-requestmanager": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.3.tgz", - "integrity": "sha512-KVHfi9xyqjFRp7UQg79ynE4tIBBZ/w0ygXCFAkyypUxXWSOAO8+q5cj5BSuGbxVsQEnCAixX/MhpXaykpzTB+g==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.4.tgz", + "integrity": "sha512-eZJDjyNTDtmSmzd3S488nR/SMJtNnn/GuwxnMh3AzYCqG3ZMfOylqTad2eYJPvc2PM5/Gj1wAMQcRpwOjjLuPg==", "requires": { "underscore": "1.9.1", - "web3-core-helpers": "1.2.3", - "web3-providers-http": "1.2.3", - "web3-providers-ipc": "1.2.3", - "web3-providers-ws": "1.2.3" + "web3-core-helpers": "1.2.4", + "web3-providers-http": "1.2.4", + "web3-providers-ipc": "1.2.4", + "web3-providers-ws": "1.2.4" } }, "web3-core-subscriptions": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.3.tgz", - "integrity": "sha512-cD3h6ZZ3w9Bop16fNQURVBAb1401b4cFVmQH7rurHwVGQrRHWqLRNktmjdARZ9xKZWyscpeOuQyqVpC9lFtJkA==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.4.tgz", + "integrity": "sha512-3D607J2M8ymY9V+/WZq4MLlBulwCkwEjjC2U+cXqgVO1rCyVqbxZNCmHyNYHjDDCxSEbks9Ju5xqJxDSxnyXEw==", "requires": { "eventemitter3": "3.1.2", "underscore": "1.9.1", - "web3-core-helpers": "1.2.3" + "web3-core-helpers": "1.2.4" } }, "web3-eth": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.3.tgz", - "integrity": "sha512-0jWHyqLY8r3LvuQjeCQRfYaOvOKg482l7g9KGpGJ14vJPE+6zOJY/NYFGJoGsgro04qHCH9pIdy7D/nw2II7ow==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.4.tgz", + "integrity": "sha512-+j+kbfmZsbc3+KJpvHM16j1xRFHe2jBAniMo1BHKc3lho6A8Sn9Buyut6odubguX2AxoRArCdIDCkT9hjUERpA==", "requires": { "underscore": "1.9.1", - "web3-core": "1.2.3", - "web3-core-helpers": "1.2.3", - "web3-core-method": "1.2.3", - "web3-core-subscriptions": "1.2.3", - "web3-eth-abi": "1.2.3", - "web3-eth-accounts": "1.2.3", - "web3-eth-contract": "1.2.3", - "web3-eth-ens": "1.2.3", - "web3-eth-iban": "1.2.3", - "web3-eth-personal": "1.2.3", - "web3-net": "1.2.3", - "web3-utils": "1.2.3" + "web3-core": "1.2.4", + "web3-core-helpers": "1.2.4", + "web3-core-method": "1.2.4", + "web3-core-subscriptions": "1.2.4", + "web3-eth-abi": "1.2.4", + "web3-eth-accounts": "1.2.4", + "web3-eth-contract": "1.2.4", + "web3-eth-ens": "1.2.4", + "web3-eth-iban": "1.2.4", + "web3-eth-personal": "1.2.4", + "web3-net": "1.2.4", + "web3-utils": "1.2.4" } }, "web3-eth-abi": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.3.tgz", - "integrity": "sha512-43xj554x8F4HOXxPh9XYXlm3KalbqHVjs5wxlVtlsRqi0R60sweWCY9fBOgZHeiW89rBbPkaGxJ09bd4OVw96A==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.4.tgz", + "integrity": "sha512-8eLIY4xZKoU3DSVu1pORluAw9Ru0/v4CGdw5so31nn+7fR8zgHMgwbFe0aOqWQ5VU42PzMMXeIJwt4AEi2buFg==", "requires": { "ethers": "4.0.0-beta.3", "underscore": "1.9.1", - "web3-utils": "1.2.3" + "web3-utils": "1.2.4" } }, "web3-eth-accounts": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.3.tgz", - "integrity": "sha512-jdH6MbyinMPjBXbQKg79csoP1zjAVG1CXpvpZ2IZNqABZNdd0cGISAMbW8qduT3KD7mpyZGUKqeXXp66Hp9U3g==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.4.tgz", + "integrity": "sha512-04LzT/UtWmRFmi4hHRewP5Zz43fWhuHiK5XimP86sUQodk/ByOkXQ3RoXyGXFMNoRxdcAeRNxSfA2DpIBc9xUw==", "requires": { "@web3-js/scrypt-shim": "^0.1.0", "any-promise": "1.3.0", @@ -13974,10 +13974,10 @@ "ethereumjs-tx": "^2.1.1", "underscore": "1.9.1", "uuid": "3.3.2", - "web3-core": "1.2.3", - "web3-core-helpers": "1.2.3", - "web3-core-method": "1.2.3", - "web3-utils": "1.2.3" + "web3-core": "1.2.4", + "web3-core-helpers": "1.2.4", + "web3-core-method": "1.2.4", + "web3-utils": "1.2.4" }, "dependencies": { "eth-lib": { @@ -13998,66 +13998,66 @@ } }, "web3-eth-contract": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.3.tgz", - "integrity": "sha512-phbnPQNTX27n/eG0yzGwkAt4sEWYWBnIMbb+h2F1FvfT4gOp1+bllZy7kK5lVnBs+oJtPaSRlalxDkt9qw+0og==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.4.tgz", + "integrity": "sha512-b/9zC0qjVetEYnzRA1oZ8gF1OSSUkwSYi5LGr4GeckLkzXP7osEnp9lkO/AQcE4GpG+l+STnKPnASXJGZPgBRQ==", "requires": { "@types/bn.js": "^4.11.4", "underscore": "1.9.1", - "web3-core": "1.2.3", - "web3-core-helpers": "1.2.3", - "web3-core-method": "1.2.3", - "web3-core-promievent": "1.2.3", - "web3-core-subscriptions": "1.2.3", - "web3-eth-abi": "1.2.3", - "web3-utils": "1.2.3" + "web3-core": "1.2.4", + "web3-core-helpers": "1.2.4", + "web3-core-method": "1.2.4", + "web3-core-promievent": "1.2.4", + "web3-core-subscriptions": "1.2.4", + "web3-eth-abi": "1.2.4", + "web3-utils": "1.2.4" } }, "web3-eth-ens": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.3.tgz", - "integrity": "sha512-jTlm9BGS3zVZBUHxHyCpe5yiyVhqkDTaZa4fQW1jQcTN2RFQNEb0nKQECO2O6+DLAitkwCTZx72F8PIp4uKjAg==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.4.tgz", + "integrity": "sha512-g8+JxnZlhdsCzCS38Zm6R/ngXhXzvc3h7bXlxgKU4coTzLLoMpgOAEz71GxyIJinWTFbLXk/WjNY0dazi9NwVw==", "requires": { "eth-ens-namehash": "2.0.8", "underscore": "1.9.1", - "web3-core": "1.2.3", - "web3-core-helpers": "1.2.3", - "web3-core-promievent": "1.2.3", - "web3-eth-abi": "1.2.3", - "web3-eth-contract": "1.2.3", - "web3-utils": "1.2.3" + "web3-core": "1.2.4", + "web3-core-helpers": "1.2.4", + "web3-core-promievent": "1.2.4", + "web3-eth-abi": "1.2.4", + "web3-eth-contract": "1.2.4", + "web3-utils": "1.2.4" } }, "web3-eth-iban": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.3.tgz", - "integrity": "sha512-2AUlDwkafWdQTQ/sesfQiMyY8xUOYjplDBTZWhN8smwLTeYGiJsYfQ6ghtGgIzWGIAAi21AtwwARkxZyqIEHDg==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.4.tgz", + "integrity": "sha512-D9HIyctru/FLRpXakRwmwdjb5bWU2O6UE/3AXvRm6DCOf2e+7Ve11qQrPtaubHfpdW3KWjDKvlxV9iaFv/oTMQ==", "requires": { "bn.js": "4.11.8", - "web3-utils": "1.2.3" + "web3-utils": "1.2.4" } }, "web3-eth-personal": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.3.tgz", - "integrity": "sha512-UufRCHOF4SXnxQ3HecAzcwp3fonJS+125dOAYSoCJsqsmt+lx32SxaTa6N4KGntFPjlmC8rK9l1qXnpdQtGgqA==", + "version": "1.2.4", + "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.3", - "web3-core-helpers": "1.2.3", - "web3-core-method": "1.2.3", - "web3-net": "1.2.3", - "web3-utils": "1.2.3" + "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" } }, "web3-net": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.3.tgz", - "integrity": "sha512-Uz9e35PaQnuSJ9rIq+ky5sUiA77H+oDelFhXku2GpC2mhZjnJBCh2wzk4avt0PrUybOXdHaYLQTXeF8pr+9zuA==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.4.tgz", + "integrity": "sha512-wKOsqhyXWPSYTGbp7ofVvni17yfRptpqoUdp3SC8RAhDmGkX6irsiT9pON79m6b3HUHfLoBilFQyt/fTUZOf7A==", "requires": { - "web3-core": "1.2.3", - "web3-core-method": "1.2.3", - "web3-utils": "1.2.3" + "web3-core": "1.2.4", + "web3-core-method": "1.2.4", + "web3-utils": "1.2.4" } }, "web3-provider-engine": { @@ -14142,49 +14142,49 @@ } }, "web3-providers-http": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.3.tgz", - "integrity": "sha512-+hyNHYmXLp18AQ++uqomgYBtQC6OLiWPjEiKYVAGT64ABfeKf+VjELc1p5PU7apVHbkU51U5srcB/A5QBFdZXQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.4.tgz", + "integrity": "sha512-dzVCkRrR/cqlIrcrWNiPt9gyt0AZTE0J+MfAu9rR6CyIgtnm1wFUVVGaxYRxuTGQRO4Dlo49gtoGwaGcyxqiTw==", "requires": { - "web3-core-helpers": "1.2.3", + "web3-core-helpers": "1.2.4", "xhr2-cookies": "1.1.0" } }, "web3-providers-ipc": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.3.tgz", - "integrity": "sha512-x12wlL32X+LYS0N59d5yXxfZOmD94G9e9jloAjSNr5Lfe40BGGdvNSSZ4MJj1vnkVQ2ArYvoJWkhIu+d9IADUg==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.4.tgz", + "integrity": "sha512-8J3Dguffin51gckTaNrO3oMBo7g+j0UNk6hXmdmQMMNEtrYqw4ctT6t06YOf9GgtOMjSAc1YEh3LPrvgIsR7og==", "requires": { "oboe": "2.1.4", "underscore": "1.9.1", - "web3-core-helpers": "1.2.3" + "web3-core-helpers": "1.2.4" } }, "web3-providers-ws": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.3.tgz", - "integrity": "sha512-3q1A+EFrpEKy/aSB8DnAJRm5PEeM4TvOolKwPq6bxMnr1VG2LKxbryD07yKnpmPgxFuPYVHmVsHL5veAkAPPYg==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.4.tgz", + "integrity": "sha512-F/vQpDzeK+++oeeNROl1IVTufFCwCR2hpWe5yRXN0ApLwHqXrMI7UwQNdJ9iyibcWjJf/ECbauEEQ8CHgE+MYQ==", "requires": { "@web3-js/websocket": "^1.0.29", "underscore": "1.9.1", - "web3-core-helpers": "1.2.3" + "web3-core-helpers": "1.2.4" } }, "web3-shh": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.3.tgz", - "integrity": "sha512-6ajA6hzjEjm4TmQSuprkEqpNg0Npt97XmCA2MUzC3EoJ7XMGcHZ6XieL6aMcb2VqoZ6+IWcrxcBgZJTV5KEs0w==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.4.tgz", + "integrity": "sha512-z+9SCw0dE+69Z/Hv8809XDbLj7lTfEv9Sgu8eKEIdGntZf4v7ewj5rzN5bZZSz8aCvfK7Y6ovz1PBAu4QzS4IQ==", "requires": { - "web3-core": "1.2.3", - "web3-core-method": "1.2.3", - "web3-core-subscriptions": "1.2.3", - "web3-net": "1.2.3" + "web3-core": "1.2.4", + "web3-core-method": "1.2.4", + "web3-core-subscriptions": "1.2.4", + "web3-net": "1.2.4" } }, "web3-utils": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.3.tgz", - "integrity": "sha512-9fmtlXuBuVNUyguUX9dHAXL3fGkvR3jySVVTN3qDudO4DTpmQRZCtJdDzVtYK5KDyQJg1j9GaaJ0zASjXixLSg==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.4.tgz", + "integrity": "sha512-+S86Ip+jqfIPQWvw2N/xBQq5JNqCO0dyvukGdJm8fEWHZbckT4WxSpHbx+9KLEWY4H4x9pUwnoRkK87pYyHfgQ==", "requires": { "bn.js": "4.11.8", "eth-lib": "0.2.7", diff --git a/package.json b/package.json index 0e1dc7b..ceb929f 100644 --- a/package.json +++ b/package.json @@ -59,19 +59,19 @@ "node-fetch": "^2.6.0", "save-file": "^2.3.1", "uuid": "^3.3.3", - "web3": "^1.2.3", + "web3": "^1.2.4", "whatwg-url": "^7.1.0" }, "devDependencies": { "@release-it/bumper": "^1.0.5", - "@truffle/hdwallet-provider": "^1.0.23", - "@types/chai": "^4.2.4", + "@truffle/hdwallet-provider": "^1.0.25", + "@types/chai": "^4.2.5", "@types/chai-spies": "^1.0.1", "@types/mocha": "^5.2.7", - "@types/node": "^12.12.6", + "@types/node": "^12.12.7", "@types/node-fetch": "^2.5.3", - "@typescript-eslint/eslint-plugin": "^2.6.1", - "@typescript-eslint/parser": "^2.6.1", + "@typescript-eslint/eslint-plugin": "^2.7.0", + "@typescript-eslint/parser": "^2.7.0", "auto-changelog": "^1.16.2", "chai": "^4.2.0", "chai-spies": "^1.0.0", @@ -85,10 +85,10 @@ "mock-local-storage": "^1.1.10", "nyc": "^14.1.1", "ora": "^4.0.2", - "prettier": "^1.18.2", + "prettier": "^1.19.1", "source-map-support": "^0.5.16", - "ts-node": "^8.4.1", - "typedoc": "^0.15.0", + "ts-node": "^8.5.2", + "typedoc": "^0.15.2", "typescript": "^3.7.2", "uglifyjs-webpack-plugin": "^2.2.0", "webpack": "^4.41.2", From 40c537f0afab6a365d28129b2174c1f79946e311 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 15 Nov 2019 12:07:40 +0100 Subject: [PATCH 48/56] test against Brizo v0.7.0 --- .travis.yml | 2 +- library.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a5d34b6..f2866f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ before_script: - git clone https://github.com/oceanprotocol/barge - cd barge - export AQUARIUS_VERSION=v1.0.2 - - export BRIZO_VERSION=v0.6.0 + - export BRIZO_VERSION=v0.7.0 - export KEEPER_VERSION=v0.12.7 - export EVENTS_HANDLER_VERSION=v0.3.0 - export KEEPER_OWNER_ROLE_ADDRESS="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260" diff --git a/library.json b/library.json index 8bd5808..d0d1524 100644 --- a/library.json +++ b/library.json @@ -11,7 +11,7 @@ }, { "name": "brizo", - "version": "~0.6.0" + "version": "~0.7.0" }, { "name": "aquarius", From 68d7eccb0cc55c80a16e156208594785571f3f1c Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 15 Nov 2019 12:44:36 +0100 Subject: [PATCH 49/56] Release 1.0.0-beta.6 --- CHANGELOG.md | 8 ++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d136ee7..6d258a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,14 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - added xDai [`#336`](https://github.com/oceanprotocol/squid-js/pull/336) +#### [v1.0.0-beta.6](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.5...v1.0.0-beta.6) + +> 15 November 2019 + +- bump packages [`42d6c45`](https://github.com/oceanprotocol/squid-js/commit/42d6c450981a3a01ccde81e17a56b25e95ed474b) +- add migration guide [`eede978`](https://github.com/oceanprotocol/squid-js/commit/eede97837a267478021c7616d84a80773e52c9b4) +- add required component versions to migration guide [`b5f2d07`](https://github.com/oceanprotocol/squid-js/commit/b5f2d078b925e969faba2105cebfd408bfadaaae) + #### [v1.0.0-beta.5](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.4...v1.0.0-beta.5) > 14 November 2019 diff --git a/package-lock.json b/package-lock.json index 1606680..f6d76b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0-beta.5", + "version": "1.0.0-beta.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ceb929f..0d66516 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0-beta.5", + "version": "1.0.0-beta.6", "description": "JavaScript client library for Ocean Protocol", "main": "./dist/node/squid.js", "typings": "./dist/node/squid.d.ts", From 39265cb558fa16658492f8bfd243068f15336d03 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 20 Nov 2019 15:34:14 +0100 Subject: [PATCH 50/56] mention existing assets migration --- MIGRATION.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MIGRATION.md b/MIGRATION.md index 461fdfe..3201302 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -17,7 +17,7 @@ squid-js v1.0.0 only works against: The whole structure of the DDO has been changed based on [OEP-12](https://github.com/oceanprotocol/OEPs/tree/master/12) and [OEP-8 v0.4](https://github.com/oceanprotocol/OEPs/tree/master/8/v0.4) to better accomodate the DDOs to hold additional services, like execution of workflows and algorithms. -For migrating we only have to deal with the `metadata` service holding the asset metadata, which was restructured too: +For migrating, you only have to deal with the `metadata` service holding the asset metadata, which was restructured too: old: @@ -105,6 +105,10 @@ NEW. Where `main` now holds the non-changable attributes only, everything else h Those changes require updates to your code whenever you fetch or create a new DDO as outlined below. +Likewise, you have to migrate the DDOs of existing registered assets to the new structure. For this you can run our migration script on your respective Aquarius instance. + +- [script: CHANGEME](https://github.com/oceanprotocol/CHANGEME) + ### Lowercase Service Names All the service names are now in lowercase: @@ -157,6 +161,8 @@ NEW: await ocean.assets.order(ddo.id, service.index, accounts[0]) ``` +The value of of `service.index` is now also a number, and not a string. + ### File Attribute Changes In the file attributes, the `contentLength` is now a string. From fc628957d2e90a383c4ca05b68c45dde5657f6e5 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 22 Nov 2019 12:16:39 +0100 Subject: [PATCH 51/56] bump Aquarius & Brizo --- .travis.yml | 4 ++-- library.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index f2866f4..4bfca21 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,8 +21,8 @@ before_script: - ganache-cli --port 18545 > ganache-cli.log & - git clone https://github.com/oceanprotocol/barge - cd barge - - export AQUARIUS_VERSION=v1.0.2 - - export BRIZO_VERSION=v0.7.0 + - export AQUARIUS_VERSION=v1.0.3 + - export BRIZO_VERSION=v0.7.2 - export KEEPER_VERSION=v0.12.7 - export EVENTS_HANDLER_VERSION=v0.3.0 - export KEEPER_OWNER_ROLE_ADDRESS="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260" diff --git a/library.json b/library.json index d0d1524..49b17d4 100644 --- a/library.json +++ b/library.json @@ -11,11 +11,11 @@ }, { "name": "brizo", - "version": "~0.7.0" + "version": "~0.7.2" }, { "name": "aquarius", - "version": "~1.0.2" + "version": "~1.0.3" }, { "name": "events-handler", From 0481177f72acf24351f4dea45f5546bed1182583 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 22 Nov 2019 12:26:40 +0100 Subject: [PATCH 52/56] bump packages --- package-lock.json | 71 ++++++++++++++++++++++++++--------------------- package.json | 10 +++---- 2 files changed, 45 insertions(+), 36 deletions(-) diff --git a/package-lock.json b/package-lock.json index f6d76b4..e867f20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1525,9 +1525,9 @@ "dev": true }, "@types/node": { - "version": "12.12.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.7.tgz", - "integrity": "sha512-E6Zn0rffhgd130zbCbAr/JdXfXkoOUFAKNs/rF8qnafSJ8KYaA/j3oz7dcwal+lYjLA7xvdd5J4wdYpCTlP8+w==" + "version": "12.12.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.11.tgz", + "integrity": "sha512-O+x6uIpa6oMNTkPuHDa9MhMMehlxLAd5QcOvKRjAFsBVpeFWTOPnXbDvILvFgFFZfQ1xh1EZi1FbXxUix+zpsQ==" }, "@types/node-fetch": { "version": "2.5.3", @@ -1539,49 +1539,58 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.7.0.tgz", - "integrity": "sha512-H5G7yi0b0FgmqaEUpzyBlVh0d9lq4cWG2ap0RKa6BkF3rpBb6IrAoubt1NWh9R2kRs/f0k6XwRDiDz3X/FqXhQ==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.8.0.tgz", + "integrity": "sha512-ohqul5s6XEB0AzPWZCuJF5Fd6qC0b4+l5BGEnrlpmvXxvyymb8yw8Bs4YMF8usNAeuCJK87eFIHy8g8GFvOtGA==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "2.7.0", - "eslint-utils": "^1.4.2", + "@typescript-eslint/experimental-utils": "2.8.0", + "eslint-utils": "^1.4.3", "functional-red-black-tree": "^1.0.1", - "regexpp": "^2.0.1", + "regexpp": "^3.0.0", "tsutils": "^3.17.1" + }, + "dependencies": { + "regexpp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.0.0.tgz", + "integrity": "sha512-Z+hNr7RAVWxznLPuA7DIh8UNX1j9CDrUQxskw9IrBE1Dxue2lyXT+shqEIeLUjrokxIP8CMy1WkjgG3rTsd5/g==", + "dev": true + } } }, "@typescript-eslint/experimental-utils": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.7.0.tgz", - "integrity": "sha512-9/L/OJh2a5G2ltgBWJpHRfGnt61AgDeH6rsdg59BH0naQseSwR7abwHq3D5/op0KYD/zFT4LS5gGvWcMmegTEg==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.8.0.tgz", + "integrity": "sha512-jZ05E4SxCbbXseQGXOKf3ESKcsGxT8Ucpkp1jiVp55MGhOvZB2twmWKf894PAuVQTCgbPbJz9ZbRDqtUWzP8xA==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.7.0", + "@typescript-eslint/typescript-estree": "2.8.0", "eslint-scope": "^5.0.0" } }, "@typescript-eslint/parser": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.7.0.tgz", - "integrity": "sha512-ctC0g0ZvYclxMh/xI+tyqP0EC2fAo6KicN9Wm2EIao+8OppLfxji7KAGJosQHSGBj3TcqUrA96AjgXuKa5ob2g==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.8.0.tgz", + "integrity": "sha512-NseXWzhkucq+JM2HgqAAoKEzGQMb5LuTRjFPLQzGIdLthXMNUfuiskbl7QSykvWW6mvzCtYbw1fYWGa2EIaekw==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.7.0", - "@typescript-eslint/typescript-estree": "2.7.0", + "@typescript-eslint/experimental-utils": "2.8.0", + "@typescript-eslint/typescript-estree": "2.8.0", "eslint-visitor-keys": "^1.1.0" } }, "@typescript-eslint/typescript-estree": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.7.0.tgz", - "integrity": "sha512-vVCE/DY72N4RiJ/2f10PTyYekX2OLaltuSIBqeHYI44GQ940VCYioInIb8jKMrK9u855OEJdFC+HmWAZTnC+Ag==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.8.0.tgz", + "integrity": "sha512-ksvjBDTdbAQ04cR5JyFSDX113k66FxH1tAXmi+dj6hufsl/G0eMc/f1GgLjEVPkYClDbRKv+rnBFuE5EusomUw==", "dev": true, "requires": { "debug": "^4.1.1", - "glob": "^7.1.4", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", "is-glob": "^4.0.1", "lodash.unescape": "4.0.1", "semver": "^6.3.0", @@ -5124,9 +5133,9 @@ } }, "eslint-config-prettier": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.5.0.tgz", - "integrity": "sha512-cjXp8SbO9VFGW/Z7mbTydqS9to8Z58E5aYhj3e1+Hx7lS9s6gL5ILKNpCqZAFOVYRcSkWPFYljHrEh8QFEK5EQ==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.7.0.tgz", + "integrity": "sha512-FamQVKM3jjUVwhG4hEMnbtsq7xOIDm+SY5iBPfR8gKsJoAB2IQnNF+bk1+8Fy44Nq7PPJaLvkRxILYdJWoguKQ==", "dev": true, "requires": { "get-stdin": "^6.0.0" @@ -7596,9 +7605,9 @@ "dev": true }, "handlebars": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.2.tgz", - "integrity": "sha512-29Zxv/cynYB7mkT1rVWQnV7mGX6v7H/miQ6dbEpYTKq5eJBN7PsRB+ViYJlcT6JINTSu4dVB9kOqEun78h6Exg==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", + "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", "dev": true, "requires": { "neo-async": "^2.6.0", @@ -9656,9 +9665,9 @@ "integrity": "sha512-bcukePBvuA3qovmq0Qtqu9+1APCIGkFHnsozrPIVromt5XFGGgkQSfaN0H6RI8gStHkO/hRgimvS3tooNes4pQ==" }, "mock-local-storage": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/mock-local-storage/-/mock-local-storage-1.1.10.tgz", - "integrity": "sha512-k/eauqgWiUeVOE80uioaTJmF2O41EYxZcac2OYbEvz1q1smCykYitKr0cqFbJmtIUSxGhh38cHjKtNCvpsR7Sw==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/mock-local-storage/-/mock-local-storage-1.1.11.tgz", + "integrity": "sha512-71sytP93tB0CkPbacafcP1iTVj9ssXU+ztRmx1MrS488JpO0az5d2sx+SNuvhGVSW56XO5M0f82uFhxteZEp9w==", "dev": true, "requires": { "core-js": "^0.8.3", diff --git a/package.json b/package.json index 0d66516..d4ae239 100644 --- a/package.json +++ b/package.json @@ -68,21 +68,21 @@ "@types/chai": "^4.2.5", "@types/chai-spies": "^1.0.1", "@types/mocha": "^5.2.7", - "@types/node": "^12.12.7", + "@types/node": "^12.12.11", "@types/node-fetch": "^2.5.3", - "@typescript-eslint/eslint-plugin": "^2.7.0", - "@typescript-eslint/parser": "^2.7.0", + "@typescript-eslint/eslint-plugin": "^2.8.0", + "@typescript-eslint/parser": "^2.8.0", "auto-changelog": "^1.16.2", "chai": "^4.2.0", "chai-spies": "^1.0.0", "cross-env": "^6.0.3", "eslint": "^6.6.0", "eslint-config-oceanprotocol": "^1.5.0", - "eslint-config-prettier": "^6.5.0", + "eslint-config-prettier": "^6.7.0", "eslint-plugin-prettier": "^3.1.1", "lcov-result-merger": "^3.1.0", "mocha": "^6.2.2", - "mock-local-storage": "^1.1.10", + "mock-local-storage": "^1.1.11", "nyc": "^14.1.1", "ora": "^4.0.2", "prettier": "^1.19.1", From c14ab17b2a1a30b504adc27a3952b34456efd68c Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 22 Nov 2019 12:31:07 +0100 Subject: [PATCH 53/56] Release 1.0.0-beta.7 --- CHANGELOG.md | 58 ++++++++--------------------------------------- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 11 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d258a4..dcf5490 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,60 +4,20 @@ 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.0.0-beta.7](https://github.com/oceanprotocol/squid-js/compare/v0.8.3...v1.0.0-beta.7) + +> 22 November 2019 + +- fresh package-lock [`0552bcc`](https://github.com/oceanprotocol/squid-js/commit/0552bcc577fb83a5e9d683cb23dcbdfd23f0fa1c) +- Change linter config. [`3d7d1f3`](https://github.com/oceanprotocol/squid-js/commit/3d7d1f3972a665ccce4a1d712077435c1cd87459) +- tweak printWidth [`143fcbe`](https://github.com/oceanprotocol/squid-js/commit/143fcbecf3661d6a0da7f7d44f74d82caca41ad1) + #### [v0.8.3](https://github.com/oceanprotocol/squid-js/compare/v0.8.2...v0.8.3) > 22 November 2019 - added xDai [`#336`](https://github.com/oceanprotocol/squid-js/pull/336) - -#### [v1.0.0-beta.6](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.5...v1.0.0-beta.6) - -> 15 November 2019 - -- bump packages [`42d6c45`](https://github.com/oceanprotocol/squid-js/commit/42d6c450981a3a01ccde81e17a56b25e95ed474b) -- add migration guide [`eede978`](https://github.com/oceanprotocol/squid-js/commit/eede97837a267478021c7616d84a80773e52c9b4) -- add required component versions to migration guide [`b5f2d07`](https://github.com/oceanprotocol/squid-js/commit/b5f2d078b925e969faba2105cebfd408bfadaaae) - -#### [v1.0.0-beta.5](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.4...v1.0.0-beta.5) - -> 14 November 2019 - -- v2: Web3.js 1.2.3 [`#331`](https://github.com/oceanprotocol/squid-js/pull/331) -- fresh package-lock [`350f831`](https://github.com/oceanprotocol/squid-js/commit/350f8317ce51ec77121a47e5b36d5febe6daf0e5) -- tweak printWidth [`e1c934f`](https://github.com/oceanprotocol/squid-js/commit/e1c934f5783c3517165af0b51aa957bd4a3853e1) -- web3.js v1.2.3 [`b50cede`](https://github.com/oceanprotocol/squid-js/commit/b50cede2309104066c1683027916aa85b1a96e04) - -#### [v1.0.0-beta.4](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.3...v1.0.0-beta.4) - -> 14 November 2019 - -- v2: add transferOwnership method [`#332`](https://github.com/oceanprotocol/squid-js/pull/332) -- refactoring for web3.js 1.2.2 [`cc54ccb`](https://github.com/oceanprotocol/squid-js/commit/cc54ccb172e0ccd0b9aee7ceb1244d8d135a8c10) -- search test tweaks [`3920d62`](https://github.com/oceanprotocol/squid-js/commit/3920d62ef9dd7f608b235982e34fb7a0c95c12d7) -- add ocean.assets.transferOwnership() [`e1ef7b0`](https://github.com/oceanprotocol/squid-js/commit/e1ef7b0f17c2f7d7bcc642b4fc1719acd0652a66) - -#### [v1.0.0-beta.3](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.2...v1.0.0-beta.3) - -> 12 November 2019 - -- Release 1.0.0-beta.3 [`e2151ec`](https://github.com/oceanprotocol/squid-js/commit/e2151ec72f54d8b83b7345b042199c44210c9e88) -- file.index typing fix [`22b0ecb`](https://github.com/oceanprotocol/squid-js/commit/22b0ecb33c580b2b00a08b212cc1fac46c1e39ad) - -#### [v1.0.0-beta.2](https://github.com/oceanprotocol/squid-js/compare/v1.0.0-beta.1...v1.0.0-beta.2) - -> 12 November 2019 - -- DDO updates, contentLength as string [`ae62a49`](https://github.com/oceanprotocol/squid-js/commit/ae62a49902aa71fbfdfb69180ee4467fab68930a) -- remove ddo.addChecksum [`e2e95c4`](https://github.com/oceanprotocol/squid-js/commit/e2e95c469c1c0738fee01722ce8967c08aacde82) -- Release 1.0.0-beta.2 [`dafb5c4`](https://github.com/oceanprotocol/squid-js/commit/dafb5c491ab61a06760e46504bc26cd7b49e0ad2) - -#### [v1.0.0-beta.1](https://github.com/oceanprotocol/squid-js/compare/v0.8.2...v1.0.0-beta.1) - -> 7 November 2019 - -- Change linter config. [`1a2b5cf`](https://github.com/oceanprotocol/squid-js/commit/1a2b5cfa1661978ae2b36e73e2a9ab9dcefc8a94) -- update metadata to OEP-8 v0.4 [`b1adbf0`](https://github.com/oceanprotocol/squid-js/commit/b1adbf0c8a358718269e5c08defb7db8c0d63484) -- Add EscrowComputeExecutionTemplate. [`7d90b75`](https://github.com/oceanprotocol/squid-js/commit/7d90b75408b679dcffa5d089c243e2963ccb2bd1) +- Release 0.8.3 [`c8e9bd2`](https://github.com/oceanprotocol/squid-js/commit/c8e9bd24c3850c250df02197582e430dee97152b) #### [v0.8.2](https://github.com/oceanprotocol/squid-js/compare/v0.8.1...v0.8.2) diff --git a/package-lock.json b/package-lock.json index e867f20..8c2c68b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0-beta.6", + "version": "1.0.0-beta.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d4ae239..6ea02ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/squid", - "version": "1.0.0-beta.6", + "version": "1.0.0-beta.7", "description": "JavaScript client library for Ocean Protocol", "main": "./dist/node/squid.js", "typings": "./dist/node/squid.d.ts", From d6a233e590631087ba1302ac44f1e597b512c34e Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 6 Dec 2019 09:57:26 +0100 Subject: [PATCH 54/56] typos --- src/ocean/OceanAccounts.ts | 2 +- src/ocean/OceanTokens.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ocean/OceanAccounts.ts b/src/ocean/OceanAccounts.ts index ba9ba54..e346551 100644 --- a/src/ocean/OceanAccounts.ts +++ b/src/ocean/OceanAccounts.ts @@ -41,7 +41,7 @@ export class OceanAccounts extends Instantiable { } /** - * Request tokens for a account. + * Request tokens for an account. * @param {Account} account Account instance. * @param {number} amount Token amount. * @return {Promise} Success. diff --git a/src/ocean/OceanTokens.ts b/src/ocean/OceanTokens.ts index 38a16f5..b5bb432 100644 --- a/src/ocean/OceanTokens.ts +++ b/src/ocean/OceanTokens.ts @@ -18,7 +18,7 @@ export class OceanTokens extends Instantiable { /** * Transfer a number of tokens to the mentioned account. - * @param {string} to Address that receives the account. + * @param {string} to Address that receives the tokens. * @param {number} amount Tokens to transfer. * @param {Account} from Sender account address. * @return {Promise} Success, @@ -29,7 +29,7 @@ export class OceanTokens extends Instantiable { } /** - * Request tokens for a account. + * Request tokens for an account. * @param {Account} account Account instance. * @param {number} amount Token amount. * @return {Promise} Success. From ccf7250af87abf986d94c5023ac960fd155d0789 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 6 Dec 2019 09:57:35 +0100 Subject: [PATCH 55/56] package updates --- package-lock.json | 242 ++++++++++++++++++++++------------------------ package.json | 20 ++-- 2 files changed, 126 insertions(+), 136 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8c2c68b..f401891 100644 --- a/package-lock.json +++ b/package-lock.json @@ -303,12 +303,12 @@ "dev": true }, "@truffle/hdwallet-provider": { - "version": "1.0.25", - "resolved": "https://registry.npmjs.org/@truffle/hdwallet-provider/-/hdwallet-provider-1.0.25.tgz", - "integrity": "sha512-0HNVe7m1koA4e4wgHp+tHKzbZtUmY7LMP8AGj9PN6I9/EU5zeHmAcZSStzwWAFywOp6ZQ3g8NNeqThraryqdaA==", + "version": "1.0.26", + "resolved": "https://registry.npmjs.org/@truffle/hdwallet-provider/-/hdwallet-provider-1.0.26.tgz", + "integrity": "sha512-ITEUOwT8o8FZmnAiZtFLHhTLFOlT5q/DIh9QzV+gG0GocqIY6D2CSLkhaqTn89xCGVftQfyQAFBqXfGRblNQKw==", "dev": true, "requires": { - "@truffle/provider": "^0.2.2", + "@truffle/provider": "^0.2.3", "any-promise": "^1.3.0", "bindings": "^1.5.0", "bip39": "^2.4.2", @@ -405,9 +405,9 @@ }, "dependencies": { "@types/node": { - "version": "10.17.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.5.tgz", - "integrity": "sha512-RElZIr/7JreF1eY6oD5RF3kpmdcreuQPjg5ri4oQ5g9sq7YWU8HkfB3eH8GwAwxf5OaCh0VPi7r4N/yoTGelrA==", + "version": "10.17.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.6.tgz", + "integrity": "sha512-0a2X6cgN3RdPBL2MIlR6Lt0KlM7fOFsutuXcdglcOq6WvLnYXgPQSh0Mx6tO1KCAE8MxbHSOSTWDoUxRq+l3DA==", "dev": true } } @@ -679,9 +679,9 @@ } }, "@truffle/interface-adapter": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.3.3.tgz", - "integrity": "sha512-l3I4WFTfnBSIfG96IOBRtAIE6AHDAxcOUJE7W5zh9hocQwzQlGWc2yEyyTcLa0656TTM8RxaZZ2S/KdHHMvCaw==", + "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", @@ -690,22 +690,19 @@ "web3": "1.2.2" }, "dependencies": { - "@types/node": { - "version": "10.17.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.5.tgz", - "integrity": "sha512-RElZIr/7JreF1eY6oD5RF3kpmdcreuQPjg5ri4oQ5g9sq7YWU8HkfB3eH8GwAwxf5OaCh0VPi7r4N/yoTGelrA==", - "dev": true - }, "elliptic": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", - "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", + "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", - "inherits": "^2.0.1" + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" } }, "eth-lib": { @@ -717,35 +714,17 @@ "bn.js": "^4.11.6", "elliptic": "^6.4.0", "xhr-request-promise": "^0.1.2" - }, - "dependencies": { - "elliptic": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.1.tgz", - "integrity": "sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==", - "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" - } - } } }, "ethers": { - "version": "4.0.39", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.39.tgz", - "integrity": "sha512-QVtC8TTUgTrnlQjQvdFJ7fkSWKwp8HVTbKRmrdbVryrPzJHMTf3WSeRNvLF2enGyAFtyHJyFNnjN0fSshcEr9w==", + "version": "4.0.40", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.40.tgz", + "integrity": "sha512-MC9BtV7Hpq4dgFONEfanx9aU9GhhoWU270F+/wegHZXA7FR+2KXFdt36YIQYLmVY5ykUWswDxd+f9EVkIa7JOA==", "dev": true, "requires": { - "@types/node": "^10.3.2", "aes-js": "3.0.0", "bn.js": "^4.4.0", - "elliptic": "6.3.3", + "elliptic": "6.5.2", "hash.js": "1.1.3", "js-sha3": "0.5.7", "scrypt-js": "2.0.4", @@ -802,14 +781,6 @@ "web3-net": "1.2.2", "web3-shh": "1.2.2", "web3-utils": "1.2.2" - }, - "dependencies": { - "@types/node": { - "version": "12.12.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.7.tgz", - "integrity": "sha512-E6Zn0rffhgd130zbCbAr/JdXfXkoOUFAKNs/rF8qnafSJ8KYaA/j3oz7dcwal+lYjLA7xvdd5J4wdYpCTlP8+w==", - "dev": true - } } }, "web3-bzz": { @@ -822,6 +793,14 @@ "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": { @@ -836,14 +815,6 @@ "web3-core-method": "1.2.2", "web3-core-requestmanager": "1.2.2", "web3-utils": "1.2.2" - }, - "dependencies": { - "@types/node": { - "version": "12.12.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.7.tgz", - "integrity": "sha512-E6Zn0rffhgd130zbCbAr/JdXfXkoOUFAKNs/rF8qnafSJ8KYaA/j3oz7dcwal+lYjLA7xvdd5J4wdYpCTlP8+w==", - "dev": true - } } }, "web3-core-helpers": { @@ -936,6 +907,24 @@ "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", @@ -1045,14 +1034,6 @@ "web3-core-method": "1.2.2", "web3-net": "1.2.2", "web3-utils": "1.2.2" - }, - "dependencies": { - "@types/node": { - "version": "12.12.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.7.tgz", - "integrity": "sha512-E6Zn0rffhgd130zbCbAr/JdXfXkoOUFAKNs/rF8qnafSJ8KYaA/j3oz7dcwal+lYjLA7xvdd5J4wdYpCTlP8+w==", - "dev": true - } } }, "web3-net": { @@ -1129,13 +1110,13 @@ } }, "@truffle/provider": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.2.tgz", - "integrity": "sha512-0lN23hJzM6cb1IK4ZjRPHDEdwtcpRwhsfBLLOAzlOFlnFvCHlQWnb7K71mCE9LXrKqjQRDF1vjUpeiKccwoN8Q==", + "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.3.3", + "@truffle/interface-adapter": "^0.4.0", "web3": "1.2.2" }, "dependencies": { @@ -1185,9 +1166,9 @@ }, "dependencies": { "@types/node": { - "version": "10.17.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.5.tgz", - "integrity": "sha512-RElZIr/7JreF1eY6oD5RF3kpmdcreuQPjg5ri4oQ5g9sq7YWU8HkfB3eH8GwAwxf5OaCh0VPi7r4N/yoTGelrA==", + "version": "10.17.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.6.tgz", + "integrity": "sha512-0a2X6cgN3RdPBL2MIlR6Lt0KlM7fOFsutuXcdglcOq6WvLnYXgPQSh0Mx6tO1KCAE8MxbHSOSTWDoUxRq+l3DA==", "dev": true } } @@ -1463,9 +1444,9 @@ } }, "@types/chai": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.5.tgz", - "integrity": "sha512-YvbLiIc0DbbhiANrfVObdkLEHJksQZVq0Uvfg550SRAKVYaEJy+V70j65BVe2WNp6E3HtKsUczeijHFCjba3og==", + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.6.tgz", + "integrity": "sha512-HF8faEUA4JurIm+68VaA2KedtZf5LYdXpQEAbIAN79DwWQbO82BNTksZgCH3UMqbZHXex9C6TrBfg7OUInRISQ==", "dev": true }, "@types/chai-spies": { @@ -1525,26 +1506,26 @@ "dev": true }, "@types/node": { - "version": "12.12.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.11.tgz", - "integrity": "sha512-O+x6uIpa6oMNTkPuHDa9MhMMehlxLAd5QcOvKRjAFsBVpeFWTOPnXbDvILvFgFFZfQ1xh1EZi1FbXxUix+zpsQ==" + "version": "12.12.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.14.tgz", + "integrity": "sha512-u/SJDyXwuihpwjXy7hOOghagLEV1KdAST6syfnOk6QZAMzZuWZqXy5aYYZbh8Jdpd4escVFP0MvftHNDb9pruA==" }, "@types/node-fetch": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.3.tgz", - "integrity": "sha512-X3TNlzZ7SuSwZsMkb5fV7GrPbVKvHc2iwHmslb8bIxRKWg2iqkfm3F/Wd79RhDpOXR7wCtKAwc5Y2JE6n/ibyw==", + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.4.tgz", + "integrity": "sha512-Oz6id++2qAOFuOlE1j0ouk1dzl3mmI1+qINPNBhi9nt/gVOz0G+13Ao6qjhdF0Ys+eOkhu6JnFmt38bR3H0POQ==", "dev": true, "requires": { "@types/node": "*" } }, "@typescript-eslint/eslint-plugin": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.8.0.tgz", - "integrity": "sha512-ohqul5s6XEB0AzPWZCuJF5Fd6qC0b4+l5BGEnrlpmvXxvyymb8yw8Bs4YMF8usNAeuCJK87eFIHy8g8GFvOtGA==", + "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==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "2.8.0", + "@typescript-eslint/experimental-utils": "2.10.0", "eslint-utils": "^1.4.3", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", @@ -1560,32 +1541,32 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.8.0.tgz", - "integrity": "sha512-jZ05E4SxCbbXseQGXOKf3ESKcsGxT8Ucpkp1jiVp55MGhOvZB2twmWKf894PAuVQTCgbPbJz9ZbRDqtUWzP8xA==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.10.0.tgz", + "integrity": "sha512-FZhWq6hWWZBP76aZ7bkrfzTMP31CCefVIImrwP3giPLcoXocmLTmr92NLZxuIcTL4GTEOE33jQMWy9PwelL+yQ==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.8.0", + "@typescript-eslint/typescript-estree": "2.10.0", "eslint-scope": "^5.0.0" } }, "@typescript-eslint/parser": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.8.0.tgz", - "integrity": "sha512-NseXWzhkucq+JM2HgqAAoKEzGQMb5LuTRjFPLQzGIdLthXMNUfuiskbl7QSykvWW6mvzCtYbw1fYWGa2EIaekw==", + "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==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.8.0", - "@typescript-eslint/typescript-estree": "2.8.0", + "@typescript-eslint/experimental-utils": "2.10.0", + "@typescript-eslint/typescript-estree": "2.10.0", "eslint-visitor-keys": "^1.1.0" } }, "@typescript-eslint/typescript-estree": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.8.0.tgz", - "integrity": "sha512-ksvjBDTdbAQ04cR5JyFSDX113k66FxH1tAXmi+dj6hufsl/G0eMc/f1GgLjEVPkYClDbRKv+rnBFuE5EusomUw==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.10.0.tgz", + "integrity": "sha512-oOYnplddQNm/LGVkqbkAwx4TIBuuZ36cAQq9v3nFIU9FmhemHuVzAesMSXNQDdAzCa5bFgCrfD3JWhYVKlRN2g==", "dev": true, "requires": { "debug": "^4.1.1", @@ -2125,9 +2106,9 @@ "dev": true }, "arg": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz", - "integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.2.tgz", + "integrity": "sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg==", "dev": true }, "argparse": { @@ -3627,9 +3608,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001010", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001010.tgz", - "integrity": "sha512-RA5GH9YjFNea4ZQszdWgh2SC+dpLiRAg4VDQS2b5JRI45OxmbGrYocYHTa9x0bKMQUE7uvHkNPNffUr+pCxSGw==", + "version": "1.0.30001015", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001015.tgz", + "integrity": "sha512-/xL2AbW/XWHNu1gnIrO8UitBGoFthcsDgU9VLK1/dpsoxbaD5LscHozKze05R6WLsBvLhqv78dAPozMFQBYLbQ==", "dev": true }, "caseless": { @@ -4850,9 +4831,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "electron-to-chromium": { - "version": "1.3.306", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.306.tgz", - "integrity": "sha512-frDqXvrIROoYvikSKTIKbHbzO6M3/qC6kCIt/1FOa9kALe++c4VAJnwjSFvf1tYLEUsP2n9XZ4XSCyqc3l7A/A==", + "version": "1.3.322", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.322.tgz", + "integrity": "sha512-Tc8JQEfGQ1MzfSzI/bTlSr7btJv/FFO7Yh6tanqVmIWOuNCu6/D1MilIEgLtmWqIrsv+o4IjpLAhgMBr/ncNAA==", "dev": true }, "elliptic": { @@ -5020,9 +5001,9 @@ "dev": true }, "eslint": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.6.0.tgz", - "integrity": "sha512-PpEBq7b6qY/qrOmpYQ/jTMDYfuQMELR4g4WI1M/NaSDDD/bdcMb+dj4Hgks7p41kW2caXsPsEZAEAyAgjVVC0g==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.7.2.tgz", + "integrity": "sha512-qMlSWJaCSxDFr8fBPvJM9kJwbazrhNcBU3+DszDW1OlEwKBBRWsJc7NJFelvwQpanHCR14cOLD41x8Eqvo3Nng==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -5040,7 +5021,7 @@ "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", "glob-parent": "^5.0.0", - "globals": "^11.7.0", + "globals": "^12.1.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -5053,7 +5034,7 @@ "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.2", + "optionator": "^0.8.3", "progress": "^2.0.0", "regexpp": "^2.0.1", "semver": "^6.1.2", @@ -5074,10 +5055,13 @@ } }, "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true + "version": "12.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.3.0.tgz", + "integrity": "sha512-wAfjdLgFsPZsklLJvOBUBmzYE8/CwhEqSBEMRXA3qxIiNtyqvjYurAtIfDh6chlEPUfmTY3MnZh5Hfh4q0UlIw==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } }, "ignore": { "version": "4.0.6", @@ -5112,6 +5096,12 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", "dev": true + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true } } }, @@ -13243,9 +13233,9 @@ "dev": true }, "ts-node": { - "version": "8.5.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.5.2.tgz", - "integrity": "sha512-W1DK/a6BGoV/D4x/SXXm6TSQx6q3blECUzd5TN+j56YEMX3yPVMpHsICLedUw3DvGF3aTQ8hfdR9AKMaHjIi+A==", + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.5.4.tgz", + "integrity": "sha512-izbVCRV68EasEPQ8MSIGBNK9dc/4sYJJKYA+IarMQct1RtEot6Xp0bXuClsbUSnKpg50ho+aOAx8en5c+y4OFw==", "dev": true, "requires": { "arg": "^4.1.0", @@ -13347,14 +13337,14 @@ } }, "typedoc": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.15.2.tgz", - "integrity": "sha512-K2nFEtyDQTVdXOzYtECw3TwuT3lM91Zc0dzGSLuor5R8qzZbwqBoCw7xYGVBow6+mEZAvKGznLFsl7FzG+wAgQ==", + "version": "0.15.3", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.15.3.tgz", + "integrity": "sha512-RGX+dgnm9fyg5KHj81/ZhMiee0FfvJnjBXedhedhMWlrtM4YRv3pn8sYCWRt5TMi1Jli3/JG224pbFo3/3uaGw==", "dev": true, "requires": { "@types/minimatch": "3.0.3", "fs-extra": "^8.1.0", - "handlebars": "^4.5.1", + "handlebars": "^4.5.3", "highlight.js": "^9.16.2", "lodash": "^4.17.15", "marked": "^0.7.0", @@ -13391,9 +13381,9 @@ } }, "typescript": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.2.tgz", - "integrity": "sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ==", + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.3.tgz", + "integrity": "sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index 6ea02ba..e9fc512 100644 --- a/package.json +++ b/package.json @@ -64,19 +64,19 @@ }, "devDependencies": { "@release-it/bumper": "^1.0.5", - "@truffle/hdwallet-provider": "^1.0.25", - "@types/chai": "^4.2.5", + "@truffle/hdwallet-provider": "^1.0.26", + "@types/chai": "^4.2.6", "@types/chai-spies": "^1.0.1", "@types/mocha": "^5.2.7", - "@types/node": "^12.12.11", - "@types/node-fetch": "^2.5.3", - "@typescript-eslint/eslint-plugin": "^2.8.0", - "@typescript-eslint/parser": "^2.8.0", + "@types/node": "^12.12.14", + "@types/node-fetch": "^2.5.4", + "@typescript-eslint/eslint-plugin": "^2.10.0", + "@typescript-eslint/parser": "^2.10.0", "auto-changelog": "^1.16.2", "chai": "^4.2.0", "chai-spies": "^1.0.0", "cross-env": "^6.0.3", - "eslint": "^6.6.0", + "eslint": "^6.7.2", "eslint-config-oceanprotocol": "^1.5.0", "eslint-config-prettier": "^6.7.0", "eslint-plugin-prettier": "^3.1.1", @@ -87,9 +87,9 @@ "ora": "^4.0.2", "prettier": "^1.19.1", "source-map-support": "^0.5.16", - "ts-node": "^8.5.2", - "typedoc": "^0.15.2", - "typescript": "^3.7.2", + "ts-node": "^8.5.4", + "typedoc": "^0.15.3", + "typescript": "^3.7.3", "uglifyjs-webpack-plugin": "^2.2.0", "webpack": "^4.41.2", "webpack-cli": "^3.3.10", From 414c885163325a69eb315b20f8fe3837bc557656 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 6 Dec 2019 10:20:55 +0100 Subject: [PATCH 56/56] lint fixes, bump Ocean components --- .nvmrc | 1 + .travis.yml | 4 ++-- library.json | 4 ++-- test/ocean/OceanAuth.test.ts | 2 +- test/utils/SubscribablePromise.test.ts | 28 +++++++++++++------------- 5 files changed, 20 insertions(+), 19 deletions(-) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..dae199a --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v12 diff --git a/.travis.yml b/.travis.yml index 4bfca21..b6551f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,10 +21,10 @@ before_script: - ganache-cli --port 18545 > ganache-cli.log & - git clone https://github.com/oceanprotocol/barge - cd barge - - export AQUARIUS_VERSION=v1.0.3 + - export AQUARIUS_VERSION=v1.0.5 - export BRIZO_VERSION=v0.7.2 - export KEEPER_VERSION=v0.12.7 - - export EVENTS_HANDLER_VERSION=v0.3.0 + - export EVENTS_HANDLER_VERSION=v0.3.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 & diff --git a/library.json b/library.json index 49b17d4..1c35b85 100644 --- a/library.json +++ b/library.json @@ -15,11 +15,11 @@ }, { "name": "aquarius", - "version": "~1.0.3" + "version": "~1.0.5" }, { "name": "events-handler", - "version": "~0.3.0" + "version": "~0.3.4" } ] } diff --git a/test/ocean/OceanAuth.test.ts b/test/ocean/OceanAuth.test.ts index 7c22ccc..1c43c4f 100644 --- a/test/ocean/OceanAuth.test.ts +++ b/test/ocean/OceanAuth.test.ts @@ -54,7 +54,7 @@ describe('OceanAuth', () => { describe('#store()', () => { it('should sign and store the token', async () => { - const writeTokenSpy = spy.on(oceanAuth as any, 'writeToken', () => {}) + const writeTokenSpy = spy.on(oceanAuth as any, 'writeToken', () => null) await oceanAuth.store(account) diff --git a/test/utils/SubscribablePromise.test.ts b/test/utils/SubscribablePromise.test.ts index ad7a4f8..850419a 100644 --- a/test/utils/SubscribablePromise.test.ts +++ b/test/utils/SubscribablePromise.test.ts @@ -7,15 +7,15 @@ use(spies) describe('SubscribablePromise', () => { it('should work', async () => { - const subscribible = new SubscribablePromise(() => {}) + const subscribable = new SubscribablePromise(() => null) - assert.isDefined(subscribible) + assert.isDefined(subscribable) }) describe('#subscribe()', () => { it('should return a subscription', async () => { - const subscribible = new SubscribablePromise(() => {}) - const subscription = subscribible.subscribe(() => {}) + const subscribable = new SubscribablePromise(() => null) + const subscription = subscribable.subscribe(() => null) assert.isDefined(subscription) assert.isDefined(subscription.unsubscribe) @@ -24,11 +24,11 @@ describe('SubscribablePromise', () => { it('should listen the next values', done => { const onNextSpy = spy() - const subscribible = new SubscribablePromise(observer => { + const subscribable = new SubscribablePromise(observer => { setTimeout(() => observer.next('test'), 10) setTimeout(() => observer.next('test'), 20) }) - subscribible.subscribe(onNextSpy) + subscribable.subscribe(onNextSpy) setTimeout(() => { expect(onNextSpy).to.has.been.called.with('test') @@ -42,12 +42,12 @@ describe('SubscribablePromise', () => { it('should resolve', done => { const onCompleteSpy = spy() const onFinallySpy = spy() - const subscribible = new SubscribablePromise(observer => { + const subscribable = new SubscribablePromise(observer => { setTimeout(() => observer.next('test'), 10) setTimeout(() => observer.complete('test'), 20) }) - subscribible.then(onCompleteSpy).finally(onFinallySpy) + subscribable.then(onCompleteSpy).finally(onFinallySpy) setTimeout(() => { expect(onCompleteSpy).to.has.been.called.with('test') @@ -62,12 +62,12 @@ describe('SubscribablePromise', () => { it('should catch the error', done => { const onErrorSpy = spy() const onFinallySpy = spy() - const subscribible = new SubscribablePromise(observer => { + const subscribable = new SubscribablePromise(observer => { setTimeout(() => observer.next('test'), 10) setTimeout(() => observer.error('test'), 20) }) - subscribible.catch(onErrorSpy).finally(onFinallySpy) + subscribable.catch(onErrorSpy).finally(onFinallySpy) setTimeout(() => { expect(onErrorSpy).to.has.been.called.with('test') @@ -80,13 +80,13 @@ describe('SubscribablePromise', () => { it('should be able to subscribe and wait for a promise', async () => { const onNextSpy = spy() - const subscribible = new SubscribablePromise(observer => { + const subscribable = new SubscribablePromise(observer => { setTimeout(() => observer.next('test'), 10) setTimeout(() => observer.next('test'), 20) setTimeout(() => observer.complete('completed'), 30) }) - const result = await subscribible.next(onNextSpy) + const result = await subscribable.next(onNextSpy) expect(onNextSpy).to.has.been.called.with('test') expect(onNextSpy).to.has.been.called.exactly(2) @@ -96,7 +96,7 @@ describe('SubscribablePromise', () => { it('should use the result of a the promise as executor to complete the observer', async () => { const onNextSpy = spy() - const subscribible = new SubscribablePromise(async observer => { + const subscribable = new SubscribablePromise(async observer => { await new Promise(resolve => setTimeout(resolve, 10)) observer.next('test') await new Promise(resolve => setTimeout(resolve, 10)) @@ -105,7 +105,7 @@ describe('SubscribablePromise', () => { return 'completed' }) - const result = await subscribible.next(onNextSpy) + const result = await subscribable.next(onNextSpy) expect(onNextSpy).to.has.been.called.with('test') expect(onNextSpy).to.has.been.called.exactly(2)