From b174e4cd661df7800787939f9831fe8ebdea9d7e Mon Sep 17 00:00:00 2001 From: Developer Date: Wed, 10 Aug 2022 15:32:37 +0200 Subject: [PATCH 1/5] feat: fonctional data provider with request --- .env | 6 +- docker-compose.yml | 22 +- networks/local/ethereum/contracts.json | 10 + networks/local/ethereum/keys.json.liquid | 3 +- networks/local/tezos/contracts.json | 10 + networks/local/tezos/keys.json.liquid | 3 +- .../cast-eth-v1/contracts/OnDemandOracle.sol | 69 ++++ .../interfaces/DataProviderOracle.sol | 6 + .../interfaces/DataProviderOracleConsumer.sol | 10 + .../contracts/tokens/ForgeBond.sol | 35 +- .../src/DataProviderOracle.ts | 65 ++++ .../cast/cast-interface-v1/src/ForgeBond.ts | 14 + .../src/blockchainSpecific/eth/abi/index.ts | 2 + packages/cast/cast-interface-v1/src/index.ts | 1 + .../cast-interface-v1/src/types/contracts.ts | 1 + .../src/models/notification/constants.ts | 7 + .../data-provider-notification.ts | 28 ++ .../models/src/models/notification/index.ts | 1 + packages/cast/oracle-clients/codegen.yml | 103 +++--- packages/cast/oracle-clients/src/index.ts | 1 + .../src/modules/dpoClient/dpoClient.config.ts | 18 ++ .../src/modules/dpoClient/dpoClient.module.ts | 11 + .../modules/dpoClient/dpoClient.service.ts | 237 ++++++++++++++ .../src/modules/dpoClient/index.ts | 3 + .../graphQL/dpo/dpoNotification.graphql | 5 + .../src/shared/graphQL/dpo/test.graphql | 3 + packages/cast/oracles/env/dc.dpo.env | 23 ++ packages/cast/oracles/genSDLForModules.ts | 4 +- .../oracles/integration/utils/envTemplates.ts | 5 +- .../oracles/integration/utils/setupEnv.ts | 2 + packages/cast/oracles/schema/config.graphql | 296 +++++++++++++++++ packages/cast/oracles/schema/dpo.graphql | 298 ++++++++++++++++++ packages/cast/oracles/schema/fio.graphql | 5 + packages/cast/oracles/schema/fro.graphql | 5 + packages/cast/oracles/schema/fso.graphql | 5 + packages/cast/oracles/schema/fxo.graphql | 5 + packages/cast/oracles/src/app.dyno.module.ts | 5 + packages/cast/oracles/src/main.ts | 2 +- packages/cast/oracles/src/mode.ts | 1 + .../dpo/dataProvider.event.constant.ts | 1 + .../src/modules/dpo/dataProvider.module.ts | 10 + .../src/modules/dpo/dataProvider.resolver.ts | 20 ++ .../src/modules/dpo/dataProvider.service.ts | 155 +++++++++ .../oracles/src/modules/fro/fro.resolver.ts | 11 + .../oracles/src/modules/fxo/fxo.resolver.ts | 17 + .../src/shared/services/blockchain.service.ts | 31 ++ .../cast/oracles/src/utils/blockchainUtils.ts | 114 ++++++- 47 files changed, 1633 insertions(+), 56 deletions(-) create mode 100644 networks/local/ethereum/contracts.json create mode 100644 networks/local/tezos/contracts.json create mode 100644 packages/cast/cast-eth-v1/contracts/OnDemandOracle.sol create mode 100644 packages/cast/cast-eth-v1/contracts/interfaces/DataProviderOracle.sol create mode 100644 packages/cast/cast-eth-v1/contracts/interfaces/DataProviderOracleConsumer.sol create mode 100644 packages/cast/cast-interface-v1/src/DataProviderOracle.ts create mode 100644 packages/cast/models/src/models/notification/data-provider-notification.ts create mode 100644 packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.config.ts create mode 100644 packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.module.ts create mode 100644 packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.service.ts create mode 100644 packages/cast/oracle-clients/src/modules/dpoClient/index.ts create mode 100644 packages/cast/oracle-clients/src/shared/graphQL/dpo/dpoNotification.graphql create mode 100644 packages/cast/oracle-clients/src/shared/graphQL/dpo/test.graphql create mode 100644 packages/cast/oracles/env/dc.dpo.env create mode 100644 packages/cast/oracles/schema/config.graphql create mode 100644 packages/cast/oracles/schema/dpo.graphql create mode 100644 packages/cast/oracles/src/modules/dpo/dataProvider.event.constant.ts create mode 100644 packages/cast/oracles/src/modules/dpo/dataProvider.module.ts create mode 100644 packages/cast/oracles/src/modules/dpo/dataProvider.resolver.ts create mode 100644 packages/cast/oracles/src/modules/dpo/dataProvider.service.ts diff --git a/.env b/.env index e470490..e9dcd1b 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ -GANACHE_PRIV="0x6aa2e67de571e04071d08df88d7252b8f3c2dae026187568fe0b8cb24d6b2255" -GANACHE_ADDRESS="0xaf9724349c52607fdd2049f2ab14bba5aa0be6a6" -TZ_KEY="forge,edpkv2Le5Zs15tUcA5XYEZtx6MdZi7rzPZQcR9GzPKevjwqPJPY257,tz1XLDSNujdGnfeWqNZAsndyFzAVqahHEovJ,unencrypted:edskRiPnv8PxD3LZcKgQ7UHLL5676DeZvRmny6Et4AhbSDtd7hcishWeDubQs6u8xLbHNAwBR5umHAJR5ssMFoVL51b8yQZA3x" \ No newline at end of file +GANACHE_PRIV="0xf36a7ffe623af7a4025d9879e9223272034dac49e9dfcf2f0bd68a41137b4561" +GANACHE_ADDRESS="0x8e2ddbc002d51811cb0312f2de9dd46c81971da1" +TZ_KEY="forge,edpkv3vx3AZrYJd6rjKPeCqr1o3WPFHbXpkm6pqgvToqjtGQxwoFmd,tz1S9CXGqf1rNRu1sJorGZ16jbJuuC2HPgZ5,unencrypted:edskS5anihcR4YYr9TixSVUAQSEzVKvD5qjYYVcTyHqeSpRTZPx3x7DEae6oKe6n59v4Q1qDZ2NQrwxAmBexjQyEzU3LzqD58B" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 20d97ff..0d02720 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -81,11 +81,27 @@ services: - './networks:/networks' - './packages:/home/node/packages/' - './node_modules:/home/node/node_modules' + dpo: + container_name: dpo + image: 'node:16.9.1-alpine3.14' + working_dir: /home/node/packages/cast/oracles + command: npm run start + env_file: + - ./packages/cast/oracles/env/dc.dpo.env + environment: + - TZ_BLOCKCHAIN_PROVIDE_LOCATION=http://flextesa:20000 + - ETH_BLOCKCHAIN_PROVIDE_LOCATION=ws://ganache:8545 + ports: + - '6670:6660' + volumes: + - './networks:/networks' + - './packages:/home/node/packages/' + - './node_modules:/home/node/node_modules' ganache: container_name: ganache image: trufflesuite/ganache-cli:latest ports: - - "8545:8545" + - '8545:8545' volumes: - 'ganache_data:/ganache_data' entrypoint: @@ -103,7 +119,7 @@ services: container_name: flextesa image: oxheadalpha/flextesa:20220321 ports: - - "20000:20000" + - '20000:20000' volumes: - 'flextesa_data:/tmp' command: hangzbox start --keep-root --add-bootstrap-account "${TZ_KEY}@2_000_000_000_000" --no-daemons-for=forge @@ -114,7 +130,7 @@ services: image: polinux/mkdocs:1.1.2 restart: always ports: - - "8000:8000" + - '8000:8000' environment: LIVE_RELOAD_SUPPORT: 'true' UPDATE_INTERVAL: 15 diff --git a/networks/local/ethereum/contracts.json b/networks/local/ethereum/contracts.json new file mode 100644 index 0000000..2e9563f --- /dev/null +++ b/networks/local/ethereum/contracts.json @@ -0,0 +1,10 @@ +{ + "BasicTokenLibrary": "0xEfF29F308C9F516297f49Ee24BF39a90C1Cb5c7a", + "ForgeBondFactory": "0x5EF5cd291dB5B57c9C434E8900aE502eF51DF92e", + "ForgeInstrumentRegistry": "0xe50Ef5A196962b8fa5b62B079cf7bAFe18b45fcB", + "IterableBalances": "0x23799E18dCe49c1c8B00A81D532a02D7F59e5E13", + "OperatorManagerLibrary": "0x0056dB4959965d02e05D8F8138172833427f6447", + "SecurityTokenBalancesLibrary": "0x5702491E74a13494C68B6F140C979f2732E5cE06", + "SettlementRepositoryLibrary": "0xd523513bB9205EcB67A147C30272157EC43951A3", + "SettlementWorkflowLibrary": "0x6B0658D4d92968BF63544a4cAb66Cffe68c499C6" +} \ No newline at end of file diff --git a/networks/local/ethereum/keys.json.liquid b/networks/local/ethereum/keys.json.liquid index e4570af..25d7e39 100644 --- a/networks/local/ethereum/keys.json.liquid +++ b/networks/local/ethereum/keys.json.liquid @@ -6,5 +6,6 @@ "INVESTOR_1": "{{ "m/44'/60'/0'/0/4'" | ethereum_private_key }}", "DEALER_1": "{{ "m/44'/60'/0'/0/5'" | ethereum_private_key }}", "DEALER_2": "{{ "m/44'/60'/0'/0/6'" | ethereum_private_key }}", - "STR": "{{ "m/44'/60'/0'/0/7'" | ethereum_private_key }}" + "STR": "{{ "m/44'/60'/0'/0/7'" | ethereum_private_key }}", + "PROVIDER": "{{ "m/44'/60'/0'/0/8'" | ethereum_private_key }}" } diff --git a/networks/local/tezos/contracts.json b/networks/local/tezos/contracts.json new file mode 100644 index 0000000..08d5735 --- /dev/null +++ b/networks/local/tezos/contracts.json @@ -0,0 +1,10 @@ +{ + "ADMIN": "tz1S9CXGqf1rNRu1sJorGZ16jbJuuC2HPgZ5", + "REGISTRAR": "tz1WqPjpML6iG9EksYNGVVo9EN9j5iwHEkJj", + "SINK": "KT1Hs7ZecjYMJWWsEJdWz9PjHY8BNkU7nuGX", + "REGISTRY": "KT1SxeyDW7wdybDL6ZA4HmyVQB8fqUz8kKpS", + "LAMBDA_BOND": "KT1KgfajJL3DMBGgNmTu7xGH28CdT9EcTS5M", + "FACTORY_BOND": "KT1V4mqPWCeuX9Swddw9XqqawbdKZPbJjBSp", + "LAMBDA_EMTN": "KT1WFJvq2B5vM3xLXFde9fKkNDboahLQx4G1", + "FACTORY_EMTN": "KT1T6ChonV5KDRDA1R23hmqp69RzY5Nz4Waa" +} \ No newline at end of file diff --git a/networks/local/tezos/keys.json.liquid b/networks/local/tezos/keys.json.liquid index d21bd85..11eec5f 100644 --- a/networks/local/tezos/keys.json.liquid +++ b/networks/local/tezos/keys.json.liquid @@ -6,5 +6,6 @@ "INVESTOR_1": "{{ "m/44'/1729'/0'/4'" | tezos_private_key }}", "DEALER_1": "{{ "m/44'/1729'/0'/5'" | tezos_private_key }}", "DEALER_2": "{{ "m/44'/1729'/0'/6'" | tezos_private_key }}", - "STR": "{{ "m/44'/1729'/0'/7'" | tezos_private_key }}" + "STR": "{{ "m/44'/1729'/0'/7'" | tezos_private_key }}", + "PROVIDER": "{{ "m/44'/1729'/0'/8'" | tezos_private_key }}" } diff --git a/packages/cast/cast-eth-v1/contracts/OnDemandOracle.sol b/packages/cast/cast-eth-v1/contracts/OnDemandOracle.sol new file mode 100644 index 0000000..4602fd8 --- /dev/null +++ b/packages/cast/cast-eth-v1/contracts/OnDemandOracle.sol @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "./AbstractInstrumentFactory.sol"; +import "./interfaces/DataProviderOracle.sol"; +import "./interfaces/DataProviderOracleConsumer.sol"; + +// simple store data contract +contract OnDemandOracle is DataProviderOracle, AbstractInstrumentFactory { + struct OracleResult { + int192 result; // -0.218 (6 decimals) + int8 decimal; + uint64 timestamp; // timestamp of the collection + // add figi + // add timestamp of the data + // add + } + + struct OracleRequest { + address caller; + // another type of data needed here for the parameter ?? + // add figi + } + + // outside MDA keeps on monitoring the nextId of the contract + uint256 public lastID; + mapping(uint256 => OracleResult) public oracleResults; + mapping(uint256 => OracleRequest) public oracleRequests; + + // content to think about, there should also be a type of data asked by the caller + event DataRequest(address caller, uint256 id); // don't know if it is possible + + constructor(address owner) public AbstractInstrumentFactory(owner) { + lastID = 0; + } + + function SubmitRequest() external override { + lastID++; + + // should insert the data in callerMapping + oracleRequests[lastID] = OracleRequest(msg.sender); + + // this should be picked up by the outside MDA (or it keeps monitoring the value of nextId) + emit DataRequest(oracleRequests[lastID].caller, lastID); + } + + // make sure this method is only called by the MDA (owner only) - to be added + // the caller should implement our solidity interface to be able to process our result + // only owner or something like this + function WriteResult( + uint256 jobId, + int192 result, + int8 decimals, + uint64 timestamp + ) public onlyOwner { + // write the result on the blockchain in this contract + oracleResults[jobId] = OracleResult(result, decimals, timestamp); + + // and write the result in the contract that made the request + address callerAddress = oracleRequests[jobId].caller; + DataProviderOracleConsumer(callerAddress).ConsumeData( + result, + decimals, + timestamp + ); + + // Emit an event to be subscribed to by the NestJS Oracle service + } +} diff --git a/packages/cast/cast-eth-v1/contracts/interfaces/DataProviderOracle.sol b/packages/cast/cast-eth-v1/contracts/interfaces/DataProviderOracle.sol new file mode 100644 index 0000000..e551f1e --- /dev/null +++ b/packages/cast/cast-eth-v1/contracts/interfaces/DataProviderOracle.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface DataProviderOracle { + function SubmitRequest() external; +} diff --git a/packages/cast/cast-eth-v1/contracts/interfaces/DataProviderOracleConsumer.sol b/packages/cast/cast-eth-v1/contracts/interfaces/DataProviderOracleConsumer.sol new file mode 100644 index 0000000..dac5892 --- /dev/null +++ b/packages/cast/cast-eth-v1/contracts/interfaces/DataProviderOracleConsumer.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface DataProviderOracleConsumer { + function ConsumeData( + int192 result, + int8 decimal, + uint64 timestamp + ) external; +} diff --git a/packages/cast/cast-eth-v1/contracts/tokens/ForgeBond.sol b/packages/cast/cast-eth-v1/contracts/tokens/ForgeBond.sol index 805a561..39552e2 100644 --- a/packages/cast/cast-eth-v1/contracts/tokens/ForgeBond.sol +++ b/packages/cast/cast-eth-v1/contracts/tokens/ForgeBond.sol @@ -10,8 +10,16 @@ import "../interfaces/IBasicToken.sol"; import "../interfaces/IInstrument.sol"; import "../interfaces/IOperatorManager.sol"; import "../interfaces/ISettlement.sol"; - -contract ForgeBond is IBasicToken, IOperatorManager, ISettlement, IInstrument { +import "../interfaces/DataProviderOracleConsumer.sol"; +import "../interfaces/DataProviderOracle.sol"; + +contract ForgeBond is + IBasicToken, + IOperatorManager, + ISettlement, + IInstrument, + DataProviderOracleConsumer +{ using BasicTokenLibrary for BasicTokenLibrary.BasicToken; using BasicTokenLibrary for BasicTokenLibrary.Bond; @@ -46,7 +54,16 @@ contract ForgeBond is IBasicToken, IOperatorManager, ISettlement, IInstrument { uint256 public constant CANCELLED = 0x05; uint256 private constant ERROR = 0xFF; + // DataProviderOracle Results + int192 public latestEuriborResult; + uint64 public latestTimestamp; + event Transfer(address indexed _from, address indexed _to, uint256 _value); // Only for erc20 explorer + event ConsumeDataEvent( + uint256 euriborResult, + uint256 decimal, + uint256 timestamp + ); constructor(BasicTokenLibrary.BasicTokenInput memory basicTokenInput) public @@ -169,6 +186,20 @@ contract ForgeBond is IBasicToken, IOperatorManager, ISettlement, IInstrument { return "Bond"; } + function RequestData() external { + DataProviderOracle(0x476059cD57800DB8eB88f67c2Aa38A6fCf8251e0) + .SubmitRequest(); + } + + function ConsumeData( + int192 euriborResult, + int8 decimal, + uint64 timestamp + ) external override { + latestEuriborResult = euriborResult; + latestTimestamp = timestamp; + } + // Modifiers modifier issuerOnly() { require( diff --git a/packages/cast/cast-interface-v1/src/DataProviderOracle.ts b/packages/cast/cast-interface-v1/src/DataProviderOracle.ts new file mode 100644 index 0000000..91b8f0e --- /dev/null +++ b/packages/cast/cast-interface-v1/src/DataProviderOracle.ts @@ -0,0 +1,65 @@ +import { + BlockchainDriver, + BlockchainSpecificParamsOf, + CallResult, + TransactionManager, + Event, +} from '@castframework/transaction-manager'; +import { Observable } from 'rxjs'; +import { SmartContract } from './SmartContract'; + +export const FORGEBOND_CONTRACT_EVENT_DATAREQUEST = 'DataRequest'; +export type ForgeBondDataRequestPayload = { + id: number; +}; +export type ForgeBondDataRequestEvent = Event< + typeof FORGEBOND_CONTRACT_EVENT_DATAREQUEST, + ForgeBondDataRequestPayload +>; + +export class DataProviderOracle< + Driver extends BlockchainDriver, +> extends SmartContract { + constructor( + smartContractAddress: string, + transactionManager: TransactionManager, + contractBlockchainSpecificParams: Partial< + BlockchainSpecificParamsOf + > = {}, + ) { + super( + smartContractAddress, + transactionManager, + contractBlockchainSpecificParams, + ); + } + + public SubmitRequest( + from?: number, + listenBlockchainSpecificParams?: Partial< + BlockchainSpecificParamsOf + >, + ): Observable { + return this._listen( + FORGEBOND_CONTRACT_EVENT_DATAREQUEST, + listenBlockchainSpecificParams, + from, + ); + } + + public async WriteResult( + jobId: number, + result: number, + decimals: number, + timestamp: number, + transactionBlockchainSpecificParams?: Partial< + BlockchainSpecificParamsOf + >, + ): Promise> { + return this._call( + 'WriteResult', + [jobId, result, decimals, timestamp], + transactionBlockchainSpecificParams, + ); + } +} diff --git a/packages/cast/cast-interface-v1/src/ForgeBond.ts b/packages/cast/cast-interface-v1/src/ForgeBond.ts index adb651d..3d95201 100644 --- a/packages/cast/cast-interface-v1/src/ForgeBond.ts +++ b/packages/cast/cast-interface-v1/src/ForgeBond.ts @@ -662,4 +662,18 @@ export class ForgeBond< transactionBlockchainSpecificParams, ); } + + public async RequestData( + transactionParams?: TransactionParams, + transactionBlockchainSpecificParams?: Partial< + BlockchainSpecificParamsOf + >, + ): Promise { + return this._send<[]>( + 'RequestData', + [], + transactionParams, + transactionBlockchainSpecificParams, + ); + } } diff --git a/packages/cast/cast-interface-v1/src/blockchainSpecific/eth/abi/index.ts b/packages/cast/cast-interface-v1/src/blockchainSpecific/eth/abi/index.ts index c350d3e..bb043b9 100644 --- a/packages/cast/cast-interface-v1/src/blockchainSpecific/eth/abi/index.ts +++ b/packages/cast/cast-interface-v1/src/blockchainSpecific/eth/abi/index.ts @@ -1,6 +1,7 @@ import ForgeFactory = require('@castframework/cast-eth-v1/dist/abi/ForgeBondFactory.json'); import ForgeBond = require('@castframework/cast-eth-v1/dist/abi/ForgeBond.json'); import InstrumentRegistry = require('@castframework/cast-eth-v1/dist/abi/ForgeInstrumentRegistry.json'); +import OnDemandOracle = require('@castframework/cast-eth-v1/dist/abi/OnDemandOracle.json'); import { ForgeContractType } from '../../../types'; type ContractTypeMapping = { @@ -12,6 +13,7 @@ export const AbiMapping: ContractTypeMapping = { [ForgeContractType.BOND_FACTORY]: ForgeFactory, [ForgeContractType.EMTN_FACTORY]: null, [ForgeContractType.INSTRUMENT_REGISTRY]: InstrumentRegistry, + [ForgeContractType.ON_DEMAND]: OnDemandOracle, }; export function getAbi(type: ForgeContractType): any { diff --git a/packages/cast/cast-interface-v1/src/index.ts b/packages/cast/cast-interface-v1/src/index.ts index 1e5cb95..a3cd2f0 100644 --- a/packages/cast/cast-interface-v1/src/index.ts +++ b/packages/cast/cast-interface-v1/src/index.ts @@ -2,6 +2,7 @@ export * from './ForgeInstrumentRegistry'; export * from './ForgeBondFactory'; export * from './ForgeEmtnFactory'; export * from './ForgeBond'; +export * from './DataProviderOracle'; export * from './SmartContract'; export * from './types'; export * from './helpers'; diff --git a/packages/cast/cast-interface-v1/src/types/contracts.ts b/packages/cast/cast-interface-v1/src/types/contracts.ts index cbe53ef..63aed2c 100644 --- a/packages/cast/cast-interface-v1/src/types/contracts.ts +++ b/packages/cast/cast-interface-v1/src/types/contracts.ts @@ -3,4 +3,5 @@ export enum ForgeContractType { BOND_FACTORY = 'ForgeBondFactory', EMTN_FACTORY = 'ForgeEmtnFactory', INSTRUMENT_REGISTRY = 'ForgeInstrumentRegistry', + ON_DEMAND = 'OnDemandOracle', } diff --git a/packages/cast/models/src/models/notification/constants.ts b/packages/cast/models/src/models/notification/constants.ts index 34585ff..e89a7ff 100644 --- a/packages/cast/models/src/models/notification/constants.ts +++ b/packages/cast/models/src/models/notification/constants.ts @@ -38,3 +38,10 @@ export enum ErrorNotificationName { registerEnumType(ErrorNotificationName, { name: 'ErrorNotificationName', }); + +export enum DataProviderNotificationName { + SubscriptionInitiated = 'SubscriptionInitiated', +} +registerEnumType(DataProviderNotificationName, { + name: 'DataProviderNotificationName', +}); diff --git a/packages/cast/models/src/models/notification/data-provider-notification.ts b/packages/cast/models/src/models/notification/data-provider-notification.ts new file mode 100644 index 0000000..6ef9749 --- /dev/null +++ b/packages/cast/models/src/models/notification/data-provider-notification.ts @@ -0,0 +1,28 @@ +import { Field, ID, ObjectType } from '@nestjs/graphql'; +import { DataProviderNotificationName } from './constants'; + +@ObjectType() +export class DataProviderNotification { + @Field((returns) => DataProviderNotificationName) + // eslint-disable-next-line @typescript-eslint/no-unused-vars + @Field((type) => ID, { nullable: true }) + public transactionHash: string; + + public constructor(transactionHash: string) { + this.transactionHash = transactionHash; + } +} + +export function isDataProviderNotification( + dpoNotification: any, +): dpoNotification is DataProviderNotification { + if (!dpoNotification || !dpoNotification.notificationName) { + return false; + } + + if (DataProviderNotificationName[dpoNotification.notificationName]) { + return true; + } + + return false; +} diff --git a/packages/cast/models/src/models/notification/index.ts b/packages/cast/models/src/models/notification/index.ts index 0aa9f8b..f5c5627 100644 --- a/packages/cast/models/src/models/notification/index.ts +++ b/packages/cast/models/src/models/notification/index.ts @@ -4,3 +4,4 @@ export * from './error-notification'; export * from './light-settlement-transaction'; export * from './heartbeat-notification'; export * from './registry-notification'; +export * from './data-provider-notification'; diff --git a/packages/cast/oracle-clients/codegen.yml b/packages/cast/oracle-clients/codegen.yml index 25fab1f..0428721 100644 --- a/packages/cast/oracle-clients/codegen.yml +++ b/packages/cast/oracle-clients/codegen.yml @@ -1,8 +1,8 @@ overwrite: true generates: src/modules/strClient/generated/graphql.ts: - schema: "../oracles/schema/str.graphql" - documents: "src/shared/graphQL/str/*.graphql" + schema: '../oracles/schema/str.graphql' + documents: 'src/shared/graphQL/str/*.graphql' config: namingConvention: keep skipTypename: true @@ -10,44 +10,44 @@ generates: scalars: DateTime: Date plugins: - - "typescript" - - "typescript-operations" - - "typescript-document-nodes" + - 'typescript' + - 'typescript-operations' + - 'typescript-document-nodes' src/modules/strClient/generated/schema.json: - schema: "../oracles/schema/str.graphql" - documents: "src/shared/graphQL/str/*.graphql" + schema: '../oracles/schema/str.graphql' + documents: 'src/shared/graphQL/str/*.graphql' plugins: - introspection config: minify: true src/modules/froClient/generated/graphql.ts: - schema: "../oracles/schema/fro.graphql" - documents: - - "src/shared/graphQL/fro/*.graphql" - - "src/shared/graphQL/fxo/*.graphql" + schema: '../oracles/schema/fro.graphql' + documents: + - 'src/shared/graphQL/fro/*.graphql' + - 'src/shared/graphQL/fxo/*.graphql' config: namingConvention: keep skipTypename: true scalars: DateTime: Date plugins: - - "typescript" - - "typescript-operations" - - "typescript-document-nodes" + - 'typescript' + - 'typescript-operations' + - 'typescript-document-nodes' src/modules/froClient/generated/schema.json: - schema: "../oracles/schema/fro.graphql" - documents: - - "src/shared/graphQL/fro/*.graphql" - - "src/shared/graphQL/fxo/*.graphql" + schema: '../oracles/schema/fro.graphql' + documents: + - 'src/shared/graphQL/fro/*.graphql' + - 'src/shared/graphQL/fxo/*.graphql' plugins: - introspection config: minify: true src/modules/fioClient/generated/graphql.ts: - schema: "../oracles/schema/fio.graphql" - documents: - - "src/shared/graphQL/fio/*.graphql" - - "src/shared/graphQL/fxo/*.graphql" + schema: '../oracles/schema/fio.graphql' + documents: + - 'src/shared/graphQL/fio/*.graphql' + - 'src/shared/graphQL/fxo/*.graphql' config: namingConvention: keep dedupeOperationSuffix: true @@ -55,37 +55,60 @@ generates: scalars: DateTime: Date plugins: - - "typescript" - - "typescript-operations" - - "typescript-document-nodes" + - 'typescript' + - 'typescript-operations' + - 'typescript-document-nodes' src/modules/fioClient/generated/schema.json: - schema: "../oracles/schema/fio.graphql" - documents: - - "src/shared/graphQL/fio/*.graphql" - - "src/shared/graphQL/fxo/*.graphql" + schema: '../oracles/schema/fio.graphql' + documents: + - 'src/shared/graphQL/fio/*.graphql' + - 'src/shared/graphQL/fxo/*.graphql' plugins: - introspection config: minify: true src/modules/fsoClient/generated/graphql.ts: - schema: "../oracles/schema/fso.graphql" - documents: - - "src/shared/graphQL/fso/*.graphql" - - "src/shared/graphQL/fxo/*.graphql" + schema: '../oracles/schema/fso.graphql' + documents: + - 'src/shared/graphQL/fso/*.graphql' + - 'src/shared/graphQL/fxo/*.graphql' config: namingConvention: keep skipTypename: true scalars: DateTime: Date plugins: - - "typescript" - - "typescript-operations" - - "typescript-document-nodes" + - 'typescript' + - 'typescript-operations' + - 'typescript-document-nodes' src/modules/fsoClient/generated/schema.json: - schema: "../oracles/schema/fso.graphql" - documents: - - "src/shared/graphQL/fso/*.graphql" - - "src/shared/graphQL/fxo/*.graphql" + schema: '../oracles/schema/fso.graphql' + documents: + - 'src/shared/graphQL/fso/*.graphql' + - 'src/shared/graphQL/fxo/*.graphql' + plugins: + - introspection + config: + minify: true + src/modules/dpoClient/generated/graphql.ts: + schema: '../oracles/schema/dpo.graphql' + documents: + - 'src/shared/graphQL/dpo/*.graphql' + - 'src/shared/graphQL/fxo/*.graphql' + config: + namingConvention: keep + skipTypename: true + scalars: + DateTime: Date + plugins: + - 'typescript' + - 'typescript-operations' + - 'typescript-document-nodes' + src/modules/dpoClient/generated/schema.json: + schema: '../oracles/schema/dpo.graphql' + documents: + - 'src/shared/graphQL/dpo/*.graphql' + - 'src/shared/graphQL/fxo/*.graphql' plugins: - introspection config: diff --git a/packages/cast/oracle-clients/src/index.ts b/packages/cast/oracle-clients/src/index.ts index 96825f6..63518c8 100644 --- a/packages/cast/oracle-clients/src/index.ts +++ b/packages/cast/oracle-clients/src/index.ts @@ -2,3 +2,4 @@ export * from './modules/fioClient'; export * from './modules/froClient'; export * from './modules/fsoClient'; export * from './modules/strClient'; +export * from './modules/dpoClient'; diff --git a/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.config.ts b/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.config.ts new file mode 100644 index 0000000..5e3449e --- /dev/null +++ b/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.config.ts @@ -0,0 +1,18 @@ +import { Property } from 'ts-convict'; + +export class DpoClientConfig { + @Property({ + default: null, + env: 'API_DPO_GQL_EP', + format: String, + }) + public dpoGraphQLEndpoint: string; + + @Property({ + default: 100, + env: 'HEARTBEAT_LOG_PERIOD', + format: Number, + doc: 'Example: 5 means it will log 1 every 5 heartbeat', + }) + public heartbeatLogPeriod: number; +} diff --git a/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.module.ts b/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.module.ts new file mode 100644 index 0000000..d62aafb --- /dev/null +++ b/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.module.ts @@ -0,0 +1,11 @@ +import { Module } from '@nestjs/common'; +import { DpoClientService as DpoClientService } from './dpoClient.service'; +import { ConfigModule } from '../config/config.module'; +import { DpoClientConfig } from './dpoClient.config'; + +@Module({ + imports: [ConfigModule.forConfig(DpoClientConfig)], + providers: [DpoClientService], + exports: [DpoClientService], +}) +export class DpoClientModule {} diff --git a/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.service.ts b/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.service.ts new file mode 100644 index 0000000..61f900a --- /dev/null +++ b/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.service.ts @@ -0,0 +1,237 @@ +import { getLogger, Logger } from '../../utils/logger'; +import { Injectable, OnModuleDestroy } from '@nestjs/common'; +import { + ContractNotification, + ErrorNotification, + RegistryNotification, + DataProviderNotification, +} from '@castframework/models'; +import { SubscriptionClient } from 'subscriptions-transport-ws'; +import { errorAsString } from '../../utils/errorAsString'; +import { + errorNotificationSubscription, + errorNotificationSubscriptionVariables, + errorNotification, + dpoNotification, + testQuery, + dpoNotificationSubscription, + dpoNotificationSubscriptionVariables, +} from './generated/graphql'; +import { ApolloClient, FetchResult } from '@apollo/client/core'; +import { DpoClientConfig } from './dpoClient.config'; +import { Observable, Subject } from 'rxjs'; +import { + extractGraphqlErrorMessageFromApolloError, + getApolloClient, + getSchema, +} from '../../shared/utils/oracleUtils'; +import * as generatedSchema from './generated/schema.json'; +import { query, subscribe } from '../../shared/utils/graphQLUtils'; +@Injectable() +export class DpoClientService implements OnModuleDestroy { + private heartbeatCounter: number | null = null; + private subscriptionClient: SubscriptionClient; + private apolloClient: ApolloClient; + private logger: Logger = getLogger(this.constructor.name); + private _promiseRegister: { + [key: string]: Promise; + } = {}; + private _promiseResolver: { + [key: string]: { + resolve: (value: any) => any; + reject: (reason: any) => any; + }; + } = {}; + + private errorNotifications = new Subject(); + private dpoNotifications = new Subject(); + private contractNotifications = new Subject(); + private registryNotifications = new Subject(); + private clientName = 'dpo'; + + private subscribed = false; + + public constructor(private readonly dpoClientConfig: DpoClientConfig) { + const schema = getSchema(generatedSchema); + const [client, subscriptionClient] = getApolloClient( + { + graphQlEndpoint: dpoClientConfig.dpoGraphQLEndpoint, + graphQlSubscriptionEndpoint: dpoClientConfig.dpoGraphQLEndpoint, + }, + schema, + this.clientName + '-client', + ); + + this.apolloClient = client; + this.subscriptionClient = subscriptionClient; + + this.setupSubscriptionClientEventHandlers(); + } + + public getErrorNotifications(): Observable { + return this.errorNotifications.asObservable(); + } + + public getDpoNotifications(): Observable { + return this.dpoNotifications.asObservable(); + } + + public getContractNotifications(): Observable { + return this.contractNotifications.asObservable(); + } + + public getRegistryNotifications(): Observable { + return this.registryNotifications.asObservable(); + } + + public async test(): Promise { + const result = await query( + { + query: testQuery, + }, + this.apolloClient, + this.graphQlErrorForwarder, + this.logger, + this.clientName, + this, + ); + + return result.data.test; + } + + public onModuleDestroy(): void { + this.logger.debug('Stopping DPO client service'); + this.apolloClient.stop(); + // this dirty trick is necessary because SubscriptionClient.close() does not work well when inside a reconnect loop + // (as SubscriptionClient.client is null most of the time, the reconnect timeout is never cleared) + (this.subscriptionClient as any).reconnect = false; + this.subscriptionClient.close(); + } + + public getRegisteredPromise(transactionHash: string): Promise { + this._promiseRegister[transactionHash] = new Promise((resolve, reject) => { + this._promiseResolver[transactionHash] = { + resolve, + reject, + }; + }); + + return this._promiseRegister[transactionHash]; + } + + private graphQlErrorForwarder(e: any): void { + const error = extractGraphqlErrorMessageFromApolloError(e); + throw new Error(error); + } + + private setupSubscriptionClientEventHandlers(): void { + this.subscriptionClient.onConnected(() => { + this.logger.debug('SubscriptionClient received Connected event'); + this.initReturnsCanal(); + }); + this.subscriptionClient.onConnecting(() => + this.logger.debug('SubscriptionClient received Connecting event'), + ); + this.subscriptionClient.onDisconnected(() => + this.logger.debug('SubscriptionClient received Disconnected event'), + ); + this.subscriptionClient.onReconnected(() => { + this.logger.debug('SubscriptionClient received Reconnected event'); + this.initReturnsCanal(); + }); + this.subscriptionClient.onReconnecting(() => + this.logger.debug('SubscriptionClient received Reconnecting event'), + ); + this.subscriptionClient.onError((err) => + this.logger.debug( + `SubscriptionClient received Error event : error[${errorAsString( + err.error, + )}] message[${err.message}] type[${err.type}]`, + ), + ); + } + + private initReturnsCanal(): void { + if (this.subscribed) return; + this.subscribed = true; + this.logger.debug('Subscribing to DPO events'); + + subscribe< + errorNotificationSubscription, + errorNotificationSubscriptionVariables + >( + { + query: errorNotification, + }, + this.apolloClient, + this.logger, + this.clientName, + ).subscribe( + (error) => this.errorNotificationHandler(error), + (error) => this.errorHandler(error), + ); + + subscribe< + dpoNotificationSubscription, + dpoNotificationSubscriptionVariables + >( + { + query: dpoNotification, + }, + this.apolloClient, + this.logger, + this.clientName, + ).subscribe( + (event) => this.dpoNotificationHandler(event), + (error) => this.errorHandler(error), + ); + } + + private errorHandler = (error: any): void => { + this.logger.error(`Subscribe error[${JSON.stringify(error)}]`); + }; + + private errorNotificationHandler( + event: FetchResult, + ): void { + this.logger.debug( + `errorNotificationHandler with event[${JSON.stringify(event)}]`, + ); + if (event.data?.errorNotification) { + const { transactionHash, message } = event.data.errorNotification; + this.logger.debug( + `Received error with transaction hash [${transactionHash}] with message[${message}]`, + ); + + this.errorNotifications.next( + new ErrorNotification(transactionHash, errorAsString(message)), + ); + + if (transactionHash && this._promiseRegister[transactionHash]) { + this._promiseResolver[transactionHash].reject(message); + delete this._promiseRegister[transactionHash]; + delete this._promiseResolver[transactionHash]; + } + } + } + + private dpoNotificationHandler = async ( + event: FetchResult, + ): Promise => { + this.logger.debug( + `dpoNotificationHandler with event[${JSON.stringify(event)}]`, + ); + if (event.data?.dpoNotification) { + const { transactionHash } = event.data.dpoNotification; + this.logger.debug( + `Received DPO notification with transaction hash [${transactionHash}]`, + ); + + if (transactionHash && this._promiseResolver[transactionHash]) { + this._promiseResolver[transactionHash].resolve(true); + delete this._promiseRegister[transactionHash]; + delete this._promiseResolver[transactionHash]; + } + } + }; +} diff --git a/packages/cast/oracle-clients/src/modules/dpoClient/index.ts b/packages/cast/oracle-clients/src/modules/dpoClient/index.ts new file mode 100644 index 0000000..5936e0d --- /dev/null +++ b/packages/cast/oracle-clients/src/modules/dpoClient/index.ts @@ -0,0 +1,3 @@ +export * from './dpoClient.config'; +export * from './dpoClient.module'; +export * from './dpoClient.service'; diff --git a/packages/cast/oracle-clients/src/shared/graphQL/dpo/dpoNotification.graphql b/packages/cast/oracle-clients/src/shared/graphQL/dpo/dpoNotification.graphql new file mode 100644 index 0000000..aaa64f9 --- /dev/null +++ b/packages/cast/oracle-clients/src/shared/graphQL/dpo/dpoNotification.graphql @@ -0,0 +1,5 @@ +subscription dpoNotification { + dpoNotification { + transactionHash + } +} diff --git a/packages/cast/oracle-clients/src/shared/graphQL/dpo/test.graphql b/packages/cast/oracle-clients/src/shared/graphQL/dpo/test.graphql new file mode 100644 index 0000000..4fcc9ad --- /dev/null +++ b/packages/cast/oracle-clients/src/shared/graphQL/dpo/test.graphql @@ -0,0 +1,3 @@ +query testQuery { + test +} diff --git a/packages/cast/oracles/env/dc.dpo.env b/packages/cast/oracles/env/dc.dpo.env new file mode 100644 index 0000000..cba2079 --- /dev/null +++ b/packages/cast/oracles/env/dc.dpo.env @@ -0,0 +1,23 @@ +NETWORK_FOLDER=/networks/local +IDENTITY=REGISTRAR + +FORGE_ORACLE_PARAMETERS=--mode dpo +PORT=6660 + +STR_GQL_URL=http://str:6660/graphql + +BLOCKCHAIN_USE_MOCK=false + +ETH_NUMBER_OF_CONFIRMATION=1 +ETH_EVENT_DELAY_IN_BLOCKS=0 +TZ_NUMBER_OF_CONFIRMATION=1 +TZ_EVENT_DELAY_IN_BLOCKS=0 +TZ_POLLING_INTERVAL_IN_SECONDS=1 + +LEI_FORGE="969500FX8K40ZDW4F377" + +JWK_KID=QjU4MERDQ0NEQTU1RkE4NDMzRTE1QTE0NkIzNDkxQzdCQUMxQjYzMA + +GRAPHQL_ENABLE_INSTROSPECTION=true +GRAPHQL_ENABLE_PLAYGROUND=true +GRAPHQL_ENABLE_TRACING=true diff --git a/packages/cast/oracles/genSDLForModules.ts b/packages/cast/oracles/genSDLForModules.ts index cafaed6..b619f8f 100644 --- a/packages/cast/oracles/genSDLForModules.ts +++ b/packages/cast/oracles/genSDLForModules.ts @@ -53,9 +53,7 @@ async function buildModuleFromPath( .filter((file) => file.match(/\.resolver\.ts$/)) .map((file) => import(`./${file}`)); - const fxoRegex = /^f[^x]o$/; // Will match fro, fio, fso but not fxo - - if (moduleName.match(fxoRegex)) { + if (moduleName !== 'fxo' && moduleName !== 'str') { log(`🔎 Adding fxo, swift and position resolver for ${moduleName}`); resolvers.push(import('./src/modules/fxo/fxo.resolver')); resolvers.push(import('./src/modules/fxo/position/position.resolver')); diff --git a/packages/cast/oracles/integration/utils/envTemplates.ts b/packages/cast/oracles/integration/utils/envTemplates.ts index 90dc9ca..17e07e9 100644 --- a/packages/cast/oracles/integration/utils/envTemplates.ts +++ b/packages/cast/oracles/integration/utils/envTemplates.ts @@ -8,6 +8,7 @@ export type EnvConfig = { fsoPort: number; fio1Port: number; fio2Port: number; + dpoPort: number; }; export function defaultEnv( @@ -17,11 +18,12 @@ export function defaultEnv( fsoPort: 6662, fio1Port: 6663, fio2Port: 6666, + dpoPort: 6670, }, ): void { const logger = getLogger('defaultEnv'); logger.info(`Env config: ${JSON.stringify(envConfig)}`); - const { froPort, fsoPort, strPort, fio1Port, fio2Port } = envConfig; + const { froPort, fsoPort, strPort, fio1Port, fio2Port, dpoPort } = envConfig; // BLOCKCHAIN PARAMETERS if (!process.env['BLOCKCHAIN_USE_MOCK']) { @@ -77,6 +79,7 @@ export function defaultEnv( process.env['STR_GQL_URL'] = `http://localhost:${strPort}/graphql`; process.env['FSO_GQL_URL'] = `http://localhost:${fsoPort}/graphql`; process.env['API_FRO_GQL_EP'] = `http://localhost:${froPort}/graphql`; + process.env['API_DPO_GQL_EP'] = `http://localhost:${dpoPort}/graphql`; // BUSINESS CONFIGURATION process.env['LEI_FORGE'] = '969500FX8K40ZDW4F377'; diff --git a/packages/cast/oracles/integration/utils/setupEnv.ts b/packages/cast/oracles/integration/utils/setupEnv.ts index a22a599..e4fc25d 100644 --- a/packages/cast/oracles/integration/utils/setupEnv.ts +++ b/packages/cast/oracles/integration/utils/setupEnv.ts @@ -130,6 +130,7 @@ export async function setupEnv(params: EnvParams): Promise { const FIO1_PORT = await getPort({ port: 6663 }); const FIO2_PORT = await getPort({ port: 6663 }); const FIO3_PORT = await getPort({ port: 6667 }); + const DPO_PORT = await getPort({ port: 6670 }); const dbName = randomDbEnv( { @@ -138,6 +139,7 @@ export async function setupEnv(params: EnvParams): Promise { froPort: FRO_PORT, fio1Port: FIO1_PORT, fio2Port: FIO2_PORT, + dpoPort: DPO_PORT, }, params.name, ); diff --git a/packages/cast/oracles/schema/config.graphql b/packages/cast/oracles/schema/config.graphql new file mode 100644 index 0000000..6e3cbf2 --- /dev/null +++ b/packages/cast/oracles/schema/config.graphql @@ -0,0 +1,296 @@ +type InstrumentPosition { + instrumentAddress: String! + ledger: Ledger! + balance: Float! + legalEntityAddress: String! + symbol: String! + valueInFiat: Float! + currency: Currency! + percentage: Float + unlocked: Float + locked: Float +} + +enum Ledger { + ETHEREUM + TEZOS +} + +enum Currency { + EUR +} + +type InstrumentDetails { + issuer: String! + registrarAgentAddress: String! + settlerAgentAddress: String! + contractAddress: String! + initialSupply: Float! + isinCode: String! + name: String! + symbol: String! + denomination: Float! + divisor: Float! + startDate: Float! + maturityDate: Float! + firstCouponDate: Float! + couponFrequencyInMonths: Float! + interestRateInBips: Float! + callable: Boolean! + isSoftBullet: Boolean! + softBulletPeriodInMonths: Float! + type: String! +} + +type SettlementTransactionParticipantAddresses { + securityDeliverer: String! + securityReceiver: String! + securityIssuer: String! + settler: String! + registrar: String! +} + +type LightSettlementTransaction { + id: String! + participantAccountNumbers: SettlementTransactionParticipantAddresses! +} + +type ContractNotification { + notificationName: ContractNotificationName! + instrumentAddress: String! + transactionHash: ID + lightSettlementTransactions: [LightSettlementTransaction!]! + settlementTransactionOperationType: String! +} + +enum ContractNotificationName { + SubscriptionInitiated + TradeInitiated + RedemptionInitiated + PaymentReceived + PaymentTransferred + Transfer + SettlementTransactionCanceled +} + +type ErrorNotification { + notificationName: ErrorNotificationName! + transactionHash: ID! + message: String +} + +enum ErrorNotificationName { + Error +} + +type LedgerBlockInfo { + ledger: Ledger! + blockNumber: Float! + blockHash: String! +} + +type HeartbeatNotification { + notificationName: HeartbeatNotificationName! + timestamp: Float! + blockInfos: [LedgerBlockInfo!]! +} + +enum HeartbeatNotificationName { + Heartbeat +} + +type RegistryNotification { + notificationName: RegistryNotificationName! + instrumentAddress: String! + instrumentLedger: Ledger! + transactionHash: ID +} + +enum RegistryNotificationName { + InstrumentListed + InstrumentUnlisted +} + +type DataProviderNotification { + transactionHash: ID +} + +type STRSettlementTransaction { + id: String! + settlementType: SettlementTransactionType! + settlementDate: DateTime! + operationId: String! + instrumentPublicAddress: String! + instrumentLedger: Ledger! + deliveryQuantity: Float! + deliverySenderAccountNumber: String! + deliveryReceiverAccountNumber: String! + paymentAmount: Float! + paymentCurrency: Currency! + paymentReceiverAccountNumber: String! + paymentSenderAccountNumber: String! + paymentSenderLegalEntityId: String! + paymentReceiverLegalEntityId: String! + movements: [Movement!]! + hash: String! + tradeId: String + tradeDate: DateTime! + additionalReaderAddresses: [String!] + settlementModel: SettlementModel! + holdableTokenAddress: String + intermediateAccountIBAN: String +} + +enum SettlementTransactionType { + DVP + PFOD + DWP + FOP +} + +""" +A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format. +""" +scalar DateTime + +enum SettlementModel { + DIRECT + INDIRECT +} + +type OracleSettlementTransaction { + id: String! + settlementType: SettlementTransactionType! + settlementDate: DateTime! + operationId: String! + instrumentPublicAddress: String! + instrumentLedger: Ledger! + deliveryQuantity: Float! + deliverySenderAccountNumber: String! + deliveryReceiverAccountNumber: String! + paymentAmount: Float! + paymentCurrency: Currency! + paymentReceiverAccountNumber: String! + paymentSenderAccountNumber: String! + paymentSenderLegalEntityId: String! + paymentReceiverLegalEntityId: String! + movements: [Movement!]! + hash: String! + tradeId: String + tradeDate: DateTime! + additionalReaderAddresses: [String!] + settlementModel: SettlementModel! + holdableTokenAddress: String + intermediateAccountIBAN: String + settlementStatus: SettlementTransactionStatus! +} + +enum SettlementTransactionStatus { + INITIATED + PENDING + ACKNOWLEDGED + REJECTED + UNPROCESSED + PROCESSED + SETTLED + CANCELED +} + +type Movement { + id: String! + settlementTransactions: [STRSettlementTransaction!]! + movementType: MovementType! + senderAccountNumber: String! + receiverAccountNumber: String! + paymentReference: String +} + +enum MovementType { + CASH + TOKEN +} + +type TransactionDetails { + to: String! + methodName: String + methodParameters: String + value: Float +} + +type BlockchainEvent { + eventName: String! + smartContractAddress: String! + blockNumber: Float! + blockHash: String! + transactionId: String! + payload: String! +} + +type TransactionInfo { + id: String! + nonce: Float! + status: TransactionStatus! + lastStatusTimestamp: DateTime! + blockNumber: Float + sendTimestamp: DateTime + sendBlockNumber: Float + replacedTransactionId: String + replacementTransactionId: String + details: TransactionDetails + currentError: String + emittedEvents: [BlockchainEvent!] + blockchainSpecificTransactionInfo: BlockchainSpecificTransactionInfo +} + +enum TransactionStatus { + PENDING + CONFIRMED + REJECTED + CANCELLED +} + +union BlockchainSpecificTransactionInfo = EthereumSpecificTransactionInfo | TezosSpecificTransactionInfo + +type EthereumSpecificTransactionInfo { + gasLimit: Float + gasPrice: Float +} + +type TezosSpecificTransactionInfo { + weNeedAtLeastOneFieldForGraphql: String +} + +type Query { + getSettlementTransactions(instrumentLedger: Ledger, instrumentAddress: String): [OracleSettlementTransaction!]! + getSettlementTransactionsByPaymentReference(paymentReference: String): [OracleSettlementTransaction!]! + whoami(ledger: Ledger!): String! + getSettlementTransaction(id: String!): OracleSettlementTransaction + getAllInstruments(ledger: Ledger!): [String!] + getInstrumentDetails(instrumentLedger: Ledger!, contractAddress: String!): InstrumentDetails! + getTransactionInfo(transactionId: String!, ledger: Ledger!): TransactionInfo! + getInstrumentPositions(ledger: Ledger!, instrumentAddress: String!): [InstrumentPosition!]! + getInstrumentPosition(legalEntityAddress: String!, ledger: Ledger!, instrumentAddress: String!): [InstrumentPosition!]! +} + +type Mutation { + boostTransaction(tezosSpecificParams: TezosSpecificParams, ethereumSpecificParams: EthereumSpecificParams, transactionId: String!, ledger: Ledger!): String! + cancelTransaction(tezosSpecificParams: TezosSpecificParams, ethereumSpecificParams: EthereumSpecificParams, transactionId: String!, ledger: Ledger!): String! +} + +input TezosSpecificParams { + eventSinkProperty: String +} + +input EthereumSpecificParams { + gasPrice: Float + gasLimit: Float +} + +type Subscription { + contractNotification: ContractNotification + contractNotificationForInstrumentAddress(instrumentAddress: String!): ContractNotification + errorNotification: ErrorNotification + heartbeatNotification: HeartbeatNotification + registryNotification: RegistryNotification + dpoNotification: DataProviderNotification +} diff --git a/packages/cast/oracles/schema/dpo.graphql b/packages/cast/oracles/schema/dpo.graphql new file mode 100644 index 0000000..2089199 --- /dev/null +++ b/packages/cast/oracles/schema/dpo.graphql @@ -0,0 +1,298 @@ +type InstrumentPosition { + instrumentAddress: String! + ledger: Ledger! + balance: Float! + legalEntityAddress: String! + symbol: String! + valueInFiat: Float! + currency: Currency! + percentage: Float + unlocked: Float + locked: Float +} + +enum Ledger { + ETHEREUM + TEZOS +} + +enum Currency { + EUR +} + +type InstrumentDetails { + issuer: String! + registrarAgentAddress: String! + settlerAgentAddress: String! + contractAddress: String! + initialSupply: Float! + isinCode: String! + name: String! + symbol: String! + denomination: Float! + divisor: Float! + startDate: Float! + maturityDate: Float! + firstCouponDate: Float! + couponFrequencyInMonths: Float! + interestRateInBips: Float! + callable: Boolean! + isSoftBullet: Boolean! + softBulletPeriodInMonths: Float! + type: String! +} + +type SettlementTransactionParticipantAddresses { + securityDeliverer: String! + securityReceiver: String! + securityIssuer: String! + settler: String! + registrar: String! +} + +type LightSettlementTransaction { + id: String! + participantAccountNumbers: SettlementTransactionParticipantAddresses! +} + +type ContractNotification { + notificationName: ContractNotificationName! + instrumentAddress: String! + transactionHash: ID + lightSettlementTransactions: [LightSettlementTransaction!]! + settlementTransactionOperationType: String! +} + +enum ContractNotificationName { + SubscriptionInitiated + TradeInitiated + RedemptionInitiated + PaymentReceived + PaymentTransferred + Transfer + SettlementTransactionCanceled +} + +type ErrorNotification { + notificationName: ErrorNotificationName! + transactionHash: ID! + message: String +} + +enum ErrorNotificationName { + Error +} + +type LedgerBlockInfo { + ledger: Ledger! + blockNumber: Float! + blockHash: String! +} + +type HeartbeatNotification { + notificationName: HeartbeatNotificationName! + timestamp: Float! + blockInfos: [LedgerBlockInfo!]! +} + +enum HeartbeatNotificationName { + Heartbeat +} + +type RegistryNotification { + notificationName: RegistryNotificationName! + instrumentAddress: String! + instrumentLedger: Ledger! + transactionHash: ID +} + +enum RegistryNotificationName { + InstrumentListed + InstrumentUnlisted +} + +type DataProviderNotification { + transactionHash: ID +} + +type STRSettlementTransaction { + id: String! + settlementType: SettlementTransactionType! + settlementDate: DateTime! + operationId: String! + instrumentPublicAddress: String! + instrumentLedger: Ledger! + deliveryQuantity: Float! + deliverySenderAccountNumber: String! + deliveryReceiverAccountNumber: String! + paymentAmount: Float! + paymentCurrency: Currency! + paymentReceiverAccountNumber: String! + paymentSenderAccountNumber: String! + paymentSenderLegalEntityId: String! + paymentReceiverLegalEntityId: String! + movements: [Movement!]! + hash: String! + tradeId: String + tradeDate: DateTime! + additionalReaderAddresses: [String!] + settlementModel: SettlementModel! + holdableTokenAddress: String + intermediateAccountIBAN: String +} + +enum SettlementTransactionType { + DVP + PFOD + DWP + FOP +} + +""" +A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format. +""" +scalar DateTime + +enum SettlementModel { + DIRECT + INDIRECT +} + +type OracleSettlementTransaction { + id: String! + settlementType: SettlementTransactionType! + settlementDate: DateTime! + operationId: String! + instrumentPublicAddress: String! + instrumentLedger: Ledger! + deliveryQuantity: Float! + deliverySenderAccountNumber: String! + deliveryReceiverAccountNumber: String! + paymentAmount: Float! + paymentCurrency: Currency! + paymentReceiverAccountNumber: String! + paymentSenderAccountNumber: String! + paymentSenderLegalEntityId: String! + paymentReceiverLegalEntityId: String! + movements: [Movement!]! + hash: String! + tradeId: String + tradeDate: DateTime! + additionalReaderAddresses: [String!] + settlementModel: SettlementModel! + holdableTokenAddress: String + intermediateAccountIBAN: String + settlementStatus: SettlementTransactionStatus! +} + +enum SettlementTransactionStatus { + INITIATED + PENDING + ACKNOWLEDGED + REJECTED + UNPROCESSED + PROCESSED + SETTLED + CANCELED +} + +type Movement { + id: String! + settlementTransactions: [STRSettlementTransaction!]! + movementType: MovementType! + senderAccountNumber: String! + receiverAccountNumber: String! + paymentReference: String +} + +enum MovementType { + CASH + TOKEN +} + +type TransactionDetails { + to: String! + methodName: String + methodParameters: String + value: Float +} + +type BlockchainEvent { + eventName: String! + smartContractAddress: String! + blockNumber: Float! + blockHash: String! + transactionId: String! + payload: String! +} + +type TransactionInfo { + id: String! + nonce: Float! + status: TransactionStatus! + lastStatusTimestamp: DateTime! + blockNumber: Float + sendTimestamp: DateTime + sendBlockNumber: Float + replacedTransactionId: String + replacementTransactionId: String + details: TransactionDetails + currentError: String + emittedEvents: [BlockchainEvent!] + blockchainSpecificTransactionInfo: BlockchainSpecificTransactionInfo +} + +enum TransactionStatus { + PENDING + CONFIRMED + REJECTED + CANCELLED +} + +union BlockchainSpecificTransactionInfo = EthereumSpecificTransactionInfo | TezosSpecificTransactionInfo + +type EthereumSpecificTransactionInfo { + gasLimit: Float + gasPrice: Float +} + +type TezosSpecificTransactionInfo { + weNeedAtLeastOneFieldForGraphql: String +} + +type Query { + test: String! + getSettlementTransactions(instrumentLedger: Ledger, instrumentAddress: String): [OracleSettlementTransaction!]! + getSettlementTransactionsByPaymentReference(paymentReference: String): [OracleSettlementTransaction!]! + whoami(ledger: Ledger!): String! + getSettlementTransaction(id: String!): OracleSettlementTransaction + getAllInstruments(ledger: Ledger!): [String!] + getInstrumentDetails(instrumentLedger: Ledger!, contractAddress: String!): InstrumentDetails! + getTransactionInfo(transactionId: String!, ledger: Ledger!): TransactionInfo! + getInstrumentPositions(ledger: Ledger!, instrumentAddress: String!): [InstrumentPosition!]! + getInstrumentPosition(legalEntityAddress: String!, ledger: Ledger!, instrumentAddress: String!): [InstrumentPosition!]! +} + +type Mutation { + dataRequest(contractAddress: String!): String! + boostTransaction(tezosSpecificParams: TezosSpecificParams, ethereumSpecificParams: EthereumSpecificParams, transactionId: String!, ledger: Ledger!): String! + cancelTransaction(tezosSpecificParams: TezosSpecificParams, ethereumSpecificParams: EthereumSpecificParams, transactionId: String!, ledger: Ledger!): String! +} + +input TezosSpecificParams { + eventSinkProperty: String +} + +input EthereumSpecificParams { + gasPrice: Float + gasLimit: Float +} + +type Subscription { + contractNotification: ContractNotification + contractNotificationForInstrumentAddress(instrumentAddress: String!): ContractNotification + errorNotification: ErrorNotification + heartbeatNotification: HeartbeatNotification + registryNotification: RegistryNotification + dpoNotification: DataProviderNotification +} diff --git a/packages/cast/oracles/schema/fio.graphql b/packages/cast/oracles/schema/fio.graphql index d596660..b285d37 100644 --- a/packages/cast/oracles/schema/fio.graphql +++ b/packages/cast/oracles/schema/fio.graphql @@ -111,6 +111,10 @@ enum RegistryNotificationName { InstrumentUnlisted } +type DataProviderNotification { + transactionHash: ID +} + type STRSettlementTransaction { id: String! settlementType: SettlementTransactionType! @@ -289,4 +293,5 @@ type Subscription { errorNotification: ErrorNotification heartbeatNotification: HeartbeatNotification registryNotification: RegistryNotification + dpoNotification: DataProviderNotification } diff --git a/packages/cast/oracles/schema/fro.graphql b/packages/cast/oracles/schema/fro.graphql index 7c71b29..c0a2fb3 100644 --- a/packages/cast/oracles/schema/fro.graphql +++ b/packages/cast/oracles/schema/fro.graphql @@ -111,6 +111,10 @@ enum RegistryNotificationName { InstrumentUnlisted } +type DataProviderNotification { + transactionHash: ID +} + type STRSettlementTransaction { id: String! settlementType: SettlementTransactionType! @@ -444,4 +448,5 @@ type Subscription { errorNotification: ErrorNotification heartbeatNotification: HeartbeatNotification registryNotification: RegistryNotification + dpoNotification: DataProviderNotification } diff --git a/packages/cast/oracles/schema/fso.graphql b/packages/cast/oracles/schema/fso.graphql index cb94029..6f3cb2e 100644 --- a/packages/cast/oracles/schema/fso.graphql +++ b/packages/cast/oracles/schema/fso.graphql @@ -111,6 +111,10 @@ enum RegistryNotificationName { InstrumentUnlisted } +type DataProviderNotification { + transactionHash: ID +} + type STRSettlementTransaction { id: String! settlementType: SettlementTransactionType! @@ -291,4 +295,5 @@ type Subscription { errorNotification: ErrorNotification heartbeatNotification: HeartbeatNotification registryNotification: RegistryNotification + dpoNotification: DataProviderNotification } diff --git a/packages/cast/oracles/schema/fxo.graphql b/packages/cast/oracles/schema/fxo.graphql index 702796e..6e3cbf2 100644 --- a/packages/cast/oracles/schema/fxo.graphql +++ b/packages/cast/oracles/schema/fxo.graphql @@ -111,6 +111,10 @@ enum RegistryNotificationName { InstrumentUnlisted } +type DataProviderNotification { + transactionHash: ID +} + type STRSettlementTransaction { id: String! settlementType: SettlementTransactionType! @@ -288,4 +292,5 @@ type Subscription { errorNotification: ErrorNotification heartbeatNotification: HeartbeatNotification registryNotification: RegistryNotification + dpoNotification: DataProviderNotification } diff --git a/packages/cast/oracles/src/app.dyno.module.ts b/packages/cast/oracles/src/app.dyno.module.ts index 064be91..4a98b9f 100644 --- a/packages/cast/oracles/src/app.dyno.module.ts +++ b/packages/cast/oracles/src/app.dyno.module.ts @@ -12,6 +12,7 @@ import { FIOModule } from './modules/fio/fio.module'; import { FROModule } from './modules/fro/fro.module'; import { FSOModule } from './modules/fso/fso.module'; import { STRModule } from './modules/str/str.module'; +import { DataProviderModule } from './modules/dpo/dataProvider.module'; import { SharedModule } from './shared.module'; import { Mode } from './mode'; import { LoggerOptions } from 'typeorm/logger/LoggerOptions'; @@ -49,6 +50,10 @@ export class AppModule implements NestModule { imports.push(FIOModule); break; + case Mode.DPO: + imports.push(DataProviderModule); + break; + default: this.logger.error(`Unknown mode requested : ${mode}`); return null; diff --git a/packages/cast/oracles/src/main.ts b/packages/cast/oracles/src/main.ts index 661b8db..8525569 100644 --- a/packages/cast/oracles/src/main.ts +++ b/packages/cast/oracles/src/main.ts @@ -11,7 +11,7 @@ import { patchTypeORMRepositoryWithBaseRepository, } from 'typeorm-transactional-cls-hooked'; -import { ClassSerializerInterceptor, ValidationPipe } from '@nestjs/common'; +import { ValidationPipe } from '@nestjs/common'; import { NestFactory, Reflector } from '@nestjs/core'; import { ExpressAdapter, diff --git a/packages/cast/oracles/src/mode.ts b/packages/cast/oracles/src/mode.ts index d330629..21edc72 100644 --- a/packages/cast/oracles/src/mode.ts +++ b/packages/cast/oracles/src/mode.ts @@ -3,4 +3,5 @@ export const enum Mode { FRO = 'fro', FSO = 'fso', FIO = 'fio', + DPO = 'dpo', } diff --git a/packages/cast/oracles/src/modules/dpo/dataProvider.event.constant.ts b/packages/cast/oracles/src/modules/dpo/dataProvider.event.constant.ts new file mode 100644 index 0000000..9734507 --- /dev/null +++ b/packages/cast/oracles/src/modules/dpo/dataProvider.event.constant.ts @@ -0,0 +1 @@ +export const DATA_REQUEST_NOTIFICATION = 'dataRequestNotification'; diff --git a/packages/cast/oracles/src/modules/dpo/dataProvider.module.ts b/packages/cast/oracles/src/modules/dpo/dataProvider.module.ts new file mode 100644 index 0000000..a9c69cf --- /dev/null +++ b/packages/cast/oracles/src/modules/dpo/dataProvider.module.ts @@ -0,0 +1,10 @@ +import { Module } from '@nestjs/common'; +import { FXOModule } from '../fxo/fxo.module'; +import { DataProviderResolver } from './dataProvider.resolver'; +import { DpoService } from './dataProvider.service'; + +@Module({ + imports: [FXOModule], + providers: [DataProviderResolver, DpoService], +}) +export class DataProviderModule {} diff --git a/packages/cast/oracles/src/modules/dpo/dataProvider.resolver.ts b/packages/cast/oracles/src/modules/dpo/dataProvider.resolver.ts new file mode 100644 index 0000000..49f2db6 --- /dev/null +++ b/packages/cast/oracles/src/modules/dpo/dataProvider.resolver.ts @@ -0,0 +1,20 @@ +import { getLogger, Logger, HandleLogsAndErrors } from '../../utils/logger'; +/* eslint-disable @typescript-eslint/explicit-function-return-type */ + +import { Query, Resolver } from '@nestjs/graphql'; +import * as log4js from 'log4js'; + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +@Resolver(() => String) +export class DataProviderResolver { + private logger: Logger = getLogger(this.constructor.name); + + public constructor() {} + + // At least one query required to generate a schema + @Query(() => String) + @HandleLogsAndErrors(log4js.levels.DEBUG) + public async test(): Promise { + return 'hello, world'; + } +} diff --git a/packages/cast/oracles/src/modules/dpo/dataProvider.service.ts b/packages/cast/oracles/src/modules/dpo/dataProvider.service.ts new file mode 100644 index 0000000..71e3c2d --- /dev/null +++ b/packages/cast/oracles/src/modules/dpo/dataProvider.service.ts @@ -0,0 +1,155 @@ +import axios from 'axios'; +import { Injectable } from '@nestjs/common'; +import { getLogger, Logger } from '../../utils/logger'; +import { + ForgeBondDataRequestEvent, + DataProviderOracle, + Ledger, +} from '@castframework/cast-interface-v1'; +import { ForgePubSub } from '../../utils/PubSub.wrapper'; +import { DataProviderNotification } from '@castframework/models'; +import { DATA_REQUEST_NOTIFICATION } from './dataProvider.event.constant'; +import { errorAsString } from '../../utils/errorAsString'; +import { BlockchainService } from '../../shared/services/blockchain.service'; +import { asyncForEach } from '../../utils/promiseUtils'; + +@Injectable() +export class DpoService { + private logger: Logger = getLogger(this.constructor.name); + private listenedContracts: Set = new Set(); + + public constructor( + private readonly pubSub: ForgePubSub, + private readonly blockchainService: BlockchainService, + ) { + // eslint-disable-next-line @typescript-eslint/no-floating-promises + this.initialize(); + } + + public async initialize(): Promise { + for (const ledger of this.blockchainService.supportedLedgers) { + try { + const instrumentRegistry = + await this.blockchainService.getRegistryFromLedger( + ledger, + this.logger, + ); + + const contractAddressList = + await instrumentRegistry.getAllInstruments(); + + await asyncForEach(contractAddressList, async (contractAddress) => { + await this.subscribeToNewContract(contractAddress, ledger); + }); + } catch (error) { + this.logger.error( + `Error during ledger[${ledger}] initialization : ${errorAsString( + error, + )}`, + ); + } + } + } + + public async subscribeToNewContract( + contractAddress: string, + LedgerType: Ledger, + from?: number, + ): Promise { + if (this.listenedContracts.has(contractAddress)) { + this.logger.debug( + `[${LedgerType}] Already listening to contract ${contractAddress}`, + ); + return; + } + try { + this.listenedContracts.add(contractAddress); + const contract = await this.blockchainService.getDataProviderOracle( + LedgerType, + contractAddress, + ); + this.logger.debug( + `[${LedgerType}] Start listening to events for contract address: ${contractAddress}${ + from ? ` from block ${from}` : '' + }`, + ); + await this.listenContract(contract, LedgerType, from); + } catch (err) { + this.logger.error( + `[${LedgerType}] Error subscribing to contract ${contractAddress}${ + from ? ` from block ${from}` : '' + } : ${errorAsString(err)}`, + ); + this.listenedContracts.delete(contractAddress); + } + } + + private async listenContract( + contract: DataProviderOracle, + LedgerType: Ledger, + from?: number, + ): Promise { + contract.SubmitRequest().subscribe(async (event) => { + try { + this.logger.debug( + `[${LedgerType}] Received event[${JSON.stringify(event)}]`, + ); + if (event) { + await this.handleSubmitRequestEvent(event, LedgerType); + } + } catch (err) { + this.logger.error( + `[${LedgerType}] Error handling event[${JSON.stringify( + event, + )}] error[${errorAsString(err)}]`, + ); + } + }); + } + + async handleSubmitRequestEvent( + event: ForgeBondDataRequestEvent, + ledger: Ledger, + ): Promise { + const logger = getLogger(this.constructor.name, 'handleSubmitRequestEvent'); + + logger.info( + `Received ${event.eventName} event on ${ledger} for instrument ${event.smartContractAddress} with transaction hash ${event.transactionId}`, + ); + + const mockResponse = await axios.get('http://demo4607115.mockable.io/'); + + const dataProviderOracle = + await this.blockchainService.getDataProviderOracle( + ledger, + event.smartContractAddress, + ); + + const DECIMAL_CONVERSION = 6; + + await dataProviderOracle.WriteResult( + event.payload.id, + mockResponse.data.value, + DECIMAL_CONVERSION, + mockResponse.data.timestamp, + ); + + logger.debug( + `Received ${event.eventName} event on ${ledger} for instrument ${event.smartContractAddress} with transaction hash ${event.transactionId}`, + JSON.stringify(event), + ); + + const notification = new DataProviderNotification('exampleTransactionHash'); + + await this.pubSub.publish(DATA_REQUEST_NOTIFICATION, notification); + } + + public async dataRequest(contractAddress: string): Promise { + const bond = await this.blockchainService.getForgeBond( + Ledger.ETHEREUM, + contractAddress, + ); + const data = await bond.RequestData(); + return data.transactionId; + } +} diff --git a/packages/cast/oracles/src/modules/fro/fro.resolver.ts b/packages/cast/oracles/src/modules/fro/fro.resolver.ts index ff6c152..b15b70b 100644 --- a/packages/cast/oracles/src/modules/fro/fro.resolver.ts +++ b/packages/cast/oracles/src/modules/fro/fro.resolver.ts @@ -17,6 +17,7 @@ import { EVENT_PLATFORM_LEVEL_PREPARED } from './fro.event.constant'; import { FroService } from './fro.service'; import { FroRedemptionService } from './fro.redemption.service'; import { FroOperationService } from './fro.operation.service'; +import { DpoService } from '../dpo/dataProvider.service'; @Resolver(() => String) export class FROResolver { @@ -27,6 +28,7 @@ export class FROResolver { private readonly pubSub: ForgePubSub, private readonly froRedemptionService: FroRedemptionService, private readonly froOperationService: FroOperationService, + private readonly dpoService: DpoService; ) {} @Mutation(() => String) @@ -111,4 +113,13 @@ export class FROResolver { ForgeOperationType.TRADE, ); } + + @Mutation(() => String) + @HandleLogsAndErrors(log4js.levels.DEBUG) + public async dataRequest( + @Args('contractAddress') + contractAddress: string, + ): Promise { + return await this.dpoService.dataRequest(contractAddress); + } } diff --git a/packages/cast/oracles/src/modules/fxo/fxo.resolver.ts b/packages/cast/oracles/src/modules/fxo/fxo.resolver.ts index 54ff828..4d3d3c6 100644 --- a/packages/cast/oracles/src/modules/fxo/fxo.resolver.ts +++ b/packages/cast/oracles/src/modules/fxo/fxo.resolver.ts @@ -6,6 +6,7 @@ import { InstrumentDetails, OracleSettlementTransaction, RegistryNotification, + DataProviderNotification, } from '@castframework/models'; import { Args, @@ -45,6 +46,7 @@ import { TezosSpecificTransactionInfo, } from '@castframework/blockchain-driver-tz'; import { HandleLogsAndErrors } from '../../utils/logger'; +import { DATA_REQUEST_NOTIFICATION } from '../dpo/dataProvider.event.constant'; @ObjectType('TransactionDetails') class TransactionDetails { @@ -319,6 +321,21 @@ export class FXOResolver { return result; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + @Subscription((returns) => DataProviderNotification, { + nullable: true, + resolve: (value) => value.dpoNotification, + }) + public dpoNotification(): AsyncIterator { + this.logger.debug(`Received subscription DpoNotification`); + const result: AsyncIterator = + this.pubSub.asyncIterator( + DATA_REQUEST_NOTIFICATION, + ); + this.logger.debug(`subscription DpoNotification: ok`); + return result; + } + @Query((returns) => GraphQLTransactionInfo) @HandleLogsAndErrors(log4js.levels.DEBUG) public async getTransactionInfo( diff --git a/packages/cast/oracles/src/shared/services/blockchain.service.ts b/packages/cast/oracles/src/shared/services/blockchain.service.ts index 845df06..1b12e85 100644 --- a/packages/cast/oracles/src/shared/services/blockchain.service.ts +++ b/packages/cast/oracles/src/shared/services/blockchain.service.ts @@ -13,6 +13,7 @@ import { ForgeTokenFactoryViewMappers, ForgeTokenViewMappers, getAbi, + DataProviderOracle, } from '@castframework/cast-interface-v1'; import { BlockchainDriver, @@ -456,4 +457,34 @@ export class BlockchainService implements OnModuleDestroy { contractBlockchainSpecificParams, ); } + + async getDataProviderOracle( + ledger: Ledger, + address: string, + ): Promise>> { + const transactionManager = this.transactionManagers.get(ledger); + if (transactionManager === undefined) { + throw new Error('No transaction manager found for this ledger'); + } + + let contractBlockchainSpecificParams: Partial< + BlockchainSpecificParamsOf> + > = {}; + + switch (ledger) { + case Ledger.ETHEREUM: + contractBlockchainSpecificParams = { + abi: getAbi(ForgeContractType.ON_DEMAND), + } as BlockchainSpecificParamsOf>; + break; + case Ledger.TEZOS: + this.logger.error('Error: No Tezos Data Provider Oracle'); + break; + } + return new DataProviderOracle( + address, + transactionManager, + contractBlockchainSpecificParams, + ); + } } diff --git a/packages/cast/oracles/src/utils/blockchainUtils.ts b/packages/cast/oracles/src/utils/blockchainUtils.ts index 79acdad..e63a1a9 100644 --- a/packages/cast/oracles/src/utils/blockchainUtils.ts +++ b/packages/cast/oracles/src/utils/blockchainUtils.ts @@ -1,7 +1,22 @@ +import * as fs from 'fs'; import { Ledger } from '@castframework/models'; - +import { + addHexPrefix, + bufferToHex, + privateToAddress, + toBuffer, +} from 'ethereumjs-util'; import Web3Utils = require('web3-utils'); import { validateContractAddress, ValidationResult } from '@taquito/utils'; +import { ForgeContractType } from '@castframework/cast-interface-v1'; + +type KeysFile = Record; +type ContractsFile = { + ExampleERC20: string; +}; +type NodeFile = { + host: string; +}; export function validateLedgerContractAddress( address: string, @@ -16,3 +31,100 @@ export function validateLedgerContractAddress( throw new Error(`Ledger ${ledger} not handled`); } } + +export function getEthAddress(privateKey: string): string { + return addHexPrefix(bufferToHex(privateToAddress(toBuffer(privateKey)))); // nearly ready for lisp eh ? +} + +export function getEthPrivateKey(account: string): string { + const { networkFolder } = getEnvProcess(); + + const keysFilePath = `${networkFolder}/ethereum/keys.json`; + let keysFile: unknown; + try { + keysFile = JSON.parse(fs.readFileSync(keysFilePath, 'utf8')); + } catch { + throw new Error(`Error while reading keys file ${keysFilePath}`); + } + + if (!isKeysFileValid(keysFile)) { + throw new Error(`Invalid contracts file at ${keysFilePath}`); + } + + if (!keysFile[account]) { + throw new Error(`No account for ${account} in keys file ${keysFilePath}`); + } + return keysFile[account]; +} + +export function getEnvProcess() { + const networkFolder = process.env.NETWORK_FOLDER; + if (networkFolder === undefined) { + throw new Error('Envrionment variable NETWORK_FOLDER must be set'); + } + return { networkFolder }; +} + +export function isKeysFileValid(keysFile: unknown): keysFile is KeysFile { + if ( + keysFile === null || + !(typeof keysFile === 'object' || typeof keysFile === 'function') || + Array.isArray(keysFile) + ) { + return false; + } + + // TODO: check if every value of keysFile is a string + return true; +} + +export function getEthExampleContractAddress( + contractType: ForgeContractType, +): string { + const { networkFolder } = getEnvProcess(); + const contractFilePath = `${networkFolder}/ethereum/contracts.json`; + let contractFile: unknown; + try { + contractFile = JSON.parse(fs.readFileSync(contractFilePath, 'utf8')); + } catch { + throw new Error(`Error while reading contracts file ${contractFilePath}`); + } + if (!isContractsFileValid(contractFile, contractType)) { + throw new Error(`Invalid contracts file at ${contractFilePath}`); + } + return contractFile[contractType]; +} + +export function isContractsFileValid( + contractFile: any, + contractType: ForgeContractType, +): contractFile is ContractsFile { + return ( + (contractFile as any)[contractType] !== undefined && + typeof (contractFile as any)[contractType] === 'string' + ); +} + +export function getEthNodeUrl(): string { + const { networkFolder } = getEnvProcess(); + const nodeFilePath = `${networkFolder}/ethereum/node.json`; + let nodeFile: unknown; + try { + nodeFile = JSON.parse(fs.readFileSync(nodeFilePath, 'utf8')); + } catch { + throw new Error(`Error while reading node file ${nodeFilePath}`); + } + + if (!isNodeFileValid(nodeFile)) { + throw new Error(`Invalid node file at ${nodeFilePath}`); + } + + return nodeFile.host; +} + +export function isNodeFileValid(nodeFile: unknown): nodeFile is NodeFile { + return ( + (nodeFile as any).host !== undefined && + typeof (nodeFile as any).host === 'string' + ); +} From 543e620c108c70bcff3af89ad49eb153909e8ca5 Mon Sep 17 00:00:00 2001 From: Sterling Date: Thu, 18 Aug 2022 16:40:11 +0200 Subject: [PATCH 2/5] fix --- package-lock.json | 1169 ++++++++--------- package.json | 6 +- packages/cast/oracles/schema/dpo.graphql | 1 - .../oracles/src/modules/fro/fro.resolver.ts | 10 - 4 files changed, 571 insertions(+), 615 deletions(-) diff --git a/package-lock.json b/package-lock.json index 948a104..53e7a19 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,9 +17,9 @@ "@nestjs/platform-express": "8.2.3", "@nestjs/schedule": "^1.0.2", "@nestjs/typeorm": "^8.0.2", - "@nrwl/cli": "^13.9.6", - "@nrwl/tao": "^13.9.6", - "@nrwl/workspace": "^13.9.6", + "@nrwl/cli": "^13.10.6", + "@nrwl/tao": "^13.10.6", + "@nrwl/workspace": "^13.10.6", "@openzeppelin/contracts": "4.4.0", "@taquito/signer": "^11.0.2", "@taquito/taquito": "^11.0.2", @@ -439,8 +439,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.16.7", - "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz", + "integrity": "sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w==", "engines": { "node": ">=6.9.0" } @@ -814,11 +815,11 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz", - "integrity": "sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz", + "integrity": "sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.18.6" }, "engines": { "node": ">=6.9.0" @@ -18539,6 +18540,17 @@ "node": ">=10.10.0" } }, + "node_modules/@humanwhocodes/gitignore-to-minimatch": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz", + "integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==", + "optional": true, + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/object-schema": { "version": "1.2.1", "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", @@ -18670,9 +18682,9 @@ } }, "node_modules/@jest/console/node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "node_modules/@jest/console/node_modules/jest-util": { "version": "27.5.1", @@ -18721,9 +18733,9 @@ } }, "node_modules/@jest/fake-timers/node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "node_modules/@jest/fake-timers/node_modules/jest-util": { "version": "27.5.1", @@ -18893,9 +18905,9 @@ } }, "node_modules/@jest/transform/node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "node_modules/@jest/transform/node_modules/jest-regex-util": { "version": "27.5.1", @@ -24156,24 +24168,26 @@ } }, "node_modules/@nrwl/cli": { - "version": "13.9.6", - "resolved": "https://registry.npmjs.org/@nrwl/cli/-/cli-13.9.6.tgz", - "integrity": "sha512-TWsk0gqzGUzpKr6yd6YtnKAMYHqazhejNR0y/bIVqi3xgStQQ+O7SdHHyOe0ocZSyczg+61I0FHJNyTq7+D6PQ==", + "version": "13.10.6", + "resolved": "https://registry.npmjs.org/@nrwl/cli/-/cli-13.10.6.tgz", + "integrity": "sha512-gIYriCFaPeAJqO+1gdrDg+Zrflrq3drc5sJMkiIZkoNPNVcRQ/HeqiTskJk5XwHH2wl/jnm9OCFC7qowyTTE4Q==", "dependencies": { - "nx": "13.9.6" + "nx": "13.10.6" } }, "node_modules/@nrwl/devkit": { - "version": "13.9.6", - "resolved": "https://registry.npmjs.org/@nrwl/devkit/-/devkit-13.9.6.tgz", - "integrity": "sha512-/adE4Fp2cKxwPbBt4tQXEtqKU+u1Cs2sLbT22aR9SqzP1bucAZHYYbaGRhncMrM5BEyTeyVXWlvZHSjZWUQjRw==", + "version": "13.10.6", + "resolved": "https://registry.npmjs.org/@nrwl/devkit/-/devkit-13.10.6.tgz", + "integrity": "sha512-oxL+r9pGguFwl//iuIyPih8mxFwYjYmPY7K8coPoucLCIwKWAnp1B8T5LEMlZh58VaYEQFaGUnuILdVrK1s4pA==", "dependencies": { "ejs": "^3.1.5", "ignore": "^5.0.4", - "nx": "13.9.6", "rxjs": "^6.5.4", "semver": "7.3.4", "tslib": "^2.3.0" + }, + "peerDependencies": { + "nx": ">= 13.10 <= 15" } }, "node_modules/@nrwl/devkit/node_modules/rxjs": { @@ -24207,13 +24221,13 @@ } }, "node_modules/@nrwl/jest": { - "version": "13.9.6", - "resolved": "https://registry.npmjs.org/@nrwl/jest/-/jest-13.9.6.tgz", - "integrity": "sha512-KYv98x73EApVzLRpzjoHxIF3FaZYuVXwKDO9ClqaBEDH27OOZTQrxW71fnfpezDNZKxtT+eqIzlP0sUDA3ZvrA==", + "version": "13.10.6", + "resolved": "https://registry.npmjs.org/@nrwl/jest/-/jest-13.10.6.tgz", + "integrity": "sha512-Mw3+yWQUxMY6ljADV84LaNWWX7w0R53FBem8RGPfRMsxP6YHej3sUAJbZDZVP3XVj5lD2I/k5Y+rbW1aEW4SQg==", "dependencies": { "@jest/reporters": "27.2.2", "@jest/test-result": "27.2.2", - "@nrwl/devkit": "13.9.6", + "@nrwl/devkit": "13.10.6", "chalk": "4.1.0", "identity-obj-proxy": "3.0.0", "jest-config": "27.2.2", @@ -24256,25 +24270,24 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, "node_modules/@nrwl/tao": { - "version": "13.9.6", - "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-13.9.6.tgz", - "integrity": "sha512-TcOV9fCwRA+JUX3WK1OTUM1WTa0DZnyz970Q/AJogpqbbuzjUzCzCVHbJVbt3rVNqjoVYeDoUroQ9SDHMez6tQ==", + "version": "13.10.6", + "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-13.10.6.tgz", + "integrity": "sha512-KPdroDsc0OMnVpY8zWN6jZAro0DuN4xHBMd/L4/W242mU7XRbDUFJL3VIHYyqpHeIToi90fMu+PDBDesiS2nMg==", "dependencies": { - "nx": "13.9.6" + "nx": "13.10.6" }, "bin": { "tao": "index.js" } }, "node_modules/@nrwl/workspace": { - "version": "13.9.6", - "resolved": "https://registry.npmjs.org/@nrwl/workspace/-/workspace-13.9.6.tgz", - "integrity": "sha512-C/cF0++hY2+i6SOfZZIq5r3M8RdMT2F068figJ+Xt4FwNuF/eMxhMTXgxTMnPLUEIuEfff8oO73Och6WVid24g==", - "hasInstallScript": true, + "version": "13.10.6", + "resolved": "https://registry.npmjs.org/@nrwl/workspace/-/workspace-13.10.6.tgz", + "integrity": "sha512-BtAlkNdf+cxcq65Trpo+ob5ez7fVDVTUGnlIyIPQ33p5Ge4sp9/0zTlUTBSJRusyLYAIHhpRTGf7w/WcV063/Q==", "dependencies": { - "@nrwl/devkit": "13.9.6", - "@nrwl/jest": "13.9.6", - "@nrwl/linter": "13.9.6", + "@nrwl/devkit": "13.10.6", + "@nrwl/jest": "13.10.6", + "@nrwl/linter": "13.10.6", "@parcel/watcher": "2.0.4", "chalk": "4.1.0", "chokidar": "^3.5.1", @@ -24289,14 +24302,14 @@ "ignore": "^5.0.4", "minimatch": "3.0.4", "npm-run-path": "^4.0.1", - "nx": "13.9.6", + "nx": "13.10.6", "open": "^8.4.0", "rxjs": "^6.5.4", "semver": "7.3.4", "tmp": "~0.2.1", "tslib": "^2.3.0", - "yargs": "15.4.1", - "yargs-parser": "20.0.0" + "yargs": "^17.4.0", + "yargs-parser": "21.0.1" }, "peerDependencies": { "prettier": "^2.5.1" @@ -24308,30 +24321,43 @@ } }, "node_modules/@nrwl/workspace/node_modules/@eslint/eslintrc": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", - "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", "optional": true, "peer": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.1", - "globals": "^13.9.0", + "espree": "^9.3.2", + "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@nrwl/workspace/node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "optional": true, + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@nrwl/workspace/node_modules/@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz", + "integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==", "optional": true, "peer": true, "dependencies": { @@ -24344,12 +24370,12 @@ } }, "node_modules/@nrwl/workspace/node_modules/@nrwl/linter": { - "version": "13.9.6", - "resolved": "https://registry.npmjs.org/@nrwl/linter/-/linter-13.9.6.tgz", - "integrity": "sha512-1rZcL3Xr0UElNn6mSyDyFTudz5szefUadGKtctphiiom4rQCp1s75eIN6MaHngDbf7QYtzDgBaK9PUTV71DMNw==", + "version": "13.10.6", + "resolved": "https://registry.npmjs.org/@nrwl/linter/-/linter-13.10.6.tgz", + "integrity": "sha512-c7gtXu4ewjc6ylp0anAt6eaWWxmqrt0CqBfzEK9vYkETN4/WUcr6Y/nNzpnvvhM9PuCEBH7QTizz/r1imRmLJQ==", "dependencies": { - "@nrwl/devkit": "13.9.6", - "@nrwl/jest": "13.9.6", + "@nrwl/devkit": "13.10.6", + "@nrwl/jest": "13.10.6", "@phenomnomnominal/tsquery": "4.1.1", "tmp": "~0.2.1", "tslib": "^2.3.0" @@ -24364,9 +24390,9 @@ } }, "node_modules/@nrwl/workspace/node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", "optional": true, "peer": true, "bin": { @@ -24383,14 +24409,6 @@ "optional": true, "peer": true }, - "node_modules/@nrwl/workspace/node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "engines": { - "node": ">=6" - } - }, "node_modules/@nrwl/workspace/node_modules/chalk": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", @@ -24406,16 +24424,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@nrwl/workspace/node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, "node_modules/@nrwl/workspace/node_modules/dotenv": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", @@ -24424,20 +24432,16 @@ "node": ">=10" } }, - "node_modules/@nrwl/workspace/node_modules/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==" - }, "node_modules/@nrwl/workspace/node_modules/eslint": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.12.0.tgz", - "integrity": "sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==", + "version": "8.22.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.22.0.tgz", + "integrity": "sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA==", "optional": true, "peer": true, "dependencies": { - "@eslint/eslintrc": "^1.2.1", - "@humanwhocodes/config-array": "^0.9.2", + "@eslint/eslintrc": "^1.3.0", + "@humanwhocodes/config-array": "^0.10.4", + "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -24447,14 +24451,17 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.1", + "espree": "^9.3.3", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", "functional-red-black-tree": "^1.0.1", "glob-parent": "^6.0.1", - "globals": "^13.6.0", + "globals": "^13.15.0", + "globby": "^11.1.0", + "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -24463,7 +24470,7 @@ "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "regexpp": "^3.2.0", @@ -24525,19 +24532,35 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@nrwl/workspace/node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "optional": true, + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@nrwl/workspace/node_modules/espree": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", - "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", + "version": "9.3.3", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.3.tgz", + "integrity": "sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng==", "optional": true, "peer": true, "dependencies": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/@nrwl/workspace/node_modules/espree/node_modules/eslint-visitor-keys": { @@ -24550,18 +24573,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@nrwl/workspace/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@nrwl/workspace/node_modules/fs-extra": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", @@ -24606,9 +24617,9 @@ } }, "node_modules/@nrwl/workspace/node_modules/globals": { - "version": "13.13.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", - "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", + "version": "13.17.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", + "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "optional": true, "peer": true, "dependencies": { @@ -24621,14 +24632,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@nrwl/workspace/node_modules/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==", - "engines": { - "node": ">=8" - } - }, "node_modules/@nrwl/workspace/node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -24642,42 +24645,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@nrwl/workspace/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@nrwl/workspace/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@nrwl/workspace/node_modules/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==", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@nrwl/workspace/node_modules/rxjs": { "version": "6.6.7", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", @@ -24708,19 +24675,6 @@ "node": ">=10" } }, - "node_modules/@nrwl/workspace/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@nrwl/workspace/node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -24758,63 +24712,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@nrwl/workspace/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@nrwl/workspace/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" - }, - "node_modules/@nrwl/workspace/node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.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": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@nrwl/workspace/node_modules/yargs-parser": { - "version": "20.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.0.0.tgz", - "integrity": "sha512-8eblPHTL7ZWRkyjIZJjnGf+TijiKJSwA24svzLRVvtgoi/RZiKa9fFQTrlx0OKLnyHSdt/enrdadji6WFfESVA==", - "engines": { - "node": ">=10" - } - }, - "node_modules/@nrwl/workspace/node_modules/yargs/node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", "engines": { - "node": ">=6" + "node": ">=12" } }, "node_modules/@nuxtjs/opencollective": { @@ -29574,9 +29477,9 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.14.2", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.2.tgz", - "integrity": "sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.0.tgz", + "integrity": "sha512-v4Vwdko+pgymgS+A2UIaJru93zQd85vIGWObM5ekZNdXCKtDYqATlEYnWgfo86Q6I1Lh0oXnksDnMU1cwmlPDw==", "dependencies": { "@babel/types": "^7.3.0" } @@ -30296,9 +30199,9 @@ "optional": true }, "node_modules/abab": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", - "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==" + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==" }, "node_modules/abbrev": { "version": "1.1.1", @@ -31454,9 +31357,9 @@ } }, "node_modules/async": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" }, "node_modules/async-each": { "version": "1.0.3", @@ -31726,9 +31629,9 @@ } }, "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz", - "integrity": "sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.0.tgz", + "integrity": "sha512-6Lthe1hqXHBNsqvgDzGO6l03XNeu3CrG4RqQ1KM9+l5+jNGpEJfIELx1NS3SEHmJQA8np/u+E4EPRKRiu6m19A==", "dependencies": { "@babel/core": "^7.12.3", "@babel/parser": "^7.14.7", @@ -32036,7 +31939,6 @@ "node_modules/bl": { "version": "4.1.0", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "devOptional": true, "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -32046,7 +31948,6 @@ "node_modules/bl/node_modules/buffer": { "version": "5.7.1", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "devOptional": true, "funding": [ { "type": "github", @@ -33454,7 +33355,7 @@ "node_modules/co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "engines": { "iojs": ">= 1.0.0", "node": ">= 0.12.0" @@ -35092,9 +34993,9 @@ } }, "node_modules/decimal.js": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", - "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==" + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.0.tgz", + "integrity": "sha512-Nv6ENEzyPQ6AItkGwLE2PGKinZZ9g59vSh2BeH6NqPu0OTKZ5ruJsVqh/orbAnqXc9pBbgXAIrc2EyaCj8NpGg==" }, "node_modules/decode-uri-component": { "version": "0.2.0", @@ -35906,11 +35807,11 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "node_modules/ejs": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.6.tgz", - "integrity": "sha512-9lt9Zse4hPucPkoP7FHDF0LQAlGyF9JVpnClFLFH3aSSbxmyoqINRpp/9wePWJTUl4KOQwRL72Iw3InHPDkoGw==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.8.tgz", + "integrity": "sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==", "dependencies": { - "jake": "^10.6.1" + "jake": "^10.8.5" }, "bin": { "ejs": "bin/cli.js" @@ -36316,7 +36217,7 @@ "node_modules/escodegen/node_modules/levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", "dependencies": { "prelude-ls": "~1.1.2", "type-check": "~0.3.2" @@ -36344,7 +36245,7 @@ "node_modules/escodegen/node_modules/prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", "engines": { "node": ">= 0.8.0" } @@ -36361,7 +36262,7 @@ "node_modules/escodegen/node_modules/type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", "dependencies": { "prelude-ls": "~1.1.2" }, @@ -39030,7 +38931,7 @@ "node_modules/exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", "engines": { "node": ">= 0.8.0" } @@ -39667,11 +39568,30 @@ "devOptional": true }, "node_modules/filelist": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.2.tgz", - "integrity": "sha512-z7O0IS8Plc39rTCq6i6iHxk43duYOn8uFJiWSewIq0Bww1RNybVHSCjahmcC87ZqAm4OTvFzlzeGu3XAzG1ctQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", "dependencies": { - "minimatch": "^3.0.4" + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" } }, "node_modules/filename-regex": { @@ -40083,8 +40003,7 @@ }, "node_modules/fs-constants": { "version": "1.0.0", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, "node_modules/fs-extra": { "version": "10.0.0", @@ -41880,6 +41799,13 @@ "version": "4.2.9", "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==" }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "optional": true, + "peer": true + }, "node_modules/graphql": { "version": "15.8.0", "integrity": "sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==", @@ -43434,7 +43360,7 @@ "node_modules/identity-obj-proxy": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz", - "integrity": "sha1-lNK9qWCERT7zb7xarsN+D3nx/BQ=", + "integrity": "sha512-00n6YnVHKrinT9t0d9+5yZC6UBNJANpYEQvL2LlX6Ab9lnmxzIRcEmTPuyGScvl1+jKuCICX1Z0Ab1pPKKdikA==", "dependencies": { "harmony-reflect": "^1.4.6" }, @@ -45106,11 +45032,11 @@ } }, "node_modules/jake": { - "version": "10.8.4", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.4.tgz", - "integrity": "sha512-MtWeTkl1qGsWUtbl/Jsca/8xSoK3x0UmS82sNbjqxxG/de/M/3b1DntdjHgPMC50enlTNwXOCRqPXLLt5cCfZA==", + "version": "10.8.5", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", + "integrity": "sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==", "dependencies": { - "async": "0.9.x", + "async": "^3.2.3", "chalk": "^4.0.2", "filelist": "^1.0.1", "minimatch": "^3.0.4" @@ -45166,9 +45092,9 @@ } }, "node_modules/jest-circus/node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "node_modules/jest-circus/node_modules/jest-util": { "version": "27.5.1", @@ -45226,9 +45152,9 @@ } }, "node_modules/jest-config/node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "node_modules/jest-config/node_modules/is-ci": { "version": "3.0.1", @@ -45289,9 +45215,9 @@ } }, "node_modules/jest-each/node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "node_modules/jest-each/node_modules/jest-util": { "version": "27.5.1", @@ -45327,9 +45253,9 @@ } }, "node_modules/jest-environment-jsdom/node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "node_modules/jest-environment-jsdom/node_modules/jest-util": { "version": "27.5.1", @@ -45364,9 +45290,9 @@ } }, "node_modules/jest-environment-node/node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "node_modules/jest-environment-node/node_modules/jest-util": { "version": "27.5.1", @@ -45417,9 +45343,9 @@ } }, "node_modules/jest-haste-map/node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "node_modules/jest-haste-map/node_modules/jest-regex-util": { "version": "27.5.1", @@ -45487,9 +45413,9 @@ } }, "node_modules/jest-jasmine2/node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "node_modules/jest-jasmine2/node_modules/jest-util": { "version": "27.5.1", @@ -45651,9 +45577,9 @@ } }, "node_modules/jest-runner/node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "node_modules/jest-runner/node_modules/jest-resolve": { "version": "27.5.1", @@ -45738,9 +45664,9 @@ } }, "node_modules/jest-runtime/node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "node_modules/jest-runtime/node_modules/jest-regex-util": { "version": "27.5.1", @@ -45831,9 +45757,9 @@ } }, "node_modules/jest-snapshot/node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "node_modules/jest-snapshot/node_modules/jest-util": { "version": "27.5.1", @@ -45852,9 +45778,9 @@ } }, "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -45882,9 +45808,9 @@ } }, "node_modules/jest-util/node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "node_modules/jest-util/node_modules/is-ci": { "version": "3.0.1", @@ -46103,9 +46029,9 @@ } }, "node_modules/jsdom/node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", "bin": { "acorn": "bin/acorn" }, @@ -51354,33 +51280,47 @@ "optional": true }, "node_modules/nwsapi": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", - "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==" + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.1.tgz", + "integrity": "sha512-JYOWTeFoS0Z93587vRJgASD5Ut11fYl5NyihP3KrYBvMe1FRRs6RN7m20SA/16GM4P6hTnZjT+UmDOt38UeXNg==" }, "node_modules/nx": { - "version": "13.9.6", - "resolved": "https://registry.npmjs.org/nx/-/nx-13.9.6.tgz", - "integrity": "sha512-mb1tPxpc8LnnRlY2qXPR07X5kMrnUtfwOGJGP12xxauSXIgrqThIt0AGjZXU5UepFeo5Ejb7HpiggALKjqGRgg==", + "version": "13.10.6", + "resolved": "https://registry.npmjs.org/nx/-/nx-13.10.6.tgz", + "integrity": "sha512-kkW1Yy/DE/56XfMqFhMDbM9KAYw2xpSyMdak0ZK7aPnoy/TgZT/PmeHXUzip+GWQYQhLzUD2i/68G3PgFq0YQQ==", + "hasInstallScript": true, "dependencies": { - "@nrwl/cli": "13.9.6", - "@nrwl/tao": "13.9.6", + "@nrwl/cli": "13.10.6", + "@nrwl/tao": "13.10.6", + "@parcel/watcher": "2.0.4", "@swc-node/register": "^1.4.2", - "@swc/core": "^1.2.146", + "@swc/core": "^1.2.152", "chalk": "4.1.0", + "chokidar": "^3.5.1", + "cli-cursor": "3.1.0", + "cli-spinners": "2.6.1", + "dotenv": "~10.0.0", "enquirer": "~2.3.6", "fast-glob": "3.2.7", + "figures": "3.2.0", + "flat": "^5.0.2", "fs-extra": "^9.1.0", + "glob": "7.1.4", "ignore": "^5.0.4", "jsonc-parser": "3.0.0", + "minimatch": "3.0.4", + "npm-run-path": "^4.0.1", + "open": "^8.4.0", "rxjs": "^6.5.4", "rxjs-for-await": "0.0.2", "semver": "7.3.4", + "tar-stream": "~2.2.0", "tmp": "~0.2.1", "tsconfig-paths": "^3.9.0", "tslib": "^2.3.0", "v8-compile-cache": "2.3.0", - "yargs-parser": "20.0.0" + "yargs": "^17.4.0", + "yargs-parser": "21.0.1" }, "bin": { "nx": "bin/nx.js" @@ -51401,6 +51341,14 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/nx/node_modules/dotenv": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", + "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", + "engines": { + "node": ">=10" + } + }, "node_modules/nx/node_modules/fs-extra": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", @@ -51415,6 +51363,22 @@ "node": ">=10" } }, + "node_modules/nx/node_modules/glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, "node_modules/nx/node_modules/rxjs": { "version": "6.6.7", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", @@ -51453,6 +51417,21 @@ "node": ">=10" } }, + "node_modules/nx/node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/nx/node_modules/tmp": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", @@ -51465,11 +51444,11 @@ } }, "node_modules/nx/node_modules/yargs-parser": { - "version": "20.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.0.0.tgz", - "integrity": "sha512-8eblPHTL7ZWRkyjIZJjnGf+TijiKJSwA24svzLRVvtgoi/RZiKa9fFQTrlx0OKLnyHSdt/enrdadji6WFfESVA==", + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/nyc": { @@ -62074,9 +62053,9 @@ } }, "node_modules/v8-to-istanbul/node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", "engines": { "node": ">= 8" } @@ -64892,8 +64871,9 @@ "dev": true }, "node_modules/yargs": { - "version": "17.3.1", - "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", + "version": "17.5.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", + "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -65220,8 +65200,9 @@ } }, "@babel/helper-plugin-utils": { - "version": "7.16.7", - "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==" + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz", + "integrity": "sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w==" }, "@babel/helper-replace-supers": { "version": "7.16.7", @@ -65484,11 +65465,11 @@ } }, "@babel/plugin-syntax-typescript": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz", - "integrity": "sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz", + "integrity": "sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA==", "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.18.6" } }, "@babel/plugin-transform-modules-commonjs": { @@ -79437,6 +79418,13 @@ "minimatch": "^3.0.4" } }, + "@humanwhocodes/gitignore-to-minimatch": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz", + "integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==", + "optional": true, + "peer": true + }, "@humanwhocodes/object-schema": { "version": "1.2.1", "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", @@ -79531,9 +79519,9 @@ }, "dependencies": { "ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "jest-util": { "version": "27.5.1", @@ -79575,9 +79563,9 @@ }, "dependencies": { "ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "jest-util": { "version": "27.5.1", @@ -79717,9 +79705,9 @@ }, "dependencies": { "ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "jest-regex-util": { "version": "27.5.1", @@ -84135,21 +84123,20 @@ } }, "@nrwl/cli": { - "version": "13.9.6", - "resolved": "https://registry.npmjs.org/@nrwl/cli/-/cli-13.9.6.tgz", - "integrity": "sha512-TWsk0gqzGUzpKr6yd6YtnKAMYHqazhejNR0y/bIVqi3xgStQQ+O7SdHHyOe0ocZSyczg+61I0FHJNyTq7+D6PQ==", + "version": "13.10.6", + "resolved": "https://registry.npmjs.org/@nrwl/cli/-/cli-13.10.6.tgz", + "integrity": "sha512-gIYriCFaPeAJqO+1gdrDg+Zrflrq3drc5sJMkiIZkoNPNVcRQ/HeqiTskJk5XwHH2wl/jnm9OCFC7qowyTTE4Q==", "requires": { - "nx": "13.9.6" + "nx": "13.10.6" } }, "@nrwl/devkit": { - "version": "13.9.6", - "resolved": "https://registry.npmjs.org/@nrwl/devkit/-/devkit-13.9.6.tgz", - "integrity": "sha512-/adE4Fp2cKxwPbBt4tQXEtqKU+u1Cs2sLbT22aR9SqzP1bucAZHYYbaGRhncMrM5BEyTeyVXWlvZHSjZWUQjRw==", + "version": "13.10.6", + "resolved": "https://registry.npmjs.org/@nrwl/devkit/-/devkit-13.10.6.tgz", + "integrity": "sha512-oxL+r9pGguFwl//iuIyPih8mxFwYjYmPY7K8coPoucLCIwKWAnp1B8T5LEMlZh58VaYEQFaGUnuILdVrK1s4pA==", "requires": { "ejs": "^3.1.5", "ignore": "^5.0.4", - "nx": "13.9.6", "rxjs": "^6.5.4", "semver": "7.3.4", "tslib": "^2.3.0" @@ -84181,13 +84168,13 @@ } }, "@nrwl/jest": { - "version": "13.9.6", - "resolved": "https://registry.npmjs.org/@nrwl/jest/-/jest-13.9.6.tgz", - "integrity": "sha512-KYv98x73EApVzLRpzjoHxIF3FaZYuVXwKDO9ClqaBEDH27OOZTQrxW71fnfpezDNZKxtT+eqIzlP0sUDA3ZvrA==", + "version": "13.10.6", + "resolved": "https://registry.npmjs.org/@nrwl/jest/-/jest-13.10.6.tgz", + "integrity": "sha512-Mw3+yWQUxMY6ljADV84LaNWWX7w0R53FBem8RGPfRMsxP6YHej3sUAJbZDZVP3XVj5lD2I/k5Y+rbW1aEW4SQg==", "requires": { "@jest/reporters": "27.2.2", "@jest/test-result": "27.2.2", - "@nrwl/devkit": "13.9.6", + "@nrwl/devkit": "13.10.6", "chalk": "4.1.0", "identity-obj-proxy": "3.0.0", "jest-config": "27.2.2", @@ -84225,21 +84212,21 @@ } }, "@nrwl/tao": { - "version": "13.9.6", - "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-13.9.6.tgz", - "integrity": "sha512-TcOV9fCwRA+JUX3WK1OTUM1WTa0DZnyz970Q/AJogpqbbuzjUzCzCVHbJVbt3rVNqjoVYeDoUroQ9SDHMez6tQ==", + "version": "13.10.6", + "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-13.10.6.tgz", + "integrity": "sha512-KPdroDsc0OMnVpY8zWN6jZAro0DuN4xHBMd/L4/W242mU7XRbDUFJL3VIHYyqpHeIToi90fMu+PDBDesiS2nMg==", "requires": { - "nx": "13.9.6" + "nx": "13.10.6" } }, "@nrwl/workspace": { - "version": "13.9.6", - "resolved": "https://registry.npmjs.org/@nrwl/workspace/-/workspace-13.9.6.tgz", - "integrity": "sha512-C/cF0++hY2+i6SOfZZIq5r3M8RdMT2F068figJ+Xt4FwNuF/eMxhMTXgxTMnPLUEIuEfff8oO73Och6WVid24g==", + "version": "13.10.6", + "resolved": "https://registry.npmjs.org/@nrwl/workspace/-/workspace-13.10.6.tgz", + "integrity": "sha512-BtAlkNdf+cxcq65Trpo+ob5ez7fVDVTUGnlIyIPQ33p5Ge4sp9/0zTlUTBSJRusyLYAIHhpRTGf7w/WcV063/Q==", "requires": { - "@nrwl/devkit": "13.9.6", - "@nrwl/jest": "13.9.6", - "@nrwl/linter": "13.9.6", + "@nrwl/devkit": "13.10.6", + "@nrwl/jest": "13.10.6", + "@nrwl/linter": "13.10.6", "@parcel/watcher": "2.0.4", "chalk": "4.1.0", "chokidar": "^3.5.1", @@ -84254,38 +84241,50 @@ "ignore": "^5.0.4", "minimatch": "3.0.4", "npm-run-path": "^4.0.1", - "nx": "13.9.6", + "nx": "13.10.6", "open": "^8.4.0", "rxjs": "^6.5.4", "semver": "7.3.4", "tmp": "~0.2.1", "tslib": "^2.3.0", - "yargs": "15.4.1", - "yargs-parser": "20.0.0" + "yargs": "^17.4.0", + "yargs-parser": "21.0.1" }, "dependencies": { "@eslint/eslintrc": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", - "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", "optional": true, "peer": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.1", - "globals": "^13.9.0", + "espree": "^9.3.2", + "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "optional": true, + "peer": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } } }, "@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz", + "integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==", "optional": true, "peer": true, "requires": { @@ -84295,21 +84294,21 @@ } }, "@nrwl/linter": { - "version": "13.9.6", - "resolved": "https://registry.npmjs.org/@nrwl/linter/-/linter-13.9.6.tgz", - "integrity": "sha512-1rZcL3Xr0UElNn6mSyDyFTudz5szefUadGKtctphiiom4rQCp1s75eIN6MaHngDbf7QYtzDgBaK9PUTV71DMNw==", + "version": "13.10.6", + "resolved": "https://registry.npmjs.org/@nrwl/linter/-/linter-13.10.6.tgz", + "integrity": "sha512-c7gtXu4ewjc6ylp0anAt6eaWWxmqrt0CqBfzEK9vYkETN4/WUcr6Y/nNzpnvvhM9PuCEBH7QTizz/r1imRmLJQ==", "requires": { - "@nrwl/devkit": "13.9.6", - "@nrwl/jest": "13.9.6", + "@nrwl/devkit": "13.10.6", + "@nrwl/jest": "13.10.6", "@phenomnomnominal/tsquery": "4.1.1", "tmp": "~0.2.1", "tslib": "^2.3.0" } }, "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", "optional": true, "peer": true }, @@ -84320,11 +84319,6 @@ "optional": true, "peer": true }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" - }, "chalk": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", @@ -84334,35 +84328,21 @@ "supports-color": "^7.1.0" } }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, "dotenv": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==" }, - "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==" - }, "eslint": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.12.0.tgz", - "integrity": "sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==", + "version": "8.22.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.22.0.tgz", + "integrity": "sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA==", "optional": true, "peer": true, "requires": { - "@eslint/eslintrc": "^1.2.1", - "@humanwhocodes/config-array": "^0.9.2", + "@eslint/eslintrc": "^1.3.0", + "@humanwhocodes/config-array": "^0.10.4", + "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -84372,14 +84352,17 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.1", + "espree": "^9.3.3", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", "functional-red-black-tree": "^1.0.1", "glob-parent": "^6.0.1", - "globals": "^13.6.0", + "globals": "^13.15.0", + "globby": "^11.1.0", + "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -84388,7 +84371,7 @@ "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "regexpp": "^3.2.0", @@ -84404,6 +84387,16 @@ "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "optional": true, "peer": true + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "optional": true, + "peer": true, + "requires": { + "brace-expansion": "^1.1.7" + } } } }, @@ -84429,14 +84422,14 @@ } }, "espree": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", - "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", + "version": "9.3.3", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.3.tgz", + "integrity": "sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng==", "optional": true, "peer": true, "requires": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" }, "dependencies": { @@ -84449,15 +84442,6 @@ } } }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, "fs-extra": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", @@ -84493,20 +84477,15 @@ } }, "globals": { - "version": "13.13.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", - "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", + "version": "13.17.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", + "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "optional": true, "peer": true, "requires": { "type-fest": "^0.20.2" } }, - "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==" - }, "js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -84517,30 +84496,6 @@ "argparse": "^2.0.1" } }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "requires": { - "p-try": "^2.0.0" - } - }, - "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==", - "requires": { - "p-limit": "^2.2.0" - } - }, "rxjs": { "version": "6.6.7", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", @@ -84564,16 +84519,6 @@ "lru-cache": "^6.0.0" } }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -84596,54 +84541,10 @@ "optional": true, "peer": true }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" - }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.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": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "dependencies": { - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, "yargs-parser": { - "version": "20.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.0.0.tgz", - "integrity": "sha512-8eblPHTL7ZWRkyjIZJjnGf+TijiKJSwA24svzLRVvtgoi/RZiKa9fFQTrlx0OKLnyHSdt/enrdadji6WFfESVA==" + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==" } } }, @@ -88530,9 +88431,9 @@ } }, "@types/babel__traverse": { - "version": "7.14.2", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.2.tgz", - "integrity": "sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.0.tgz", + "integrity": "sha512-v4Vwdko+pgymgS+A2UIaJru93zQd85vIGWObM5ekZNdXCKtDYqATlEYnWgfo86Q6I1Lh0oXnksDnMU1cwmlPDw==", "requires": { "@babel/types": "^7.3.0" } @@ -89146,9 +89047,9 @@ "optional": true }, "abab": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", - "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==" + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==" }, "abbrev": { "version": "1.1.1", @@ -90031,9 +89932,9 @@ "dev": true }, "async": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" }, "async-each": { "version": "1.0.3", @@ -90246,9 +90147,9 @@ }, "dependencies": { "istanbul-lib-instrument": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz", - "integrity": "sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.0.tgz", + "integrity": "sha512-6Lthe1hqXHBNsqvgDzGO6l03XNeu3CrG4RqQ1KM9+l5+jNGpEJfIELx1NS3SEHmJQA8np/u+E4EPRKRiu6m19A==", "requires": { "@babel/core": "^7.12.3", "@babel/parser": "^7.14.7", @@ -90502,7 +90403,6 @@ "bl": { "version": "4.1.0", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "devOptional": true, "requires": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -90512,7 +90412,6 @@ "buffer": { "version": "5.7.1", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "devOptional": true, "requires": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -91608,7 +91507,7 @@ "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==" }, "code-point-at": { "version": "1.1.0", @@ -92909,9 +92808,9 @@ } }, "decimal.js": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", - "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==" + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.0.tgz", + "integrity": "sha512-Nv6ENEzyPQ6AItkGwLE2PGKinZZ9g59vSh2BeH6NqPu0OTKZ5ruJsVqh/orbAnqXc9pBbgXAIrc2EyaCj8NpGg==" }, "decode-uri-component": { "version": "0.2.0", @@ -93555,11 +93454,11 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "ejs": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.6.tgz", - "integrity": "sha512-9lt9Zse4hPucPkoP7FHDF0LQAlGyF9JVpnClFLFH3aSSbxmyoqINRpp/9wePWJTUl4KOQwRL72Iw3InHPDkoGw==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.8.tgz", + "integrity": "sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==", "requires": { - "jake": "^10.6.1" + "jake": "^10.8.5" } }, "electron-fetch": { @@ -93882,7 +93781,7 @@ "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", "requires": { "prelude-ls": "~1.1.2", "type-check": "~0.3.2" @@ -93904,7 +93803,7 @@ "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==" }, "source-map": { "version": "0.6.1", @@ -93915,7 +93814,7 @@ "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", "requires": { "prelude-ls": "~1.1.2" } @@ -96087,7 +95986,7 @@ "exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=" + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==" }, "exit-on-epipe": { "version": "1.0.1", @@ -96607,11 +96506,29 @@ "devOptional": true }, "filelist": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.2.tgz", - "integrity": "sha512-z7O0IS8Plc39rTCq6i6iHxk43duYOn8uFJiWSewIq0Bww1RNybVHSCjahmcC87ZqAm4OTvFzlzeGu3XAzG1ctQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", "requires": { - "minimatch": "^3.0.4" + "minimatch": "^5.0.1" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "requires": { + "brace-expansion": "^2.0.1" + } + } } }, "filename-regex": { @@ -96923,8 +96840,7 @@ }, "fs-constants": { "version": "1.0.0", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, "fs-extra": { "version": "10.0.0", @@ -98282,6 +98198,13 @@ "version": "4.2.9", "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==" }, + "grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "optional": true, + "peer": true + }, "graphql": { "version": "15.8.0", "integrity": "sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==" @@ -99503,7 +99426,7 @@ "identity-obj-proxy": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz", - "integrity": "sha1-lNK9qWCERT7zb7xarsN+D3nx/BQ=", + "integrity": "sha512-00n6YnVHKrinT9t0d9+5yZC6UBNJANpYEQvL2LlX6Ab9lnmxzIRcEmTPuyGScvl1+jKuCICX1Z0Ab1pPKKdikA==", "requires": { "harmony-reflect": "^1.4.6" } @@ -100739,11 +100662,11 @@ } }, "jake": { - "version": "10.8.4", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.4.tgz", - "integrity": "sha512-MtWeTkl1qGsWUtbl/Jsca/8xSoK3x0UmS82sNbjqxxG/de/M/3b1DntdjHgPMC50enlTNwXOCRqPXLLt5cCfZA==", + "version": "10.8.5", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", + "integrity": "sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==", "requires": { - "async": "0.9.x", + "async": "^3.2.3", "chalk": "^4.0.2", "filelist": "^1.0.1", "minimatch": "^3.0.4" @@ -100787,9 +100710,9 @@ } }, "ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "jest-util": { "version": "27.5.1", @@ -100835,9 +100758,9 @@ }, "dependencies": { "ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "is-ci": { "version": "3.0.1", @@ -100885,9 +100808,9 @@ }, "dependencies": { "ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "jest-util": { "version": "27.5.1", @@ -100919,9 +100842,9 @@ }, "dependencies": { "ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "jest-util": { "version": "27.5.1", @@ -100952,9 +100875,9 @@ }, "dependencies": { "ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "jest-util": { "version": "27.5.1", @@ -100996,9 +100919,9 @@ }, "dependencies": { "ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "jest-regex-util": { "version": "27.5.1", @@ -101056,9 +100979,9 @@ } }, "ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "jest-util": { "version": "27.5.1", @@ -101185,9 +101108,9 @@ } }, "ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "jest-resolve": { "version": "27.5.1", @@ -101262,9 +101185,9 @@ } }, "ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "jest-regex-util": { "version": "27.5.1", @@ -101342,9 +101265,9 @@ }, "dependencies": { "ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "jest-util": { "version": "27.5.1", @@ -101360,9 +101283,9 @@ } }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "requires": { "lru-cache": "^6.0.0" } @@ -101383,9 +101306,9 @@ }, "dependencies": { "ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==" }, "is-ci": { "version": "3.0.1", @@ -101559,9 +101482,9 @@ }, "dependencies": { "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==" + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==" }, "tough-cookie": { "version": "4.0.0", @@ -105835,33 +105758,46 @@ "optional": true }, "nwsapi": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", - "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==" + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.1.tgz", + "integrity": "sha512-JYOWTeFoS0Z93587vRJgASD5Ut11fYl5NyihP3KrYBvMe1FRRs6RN7m20SA/16GM4P6hTnZjT+UmDOt38UeXNg==" }, "nx": { - "version": "13.9.6", - "resolved": "https://registry.npmjs.org/nx/-/nx-13.9.6.tgz", - "integrity": "sha512-mb1tPxpc8LnnRlY2qXPR07X5kMrnUtfwOGJGP12xxauSXIgrqThIt0AGjZXU5UepFeo5Ejb7HpiggALKjqGRgg==", + "version": "13.10.6", + "resolved": "https://registry.npmjs.org/nx/-/nx-13.10.6.tgz", + "integrity": "sha512-kkW1Yy/DE/56XfMqFhMDbM9KAYw2xpSyMdak0ZK7aPnoy/TgZT/PmeHXUzip+GWQYQhLzUD2i/68G3PgFq0YQQ==", "requires": { - "@nrwl/cli": "13.9.6", - "@nrwl/tao": "13.9.6", + "@nrwl/cli": "13.10.6", + "@nrwl/tao": "13.10.6", + "@parcel/watcher": "2.0.4", "@swc-node/register": "^1.4.2", - "@swc/core": "^1.2.146", + "@swc/core": "^1.2.152", "chalk": "4.1.0", + "chokidar": "^3.5.1", + "cli-cursor": "3.1.0", + "cli-spinners": "2.6.1", + "dotenv": "~10.0.0", "enquirer": "~2.3.6", "fast-glob": "3.2.7", + "figures": "3.2.0", + "flat": "^5.0.2", "fs-extra": "^9.1.0", + "glob": "7.1.4", "ignore": "^5.0.4", "jsonc-parser": "3.0.0", + "minimatch": "3.0.4", + "npm-run-path": "^4.0.1", + "open": "^8.4.0", "rxjs": "^6.5.4", "rxjs-for-await": "0.0.2", "semver": "7.3.4", + "tar-stream": "~2.2.0", "tmp": "~0.2.1", "tsconfig-paths": "^3.9.0", "tslib": "^2.3.0", "v8-compile-cache": "2.3.0", - "yargs-parser": "20.0.0" + "yargs": "^17.4.0", + "yargs-parser": "21.0.1" }, "dependencies": { "chalk": { @@ -105873,6 +105809,11 @@ "supports-color": "^7.1.0" } }, + "dotenv": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", + "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==" + }, "fs-extra": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", @@ -105884,6 +105825,19 @@ "universalify": "^2.0.0" } }, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "rxjs": { "version": "6.6.7", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", @@ -105913,6 +105867,18 @@ "lru-cache": "^6.0.0" } }, + "tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "requires": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + } + }, "tmp": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", @@ -105922,9 +105888,9 @@ } }, "yargs-parser": { - "version": "20.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.0.0.tgz", - "integrity": "sha512-8eblPHTL7ZWRkyjIZJjnGf+TijiKJSwA24svzLRVvtgoi/RZiKa9fFQTrlx0OKLnyHSdt/enrdadji6WFfESVA==" + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==" } } }, @@ -114046,9 +114012,9 @@ }, "dependencies": { "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==" + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==" } } }, @@ -116412,8 +116378,9 @@ "dev": true }, "yargs": { - "version": "17.3.1", - "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", + "version": "17.5.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", + "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", "requires": { "cliui": "^7.0.2", "escalade": "^3.1.1", diff --git a/package.json b/package.json index 61f5845..51fc5ca 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ "@nestjs/platform-express": "8.2.3", "@nestjs/schedule": "^1.0.2", "@nestjs/typeorm": "^8.0.2", - "@nrwl/cli": "^13.9.6", - "@nrwl/tao": "^13.9.6", - "@nrwl/workspace": "^13.9.6", + "@nrwl/cli": "^13.10.6", + "@nrwl/tao": "^13.10.6", + "@nrwl/workspace": "^13.10.6", "@openzeppelin/contracts": "4.4.0", "@taquito/signer": "^11.0.2", "@taquito/taquito": "^11.0.2", diff --git a/packages/cast/oracles/schema/dpo.graphql b/packages/cast/oracles/schema/dpo.graphql index 2089199..9d8d3b4 100644 --- a/packages/cast/oracles/schema/dpo.graphql +++ b/packages/cast/oracles/schema/dpo.graphql @@ -274,7 +274,6 @@ type Query { } type Mutation { - dataRequest(contractAddress: String!): String! boostTransaction(tezosSpecificParams: TezosSpecificParams, ethereumSpecificParams: EthereumSpecificParams, transactionId: String!, ledger: Ledger!): String! cancelTransaction(tezosSpecificParams: TezosSpecificParams, ethereumSpecificParams: EthereumSpecificParams, transactionId: String!, ledger: Ledger!): String! } diff --git a/packages/cast/oracles/src/modules/fro/fro.resolver.ts b/packages/cast/oracles/src/modules/fro/fro.resolver.ts index b15b70b..b2561c0 100644 --- a/packages/cast/oracles/src/modules/fro/fro.resolver.ts +++ b/packages/cast/oracles/src/modules/fro/fro.resolver.ts @@ -28,7 +28,6 @@ export class FROResolver { private readonly pubSub: ForgePubSub, private readonly froRedemptionService: FroRedemptionService, private readonly froOperationService: FroOperationService, - private readonly dpoService: DpoService; ) {} @Mutation(() => String) @@ -113,13 +112,4 @@ export class FROResolver { ForgeOperationType.TRADE, ); } - - @Mutation(() => String) - @HandleLogsAndErrors(log4js.levels.DEBUG) - public async dataRequest( - @Args('contractAddress') - contractAddress: string, - ): Promise { - return await this.dpoService.dataRequest(contractAddress); - } } From 78fef56e4d15121219d392c703d5079768314136 Mon Sep 17 00:00:00 2001 From: Sterling Date: Fri, 19 Aug 2022 09:52:26 +0200 Subject: [PATCH 3/5] fix: remove nest oracle --- .env | 6 +- docker-compose.yml | 16 - networks/local/ethereum/contracts.json | 16 +- networks/local/ethereum/keys.json.liquid | 3 +- networks/local/tezos/contracts.json | 16 +- networks/local/tezos/keys.json.liquid | 3 +- .../src/models/notification/constants.ts | 7 - .../data-provider-notification.ts | 28 -- .../models/src/models/notification/index.ts | 1 - packages/cast/oracle-clients/codegen.yml | 23 -- packages/cast/oracle-clients/src/index.ts | 1 - .../src/modules/dpoClient/dpoClient.config.ts | 18 -- .../src/modules/dpoClient/dpoClient.module.ts | 11 - .../modules/dpoClient/dpoClient.service.ts | 237 -------------- .../src/modules/dpoClient/index.ts | 3 - .../graphQL/dpo/dpoNotification.graphql | 5 - .../src/shared/graphQL/dpo/test.graphql | 3 - packages/cast/oracles/env/dc.dpo.env | 23 -- packages/cast/oracles/genSDLForModules.ts | 5 +- .../oracles/integration/utils/envTemplates.ts | 5 +- .../oracles/integration/utils/setupEnv.ts | 2 - packages/cast/oracles/schema/config.graphql | 296 ----------------- packages/cast/oracles/schema/dpo.graphql | 297 ------------------ packages/cast/oracles/schema/fio.graphql | 5 - packages/cast/oracles/schema/fro.graphql | 5 - packages/cast/oracles/schema/fso.graphql | 5 - packages/cast/oracles/schema/fxo.graphql | 5 - packages/cast/oracles/src/app.dyno.module.ts | 5 - packages/cast/oracles/src/mode.ts | 1 - .../dpo/dataProvider.event.constant.ts | 1 - .../src/modules/dpo/dataProvider.module.ts | 10 - .../src/modules/dpo/dataProvider.resolver.ts | 20 -- .../src/modules/dpo/dataProvider.service.ts | 155 --------- .../oracles/src/modules/fro/fro.resolver.ts | 1 - .../oracles/src/modules/fxo/fxo.resolver.ts | 17 - 35 files changed, 26 insertions(+), 1229 deletions(-) delete mode 100644 packages/cast/models/src/models/notification/data-provider-notification.ts delete mode 100644 packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.config.ts delete mode 100644 packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.module.ts delete mode 100644 packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.service.ts delete mode 100644 packages/cast/oracle-clients/src/modules/dpoClient/index.ts delete mode 100644 packages/cast/oracle-clients/src/shared/graphQL/dpo/dpoNotification.graphql delete mode 100644 packages/cast/oracle-clients/src/shared/graphQL/dpo/test.graphql delete mode 100644 packages/cast/oracles/env/dc.dpo.env delete mode 100644 packages/cast/oracles/schema/config.graphql delete mode 100644 packages/cast/oracles/schema/dpo.graphql delete mode 100644 packages/cast/oracles/src/modules/dpo/dataProvider.event.constant.ts delete mode 100644 packages/cast/oracles/src/modules/dpo/dataProvider.module.ts delete mode 100644 packages/cast/oracles/src/modules/dpo/dataProvider.resolver.ts delete mode 100644 packages/cast/oracles/src/modules/dpo/dataProvider.service.ts diff --git a/.env b/.env index e9dcd1b..ee00c82 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ -GANACHE_PRIV="0xf36a7ffe623af7a4025d9879e9223272034dac49e9dfcf2f0bd68a41137b4561" -GANACHE_ADDRESS="0x8e2ddbc002d51811cb0312f2de9dd46c81971da1" -TZ_KEY="forge,edpkv3vx3AZrYJd6rjKPeCqr1o3WPFHbXpkm6pqgvToqjtGQxwoFmd,tz1S9CXGqf1rNRu1sJorGZ16jbJuuC2HPgZ5,unencrypted:edskS5anihcR4YYr9TixSVUAQSEzVKvD5qjYYVcTyHqeSpRTZPx3x7DEae6oKe6n59v4Q1qDZ2NQrwxAmBexjQyEzU3LzqD58B" \ No newline at end of file +GANACHE_PRIV="0x2844679196038d5f8097b1f862204c4c13b5faaab2d075ef0de088463383ba72" +GANACHE_ADDRESS="0xddfb2b449f976330450b26ba7ed1cc7acb9866a6" +TZ_KEY="forge,edpkuhuV7DpmqJHc3ryRB7ReH3AP1e1Vh1P1pSy2WFbikECTTLHBAV,tz1bvfgPGQgXuf2TNt8uFGBgTM7dpVHNcqab,unencrypted:edskRqiLMNP8KLjLzziEznkxCokKFMdeiy2DNSw9yRtD1P9K2KdTEReWqK6ReME961E8JqUyj7q71q1EZy1bsAs6zGHeZVvHGR" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 0d02720..a58deda 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -81,22 +81,6 @@ services: - './networks:/networks' - './packages:/home/node/packages/' - './node_modules:/home/node/node_modules' - dpo: - container_name: dpo - image: 'node:16.9.1-alpine3.14' - working_dir: /home/node/packages/cast/oracles - command: npm run start - env_file: - - ./packages/cast/oracles/env/dc.dpo.env - environment: - - TZ_BLOCKCHAIN_PROVIDE_LOCATION=http://flextesa:20000 - - ETH_BLOCKCHAIN_PROVIDE_LOCATION=ws://ganache:8545 - ports: - - '6670:6660' - volumes: - - './networks:/networks' - - './packages:/home/node/packages/' - - './node_modules:/home/node/node_modules' ganache: container_name: ganache image: trufflesuite/ganache-cli:latest diff --git a/networks/local/ethereum/contracts.json b/networks/local/ethereum/contracts.json index 2e9563f..fcca91a 100644 --- a/networks/local/ethereum/contracts.json +++ b/networks/local/ethereum/contracts.json @@ -1,10 +1,10 @@ { - "BasicTokenLibrary": "0xEfF29F308C9F516297f49Ee24BF39a90C1Cb5c7a", - "ForgeBondFactory": "0x5EF5cd291dB5B57c9C434E8900aE502eF51DF92e", - "ForgeInstrumentRegistry": "0xe50Ef5A196962b8fa5b62B079cf7bAFe18b45fcB", - "IterableBalances": "0x23799E18dCe49c1c8B00A81D532a02D7F59e5E13", - "OperatorManagerLibrary": "0x0056dB4959965d02e05D8F8138172833427f6447", - "SecurityTokenBalancesLibrary": "0x5702491E74a13494C68B6F140C979f2732E5cE06", - "SettlementRepositoryLibrary": "0xd523513bB9205EcB67A147C30272157EC43951A3", - "SettlementWorkflowLibrary": "0x6B0658D4d92968BF63544a4cAb66Cffe68c499C6" + "BasicTokenLibrary": "0x0c585044111E23c814fB538599bF882b80Cc1558", + "ForgeBondFactory": "0xD679bBD9A041201d02a1B36AC40e3CD078f510ac", + "ForgeInstrumentRegistry": "0xF72C381951d913bb97B3de6f783a1Cf361B015C6", + "IterableBalances": "0xC539c41A59c088bbE5CD5638CAb359AfC078ae6d", + "OperatorManagerLibrary": "0x1FD7461d163680e8B9ad46Fe84A0b19547DE6338", + "SecurityTokenBalancesLibrary": "0xD03d88F26D1340309907BDBE8CB0Aa1E658Bd1F6", + "SettlementRepositoryLibrary": "0xbcefCcd14EcE89Ad7BB9B3F167fA394426e1fF05", + "SettlementWorkflowLibrary": "0xF877083f5309e2118CFea07dD2C4Eb49f500Ea7e" } \ No newline at end of file diff --git a/networks/local/ethereum/keys.json.liquid b/networks/local/ethereum/keys.json.liquid index 25d7e39..e4570af 100644 --- a/networks/local/ethereum/keys.json.liquid +++ b/networks/local/ethereum/keys.json.liquid @@ -6,6 +6,5 @@ "INVESTOR_1": "{{ "m/44'/60'/0'/0/4'" | ethereum_private_key }}", "DEALER_1": "{{ "m/44'/60'/0'/0/5'" | ethereum_private_key }}", "DEALER_2": "{{ "m/44'/60'/0'/0/6'" | ethereum_private_key }}", - "STR": "{{ "m/44'/60'/0'/0/7'" | ethereum_private_key }}", - "PROVIDER": "{{ "m/44'/60'/0'/0/8'" | ethereum_private_key }}" + "STR": "{{ "m/44'/60'/0'/0/7'" | ethereum_private_key }}" } diff --git a/networks/local/tezos/contracts.json b/networks/local/tezos/contracts.json index 08d5735..481caf5 100644 --- a/networks/local/tezos/contracts.json +++ b/networks/local/tezos/contracts.json @@ -1,10 +1,10 @@ { - "ADMIN": "tz1S9CXGqf1rNRu1sJorGZ16jbJuuC2HPgZ5", - "REGISTRAR": "tz1WqPjpML6iG9EksYNGVVo9EN9j5iwHEkJj", - "SINK": "KT1Hs7ZecjYMJWWsEJdWz9PjHY8BNkU7nuGX", - "REGISTRY": "KT1SxeyDW7wdybDL6ZA4HmyVQB8fqUz8kKpS", - "LAMBDA_BOND": "KT1KgfajJL3DMBGgNmTu7xGH28CdT9EcTS5M", - "FACTORY_BOND": "KT1V4mqPWCeuX9Swddw9XqqawbdKZPbJjBSp", - "LAMBDA_EMTN": "KT1WFJvq2B5vM3xLXFde9fKkNDboahLQx4G1", - "FACTORY_EMTN": "KT1T6ChonV5KDRDA1R23hmqp69RzY5Nz4Waa" + "ADMIN": "tz1bT95UmT5RmjzTqL5DysGSf1sxSLC1ftdu", + "REGISTRAR": "tz1Qz7bb3eqa3MFosfVJHE7KS7Af4AEJgXJF", + "SINK": "KT1LW7GiQgTYbn44Nm6AENB5JUYCrKao1Y5N", + "REGISTRY": "KT18wNBqnj5DkAKGRjzwpktbwUnqripwNusN", + "LAMBDA_BOND": "KT1N1UgWTGmovu2KFBRJvxvVcdxYKAnL237z", + "FACTORY_BOND": "KT1FSiN9o6VH5ssfHvH4NB1qGUtTSLAfeHTe", + "LAMBDA_EMTN": "KT1Asdk7cuGwj5hRNpRNcc77inYGwgJDLsVt", + "FACTORY_EMTN": "KT1AqzctRbMz1e329jFQp4P4TB7DQLvZGCVF" } \ No newline at end of file diff --git a/networks/local/tezos/keys.json.liquid b/networks/local/tezos/keys.json.liquid index 11eec5f..d21bd85 100644 --- a/networks/local/tezos/keys.json.liquid +++ b/networks/local/tezos/keys.json.liquid @@ -6,6 +6,5 @@ "INVESTOR_1": "{{ "m/44'/1729'/0'/4'" | tezos_private_key }}", "DEALER_1": "{{ "m/44'/1729'/0'/5'" | tezos_private_key }}", "DEALER_2": "{{ "m/44'/1729'/0'/6'" | tezos_private_key }}", - "STR": "{{ "m/44'/1729'/0'/7'" | tezos_private_key }}", - "PROVIDER": "{{ "m/44'/1729'/0'/8'" | tezos_private_key }}" + "STR": "{{ "m/44'/1729'/0'/7'" | tezos_private_key }}" } diff --git a/packages/cast/models/src/models/notification/constants.ts b/packages/cast/models/src/models/notification/constants.ts index e89a7ff..34585ff 100644 --- a/packages/cast/models/src/models/notification/constants.ts +++ b/packages/cast/models/src/models/notification/constants.ts @@ -38,10 +38,3 @@ export enum ErrorNotificationName { registerEnumType(ErrorNotificationName, { name: 'ErrorNotificationName', }); - -export enum DataProviderNotificationName { - SubscriptionInitiated = 'SubscriptionInitiated', -} -registerEnumType(DataProviderNotificationName, { - name: 'DataProviderNotificationName', -}); diff --git a/packages/cast/models/src/models/notification/data-provider-notification.ts b/packages/cast/models/src/models/notification/data-provider-notification.ts deleted file mode 100644 index 6ef9749..0000000 --- a/packages/cast/models/src/models/notification/data-provider-notification.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Field, ID, ObjectType } from '@nestjs/graphql'; -import { DataProviderNotificationName } from './constants'; - -@ObjectType() -export class DataProviderNotification { - @Field((returns) => DataProviderNotificationName) - // eslint-disable-next-line @typescript-eslint/no-unused-vars - @Field((type) => ID, { nullable: true }) - public transactionHash: string; - - public constructor(transactionHash: string) { - this.transactionHash = transactionHash; - } -} - -export function isDataProviderNotification( - dpoNotification: any, -): dpoNotification is DataProviderNotification { - if (!dpoNotification || !dpoNotification.notificationName) { - return false; - } - - if (DataProviderNotificationName[dpoNotification.notificationName]) { - return true; - } - - return false; -} diff --git a/packages/cast/models/src/models/notification/index.ts b/packages/cast/models/src/models/notification/index.ts index f5c5627..0aa9f8b 100644 --- a/packages/cast/models/src/models/notification/index.ts +++ b/packages/cast/models/src/models/notification/index.ts @@ -4,4 +4,3 @@ export * from './error-notification'; export * from './light-settlement-transaction'; export * from './heartbeat-notification'; export * from './registry-notification'; -export * from './data-provider-notification'; diff --git a/packages/cast/oracle-clients/codegen.yml b/packages/cast/oracle-clients/codegen.yml index 0428721..d0e099c 100644 --- a/packages/cast/oracle-clients/codegen.yml +++ b/packages/cast/oracle-clients/codegen.yml @@ -90,26 +90,3 @@ generates: - introspection config: minify: true - src/modules/dpoClient/generated/graphql.ts: - schema: '../oracles/schema/dpo.graphql' - documents: - - 'src/shared/graphQL/dpo/*.graphql' - - 'src/shared/graphQL/fxo/*.graphql' - config: - namingConvention: keep - skipTypename: true - scalars: - DateTime: Date - plugins: - - 'typescript' - - 'typescript-operations' - - 'typescript-document-nodes' - src/modules/dpoClient/generated/schema.json: - schema: '../oracles/schema/dpo.graphql' - documents: - - 'src/shared/graphQL/dpo/*.graphql' - - 'src/shared/graphQL/fxo/*.graphql' - plugins: - - introspection - config: - minify: true diff --git a/packages/cast/oracle-clients/src/index.ts b/packages/cast/oracle-clients/src/index.ts index 63518c8..96825f6 100644 --- a/packages/cast/oracle-clients/src/index.ts +++ b/packages/cast/oracle-clients/src/index.ts @@ -2,4 +2,3 @@ export * from './modules/fioClient'; export * from './modules/froClient'; export * from './modules/fsoClient'; export * from './modules/strClient'; -export * from './modules/dpoClient'; diff --git a/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.config.ts b/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.config.ts deleted file mode 100644 index 5e3449e..0000000 --- a/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.config.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Property } from 'ts-convict'; - -export class DpoClientConfig { - @Property({ - default: null, - env: 'API_DPO_GQL_EP', - format: String, - }) - public dpoGraphQLEndpoint: string; - - @Property({ - default: 100, - env: 'HEARTBEAT_LOG_PERIOD', - format: Number, - doc: 'Example: 5 means it will log 1 every 5 heartbeat', - }) - public heartbeatLogPeriod: number; -} diff --git a/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.module.ts b/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.module.ts deleted file mode 100644 index d62aafb..0000000 --- a/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Module } from '@nestjs/common'; -import { DpoClientService as DpoClientService } from './dpoClient.service'; -import { ConfigModule } from '../config/config.module'; -import { DpoClientConfig } from './dpoClient.config'; - -@Module({ - imports: [ConfigModule.forConfig(DpoClientConfig)], - providers: [DpoClientService], - exports: [DpoClientService], -}) -export class DpoClientModule {} diff --git a/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.service.ts b/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.service.ts deleted file mode 100644 index 61f900a..0000000 --- a/packages/cast/oracle-clients/src/modules/dpoClient/dpoClient.service.ts +++ /dev/null @@ -1,237 +0,0 @@ -import { getLogger, Logger } from '../../utils/logger'; -import { Injectable, OnModuleDestroy } from '@nestjs/common'; -import { - ContractNotification, - ErrorNotification, - RegistryNotification, - DataProviderNotification, -} from '@castframework/models'; -import { SubscriptionClient } from 'subscriptions-transport-ws'; -import { errorAsString } from '../../utils/errorAsString'; -import { - errorNotificationSubscription, - errorNotificationSubscriptionVariables, - errorNotification, - dpoNotification, - testQuery, - dpoNotificationSubscription, - dpoNotificationSubscriptionVariables, -} from './generated/graphql'; -import { ApolloClient, FetchResult } from '@apollo/client/core'; -import { DpoClientConfig } from './dpoClient.config'; -import { Observable, Subject } from 'rxjs'; -import { - extractGraphqlErrorMessageFromApolloError, - getApolloClient, - getSchema, -} from '../../shared/utils/oracleUtils'; -import * as generatedSchema from './generated/schema.json'; -import { query, subscribe } from '../../shared/utils/graphQLUtils'; -@Injectable() -export class DpoClientService implements OnModuleDestroy { - private heartbeatCounter: number | null = null; - private subscriptionClient: SubscriptionClient; - private apolloClient: ApolloClient; - private logger: Logger = getLogger(this.constructor.name); - private _promiseRegister: { - [key: string]: Promise; - } = {}; - private _promiseResolver: { - [key: string]: { - resolve: (value: any) => any; - reject: (reason: any) => any; - }; - } = {}; - - private errorNotifications = new Subject(); - private dpoNotifications = new Subject(); - private contractNotifications = new Subject(); - private registryNotifications = new Subject(); - private clientName = 'dpo'; - - private subscribed = false; - - public constructor(private readonly dpoClientConfig: DpoClientConfig) { - const schema = getSchema(generatedSchema); - const [client, subscriptionClient] = getApolloClient( - { - graphQlEndpoint: dpoClientConfig.dpoGraphQLEndpoint, - graphQlSubscriptionEndpoint: dpoClientConfig.dpoGraphQLEndpoint, - }, - schema, - this.clientName + '-client', - ); - - this.apolloClient = client; - this.subscriptionClient = subscriptionClient; - - this.setupSubscriptionClientEventHandlers(); - } - - public getErrorNotifications(): Observable { - return this.errorNotifications.asObservable(); - } - - public getDpoNotifications(): Observable { - return this.dpoNotifications.asObservable(); - } - - public getContractNotifications(): Observable { - return this.contractNotifications.asObservable(); - } - - public getRegistryNotifications(): Observable { - return this.registryNotifications.asObservable(); - } - - public async test(): Promise { - const result = await query( - { - query: testQuery, - }, - this.apolloClient, - this.graphQlErrorForwarder, - this.logger, - this.clientName, - this, - ); - - return result.data.test; - } - - public onModuleDestroy(): void { - this.logger.debug('Stopping DPO client service'); - this.apolloClient.stop(); - // this dirty trick is necessary because SubscriptionClient.close() does not work well when inside a reconnect loop - // (as SubscriptionClient.client is null most of the time, the reconnect timeout is never cleared) - (this.subscriptionClient as any).reconnect = false; - this.subscriptionClient.close(); - } - - public getRegisteredPromise(transactionHash: string): Promise { - this._promiseRegister[transactionHash] = new Promise((resolve, reject) => { - this._promiseResolver[transactionHash] = { - resolve, - reject, - }; - }); - - return this._promiseRegister[transactionHash]; - } - - private graphQlErrorForwarder(e: any): void { - const error = extractGraphqlErrorMessageFromApolloError(e); - throw new Error(error); - } - - private setupSubscriptionClientEventHandlers(): void { - this.subscriptionClient.onConnected(() => { - this.logger.debug('SubscriptionClient received Connected event'); - this.initReturnsCanal(); - }); - this.subscriptionClient.onConnecting(() => - this.logger.debug('SubscriptionClient received Connecting event'), - ); - this.subscriptionClient.onDisconnected(() => - this.logger.debug('SubscriptionClient received Disconnected event'), - ); - this.subscriptionClient.onReconnected(() => { - this.logger.debug('SubscriptionClient received Reconnected event'); - this.initReturnsCanal(); - }); - this.subscriptionClient.onReconnecting(() => - this.logger.debug('SubscriptionClient received Reconnecting event'), - ); - this.subscriptionClient.onError((err) => - this.logger.debug( - `SubscriptionClient received Error event : error[${errorAsString( - err.error, - )}] message[${err.message}] type[${err.type}]`, - ), - ); - } - - private initReturnsCanal(): void { - if (this.subscribed) return; - this.subscribed = true; - this.logger.debug('Subscribing to DPO events'); - - subscribe< - errorNotificationSubscription, - errorNotificationSubscriptionVariables - >( - { - query: errorNotification, - }, - this.apolloClient, - this.logger, - this.clientName, - ).subscribe( - (error) => this.errorNotificationHandler(error), - (error) => this.errorHandler(error), - ); - - subscribe< - dpoNotificationSubscription, - dpoNotificationSubscriptionVariables - >( - { - query: dpoNotification, - }, - this.apolloClient, - this.logger, - this.clientName, - ).subscribe( - (event) => this.dpoNotificationHandler(event), - (error) => this.errorHandler(error), - ); - } - - private errorHandler = (error: any): void => { - this.logger.error(`Subscribe error[${JSON.stringify(error)}]`); - }; - - private errorNotificationHandler( - event: FetchResult, - ): void { - this.logger.debug( - `errorNotificationHandler with event[${JSON.stringify(event)}]`, - ); - if (event.data?.errorNotification) { - const { transactionHash, message } = event.data.errorNotification; - this.logger.debug( - `Received error with transaction hash [${transactionHash}] with message[${message}]`, - ); - - this.errorNotifications.next( - new ErrorNotification(transactionHash, errorAsString(message)), - ); - - if (transactionHash && this._promiseRegister[transactionHash]) { - this._promiseResolver[transactionHash].reject(message); - delete this._promiseRegister[transactionHash]; - delete this._promiseResolver[transactionHash]; - } - } - } - - private dpoNotificationHandler = async ( - event: FetchResult, - ): Promise => { - this.logger.debug( - `dpoNotificationHandler with event[${JSON.stringify(event)}]`, - ); - if (event.data?.dpoNotification) { - const { transactionHash } = event.data.dpoNotification; - this.logger.debug( - `Received DPO notification with transaction hash [${transactionHash}]`, - ); - - if (transactionHash && this._promiseResolver[transactionHash]) { - this._promiseResolver[transactionHash].resolve(true); - delete this._promiseRegister[transactionHash]; - delete this._promiseResolver[transactionHash]; - } - } - }; -} diff --git a/packages/cast/oracle-clients/src/modules/dpoClient/index.ts b/packages/cast/oracle-clients/src/modules/dpoClient/index.ts deleted file mode 100644 index 5936e0d..0000000 --- a/packages/cast/oracle-clients/src/modules/dpoClient/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './dpoClient.config'; -export * from './dpoClient.module'; -export * from './dpoClient.service'; diff --git a/packages/cast/oracle-clients/src/shared/graphQL/dpo/dpoNotification.graphql b/packages/cast/oracle-clients/src/shared/graphQL/dpo/dpoNotification.graphql deleted file mode 100644 index aaa64f9..0000000 --- a/packages/cast/oracle-clients/src/shared/graphQL/dpo/dpoNotification.graphql +++ /dev/null @@ -1,5 +0,0 @@ -subscription dpoNotification { - dpoNotification { - transactionHash - } -} diff --git a/packages/cast/oracle-clients/src/shared/graphQL/dpo/test.graphql b/packages/cast/oracle-clients/src/shared/graphQL/dpo/test.graphql deleted file mode 100644 index 4fcc9ad..0000000 --- a/packages/cast/oracle-clients/src/shared/graphQL/dpo/test.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query testQuery { - test -} diff --git a/packages/cast/oracles/env/dc.dpo.env b/packages/cast/oracles/env/dc.dpo.env deleted file mode 100644 index cba2079..0000000 --- a/packages/cast/oracles/env/dc.dpo.env +++ /dev/null @@ -1,23 +0,0 @@ -NETWORK_FOLDER=/networks/local -IDENTITY=REGISTRAR - -FORGE_ORACLE_PARAMETERS=--mode dpo -PORT=6660 - -STR_GQL_URL=http://str:6660/graphql - -BLOCKCHAIN_USE_MOCK=false - -ETH_NUMBER_OF_CONFIRMATION=1 -ETH_EVENT_DELAY_IN_BLOCKS=0 -TZ_NUMBER_OF_CONFIRMATION=1 -TZ_EVENT_DELAY_IN_BLOCKS=0 -TZ_POLLING_INTERVAL_IN_SECONDS=1 - -LEI_FORGE="969500FX8K40ZDW4F377" - -JWK_KID=QjU4MERDQ0NEQTU1RkE4NDMzRTE1QTE0NkIzNDkxQzdCQUMxQjYzMA - -GRAPHQL_ENABLE_INSTROSPECTION=true -GRAPHQL_ENABLE_PLAYGROUND=true -GRAPHQL_ENABLE_TRACING=true diff --git a/packages/cast/oracles/genSDLForModules.ts b/packages/cast/oracles/genSDLForModules.ts index b619f8f..ae06de5 100644 --- a/packages/cast/oracles/genSDLForModules.ts +++ b/packages/cast/oracles/genSDLForModules.ts @@ -53,7 +53,10 @@ async function buildModuleFromPath( .filter((file) => file.match(/\.resolver\.ts$/)) .map((file) => import(`./${file}`)); - if (moduleName !== 'fxo' && moduleName !== 'str') { + // Avoids matching FXO, Config, STR, etc. + const fxoRegex = /^f[^x]o$/; + + if (moduleName.match(fxoRegex)) { log(`🔎 Adding fxo, swift and position resolver for ${moduleName}`); resolvers.push(import('./src/modules/fxo/fxo.resolver')); resolvers.push(import('./src/modules/fxo/position/position.resolver')); diff --git a/packages/cast/oracles/integration/utils/envTemplates.ts b/packages/cast/oracles/integration/utils/envTemplates.ts index 17e07e9..90dc9ca 100644 --- a/packages/cast/oracles/integration/utils/envTemplates.ts +++ b/packages/cast/oracles/integration/utils/envTemplates.ts @@ -8,7 +8,6 @@ export type EnvConfig = { fsoPort: number; fio1Port: number; fio2Port: number; - dpoPort: number; }; export function defaultEnv( @@ -18,12 +17,11 @@ export function defaultEnv( fsoPort: 6662, fio1Port: 6663, fio2Port: 6666, - dpoPort: 6670, }, ): void { const logger = getLogger('defaultEnv'); logger.info(`Env config: ${JSON.stringify(envConfig)}`); - const { froPort, fsoPort, strPort, fio1Port, fio2Port, dpoPort } = envConfig; + const { froPort, fsoPort, strPort, fio1Port, fio2Port } = envConfig; // BLOCKCHAIN PARAMETERS if (!process.env['BLOCKCHAIN_USE_MOCK']) { @@ -79,7 +77,6 @@ export function defaultEnv( process.env['STR_GQL_URL'] = `http://localhost:${strPort}/graphql`; process.env['FSO_GQL_URL'] = `http://localhost:${fsoPort}/graphql`; process.env['API_FRO_GQL_EP'] = `http://localhost:${froPort}/graphql`; - process.env['API_DPO_GQL_EP'] = `http://localhost:${dpoPort}/graphql`; // BUSINESS CONFIGURATION process.env['LEI_FORGE'] = '969500FX8K40ZDW4F377'; diff --git a/packages/cast/oracles/integration/utils/setupEnv.ts b/packages/cast/oracles/integration/utils/setupEnv.ts index e4fc25d..a22a599 100644 --- a/packages/cast/oracles/integration/utils/setupEnv.ts +++ b/packages/cast/oracles/integration/utils/setupEnv.ts @@ -130,7 +130,6 @@ export async function setupEnv(params: EnvParams): Promise { const FIO1_PORT = await getPort({ port: 6663 }); const FIO2_PORT = await getPort({ port: 6663 }); const FIO3_PORT = await getPort({ port: 6667 }); - const DPO_PORT = await getPort({ port: 6670 }); const dbName = randomDbEnv( { @@ -139,7 +138,6 @@ export async function setupEnv(params: EnvParams): Promise { froPort: FRO_PORT, fio1Port: FIO1_PORT, fio2Port: FIO2_PORT, - dpoPort: DPO_PORT, }, params.name, ); diff --git a/packages/cast/oracles/schema/config.graphql b/packages/cast/oracles/schema/config.graphql deleted file mode 100644 index 6e3cbf2..0000000 --- a/packages/cast/oracles/schema/config.graphql +++ /dev/null @@ -1,296 +0,0 @@ -type InstrumentPosition { - instrumentAddress: String! - ledger: Ledger! - balance: Float! - legalEntityAddress: String! - symbol: String! - valueInFiat: Float! - currency: Currency! - percentage: Float - unlocked: Float - locked: Float -} - -enum Ledger { - ETHEREUM - TEZOS -} - -enum Currency { - EUR -} - -type InstrumentDetails { - issuer: String! - registrarAgentAddress: String! - settlerAgentAddress: String! - contractAddress: String! - initialSupply: Float! - isinCode: String! - name: String! - symbol: String! - denomination: Float! - divisor: Float! - startDate: Float! - maturityDate: Float! - firstCouponDate: Float! - couponFrequencyInMonths: Float! - interestRateInBips: Float! - callable: Boolean! - isSoftBullet: Boolean! - softBulletPeriodInMonths: Float! - type: String! -} - -type SettlementTransactionParticipantAddresses { - securityDeliverer: String! - securityReceiver: String! - securityIssuer: String! - settler: String! - registrar: String! -} - -type LightSettlementTransaction { - id: String! - participantAccountNumbers: SettlementTransactionParticipantAddresses! -} - -type ContractNotification { - notificationName: ContractNotificationName! - instrumentAddress: String! - transactionHash: ID - lightSettlementTransactions: [LightSettlementTransaction!]! - settlementTransactionOperationType: String! -} - -enum ContractNotificationName { - SubscriptionInitiated - TradeInitiated - RedemptionInitiated - PaymentReceived - PaymentTransferred - Transfer - SettlementTransactionCanceled -} - -type ErrorNotification { - notificationName: ErrorNotificationName! - transactionHash: ID! - message: String -} - -enum ErrorNotificationName { - Error -} - -type LedgerBlockInfo { - ledger: Ledger! - blockNumber: Float! - blockHash: String! -} - -type HeartbeatNotification { - notificationName: HeartbeatNotificationName! - timestamp: Float! - blockInfos: [LedgerBlockInfo!]! -} - -enum HeartbeatNotificationName { - Heartbeat -} - -type RegistryNotification { - notificationName: RegistryNotificationName! - instrumentAddress: String! - instrumentLedger: Ledger! - transactionHash: ID -} - -enum RegistryNotificationName { - InstrumentListed - InstrumentUnlisted -} - -type DataProviderNotification { - transactionHash: ID -} - -type STRSettlementTransaction { - id: String! - settlementType: SettlementTransactionType! - settlementDate: DateTime! - operationId: String! - instrumentPublicAddress: String! - instrumentLedger: Ledger! - deliveryQuantity: Float! - deliverySenderAccountNumber: String! - deliveryReceiverAccountNumber: String! - paymentAmount: Float! - paymentCurrency: Currency! - paymentReceiverAccountNumber: String! - paymentSenderAccountNumber: String! - paymentSenderLegalEntityId: String! - paymentReceiverLegalEntityId: String! - movements: [Movement!]! - hash: String! - tradeId: String - tradeDate: DateTime! - additionalReaderAddresses: [String!] - settlementModel: SettlementModel! - holdableTokenAddress: String - intermediateAccountIBAN: String -} - -enum SettlementTransactionType { - DVP - PFOD - DWP - FOP -} - -""" -A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format. -""" -scalar DateTime - -enum SettlementModel { - DIRECT - INDIRECT -} - -type OracleSettlementTransaction { - id: String! - settlementType: SettlementTransactionType! - settlementDate: DateTime! - operationId: String! - instrumentPublicAddress: String! - instrumentLedger: Ledger! - deliveryQuantity: Float! - deliverySenderAccountNumber: String! - deliveryReceiverAccountNumber: String! - paymentAmount: Float! - paymentCurrency: Currency! - paymentReceiverAccountNumber: String! - paymentSenderAccountNumber: String! - paymentSenderLegalEntityId: String! - paymentReceiverLegalEntityId: String! - movements: [Movement!]! - hash: String! - tradeId: String - tradeDate: DateTime! - additionalReaderAddresses: [String!] - settlementModel: SettlementModel! - holdableTokenAddress: String - intermediateAccountIBAN: String - settlementStatus: SettlementTransactionStatus! -} - -enum SettlementTransactionStatus { - INITIATED - PENDING - ACKNOWLEDGED - REJECTED - UNPROCESSED - PROCESSED - SETTLED - CANCELED -} - -type Movement { - id: String! - settlementTransactions: [STRSettlementTransaction!]! - movementType: MovementType! - senderAccountNumber: String! - receiverAccountNumber: String! - paymentReference: String -} - -enum MovementType { - CASH - TOKEN -} - -type TransactionDetails { - to: String! - methodName: String - methodParameters: String - value: Float -} - -type BlockchainEvent { - eventName: String! - smartContractAddress: String! - blockNumber: Float! - blockHash: String! - transactionId: String! - payload: String! -} - -type TransactionInfo { - id: String! - nonce: Float! - status: TransactionStatus! - lastStatusTimestamp: DateTime! - blockNumber: Float - sendTimestamp: DateTime - sendBlockNumber: Float - replacedTransactionId: String - replacementTransactionId: String - details: TransactionDetails - currentError: String - emittedEvents: [BlockchainEvent!] - blockchainSpecificTransactionInfo: BlockchainSpecificTransactionInfo -} - -enum TransactionStatus { - PENDING - CONFIRMED - REJECTED - CANCELLED -} - -union BlockchainSpecificTransactionInfo = EthereumSpecificTransactionInfo | TezosSpecificTransactionInfo - -type EthereumSpecificTransactionInfo { - gasLimit: Float - gasPrice: Float -} - -type TezosSpecificTransactionInfo { - weNeedAtLeastOneFieldForGraphql: String -} - -type Query { - getSettlementTransactions(instrumentLedger: Ledger, instrumentAddress: String): [OracleSettlementTransaction!]! - getSettlementTransactionsByPaymentReference(paymentReference: String): [OracleSettlementTransaction!]! - whoami(ledger: Ledger!): String! - getSettlementTransaction(id: String!): OracleSettlementTransaction - getAllInstruments(ledger: Ledger!): [String!] - getInstrumentDetails(instrumentLedger: Ledger!, contractAddress: String!): InstrumentDetails! - getTransactionInfo(transactionId: String!, ledger: Ledger!): TransactionInfo! - getInstrumentPositions(ledger: Ledger!, instrumentAddress: String!): [InstrumentPosition!]! - getInstrumentPosition(legalEntityAddress: String!, ledger: Ledger!, instrumentAddress: String!): [InstrumentPosition!]! -} - -type Mutation { - boostTransaction(tezosSpecificParams: TezosSpecificParams, ethereumSpecificParams: EthereumSpecificParams, transactionId: String!, ledger: Ledger!): String! - cancelTransaction(tezosSpecificParams: TezosSpecificParams, ethereumSpecificParams: EthereumSpecificParams, transactionId: String!, ledger: Ledger!): String! -} - -input TezosSpecificParams { - eventSinkProperty: String -} - -input EthereumSpecificParams { - gasPrice: Float - gasLimit: Float -} - -type Subscription { - contractNotification: ContractNotification - contractNotificationForInstrumentAddress(instrumentAddress: String!): ContractNotification - errorNotification: ErrorNotification - heartbeatNotification: HeartbeatNotification - registryNotification: RegistryNotification - dpoNotification: DataProviderNotification -} diff --git a/packages/cast/oracles/schema/dpo.graphql b/packages/cast/oracles/schema/dpo.graphql deleted file mode 100644 index 9d8d3b4..0000000 --- a/packages/cast/oracles/schema/dpo.graphql +++ /dev/null @@ -1,297 +0,0 @@ -type InstrumentPosition { - instrumentAddress: String! - ledger: Ledger! - balance: Float! - legalEntityAddress: String! - symbol: String! - valueInFiat: Float! - currency: Currency! - percentage: Float - unlocked: Float - locked: Float -} - -enum Ledger { - ETHEREUM - TEZOS -} - -enum Currency { - EUR -} - -type InstrumentDetails { - issuer: String! - registrarAgentAddress: String! - settlerAgentAddress: String! - contractAddress: String! - initialSupply: Float! - isinCode: String! - name: String! - symbol: String! - denomination: Float! - divisor: Float! - startDate: Float! - maturityDate: Float! - firstCouponDate: Float! - couponFrequencyInMonths: Float! - interestRateInBips: Float! - callable: Boolean! - isSoftBullet: Boolean! - softBulletPeriodInMonths: Float! - type: String! -} - -type SettlementTransactionParticipantAddresses { - securityDeliverer: String! - securityReceiver: String! - securityIssuer: String! - settler: String! - registrar: String! -} - -type LightSettlementTransaction { - id: String! - participantAccountNumbers: SettlementTransactionParticipantAddresses! -} - -type ContractNotification { - notificationName: ContractNotificationName! - instrumentAddress: String! - transactionHash: ID - lightSettlementTransactions: [LightSettlementTransaction!]! - settlementTransactionOperationType: String! -} - -enum ContractNotificationName { - SubscriptionInitiated - TradeInitiated - RedemptionInitiated - PaymentReceived - PaymentTransferred - Transfer - SettlementTransactionCanceled -} - -type ErrorNotification { - notificationName: ErrorNotificationName! - transactionHash: ID! - message: String -} - -enum ErrorNotificationName { - Error -} - -type LedgerBlockInfo { - ledger: Ledger! - blockNumber: Float! - blockHash: String! -} - -type HeartbeatNotification { - notificationName: HeartbeatNotificationName! - timestamp: Float! - blockInfos: [LedgerBlockInfo!]! -} - -enum HeartbeatNotificationName { - Heartbeat -} - -type RegistryNotification { - notificationName: RegistryNotificationName! - instrumentAddress: String! - instrumentLedger: Ledger! - transactionHash: ID -} - -enum RegistryNotificationName { - InstrumentListed - InstrumentUnlisted -} - -type DataProviderNotification { - transactionHash: ID -} - -type STRSettlementTransaction { - id: String! - settlementType: SettlementTransactionType! - settlementDate: DateTime! - operationId: String! - instrumentPublicAddress: String! - instrumentLedger: Ledger! - deliveryQuantity: Float! - deliverySenderAccountNumber: String! - deliveryReceiverAccountNumber: String! - paymentAmount: Float! - paymentCurrency: Currency! - paymentReceiverAccountNumber: String! - paymentSenderAccountNumber: String! - paymentSenderLegalEntityId: String! - paymentReceiverLegalEntityId: String! - movements: [Movement!]! - hash: String! - tradeId: String - tradeDate: DateTime! - additionalReaderAddresses: [String!] - settlementModel: SettlementModel! - holdableTokenAddress: String - intermediateAccountIBAN: String -} - -enum SettlementTransactionType { - DVP - PFOD - DWP - FOP -} - -""" -A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format. -""" -scalar DateTime - -enum SettlementModel { - DIRECT - INDIRECT -} - -type OracleSettlementTransaction { - id: String! - settlementType: SettlementTransactionType! - settlementDate: DateTime! - operationId: String! - instrumentPublicAddress: String! - instrumentLedger: Ledger! - deliveryQuantity: Float! - deliverySenderAccountNumber: String! - deliveryReceiverAccountNumber: String! - paymentAmount: Float! - paymentCurrency: Currency! - paymentReceiverAccountNumber: String! - paymentSenderAccountNumber: String! - paymentSenderLegalEntityId: String! - paymentReceiverLegalEntityId: String! - movements: [Movement!]! - hash: String! - tradeId: String - tradeDate: DateTime! - additionalReaderAddresses: [String!] - settlementModel: SettlementModel! - holdableTokenAddress: String - intermediateAccountIBAN: String - settlementStatus: SettlementTransactionStatus! -} - -enum SettlementTransactionStatus { - INITIATED - PENDING - ACKNOWLEDGED - REJECTED - UNPROCESSED - PROCESSED - SETTLED - CANCELED -} - -type Movement { - id: String! - settlementTransactions: [STRSettlementTransaction!]! - movementType: MovementType! - senderAccountNumber: String! - receiverAccountNumber: String! - paymentReference: String -} - -enum MovementType { - CASH - TOKEN -} - -type TransactionDetails { - to: String! - methodName: String - methodParameters: String - value: Float -} - -type BlockchainEvent { - eventName: String! - smartContractAddress: String! - blockNumber: Float! - blockHash: String! - transactionId: String! - payload: String! -} - -type TransactionInfo { - id: String! - nonce: Float! - status: TransactionStatus! - lastStatusTimestamp: DateTime! - blockNumber: Float - sendTimestamp: DateTime - sendBlockNumber: Float - replacedTransactionId: String - replacementTransactionId: String - details: TransactionDetails - currentError: String - emittedEvents: [BlockchainEvent!] - blockchainSpecificTransactionInfo: BlockchainSpecificTransactionInfo -} - -enum TransactionStatus { - PENDING - CONFIRMED - REJECTED - CANCELLED -} - -union BlockchainSpecificTransactionInfo = EthereumSpecificTransactionInfo | TezosSpecificTransactionInfo - -type EthereumSpecificTransactionInfo { - gasLimit: Float - gasPrice: Float -} - -type TezosSpecificTransactionInfo { - weNeedAtLeastOneFieldForGraphql: String -} - -type Query { - test: String! - getSettlementTransactions(instrumentLedger: Ledger, instrumentAddress: String): [OracleSettlementTransaction!]! - getSettlementTransactionsByPaymentReference(paymentReference: String): [OracleSettlementTransaction!]! - whoami(ledger: Ledger!): String! - getSettlementTransaction(id: String!): OracleSettlementTransaction - getAllInstruments(ledger: Ledger!): [String!] - getInstrumentDetails(instrumentLedger: Ledger!, contractAddress: String!): InstrumentDetails! - getTransactionInfo(transactionId: String!, ledger: Ledger!): TransactionInfo! - getInstrumentPositions(ledger: Ledger!, instrumentAddress: String!): [InstrumentPosition!]! - getInstrumentPosition(legalEntityAddress: String!, ledger: Ledger!, instrumentAddress: String!): [InstrumentPosition!]! -} - -type Mutation { - boostTransaction(tezosSpecificParams: TezosSpecificParams, ethereumSpecificParams: EthereumSpecificParams, transactionId: String!, ledger: Ledger!): String! - cancelTransaction(tezosSpecificParams: TezosSpecificParams, ethereumSpecificParams: EthereumSpecificParams, transactionId: String!, ledger: Ledger!): String! -} - -input TezosSpecificParams { - eventSinkProperty: String -} - -input EthereumSpecificParams { - gasPrice: Float - gasLimit: Float -} - -type Subscription { - contractNotification: ContractNotification - contractNotificationForInstrumentAddress(instrumentAddress: String!): ContractNotification - errorNotification: ErrorNotification - heartbeatNotification: HeartbeatNotification - registryNotification: RegistryNotification - dpoNotification: DataProviderNotification -} diff --git a/packages/cast/oracles/schema/fio.graphql b/packages/cast/oracles/schema/fio.graphql index b285d37..d596660 100644 --- a/packages/cast/oracles/schema/fio.graphql +++ b/packages/cast/oracles/schema/fio.graphql @@ -111,10 +111,6 @@ enum RegistryNotificationName { InstrumentUnlisted } -type DataProviderNotification { - transactionHash: ID -} - type STRSettlementTransaction { id: String! settlementType: SettlementTransactionType! @@ -293,5 +289,4 @@ type Subscription { errorNotification: ErrorNotification heartbeatNotification: HeartbeatNotification registryNotification: RegistryNotification - dpoNotification: DataProviderNotification } diff --git a/packages/cast/oracles/schema/fro.graphql b/packages/cast/oracles/schema/fro.graphql index c0a2fb3..7c71b29 100644 --- a/packages/cast/oracles/schema/fro.graphql +++ b/packages/cast/oracles/schema/fro.graphql @@ -111,10 +111,6 @@ enum RegistryNotificationName { InstrumentUnlisted } -type DataProviderNotification { - transactionHash: ID -} - type STRSettlementTransaction { id: String! settlementType: SettlementTransactionType! @@ -448,5 +444,4 @@ type Subscription { errorNotification: ErrorNotification heartbeatNotification: HeartbeatNotification registryNotification: RegistryNotification - dpoNotification: DataProviderNotification } diff --git a/packages/cast/oracles/schema/fso.graphql b/packages/cast/oracles/schema/fso.graphql index 6f3cb2e..cb94029 100644 --- a/packages/cast/oracles/schema/fso.graphql +++ b/packages/cast/oracles/schema/fso.graphql @@ -111,10 +111,6 @@ enum RegistryNotificationName { InstrumentUnlisted } -type DataProviderNotification { - transactionHash: ID -} - type STRSettlementTransaction { id: String! settlementType: SettlementTransactionType! @@ -295,5 +291,4 @@ type Subscription { errorNotification: ErrorNotification heartbeatNotification: HeartbeatNotification registryNotification: RegistryNotification - dpoNotification: DataProviderNotification } diff --git a/packages/cast/oracles/schema/fxo.graphql b/packages/cast/oracles/schema/fxo.graphql index 6e3cbf2..702796e 100644 --- a/packages/cast/oracles/schema/fxo.graphql +++ b/packages/cast/oracles/schema/fxo.graphql @@ -111,10 +111,6 @@ enum RegistryNotificationName { InstrumentUnlisted } -type DataProviderNotification { - transactionHash: ID -} - type STRSettlementTransaction { id: String! settlementType: SettlementTransactionType! @@ -292,5 +288,4 @@ type Subscription { errorNotification: ErrorNotification heartbeatNotification: HeartbeatNotification registryNotification: RegistryNotification - dpoNotification: DataProviderNotification } diff --git a/packages/cast/oracles/src/app.dyno.module.ts b/packages/cast/oracles/src/app.dyno.module.ts index 4a98b9f..064be91 100644 --- a/packages/cast/oracles/src/app.dyno.module.ts +++ b/packages/cast/oracles/src/app.dyno.module.ts @@ -12,7 +12,6 @@ import { FIOModule } from './modules/fio/fio.module'; import { FROModule } from './modules/fro/fro.module'; import { FSOModule } from './modules/fso/fso.module'; import { STRModule } from './modules/str/str.module'; -import { DataProviderModule } from './modules/dpo/dataProvider.module'; import { SharedModule } from './shared.module'; import { Mode } from './mode'; import { LoggerOptions } from 'typeorm/logger/LoggerOptions'; @@ -50,10 +49,6 @@ export class AppModule implements NestModule { imports.push(FIOModule); break; - case Mode.DPO: - imports.push(DataProviderModule); - break; - default: this.logger.error(`Unknown mode requested : ${mode}`); return null; diff --git a/packages/cast/oracles/src/mode.ts b/packages/cast/oracles/src/mode.ts index 21edc72..d330629 100644 --- a/packages/cast/oracles/src/mode.ts +++ b/packages/cast/oracles/src/mode.ts @@ -3,5 +3,4 @@ export const enum Mode { FRO = 'fro', FSO = 'fso', FIO = 'fio', - DPO = 'dpo', } diff --git a/packages/cast/oracles/src/modules/dpo/dataProvider.event.constant.ts b/packages/cast/oracles/src/modules/dpo/dataProvider.event.constant.ts deleted file mode 100644 index 9734507..0000000 --- a/packages/cast/oracles/src/modules/dpo/dataProvider.event.constant.ts +++ /dev/null @@ -1 +0,0 @@ -export const DATA_REQUEST_NOTIFICATION = 'dataRequestNotification'; diff --git a/packages/cast/oracles/src/modules/dpo/dataProvider.module.ts b/packages/cast/oracles/src/modules/dpo/dataProvider.module.ts deleted file mode 100644 index a9c69cf..0000000 --- a/packages/cast/oracles/src/modules/dpo/dataProvider.module.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Module } from '@nestjs/common'; -import { FXOModule } from '../fxo/fxo.module'; -import { DataProviderResolver } from './dataProvider.resolver'; -import { DpoService } from './dataProvider.service'; - -@Module({ - imports: [FXOModule], - providers: [DataProviderResolver, DpoService], -}) -export class DataProviderModule {} diff --git a/packages/cast/oracles/src/modules/dpo/dataProvider.resolver.ts b/packages/cast/oracles/src/modules/dpo/dataProvider.resolver.ts deleted file mode 100644 index 49f2db6..0000000 --- a/packages/cast/oracles/src/modules/dpo/dataProvider.resolver.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { getLogger, Logger, HandleLogsAndErrors } from '../../utils/logger'; -/* eslint-disable @typescript-eslint/explicit-function-return-type */ - -import { Query, Resolver } from '@nestjs/graphql'; -import * as log4js from 'log4js'; - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -@Resolver(() => String) -export class DataProviderResolver { - private logger: Logger = getLogger(this.constructor.name); - - public constructor() {} - - // At least one query required to generate a schema - @Query(() => String) - @HandleLogsAndErrors(log4js.levels.DEBUG) - public async test(): Promise { - return 'hello, world'; - } -} diff --git a/packages/cast/oracles/src/modules/dpo/dataProvider.service.ts b/packages/cast/oracles/src/modules/dpo/dataProvider.service.ts deleted file mode 100644 index 71e3c2d..0000000 --- a/packages/cast/oracles/src/modules/dpo/dataProvider.service.ts +++ /dev/null @@ -1,155 +0,0 @@ -import axios from 'axios'; -import { Injectable } from '@nestjs/common'; -import { getLogger, Logger } from '../../utils/logger'; -import { - ForgeBondDataRequestEvent, - DataProviderOracle, - Ledger, -} from '@castframework/cast-interface-v1'; -import { ForgePubSub } from '../../utils/PubSub.wrapper'; -import { DataProviderNotification } from '@castframework/models'; -import { DATA_REQUEST_NOTIFICATION } from './dataProvider.event.constant'; -import { errorAsString } from '../../utils/errorAsString'; -import { BlockchainService } from '../../shared/services/blockchain.service'; -import { asyncForEach } from '../../utils/promiseUtils'; - -@Injectable() -export class DpoService { - private logger: Logger = getLogger(this.constructor.name); - private listenedContracts: Set = new Set(); - - public constructor( - private readonly pubSub: ForgePubSub, - private readonly blockchainService: BlockchainService, - ) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.initialize(); - } - - public async initialize(): Promise { - for (const ledger of this.blockchainService.supportedLedgers) { - try { - const instrumentRegistry = - await this.blockchainService.getRegistryFromLedger( - ledger, - this.logger, - ); - - const contractAddressList = - await instrumentRegistry.getAllInstruments(); - - await asyncForEach(contractAddressList, async (contractAddress) => { - await this.subscribeToNewContract(contractAddress, ledger); - }); - } catch (error) { - this.logger.error( - `Error during ledger[${ledger}] initialization : ${errorAsString( - error, - )}`, - ); - } - } - } - - public async subscribeToNewContract( - contractAddress: string, - LedgerType: Ledger, - from?: number, - ): Promise { - if (this.listenedContracts.has(contractAddress)) { - this.logger.debug( - `[${LedgerType}] Already listening to contract ${contractAddress}`, - ); - return; - } - try { - this.listenedContracts.add(contractAddress); - const contract = await this.blockchainService.getDataProviderOracle( - LedgerType, - contractAddress, - ); - this.logger.debug( - `[${LedgerType}] Start listening to events for contract address: ${contractAddress}${ - from ? ` from block ${from}` : '' - }`, - ); - await this.listenContract(contract, LedgerType, from); - } catch (err) { - this.logger.error( - `[${LedgerType}] Error subscribing to contract ${contractAddress}${ - from ? ` from block ${from}` : '' - } : ${errorAsString(err)}`, - ); - this.listenedContracts.delete(contractAddress); - } - } - - private async listenContract( - contract: DataProviderOracle, - LedgerType: Ledger, - from?: number, - ): Promise { - contract.SubmitRequest().subscribe(async (event) => { - try { - this.logger.debug( - `[${LedgerType}] Received event[${JSON.stringify(event)}]`, - ); - if (event) { - await this.handleSubmitRequestEvent(event, LedgerType); - } - } catch (err) { - this.logger.error( - `[${LedgerType}] Error handling event[${JSON.stringify( - event, - )}] error[${errorAsString(err)}]`, - ); - } - }); - } - - async handleSubmitRequestEvent( - event: ForgeBondDataRequestEvent, - ledger: Ledger, - ): Promise { - const logger = getLogger(this.constructor.name, 'handleSubmitRequestEvent'); - - logger.info( - `Received ${event.eventName} event on ${ledger} for instrument ${event.smartContractAddress} with transaction hash ${event.transactionId}`, - ); - - const mockResponse = await axios.get('http://demo4607115.mockable.io/'); - - const dataProviderOracle = - await this.blockchainService.getDataProviderOracle( - ledger, - event.smartContractAddress, - ); - - const DECIMAL_CONVERSION = 6; - - await dataProviderOracle.WriteResult( - event.payload.id, - mockResponse.data.value, - DECIMAL_CONVERSION, - mockResponse.data.timestamp, - ); - - logger.debug( - `Received ${event.eventName} event on ${ledger} for instrument ${event.smartContractAddress} with transaction hash ${event.transactionId}`, - JSON.stringify(event), - ); - - const notification = new DataProviderNotification('exampleTransactionHash'); - - await this.pubSub.publish(DATA_REQUEST_NOTIFICATION, notification); - } - - public async dataRequest(contractAddress: string): Promise { - const bond = await this.blockchainService.getForgeBond( - Ledger.ETHEREUM, - contractAddress, - ); - const data = await bond.RequestData(); - return data.transactionId; - } -} diff --git a/packages/cast/oracles/src/modules/fro/fro.resolver.ts b/packages/cast/oracles/src/modules/fro/fro.resolver.ts index b2561c0..ff6c152 100644 --- a/packages/cast/oracles/src/modules/fro/fro.resolver.ts +++ b/packages/cast/oracles/src/modules/fro/fro.resolver.ts @@ -17,7 +17,6 @@ import { EVENT_PLATFORM_LEVEL_PREPARED } from './fro.event.constant'; import { FroService } from './fro.service'; import { FroRedemptionService } from './fro.redemption.service'; import { FroOperationService } from './fro.operation.service'; -import { DpoService } from '../dpo/dataProvider.service'; @Resolver(() => String) export class FROResolver { diff --git a/packages/cast/oracles/src/modules/fxo/fxo.resolver.ts b/packages/cast/oracles/src/modules/fxo/fxo.resolver.ts index 4d3d3c6..54ff828 100644 --- a/packages/cast/oracles/src/modules/fxo/fxo.resolver.ts +++ b/packages/cast/oracles/src/modules/fxo/fxo.resolver.ts @@ -6,7 +6,6 @@ import { InstrumentDetails, OracleSettlementTransaction, RegistryNotification, - DataProviderNotification, } from '@castframework/models'; import { Args, @@ -46,7 +45,6 @@ import { TezosSpecificTransactionInfo, } from '@castframework/blockchain-driver-tz'; import { HandleLogsAndErrors } from '../../utils/logger'; -import { DATA_REQUEST_NOTIFICATION } from '../dpo/dataProvider.event.constant'; @ObjectType('TransactionDetails') class TransactionDetails { @@ -321,21 +319,6 @@ export class FXOResolver { return result; } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - @Subscription((returns) => DataProviderNotification, { - nullable: true, - resolve: (value) => value.dpoNotification, - }) - public dpoNotification(): AsyncIterator { - this.logger.debug(`Received subscription DpoNotification`); - const result: AsyncIterator = - this.pubSub.asyncIterator( - DATA_REQUEST_NOTIFICATION, - ); - this.logger.debug(`subscription DpoNotification: ok`); - return result; - } - @Query((returns) => GraphQLTransactionInfo) @HandleLogsAndErrors(log4js.levels.DEBUG) public async getTransactionInfo( From f578c373cb4da6a4c8c45ae8c558fb07cefab423 Mon Sep 17 00:00:00 2001 From: Sterling Date: Mon, 22 Aug 2022 15:07:57 +0200 Subject: [PATCH 4/5] feat: basic dataprovideroracle test --- packages/cast/cast-eth-v1/contracts/OnDemandOracle.sol | 3 --- .../contracts/interfaces/DataProviderOracle.sol | 1 + packages/cast/cast-eth-v1/contracts/tokens/ForgeBond.sol | 5 +++-- .../cast/cast-eth-v1/src/test/tokens/bond/forge-bond.ts | 9 ++++++++- packages/cast/cast-eth-v1/src/test/utils/builders.ts | 7 +++++++ packages/cast/cast-eth-v1/truffle-config.js | 1 + 6 files changed, 20 insertions(+), 6 deletions(-) diff --git a/packages/cast/cast-eth-v1/contracts/OnDemandOracle.sol b/packages/cast/cast-eth-v1/contracts/OnDemandOracle.sol index 4602fd8..dbfca7d 100644 --- a/packages/cast/cast-eth-v1/contracts/OnDemandOracle.sol +++ b/packages/cast/cast-eth-v1/contracts/OnDemandOracle.sol @@ -27,9 +27,6 @@ contract OnDemandOracle is DataProviderOracle, AbstractInstrumentFactory { mapping(uint256 => OracleResult) public oracleResults; mapping(uint256 => OracleRequest) public oracleRequests; - // content to think about, there should also be a type of data asked by the caller - event DataRequest(address caller, uint256 id); // don't know if it is possible - constructor(address owner) public AbstractInstrumentFactory(owner) { lastID = 0; } diff --git a/packages/cast/cast-eth-v1/contracts/interfaces/DataProviderOracle.sol b/packages/cast/cast-eth-v1/contracts/interfaces/DataProviderOracle.sol index e551f1e..5aea141 100644 --- a/packages/cast/cast-eth-v1/contracts/interfaces/DataProviderOracle.sol +++ b/packages/cast/cast-eth-v1/contracts/interfaces/DataProviderOracle.sol @@ -3,4 +3,5 @@ pragma solidity ^0.8.0; interface DataProviderOracle { function SubmitRequest() external; + event DataRequest(address caller, uint256 id); } diff --git a/packages/cast/cast-eth-v1/contracts/tokens/ForgeBond.sol b/packages/cast/cast-eth-v1/contracts/tokens/ForgeBond.sol index 39552e2..58ed763 100644 --- a/packages/cast/cast-eth-v1/contracts/tokens/ForgeBond.sol +++ b/packages/cast/cast-eth-v1/contracts/tokens/ForgeBond.sol @@ -64,6 +64,7 @@ contract ForgeBond is uint256 decimal, uint256 timestamp ); + event DataRequest(address caller, uint256 id); constructor(BasicTokenLibrary.BasicTokenInput memory basicTokenInput) public @@ -186,8 +187,8 @@ contract ForgeBond is return "Bond"; } - function RequestData() external { - DataProviderOracle(0x476059cD57800DB8eB88f67c2Aa38A6fCf8251e0) + function RequestData(address oracleAddress) external { + DataProviderOracle(oracleAddress) .SubmitRequest(); } diff --git a/packages/cast/cast-eth-v1/src/test/tokens/bond/forge-bond.ts b/packages/cast/cast-eth-v1/src/test/tokens/bond/forge-bond.ts index a3f1e9c..add29c4 100644 --- a/packages/cast/cast-eth-v1/src/test/tokens/bond/forge-bond.ts +++ b/packages/cast/cast-eth-v1/src/test/tokens/bond/forge-bond.ts @@ -1,7 +1,7 @@ import { ForgeBondInstance } from '../../../../dist/types'; import * as constants from '../../constants'; import { assertEvent, assertEventArgs } from '../../utils/events'; -import { buildForgeBond } from '../../utils/builders'; +import { buildForgeBond, buildOnDemandOracle } from '../../utils/builders'; import * as faker from 'faker'; const initialSupply = constants.initialSupply; @@ -186,5 +186,12 @@ contract('ForgeBond', (accounts) => { assert.equal(balance.valueOf(), 0, 'Second account has a balance'); }); }); + + it.only('should call DataRequest', async function () { + const OnDemandOracle = await buildOnDemandOracle(constants.owner); + await forgeBond.RequestData(OnDemandOracle.address).then((result) => { + assert.equal(assertEvent(result, 'DataRequest'), 0, 'DataRequest event not found'); + }); + }); }); }); diff --git a/packages/cast/cast-eth-v1/src/test/utils/builders.ts b/packages/cast/cast-eth-v1/src/test/utils/builders.ts index 77ea212..4637b2d 100644 --- a/packages/cast/cast-eth-v1/src/test/utils/builders.ts +++ b/packages/cast/cast-eth-v1/src/test/utils/builders.ts @@ -31,3 +31,10 @@ export async function buildForgeBond( return ForgeBond.new(bondParameters); } + +const OnDemandOracle = artifacts.require('OnDemandOracle'); +export async function buildOnDemandOracle( + owner: string +) { + return OnDemandOracle.new(owner); +} diff --git a/packages/cast/cast-eth-v1/truffle-config.js b/packages/cast/cast-eth-v1/truffle-config.js index 2974a88..05dfd57 100644 --- a/packages/cast/cast-eth-v1/truffle-config.js +++ b/packages/cast/cast-eth-v1/truffle-config.js @@ -97,6 +97,7 @@ if (typeof networkFolder !== 'string') { module.exports = { contracts_build_directory: "./dist/contracts", migrations_directory: "./dist/migrations", + test_directory: "./dist/test", plugins: ['solidity-coverage', 'truffle-security'], mocha: { // not working currently because globals(artifacts, web3, assert, expect) are not shared between processes From aee7e3d89063d8548e579c57ddbb535cf7cf7157 Mon Sep 17 00:00:00 2001 From: Sterling Date: Mon, 22 Aug 2022 15:18:33 +0200 Subject: [PATCH 5/5] feat: basic consumedata test --- .../cast-eth-v1/src/test/tokens/bond/forge-bond.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/cast/cast-eth-v1/src/test/tokens/bond/forge-bond.ts b/packages/cast/cast-eth-v1/src/test/tokens/bond/forge-bond.ts index add29c4..f5aed76 100644 --- a/packages/cast/cast-eth-v1/src/test/tokens/bond/forge-bond.ts +++ b/packages/cast/cast-eth-v1/src/test/tokens/bond/forge-bond.ts @@ -3,6 +3,7 @@ import * as constants from '../../constants'; import { assertEvent, assertEventArgs } from '../../utils/events'; import { buildForgeBond, buildOnDemandOracle } from '../../utils/builders'; import * as faker from 'faker'; +import { timeStamp } from 'console'; const initialSupply = constants.initialSupply; const currentSupply = constants.currentSupply; @@ -187,11 +188,22 @@ contract('ForgeBond', (accounts) => { }); }); - it.only('should call DataRequest', async function () { + it('should call DataRequest', async function () { const OnDemandOracle = await buildOnDemandOracle(constants.owner); await forgeBond.RequestData(OnDemandOracle.address).then((result) => { assert.equal(assertEvent(result, 'DataRequest'), 0, 'DataRequest event not found'); }); }); + + it('should call ConsumeData', async function () { + const OnDemandOracle = await buildOnDemandOracle(constants.owner); + const euriborResult: BN = 25 as unknown as BN; + const decimal = 6; + const timeStamp: BN = Date.now() as unknown as BN; + await forgeBond.ConsumeData(euriborResult, decimal, timeStamp).then(async (result) => { + assert.equal(await forgeBond.latestEuriborResult(), euriborResult, 'Euribor Result was not saved'); + assert.equal(await forgeBond.latestTimestamp(), timeStamp, 'Euribor Result was not saved'); + }); + }); }); });