diff --git a/.github/workflows/indy-besu.yml b/.github/workflows/indy-besu.yml index a56842e6..cd3efbab 100644 --- a/.github/workflows/indy-besu.yml +++ b/.github/workflows/indy-besu.yml @@ -2,7 +2,7 @@ name: CI on: pull_request: - paths: "indy-besu/**" + paths: "**" workflow_dispatch: @@ -18,10 +18,10 @@ jobs: node-version: "20.x" - name: Install dependencies run: yarn install - working-directory: indy-besu/smart_contracts + working-directory: smart_contracts - name: Lint run: yarn lint-check - working-directory: indy-besu/smart_contracts + working-directory: smart_contracts test-contracts: needs: lint-contracts @@ -35,16 +35,15 @@ jobs: node-version: "20.x" - name: Install dependencies run: yarn install - working-directory: indy-besu/smart_contracts + working-directory: smart_contracts - name: Unit tests run: yarn test - working-directory: indy-besu/smart_contracts + working-directory: smart_contracts - name: Run localnet run: ./network/scripts/run.sh && sleep 40 - working-directory: indy-besu - name: Demos run: yarn demos - working-directory: indy-besu/smart_contracts + working-directory: smart_contracts lint-vdr: runs-on: ubuntu-latest @@ -57,7 +56,7 @@ jobs: toolchain: stable - name: Lint run: cargo fmt --check - working-directory: indy-besu/vdr + working-directory: vdr store-artifacts: needs: lint-vdr @@ -71,15 +70,15 @@ jobs: node-version: "20.x" - name: Install dependencies run: yarn add hardhat - working-directory: indy-besu/smart_contracts + working-directory: smart_contracts - name: Compile smart contracts run: yarn compile - working-directory: indy-besu/smart_contracts + working-directory: smart_contracts - name: Archive contract artifacts uses: actions/upload-artifact@v3 with: name: smart-contracts-artifacts - path: indy-besu/smart_contracts/artifacts/** + path: smart_contracts/artifacts/** retention-days: 3 test-vdr: @@ -96,10 +95,9 @@ jobs: uses: actions/download-artifact@v3 with: name: smart-contracts-artifacts - path: indy-besu/smart_contracts/artifacts + path: smart_contracts/artifacts - name: Run localnet run: ./network/scripts/run.sh && sleep 40 - working-directory: indy-besu - name: Test run: cargo test --features=ledger_test -- --test-threads=1 - working-directory: indy-besu/vdr + working-directory: vdr diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..9b1a58c9 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,13 @@ +## How to contribute + +You are encouraged to contribute to the repository by **forking and submitting a pull request**. + +For significant changes, please open an issue first to discuss the proposed changes to avoid re-work. + +(If you are new to GitHub, you might start with a [basic tutorial](https://help.github.com/articles/set-up-git) and check out a more detailed guide to [pull requests](https://help.github.com/articles/using-pull-requests/).) + +Pull requests will be evaluated by the repository guardians on a schedule and if deemed beneficial will be committed to the master. Pull requests should have a descriptive name and include an summary of all changes made in the pull request description. + +If you would like to propose a significant change, please open an issue first to discuss the work with the community. + +All contributors retain the original copyright to their stuff, but by contributing to this project, you grant a world-wide, royalty-free, perpetual, irrevocable, non-exclusive, transferable license to all users **under the terms of the license under which this project is distributed.** \ No newline at end of file diff --git a/LICENSE b/LICENSE index 261eeb9e..bf1d61ca 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,4 @@ + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -175,18 +176,8 @@ END OF TERMS AND CONDITIONS - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] + Copyright 2017 Sovrin Foundation + Copyright 2020 Province of British Columbia Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -198,4 +189,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. + limitations under the License. \ No newline at end of file diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 00000000..fcb917c6 --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,99 @@ +# Maintainers + + + +## Active Maintainers + +| Name | Github | LFID | +|---------------------|--------------------|------| +| Artem Ivanov | Artemkaaas | | +| Renata Toktar | Toktar | | +| Alexander Sherbakov | ashcherbakov | | +| Wade Barnes | WadeBarnes | | + +## Becoming a Maintainer + +Indy-Besu welcomes community contribution. +Each community member may progress to become a maintainer. + +How to become a maintainer: + +- Contribute significantly to the code in this repository. + +### Maintainers contribution requirement + +The requirement to be able to be proposed as a maintainer is: + +- 5 significant changes on code have been authored in this repos by the proposed maintainer and accepted (merged PRs). + +### Maintainers approval process + +The following steps must occur for a contributor to be "upgraded" as a maintainer: + +- The proposed maintainer has the sponsorship of at least one other maintainer. + - This sponsoring maintainer will create a proposal PR modifying the list of + maintainers. (see [proposal PR template](#proposal-pr-template).) + - The proposed maintainer accepts the nomination and expresses a willingness + to be a long-term (more than 6 month) committer by adding a comment in the proposal PR. + - The PR will be communicated in all appropriate communication channels + including at least [indy-contributors channel on Hyperledger Discord](https://discord.gg/hyperledger), + the [mailing list](https://lists.hyperledger.org/g/indy) + and any maintainer/community call. +- Approval by at least 3 current maintainers within two weeks of the proposal or + an absolute majority (half the total + 1) of current maintainers. + - Maintainers will vote by approving the proposal PR. +- No veto raised by another maintainer within the voting timeframe. + - All vetoes must be accompanied by a public explanation as a comment in the + proposal PR. + - A veto can be retracted, in that case the voting timeframe is reset and all approvals are removed. + - It is bad form to veto, retract, and veto again. + +The proposed maintainer becomes a maintainer either: + +- when two weeks have passed without veto since the third approval of the proposal PR, +- or an absolute majority of maintainers approved the proposal PR. + +In either case, no maintainer raised and stood by a veto. + +## Removing Maintainers + +Being a maintainer is not a status symbol or a title to be maintained indefinitely. + +It will occasionally be necessary and appropriate to move a maintainer to emeritus status. + +This can occur in the following situations: + +- Resignation of a maintainer. +- Violation of the Code of Conduct warranting removal. +- Inactivity. + - A general measure of inactivity will be no commits or code review comments + for two reporting quarters, although this will not be strictly enforced if + the maintainer expresses a reasonable intent to continue contributing. + - Reasonable exceptions to inactivity will be granted for known long term + leave such as parental leave and medical leave. +- Other unspecified circumstances. + +As for adding a maintainer, the record and governance process for moving a +maintainer to emeritus status is recorded using review approval in the PR making that change. + +Returning to active status from emeritus status uses the same steps as adding a +new maintainer. + +Note that the emeritus maintainer always already has the required significant contributions. +There is no contribution prescription delay. + +## Proposal PR template + +```markdown +I propose to add [maintainer github handle] as a Indy-Besu project maintainer. + +[maintainer github handle] contributed with many high quality commits: + +- [list significant achievements] + +Here are [their past contributions on Indy-Besu project](https://github.com/hyperledger/indy-besu/commits?author=[user github handle]). + +Voting ends two weeks from today. + +For more information on this process see the Becoming a Maintainer section in the MAINTAINERS.md file. +``` diff --git a/README.md b/README.md index aa316030..2d74b10b 100644 --- a/README.md +++ b/README.md @@ -2,38 +2,40 @@ ## Goals and ideas -* Provide a replacement for [Hyperledger Indy](https://www.hyperledger.org/projects/hyperledger-indy) ecosystem that provides support for verifiable credentials: - * Components to replace: - * Distributed ledger: [Indy Node](https://github.com/hyperledger/indy-node) and [Indy Plenum](https://github.com/hyperledger/indy-plenum) - * Client library: [Indy SDK](https://github.com/hyperledger/indy-sdk/tree/main) - * Capability to migrate the data from the original Indy Ledger +* Provide a replacement for [Hyperledger Indy](https://www.hyperledger.org/projects/hyperledger-indy) ecosystem that + provides support for verifiable credentials: + * Components to replace: + * Distributed ledger: [Indy Node](https://github.com/hyperledger/indy-node) + and [Indy Plenum](https://github.com/hyperledger/indy-plenum) + * Client library: [Indy SDK](https://github.com/hyperledger/indy-sdk/tree/main) + * Capability to migrate the data from the original Indy Ledger * Distributed ledger requirements: - * Public Permissioned Blockchain - * Control the validator nodes - * Control the user permissions - * EVM compatible Blockchain - * Capability to deploy on different networks - * Based on existing open-source blockchain framework with a good performance, sufficient adoption, and wide community - * Capability to work without tokens and fees - * Stable consensus protocol + * Public Permissioned Blockchain + * Control the validator nodes + * Control the user permissions + * EVM compatible Blockchain + * Capability to deploy on different networks + * Based on existing open-source blockchain framework with a good performance, sufficient adoption, and wide + community + * Capability to work without tokens and fees + * Stable consensus protocol * Functional requirements: - * Interoperability: - * Capability to use existing DID's and identifiers: - * Support [indy](https://hyperledger.github.io/indy-did-method/) DID method - * Support [sov](https://sovrin-foundation.github.io/sovrin/spec/did-method-spec-template.html) DID method - * Identifiers previously stored on the client side should be resolvable on the new Ledger - * Capability to use the ledger as an [AnonCreds Registry](https://hyperledger.github.io/anoncreds-methods-registry/) - * Compatibility with the latest [AnonCreds Specification](https://hyperledger.github.io/anoncreds-spec/) - * Extensibility: - * Capability to integrate new pieces of functionality easily - * Capability to use [ETHR](https://github.com/decentralized-identity/ethr-did-resolver/blob/master/doc/did-method-spec.md) DID method - * Integration with the [AnonCreds Registry](https://hyperledger.github.io/anoncreds-methods-registry/) - * Integration with `Permissioned` modules - * Data validity: - * Neglect `gas` efficiency in favour general validation of the stored data - * Basic [DID Documents](https://www.w3.org/TR/did-core/) validation - * Basic [AnonCreds entities](https://hyperledger.github.io/anoncreds-spec/#anoncreds-setup-data-flow) validation - * Basic state consistency validation + * Interoperability: + * Capability to use existing DID's and identifiers: + * Support [indy](https://hyperledger.github.io/indy-did-method/) DID method + * Support [sov](https://sovrin-foundation.github.io/sovrin/spec/did-method-spec-template.html) DID method + * Identifiers previously stored on the client side should be resolvable on the new Ledger + * Capability to use the ledger as + an [AnonCreds Registry](https://hyperledger.github.io/anoncreds-methods-registry/) + * Compatibility with the latest [AnonCreds Specification](https://hyperledger.github.io/anoncreds-spec/) + * Extensibility: + * Capability to integrate new pieces of functionality easily + * Capability to + use [ETHR](https://github.com/decentralized-identity/ethr-did-resolver/blob/master/doc/did-method-spec.md) DID + method + * Integration with the [AnonCreds Registry](https://hyperledger.github.io/anoncreds-methods-registry/) + * Integration with `Permissioned` modules + * Do only basic state consistency validation ## Design documentation @@ -45,7 +47,10 @@ See [design document](./docs/README.md) covering the main ledger aspects. - [Docker and Docker-compose](https://docs.docker.com/compose/install/) v2 or higher -> ⚠️ **Note**: If on MacOS or Windows, please ensure that you allow docker to use upto 4G of memory under the _Resources_ section. The [Docker for Mac](https://docs.docker.com/docker-for-mac/) and [Docker Desktop](https://docs.docker.com/docker-for-windows/) sites have details on how to do this at the "Resources" heading +> ⚠️ **Note**: If on MacOS or Windows, please ensure that you allow docker to use upto 4G of memory under the +_Resources_ section. The [Docker for Mac](https://docs.docker.com/docker-for-mac/) +> and [Docker Desktop](https://docs.docker.com/docker-for-windows/) sites have details on how to do this at the " +> Resources" heading ### Commands @@ -57,7 +62,7 @@ See [design document](./docs/README.md) covering the main ledger aspects. ```bash ./network/scripts/run.sh --blockscout ``` - or + or ```bash ./network/scripts/run.sh -b ``` @@ -76,4 +81,20 @@ See [design document](./docs/README.md) covering the main ledger aspects. See [README.md](/smart_contracts/README.md). +## Client library +[Rust library](./vdr/README.md) representing a convenient client for connecting to an Indy-Besu node, building and +executing transactions and queries. + +## Contributing + +Pull requests are welcome! Please read our [contributions guide](./CONTRIBUTING.md) +and submit your PRs. We enforce [developer certificate of origin](https://developercertificate.org/) (DCO) commit +signing. See guidance [here](https://github.com/apps/dco). + +We also welcome issues submitted about problems you encounter in using +`Indy-Besu`, `VDR` or any of the VDR wrappers. + +## License + +[Apache License Version 2.0](./LICENSE) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..52dd88ef --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,11 @@ +# Hyperledger Security Policy + +## Reporting a Security Bug + +If you think you have discovered a security issue in any of the Hyperledger projects, we'd love to hear from you. We will take all security bugs seriously and if confirmed upon investigation we will patch it within a reasonable amount of time and release a public security bulletin discussing the impact and credit the discoverer. + +There are two ways to report a security bug. The easiest is to email a description of the flaw and any related information (e.g. reproduction steps, version) to [security at hyperledger dot org](mailto:security@hyperledger.org). + +The other way is to file a confidential security bug in our [JIRA bug tracking system](https://jira.hyperledger.org). Be sure to set the “Security Level” to “Security issue”. + +The process by which the Hyperledger Security Team handles security bugs is documented further in our [Defect Response page](https://wiki.hyperledger.org/display/HYP/Defect+Response) on our [wiki](https://wiki.hyperledger.org). \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 6ee221f3..fd515942 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,17 +17,10 @@ x-besu-def: /opt/besu/bin/besu \ --config-file=/config/config.toml \ --p2p-host=$$(hostname -i) \ + --revert-reason-enabled=true \ --rpc-http-api=EEA,WEB3,ETH,NET,TRACE,DEBUG,ADMIN,TXPOOL,PERM,${BESU_CONS_ALGO:-QBFT} \ --rpc-ws-api=EEA,WEB3,ETH,NET,TRACE,DEBUG,ADMIN,TXPOOL,PERM,${BESU_CONS_ALGO:-QBFT} ; - - - - - - - - x-ethsignerProxy-def: ðsignerProxy-def image: consensys/ethsigner:${ETHSIGNER_VERSION:-latest} @@ -176,16 +169,6 @@ services: quorum-dev-quickstart: ipv4_address: 172.16.239.40 - - - - - - - - - - prometheus: image: "prom/prometheus" volumes: @@ -234,11 +217,6 @@ services: quorum-dev-quickstart: ipv4_address: 172.16.239.35 - - - - - volumes: public-keys: prometheus: diff --git a/docs/README.md b/docs/README.md index 058f8058..d65db3b6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,5 +1,11 @@ ## Design documents +### Diagrams + +- [Components Overview](./design/conmponents.png) +- [Deployed Smart Contracts](./design/contracts.png) +- [Flow](./design/flow.png) + ### Modules - Network Permission modules: @@ -8,12 +14,19 @@ - access control - first level validation: whether to accept write transactions (execute target contract method) from a given account - [Upgrading contracts](design/upgradability.md) - control versions of deployed contracts (proposing and approving new versions). - [Validators node management](design/network.md) - control the list of network validator nodes -- [DID Methods](design/did-registry.md) - Supported DID methods -- Registries: - - [DID Document Registry](design/did-registry.md) +- Identity: + - [DID Method](design/did-method.md) - Supported DID method - [CL Registry](design/cl-registry.md) -- [VDR](design/vdr.md) - design of VDR library +- [Client](design/vdr.md) - design of VDR library -## Migration documents +### Migration documents - [Indy Migration](migrtion/migration.md) + +### Development designs + +- [Roadmap](./roadmap.md) +- [DID and CL registers approach](./design/registry.md) +- [Transaction Endorsement](./design/endorsement.md) +- [Contract upgradability](./design/upgradability.md) +- [Legacy identifiers support](./design/legacy-identifiers-support.md) diff --git a/docs/design/cl-registry.md b/docs/design/cl-registry.md index abe81a9f..5461ef30 100644 --- a/docs/design/cl-registry.md +++ b/docs/design/cl-registry.md @@ -1,5 +1,16 @@ # CL Registry +## Design + +Smart contracts for schema and credential definition registries are designed to follow an approach used for DID:ethr +method: + +* Contract Events are used for storing data +* Contracts hold mapping for more efficient events look up +* Gas efficient data types are used in contract method +* Provided methods for delegating signing + * Nonce is not needed because only `create` methods provided (no `update` method) + ## Schema ### ID Syntax @@ -9,60 +20,30 @@ | parameter | value | |-------------|-----------------------------------------------------------------| | id | “did:” method-name “:” namespace “:” method-specific-id | -| method-name | “indy2”, “indy”, “sov”, “ethr” | +| method-name | “ethr” | | namespace | “testnet”/"mainnet" | | indy-id | /anoncreds/v0/SCHEMA// | ``` -Example: did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu/anoncreds/v0/SCHEMA/BasicIdentity/1.0.0 +Example: did:ethr:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu/anoncreds/v0/SCHEMA/BasicIdentity/1.0.0 ``` ### Storage format -* Schemas collection: - * Description: Mapping holding the list of Schema ID's to their data and metadata. +* Created schemas mapping: + * Description: Mapping to track created schemas by their id to the block number when it was created. * Format: ``` - mapping(string id => SchemaRecord schemaRecord); - - struct SchemaRecord { - string data; - SchemaMetadata metadata; - } - - struct SchemaMetadata { - uint256 created; - } + mapping(bytes32 id => uint block); ``` * Example: ``` { - "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu/anoncreds/v0/SCHEMA/BasicIdentity/1.0.0": { - schema: "{ - "issuerId": "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu", - "name": "BasicIdentity", - "version": "1.0.0", - "attrNames": ["First Name", "Last Name"] - }", - metadata: { - created: 1234 - }, - }, + "0x8ae64c08cf45da3364623a7235a9e7d132fdc8e9f6e63858b53a90d9db32c3af": 110, ... } ``` -#### Types definition - -##### Schema - -Schema must match to -the [specification](https://hyperledger.github.io/anoncreds-spec/#schema-publisher-publish-schema-object). - -##### Schema Metadata - -* `created` - timestamp of schema creation. - ### Transactions (Smart Contract's methods) Contract name: **SchemaRegistry** @@ -70,57 +51,86 @@ Contract name: **SchemaRegistry** #### Create a new schema * Method: `createSchema` - * Description: Transaction to create a new AnonCreds Schema + * Description: Transaction to create a new AnonCreds Schema matching to the [specification](https://hyperledger.github.io/anoncreds-spec/#schema-publisher-publish-schema-object) * Parameters: - * `id` - Id of schema to be created - * `issuerId` - Id of schema issuer - * `schema` - AnonCreds schema as JSON string + * `identity` - Account address of schema issuer + * `id` - KECCAK256 hash of schema id to be created + * `schema` - AnonCreds Schema object as bytes * Restrictions: * Schema id must be unique. - * Corresponding issuer DID must exist, be active, and owned by sender. + * Corresponding issuer account must exist and owned by sender. * Format: ``` SchemaRegistry.createSchema( - string calldata id, - string calldata issuerId, - string calldata schema + address identity, + bytes32 id, + bytes schema ) ``` + * Raised Event: + ``` + SchemaCreated(bytes32 indexed id, address identity, bytes schema)` + ``` * Example: ``` SchemaRegistry.createSchema( - "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu/anoncreds/v0/SCHEMA/BasicIdentity/1.0.0", - "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu", - "{ - "issuerId": "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu", - "name": "BasicIdentity", - "version": "1.0.0", - "attrNames": ["First Name", "Last Name"] - }" + "0x173CC02518a355040F5Faee93D3AAAb1259F010c", + "0x8ae64c08cf45da3364623a7235a9e7d132fdc8e9f6e63858b53a90d9db32c3af", + [34, 123, 92, 34, 105, 100, 92, 34, 58, 92, 34, 100, ...] ) - * Raised Event: - * `SchemaCreated(schemaId)` - -#### Resolve schema -* Method: `resolveSchema` - * Description: Transaction to resolve Schema for giving id +* Method: `createSchemaSigned` + * Description: Transaction to endorse a new AnonCreds Schema (off-chain author signature) * Parameters: - * `id` - ID of the Schema to resolve + * `identity` - Account address of schema issuer + * `sigV` - Part of EcDSA signature. + * `sigR` - Part of EcDSA signature. + * `sigS` - Part of EcDSA signature. + * `id` - KECCAK256 hash of schema id to be created + * `schema` - AnonCreds schema object as bytes * Restrictions: - * Schema must exist. + * Schema id must be unique. + * Corresponding issuer account must exist and owned by sender. * Format: ``` - SchemaRegistry.resolveSchema( - string id - ) returns (SchemaRecord sschemaRecord) + SchemaRegistry.createSchemaSigned( + address identity, + uint8 sigV, + bytes32 sigR, + bytes32 sigS, + bytes32 id, + bytes schema + ) ``` + * Raised Event: + ``` + SchemaCreated(bytes32 indexed id, address identity, bytes schema)` + ``` * Example: ``` - SchemaRegistry.resolveSchema( - "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu/anoncreds/v0/SCHEMA/BasicIdentity/1.0.0" + SchemaRegistry.createSchemaSigned( + "0x173CC02518a355040F5Faee93D3AAAb1259F010c", + 27, + [1, 2, 3, 4, 5, 6, 7, 8, ...], + [11, 21, 33, 44, 55, 73, ...], + "0x8ae64c08cf45da3364623a7235a9e7d132fdc8e9f6e63858b53a90d9db32c3af", + [34, 123, 92, 34, 105, 100, 92, 34, 58, 92, 34, 100, ...] ) - * Raised Event: `None` + +#### Resolve schema + +In order to resolve a Schema the following steps must be done: + +* Call `SchemaRegistry.created(bytes32 id)` contract method passing KECCAK256 hash of target Schema id to get the block number when the Schema was created. + * Schemas are stored in the transaction logs. + * Query log events from the whole transaction history is very inefficient lookup mechanism. +* Query ledger for `SchemaCreated` events specifying following data: + * `address`: Address of `SchemaRegistry + * `topics`: KECCAK256 hash of target Schema id as the second topic + * `from_block`: block number when the Schema was created + * `to_block`: block number when the Schema was created +* If result is empty, schema does not exist. +* If result contains more than one event, its unexpected case and ledger history is broken ## Credential Definition @@ -141,51 +151,20 @@ Example: did:indy2:sovrin:Gs6cQcvrtWoZKsbBhD3dQJ/anoncreds/v0/CLAIM_DEF/56495/mc ### Storage format -* Credential Definitions collection: - * Description: Mapping holding the list of Credential Definition ID's to their data and metadata. +* Created credential definitions mapping: + * Description: Mapping to track created credential definitions by their id to the block number when it was created. * Format: ``` - mapping(string id => CredentialDefinitionRecord credentialDefinitionRecord); - - struct CredentialDefinitionRecord { - string credDef; - CredentialDefinitionMetadata metadata; - } - - struct CredentialDefinitionMetadata { - uint256 created; - } + mapping(bytes32 id => uint block); ``` * Example: ``` { - "did:indy2:sovrin:Gs6cQcvrtWoZKsbBhD3dQJ/anoncreds/v0/CLAIM_DEF/56495/mctc": { - credDef: "{ - "issuerId": "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu", - "schemaId": "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu/anoncreds/v0/SCHEMA/BasicIdentity/1.0.0", - "type": "CL", - "tag": "BasicIdentity", - "value": "{ ... }" - }", - metadata: { - created: 1234 - }, - }, + "0x8ae64c08cf45da3364623a7235a9e7d132fdc8e9f6e63858b53a90d9db32c3af": 110, ... } ``` -#### Types definition - -##### CredentialDefinitionData - -Schema must match to -the [specification](https://hyperledger.github.io/anoncreds-spec/#generating-a-credential-definition-without-revocation-support). - -##### CredentialDefinitionMetadata - -* `created` - timestamp of credential definition creation. - ### Transactions (Smart Contract's methods) Contract name: **CredentialDefinitionRegistry** @@ -193,61 +172,93 @@ Contract name: **CredentialDefinitionRegistry** #### Create a new credential definition * Method: `createCredentialDefinition` - * Description: Transaction to create a new AnonCreds Credential Definition + * Description: Transaction to create a new AnonCreds Credential Definition matching to the [specification](https://hyperledger.github.io/anoncreds-spec/#generating-a-credential-definition-without-revocation-support) * Parameters: - * `id` - Id of credential definition to be created - * `issuerId` - Id of credential definition issuer - * `schemaId` - Id of credential definition schema - * `credDef` - AnonCreds credential definition as JSON string + * `identity` - Account address of credential definition issuer + * `id` - KECCAK256 hash of credential definition id to be created + * `schemaId` - KECCAK256 hash of schema id to be created + * `credDef` - AnonCreds Credential Definition object as bytes * Restrictions: * Credential Definition must be unique. - * Corresponding issuer DID must exist, be active, and owned by sender. + * Corresponding issuer DID must exist and owned by sender. * Corresponding schema must exist. * Format: ``` CredentialDefinitionRegistry.createCredentialDefinition( - string calldata id, - string calldata issuerId, - string calldata schemaId, - string calldata credDef + address identity, + bytes32 id, + bytes32 schemaId, + bytes credDef ) ``` + * Raised Event: + ``` + CredentialDefinitionCreated(bytes32 indexed id, address identity, bytes credDef)` + ``` * Example: ``` - CredentialDefinitionRegistry.createCredentialDefinition( - "did:indy2:sovrin:Gs6cQcvrtWoZKsbBhD3dQJ/anoncreds/v0/CLAIM_DEF/56495/BasicIdentity", - "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu", - "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu/anoncreds/v0/SCHEMA/BasicIdentity/1.0.0", - "{ - "issuerId": "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu", - "schemaId": "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu/anoncreds/v0/SCHEMA/BasicIdentity/1.0.0", - "type": "CL", - "tag": "BasicIdentity", - "value": "{.......}", - }" + CredentialDefinitionCreated.createCredentialDefinition( + "0x173CC02518a355040F5Faee93D3AAAb1259F010c", + "0x76943530d3587e81f029e8ce20edb64f9254350d81c59ecf6b7e3ed553e9a8f6", + "0x8ae64c08cf45da3364623a7235a9e7d132fdc8e9f6e63858b53a90d9db32c3af", + [34, 123, 92, 34, 105, 100, 92, 34, 58, 92, 34, 100, ...] ) - * Raised Event: - * `CredentialDefinitionCreated(credentialDefinitionId)` -#### Resolve credential definition - -* Method: `resolveCredentialDefinition` - * Description: Transaction to resolve Credential Definition for giving id +* Method: `createCredentialDefinitionSigned` + * Description: Transaction to endorse a new AnonCreds Credential Definition (off-chain author signature) * Parameters: - * `id` - Id of credential definition to be resolved + * `identity` - Account address of credential definition issuer + * `sigV` - Part of EcDSA signature. + * `sigR` - Part of EcDSA signature. + * `sigS` - Part of EcDSA signature. + * `id` - KECCAK256 hash of credential definition id to be created + * `schemaId` - KECCAK256 hash of schema id + * `credDef` - AnonCreds credential definition object as bytes * Restrictions: - * Credential Definition must exist. + * Credential Definition must be unique. + * Corresponding issuer DID must exist and owned by sender. + * Corresponding schema must exist. * Format: ``` - CredentialDefinitionRegistry.resolveCredentialDefinition( - string calldata id - ) returns (CredentialDefinitionRecord credentialDefinitionRecord) + CredentialDefinitionRegistry.createCredentialDefinitionSigned( + address identity, + uint8 sigV, + bytes32 sigR, + bytes32 sigS, + bytes32 id, + bytes32 schemaId, + bytes credDef + ) ``` + * Raised Event: + ``` + CredentialDefinitionCreated(bytes32 indexed id, address identity, bytes credDef)` + ``` * Example: ``` - CredentialDefinitionRegistry.resolveCredentialDefinition( - "did:indy2:sovrin:Gs6cQcvrtWoZKsbBhD3dQJ/anoncreds/v0/CLAIM_DEF/56495/BasicIdentity" + CredentialDefinitionRegistry.createCredentialDefinitionSigned( + "0x173CC02518a355040F5Faee93D3AAAb1259F010c", + 27, + [1, 2, 3, 4, 5, 6, 7, 8, ...], + [11, 21, 33, 44, 55, 73, ...], + "0x76943530d3587e81f029e8ce20edb64f9254350d81c59ecf6b7e3ed553e9a8f6", + "0x8ae64c08cf45da3364623a7235a9e7d132fdc8e9f6e63858b53a90d9db32c3af", + [34, 123, 92, 34, 105, 100, 92, 34, 58, 92, 34, 100, ...] ) - * Raised Event: `None` + +#### Resolve credential definition + +In order to resolve a Credential Definition the following steps must be done: + +* Call `CredentialDefinitionRegistry.created(bytes32 id)` contract method passing KECCAK256 hash of target Credential Definition id to get the block number when the Credential Definition was created. + * Credential Definitions are stored in the transaction logs. + * Query log events from the whole transaction history is very inefficient lookup mechanism. +* Query ledger for `CredentialDefinitionCreated` events specifying following data: + * `address`: Address of `CredentialDefinitionRegistry` + * `topics`: KECCAK256 hash of target Credential Definition id as the second topic + * `from_block`: block number when the Credential Definition was created + * `to_block`: block number when the Credential Definition was created +* If result is empty, Credential Definition does not exist. +* If result contains more than one event, its unexpected case and ledger history is broken diff --git a/docs/design/conmponents.png b/docs/design/conmponents.png index d677834e..e5d0c2d2 100644 Binary files a/docs/design/conmponents.png and b/docs/design/conmponents.png differ diff --git a/docs/design/conmponents.puml b/docs/design/conmponents.puml index be627ecb..5a717d34 100644 --- a/docs/design/conmponents.puml +++ b/docs/design/conmponents.puml @@ -7,9 +7,7 @@ package "Ethereum Network" { component [Account Control] component [Validator Control] component [Upgrade Control] - component [Indy Did Registry] component [Ethereum Did Registry] - component [Universal Did Resolver] component [Schema Registry] component [Credential Definition Registry] } @@ -39,6 +37,7 @@ together { Interact with a network node - ping network - submit transaction + - submit event query - retrieve transaction receipt end note } diff --git a/docs/design/contracts.png b/docs/design/contracts.png index fdc23fb9..7c2d886d 100644 Binary files a/docs/design/contracts.png and b/docs/design/contracts.png differ diff --git a/docs/design/contracts.puml b/docs/design/contracts.puml index 8bfc95b0..957a9593 100644 --- a/docs/design/contracts.puml +++ b/docs/design/contracts.puml @@ -42,14 +42,6 @@ package "Smart Contracts" { package "DID" { - component [Indy Did Registry] - note bottom of [Indy Did Registry] - Manage `indy2` DID method records - - legacy DID identifier - - did doc stored in the contract storage - - many-to-one relationship with account - end note - component [Ethereum Did Registry] note bottom of [Ethereum Did Registry] Manage `ethr` DID method records @@ -59,12 +51,6 @@ package "Smart Contracts" { - uses events approach - extended to control versioning end note - - component [Universal Did Resolver] - note bottom of [Universal Did Resolver] - Resolve Issuer DID from various DID registries - - used by CL contracts to verify did existence and owner - end note } package "CL" { @@ -72,21 +58,23 @@ package "Smart Contracts" { component [Schema Registry] note bottom of [Schema Registry] Store CL schemas + - uses events approach + - uses KECCAK256 hash of id for indexing end note component [Credential Definition Registry] note top of [Credential Definition Registry] Store CL Credential Definitions + - uses events approach + - uses KECCAK256 hash of id for indexing end note } } [Identity] --> [Role Control] [Identity] --> [Upgrade Control] - [Universal Did Resolver] --> [Indy Did Registry] - [Universal Did Resolver] --> [Ethereum Did Registry] - [Schema Registry] --> [Universal Did Resolver] - [Credential Definition Registry] --> [Universal Did Resolver] + [Schema Registry] --> [Ethereum Did Registry] + [Credential Definition Registry] --> [Ethereum Did Registry] } @enduml diff --git a/docs/design/did-method.md b/docs/design/did-method.md new file mode 100644 index 00000000..e5b5cd44 --- /dev/null +++ b/docs/design/did-method.md @@ -0,0 +1,10 @@ +# DID Method + +The extended version of Ethr DID method (`did:ethr`) in used on the ledger. +The core specification of `did:ethr` can be found [here](https://github.com/decentralized-identity/ethr-did-resolver/blob/master/doc/did-method-spec.md) in great details is used on the Ledger. + +Example DID: `did:ethr:0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266` + +The following extension logic is applied to DID ethr smart contract to integrate it with permission related modules: +* Control contract upgrade versions +* Control account roles executing write transactions diff --git a/docs/design/did-methods.md b/docs/design/did-methods.md deleted file mode 100644 index 67b59d08..00000000 --- a/docs/design/did-methods.md +++ /dev/null @@ -1,86 +0,0 @@ -# DID Methods - -Out of box Ledger provides an ability to use one of two supported DID methods: `did:ethr` or `did:indy`. - -Contracts implementing both methods are deployed on the network and integrated with `CL Registry`. - -Ledger `permission` related modules are implemented in a way to use **account address** but not a DID. - -It is up to a User which DID method to use. - -> Moreover, users having an appropriate permissions can even deploy contracts adding support for another DID methods -> (need to integrate into `CLRegistry`). - -## Ethereum DID method: did:ethr - -Ethereum DID Method `did:ethr` described in -the [specification](https://github.com/decentralized-identity/ethr-did-resolver/blob/master/doc/did-method-spec.md). - -Example DID: `did:ethr:0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266` - -## Indy2 DID method: did:indy2 - Indy/Sov DID methods adoption - -New `indy2` DID method represented in a form compatible with `indy` and `sov` DID methods used in legacy Indy based -networks. - -Users having `indy/sov` DID's (like `did:sov:2wJPyULfLLnYTEFYzByfUR`) can keep using their `id` -part (`2wJPyULfLLnYTEFYzByfUR`) for preserving the trust. - -Example: - -* Legacy DID: `did:sov:2wJPyULfLLnYTEFYzByfUR` -* New DID will be stored on the Ledger: `did:indy2:2wJPyULfLLnYTEFYzByfUR` - -### DID Syntax - -| parameter | value | -|--------------------|---------------------------------------------------------| -| did | “did:” method-name “:” namespace “:” method-specific-id | -| method-name | “indy2”, “indy”, “sov” | -| namespace | “testnet”/"mainnet" | -| method-specific-id | indy-id | -| indy-id | Base58(Truncate_msb(16(SHA256(publicKey)))) | - -The `indy-id` is received by deriving from the initial ED25519 verkey the same was as it is described in -the [Sovrin DID Method Specification](https://sovrin-foundation.github.io/sovrin/spec/did-method-spec-template.html#namespace-specific-identifier-nsi) -. - -#### Ownership proving - -In case of `did:ethr` ownership is proven by validation of transaction level signature. When an identity decide to -use `indy2` DID method we need to add provide an additional validation to prove an identifier ownership. - -The process will be similar to endorsement flow: - -* Author steps: - * Step 1: Author prepares a DID Document object (`indy2` DID method is used) - * Step 2: Author convert DID Document into contracts representation (which will be stored on the ledger) and encodes - it into bytes using `abi.encodePacked` (available in solidity as well) - * Same bytes are signed as in case of endorsement flow - * Step 3: Author performs Ed25519 signing using secret key associated with the identifier - * The correspondent verification key must be presented in the DidDocument - * Step 4: Author passes Ed25519 Signature as contract parameter -* Contract: - * Step 1: Encodes DID Document into bytes using `abi.encodePacked` - * Step 2: Find Ed25519 Verification Method - * Issue: We need to decode the key from string representation. Maybe we should pass key bytes as contract parameter instead? - * Step 3: Check that DID identifier can be derived from verification key - * Step 4: Checks the validity of the provided Ed25519 signature against DidDocument bytes and verification key - -``` -// legacyDidPosessionSignature - is optional parameter -function createDid(DidDocument didDocument, bytes32 legacyDidPosessionSignature) { - ... - bytes32 hash = abi.encodePacked(didDocument); - - // if DID is of `indy` method additional ED25518 signature must be provided and checked - if (didDocument.did.isIndyMethod()) { - if (legacyDidPosessionSignature == address(0)) { - revert InvalidSignature("Ed25518 signature must be provided"); - } - string ed25519Key = didDocument.find(key => key.type == ED25519).publicKeyBase58 - checkDidIdentifierMatchesToKey(ed25519Key, didDocument.did) - checkEd25518Signature(hash, ed25519Key, legacyDidPosessionSignature) - } -} -``` diff --git a/docs/design/did-registry.md b/docs/design/did-registry.md deleted file mode 100644 index d0e8981c..00000000 --- a/docs/design/did-registry.md +++ /dev/null @@ -1,183 +0,0 @@ -# Indy DID Registry - -## Storage format - -* DID Records collection: - * Description: Mapping holding the list of DID's to their DID Document and metadata. - * Format: - ``` - mapping(string DID => DidRecord didRecord); - - struct DidDocStorage { - string document; - DidMetadata metadata; - } - - struct DidMetadata { - address creator; - uint256 created; - uint256 updated; - bool deactivated; - } - ``` - * Example: - ``` - { - "did:indy2:testnet:SEp33q43PsdP7nDATyySSH": { - document: " - { - "@context": [ - "https://www.w3.org/ns/did/v1", - "https://w3id.org/security/suites/ed25519-2020/v1" - ], - "id": "did:example:123456789abcdefghi", - "verificationMethod": [{ - "id": "did:example:123456789abcdefghi#key-1", - "type": "Ed25519VerificationKey2020", - "controller": "did:example:123456789abcdefghi", - "publicKeyMultibase": "zH3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV" - }], - "authentication": ["#key-1"], - } - ", - metadata: { - owner: 0x93917cadbace5dfce132b991732c6cda9bcc5b8a, - sender: 0x93917cadbace5dfce132b991732c6cda9bcc5b8a, - created: 1234, - updated: 1234, - deactivated: false - }, - }, - ... - } - ``` - -### Types definition - -#### DidDocument - -DID Document must match to the [specification](https://www.w3.org/TR/did-core/). - -#### DID Document metadata - -Each DID Document MUST have a metadata section when a representation is produced. It can have the following properties: - -* owner (address): An address of DID owner -* sender (address): An address of DID Document sender -* created (timestamp): Time of a block ordered a transaction for DID Doc creation -* updated (timestamp): The updated field is null if an Update operation has never been performed on the DID document. - Time of a block ordered a transaction changed a DID Doc last time -* deactivated (string): If DID has been deactivated, DID document metadata MUST include this property with the boolean - value true. By default this is set to false. - -## Transactions (Smart Contract's methods) - -Contract name: **IndyDidRegistry** - -### Create DID - -* Method: `createDid` - * Description: Transaction to create a new DID record (DID Document and corresponding DID Metadata) - * Parameters: - * `identity` - Address of DID owner - * `did` - The new DID - * `document` - The new DID Document as JSON string - * Restrictions: - * DID must not exist - * Valid DID must be provided - * Format: - ``` - IndyDidRegistry.createDid( - address identity, - string calldata did, - string calldata document - ) - ``` - * Example: - ``` - IndyDidRegistry.createDid( - "0xa9b7df62c953c4c49deebea05d3c8fee1f47c1f6", - "did:indy2:testnet:SEp33q43PsdP7nDATyySSH", - "{ did document as json string }" - ) - ``` - * Raised Event: - * `DIDCreated(did)` - -### Update DID - -* Method: `updateDid` - * Description: Transaction to update an existing DidDocStorage entry - * Restrictions: - * DID must exist - * DID must be active - * Sender must be authorized to perform update (owner or sender) - * Format: - ``` - IndyDidRegistry.updateDid( - string calldata did, - string calldata document - ) - ``` - * Example: - ``` - IndyDidRegistry.updatedDid( - "did:indy2:testnet:SEp33q43PsdP7nDATyySSH" - "{ did document as json string }" - ) - ``` - * Raised Event: - * `DIDUpdated(did)` - -### Deactivate DID - -* Method: `deactivateDid` - * Description: Transaction to deactivate an existing DID - * Parameters: - * `did` - DID to update - * `document` - The new DID Document as JSON string - * Restrictions: - * DID must exist - * DID must be active - * Sender must be authorized to perform deactivation (owner or sender) - * Format: - ``` - IndyDidRegistry.deactivateDid( - string did - ) - ``` - * Example: - ``` - IndyDidRegistry.deactivateDid( - "did:indy2:testnet:SEp33q43PsdP7nDATyySSH" - ) - ``` - * Raised Event: - * `DIDDeactivated(did)` - -### Resolve DID Document with Meta - -* Method: `resolveDid` - * Description: Transaction to resolve DidDocStorage entry (DID Document and corresponding DID Doc Metadata) - * Parameters: - * `did` - DID to deactivate - * Restrictions: - * DID must exist - * Format: - ``` - IndyDidRegistry.resolveDid( - string did, - ) returns (DidRecord didRecord) - ``` - * Example: - ``` - IndyDidRegistry.resolveDid( - "did:indy2:testnet:SEp33q43PsdP7nDATyySSH" - ) - ``` - * Raised Event: `None` - - - - - diff --git a/docs/design/endorsement.md b/docs/design/endorsement.md index b7304492..b5bdba0d 100644 --- a/docs/design/endorsement.md +++ b/docs/design/endorsement.md @@ -1,91 +1,8 @@ ## Endorsement Not all identity owners may have permissions for writing transactions on the ledger. -We need to define a mechanism of doing transaction writes by an Endorser with preserving original author as an entity -owner. - -### DID Indy registry - -#### Flow - -* Author steps: - * Step 1: Author prepares a DID Document object - * Step 2: Author queries `nonce` from the ledger - * Step 3: Author convert DID Document into contracts representation (which will be stored on the ledger) and encodes - it into bytes using `abi.encodePacked` (available in solidity as well) - * Step 4: Author performs EcDSA signing using his ethereum identity account keys of concatenated nonce and did - document bytes and next hashing of the result value: `keccak256(abi.encodePacked(nonce, didDocument))` - * Step 5: Author passes DID Document and Signature to Endorser -* Endorser steps: - * Step 1: Endorser builds transaction to endorse - DID: `endorseDid(address sender, address identity, DidDocument didDocument, bytes32 identitySignature)` - > Optionally: `identity` can be derived from DidDocument.id instead of passing explicitly - * Step 2: Endorser does regular EcDSA signing of the **Transaction** - * Step 3: Endorser submit the signed transaction to the ledger which executes deployed `IndyDidRegistry.endorseDid` - contract method -* Ethereum: - * Checks the validity of the transaction level signature (Endorser's signature) -* Contract: - * Step 1: Get current nonce value of identity - * Step 2: Calculate the hash signed data: `keccak256(abi.encodePacked(nonce, didDocument))` - * Step 3: Checks the validity of the provided signature against identity passed as the parameter `ecrecover(...);` - * `ecrecover` returns an account signed the message - -> Should we add and use some nonce to prevent reply attack? - -#### Contracts - -``` -mapping(address => uint) public nonce; - -// identity - ethereum address of DID owner -// document - did document -// identitySignature - identity owner signatures (EcDSA and optionally ED25519) ower serialized DID Document -function endorseDid(address identity, DidDocument didDocument, bytes32 identitySignature) { - // sender is endorser when it's not equal to identity - if (msg.sender == identity) { - revert InvalidmethodExecution; - } - - // calculate the hash of DiDocument - // this hash will be checked agains signatures to verify ownership - bytes32 hash = keccak256(abi.encodePacked(nonce[identity], didDocument)); - - // verify EcDSA identity owner signature ower DID + DidDocument - checkEcDsaSignature(identity, hash, identitySignature); - - nonce[identity]++; - record[didDocument.did].didDocument = didDocument - record[didDocument.did].metadata.owner = identity - record[didDocument.did].metadata.sender = msg.sender -} - -function checkEcDsaSignature(address identity, bytes32 hash, EcDSASignature signature) { - address signer = ecrecover(hash, signature.v, signature.r, signature.s); - if (signer == address(0)) { - revert InvalidSignature("Invalid signature provided"); - } - if (identity != signer) { - revert InvalidSignature("Signature does not match to the target identity"); - } -} -``` - -#### VDR - -```rust -// Encode DID Document which need to be signed by an identity owner -fn indy_vdr_encode_did_document(did_doc: DidDocument) -> Vec; - -// Build transaction to endorse DID -fn build_endorse_did_transaction( - client: &LedgerClient, - sender: &Address, - identity: &Address, - did_doc: &DidDocument, - signature: &Signature -) -> VdrResult {} -``` +The goal of this document to define a mechanism of doing transaction writes to the ledger by a special parties having an +Endorser role with preserving of original author as an entity owner. ### DID Ethr registry @@ -95,6 +12,8 @@ So that DID assume to be written by default -> endorsement is not needed. Endorsement is needed to modify DID properties, what can be done using the set of existing contract methods: +#### Contracts + ``` function setAttributeSigned(address identity, uint8 sigV, bytes32 sigR, bytes32 sigS, bytes32 name, bytes memory value, uint validity) @@ -107,12 +26,6 @@ function revokeDelegateSigned(address identity, uint8 sigV, bytes32 sigR, bytes3 function changeOwnerSigned(address identity, uint8 sigV, bytes32 sigR, bytes32 sigS, address newOwner) ``` -#### Contracts - -Should we extend DidEthrRegistry contract to add roles check? - -> We already extended `DidEthrRegistry` to use UpgradeControl - #### VDR TO BE defined later. @@ -121,19 +34,33 @@ TO BE defined later. #### Flow -**Schema endorsing** +**Schema endorsing steps** + +Endorsing for schemas and credential definition is designed to match existing `did:ethr` API. + +> In case of Schema and Credential Definition we do not need to add `nonce` as we do not have an update operation. * Author steps: * Step 1: Author prepares a Schema object - * Step 2: Author queries `nonce` from the ledger - * Step 3: Author convert Schema into contracts representation (which will be stored on the ledger) and encodes - it into bytes using `abi.encodePacked` (available in solidity as well) - * Step 4: Author performs EcDSA signing using his ethereum identity account keys of concatenated nonce and did - document bytes and next hashing of the result value: `keccak256(abi.encodePacked(nonce, schema))` - * Step 5: Author passes Schema and Signature to Endorser + * Step 2: Execute VDR method to calculate hash need to be signed - contract signed data according + to [EIP](https://eips.ethereum.org/EIPS/eip-191). + ``` + keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), identity, "createSchema", id, schema)) + // Arguments when calculating hash to validate + // 1: byte(0x19) - the initial 0x19 byte + // 2: byte(0) - the version byte + // 3: address(this) - the validator address + // 4-7: Application specific data + // identity - author account address + // `createSchema` original contract method - added to be aligned with did:ethr contract + // id - id of schema to be created + // schema - schema as JSON string + ``` + * Step 3: Performs EcDSA signing using his ethereum identity account keys + * Step 4: Author passes Schema and Signature to Endorser * Endorser steps: * Step 1: Endorser builds transaction to endorse - DID: `endorseSchema(address sender, Schema schema, bytes32 identitySignature)` + DID: `endorseSchema(address identity, uint8 sigV, bytes32 sigR, bytes32 sigS, bytes32 id, bytes schema)` * Step 2: Endorser does regular EcDSA signing of the **Transaction** * Step 3: Endorser submit the signed transaction to the ledger which executes deployed `SchemaRegistry.endorseSchema` @@ -141,75 +68,107 @@ TO BE defined later. * Ethereum: * Checks the validity of the transaction level signature (Endorser's signature) * Contract: - * Step 1: Resolve identity owner for the schema `issuerId` - * Step 2: Get current nonce value of identity - * Step 3: Calculate the hash signed data: `keccak256(abi.encodePacked(nonce, schema))` - * Step 4: Checks the validity of the provided signature against identity passed as the parameter `ecrecover(...);` + * Step 1: Calculate the hash of signed data: same as for Author Step 3 + * Step 2: Checks the validity of the provided signature against identity passed as the parameter `ecrecover(...);` * `ecrecover` returns an account signed the message + * Step 3: Resolve and check identity owner for the schema `issuerId` -Credential Definition endorsing process is the same as for Schema. +**Credential Definition endorsing steps**: + +> Credential Definition endorsing process is the same as for Schema. + +* Author steps: + * Step 1: Author prepares a Credential Definition object + * Step 2: Execute VDR method to calculate hash need to be signed - contract signed data according + to [EIP](https://eips.ethereum.org/EIPS/eip-191). + ``` + keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), identity, "createCredentialDefinition", id, schemaId, credDef)) + // Arguments when calculating hash to validate + // 1: byte(0x19) - the initial 0x19 byte + // 2: byte(0) - the version byte + // 3: address(this) - the validator address + // 4-8: Application specific data + // identity - author account address + // `createSchema` original contract method - added to be aligned with did:ethr contract + // id - id of schema to be created + // schemaId - id of schema + // credDef - credential definition as JSON string + ``` + * Step 3: Performs EcDSA signing using his ethereum identity account keys + * Step 4: Author passes Credential Definition and Signature to Endorser +* Endorser/Ethereum/Contract steps are similar to the schema steps. #### Contracts ``` -// schema - CL schema -// identitySignature - signature ower serialized Schema of the schema issuer identity owner -function endorseSchema(Schema schema, EcDsaSignature identitySignature) { - // resolver owner of issuerDID - DidMetadata issuerDidMeta = didResolver.resolveMetadata(schema.issuerId) - - if (msg.sender == issuerDidMeta.owner) { - revert InvalidmethodExecution; - } - - bytes32 hash = keccak256(abi.encodePacked(nonce[issuerDidMeta.owner], schema)); - - checkEcDsaSignature(issuerDidMeta.owner, hash, identitySignature); - - nonce[issuerDidMeta.owner]++; - _schemas[schema.id].schema = schema; +function createSchemaSigned( + address identity, + uint8 sigV, + bytes32 sigR, + bytes32 sigS + bytes32 id, + bytes schema, + +) public virtual { + // validate identity signature + bytes32 hash = keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), identity, "createSchema", id, schema)); + checkSignature(identity, hash, sigV, sigR, sigS); + + // store schema + createSchema(identity, id, schema); } -// credDef - CL credential definition -// identitySignature - signature ower serialized credDef of the cred def issuer identity owner -function endorseCredentialDefinition(CredentialDefinition credDef, EcDsaSignature identitySignature) { - // resolver owner of issuerDID - DidMetadata issuerDidMeta = didResolver.resolveMetadata(credDef.issuerId) - if (msg.sender == identity) { - revert InvalidmethodExecution; - } - - bytes32 hash = keccak256(abi.encodePacked(nonce[issuerDidMeta.owner], credDef)); - - checkEcDsaSignature(issuerDidMeta.owner, hash, identitySignature); - - nonce[issuerDidMeta.owner]++; - _credDefs[credDef.id].credDef = credDef; +function endorseCredentialDefinition( + address identity, + uint8 sigV, + bytes32 sigR, + bytes32 sigS, + byets32 id, + byets32 schemaId, + byets credDef +) public virtual { + // validate identity signature + bytes32 hash = keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), identity, "createCredentialDefinition", id, schemaId, credDef)); + checkSignature(identity, hash, sigV, sigR, sigS); + + // store credential definition + createCredentialDefinition_(identity, id, schemaId, credDef); } ``` #### VDR ```rust -// Encode Schema which need to be signed by an identity owner -fn indy_vdr_encode_schema(schema: Schema) -> Vec; +// Prepare schema endorsing bytes which need to be signed by an identity owner +pub async fn build_create_schema_endorsing_data( + client: &LedgerClient, + id: &SchemaId, + schema: &Schema, +) -> VdrResult; // Build transaction to endorse Schema -fn build_endorse_schema_transaction( +pub async fn build_create_schema_signed_transaction( client: &LedgerClient, sender: &Address, + id: &SchemaId, schema: &Schema, - signature: &Signature -) -> VdrResult {} + signature: &SignatureData, +) -> VdrResult; -// Encode CredentialDefinition which need to be signed by an identity owner -fn indy_vdr_encode_credential_definition(cred_def: CredentialDefinition) -> Vec; +// Prepare credential definition endorsing bytes which need to be signed by an identity owner +pub async fn build_create_credential_definition_endorsing_data( + client: &LedgerClient, + id: &CredentialDefinitionId, + credential_definition: &CredentialDefinition, +) -> VdrResult; // Build transaction to endorse CredentialDefinition -fn build_endorse_credential_definition_transaction( +pub async fn build_create_credential_definition_signed_transaction( client: &LedgerClient, - sender: &Address, - cred_def: &CredentialDefinition, - signature: &Signature -) -> VdrResult {} + from: &Address, + id: &CredentialDefinitionId, + credential_definition: &CredentialDefinition, + signature: &SignatureData, +) -> VdrResult; ``` + diff --git a/docs/design/flow.png b/docs/design/flow.png index f0367659..7b26b8eb 100644 Binary files a/docs/design/flow.png and b/docs/design/flow.png differ diff --git a/docs/design/flow.puml b/docs/design/flow.puml index a6a2f8e0..d1592b68 100644 --- a/docs/design/flow.puml +++ b/docs/design/flow.puml @@ -44,14 +44,6 @@ T->TV: Submit transaction TV->C: Send transaction C-->C: Execute RoleControl.assignRole contract -== Create Indy Did == - -E->EV: Build Did Document -E->EV: Build and sign transaction to create Did -E->EV: Submit transaction -EV->C: Send transaction -C-->C: Execute IndyDidRegistry.createDid contract - == Create Ethr Did == note across @@ -61,46 +53,44 @@ end note E->EV: Build and sign transaction to add DID attribute (Service) E->EV: Submit transaction EV->C: Send transaction -C-->C: Execute EthrExtDidRegistry.setAttribute contract - -== Endorse Indy Did == - -F->FV: Build Did Document -F->FV: Encode Did Document -F->FW: EdDSA sign did document bytes -F-->E: Pass Did Document, Signature -E->EV: Build and sign transaction to endorse Did -E->EV: Submit transaction -EV->C: Send transaction -C-->C: Execute IndyDidRegistry.endorseDid contract +C-->C: Execute `EthrExtDidRegistry.setAttribute` contract == Endorse Ethr Did == note across - Not needed as DID imply to be written by default - Owner can add resource without endorsement need + Not needed for creation as DID imply to be written by default + Required for adding of a resource end note -== Create Schema (any DID method) == +F->FV: Build Service attribute +F->FV: Prepare endorsement data for setting attribute +F->FW: EdDSA sign endorsement data +F-->E: Pass Service attribute and Signature +E->EV: Build and sign transaction for setting signed attribute +E->EV: Submit transaction +EV->C: Send transaction +C-->C: Execute `EthrExtDidRegistry.setAttributeSigned` contract + +== Create Schema == E->EV: Build Schema E->EV: Build and sign transaction to create Schema E->EV: Submit transaction EV->C: Send transaction -C-->C: Execute SchemaRegistry.createSchema contract +C-->C: Execute `SchemaRegistry.createSchema` contract C-->C: Resolve and verify issuerDid ownership -== Endorse Schema (any DID method) == +== Endorse Schema == F->FV: Build Schema -F->FV: Encode Schema -F->FW: EdDSA sign Schema bytes -F-->E: Pass Schema, Signature -E->EV: Build and sign transaction to endorse Schema +F->FV: Prepare endorsement data for creating schema +F->FW: EdDSA sign endorsement data +F-->E: Pass Schema and Signature +E->EV: Build and sign transaction to creating signed schema E->EV: Submit transaction EV->C: Send transaction -C-->C: Execute SchemaRegistry.endorseSchema contract -C-->C: Resolve and verify issuerDid ownership +C-->C: Execute SchemaRegistry.createSchemaSigned contract +C-->C: Resolve and verify issuerId ownership == == diff --git a/docs/design/legacy-identifiers-support.md b/docs/design/legacy-identifiers-support.md new file mode 100644 index 00000000..296569b8 --- /dev/null +++ b/docs/design/legacy-identifiers-support.md @@ -0,0 +1,71 @@ +## Legacy identifiers support + +The idea is using of a basic mapping between legacy DIDs identifiers and ethereum accounts instead of introducing a new +`did:indy2` DID method. +So that legacy DID can be associated with a new `did:ethr` and we can only use `did:ethr` in the network. + +* Create a new `LegacyIdMappingRegistry` smart contract which will be holding mapping of legacy identifiers to ethereum accounts/new ids: + ``` + contract LegacyIdMappingRegistry { + // did:sov: -> ethr account address + mapping(string => address) public didMappings; + + // legacy formated ids of schemas and cred defs -> new id + mapping(string => string) public clMappings; + + function createDidMapping(string legacyDid, bytes32 key, bytes32 ed25518Signature) { + // check signature + // check legacyDid is derived from key + didMappings[legacyDid] = msg.sender; + } + + function endorseDidMapping(address identity, string legacyDid, bytes32 key, bytes32 ed25518Signature, bytes32 ecdsaSignature) { + // check signatures + didMappings[legacyDid] = identity; + } + + // resolve mapping done through `didMappings(string)` function available after contract compilation + + function createClMapping(string legacyId, string id, bytes32 key, bytes32 signature) { + // fetch issuer did from legacy schema/credDef id + // check issuer did is derived from key + // check msg.sender is owner of issuer did + // check identity is owner of schema / cred def + // check signature + clMappings[legacyId] = id; + } + + function endorseClMapping(address identity, string legacyId, string id, bytes32 key, bytes32 ed25518Signature, bytes32 ecdsaSignature) { + // fetch issuer did from legacy schema/credDef id + // check issuer did is derived from key + // check identity is owner of issuer did + // check identity is owner of schema / cred def + // check signatures + clMappings[legacyId] = id; + } + + // resolve mapping done through `clMappings(string)` function available after contract compilation + } + ``` + * Note, that user must pass signature over identifier to prove ownership +* On migration, DID owners willing to preserve resolving of legacy formatted DIDs and id's must do: + * add mapping between legacy + identifier and ethereum account representing `did:ethr` identifier by + executing `LegacyIdMappingRegistry.createDidMapping(...)` method where he must pass: + * DID identifier itself + * Associated public key + * Ed25519 signature owner identifier proving ownership + * Signature must be done over the following hash value: `keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), msg.sender, "createDidMapping", legacyDid, identity, key))` + * add mapping between legacy schema/credDef id's and new ones executing `LegacyIdMappingRegistry.createClMapping()` method he must pass: + * Legacy schema/credDef id + * New id of corresponding schema/credDef + * Associated public key + * Ed25519 signature owner identifier proving ownership + * Signature must be done over the following hash value: `keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), msg.sender, "createClMapping", legacyId, id, key))` +* After migration, clients in order to resolve legacy identifiers: + * for DID document firstly must resolve ethereum account + using `LegacyIdMappingRegistry.didMappings(identifier)`, and next resolve DID ether document as it described in the + corresponding specification. + * for Schema/Credential Definition firstly must resolve new identifier + using `LegacyIdMappingRegistry.clMappings(identifier)`, and next resolve Schema/Credential Definition as it described in the + corresponding specification. diff --git a/docs/design/registry.md b/docs/design/registry.md index 1932606a..ae1b9c05 100644 --- a/docs/design/registry.md +++ b/docs/design/registry.md @@ -3,7 +3,31 @@ General design for smart contracts oriented for storing objects like DID Document, Schema, Credential Definition. The main question is whether we need to validate storing object or not? -### Current Option: Strict object definition +### Option 1 (Current): Arbitrary objects as JSON string + +#### Pros + +* Simplicity: accept objects (Did Document, Schema, CredDef) as JSON strings (bytes) and store them in transaction log events +* Spec compliant objects stored on the ledger +* Small contract size +* Gas efficient +* Different versions and formats of object can be stored without an upgrade + +#### Cons + +* Invalid data can be written on the Ledger + * JSON string may contain not owned data: + * VDR must perform validation and be reliable by client + * JSON string may contain bad formatted objects +* Duplication: + * Some fields must be passed as an independent parameters for doing obligatory state checks + * Like issuer DID for schema and cred def +* Strong relationship with VDR library? + * VDR must perform the validation of sending data + +### Option 2 (Outdated): Strict object definition + +Define data types for accepting and storing objects, and perform validation of input data. #### Pros @@ -61,26 +85,3 @@ The main question is whether we need to validate storing object or not? * Type is not empty * Value is not empty -### Option 2: Arbitrary objects as JSON string - -#### Pros - -* Simplicity: accept objects (Did Document, Schema, CredDef) as JSON strings and store them as is -* Spec compliant objects stored on the ledger -* We can return state proof for spec compliant objects -* Small contract size -* Gas efficient -* Different versions and formats of object can be stored without an upgrade - -#### Cons - -* Invalid data can be written on the Ledger - * JSON string may contain not owned data: - * VDR must perform validation and be reliable by client - * JSON string may contain bad formatted objects -* Duplication: - * Some fields must be passed as an independent parameters for doing obligatory state checks - * Like issuer DID for schema and cred def -* Strong relationship with VDR library? - * VDR must perform the validation of sending data - diff --git a/docs/design/vdr.md b/docs/design/vdr.md index f825e12b..fd433017 100644 --- a/docs/design/vdr.md +++ b/docs/design/vdr.md @@ -10,10 +10,10 @@ In the same, time Indy community follows to idea of splitting complex library in * VDR library firstly will be implemented independently and later integrate into existing indy vdr/sdk/frameworks. * VDR library will be written in Rust with providing language wrappers. -* VDR library does conversion of legacy `sov/indy` formatted did's and id's into `indy2` format. -* VDR library does conversion of ledger formatted entities (DID Document, Schema, Credential Definition) into +* VDR library simplifies migration from legacy `sov/indy` formatted did's and id's. +* VDR library simplifies migration from legacy entities (DID Document, Schema, Credential Definition) into specifications compatible format. -* VDR library does only basic validation within request builders. +* VDR library does validation of input and output data. * VDR library does only Ethereum base account signing of transactions. * VDR library request builders are tide to the network. * VDR library will work with RPC Node over HTTP. @@ -22,77 +22,88 @@ In the same, time Indy community follows to idea of splitting complex library in ```rust pub struct LedgerClient { - chain_id: u64, - client: Box, - contracts: HashMap>, - quorum_handler: Option, + chain_id: u64, + client: Box, + contracts: HashMap>, + quorum_handler: Option, } struct ContractConfig { - address: String, // address of deployed contract - spec_path: String, // path to JSON file containing compiled contract's ABI specification + address: String, + // address of deployed contract + spec_path: String, // path to JSON file containing compiled contract's ABI specification } struct StatusResult { - status: Status + status: Status } enum Status { - Ok, - Err(String) + Ok, + Err(String) } impl LedgerClient { - /// Create indy2 client interacting with ledger - /// - /// # Params - /// - `chain_id` - chain id of network (chain ID is part of the transaction signing process to protect against transaction replay attack) - /// - `rpc_node` - string - RPC node endpoint - /// - `contract_configs` - [ContractSpec] specifications for contracts deployed on the network - /// - `quorum_config` - Option<[QuorumConfig]> quorum configuration. Can be None if quorum check is not needed - /// - /// # Returns - /// client to use for building and sending transactions - fn new( - chain_id: u64, - node_address: String, - contract_configs: Vec, - quorum_config: Option<&QuorumConfig>, - ) -> LedgerClient { - unimpltemented!() - } - - /// Ping Ledger. - /// - /// # Returns - /// ping status - pub async fn ping(&self) -> VdrResult { - unimpltemented!() - } - - /// Submit prepared transaction to the ledger - /// Depending on the transaction type Write/Read ethereum methods will be used - /// - /// #Params - /// `transaction` - transaction to submit - /// - /// #Returns - /// transaction execution result: - /// depending on the type it will be either result bytes or block hash - pub async fn submit_transaction(&self, transaction: &Transaction) -> VdrResult> { - unimpltemented!() - } - - /// Get receipt for the given block hash - /// - /// # Params - /// `transaction` - transaction to submit - /// - /// # Returns - /// receipt for the given block - pub async fn get_receipt(&self, hash: &[u8]) -> VdrResult { - unimpltemented!() - } + /// Create indy2 client interacting with ledger + /// + /// # Params + /// - `chain_id` - chain id of network (chain ID is part of the transaction signing process to protect against transaction replay attack) + /// - `rpc_node` - string - RPC node endpoint + /// - `contract_configs` - [ContractSpec] specifications for contracts deployed on the network + /// - `quorum_config` - Option<[QuorumConfig]> quorum configuration. Can be None if quorum is not needed + /// + /// # Returns + /// client to use for building and sending transactions + fn new( + chain_id: u64, + node_address: String, + contract_configs: Vec, + quorum_config: Option, + ) -> LedgerClient { + unimpltemented!() + } + + /// Ping Ledger. + /// + /// # Returns + /// ping status + pub async fn ping(&self) -> VdrResult { + unimpltemented!() + } + + /// Submit prepared transaction to the ledger + /// Depending on the transaction type Write/Read ethereum methods will be used + /// + /// #Params + /// `transaction` - transaction to submit + /// + /// #Returns + /// transaction execution result: + /// depending on the type it will be either result bytes or block hash + pub async fn submit_transaction(&self, transaction: &Transaction) -> VdrResult> { + unimpltemented!() + } + + /// Get receipt for the given block hash + /// + /// # Params + /// `transaction` - transaction to submit + /// + /// # Returns + /// receipt for the given block + pub async fn get_receipt(&self, hash: &[u8]) -> VdrResult { + unimpltemented!() + } + + /// Send a prepared query for retrieving log events on the ledger + /// + /// #Params + /// param: client: Ledger - client (Ethereum client - for example web3::Http) + /// param: query: EventQuery - query to send + /// + /// #Returns + /// logs - list of received events + pub async fn query_events(&self, query: &EventQuery) -> VdrResult>; } struct SubmitTransactionOptions {} @@ -100,85 +111,92 @@ struct SubmitTransactionOptions {} type Receipt = Vec; trait Client: Sync + Send { - /// Retrieve count of transaction for the given account - /// - /// # Params - /// - `address` address of an account to get number of written transactions - /// - /// # Returns - /// number of transactions - async fn get_transaction_count(&self, address: &Address) -> VdrResult<[u64; 4]>; - - /// Submit transaction to the ledger - /// - /// # Params - /// - `transaction` transaction to submit - /// - `transaction` prepared transaction to submit - /// - /// # Returns - /// hash of a block in which transaction included - async fn submit_transaction(&self, transaction: &[u8]) -> VdrResult>; - - /// Submit read transaction to the ledger - /// - /// # Params - /// - `transaction` prepared transaction to submit - /// - /// # Returns - /// result data of transaction execution - async fn call_transaction(&self, to: &str, transaction: &[u8]) -> VdrResult>; - - /// Get the receipt for the given block hash - /// - /// # Params - /// - `hash` hash of a block to get the receipt - /// - /// # Returns - /// receipt as JSON string for the requested block - async fn get_receipt(&self, hash: &[u8]) -> VdrResult; - - /// Check client connection (passed node is alive and return valid ledger data) - /// - /// # Returns - /// ledger status - async fn ping(&self) -> VdrResult; - - /// Get the transaction for the given transaction hash - /// - /// # Params - /// - `hash` hash of a transaction to get - /// - /// # Returns - /// transaction for the requested hash - async fn get_transaction(&self, hash: &[u8]) -> VdrResult>; + /// Retrieve count of transaction for the given account + /// + /// # Params + /// - `address` address of an account to get number of written transactions + /// + /// # Returns + /// number of transactions + async fn get_transaction_count(&self, address: &Address) -> VdrResult<[u64; 4]>; + + /// Submit transaction to the ledger + /// + /// # Params + /// - `transaction` transaction to submit + /// - `transaction` prepared transaction to submit + /// + /// # Returns + /// hash of a block in which transaction included + async fn submit_transaction(&self, transaction: &[u8]) -> VdrResult>; + + /// Submit read transaction to the ledger + /// + /// # Params + /// - `transaction` prepared transaction to submit + /// + /// # Returns + /// result data of transaction execution + async fn call_transaction(&self, to: &str, transaction: &[u8]) -> VdrResult>; + + /// Get the receipt for the given block hash + /// + /// # Params + /// - `hash` hash of a block to get the receipt + /// + /// # Returns + /// receipt as JSON string for the requested block + async fn get_receipt(&self, hash: &[u8]) -> VdrResult; + + /// Check client connection (passed node is alive and return valid ledger data) + /// + /// # Returns + /// ledger status + async fn ping(&self) -> VdrResult; + + /// Get the transaction for the given transaction hash + /// + /// # Params + /// - `hash` hash of a transaction to get + /// + /// # Returns + /// transaction for the requested hash + async fn get_transaction(&self, hash: &[u8]) -> VdrResult>; + + /// Request log events from the ledger for the given filter + /// + /// # Params + /// - `query` log events filter to submit + /// + /// # Returns + /// received log events + async fn query_events(&self, query: &EventQuery) -> VdrResult>; } trait Contract: Sync + Send { - /// Get the address of deployed contract - /// - /// # Returns - /// address of the deployed contract. Should be used to execute contract methods - fn address(&self) -> &Address; - - /// Encode data required for the execution of a contract method - /// - /// # Params - /// - `method` method to execute - /// - `params` data to pass/encode for contract execution - /// - /// # Returns - /// encoded data to set into transaction - fn encode_input(&self, method: &str, params: &[ContractParam]) -> VdrResult>; - - /// Decode the value (bytes) returned as the result of the execution of a contract method - /// - /// # Params - /// - `method` method to execute - /// - `output` data to decode (returned as result of sending call transaction) - /// - /// # Returns - /// contract execution result in decoded form - fn decode_output(&self, method: &str, output: &[u8]) -> VdrResult; + /// Get the address of deployed contract + /// + /// # Returns + /// address of the deployed contract. Should be used to execute contract methods + fn address(&self) -> &Address; + + /// Get the contract function for the given name + /// + /// # Params + /// - `name` name of the function to obtain + /// + /// # Returns + /// Contract function + fn function(&self, name: &str) -> VdrResult<&Function>; + + /// Get the contract event for the given name + /// + /// # Params + /// - `name` name of the event to obtain + /// + /// # Returns + /// Contract event + fn event(&self, name: &str) -> VdrResult<&ContractEvent>; } ``` @@ -188,38 +206,36 @@ trait Contract: Sync + Send { /// Transaction object struct Transaction { - /// type of transaction: write/read - /// depending on the transaction type different client methods will be executed to submit transaction - type_: TransactionType, - /// transaction sender account address - from: Option
, - /// transaction recipient address - to: Address, - /// nonce - count of transaction sent by account - nonce: Option>, - /// chain id of the ledger - chain_id: u64, - /// transaction payload - data: Vec, - /// transaction signature - signature: Option, - /// transaction hash - hash: Option>, + /// type of transaction: write/read + /// depending on the transaction type different client methods will be executed to submit transaction + type_: TransactionType, + /// transaction sender account address + from: Option
, + /// transaction recipient address + to: String, + /// nonce - count of transaction sent by account + nonce: Option, + /// chain id of the ledger + chain_id: u64, + /// transaction payload + data: Vec, + /// transaction signature + signature: Option, } impl Transaction { - /// Get bytes which needs to be signed for transaction sending - /// - /// # Returns - /// bytes to sign - fn get_signing_bytes(&self) -> VdrResult> { - unimplemented!() - } - - /// Set transaction signature - fn set_signature(&mut self, signature_data: SignatureData) { - unimplemented!() - } + /// Get bytes which needs to be signed for transaction sending + /// + /// # Returns + /// bytes to sign + fn get_signing_bytes(&self) -> VdrResult> { + unimplemented!() + } + + /// Set transaction signature + fn set_signature(&mut self, signature_data: SignatureData) { + unimplemented!() + } } enum TransactionType { @@ -227,173 +243,634 @@ enum TransactionType { Write } +struct TransactionEndorsingData { + to: Address, + from: Address, + params: Vec, +} + +impl TransactionEndorsingData { + fn get_signing_bytes(&self) -> VdrResult> { + unimplemented!() + } +} + +struct EventQuery { + address: Address, + from_block: Option, + to_block: Option, + topic: String, +} + struct SignatureData { - /// recovery ID using for public key recovery - pub recovery_id: u64, - /// ECDSA signature - pub signature: Vec, + /// recovery ID using for public key recovery + pub recovery_id: u64, + /// ECDSA signature + pub signature: Vec, } ``` ## Contracts/Requests methods -### DID Document +### DID Ethr -#### Create DID +#### Writes ```rust -// Probably we do no even need it -struct BuildTxnOptions {} -``` - -```rust -/// Prepare transaction executing `IndyDidRegistry.createDid` smart contract method to create a new DID on the Ledger +/// Change owner of ethr DID /// /// #Params -/// param: client: LedgerClient - Ledger client +/// param: client: Ledger - client (Ethereum client - for example web3::Http) /// param: from: string - sender account address -/// param: identity: string - DID owner account address -/// param: did: string - DID to be created -/// param: did_document: DidDocument - DID Document matching to the specification: https://www.w3.org/TR/did-core/ +/// param: did: string - DID to change ownership +/// param: new_owner: string - account address of new owner /// /// #Returns /// transaction: Transaction - prepared transaction object -fn indy_vdr_build_create_did_transaction( - client: LedgerClient, - from: String, - identity: String, - did: String, - did_document: &DidDocument, -) -> Transaction { - unimplemented!(); -} -``` - -#### Update DID - -```rust -/// Prepare transaction executing `IndyDidRegistry.updateDid` smart contract method to update an existing DID Document +pub async fn build_did_change_owner_transaction( + client: &LedgerClient, + from: &Address, + did: &DID, + new_owner: &Address, +) -> VdrResult; + +/// Prepared data for endorsing EthereumExtDidRegistry.changeOwner contract method /// /// #Params -/// param: client: LedgerClient - Ledger client -/// param: from: string - sender account address -/// param: did: string - DID to be created -/// param: did_document: DidDocument - DID Document matching to the specification: https://www.w3.org/TR/did-core/ +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to change ownership +/// - `new_owner` account address of new owner /// /// #Returns -/// transaction: Transaction - prepared transaction object -fn indy_vdr_build_update_did_transaction( - client: LedgerClient, - from: String, - did: String, - did_document: DidDocument, -) -> Transaction; -``` - -#### Deactivate DID - -```rust -/// Prepare transaction executing `IndyDidRegistry.deactivateDid` smart contract method to deactivate an existing DID +/// data: TransactionEndorsingData - transaction endorsement data to sign +pub async fn build_did_change_owner_endorsing_data( + client: &LedgerClient, + did: &DID, + new_owner: &Address, +) -> VdrResult; + +/// Build transaction to execute EthereumExtDidRegistry.changeOwnerSigned contract method to +/// change the owner of ether DID +/// Endorsing version of the method - sender is not identity owner /// /// #Params -/// param: client: LedgerClient - Ledger client +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address +/// - `did` DID to change ownership +/// - `new_owner` account address of new owner +/// - `signature` signature of DID identity owner +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +pub async fn build_did_change_owner_signed_transaction( + client: &LedgerClient, + from: &Address, + did: &DID, + new_owner: &Address, + signature: &Signature, +) -> VdrResult; + +/// An identity can assign multiple delegates to manage signing on their behalf for specific purposes. +/// Function to add a new delegate for a DID +/// +/// #Params +/// param: client: Ledger - client (Ethereum client - for example web3::Http) /// param: from: string - sender account address -/// param: did: string - did to deactivate +/// param: did: string - DID to add delegate +/// param: delegate_type: string - type of delegation +/// param: delegate: string - account address of delegate +/// param: validity: Option - delegate validity time /// /// #Returns /// transaction: Transaction - prepared transaction object -fn indy_vdr_build_deactivate_did_transaction( - client: LedgerClient, - from: String, - did: String, -) -> Transaction; +pub async fn build_did_add_delegate_transaction( + client: &LedgerClient, + from: &Address, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, + validity: &Validity, +) -> VdrResult; + +/// Prepared data for endorsing EthereumExtDidRegistry.addDelegate contract method +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to add a delegate +/// - `delegate_type` type of delegation (`veriKey` or `sigAuth`) +/// - `delegate` account address of delegate +/// - `validity` delegate validity time +/// +/// #Returns +/// data: TransactionEndorsingData - transaction endorsement data to sign +pub async fn build_did_add_delegate_endorsing_data( + client: &LedgerClient, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, + validity: &Validity, +) -> VdrResult; + +/// Build transaction to execute EthereumExtDidRegistry.addDelegateSigned contract method to add a delegate. +/// An identity can assign multiple delegates to manage signing on their behalf for specific purposes. +/// +/// Endorsing version of the method - sender is not identity owner +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address +/// - `did` DID to add a delegate +/// - `delegate_type` type of delegation (`veriKey` or `sigAuth`) +/// - `delegate` account address of delegate +/// - `validity` delegate validity time +/// - `signature` signature of DID identity owner +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +pub async fn build_did_add_delegate_signed_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, + validity: &Validity, + signature: &SignatureData, +) -> VdrResult; + +/// Build transaction to execute EthereumExtDidRegistry.revokeDelegate contract method to revoke a delegate. +/// An identity can assign multiple delegates to manage signing on their behalf for specific purposes. +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address (Must be DID owner) +/// - `did` DID to revoke a delegate +/// - `delegate_type` type of delegation (`veriKey` or `sigAuth`) +/// - `delegate` account address of delegate +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +pub async fn build_did_revoke_delegate_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, +) -> VdrResult; + +/// Prepared data for endorsing EthereumExtDidRegistry.revokeDelegate contract method +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to add a delegate +/// - `delegate_type` type of delegation (`veriKey` or `sigAuth`) +/// - `delegate` account address of delegate +/// +/// #Returns +/// data: TransactionEndorsingData - transaction endorsement data to sign +pub async fn build_did_revoke_delegate_endorsing_data( + client: &LedgerClient, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, +) -> VdrResult; + +/// Build transaction to execute EthereumExtDidRegistry.revokeDelegateSigned contract method to revoke a delegate. +/// An identity can assign multiple delegates to manage signing on their behalf for specific purposes. +/// +/// Endorsing version of the method - sender is not identity owner +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address +/// - `did` DID to revoke a delegate +/// - `delegate_type` type of delegation (`veriKey` or `sigAuth`) +/// - `delegate` account address of delegate +/// - `signature` signature of DID identity owner +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +pub async fn build_did_revoke_delegate_signed_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, + signature: &SignatureData, +) -> VdrResult; + +/// Build transaction to execute EthereumExtDidRegistry.setAttribute contract method to add +/// a non ledger DID associated attribute. +/// An identity may need to publish some information that is only needed off-chain but +/// still requires the security benefits of using a blockchain. +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address (Must be DID owner) +/// - `did` DID to add an attribute +/// - `attribute` attribute to add +/// - `validity` attribute validity time +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +pub async fn build_did_set_attribute_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + attribute: &DidDocAttribute, + validity: &Validity, +) -> VdrResult; + +/// Prepared data for endorsing EthereumExtDidRegistry.setAttribute contract method +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to add an attribute +/// - `attribute` attribute to add +/// - `validity` attribute validity time +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +pub async fn build_did_set_attribute_endorsing_data( + client: &LedgerClient, + did: &DID, + attribute: &DidDocAttribute, + validity: &Validity, +) -> VdrResult; + +/// Build transaction to execute EthereumExtDidRegistry.setAttributeSigned contract method to add +/// a non ledger DID associated attribute. +/// An identity may need to publish some information that is only needed off-chain but +/// still requires the security benefits of using a blockchain. +/// +/// Endorsing version of the method - sender is not identity owner +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address +/// - `did` DID to add an attribute +/// - `attribute` attribute to add +/// - `validity` attribute validity time +/// - `signature` signature of DID identity owner +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +pub async fn build_did_set_attribute_signed_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + attribute: &DidDocAttribute, + validity: &Validity, + signature: &SignatureData, +) -> VdrResult; + +/// Build transaction to execute EthereumExtDidRegistry.revokeAttribute contract method to revoke +/// a non ledger DID associated attribute. +/// An identity may need to publish some information that is only needed off-chain but +/// still requires the security benefits of using a blockchain. +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address (Must be DID owner) +/// - `did` DID to revoke an attribute +/// - `attribute` attribute to add +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +pub async fn build_did_revoke_attribute_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + attribute: &DidDocAttribute, +) -> VdrResult; + +/// Prepared data for endorsing EthereumExtDidRegistry.revokeAttribute contract method +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to add an attribute +/// - `attribute` attribute to add +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +pub async fn build_did_revoke_attribute_endorsing_data( + client: &LedgerClient, + did: &DID, + attribute: &DidDocAttribute, +) -> VdrResult; + +/// Build transaction to execute EthereumExtDidRegistry.revokeAttributeSigned contract method to revoke +/// a non ledger DID associated attribute. +/// An identity may need to publish some information that is only needed off-chain but +/// still requires the security benefits of using a blockchain. +/// +/// Endorsing version of the method - sender is not identity owner +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address +/// - `did` DID to revoke an attribute +/// - `attribute` attribute to add +/// - `signature` signature of DID identity owner +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +pub async fn build_did_revoke_attribute_signed_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + attribute: &DidDocAttribute, + signature: &SignatureData, +) -> VdrResult; ``` -#### Resolve DID +#### Resolve ```rust -/// Prepare transaction executing `IndyDidRegistry.resolveDid` smart contract method to resolve a DID +/// Build transaction to execute EthereumExtDidRegistry.owners contract method to get +/// an account address owning the DID. /// /// #Params -/// param: client: Ledger - client (Ethereum client - for example web3::Http) -/// param: did: string - DID to resolve +/// - `client` client connected to the network where contract will be executed +/// - `did` target DID /// /// #Returns -/// transaction: Transaction - prepared transaction object -fn indy_vdr_build_resolve_did_transaction( - client: LedgerClient, - did: String, -) -> Transaction; -``` +/// transaction: Transaction - prepared read transaction object to submit +pub async fn build_get_did_owner_transaction( + client: &LedgerClient, + did: &DID, +) -> VdrResult; + +/// Build transaction to execute EthereumExtDidRegistry.changed contract method to get +/// block number when DID was changed last time +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` target DID +/// +/// #Returns +/// transaction: Transaction - prepared read transaction object to submit +pub async fn build_get_did_changed_transaction( + client: &LedgerClient, + did: &DID, +) -> VdrResult; + +/// Build transaction to execute EthereumExtDidRegistry.nonce contract method to get signing +/// nonce needed for endorsement +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` target DID +/// +/// #Returns +/// transaction: Transaction - prepared read transaction object to submit +pub async fn build_get_identity_nonce_transaction( + client: &LedgerClient, + identity: &Address, +) -> VdrResult; -```rust -/// Parse response for of `IndyDidRegistry.resolveDid` smart contract +/// Build event query to obtain log DID associated events from the ledger /// /// #Params -/// param: client: Ledger - client (Ethereum client - for example web3::Http) -/// param: response: bytes - received response +/// - `client` client connected to the network where contract will be executed +/// - `did` target DID +/// - `from_block` start block +/// - `to_block` finish block /// /// #Returns -/// transaction: Transaction - prepared transaction object -fn indy_vdr_parse_resolve_did_response( - client: LedgerClient, - response: bytes, -) -> DidDocumentWithMeta; +/// query: EventQuery - prepared event query to send +pub async fn build_get_did_events_query( + client: &LedgerClient, + did: &DID, + from_block: Option<&Block>, + to_block: Option<&Block>, +) -> VdrResult + +/// Parse the result of execution EthereumExtDidRegistry.changed contract method to receive +/// a block number when DID was changed last time +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Block number +pub fn parse_did_changed_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult; + +/// Parse the result of execution EthereumExtDidRegistry.owners contract method to receive +/// an account address owning the DID. +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Owner account address +pub fn parse_did_owner_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult
; + +/// Parse the result of execution EthereumExtDidRegistry.nonce contract method to receive +/// a signing nonce needed for endorsement +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Nonce to use for endorsing +pub fn parse_did_nonce_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult; + +/// Parse DidAttributeChangedEvent from the event log. +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Parsed DidAttributeChanged event object +pub fn parse_did_attribute_changed_event_response( + client: &LedgerClient, + log: &EventLog, +) -> VdrResult; + +/// Parse DidDelegateChangedEvent from the event log. +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Parsed DidDelegateChanged event object +pub fn parse_did_delegate_changed_event_response( + client: &LedgerClient, + log: &EventLog, +) -> VdrResult; + +/// Parse DidOwnerChangedEvent from the event log. +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Parsed DidOwnerChanged event object +pub fn parse_did_owner_changed_event_response( + client: &LedgerClient, + log: &EventLog, +) -> VdrResult; + +/// Parse DID associated event from the event log (it can be one of: DidAttributeChanged, DidDelegateChanged, DidOwnerChanged). +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Parsed DID event object +pub fn parse_did_event_response(client: &LedgerClient, event: &EventLog) -> VdrResult; + +/// Single step function to resolve a DidDocument with metadata for the given DID +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to get a DID Document and metadata +/// - `options` Resolution options +/// +/// # Returns +/// Parsed DID event object +pub async fn resolve_did( + client: &LedgerClient, + did: &DID, + options: Option<&DidResolutionOptions>, +) -> VdrResult ``` + ### Schema #### Create Schema ```rust -/// Prepare transaction executing SchemaRegistry.createSchema smart contract method +/// Build transaction to execute SchemaRegistry.createSchema contract method to create a new Schema +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `from` transaction sender account address +/// - `id` id of schema to be created +/// - `schema` Schema object matching to the specification - https://hyperledger.github.io/anoncreds-spec/#term:schema +/// +/// # Returns +/// Write transaction to sign and submit +pub async fn build_create_schema_transaction( + client: &LedgerClient, + from: &Address, + id: &SchemaId, + schema: &Schema, +) -> VdrResult; + +/// Prepared data for execution of SchemaRegistry.createSchema contract method to endorse a new Schema /// /// #Params -/// param: client: Ledger - client (Ethereum client - for example web3::Http) -/// param: from: string - sender account address -/// param: id: string - id of schema to be created -/// param: schema: Schema - Schema object matching to the specification - https://hyperledger.github.io/anoncreds-spec/#term:schema +/// - `client` client connected to the network where contract will be executed +/// - `id` id of schema to be created +/// - `schema` Schema object matching to the specification - https://hyperledger.github.io/anoncreds-spec/#term:schema /// /// #Returns -/// transaction: Transaction - prepared transaction object -fn indy_vdr_build_create_schema_transaction( - client: LedgerClient, - from: String, - id: String, - schema: Schema, -) -> Transaction; +/// data: TransactionEndorsingData - transaction endorsement data to sign +pub async fn build_create_schema_endorsing_data( + client: &LedgerClient, + id: &SchemaId, + schema: &Schema, +) -> VdrResult; + +/// Build transaction to execute SchemaRegistry.createSchemaSigned contract method to +/// endorse a new Schema +/// Endorsing version of the method - sender is not identity owner +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `id` id of schema to be created +/// - `schema` Schema object matching to the specification - https://hyperledger.github.io/anoncreds-spec/#term:schema +/// - `signature` signature of schema issuer +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +pub async fn build_create_schema_signed_transaction( + client: &LedgerClient, + sender: &Address, + id: &SchemaId, + schema: &Schema, + signature: &SignatureData, +) -> VdrResult ``` #### Resolve Schema ```rust -/// Prepare transaction executing `SchemaRegistry.resolveSchema` smart contract method +/// Build transaction to execute SchemaRegistry.schemasCreated contract method to get +/// block number when Schema was created /// /// #Params -/// param: client: Ledger - client (Ethereum client - for example web3::Http) -/// param: id: string - id of Schema to resolve +/// - `client` client connected to the network where contract will be executed +/// - `id` identifier of target schema /// /// #Returns -/// transaction: Transaction - prepared transaction object -fn indy_vdr_build_resolve_schema_transaction( - client: LedgerClient, - id: String, -) -> Transaction; -``` +/// transaction: Transaction - prepared read transaction object to submit +pub async fn build_get_schema_created_transaction( + client: &LedgerClient, + id: &SchemaId, +) -> VdrResult; -```rust -/// Parse response for of `SchemaRegistry.resolveSchema` smart contract +/// Build event query to get SchemaRegistry.SchemaCreated event from the ledger /// /// #Params -/// param: client: Ledger - client (Ethereum client - for example web3::Http) -/// param: response: bytes - received response bytes +/// - `client` client connected to the network where contract will be executed +/// - `id` identifier of target schema +/// - `from_block` start block +/// - `to_block` finish block /// /// #Returns -/// transaction: Transaction - prepared transaction object -fn indy_vdr_parse_resolve_schema_response( - client: LedgerClient, - response: bytes, -) -> SchemaWithMeta; +/// query: EventQuery - prepared event query to send +#[logfn(Ifo)] +pub async fn build_get_schema_query( + client: &LedgerClient, + id: &SchemaId, + from_block: Option<&Block>, + to_block: Option<&Block>, +) -> VdrResult +``` + +```rust +/// Parse the result of execution SchemaRegistry.schemas contract method to receive +/// block number when a schema was created +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Block when the schema was created +pub fn parse_schema_created_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult; + +/// Parse SchemaRegistry.SchemaCreated from the event log. +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Parsed Schema object +pub fn parse_schema_created_event(client: &LedgerClient, log: &EventLog) -> VdrResult +``` + +```rust +/// Single step function to resolve a Schema for the given ID +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `id` id of schema to resolve +/// +/// # Returns +/// Resolved Schema object +pub async fn resolve_schema(client: &LedgerClient, id: &SchemaId) -> VdrResult; ``` ### Credential Definition @@ -401,54 +878,128 @@ fn indy_vdr_parse_resolve_schema_response( #### Create Credential Definition ```rust -/// Prepare transaction executing CredentialDefinitionRegistry.createCredentialDefinition smart contract method +/// Build transaction to execute CredentialDefinitionRegistry.createCredentialDefinition contract +/// method to create a new Credential Definition +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `from` transaction sender account address +/// - `id` id of credential definition to be created +/// - `credential_definition` Credential Definition object matching to the specification - https://hyperledger.github.io/anoncreds-spec/#term:credential-definition +/// +/// # Returns +/// Write transaction to sign and submit +pub async fn build_create_credential_definition_transaction( + client: &LedgerClient, + from: &Address, + id: &CredentialDefinitionId, + credential_definition: &CredentialDefinition, +) -> VdrResult; + +/// Prepared data for endorsing CredentialDefinitionRegistry.createCredentialDefinition contract method /// /// #Params -/// param: client: Ledger - client (Ethereum client - for example web3::Http) -/// param: from: string - sender account address -/// param: id: string - id of credential definition to be created -/// param: cred_def - Credential Definition object matching to the specification - https://hyperledger.github.io/anoncreds-spec/#term:credential-definition +/// - `client` client connected to the network where contract will be executed +/// - `id` id of credential definition to be created +/// - `credential_definition` Credential Definition object matching to the specification - https://hyperledger.github.io/anoncreds-spec/#term:credential-definition /// /// #Returns -/// transaction: Transaction - prepared transaction object -fn indy_vdr_build_create_credential_definition_transaction( - client: LedgerClient, - from: String, - id: String, - cred_def: CredentialDefinition, -) -> Transaction; +/// data: TransactionEndorsingData - transaction endorsement data to sign +pub async fn build_create_credential_definition_endorsing_data( + client: &LedgerClient, + id: &CredentialDefinitionId, + credential_definition: &CredentialDefinition, +) -> VdrResult; + +/// Build transaction to execute CredentialDefinitionRegistry.createCredentialDefinitionSigned contract method to +/// endorse a new Credential Definition +/// Endorsing version of the method - sender is not identity owner +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `id` id of credential definition to be created +/// - `credential_definition` Credential Definition object matching to the specification - https://hyperledger.github.io/anoncreds-spec/#term:credential-definition +/// - `signature` signature of schema issuer +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +pub async fn build_create_credential_definition_signed_transaction( + client: &LedgerClient, + from: &Address, + id: &CredentialDefinitionId, + credential_definition: &CredentialDefinition, + signature: &SignatureData, +) -> VdrResult ``` #### Resolve Credential DefinitionCredential Definition ```rust -/// Prepare transaction executing CredentialDefinitionRegistry.resolveCredentialDefinition smart contract method +/// Build transaction to execute CredentialDefinitionRegistry.credDefs contract method to get +/// block number when a Credential Definition was created /// /// #Params -/// param: client: Ledger - client (Ethereum client - for example web3::Http) -/// param: id: string - id of Credential Definition to resolve +/// - `client` client connected to the network where contract will be executed +/// - `id` identifier of target credential definition /// /// #Returns -/// transaction: Transaction - prepared transaction object -fn indy_vdr_build_resolve_credential_definition_transaction( - client: LedgerClient, - id: String, -) -> Transaction; -``` +/// transaction: Transaction - prepared read transaction object to submit +pub async fn build_get_credential_definition_created_transaction( + client: &LedgerClient, + id: &CredentialDefinitionId, +) -> VdrResult; -```rust -/// Parse response for of `CredentialDefinitionRegistry.resolveCredentialDefinition` smart contract +/// Build event query to get CredentialDefinitionRegistry.CredentialDefinitionCreated event from the ledger /// /// #Params -/// param: client: Ledger - client (Ethereum client - for example web3::Http) -/// param: response: bytes - received response bytes +/// - `client` client connected to the network where contract will be executed +/// - `id` identifier of target credential definition +/// - `from_block` start block +/// - `to_block` finish block /// /// #Returns -/// transaction: Transaction - prepared transaction object -fn indy_vdr_parse_resolve_credential_definition_response( - client: LedgerClient, - response: bytes, -) -> CredentialDefinitionWithMeta; +/// query: EventQuery - prepared event query to send +pub async fn build_get_credential_definition_query( + client: &LedgerClient, + id: &CredentialDefinitionId, + from_block: Option<&Block>, + to_block: Option<&Block>, +) -> VdrResult +``` + +```rust +/// Parse the result of execution CredentialDefinitionRegistry.credDefs contract method to receive +/// block number when a credential definition was created +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Block when the credential definition was created +pub fn parse_credential_definition_created_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult; + +/// Parse CredentialDefinitionRegistry.CredentialDefinitionCreated from the event log. +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Parsed Credential Definition event object +pub fn parse_credential_definition_created_event(client: &LedgerClient, log: &EventLog) -> VdrResult +``` + +```rust +/// Single step function to resolve a Credential Definition for the given ID +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `id` id of schema to resolve +/// +/// # Returns +/// Resolved Credential Definition object +pub async fn resolve_credential_definition(client: &LedgerClient, id: &CredentialDefinitionId) -> VdrResult; ``` ### Auth @@ -471,7 +1022,8 @@ fn indy_vdr_build_assign_role_transaction( client: LedgerClient, from: String, to: String, - role: u8, + role: String, + options: Option, ) -> Transaction; ``` @@ -491,9 +1043,9 @@ fn indy_vdr_build_assign_role_transaction( /// transaction: Transaction - prepared transaction object fn indy_vdr_build_revoke_role_transaction( client: LedgerClient, - from:String, + from: String, to: String, - role: u8, + role: String, options: Option, ) -> Transaction; ``` diff --git a/docs/roadmap.md b/docs/roadmap.md index 29d0454f..f3a59760 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -31,23 +31,20 @@ Note: Right now we have finished PoC implementation. Roadmap tasks and their pri ## Phase 1: MVP -* DID Method: - * Publish final version of Indy2 DID Method specification - * Ability for easy integration of DID methods into the network infrastructures - * Possibility of integration with `did:ethr` method - * Compatibility with `did:indy` and `did:sov` methods * Network identity implementation: - * Indy2 DID method - * More strict validation of DID Document format - * Implement a validation to check VerificationRelationship format (Can accept only id or verificationMethod) - * CL Registry: - * Implement owner verification + * Deprecate Indy2 method in favor of using `did:ethr` contract and specification + * CL Registry: implement event approach matching to `did:ethr` design + * Endorsement support for DID Documents and CL entities * Network Permission implementation: * Restrict execution of transactions exclusively to users with specific roles +* Network configuration + * Improve error handling + * Add transaction explorer * Demo: * Integration into Aries Frameworks Javascript * Migration: * Tooling implementation + * Mapping of legacy identifiers to ethereum account * Ready for experiments and testing * Documentation: * Network operators: @@ -60,8 +57,10 @@ Note: Right now we have finished PoC implementation. Roadmap tasks and their pri * How to issue and verify credentials * VDR: * Support `did:ethr` DID method + * Support endorsement flow + * Implement additional validations to replace checks removed from contracts. * Wrappers for foreign languages: Python + JavaScript - * `indy-vdr` integration + * Quorum handling for read and write transactions ## Phase 2: Beta @@ -71,29 +70,25 @@ Note: Right now we have finished PoC implementation. Roadmap tasks and their pri * Implement IaC for setting up a network monitor and explorer * Network configuration: * Tooling for configuration of specific networks + * Add Transaction Author Agreement * Network Permission: * Logic for assigning roles (Trustee) by consensus * Network identity: - * DID ownership verification: - * Validate Verification Methods with EcdsaSecp256k1Signature2019 keys - * Validation of the DID identifier using its associated verification key (will probably need to be implemented - sha2 hash and Base58 encoder) * Restrict the creation of DID, Schema, and Cred Def exclusively to users with Trustee and Endorser roles - * Add `DidUniversalResolver` contract so that adding a support for new DID method * Aries Frameworks: * Support Indy 2.0 in Aries Framework Javascript * Support Indy 2.0 in ACA-Py * Migration: * Process finalization -* DID Method: - * Advanced format and ownership validation * CL Registry: * Revocation entities support * Command Line Interface * CI/CD * Advanced: testing and deployment * VDR + * `indy-vdr` integration * Revocation support + * Improve client API in more user-friendly way ## Phase 3: New features diff --git a/network/config/besu/.env b/network/config/besu/.env index a032ac09..7dc7cb84 100644 --- a/network/config/besu/.env +++ b/network/config/besu/.env @@ -1,4 +1,4 @@ LOG4J_CONFIGURATION_FILE=/config/log-config.xml - +BESU_REVERT_REASON_ENABLED=true diff --git a/network/config/besu/config.toml b/network/config/besu/config.toml index c5af9d42..b3cf5567 100644 --- a/network/config/besu/config.toml +++ b/network/config/besu/config.toml @@ -5,6 +5,7 @@ logging="INFO" data-path="/opt/besu/data" host-allowlist=["*"] min-gas-price=0 +revert-reason-enabled=true # rpc rpc-http-enabled=true diff --git a/network/config/besu/genesis.json b/network/config/besu/genesis.json index df139c11..29c74459 100644 --- a/network/config/besu/genesis.json +++ b/network/config/besu/genesis.json @@ -76,23 +76,23 @@ "0x0000000000000000000000000000000000008888": { "comment": "Proxy: Account permissioning smart contract", "balance": "0", - "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212202bb3e818f8e7f23c5970e203f84012b1e8339cbb5380d39199eb3da2d17147c364736f6c63430008170033", + "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212208de99705f21830b33bf2bd4a57ce70f27ec58ac48b2c88e1c96b59a11978ef8164736f6c63430008170033", "storage": { "0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000009999", "0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000006666", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000e6ca358186b77b89c6b8962844a04768bd881564" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000e4b52aa82142466f16866aab7df38ac244194ace" } }, - "0xe6ca358186b77b89c6b8962844a04768bd881564": { + "0xe4b52aa82142466f16866aab7df38ac244194ace": { "comment": "Implementation: Account permissioning smart contract", "balance": "0", - "code": "0x60806040526004361061004a5760003560e01c8063485cc9551461004f5780634f1ef2861461007157806352d1902d14610084578063936421d5146100ac578063ad3cb1cc146100dc575b600080fd5b34801561005b57600080fd5b5061006f61006a36600461082c565b61011a565b005b61006f61007f366004610875565b610246565b34801561009057600080fd5b50610099610265565b6040519081526020015b60405180910390f35b3480156100b857600080fd5b506100cc6100c7366004610937565b610282565b60405190151581526020016100a3565b3480156100e857600080fd5b5061010d604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100a39190610a0c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156101605750825b905060008267ffffffffffffffff16600114801561017d5750303b155b90508115801561018b575080155b156101a95760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156101d357845460ff60401b1916600160401b1785555b600180546001600160a01b0319166001600160a01b0389161790556101f7866103a8565b831561023d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b61024e6103d2565b61025782610479565b61026182826104df565b5050565b600061026f6105a6565b50600080516020610ad183398151915290565b60006001600160a01b03871615801561030b575060018054604051634f4bdc7b60e11b81526001600160a01b0390911691639e97b8f6916102c891908c90600401610a3f565b602060405180830381865afa1580156102e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103099190610a79565b155b156103185750600061039d565b600154604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f69061034b906000908c90600401610a3f565b602060405180830381865afa158015610368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038c9190610a79565b156103995750600061039d565b5060015b979650505050505050565b6103b06105ef565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061045957507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661044d600080516020610ad1833981519152546001600160a01b031690565b6001600160a01b031614155b156104775760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b1580156104c457600080fd5b505afa1580156104d8573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610539575060408051601f3d908101601f1916820190925261053691810190610a9b565b60015b61056657604051634c9c8ce360e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610ad1833981519152811461059757604051632a87526960e21b81526004810182905260240161055d565b6105a18383610638565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104775760405163703e46dd60e11b815260040160405180910390fd5b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661047757604051631afcd79f60e31b815260040160405180910390fd5b6106418261068e565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610686576105a182826106f3565b610261610769565b806001600160a01b03163b6000036106c457604051634c9c8ce360e01b81526001600160a01b038216600482015260240161055d565b600080516020610ad183398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516107109190610ab4565b600060405180830381855af49150503d806000811461074b576040519150601f19603f3d011682016040523d82523d6000602084013e610750565b606091505b5091509150610760858383610788565b95945050505050565b34156104775760405163b398979f60e01b815260040160405180910390fd5b60608261079d57610798826107e7565b6107e0565b81511580156107b457506001600160a01b0384163b155b156107dd57604051639996b31560e01b81526001600160a01b038516600482015260240161055d565b50805b9392505050565b8051156107f75780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b038116811461082757600080fd5b919050565b6000806040838503121561083f57600080fd5b61084883610810565b915061085660208401610810565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561088857600080fd5b61089183610810565b9150602083013567ffffffffffffffff808211156108ae57600080fd5b818501915085601f8301126108c257600080fd5b8135818111156108d4576108d461085f565b604051601f8201601f19908116603f011681019083821181831017156108fc576108fc61085f565b8160405282815288602084870101111561091557600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600080600080600080600060c0888a03121561095257600080fd5b61095b88610810565b965061096960208901610810565b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff8082111561099b57600080fd5b818a0191508a601f8301126109af57600080fd5b8135818111156109be57600080fd5b8b60208285010111156109d057600080fd5b60208301945080935050505092959891949750929550565b60005b83811015610a035781810151838201526020016109eb565b50506000910152565b6020815260008251806020840152610a2b8160408501602087016109e8565b601f01601f19169190910160400192915050565b6040810160048410610a6157634e487b7160e01b600052602160045260246000fd5b9281526001600160a01b039190911660209091015290565b600060208284031215610a8b57600080fd5b815180151581146107e057600080fd5b600060208284031215610aad57600080fd5b5051919050565b60008251610ac68184602087016109e8565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212204d621b1d6519129b2cb8976e1fde6812df8d65f411c3d820220cc721cc46206964736f6c63430008170033" + "code": "0x60806040526004361061004a5760003560e01c8063485cc9551461004f5780634f1ef2861461007157806352d1902d14610084578063936421d5146100ac578063ad3cb1cc146100dc575b600080fd5b34801561005b57600080fd5b5061006f61006a36600461082c565b61011a565b005b61006f61007f366004610875565b610246565b34801561009057600080fd5b50610099610265565b6040519081526020015b60405180910390f35b3480156100b857600080fd5b506100cc6100c7366004610937565b610282565b60405190151581526020016100a3565b3480156100e857600080fd5b5061010d604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100a39190610a0c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156101605750825b905060008267ffffffffffffffff16600114801561017d5750303b155b90508115801561018b575080155b156101a95760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156101d357845460ff60401b1916600160401b1785555b600180546001600160a01b0319166001600160a01b0389161790556101f7866103a8565b831561023d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b61024e6103d2565b61025782610479565b61026182826104df565b5050565b600061026f6105a6565b50600080516020610ad183398151915290565b60006001600160a01b03871615801561030b575060018054604051634f4bdc7b60e11b81526001600160a01b0390911691639e97b8f6916102c891908c90600401610a3f565b602060405180830381865afa1580156102e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103099190610a79565b155b156103185750600061039d565b600154604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f69061034b906000908c90600401610a3f565b602060405180830381865afa158015610368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038c9190610a79565b156103995750600061039d565b5060015b979650505050505050565b6103b06105ef565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061045957507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661044d600080516020610ad1833981519152546001600160a01b031690565b6001600160a01b031614155b156104775760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b1580156104c457600080fd5b505afa1580156104d8573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610539575060408051601f3d908101601f1916820190925261053691810190610a9b565b60015b61056657604051634c9c8ce360e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610ad1833981519152811461059757604051632a87526960e21b81526004810182905260240161055d565b6105a18383610638565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104775760405163703e46dd60e11b815260040160405180910390fd5b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661047757604051631afcd79f60e31b815260040160405180910390fd5b6106418261068e565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610686576105a182826106f3565b610261610769565b806001600160a01b03163b6000036106c457604051634c9c8ce360e01b81526001600160a01b038216600482015260240161055d565b600080516020610ad183398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516107109190610ab4565b600060405180830381855af49150503d806000811461074b576040519150601f19603f3d011682016040523d82523d6000602084013e610750565b606091505b5091509150610760858383610788565b95945050505050565b34156104775760405163b398979f60e01b815260040160405180910390fd5b60608261079d57610798826107e7565b6107e0565b81511580156107b457506001600160a01b0384163b155b156107dd57604051639996b31560e01b81526001600160a01b038516600482015260240161055d565b50805b9392505050565b8051156107f75780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b038116811461082757600080fd5b919050565b6000806040838503121561083f57600080fd5b61084883610810565b915061085660208401610810565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561088857600080fd5b61089183610810565b9150602083013567ffffffffffffffff808211156108ae57600080fd5b818501915085601f8301126108c257600080fd5b8135818111156108d4576108d461085f565b604051601f8201601f19908116603f011681019083821181831017156108fc576108fc61085f565b8160405282815288602084870101111561091557600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600080600080600080600060c0888a03121561095257600080fd5b61095b88610810565b965061096960208901610810565b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff8082111561099b57600080fd5b818a0191508a601f8301126109af57600080fd5b8135818111156109be57600080fd5b8b60208285010111156109d057600080fd5b60208301945080935050505092959891949750929550565b60005b83811015610a035781810151838201526020016109eb565b50506000910152565b6020815260008251806020840152610a2b8160408501602087016109e8565b601f01601f19169190910160400192915050565b6040810160048410610a6157634e487b7160e01b600052602160045260246000fd5b9281526001600160a01b039190911660209091015290565b600060208284031215610a8b57600080fd5b815180151581146107e057600080fd5b600060208284031215610aad57600080fd5b5051919050565b60008251610ac68184602087016109e8565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122024c7a984c1746f95a2bb68bb5a8f4cbdcd789ffee8005f9c276c257eb25e2fb764736f6c63430008170033" }, "0x0000000000000000000000000000000000006666": { "comment": "Proxy: Smart contract to manage account roles", "balance": "0", - "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212202bb3e818f8e7f23c5970e203f84012b1e8339cbb5380d39199eb3da2d17147c364736f6c63430008170033", + "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212208de99705f21830b33bf2bd4a57ce70f27ec58ac48b2c88e1c96b59a11978ef8164736f6c63430008170033", "storage": { "0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000009999", "aedead2c33b41c31b4afd2246c6bf5131c209d4b0ca6c2247778ac7be7443a00": "0000000000000000000000000000000000000000000000000000000000000001", @@ -105,18 +105,18 @@ "88601476d11616a71c5be67555bd1dff4b1cbf21533d2669b768b61518cfe1c3": "0000000000000000000000000000000000000000000000000000000000000001", "a15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054c": "0000000000000000000000000000000000000000000000000000000000000005", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000b9059400dcd05158ffd8ca092937989dd27b3bdc" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000b916cf0bdb279c2d91fa7ab4b11d364ddaa8ae15" } }, - "0xb9059400dcd05158ffd8ca092937989dd27b3bdc": { + "0xb916cf0bdb279c2d91fa7ab4b11d364ddaa8ae15": { "comment": "Implementation: Smart contract to manage account roles", "balance": "0", - "code": "0x6080604052600436106100865760003560e01c806388a5bf6e1161005957806388a5bf6e146101425780639e97b8f614610162578063ad3cb1cc14610182578063c4d66de8146101c0578063d02971ca146101e057600080fd5b8063442767331461008b5780634cbb87d3146100da5780634f1ef2861461010a57806352d1902d1461011f575b600080fd5b34801561009757600080fd5b506100c46100a6366004610bc5565b6001600160a01b031660009081526001602052604090205460ff1690565b6040516100d19190610bf6565b60405180910390f35b3480156100e657600080fd5b506100fa6100f5366004610c2d565b610215565b60405190151581526020016100d1565b61011d610118366004610c76565b61037d565b005b34801561012b57600080fd5b5061013461039c565b6040519081526020016100d1565b34801561014e57600080fd5b506100c461015d366004610c2d565b6103b9565b34801561016e57600080fd5b506100fa61017d366004610c2d565b61052e565b34801561018e57600080fd5b506101b3604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100d19190610d5c565b3480156101cc57600080fd5b5061011d6101db366004610bc5565b610577565b3480156101ec57600080fd5b506102006101fb366004610d8f565b6106f2565b60405163ffffffff90911681526020016100d1565b60008260006002600083600381111561023057610230610be0565b600381111561024157610241610be0565b815260208101919091526040016000205460ff169050610261813361052e565b6102855760405163472511eb60e11b81523360048201526024015b60405180910390fd5b61028f858561052e565b15610370576001600160a01b0384166000908152600160205260408120805460ff1916905560039086828111156102c8576102c8610be0565b60038111156102d9576102d9610be0565b815260208101919091526040016000908120805463ffffffff16916102fd83610dc0565b91906101000a81548163ffffffff021916908363ffffffff16021790555050336001600160a01b0316846001600160a01b03167f5a8379f4a3380f87fd5924475f76a3471ac8d775668601653e3f9ef69a3dd2718760405161035f9190610bf6565b60405180910390a360019250610375565b600092505b505092915050565b610385610738565b61038e826107df565b6103988282610845565b5050565b60006103a6610907565b50600080516020610e3983398151915290565b6000826000600260008360038111156103d4576103d4610be0565b60038111156103e5576103e5610be0565b815260208101919091526040016000205460ff169050610405813361052e565b6104245760405163472511eb60e11b815233600482015260240161027c565b61042e858561052e565b610525576001600160a01b03841660009081526001602081905260409091208054879260ff199091169083600381111561046a5761046a610be0565b02179055506003600086600381111561048557610485610be0565b600381111561049657610496610be0565b815260208101919091526040016000908120805463ffffffff16916104ba83610de0565b91906101000a81548163ffffffff021916908363ffffffff16021790555050336001600160a01b0316846001600160a01b03167f47307e88f3e82b4e8cdffde5a264aa53a2ee17636fd8df7effe0a098da4956568760405161051c9190610bf6565b60405180910390a35b50929392505050565b600082600381111561054257610542610be0565b6001600160a01b03831660009081526001602052604090205460ff16600381111561056f5761056f610be0565b149392505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806105c15750805467ffffffffffffffff808416911610155b156105df5760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b178155610609610950565b60026020527fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e08054600160ff1991821681179092557f679795a0195a1b76cdebb7c51d74e058aee92919b8c3389af86ef24535e8a28c805482168317905560036000527f88601476d11616a71c5be67555bd1dff4b1cbf21533d2669b768b61518cfe1c3805490911690911790556106a08361095e565b805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b60006003600083600381111561070a5761070a610be0565b600381111561071b5761071b610be0565b815260208101919091526040016000205463ffffffff1692915050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806107bf57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166107b3600080516020610e39833981519152546001600160a01b031690565b6001600160a01b031614155b156107dd5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561082a57600080fd5b505afa15801561083e573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561089f575060408051601f3d908101601f1916820190925261089c91810190610e03565b60015b6108c757604051634c9c8ce360e01b81526001600160a01b038316600482015260240161027c565b600080516020610e3983398151915281146108f857604051632a87526960e21b81526004810182905260240161027c565b6109028383610988565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107dd5760405163703e46dd60e11b815260040160405180910390fd5b61095b6001336103b9565b50565b6109666109de565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b61099182610a27565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156109d6576109028282610a8c565b610398610b02565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166107dd57604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b600003610a5d57604051634c9c8ce360e01b81526001600160a01b038216600482015260240161027c565b600080516020610e3983398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610aa99190610e1c565b600060405180830381855af49150503d8060008114610ae4576040519150601f19603f3d011682016040523d82523d6000602084013e610ae9565b606091505b5091509150610af9858383610b21565b95945050505050565b34156107dd5760405163b398979f60e01b815260040160405180910390fd5b606082610b3657610b3182610b80565b610b79565b8151158015610b4d57506001600160a01b0384163b155b15610b7657604051639996b31560e01b81526001600160a01b038516600482015260240161027c565b50805b9392505050565b805115610b905780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610bc057600080fd5b919050565b600060208284031215610bd757600080fd5b610b7982610ba9565b634e487b7160e01b600052602160045260246000fd5b6020810160048310610c1857634e487b7160e01b600052602160045260246000fd5b91905290565b803560048110610bc057600080fd5b60008060408385031215610c4057600080fd5b610c4983610c1e565b9150610c5760208401610ba9565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610c8957600080fd5b610c9283610ba9565b9150602083013567ffffffffffffffff80821115610caf57600080fd5b818501915085601f830112610cc357600080fd5b813581811115610cd557610cd5610c60565b604051601f8201601f19908116603f01168101908382118183101715610cfd57610cfd610c60565b81604052828152886020848701011115610d1657600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b83811015610d53578181015183820152602001610d3b565b50506000910152565b6020815260008251806020840152610d7b816040850160208701610d38565b601f01601f19169190910160400192915050565b600060208284031215610da157600080fd5b610b7982610c1e565b634e487b7160e01b600052601160045260246000fd5b600063ffffffff821680610dd657610dd6610daa565b6000190192915050565b600063ffffffff808316818103610df957610df9610daa565b6001019392505050565b600060208284031215610e1557600080fd5b5051919050565b60008251610e2e818460208701610d38565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212204a42482ffed0aa6d3e0658e07f3883d70783760f3258191fe1ab6fb80840cbe364736f6c63430008170033" + "code": "0x6080604052600436106100865760003560e01c806388a5bf6e1161005957806388a5bf6e146101425780639e97b8f614610162578063ad3cb1cc14610182578063c4d66de8146101c0578063d02971ca146101e057600080fd5b8063442767331461008b5780634cbb87d3146100da5780634f1ef2861461010a57806352d1902d1461011f575b600080fd5b34801561009757600080fd5b506100c46100a6366004610bc5565b6001600160a01b031660009081526001602052604090205460ff1690565b6040516100d19190610bf6565b60405180910390f35b3480156100e657600080fd5b506100fa6100f5366004610c2d565b610215565b60405190151581526020016100d1565b61011d610118366004610c76565b61037d565b005b34801561012b57600080fd5b5061013461039c565b6040519081526020016100d1565b34801561014e57600080fd5b506100c461015d366004610c2d565b6103b9565b34801561016e57600080fd5b506100fa61017d366004610c2d565b61052e565b34801561018e57600080fd5b506101b3604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100d19190610d5c565b3480156101cc57600080fd5b5061011d6101db366004610bc5565b610577565b3480156101ec57600080fd5b506102006101fb366004610d8f565b6106f2565b60405163ffffffff90911681526020016100d1565b60008260006002600083600381111561023057610230610be0565b600381111561024157610241610be0565b815260208101919091526040016000205460ff169050610261813361052e565b6102855760405163472511eb60e11b81523360048201526024015b60405180910390fd5b61028f858561052e565b15610370576001600160a01b0384166000908152600160205260408120805460ff1916905560039086828111156102c8576102c8610be0565b60038111156102d9576102d9610be0565b815260208101919091526040016000908120805463ffffffff16916102fd83610dc0565b91906101000a81548163ffffffff021916908363ffffffff16021790555050336001600160a01b0316846001600160a01b03167f5a8379f4a3380f87fd5924475f76a3471ac8d775668601653e3f9ef69a3dd2718760405161035f9190610bf6565b60405180910390a360019250610375565b600092505b505092915050565b610385610738565b61038e826107df565b6103988282610845565b5050565b60006103a6610907565b50600080516020610e3983398151915290565b6000826000600260008360038111156103d4576103d4610be0565b60038111156103e5576103e5610be0565b815260208101919091526040016000205460ff169050610405813361052e565b6104245760405163472511eb60e11b815233600482015260240161027c565b61042e858561052e565b610525576001600160a01b03841660009081526001602081905260409091208054879260ff199091169083600381111561046a5761046a610be0565b02179055506003600086600381111561048557610485610be0565b600381111561049657610496610be0565b815260208101919091526040016000908120805463ffffffff16916104ba83610de0565b91906101000a81548163ffffffff021916908363ffffffff16021790555050336001600160a01b0316846001600160a01b03167f47307e88f3e82b4e8cdffde5a264aa53a2ee17636fd8df7effe0a098da4956568760405161051c9190610bf6565b60405180910390a35b50929392505050565b600082600381111561054257610542610be0565b6001600160a01b03831660009081526001602052604090205460ff16600381111561056f5761056f610be0565b149392505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806105c15750805467ffffffffffffffff808416911610155b156105df5760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b178155610609610950565b60026020527fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e08054600160ff1991821681179092557f679795a0195a1b76cdebb7c51d74e058aee92919b8c3389af86ef24535e8a28c805482168317905560036000527f88601476d11616a71c5be67555bd1dff4b1cbf21533d2669b768b61518cfe1c3805490911690911790556106a08361095e565b805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b60006003600083600381111561070a5761070a610be0565b600381111561071b5761071b610be0565b815260208101919091526040016000205463ffffffff1692915050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806107bf57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166107b3600080516020610e39833981519152546001600160a01b031690565b6001600160a01b031614155b156107dd5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561082a57600080fd5b505afa15801561083e573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561089f575060408051601f3d908101601f1916820190925261089c91810190610e03565b60015b6108c757604051634c9c8ce360e01b81526001600160a01b038316600482015260240161027c565b600080516020610e3983398151915281146108f857604051632a87526960e21b81526004810182905260240161027c565b6109028383610988565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107dd5760405163703e46dd60e11b815260040160405180910390fd5b61095b6001336103b9565b50565b6109666109de565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b61099182610a27565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156109d6576109028282610a8c565b610398610b02565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166107dd57604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b600003610a5d57604051634c9c8ce360e01b81526001600160a01b038216600482015260240161027c565b600080516020610e3983398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610aa99190610e1c565b600060405180830381855af49150503d8060008114610ae4576040519150601f19603f3d011682016040523d82523d6000602084013e610ae9565b606091505b5091509150610af9858383610b21565b95945050505050565b34156107dd5760405163b398979f60e01b815260040160405180910390fd5b606082610b3657610b3182610b80565b610b79565b8151158015610b4d57506001600160a01b0384163b155b15610b7657604051639996b31560e01b81526001600160a01b038516600482015260240161027c565b50805b9392505050565b805115610b905780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610bc057600080fd5b919050565b600060208284031215610bd757600080fd5b610b7982610ba9565b634e487b7160e01b600052602160045260246000fd5b6020810160048310610c1857634e487b7160e01b600052602160045260246000fd5b91905290565b803560048110610bc057600080fd5b60008060408385031215610c4057600080fd5b610c4983610c1e565b9150610c5760208401610ba9565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610c8957600080fd5b610c9283610ba9565b9150602083013567ffffffffffffffff80821115610caf57600080fd5b818501915085601f830112610cc357600080fd5b813581811115610cd557610cd5610c60565b604051601f8201601f19908116603f01168101908382118183101715610cfd57610cfd610c60565b81604052828152886020848701011115610d1657600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b83811015610d53578181015183820152602001610d3b565b50506000910152565b6020815260008251806020840152610d7b816040850160208701610d38565b601f01601f19169190910160400192915050565b600060208284031215610da157600080fd5b610b7982610c1e565b634e487b7160e01b600052601160045260246000fd5b600063ffffffff821680610dd657610dd6610daa565b6000190192915050565b600063ffffffff808316818103610df957610df9610daa565b6001019392505050565b600060208284031215610e1557600080fd5b5051919050565b60008251610e2e818460208701610d38565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212201732ba2607bd323ad6b9ab7eaab6517fb63fd8cc432dcc9caa62384d439517ce64736f6c63430008170033" }, "0x0000000000000000000000000000000000007777": { "comment": "Proxy: Smart contract to manage validator nodes", "balance": "0", - "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212202bb3e818f8e7f23c5970e203f84012b1e8339cbb5380d39199eb3da2d17147c364736f6c63430008170033", + "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212208de99705f21830b33bf2bd4a57ce70f27ec58ac48b2c88e1c96b59a11978ef8164736f6c63430008170033", "storage": { "0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000009999", "0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000006666", @@ -130,113 +130,75 @@ "149d22bf3f008a1407770ecbdb723975d92c5073caa510ba413c1db0f8063ed8": "0000000000000000000000886328869e4e1f401e1052a5f4aae8b45f42610201", "7f33ce678224e207038746a5939df116c5dff1ccc6e79de84c95388c521e898c": "000000000000000000000f48de4a0c2939e62891f3c6aca68982975477e45301", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x0000000000000000000000004794e2e8a916eb21aded9546183fd565492b32bc" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x00000000000000000000000066bba756037fac0d44ccf9d087c6a83ea2352997" } }, - "0x4794e2e8a916eb21aded9546183fd565492b32bc": { + "0x66bba756037fac0d44ccf9d087c6a83ea2352997": { "comment": "Implementation: Smart contract to manage validator nodes", "balance": "0", - "code": "0x6080604052600436106100705760003560e01c806352d1902d1161004e57806352d1902d146100ca57806398772d88146100f2578063ad3cb1cc14610112578063b7ab4db51461015057600080fd5b806340a141ff146100755780634d238c8e146100975780634f1ef286146100b7575b600080fd5b34801561008157600080fd5b50610095610090366004610eff565b610172565b005b3480156100a357600080fd5b506100956100b2366004610eff565b610430565b6100956100c5366004610f8a565b610718565b3480156100d657600080fd5b506100df610737565b6040519081526020015b60405180910390f35b3480156100fe57600080fd5b5061009561010d366004611030565b610754565b34801561011e57600080fd5b50610143604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100e99190611151565b34801561015c57600080fd5b50610165610a1c565b6040516100e99190611184565b600154604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f6906101a59060039033906004016111d1565b602060405180830381865afa1580156101c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e6919061120b565b61020a5760405163472511eb60e11b81523360048201526024015b60405180910390fd5b806001600160a01b0381166102325760405163713ce51160e01b815260040160405180910390fd5b6002546001036102555760405163f1a1929360e01b815260040160405180910390fd5b6001600160a01b03828116600090815260036020908152604091829020825180840190935254928316808352600160a01b90930460ff1690820152906102b957604051635a4887e160e01b81526001600160a01b0384166004820152602401610201565b600081602001519050600060028260ff16815481106102da576102da61122d565b6000918252602082200154600280546001600160a01b0390921693509061030390600190611243565b815481106103135761031361122d565b600091825260209091200154600280546001600160a01b039092169250829160ff86169081106103455761034561122d565b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559183168152600390915260409020805460ff60a01b1916600160a01b60ff86160217905560028054806103a2576103a2611264565b60008281526020808220600019908401810180546001600160a01b03191690559092019092556001600160a01b0384168083526003825260409283902080546001600160a81b0319169055600254925160ff9093168352339290917fb10fc4fba5b5eb2a6e82796887299220653537d6a5fc8a3fb60937bd2442ea29910160405180910390a3505050505050565b600154604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f6906104639060039033906004016111d1565b602060405180830381865afa158015610480573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a4919061120b565b6104c35760405163472511eb60e11b8152336004820152602401610201565b806001600160a01b0381166104eb5760405163713ce51160e01b815260040160405180910390fd5b6002546101001161051357604051635dd7a94360e11b81526101006004820152602401610201565b60025460005b8160ff168160ff16101561063f5760006003600060028460ff16815481106105435761054361122d565b60009182526020808320909101546001600160a01b039081168452838201949094526040928301909120825180840190935254928316825260ff600160a01b909304831690820152600280549193509184169081106105a4576105a461122d565b6000918252602090912001546001600160a01b039081169086160361060a5760028260ff16815481106105d9576105d961122d565b60009182526020909120015460405163164688df60e21b81526001600160a01b039091166004820152602401610201565b80516001600160a01b0316330361063657604051635154e66760e11b8152336004820152602401610201565b50600101610519565b506040805180820182523380825260ff84811660208085019182526001600160a01b038981166000818152600384528881209751885495518716600160a01b026001600160a81b03199096169316929092179390931790955560028054600181018255958190527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90950180546001600160a01b0319168317905593549451949091168452909290917f4583e1f70afe5f9f38886187732a4b1336bad46fc758cdd6ad86815931d6f6c2910160405180910390a3505050565b610720610a7e565b61072982610b25565b6107338282610b8b565b5050565b6000610741610c4d565b506000805160206112b083398151915290565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff168061079e5750805467ffffffffffffffff808416911610155b156107bc5760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b178155825160000361080057604051635a7582eb60e11b815260040160405180910390fd5b82516101001161082757604051635dd7a94360e11b81526101006004820152602401610201565b60005b83518110156109a35760006001600160a01b03168482815181106108505761085061122d565b6020026020010151602001516001600160a01b0316036108835760405163d4c3bd5160e01b815260040160405180910390fd5b60006001600160a01b03168482815181106108a0576108a061122d565b6020026020010151600001516001600160a01b0316036108d35760405163713ce51160e01b815260040160405180910390fd5b60008482815181106108e7576108e761122d565b6020908102919091018101518051600280546001818101835560009283527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180546001600160a01b039485166001600160a01b0319909116179055604080518082018252858701518516815260ff808a1682890190815296518616855260039097529220915182549451909516600160a01b026001600160a81b031990941694909216939093179190911790915591909101905061082a565b50600180546001600160a01b0319166001600160a01b0387161790556109c884610c96565b805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b60606002805480602002602001604051908101604052809291908181526020018280548015610a7457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a56575b5050505050905090565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610b0557507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610af96000805160206112b0833981519152546001600160a01b031690565b6001600160a01b031614155b15610b235760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b158015610b7057600080fd5b505afa158015610b84573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610be5575060408051601f3d908101601f19168201909252610be29181019061127a565b60015b610c0d57604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610201565b6000805160206112b08339815191528114610c3e57604051632a87526960e21b815260048101829052602401610201565b610c488383610cc0565b505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b235760405163703e46dd60e11b815260040160405180910390fd5b610c9e610d16565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b610cc982610d5f565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610d0e57610c488282610dc4565b610733610e3c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610b2357604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b600003610d9557604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610201565b6000805160206112b083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610de19190611293565b600060405180830381855af49150503d8060008114610e1c576040519150601f19603f3d011682016040523d82523d6000602084013e610e21565b606091505b5091509150610e31858383610e5b565b925050505b92915050565b3415610b235760405163b398979f60e01b815260040160405180910390fd5b606082610e7057610e6b82610eba565b610eb3565b8151158015610e8757506001600160a01b0384163b155b15610eb057604051639996b31560e01b81526001600160a01b0385166004820152602401610201565b50805b9392505050565b805115610eca5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610efa57600080fd5b919050565b600060208284031215610f1157600080fd5b610eb382610ee3565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610f5357610f53610f1a565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610f8257610f82610f1a565b604052919050565b60008060408385031215610f9d57600080fd5b610fa683610ee3565b915060208084013567ffffffffffffffff80821115610fc457600080fd5b818601915086601f830112610fd857600080fd5b813581811115610fea57610fea610f1a565b610ffc601f8201601f19168501610f59565b9150808252878482850101111561101257600080fd5b80848401858401376000848284010152508093505050509250929050565b60008060006060848603121561104557600080fd5b61104e84610ee3565b9250602061105d818601610ee3565b925060408086013567ffffffffffffffff8082111561107b57600080fd5b818801915088601f83011261108f57600080fd5b8135818111156110a1576110a1610f1a565b6110af858260051b01610f59565b818152858101925060069190911b83018501908a8211156110cf57600080fd5b928501925b8184101561111d5784848c0312156110ec5760008081fd5b6110f4610f30565b6110fd85610ee3565b815261110a878601610ee3565b81880152835292840192918501916110d4565b8096505050505050509250925092565b60005b83811015611148578181015183820152602001611130565b50506000910152565b602081526000825180602084015261117081604085016020870161112d565b601f01601f19169190910160400192915050565b6020808252825182820181905260009190848201906040850190845b818110156111c55783516001600160a01b0316835292840192918401916001016111a0565b50909695505050505050565b60408101600484106111f357634e487b7160e01b600052602160045260246000fd5b9281526001600160a01b039190911660209091015290565b60006020828403121561121d57600080fd5b81518015158114610eb357600080fd5b634e487b7160e01b600052603260045260246000fd5b81810381811115610e3657634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60006020828403121561128c57600080fd5b5051919050565b600082516112a581846020870161112d565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220829d152ecc308e719e1b366740b218926c1fca47a3d48dd99242a1f8207820aa64736f6c63430008170033" + "code": "0x6080604052600436106100705760003560e01c806352d1902d1161004e57806352d1902d146100ca57806398772d88146100f2578063ad3cb1cc14610112578063b7ab4db51461015057600080fd5b806340a141ff146100755780634d238c8e146100975780634f1ef286146100b7575b600080fd5b34801561008157600080fd5b50610095610090366004610eff565b610172565b005b3480156100a357600080fd5b506100956100b2366004610eff565b610430565b6100956100c5366004610f8a565b610718565b3480156100d657600080fd5b506100df610737565b6040519081526020015b60405180910390f35b3480156100fe57600080fd5b5061009561010d366004611030565b610754565b34801561011e57600080fd5b50610143604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100e99190611151565b34801561015c57600080fd5b50610165610a1c565b6040516100e99190611184565b600154604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f6906101a59060039033906004016111d1565b602060405180830381865afa1580156101c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e6919061120b565b61020a5760405163472511eb60e11b81523360048201526024015b60405180910390fd5b806001600160a01b0381166102325760405163713ce51160e01b815260040160405180910390fd5b6002546001036102555760405163f1a1929360e01b815260040160405180910390fd5b6001600160a01b03828116600090815260036020908152604091829020825180840190935254928316808352600160a01b90930460ff1690820152906102b957604051635a4887e160e01b81526001600160a01b0384166004820152602401610201565b600081602001519050600060028260ff16815481106102da576102da61122d565b6000918252602082200154600280546001600160a01b0390921693509061030390600190611243565b815481106103135761031361122d565b600091825260209091200154600280546001600160a01b039092169250829160ff86169081106103455761034561122d565b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559183168152600390915260409020805460ff60a01b1916600160a01b60ff86160217905560028054806103a2576103a2611264565b60008281526020808220600019908401810180546001600160a01b03191690559092019092556001600160a01b0384168083526003825260409283902080546001600160a81b0319169055600254925160ff9093168352339290917fb10fc4fba5b5eb2a6e82796887299220653537d6a5fc8a3fb60937bd2442ea29910160405180910390a3505050505050565b600154604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f6906104639060039033906004016111d1565b602060405180830381865afa158015610480573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a4919061120b565b6104c35760405163472511eb60e11b8152336004820152602401610201565b806001600160a01b0381166104eb5760405163713ce51160e01b815260040160405180910390fd5b6002546101001161051357604051635dd7a94360e11b81526101006004820152602401610201565b60025460005b8160ff168160ff16101561063f5760006003600060028460ff16815481106105435761054361122d565b60009182526020808320909101546001600160a01b039081168452838201949094526040928301909120825180840190935254928316825260ff600160a01b909304831690820152600280549193509184169081106105a4576105a461122d565b6000918252602090912001546001600160a01b039081169086160361060a5760028260ff16815481106105d9576105d961122d565b60009182526020909120015460405163164688df60e21b81526001600160a01b039091166004820152602401610201565b80516001600160a01b0316330361063657604051635154e66760e11b8152336004820152602401610201565b50600101610519565b506040805180820182523380825260ff84811660208085019182526001600160a01b038981166000818152600384528881209751885495518716600160a01b026001600160a81b03199096169316929092179390931790955560028054600181018255958190527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90950180546001600160a01b0319168317905593549451949091168452909290917f4583e1f70afe5f9f38886187732a4b1336bad46fc758cdd6ad86815931d6f6c2910160405180910390a3505050565b610720610a7e565b61072982610b25565b6107338282610b8b565b5050565b6000610741610c4d565b506000805160206112b083398151915290565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff168061079e5750805467ffffffffffffffff808416911610155b156107bc5760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b178155825160000361080057604051635a7582eb60e11b815260040160405180910390fd5b82516101001161082757604051635dd7a94360e11b81526101006004820152602401610201565b60005b83518110156109a35760006001600160a01b03168482815181106108505761085061122d565b6020026020010151602001516001600160a01b0316036108835760405163d4c3bd5160e01b815260040160405180910390fd5b60006001600160a01b03168482815181106108a0576108a061122d565b6020026020010151600001516001600160a01b0316036108d35760405163713ce51160e01b815260040160405180910390fd5b60008482815181106108e7576108e761122d565b6020908102919091018101518051600280546001818101835560009283527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180546001600160a01b039485166001600160a01b0319909116179055604080518082018252858701518516815260ff808a1682890190815296518616855260039097529220915182549451909516600160a01b026001600160a81b031990941694909216939093179190911790915591909101905061082a565b50600180546001600160a01b0319166001600160a01b0387161790556109c884610c96565b805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b60606002805480602002602001604051908101604052809291908181526020018280548015610a7457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a56575b5050505050905090565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610b0557507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610af96000805160206112b0833981519152546001600160a01b031690565b6001600160a01b031614155b15610b235760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b158015610b7057600080fd5b505afa158015610b84573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610be5575060408051601f3d908101601f19168201909252610be29181019061127a565b60015b610c0d57604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610201565b6000805160206112b08339815191528114610c3e57604051632a87526960e21b815260048101829052602401610201565b610c488383610cc0565b505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b235760405163703e46dd60e11b815260040160405180910390fd5b610c9e610d16565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b610cc982610d5f565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610d0e57610c488282610dc4565b610733610e3c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610b2357604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b600003610d9557604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610201565b6000805160206112b083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610de19190611293565b600060405180830381855af49150503d8060008114610e1c576040519150601f19603f3d011682016040523d82523d6000602084013e610e21565b606091505b5091509150610e31858383610e5b565b925050505b92915050565b3415610b235760405163b398979f60e01b815260040160405180910390fd5b606082610e7057610e6b82610eba565b610eb3565b8151158015610e8757506001600160a01b0384163b155b15610eb057604051639996b31560e01b81526001600160a01b0385166004820152602401610201565b50805b9392505050565b805115610eca5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610efa57600080fd5b919050565b600060208284031215610f1157600080fd5b610eb382610ee3565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610f5357610f53610f1a565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610f8257610f82610f1a565b604052919050565b60008060408385031215610f9d57600080fd5b610fa683610ee3565b915060208084013567ffffffffffffffff80821115610fc457600080fd5b818601915086601f830112610fd857600080fd5b813581811115610fea57610fea610f1a565b610ffc601f8201601f19168501610f59565b9150808252878482850101111561101257600080fd5b80848401858401376000848284010152508093505050509250929050565b60008060006060848603121561104557600080fd5b61104e84610ee3565b9250602061105d818601610ee3565b925060408086013567ffffffffffffffff8082111561107b57600080fd5b818801915088601f83011261108f57600080fd5b8135818111156110a1576110a1610f1a565b6110af858260051b01610f59565b818152858101925060069190911b83018501908a8211156110cf57600080fd5b928501925b8184101561111d5784848c0312156110ec5760008081fd5b6110f4610f30565b6110fd85610ee3565b815261110a878601610ee3565b81880152835292840192918501916110d4565b8096505050505050509250925092565b60005b83811015611148578181015183820152602001611130565b50506000910152565b602081526000825180602084015261117081604085016020870161112d565b601f01601f19169190910160400192915050565b6020808252825182820181905260009190848201906040850190845b818110156111c55783516001600160a01b0316835292840192918401916001016111a0565b50909695505050505050565b60408101600484106111f357634e487b7160e01b600052602160045260246000fd5b9281526001600160a01b039190911660209091015290565b60006020828403121561121d57600080fd5b81518015158114610eb357600080fd5b634e487b7160e01b600052603260045260246000fd5b81810381811115610e3657634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60006020828403121561128c57600080fd5b5051919050565b600082516112a581846020870161112d565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220c436072d13fd05c099ab9683ba146fced0068424513a53e1fd87d25d51ebd53c64736f6c63430008170033" }, "0x0000000000000000000000000000000000009999": { "comment": "Proxy: Smart contract to manage proxy contract upgrades", "balance": "0", - "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212202bb3e818f8e7f23c5970e203f84012b1e8339cbb5380d39199eb3da2d17147c364736f6c63430008170033", + "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212208de99705f21830b33bf2bd4a57ce70f27ec58ac48b2c88e1c96b59a11978ef8164736f6c63430008170033", "storage": { "0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000006666", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x0000000000000000000000002d3d7c23d83c023edf2dea74995178ca98d11839" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000b194eabbb2d2cc4180093e0df47bb231658c407e" } }, - "0x2d3d7c23d83c023edf2dea74995178ca98d11839": { + "0xb194eabbb2d2cc4180093e0df47bb231658c407e": { "comment": "Implementation: Smart contract to manage proxy contract upgrades", "balance": "0", - "code": "0x6080604052600436106100705760003560e01c80637e5465ba1161004e5780637e5465ba146100d2578063ad3cb1cc146100f2578063c4d66de814610130578063e8f158641461015057600080fd5b80634f1ef2861461007557806352d1902d1461008a578063574a81d7146100b2575b600080fd5b610088610083366004610c59565b610170565b005b34801561009657600080fd5b5061009f61018f565b6040519081526020015b60405180910390f35b3480156100be57600080fd5b506100886100cd366004610d1b565b6101ac565b3480156100de57600080fd5b506100886100ed366004610d1b565b6101d3565b3480156100fe57600080fd5b50610123604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100a99190610d72565b34801561013c57600080fd5b5061008861014b366004610da5565b610475565b34801561015c57600080fd5b5061008861016b366004610d1b565b610565565b610178610791565b61018182610838565b61018b8282610845565b5050565b6000610199610902565b50600080516020610f6083398151915290565b6101b6828261094b565b61018b57604051638af69cf160e01b815260040160405180910390fd5b600054604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f690610206906001903390600401610de2565b602060405180830381865afa158015610223573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102479190610e08565b61026b5760405163472511eb60e11b81523360048201526024015b60405180910390fd5b6001600160a01b0380831660009081526001602090815260408083209385168352929052908120600201548391839190036102cc57604051633af3b55760e01b81526001600160a01b03808416600483015282166024820152604401610262565b6001600160a01b0380851660009081526001602090815260408083209387168352928152828220338352905220548490849060ff1615610332576040516316d5788b60e31b81526001600160a01b03808416600483015282166024820152604401610262565b6001600160a01b038087166000908152600160208181526040808420948a16808552858352818520338652808452918520805460ff191685179055845293905291909101805463ffffffff169161038883610e40565b91906101000a81548163ffffffff021916908363ffffffff16021790555050336001600160a01b0316856001600160a01b0316876001600160a01b03167fc42e62d9f6b29d37599fcb472a6f30bc6e8c8d6fbbcb774ac585c02b314bd2ad60405160405180910390a46103fb868661094b565b1561046d576040805163278f794360e11b81526001600160a01b03878116600483015260248201929092526000604482015290871690634f1ef28690606401600060405180830381600087803b15801561045457600080fd5b505af1158015610468573d6000803e3d6000fd5b505050505b505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806104bf5750805467ffffffffffffffff808416911610155b156104dd5760405163f92ee8a960e01b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815468ff0000000000000000191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b600054604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f690610598906001903390600401610de2565b602060405180830381865afa1580156105b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d99190610e08565b6105f85760405163472511eb60e11b8152336004820152602401610262565b80806001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610653575060408051601f3d908101601f1916820190925261065091810190610e63565b60015b61067b57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610262565b600080516020610f6083398151915281146106ac57604051632a87526960e21b815260048101829052602401610262565b6001600160a01b03808516600090815260016020908152604080832093871683529290522060020154849084901561070a57604051634cc571cf60e01b81526001600160a01b03808416600483015282166024820152604401610262565b6001600160a01b038681166000818152600160208181526040808420958b16808552959091528083209182018054640100000000600160c01b031916336401000000008102919091179091554260029093019290925551909392917fe33956f8d60ae2b38d9860e46ec9b53d8fb58aa99a9404b1195b7ce35d2941dc91a45050505b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061081857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661080c600080516020610f60833981519152546001600160a01b031690565b6001600160a01b031614155b156108365760405163703e46dd60e11b815260040160405180910390fd5b565b61084230826101ac565b50565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561089f575060408051601f3d908101601f1916820190925261089c91810190610e63565b60015b6108c757604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610262565b600080516020610f6083398151915281146108f857604051632a87526960e21b815260048101829052602401610262565b61078c8383610a28565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108365760405163703e46dd60e11b815260040160405180910390fd5b60008054604051636814b8e560e11b815282916001600160a01b03169063d02971ca9061097d90600190600401610e7c565b602060405180830381865afa15801561099a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109be9190610e8a565b6001600160a01b03808616600090815260016020818152604080842094891684529390529181209091015491925063ffffffff90911690610a0a610a03846006610eb0565b600a610a7e565b90508063ffffffff168263ffffffff16101593505050505b92915050565b610a3182610aa8565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610a765761078c8282610b0d565b61018b610b83565b600081610a8c600185610ed8565b610a969190610ef5565b610aa1906001610f26565b9392505050565b806001600160a01b03163b600003610ade57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610262565b600080516020610f6083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610b2a9190610f43565b600060405180830381855af49150503d8060008114610b65576040519150601f19603f3d011682016040523d82523d6000602084013e610b6a565b606091505b5091509150610b7a858383610ba2565b95945050505050565b34156108365760405163b398979f60e01b815260040160405180910390fd5b606082610bb757610bb282610bfe565b610aa1565b8151158015610bce57506001600160a01b0384163b155b15610bf757604051639996b31560e01b81526001600160a01b0385166004820152602401610262565b5092915050565b805115610c0e5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610c3e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610c6c57600080fd5b610c7583610c27565b9150602083013567ffffffffffffffff80821115610c9257600080fd5b818501915085601f830112610ca657600080fd5b813581811115610cb857610cb8610c43565b604051601f8201601f19908116603f01168101908382118183101715610ce057610ce0610c43565b81604052828152886020848701011115610cf957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008060408385031215610d2e57600080fd5b610d3783610c27565b9150610d4560208401610c27565b90509250929050565b60005b83811015610d69578181015183820152602001610d51565b50506000910152565b6020815260008251806020840152610d91816040850160208701610d4e565b601f01601f19169190910160400192915050565b600060208284031215610db757600080fd5b610aa182610c27565b60048110610dde57634e487b7160e01b600052602160045260246000fd5b9052565b60408101610df08285610dc0565b6001600160a01b039290921660209190910152919050565b600060208284031215610e1a57600080fd5b81518015158114610aa157600080fd5b634e487b7160e01b600052601160045260246000fd5b600063ffffffff808316818103610e5957610e59610e2a565b6001019392505050565b600060208284031215610e7557600080fd5b5051919050565b60208101610a228284610dc0565b600060208284031215610e9c57600080fd5b815163ffffffff81168114610aa157600080fd5b63ffffffff818116838216028082169190828114610ed057610ed0610e2a565b505092915050565b63ffffffff828116828216039080821115610bf757610bf7610e2a565b600063ffffffff80841680610f1a57634e487b7160e01b600052601260045260246000fd5b92169190910492915050565b63ffffffff818116838216019080821115610bf757610bf7610e2a565b60008251610f55818460208701610d4e565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220c76ef524f52e1b5454ea35ee49cb7e567b741389d8de3fd9b4040e73c412999264736f6c63430008170033" - }, - "0x0000000000000000000000000000000000002222": { - "comment": "Library to validate DID", - "balance": "0", - "code": "0x73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c8063af8b5bbf1461003a575b600080fd5b61004d610048366004610aac565b61004f565b005b600061005a826100d8565b90506100698160000151610223565b6100915781604051631859e3bb60e11b81526004016100889190610b5d565b60405180910390fd5b600061009f82602001515190565b9050806015141580156100b3575080601614155b156100d35782604051631859e3bb60e11b81526004016100889190610b5d565b505050565b604080518082019091526060808252602082015260006100f7836102c3565b9050600061011d604051806040016040528060018152602001601d60f91b8152506102c3565b905060008061012c84846102d4565b95509250905080158061016a575061016861016160405180604001604052806003815260200162191a5960ea1b8152506102c3565b8390610322565b155b1561018a5785604051631859e3bb60e11b81526004016100889190610b5d565b61019484846102d4565b955092509050806101ba5785604051631859e3bb60e11b81526004016100889190610b5d565b60408051808201909152606080825260208201526101d78361032e565b81526040805180820190915260018152601d60f91b6020820152610205906101fe906102c3565b8690610339565b9450610214915084905061032e565b60208201529695505050505050565b60008061022f836102c3565b905061026061025960405180604001604052806004815260200163696e647960e01b8152506102c3565b8290610322565b8061028f575061028f6102596040518060400160405280600581526020016434b7323c9960d91b8152506102c3565b806102bc57506102bc6102596040518060400160405280600381526020016239b7bb60e91b8152506102c3565b9392505050565b60006102ce82610363565b92915050565b60008080806102e38686610377565b905060001981036102ff5760008660009350935093505061031b565b61031386826001600160801b038816610482565b935093509350505b9250925092565b60006102bc83836104ef565b60606102ce82610539565b600080808061034886866105b1565b905060001981036102ff57600080879350935093505061031b565b6000806020830190506102bc8184516106a3565b60006001600160801b03838116908316808303610399576000925050506102ce565b8115806103a557508181115b156103b657600019925050506102ce565b60006103c28660801c90565b905060006103d08660801c90565b905060006103df825160001a90565b90505b60006103ef8487846106af565b9050600019810361040a5760001996505050505050506102ce565b9485900394928301928585111561042b5760001996505050505050506102ce565b84832085852003610457576104408960801c90565b61044a9085610bac565b96505050505050506102ce565b8560010361046f5760001996505050505050506102ce565b60001990950194600190930192506103e2565b6000806000806104928760801c90565b90506001600160801b038716858701818111156104c2576040516365f4e9df60e01b815260040160405180910390fd5b6001996001600160801b03988916608085811b919091179a50928290039098169201901b17949350505050565b60006001600160801b03838116908316811461050f5760009150506102ce565b61053161051c8560801c90565b6105268560801c90565b839081902091201490565b949350505050565b60606001600160801b03821667ffffffffffffffff81111561055d5761055d610a96565b6040519080825280601f01601f191660200182016040528015610587576020820181803683370190505b509050602081016105ab8161059c8560801c90565b6001600160801b038616610777565b50919050565b60006001600160801b038381169083168083036105d3576000925050506102ce565b8115806105df57508181115b156105f057600019925050506102ce565b60006105fc8660801c90565b9050600061060a8660801c90565b9050600061061787610785565b905060001984015b600061062c8588856107ca565b90506000198103610648576000199750505050505050506102ce565b80821115610661576000199750505050505050506102ce565b8584208282038681018890209091036106835797506102ce9650505050505050565b81156106915750955061061f565b600019985050505050505050506102ce565b60006102bc838361087e565b6000602083116106cb576106c484848461088a565b90506102bc565b83601f8416808503820160ff8516600080516020610bce833981519152025b8188101561072c57875181186106ff8161099c565b15610720578489036107138a60208a61088a565b01955050505050506102bc565b602089019850506106ea565b82600003610742576000199450505050506102bc565b61074d82848861088a565b94506000198503610766576000199450505050506102bc565b509190910391909101949350505050565b8083828460045afa50505050565b60006001600160801b0382168082036107b1576040516365f4e9df60e01b815260040160405180910390fd5b6102bc600182036107c28560801c90565b015160001a90565b6000602083116107df576106c48484846109e7565b601f831684840181156108175781900360006107fc8284876109e7565b9050600019811461081557908690030191506102bc9050565b505b60ff8416600080516020610bce833981519152025b8682111561087057601f199091018051909190811861084a8161099c565b1561086a5787830361085e846020896109e7565b019450505050506102bc565b5061082c565b506000199695505050505050565b60006102bc8383610a30565b825160009081602085111561089e57602094505b601285106109295760ff8416600080516020610bce8339815191520282186108ce6001600160801b03821761099c565b6000036109055760109150601a8610610900576108f467ffffffffffffffff821761099c565b60000361090057601891505b610923565b6109176001600160c01b03821761099c565b60000361092357600891505b50610967565b600a85106109675760ff8416600080516020610bce8339815191520282186109596001600160c01b03821761099c565b60000361096557600891505b505b8481101561098f5781811a60ff85168103610986575091506102bc9050565b50600101610967565b5060001995945050505050565b7ffefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefeff81019019167f80808080808080808080808080808080808080808080808080808080808080801690565b600060208311156109f757602092505b83515b8315610a24576000199093019280841a60ff84168103610a1e5784925050506102bc565b506109fa565b50600019949350505050565b60006001600160801b03831115610a5a5760405163fee7506f60e01b815260040160405180910390fd5b6001600160801b03821115610a8257604051633b6b098d60e01b815260040160405180910390fd5b506001600160801b031660809190911b1790565b634e487b7160e01b600052604160045260246000fd5b600060208284031215610abe57600080fd5b813567ffffffffffffffff80821115610ad657600080fd5b818401915084601f830112610aea57600080fd5b813581811115610afc57610afc610a96565b604051601f8201601f19908116603f01168101908382118183101715610b2457610b24610a96565b81604052828152876020848701011115610b3d57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020808352835180602085015260005b81811015610b8b57858101830151858201604001528201610b6f565b506000604082860101526040601f19601f8301168501019250505092915050565b818103818111156102ce57634e487b7160e01b600052601160045260246000fdfe0101010101010101010101010101010101010101010101010101010101010101a26469706673582212201a29e89d4026d9e0506d47d73a66e9b716658f0b17d2677237d5ed6dc886170a64736f6c63430008170033", - "storage": {} - }, - "0x0000000000000000000000000000000000003333": { - "comment": "Proxy: Smart contract to manage DIDs", - "balance": "0", - "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212202bb3e818f8e7f23c5970e203f84012b1e8339cbb5380d39199eb3da2d17147c364736f6c63430008170033", - "storage": { - "0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000009999", - "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x0000000000000000000000000108244ebb041d5108d13692c712b66adc8491e3" - } - }, - "0x0108244ebb041d5108d13692c712b66adc8491e3": { - "comment": "Implementation: Smart contract to manage DIDs", - "balance": "0", - "code": "0x60806040526004361061007b5760003560e01c8063ad3cb1cc1161004e578063ad3cb1cc1461010e578063c4d66de81461014c578063dafffa7d1461016c578063f4653a1d1461018c57600080fd5b80631e715511146100805780633633852c146100a25780634f1ef286146100d857806352d1902d146100eb575b600080fd5b34801561008c57600080fd5b506100a061009b366004611045565b6101ac565b005b3480156100ae57600080fd5b506100c26100bd3660046110c6565b6103e2565b6040516100cf9190611158565b60405180910390f35b6100a06100e63660046111d9565b61057d565b3480156100f757600080fd5b5061010061059c565b6040519081526020016100cf565b34801561011a57600080fd5b5061013f604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100cf919061129b565b34801561015857600080fd5b506100a06101673660046112ae565b6105b9565b34801561017857600080fd5b506100a06101873660046112c9565b61069e565b34801561019857600080fd5b506100a06101a73660046110c6565b6108f1565b83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600192506101f391508390611335565b908152604051908190036020019020600301541561022f5780604051630eb7cd9560e01b8152600401610226919061129b565b60405180910390fd5b60405163af8b5bbf60e01b81527300000000000000000000000000000000000022229063af8b5bbf90610268908890889060040161137a565b60006040518083038186803b15801561028057600080fd5b505af4158015610294573d6000803e3d6000fd5b505050508282600187876040516102ac929190611396565b908152604051908190036020019020916102c7919083611430565b5085600186866040516102db929190611396565b908152604051908190036020018120600190810180546001600160a01b03949094166001600160a01b0319909416939093179092553391906103209088908890611396565b90815260405190819003602001812060020180546001600160a01b03939093166001600160a01b03199093169290921790915542906001906103659088908890611396565b90815260405190819003602001812060030191909155429060019061038d9088908890611396565b908152604051908190036020018120600401919091557f5fccafd09eeeb6a3dc1c80357ee982c00d7fb00a991274a9b96fe4fd7cb60552906103d2908790879061137a565b60405180910390a1505050505050565b6103ea610f83565b82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040516001925061043191508390611335565b90815260405190819003602001902060030154600003610466578060405163186a887560e11b8152600401610226919061129b565b60018484604051610478929190611396565b90815260200160405180910390206040518060400160405290816000820180546104a1906113a6565b80601f01602080910402602001604051908101604052809291908181526020018280546104cd906113a6565b801561051a5780601f106104ef5761010080835404028352916020019161051a565b820191906000526020600020905b8154815290600101906020018083116104fd57829003601f168201915b50505091835250506040805160a08101825260018401546001600160a01b0390811682526002850154166020808301919091526003850154928201929092526004840154606082015260059093015460ff16151560808401520152949350505050565b610585610b20565b61058e82610bc7565b6105988282610c2d565b5050565b60006105a6610cef565b5060008051602061150a83398151915290565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806106035750805467ffffffffffffffff808416911610155b156106215760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b17815561064c83610d38565b805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600192506106e591508390611335565b9081526040519081900360200190206003015460000361071a578060405163186a887560e11b8152600401610226919061129b565b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040516001925061076191508390611335565b9081526040519081900360200190206005015460ff16156107975780604051630341716360e51b8152600401610226919061129b565b85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600192506107de91508390611335565b90815260405190819003602001902060010154336001600160a01b039091161480159061083857506001816040516108169190611335565b90815260405190819003602001902060020154336001600160a01b0390911614155b1561085857604051633fcc3f1760e01b8152336004820152602401610226565b84846001898960405161086c929190611396565b90815260405190819003602001902091610887919083611430565b50426001888860405161089b929190611396565b908152604051908190036020018120600401919091557f7e7500a71b0209575a3b4858a2a662e94b0cad314ecb249f3526e9b2f86a0146906108e0908990899061137a565b60405180910390a150505050505050565b81818080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040516001925061093891508390611335565b9081526040519081900360200190206003015460000361096d578060405163186a887560e11b8152600401610226919061129b565b82828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600192506109b491508390611335565b9081526040519081900360200190206005015460ff16156109ea5780604051630341716360e51b8152600401610226919061129b565b83838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405160019250610a3191508390611335565b90815260405190819003602001902060010154336001600160a01b0390911614801590610a8b5750600181604051610a699190611335565b90815260405190819003602001902060020154336001600160a01b0390911614155b15610aab57604051633fcc3f1760e01b8152336004820152602401610226565b6001808686604051610abe929190611396565b908152604051908190036020018120600501805492151560ff19909316929092179091557f4360f12f602ccecefb32480e5314d0d3f57d38db8f52c76d8fdf4c39596c1c2890610b11908790879061137a565b60405180910390a15050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ba757507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610b9b60008051602061150a833981519152546001600160a01b031690565b6001600160a01b031614155b15610bc55760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b158015610c1257600080fd5b505afa158015610c26573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610c87575060408051601f3d908101601f19168201909252610c84918101906114f0565b60015b610caf57604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610226565b60008051602061150a8339815191528114610ce057604051632a87526960e21b815260048101829052602401610226565b610cea8383610d62565b505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bc55760405163703e46dd60e11b815260040160405180910390fd5b610d40610db8565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b610d6b82610e01565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610db057610cea8282610e66565b610598610edc565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610bc557604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b600003610e3757604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610226565b60008051602061150a83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610e839190611335565b600060405180830381855af49150503d8060008114610ebe576040519150601f19603f3d011682016040523d82523d6000602084013e610ec3565b606091505b5091509150610ed3858383610efb565b95945050505050565b3415610bc55760405163b398979f60e01b815260040160405180910390fd5b606082610f1057610f0b82610f5a565b610f53565b8151158015610f2757506001600160a01b0384163b155b15610f5057604051639996b31560e01b81526001600160a01b0385166004820152602401610226565b50805b9392505050565b805115610f6a5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b604051806040016040528060608152602001610fdb6040518060a0016040528060006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600081526020016000151581525090565b905290565b80356001600160a01b0381168114610ff757600080fd5b919050565b60008083601f84011261100e57600080fd5b50813567ffffffffffffffff81111561102657600080fd5b60208301915083602082850101111561103e57600080fd5b9250929050565b60008060008060006060868803121561105d57600080fd5b61106686610fe0565b9450602086013567ffffffffffffffff8082111561108357600080fd5b61108f89838a01610ffc565b909650945060408801359150808211156110a857600080fd5b506110b588828901610ffc565b969995985093965092949392505050565b600080602083850312156110d957600080fd5b823567ffffffffffffffff8111156110f057600080fd5b6110fc85828601610ffc565b90969095509350505050565b60005b8381101561112357818101518382015260200161110b565b50506000910152565b60008151808452611144816020860160208601611108565b601f01601f19169290920160200192915050565b602081526000825160c0602084015261117460e084018261112c565b9050602084015160018060a01b038082511660408601528060208301511660608601525060408101516080850152606081015160a08501526080810151151560c0850152508091505092915050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156111ec57600080fd5b6111f583610fe0565b9150602083013567ffffffffffffffff8082111561121257600080fd5b818501915085601f83011261122657600080fd5b813581811115611238576112386111c3565b604051601f8201601f19908116603f01168101908382118183101715611260576112606111c3565b8160405282815288602084870101111561127957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b602081526000610f53602083018461112c565b6000602082840312156112c057600080fd5b610f5382610fe0565b600080600080604085870312156112df57600080fd5b843567ffffffffffffffff808211156112f757600080fd5b61130388838901610ffc565b9096509450602087013591508082111561131c57600080fd5b5061132987828801610ffc565b95989497509550505050565b60008251611347818460208701611108565b9190910192915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208152600061138e602083018486611351565b949350505050565b8183823760009101908152919050565b600181811c908216806113ba57607f821691505b6020821081036113da57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610cea576000816000526020600020601f850160051c810160208610156114095750805b601f850160051c820191505b8181101561142857828155600101611415565b505050505050565b67ffffffffffffffff831115611448576114486111c3565b61145c8361145683546113a6565b836113e0565b6000601f84116001811461149057600085156114785750838201355b600019600387901b1c1916600186901b178355610c26565b600083815260209020601f19861690835b828110156114c157868501358255602094850194600190920191016114a1565b50868210156114de5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60006020828403121561150257600080fd5b505191905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212209a4d3ad6114933db1c502ac96c2ffbfe891b309c6937423b10349128001ffbc564736f6c63430008170033" + "code": "0x6080604052600436106100705760003560e01c80637e5465ba1161004e5780637e5465ba146100d2578063ad3cb1cc146100f2578063c4d66de814610130578063e8f158641461015057600080fd5b80634f1ef2861461007557806352d1902d1461008a578063574a81d7146100b2575b600080fd5b610088610083366004610c59565b610170565b005b34801561009657600080fd5b5061009f61018f565b6040519081526020015b60405180910390f35b3480156100be57600080fd5b506100886100cd366004610d1b565b6101ac565b3480156100de57600080fd5b506100886100ed366004610d1b565b6101d3565b3480156100fe57600080fd5b50610123604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100a99190610d72565b34801561013c57600080fd5b5061008861014b366004610da5565b610475565b34801561015c57600080fd5b5061008861016b366004610d1b565b610565565b610178610791565b61018182610838565b61018b8282610845565b5050565b6000610199610902565b50600080516020610f6083398151915290565b6101b6828261094b565b61018b57604051638af69cf160e01b815260040160405180910390fd5b600054604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f690610206906001903390600401610de2565b602060405180830381865afa158015610223573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102479190610e08565b61026b5760405163472511eb60e11b81523360048201526024015b60405180910390fd5b6001600160a01b0380831660009081526001602090815260408083209385168352929052908120600201548391839190036102cc57604051633af3b55760e01b81526001600160a01b03808416600483015282166024820152604401610262565b6001600160a01b0380851660009081526001602090815260408083209387168352928152828220338352905220548490849060ff1615610332576040516316d5788b60e31b81526001600160a01b03808416600483015282166024820152604401610262565b6001600160a01b038087166000908152600160208181526040808420948a16808552858352818520338652808452918520805460ff191685179055845293905291909101805463ffffffff169161038883610e40565b91906101000a81548163ffffffff021916908363ffffffff16021790555050336001600160a01b0316856001600160a01b0316876001600160a01b03167fc42e62d9f6b29d37599fcb472a6f30bc6e8c8d6fbbcb774ac585c02b314bd2ad60405160405180910390a46103fb868661094b565b1561046d576040805163278f794360e11b81526001600160a01b03878116600483015260248201929092526000604482015290871690634f1ef28690606401600060405180830381600087803b15801561045457600080fd5b505af1158015610468573d6000803e3d6000fd5b505050505b505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806104bf5750805467ffffffffffffffff808416911610155b156104dd5760405163f92ee8a960e01b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815468ff0000000000000000191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b600054604051634f4bdc7b60e11b81526001600160a01b0390911690639e97b8f690610598906001903390600401610de2565b602060405180830381865afa1580156105b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d99190610e08565b6105f85760405163472511eb60e11b8152336004820152602401610262565b80806001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610653575060408051601f3d908101601f1916820190925261065091810190610e63565b60015b61067b57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610262565b600080516020610f6083398151915281146106ac57604051632a87526960e21b815260048101829052602401610262565b6001600160a01b03808516600090815260016020908152604080832093871683529290522060020154849084901561070a57604051634cc571cf60e01b81526001600160a01b03808416600483015282166024820152604401610262565b6001600160a01b038681166000818152600160208181526040808420958b16808552959091528083209182018054640100000000600160c01b031916336401000000008102919091179091554260029093019290925551909392917fe33956f8d60ae2b38d9860e46ec9b53d8fb58aa99a9404b1195b7ce35d2941dc91a45050505b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061081857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661080c600080516020610f60833981519152546001600160a01b031690565b6001600160a01b031614155b156108365760405163703e46dd60e11b815260040160405180910390fd5b565b61084230826101ac565b50565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561089f575060408051601f3d908101601f1916820190925261089c91810190610e63565b60015b6108c757604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610262565b600080516020610f6083398151915281146108f857604051632a87526960e21b815260048101829052602401610262565b61078c8383610a28565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108365760405163703e46dd60e11b815260040160405180910390fd5b60008054604051636814b8e560e11b815282916001600160a01b03169063d02971ca9061097d90600190600401610e7c565b602060405180830381865afa15801561099a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109be9190610e8a565b6001600160a01b03808616600090815260016020818152604080842094891684529390529181209091015491925063ffffffff90911690610a0a610a03846006610eb0565b600a610a7e565b90508063ffffffff168263ffffffff16101593505050505b92915050565b610a3182610aa8565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610a765761078c8282610b0d565b61018b610b83565b600081610a8c600185610ed8565b610a969190610ef5565b610aa1906001610f26565b9392505050565b806001600160a01b03163b600003610ade57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610262565b600080516020610f6083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610b2a9190610f43565b600060405180830381855af49150503d8060008114610b65576040519150601f19603f3d011682016040523d82523d6000602084013e610b6a565b606091505b5091509150610b7a858383610ba2565b95945050505050565b34156108365760405163b398979f60e01b815260040160405180910390fd5b606082610bb757610bb282610bfe565b610aa1565b8151158015610bce57506001600160a01b0384163b155b15610bf757604051639996b31560e01b81526001600160a01b0385166004820152602401610262565b5092915050565b805115610c0e5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b0381168114610c3e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610c6c57600080fd5b610c7583610c27565b9150602083013567ffffffffffffffff80821115610c9257600080fd5b818501915085601f830112610ca657600080fd5b813581811115610cb857610cb8610c43565b604051601f8201601f19908116603f01168101908382118183101715610ce057610ce0610c43565b81604052828152886020848701011115610cf957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008060408385031215610d2e57600080fd5b610d3783610c27565b9150610d4560208401610c27565b90509250929050565b60005b83811015610d69578181015183820152602001610d51565b50506000910152565b6020815260008251806020840152610d91816040850160208701610d4e565b601f01601f19169190910160400192915050565b600060208284031215610db757600080fd5b610aa182610c27565b60048110610dde57634e487b7160e01b600052602160045260246000fd5b9052565b60408101610df08285610dc0565b6001600160a01b039290921660209190910152919050565b600060208284031215610e1a57600080fd5b81518015158114610aa157600080fd5b634e487b7160e01b600052601160045260246000fd5b600063ffffffff808316818103610e5957610e59610e2a565b6001019392505050565b600060208284031215610e7557600080fd5b5051919050565b60208101610a228284610dc0565b600060208284031215610e9c57600080fd5b815163ffffffff81168114610aa157600080fd5b63ffffffff818116838216028082169190828114610ed057610ed0610e2a565b505092915050565b63ffffffff828116828216039080821115610bf757610bf7610e2a565b600063ffffffff80841680610f1a57634e487b7160e01b600052601260045260246000fd5b92169190910492915050565b63ffffffff818116838216019080821115610bf757610bf7610e2a565b60008251610f55818460208701610d4e565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220e2a4e2c158ec7d38443cf09da5dacb8f5d2cef32752a3b7a150d8d9a0a5dc4f264736f6c63430008170033" }, "0x0000000000000000000000000000000000018888": { "comment": "Proxy: Ethereum registry for ERC-1056 ethr did methods", "balance": "0", - "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212202bb3e818f8e7f23c5970e203f84012b1e8339cbb5380d39199eb3da2d17147c364736f6c63430008170033", + "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212208de99705f21830b33bf2bd4a57ce70f27ec58ac48b2c88e1c96b59a11978ef8164736f6c63430008170033", "storage": { "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x0000000000000000000000004995f130ff5e3b4abebfca43f17ed2185eeef297" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000ef45dd3009cccced5304f337ebe64c56b6446e7c" } }, - "0x4995f130ff5e3b4abebfca43f17ed2185eeef297": { + "0xef45dd3009cccced5304f337ebe64c56b6446e7c": { "comment": "Implementation: Ethereum registry for ERC-1056 ethr did methods", "balance": "0", - "code": "0x60806040526004361061011e5760003560e01c806380b29f7c116100a0578063ad3cb1cc11610064578063ad3cb1cc14610369578063c4d66de8146103a7578063e476af5c146103c7578063f00d4b5d146103e7578063f96d0f9f1461040757600080fd5b806380b29f7c146102c95780638733d4e8146102e957806393072684146103095780639c2c1b2b14610329578063a7068d661461034957600080fd5b80634f1ef286116100e75780634f1ef2861461022457806352d1902d14610237578063622b2a3c1461024c57806370ae92d21461027c5780637ad4b0a4146102a957600080fd5b8062c023da14610123578063022914a7146101455780630d44625b14610198578063123b5e98146101e4578063240cf1fa14610204575b600080fd5b34801561012f57600080fd5b5061014361013e3660046113d9565b610434565b005b34801561015157600080fd5b5061017b610160366004611430565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101a457600080fd5b506101d66101b336600461144b565b600160209081526000938452604080852082529284528284209052825290205481565b60405190815260200161018f565b3480156101f057600080fd5b506101436101ff366004611498565b610445565b34801561021057600080fd5b5061014361021f36600461151d565b6104d1565b610143610232366004611574565b61059c565b34801561024357600080fd5b506101d66105bb565b34801561025857600080fd5b5061026c61026736600461144b565b6105d8565b604051901515815260200161018f565b34801561028857600080fd5b506101d6610297366004611430565b60036020526000908152604090205481565b3480156102b557600080fd5b506101436102c43660046115c2565b61062b565b3480156102d557600080fd5b506101436102e436600461144b565b61063e565b3480156102f557600080fd5b5061017b610304366004611430565b61064a565b34801561031557600080fd5b50610143610324366004611621565b61067a565b34801561033557600080fd5b50610143610344366004611680565b610751565b34801561035557600080fd5b506101436103643660046116ea565b610828565b34801561037557600080fd5b5061039a604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161018f919061177e565b3480156103b357600080fd5b506101436103c2366004611430565b610835565b3480156103d357600080fd5b506101436103e2366004611791565b61091a565b3480156103f357600080fd5b5061014361040236600461180b565b610999565b34801561041357600080fd5b506101d6610422366004611430565b60026020526000908152604090205481565b610440833384846109a4565b505050565b6000601960f81b813060038261045a8d61064a565b6001600160a01b03166001600160a01b03168152602001908152602001600020548b88888860405160200161049698979695949392919061183e565b6040516020818303038152906040528051906020012090506104c7886104bf8a8a8a8a87610a60565b868686610b4f565b5050505050505050565b6000601960f81b81306003826104e68b61064a565b6001600160a01b0316815260208082019290925260409081016000205481516001600160f81b0319968716818501529490951660218501526001600160601b0319606093841b8116602286015260368501959095528a831b851660568501526a31b430b733b2a7bbb732b960a91b606a8501529186901b90931660758301528051606981840301815260899092019052805191012090506105948661058e8188888887610a60565b84610c17565b505050505050565b6105a4610cdf565b6105ad82610d86565b6105b78282610ded565b5050565b60006105c5610eaa565b50600080516020611a0d83398151915290565b6001600160a01b03838116600090815260016020908152604080832081518084018890528251808203850181529083018352805190840120845282528083209385168352929052205442105b9392505050565b6106388433858585610b4f565b50505050565b61044083338484610ef3565b6001600160a01b0380821660009081526020819052604081205490911680156106735792915050565b5090919050565b6000601960f81b813060038261068f8c61064a565b6001600160a01b0316815260208082019290925260409081016000205481516001600160f81b0319968716818501529490951660218501526001600160601b0319606093841b8116602286015260368501959095528b831b851660568501526d7265766f6b6544656c656761746560901b606a850152607884018890529186901b90931660988301528051608c81840301815260ac909201905280519101209050610748876107418189898987610a60565b8585610ef3565b50505050505050565b6000601960f81b81306003826107668d61064a565b6001600160a01b0316815260208082019290925260409081016000205490516001600160f81b031995861692810192909252929093166021840152606090811b6001600160601b0319908116602285015260368401929092528a811b821660568401526a61646444656c656761746560a81b606a8401526075830187905285901b16609582015260a9810183905260c9016040516020818303038152906040528051906020012090506104c7886108208a8a8a8a87610a60565b868686610fd1565b6106388433858585610fd1565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff168061087f5750805467ffffffffffffffff808416911610155b1561089d5760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b1781556108c8836110d0565b805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6000601960f81b813060038261092f8c61064a565b6001600160a01b03166001600160a01b03168152602001908152602001600020548a878760405160200161096997969594939291906118c4565b604051602081830303815290604052805190602001209050610748876109928989898987610a60565b85856109a4565b6105b7823383610c17565b83836109af8261064a565b6001600160a01b0316816001600160a01b0316146109e85760405162461bcd60e51b81526004016109df90611946565b60405180910390fd5b6001600160a01b0386166000818152600260205260408082205490517f18ab6b2ae3d64306c00ce663125f2bd680e441a098de1635bd7ad8b0d44965e492610a3592899289929190611969565b60405180910390a25050506001600160a01b0390921660009081526002602052604090204390555050565b6040805160008082526020820180845284905260ff8716928201929092526060810185905260808101849052819060019060a0016020604051602081039080840390855afa158015610ab6573d6000803e3d6000fd5b505050602060405103519050610acb8761064a565b6001600160a01b0316816001600160a01b031614610b1b5760405162461bcd60e51b815260206004820152600d60248201526c6261645f7369676e617475726560981b60448201526064016109df565b6001600160a01b0381166000908152600360205260408120805491610b3f836119ab565b9091555090979650505050505050565b8484610b5a8261064a565b6001600160a01b0316816001600160a01b031614610b8a5760405162461bcd60e51b81526004016109df90611946565b6001600160a01b0387167f18ab6b2ae3d64306c00ce663125f2bd680e441a098de1635bd7ad8b0d44965e48686610bc187426119c4565b6001600160a01b038c1660009081526002602052604090819020549051610beb9493929190611969565b60405180910390a25050506001600160a01b039093166000908152600260205260409020439055505050565b8282610c228261064a565b6001600160a01b0316816001600160a01b031614610c525760405162461bcd60e51b81526004016109df90611946565b6001600160a01b0385811660008181526020818152604080832080546001600160a01b031916958916958617905560028252918290205482519485529084015290917f38a5a6e68f30ed1ab45860a4afb34bcb2fc00f22ca462d249b8a8d40cda6f7a3910160405180910390a2505050506001600160a01b03166000908152600260205260409020439055565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610d6657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610d5a600080516020611a0d833981519152546001600160a01b031690565b6001600160a01b031614155b15610d845760405163703e46dd60e11b815260040160405180910390fd5b565b6004805460405163574a81d760e01b815230928101929092526001600160a01b038381166024840152169063574a81d79060440160006040518083038186803b158015610dd257600080fd5b505afa158015610de6573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610e47575060408051601f3d908101601f19168201909252610e44918101906119d7565b60015b610e6f57604051634c9c8ce360e01b81526001600160a01b03831660048201526024016109df565b600080516020611a0d8339815191528114610ea057604051632a87526960e21b8152600481018290526024016109df565b61044083836110fa565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d845760405163703e46dd60e11b815260040160405180910390fd5b8383610efe8261064a565b6001600160a01b0316816001600160a01b031614610f2e5760405162461bcd60e51b81526004016109df90611946565b6001600160a01b03868116600081815260016020908152604080832081518084018b90528251808203850181528184018085528151918601919091208652918452828520968a16808652968452828520429081905586865260029094529190932054928990526060810194909452608084015260a0830152907f5a5084339536bcab65f20799fcc58724588145ca054bd2be626174b27ba156f79060c001610a35565b8484610fdc8261064a565b6001600160a01b0316816001600160a01b03161461100c5760405162461bcd60e51b81526004016109df90611946565b61101683426119c4565b6001600160a01b03888116600081815260016020908152604080832081518084018d9052825180820385018152908301835280519084012084528252808320948a16835293905291909120919091557f5a5084339536bcab65f20799fcc58724588145ca054bd2be626174b27ba156f7868661109287426119c4565b6001600160a01b038c811660009081526002602090815260409182902054825196875294909216918501919091528301526060820152608001610beb565b6110d8611150565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b61110382611199565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156111485761044082826111fe565b6105b7611276565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610d8457604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b6000036111cf57604051634c9c8ce360e01b81526001600160a01b03821660048201526024016109df565b600080516020611a0d83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161121b91906119f0565b600060405180830381855af49150503d8060008114611256576040519150601f19603f3d011682016040523d82523d6000602084013e61125b565b606091505b509150915061126b858383611295565b925050505b92915050565b3415610d845760405163b398979f60e01b815260040160405180910390fd5b6060826112aa576112a5826112f1565b610624565b81511580156112c157506001600160a01b0384163b155b156112ea57604051639996b31560e01b81526001600160a01b03851660048201526024016109df565b5080610624565b8051156113015780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b038116811461133157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261135d57600080fd5b813567ffffffffffffffff8082111561137857611378611336565b604051601f8301601f19908116603f011681019082821181831017156113a0576113a0611336565b816040528381528660208588010111156113b957600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000606084860312156113ee57600080fd5b6113f78461131a565b925060208401359150604084013567ffffffffffffffff81111561141a57600080fd5b6114268682870161134c565b9150509250925092565b60006020828403121561144257600080fd5b6106248261131a565b60008060006060848603121561146057600080fd5b6114698461131a565b92506020840135915061147e6040850161131a565b90509250925092565b803560ff8116811461133157600080fd5b600080600080600080600060e0888a0312156114b357600080fd5b6114bc8861131a565b96506114ca60208901611487565b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff8111156114fb57600080fd5b6115078a828b0161134c565b92505060c0880135905092959891949750929550565b600080600080600060a0868803121561153557600080fd5b61153e8661131a565b945061154c60208701611487565b935060408601359250606086013591506115686080870161131a565b90509295509295909350565b6000806040838503121561158757600080fd5b6115908361131a565b9150602083013567ffffffffffffffff8111156115ac57600080fd5b6115b88582860161134c565b9150509250929050565b600080600080608085870312156115d857600080fd5b6115e18561131a565b935060208501359250604085013567ffffffffffffffff81111561160457600080fd5b6116108782880161134c565b949793965093946060013593505050565b60008060008060008060c0878903121561163a57600080fd5b6116438761131a565b955061165160208801611487565b945060408701359350606087013592506080870135915061167460a0880161131a565b90509295509295509295565b600080600080600080600060e0888a03121561169b57600080fd5b6116a48861131a565b96506116b260208901611487565b95506040880135945060608801359350608088013592506116d560a0890161131a565b915060c0880135905092959891949750929550565b6000806000806080858703121561170057600080fd5b6117098561131a565b93506020850135925061171e6040860161131a565b9396929550929360600135925050565b60005b83811015611749578181015183820152602001611731565b50506000910152565b6000815180845261176a81602086016020860161172e565b601f01601f19169290920160200192915050565b6020815260006106246020830184611752565b60008060008060008060c087890312156117aa57600080fd5b6117b38761131a565b95506117c160208801611487565b945060408701359350606087013592506080870135915060a087013567ffffffffffffffff8111156117f257600080fd5b6117fe89828a0161134c565b9150509295509295509295565b6000806040838503121561181e57600080fd5b6118278361131a565b91506118356020840161131a565b90509250929050565b6001600160f81b03198981168252881660018201526001600160601b0319606088811b821660028401526016830188905286901b1660368201526b73657441747472696275746560a01b604a8201526056810184905282516000906118aa81607685016020880161172e565b607692019182019290925260960198975050505050505050565b6001600160f81b03198881168252871660018201526001600160601b0319606087811b821660028401526016830187905285901b1660368201526e7265766f6b6541747472696275746560881b604a82015260598101839052815160009061193381607985016020870161172e565b9190910160790198975050505050505050565b6020808252600990820152683130b22fb0b1ba37b960b91b604082015260600190565b8481526080602082015260006119826080830186611752565b6040830194909452506060015292915050565b634e487b7160e01b600052601160045260246000fd5b6000600182016119bd576119bd611995565b5060010190565b8082018082111561127057611270611995565b6000602082840312156119e957600080fd5b5051919050565b60008251611a0281846020870161172e565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220e7a23dcffe91957f005fa1de7f2f0b751f0524e66901b8d42080dc5103cb30ba64736f6c63430008170033" - }, - "0x000000000000000000000000000000000019999": { - "comment": "Proxy: Smart contract to resolve DIDs from various DID registries", - "balance": "0", - "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212202bb3e818f8e7f23c5970e203f84012b1e8339cbb5380d39199eb3da2d17147c364736f6c63430008170033", - "storage": { - "0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000009999", - "0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000003333", - "0000000000000000000000000000000000000000000000000000000000000002": "0x0000000000000000000000000000000000000000000000000000000000018888", - "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000d400ee7483c04facb08a85ac3f5246623b8703d6" - } - }, - "0xd400ee7483c04facb08a85ac3f5246623b8703d6": { - "comment": "Implementation: Smart contract to resolve DIDs from various DID registries", - "balance": "0", - "code": "0x6080604052600436106100555760003560e01c806329181c6c1461005a5780634f1ef2861461009057806352d1902d146100a557806366874f25146100c8578063ad3cb1cc14610135578063c0c53b8b14610166575b600080fd5b34801561006657600080fd5b5061007a61007536600461191c565b610186565b60405161008791906119dd565b60405180910390f35b6100a361009e366004611abc565b6102a8565b005b3480156100b157600080fd5b506100ba6102c7565b604051908152602001610087565b3480156100d457600080fd5b506100e86100e336600461191c565b6102e4565b604051610087919081516001600160a01b03908116825260208084015190911690820152604080830151908201526060808301519082015260809182015115159181019190915260a00190565b34801561014157600080fd5b5061007a604051806040016040528060058152602001640352e302e360dc1b81525081565b34801561017257600080fd5b506100a3610181366004611b4e565b610518565b606060006101c984848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061062c92505050565b90506101d88160000151610777565b1561025e57600154604051630d8ce14b60e21b81526001600160a01b0390911690633633852c9061020f9087908790600401611b99565b600060405180830381865afa15801561022c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102549190810190611bc8565b5191506102a29050565b80516040516102709190602001611ce7565b60408051601f198184030181529082905263fdc1b5c360e01b825261029791600401611d37565b60405180910390fd5b505b92915050565b6102b0610817565b6102b9826108be565b6102c38282610924565b5050565b60006102d16109e6565b50600080516020611f4783398151915290565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152600061035084848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061062c92505050565b905061035f8160000151610a2f565b1561044c5760006103738260200151610a68565b90506001600160a01b0381166103a0578484604051631859e3bb60e11b8152600401610297929190611b99565b6002546040516310e67a9d60e31b81526001600160a01b0383811660048301526000921690638733d4e890602401602060405180830381865afa1580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f9190611d8b565b6040805160a0810182526001600160a01b03909216825260006020830181905290820181905260608201819052608082015293506102a292505050565b805161045790610777565b156104df57600154604051630d8ce14b60e21b81526001600160a01b0390911690633633852c9061048e9087908790600401611b99565b600060405180830381865afa1580156104ab573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104d39190810190611bc8565b602001519150506102a2565b80516040516104f19190602001611ce7565b60408051601f198184030181529082905263fdc1b5c360e01b825261029791600401611da8565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff1680610561575080546001600160401b03808416911610155b1561057f5760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b1781556105a985610aa1565b600180546001600160a01b038681166001600160a01b0319928316179092556002805492861692909116919091179055805468ff0000000000000000191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b6040805180820190915260608082526020820152600061064b83610acb565b90506000610671604051806040016040528060018152602001601d60f91b815250610acb565b90506000806106808484610ad6565b9550925090508015806106be57506106bc6106b560405180604001604052806003815260200162191a5960ea1b815250610acb565b8390610b24565b155b156106de5785604051631859e3bb60e11b815260040161029791906119dd565b6106e88484610ad6565b9550925090508061070e5785604051631859e3bb60e11b815260040161029791906119dd565b604080518082019091526060808252602082015261072b83610b30565b81526040805180820190915260018152601d60f91b60208201526107599061075290610acb565b8690610b3b565b94506107689150849050610b30565b60208201529695505050505050565b60008061078383610acb565b90506107b46107ad60405180604001604052806004815260200163696e647960e01b815250610acb565b8290610b24565b806107e357506107e36107ad6040518060400160405280600581526020016434b7323c9960d91b815250610acb565b8061081057506108106107ad6040518060400160405280600381526020016239b7bb60e91b815250610acb565b9392505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061089e57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610892600080516020611f47833981519152546001600160a01b031690565b6001600160a01b031614155b156108bc5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561090957600080fd5b505afa15801561091d573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561097e575060408051601f3d908101601f1916820190925261097b91810190611dfc565b60015b6109a657604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610297565b600080516020611f4783398151915281146109d757604051632a87526960e21b815260048101829052602401610297565b6109e18383610b65565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108bc5760405163703e46dd60e11b815260040160405180910390fd5b60006102a2610a596040518060400160405280600481526020016332ba343960e11b815250610acb565b610a6284610acb565b90610b24565b60006016610a74835190565b03610a8157506000919050565b6000610a8c83610bbb565b9050610a9781611e15565b60601c9392505050565b610aa9610dad565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006102a282610df6565b6000808080610ae58686610e0a565b90506000198103610b0157600086600093509350935050610b1d565b610b1586826001600160801b038816610f15565b935093509350505b9250925092565b60006108108383610f82565b60606102a282610fcc565b6000808080610b4a8686611043565b90506000198103610b01576000808793509350935050610b1d565b610b6e82611135565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610bb3576109e1828261119a565b6102c3611210565b60606000610bc883610acb565b90506000610bef60405180604001604052806002815260200161060f60f31b815250610acb565b9050610c1e610c1760405180604001604052806002815260200161060f60f31b815250610acb565b839061122f565b610c3957505060408051602081019091526000815292915050565b610c4b610c46838361123b565b610b30565b93506000849050600060028251610c629190611e67565b6001600160401b03811115610c7957610c79611a05565b6040519080825280601f01601f191660200182016040528015610ca3576020820181803683370190505b50905060005b8151811015610da357600080610ce885610cc4856002611e89565b81518110610cd457610cd4611ea0565b01602001516001600160f81b031916611247565b9150915080610d0d575050604080516020810190915260008152979650505050505050565b600080610d2a87610d1f876002611e89565b610cc4906001611eb6565b9150915080610d515750506040805160208101909152600081529998505050505050505050565b81610d5d856010611ec9565b610d679190611ee5565b60f81b868681518110610d7c57610d7c611ea0565b60200101906001600160f81b031916908160001a9053505060019093019250610ca9915050565b5095945050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166108bc57604051631afcd79f60e31b815260040160405180910390fd5b60008060208301905061081081845161132d565b60006001600160801b03838116908316808303610e2c576000925050506102a2565b811580610e3857508181115b15610e4957600019925050506102a2565b6000610e558660801c90565b90506000610e638660801c90565b90506000610e72825160001a90565b90505b6000610e82848784611339565b90506000198103610e9d5760001996505050505050506102a2565b94859003949283019285851115610ebe5760001996505050505050506102a2565b84832085852003610eea57610ed38960801c90565b610edd9085611efe565b96505050505050506102a2565b85600103610f025760001996505050505050506102a2565b6000199095019460019093019250610e75565b600080600080610f258760801c90565b90506001600160801b03871685870181811115610f55576040516365f4e9df60e01b815260040160405180910390fd5b6001996001600160801b03988916608085811b919091179a50928290039098169201901b17949350505050565b60006001600160801b038381169083168114610fa25760009150506102a2565b610fc4610faf8560801c90565b610fb98560801c90565b839081902091201490565b949350505050565b60606001600160801b0382166001600160401b03811115610fef57610fef611a05565b6040519080825280601f01601f191660200182016040528015611019576020820181803683370190505b5090506020810161103d8161102e8560801c90565b6001600160801b038616611401565b50919050565b60006001600160801b03838116908316808303611065576000925050506102a2565b81158061107157508181115b1561108257600019925050506102a2565b600061108e8660801c90565b9050600061109c8660801c90565b905060006110a98761140f565b905060001984015b60006110be858885611454565b905060001981036110da576000199750505050505050506102a2565b808211156110f3576000199750505050505050506102a2565b8584208282038681018890209091036111155797506102a29650505050505050565b8115611123575095506110b1565b600019985050505050505050506102a2565b806001600160a01b03163b60000361116b57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610297565b600080516020611f4783398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516111b79190611f11565b600060405180830381855af49150503d80600081146111f2576040519150601f19603f3d011682016040523d82523d6000602084013e6111f7565b606091505b5091509150611207858383611508565b95945050505050565b34156108bc5760405163b398979f60e01b815260040160405180910390fd5b60006108108383611564565b600061081083836115b1565b600080600360fc1b6001600160f81b03198416108015906112765750603960f81b6001600160f81b0319841611155b156112945761128a603060f885901c611f2d565b9360019350915050565b604160f81b6001600160f81b03198416108015906112c05750602360f91b6001600160f81b0319841611155b156112e05760416112d660f885901c600a611ee5565b61128a9190611f2d565b606160f81b6001600160f81b031984161080159061130c5750603360f91b6001600160f81b0319841611155b156113225760616112d660f885901c600a611ee5565b506000928392509050565b6000610810838361160b565b6000602083116113555761134e848484611617565b9050610810565b83601f8416808503820160ff8516600080516020611f67833981519152025b818810156113b6578751811861138981611728565b156113aa5784890361139d8a60208a611617565b0195505050505050610810565b60208901985050611374565b826000036113cc57600019945050505050610810565b6113d7828488611617565b945060001985036113f057600019945050505050610810565b509190910391909101949350505050565b8083828460045afa50505050565b60006001600160801b03821680820361143b576040516365f4e9df60e01b815260040160405180910390fd5b6108106001820361144c8560801c90565b015160001a90565b6000602083116114695761134e848484611773565b601f831684840181156114a1578190036000611486828487611773565b9050600019811461149f57908690030191506108109050565b505b60ff8416600080516020611f67833981519152025b868211156114fa57601f19909101805190919081186114d481611728565b156114f4578783036114e884602089611773565b01945050505050610810565b506114b6565b506000199695505050505050565b60608261151d57611518826117bc565b610810565b815115801561153457506001600160a01b0384163b155b1561155d57604051639996b31560e01b81526001600160a01b0385166004820152602401610297565b5080610810565b60006001600160801b0383811690831680821015611587576000925050506102a2565b848183111561159d5761159a86836117e8565b90505b6115a78186610f82565b9695505050505050565b60006001600160801b03838116908316818111156115d35784925050506102a2565b6000806115e08784611833565b90925090506115ef8287610f82565b156115ff5793506102a292505050565b869450505050506102a2565b600061081083836118b6565b825160009081602085111561162b57602094505b601285106116b55760ff8416600080516020611f6783398151915202821861165b6001600160801b038217611728565b6000036116915760109150601a861061168c576116806001600160401b038217611728565b60000361168c57601891505b6116af565b6116a36001600160c01b038217611728565b6000036116af57600891505b506116f3565b600a85106116f35760ff8416600080516020611f678339815191520282186116e56001600160c01b038217611728565b6000036116f157600891505b505b8481101561171b5781811a60ff85168103611712575091506108109050565b506001016116f3565b5060001995945050505050565b7ffefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefeff81019019167f80808080808080808080808080808080808080808080808080808080808080801690565b6000602083111561178357602092505b83515b83156117b0576000199093019280841a60ff841681036117aa578492505050610810565b50611786565b50600019949350505050565b8051156117cc5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b60006001600160801b03831680831115611815576040516365f4e9df60e01b815260040160405180910390fd5b610fc46118228560801c90565b60801b6001600160801b0385161790565b60008060006118428560801c90565b90506001600160801b0385168085111561186f576040516365f4e9df60e01b815260040160405180910390fd5b608082901b6001600160801b038616176118a961188c8785611eb6565b6118968885611efe565b6001600160801b031660809190911b1790565b9350935050509250929050565b60006001600160801b038311156118e05760405163fee7506f60e01b815260040160405180910390fd5b6001600160801b0382111561190857604051633b6b098d60e01b815260040160405180910390fd5b506001600160801b031660809190911b1790565b6000806020838503121561192f57600080fd5b82356001600160401b038082111561194657600080fd5b818501915085601f83011261195a57600080fd5b81358181111561196957600080fd5b86602082850101111561197b57600080fd5b60209290920196919550909350505050565b60005b838110156119a8578181015183820152602001611990565b50506000910152565b600081518084526119c981602086016020860161198d565b601f01601f19169290920160200192915050565b60208152600061081060208301846119b1565b6001600160a01b03811681146117e557600080fd5b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715611a3d57611a3d611a05565b60405290565b60405160a081016001600160401b0381118282101715611a3d57611a3d611a05565b604051601f8201601f191681016001600160401b0381118282101715611a8d57611a8d611a05565b604052919050565b60006001600160401b03821115611aae57611aae611a05565b50601f01601f191660200190565b60008060408385031215611acf57600080fd5b8235611ada816119f0565b915060208301356001600160401b03811115611af557600080fd5b8301601f81018513611b0657600080fd5b8035611b19611b1482611a95565b611a65565b818152866020838501011115611b2e57600080fd5b816020840160208301376000602083830101528093505050509250929050565b600080600060608486031215611b6357600080fd5b8335611b6e816119f0565b92506020840135611b7e816119f0565b91506040840135611b8e816119f0565b809150509250925092565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006020808385031215611bdb57600080fd5b82516001600160401b0380821115611bf257600080fd5b9084019081860360c0811215611c0757600080fd5b611c0f611a1b565b835183811115611c1e57600080fd5b84019250601f83018813611c3157600080fd5b8251611c3f611b1482611a95565b8181528987838701011115611c5357600080fd5b611c628288830189880161198d565b82525060a0601f1983011215611c7757600080fd5b611c7f611a43565b9250848401519150611c90826119f0565b908252604083015190611ca2826119f0565b8185840152606084015160408401526080840151606084015260a084015193508315158414611cd057600080fd5b608083019390935250918101919091529392505050565b7f556e737570706f7274656420444944204d6574686f643a202700000000000000815260008251611d1f81601985016020870161198d565b602760f81b6019939091019283015250601a01919050565b60408152602460408201527f556e6976657273616c4469645265736f6c7665722e7265736f6c7665446f63756060820152631b595b9d60e21b608082015260a06020820152600061081060a08301846119b1565b600060208284031215611d9d57600080fd5b8151610810816119f0565b60408152602460408201527f556e6976657273616c4469645265736f6c7665722e7265736f6c76654d6574616060820152636461746160e01b608082015260a06020820152600061081060a08301846119b1565b600060208284031215611e0e57600080fd5b5051919050565b805160208201516bffffffffffffffffffffffff198082169291906014831015611e495780818460140360031b1b83161693505b505050919050565b634e487b7160e01b600052601160045260246000fd5b600082611e8457634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176102a2576102a2611e51565b634e487b7160e01b600052603260045260246000fd5b808201808211156102a2576102a2611e51565b60ff81811683821602908116908181146102a0576102a0611e51565b60ff81811683821601908111156102a2576102a2611e51565b818103818111156102a2576102a2611e51565b60008251611f2381846020870161198d565b9190910192915050565b60ff82811682821603908111156102a2576102a2611e5156fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc0101010101010101010101010101010101010101010101010101010101010101a264697066735822122044705fbc848c4daa0671e8e6e6b375afe66e66cc889c42f434906d6446f271cb64736f6c63430008170033" + "code": "0x60806040526004361061011e5760003560e01c806380b29f7c116100a0578063ad3cb1cc11610064578063ad3cb1cc14610369578063c4d66de8146103a7578063e476af5c146103c7578063f00d4b5d146103e7578063f96d0f9f1461040757600080fd5b806380b29f7c146102c95780638733d4e8146102e957806393072684146103095780639c2c1b2b14610329578063a7068d661461034957600080fd5b80634f1ef286116100e75780634f1ef2861461022457806352d1902d14610237578063622b2a3c1461024c57806370ae92d21461027c5780637ad4b0a4146102a957600080fd5b8062c023da14610123578063022914a7146101455780630d44625b14610198578063123b5e98146101e4578063240cf1fa14610204575b600080fd5b34801561012f57600080fd5b5061014361013e3660046113d9565b610434565b005b34801561015157600080fd5b5061017b610160366004611430565b6000602081905290815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101a457600080fd5b506101d66101b336600461144b565b600160209081526000938452604080852082529284528284209052825290205481565b60405190815260200161018f565b3480156101f057600080fd5b506101436101ff366004611498565b610445565b34801561021057600080fd5b5061014361021f36600461151d565b6104d1565b610143610232366004611574565b61059c565b34801561024357600080fd5b506101d66105bb565b34801561025857600080fd5b5061026c61026736600461144b565b6105d8565b604051901515815260200161018f565b34801561028857600080fd5b506101d6610297366004611430565b60036020526000908152604090205481565b3480156102b557600080fd5b506101436102c43660046115c2565b61062b565b3480156102d557600080fd5b506101436102e436600461144b565b61063e565b3480156102f557600080fd5b5061017b610304366004611430565b61064a565b34801561031557600080fd5b50610143610324366004611621565b61067a565b34801561033557600080fd5b50610143610344366004611680565b610751565b34801561035557600080fd5b506101436103643660046116ea565b610828565b34801561037557600080fd5b5061039a604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161018f919061177e565b3480156103b357600080fd5b506101436103c2366004611430565b610835565b3480156103d357600080fd5b506101436103e2366004611791565b61091a565b3480156103f357600080fd5b5061014361040236600461180b565b610999565b34801561041357600080fd5b506101d6610422366004611430565b60026020526000908152604090205481565b610440833384846109a4565b505050565b6000601960f81b813060038261045a8d61064a565b6001600160a01b03166001600160a01b03168152602001908152602001600020548b88888860405160200161049698979695949392919061183e565b6040516020818303038152906040528051906020012090506104c7886104bf8a8a8a8a87610a60565b868686610b4f565b5050505050505050565b6000601960f81b81306003826104e68b61064a565b6001600160a01b0316815260208082019290925260409081016000205481516001600160f81b0319968716818501529490951660218501526001600160601b0319606093841b8116602286015260368501959095528a831b851660568501526a31b430b733b2a7bbb732b960a91b606a8501529186901b90931660758301528051606981840301815260899092019052805191012090506105948661058e8188888887610a60565b84610c17565b505050505050565b6105a4610cdf565b6105ad82610d86565b6105b78282610ded565b5050565b60006105c5610eaa565b50600080516020611a0d83398151915290565b6001600160a01b03838116600090815260016020908152604080832081518084018890528251808203850181529083018352805190840120845282528083209385168352929052205442105b9392505050565b6106388433858585610b4f565b50505050565b61044083338484610ef3565b6001600160a01b0380821660009081526020819052604081205490911680156106735792915050565b5090919050565b6000601960f81b813060038261068f8c61064a565b6001600160a01b0316815260208082019290925260409081016000205481516001600160f81b0319968716818501529490951660218501526001600160601b0319606093841b8116602286015260368501959095528b831b851660568501526d7265766f6b6544656c656761746560901b606a850152607884018890529186901b90931660988301528051608c81840301815260ac909201905280519101209050610748876107418189898987610a60565b8585610ef3565b50505050505050565b6000601960f81b81306003826107668d61064a565b6001600160a01b0316815260208082019290925260409081016000205490516001600160f81b031995861692810192909252929093166021840152606090811b6001600160601b0319908116602285015260368401929092528a811b821660568401526a61646444656c656761746560a81b606a8401526075830187905285901b16609582015260a9810183905260c9016040516020818303038152906040528051906020012090506104c7886108208a8a8a8a87610a60565b868686610fd1565b6106388433858585610fd1565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff168061087f5750805467ffffffffffffffff808416911610155b1561089d5760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b1781556108c8836110d0565b805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6000601960f81b813060038261092f8c61064a565b6001600160a01b03166001600160a01b03168152602001908152602001600020548a878760405160200161096997969594939291906118c4565b604051602081830303815290604052805190602001209050610748876109928989898987610a60565b85856109a4565b6105b7823383610c17565b83836109af8261064a565b6001600160a01b0316816001600160a01b0316146109e85760405162461bcd60e51b81526004016109df90611946565b60405180910390fd5b6001600160a01b0386166000818152600260205260408082205490517f18ab6b2ae3d64306c00ce663125f2bd680e441a098de1635bd7ad8b0d44965e492610a3592899289929190611969565b60405180910390a25050506001600160a01b0390921660009081526002602052604090204390555050565b6040805160008082526020820180845284905260ff8716928201929092526060810185905260808101849052819060019060a0016020604051602081039080840390855afa158015610ab6573d6000803e3d6000fd5b505050602060405103519050610acb8761064a565b6001600160a01b0316816001600160a01b031614610b1b5760405162461bcd60e51b815260206004820152600d60248201526c6261645f7369676e617475726560981b60448201526064016109df565b6001600160a01b0381166000908152600360205260408120805491610b3f836119ab565b9091555090979650505050505050565b8484610b5a8261064a565b6001600160a01b0316816001600160a01b031614610b8a5760405162461bcd60e51b81526004016109df90611946565b6001600160a01b0387167f18ab6b2ae3d64306c00ce663125f2bd680e441a098de1635bd7ad8b0d44965e48686610bc187426119c4565b6001600160a01b038c1660009081526002602052604090819020549051610beb9493929190611969565b60405180910390a25050506001600160a01b039093166000908152600260205260409020439055505050565b8282610c228261064a565b6001600160a01b0316816001600160a01b031614610c525760405162461bcd60e51b81526004016109df90611946565b6001600160a01b0385811660008181526020818152604080832080546001600160a01b031916958916958617905560028252918290205482519485529084015290917f38a5a6e68f30ed1ab45860a4afb34bcb2fc00f22ca462d249b8a8d40cda6f7a3910160405180910390a2505050506001600160a01b03166000908152600260205260409020439055565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610d6657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610d5a600080516020611a0d833981519152546001600160a01b031690565b6001600160a01b031614155b15610d845760405163703e46dd60e11b815260040160405180910390fd5b565b6004805460405163574a81d760e01b815230928101929092526001600160a01b038381166024840152169063574a81d79060440160006040518083038186803b158015610dd257600080fd5b505afa158015610de6573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610e47575060408051601f3d908101601f19168201909252610e44918101906119d7565b60015b610e6f57604051634c9c8ce360e01b81526001600160a01b03831660048201526024016109df565b600080516020611a0d8339815191528114610ea057604051632a87526960e21b8152600481018290526024016109df565b61044083836110fa565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d845760405163703e46dd60e11b815260040160405180910390fd5b8383610efe8261064a565b6001600160a01b0316816001600160a01b031614610f2e5760405162461bcd60e51b81526004016109df90611946565b6001600160a01b03868116600081815260016020908152604080832081518084018b90528251808203850181528184018085528151918601919091208652918452828520968a16808652968452828520429081905586865260029094529190932054928990526060810194909452608084015260a0830152907f5a5084339536bcab65f20799fcc58724588145ca054bd2be626174b27ba156f79060c001610a35565b8484610fdc8261064a565b6001600160a01b0316816001600160a01b03161461100c5760405162461bcd60e51b81526004016109df90611946565b61101683426119c4565b6001600160a01b03888116600081815260016020908152604080832081518084018d9052825180820385018152908301835280519084012084528252808320948a16835293905291909120919091557f5a5084339536bcab65f20799fcc58724588145ca054bd2be626174b27ba156f7868661109287426119c4565b6001600160a01b038c811660009081526002602090815260409182902054825196875294909216918501919091528301526060820152608001610beb565b6110d8611150565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b61110382611199565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156111485761044082826111fe565b6105b7611276565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610d8457604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b6000036111cf57604051634c9c8ce360e01b81526001600160a01b03821660048201526024016109df565b600080516020611a0d83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161121b91906119f0565b600060405180830381855af49150503d8060008114611256576040519150601f19603f3d011682016040523d82523d6000602084013e61125b565b606091505b509150915061126b858383611295565b925050505b92915050565b3415610d845760405163b398979f60e01b815260040160405180910390fd5b6060826112aa576112a5826112f1565b610624565b81511580156112c157506001600160a01b0384163b155b156112ea57604051639996b31560e01b81526001600160a01b03851660048201526024016109df565b5080610624565b8051156113015780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b038116811461133157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261135d57600080fd5b813567ffffffffffffffff8082111561137857611378611336565b604051601f8301601f19908116603f011681019082821181831017156113a0576113a0611336565b816040528381528660208588010111156113b957600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000606084860312156113ee57600080fd5b6113f78461131a565b925060208401359150604084013567ffffffffffffffff81111561141a57600080fd5b6114268682870161134c565b9150509250925092565b60006020828403121561144257600080fd5b6106248261131a565b60008060006060848603121561146057600080fd5b6114698461131a565b92506020840135915061147e6040850161131a565b90509250925092565b803560ff8116811461133157600080fd5b600080600080600080600060e0888a0312156114b357600080fd5b6114bc8861131a565b96506114ca60208901611487565b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff8111156114fb57600080fd5b6115078a828b0161134c565b92505060c0880135905092959891949750929550565b600080600080600060a0868803121561153557600080fd5b61153e8661131a565b945061154c60208701611487565b935060408601359250606086013591506115686080870161131a565b90509295509295909350565b6000806040838503121561158757600080fd5b6115908361131a565b9150602083013567ffffffffffffffff8111156115ac57600080fd5b6115b88582860161134c565b9150509250929050565b600080600080608085870312156115d857600080fd5b6115e18561131a565b935060208501359250604085013567ffffffffffffffff81111561160457600080fd5b6116108782880161134c565b949793965093946060013593505050565b60008060008060008060c0878903121561163a57600080fd5b6116438761131a565b955061165160208801611487565b945060408701359350606087013592506080870135915061167460a0880161131a565b90509295509295509295565b600080600080600080600060e0888a03121561169b57600080fd5b6116a48861131a565b96506116b260208901611487565b95506040880135945060608801359350608088013592506116d560a0890161131a565b915060c0880135905092959891949750929550565b6000806000806080858703121561170057600080fd5b6117098561131a565b93506020850135925061171e6040860161131a565b9396929550929360600135925050565b60005b83811015611749578181015183820152602001611731565b50506000910152565b6000815180845261176a81602086016020860161172e565b601f01601f19169290920160200192915050565b6020815260006106246020830184611752565b60008060008060008060c087890312156117aa57600080fd5b6117b38761131a565b95506117c160208801611487565b945060408701359350606087013592506080870135915060a087013567ffffffffffffffff8111156117f257600080fd5b6117fe89828a0161134c565b9150509295509295509295565b6000806040838503121561181e57600080fd5b6118278361131a565b91506118356020840161131a565b90509250929050565b6001600160f81b03198981168252881660018201526001600160601b0319606088811b821660028401526016830188905286901b1660368201526b73657441747472696275746560a01b604a8201526056810184905282516000906118aa81607685016020880161172e565b607692019182019290925260960198975050505050505050565b6001600160f81b03198881168252871660018201526001600160601b0319606087811b821660028401526016830187905285901b1660368201526e7265766f6b6541747472696275746560881b604a82015260598101839052815160009061193381607985016020870161172e565b9190910160790198975050505050505050565b6020808252600990820152683130b22fb0b1ba37b960b91b604082015260600190565b8481526080602082015260006119826080830186611752565b6040830194909452506060015292915050565b634e487b7160e01b600052601160045260246000fd5b6000600182016119bd576119bd611995565b5060010190565b8082018082111561127057611270611995565b6000602082840312156119e957600080fd5b5051919050565b60008251611a0281846020870161172e565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122041023550f57b6c49d7a3e0c8c26d2ea4e06db2989abcb1738d1c2e4ccc19e8bb64736f6c63430008170033" }, "0x0000000000000000000000000000000000005555": { "comment": "Proxy: Smart contract to manage schemas", "balance": "0", - "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212202bb3e818f8e7f23c5970e203f84012b1e8339cbb5380d39199eb3da2d17147c364736f6c63430008170033", + "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212208de99705f21830b33bf2bd4a57ce70f27ec58ac48b2c88e1c96b59a11978ef8164736f6c63430008170033", "storage": { "0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000009999", - "0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000019999", + "0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000018888", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000cb69afb4aa332708f86210a988cd1885bb1dcd41" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x0000000000000000000000002d8ef83a48caa0366b27021d47d8bb9f7d02016d" } }, - "0xcb69afb4aa332708f86210a988cd1885bb1dcd41": { + "0x2d8ef83a48caa0366b27021d47d8bb9f7d02016d": { "comment": "Implementation: Smart contract to manage schemas", "balance": "0", - "code": "0x6080604052600436106100555760003560e01c806336ce177d1461005a578063485cc9551461007c5780634f1ef2861461009c57806352d1902d146100af578063ad3cb1cc146100d7578063bd7fc5eb14610115575b600080fd5b34801561006657600080fd5b5061007a610075366004610e37565b610142565b005b34801561008857600080fd5b5061007a610097366004610ee6565b61045f565b61007a6100aa366004610f66565b610560565b3480156100bb57600080fd5b506100c461057f565b6040519081526020015b60405180910390f35b3480156100e357600080fd5b50610108604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100ce919061105e565b34801561012157600080fd5b50610135610130366004611071565b61059c565b6040516100ce91906110b3565b85858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405160029250610189915083906110e6565b90815260405190819003602001902060010154156101c5578060405163012f5f2760e11b81526004016101bc919061105e565b60405180910390fd5b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506001546040516366874f2560e01b81526001600160a01b0390911692506366874f25915061022b90849060040161105e565b60a060405180830381865afa925050508015610264575060408051601f3d908101601f1916820190925261026191810190611102565b60015b610309573d808015610292576040519150601f19603f3d011682016040523d82523d6000602084013e610297565b606091505b506102a98163186a887560e11b6106fb565b156102c95781604051634c92543b60e01b81526004016101bc919061105e565b6102da81631859e3bb60e11b6106fb565b156102fa578160405163046cb69560e21b81526004016101bc919061105e565b6103038161072b565b50610380565b80516001600160a01b03163314801590610339575080602001516001600160a01b0316336001600160a01b031614155b1561035957604051633fcc3f1760e01b81523360048201526024016101bc565b80608001511561037e57816040516350943b5760e11b81526004016101bc919061105e565b505b6103c586868a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294939250506107379050565b838360028a8a6040516103d992919061118f565b908152604051908190036020019020916103f4919083611229565b50426002898960405161040892919061118f565b908152604051908190036020018120600101919091557f4caa3c04537f182db18e883a82444b9f9a8a6765fba869bb25cfa69694e7b8cf9061044d908a908a906112e9565b60405180910390a15050505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806104a95750805467ffffffffffffffff808416911610155b156104c75760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b1781556104f2846107cc565b600180546001600160a01b0319166001600160a01b038516179055805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b6105686107f6565b6105718261089d565b61057b8282610903565b5050565b60006105896109c5565b5060008051602061138383398151915290565b6105a4610dc1565b82828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600292506105eb915083906110e6565b90815260405190819003602001902060010154600003610620578060405163272a91e160e21b81526004016101bc919061105e565b6002848460405161063292919061118f565b908152602001604051809103902060405180604001604052908160008201805461065b9061119f565b80601f01602080910402602001604051908101604052809291908181526020018280546106879061119f565b80156106d45780601f106106a9576101008083540402835291602001916106d4565b820191906000526020600020905b8154815290600101906020018083116106b757829003601f168201915b50505091835250506040805160208082019092526001939093015483520152949350505050565b600080838060200190518101906107129190611318565b6001600160e01b03198481169116149150505b92915050565b60208101815182018082fd5b60008282604051806040016040528060158152602001742f616e6f6e63726564732f76302f534348454d412f60581b81525060405160200161077b93929190611342565b60405160208183030381529060405290506107a761079882610a0e565b6107a186610a0e565b90610a19565b6107c6578360405163ba33fe2160e01b81526004016101bc919061105e565b50505050565b6107d4610a2c565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061087d57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610871600080516020611383833981519152546001600160a01b031690565b6001600160a01b031614155b1561089b5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b1580156108e857600080fd5b505afa1580156108fc573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561095d575060408051601f3d908101601f1916820190925261095a91810190611369565b60015b61098557604051634c9c8ce360e01b81526001600160a01b03831660048201526024016101bc565b60008051602061138383398151915281146109b657604051632a87526960e21b8152600481018290526024016101bc565b6109c08383610a75565b505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461089b5760405163703e46dd60e11b815260040160405180910390fd5b600061072582610acb565b6000610a258383610adf565b9392505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661089b57604051631afcd79f60e31b815260040160405180910390fd5b610a7e82610b2c565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610ac3576109c08282610b91565b61057b610c07565b600080602083019050610a25818451610c26565b60006001600160801b0383811690831680821015610b0257600092505050610725565b8481831115610b1857610b158683610c32565b90505b610b228186610c85565b9695505050505050565b806001600160a01b03163b600003610b6257604051634c9c8ce360e01b81526001600160a01b03821660048201526024016101bc565b60008051602061138383398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610bae91906110e6565b600060405180830381855af49150503d8060008114610be9576040519150601f19603f3d011682016040523d82523d6000602084013e610bee565b606091505b5091509150610bfe858383610cc7565b95945050505050565b341561089b5760405163b398979f60e01b815260040160405180910390fd5b6000610a258383610d23565b60006001600160801b03831680831115610c5f576040516365f4e9df60e01b815260040160405180910390fd5b610c7d610c6c8560801c90565b60801b6001600160801b0385161790565b949350505050565b60006001600160801b038381169083168114610ca5576000915050610725565b610c7d610cb28560801c90565b610cbc8560801c90565b839081902091201490565b606082610cdc57610cd782610d2f565b610a25565b8151158015610cf357506001600160a01b0384163b155b15610d1c57604051639996b31560e01b81526001600160a01b03851660048201526024016101bc565b5092915050565b6000610a258383610d5b565b805115610d3f5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b60006001600160801b03831115610d855760405163fee7506f60e01b815260040160405180910390fd5b6001600160801b03821115610dad57604051633b6b098d60e01b815260040160405180910390fd5b506001600160801b031660809190911b1790565b604051806040016040528060608152602001610de96040518060200160405280600081525090565b905290565b60008083601f840112610e0057600080fd5b50813567ffffffffffffffff811115610e1857600080fd5b602083019150836020828501011115610e3057600080fd5b9250929050565b60008060008060008060608789031215610e5057600080fd5b863567ffffffffffffffff80821115610e6857600080fd5b610e748a838b01610dee565b90985096506020890135915080821115610e8d57600080fd5b610e998a838b01610dee565b90965094506040890135915080821115610eb257600080fd5b50610ebf89828a01610dee565b979a9699509497509295939492505050565b6001600160a01b0381168114610d5857600080fd5b60008060408385031215610ef957600080fd5b8235610f0481610ed1565b91506020830135610f1481610ed1565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610f5e57610f5e610f1f565b604052919050565b60008060408385031215610f7957600080fd5b8235610f8481610ed1565b915060208381013567ffffffffffffffff80821115610fa257600080fd5b818601915086601f830112610fb657600080fd5b813581811115610fc857610fc8610f1f565b610fda601f8201601f19168501610f35565b91508082528784828501011115610ff057600080fd5b80848401858401376000848284010152508093505050509250929050565b60005b83811015611029578181015183820152602001611011565b50506000910152565b6000815180845261104a81602086016020860161100e565b601f01601f19169290920160200192915050565b602081526000610a256020830184611032565b6000806020838503121561108457600080fd5b823567ffffffffffffffff81111561109b57600080fd5b6110a785828601610dee565b90969095509350505050565b6020815260008251604060208401526110cf6060840182611032565b905060208401515160408401528091505092915050565b600082516110f881846020870161100e565b9190910192915050565b600060a0828403121561111457600080fd5b60405160a0810181811067ffffffffffffffff8211171561113757611137610f1f565b604052825161114581610ed1565b8152602083015161115581610ed1565b8060208301525060408301516040820152606083015160608201526080830151801515811461118357600080fd5b60808201529392505050565b8183823760009101908152919050565b600181811c908216806111b357607f821691505b6020821081036111d357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156109c0576000816000526020600020601f850160051c810160208610156112025750805b601f850160051c820191505b818110156112215782815560010161120e565b505050505050565b67ffffffffffffffff83111561124157611241610f1f565b6112558361124f835461119f565b836111d9565b6000601f84116001811461128957600085156112715750838201355b600019600387901b1c1916600186901b1783556108fc565b600083815260209020601f19861690835b828110156112ba578685013582556020948501946001909201910161129a565b50868210156112d75760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006020828403121561132a57600080fd5b81516001600160e01b031981168114610a2557600080fd5b82848237600083820160008152835161135f81836020880161100e565b0195945050505050565b60006020828403121561137b57600080fd5b505191905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220610feefa69ff683451b4ec2d1e34b52eb35229228dc2caa5632873a2656b814f64736f6c63430008170033" + "code": "0x6080604052600436106100705760003560e01c80635915b7681161004e5780635915b768146100d2578063ad3cb1cc146100f2578063bdd23ccb14610130578063eaa760c21461015057600080fd5b8063485cc955146100755780634f1ef2861461009757806352d1902d146100aa575b600080fd5b34801561008157600080fd5b5061009561009036600461099d565b61017d565b005b6100956100a53660046109ec565b61027e565b3480156100b657600080fd5b506100bf61029d565b6040519081526020015b60405180910390f35b3480156100de57600080fd5b506100956100ed366004610af9565b6102ba565b3480156100fe57600080fd5b50610123604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100c99190610b79565b34801561013c57600080fd5b5061009561014b366004610bac565b6102cd565b34801561015c57600080fd5b506100bf61016b366004610c38565b60026020526000908152604090205481565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806101c75750805467ffffffffffffffff808416911610155b156101e55760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b1781556102108461032c565b600180546001600160a01b0319166001600160a01b038516179055805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b610286610356565b61028f826103fd565b6102998282610463565b5050565b60006102a761052a565b50600080516020610d5683398151915290565b6102c78433858585610573565b50505050565b6040516000906102f190601960f81b90839030908c90899089908990602001610c51565b6040516020818303038152906040528051906020012090506103228861031a8a848b8b8b6106b3565b868686610573565b5050505050505050565b610334610764565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806103dd57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166103d1600080516020610d56833981519152546001600160a01b031690565b6001600160a01b031614155b156103fb5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561044857600080fd5b505afa15801561045c573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156104bd575060408051601f3d908101601f191682019092526104ba91810190610cc3565b60015b6104ea57604051634c9c8ce360e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610d56833981519152811461051b57604051632a87526960e21b8152600481018290526024016104e1565b61052583836107ad565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103fb5760405163703e46dd60e11b815260040160405180910390fd5b6000838152600260205260409020548390156105a5576040516347f6332960e11b8152600481018290526024016104e1565b6001546040516310e67a9d60e31b81526001600160a01b03808916600483015288928892911690638733d4e890602401602060405180830381865afa1580156105f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106169190610cdc565b6001600160a01b0316816001600160a01b03161461065a5760405163cc41100960e01b81526001600160a01b038084166004830152821660248201526044016104e1565b600086815260026020526040908190204390555186907f3e21fe65ee16f151c8cda6e871883b2e0550f9c8511b4ea1d75c9c9e8d489f67906106a1908a9089908990610cf9565b60405180910390a25050505050505050565b6040805160008082526020820180845287905260ff8616928201929092526060810184905260808101839052819060019060a0016020604051602081039080840390855afa158015610709573d6000803e3d6000fd5b505050602060405103519050806001600160a01b0316876001600160a01b03161461075a5760405163cc41100960e01b81526001600160a01b038089166004830152821660248201526044016104e1565b9695505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166103fb57604051631afcd79f60e31b815260040160405180910390fd5b6107b682610803565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156107fb576105258282610868565b6102996108de565b806001600160a01b03163b60000361083957604051634c9c8ce360e01b81526001600160a01b03821660048201526024016104e1565b600080516020610d5683398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516108859190610d39565b600060405180830381855af49150503d80600081146108c0576040519150601f19603f3d011682016040523d82523d6000602084013e6108c5565b606091505b50915091506108d58583836108fd565b95945050505050565b34156103fb5760405163b398979f60e01b815260040160405180910390fd5b6060826109125761090d8261095c565b610955565b815115801561092957506001600160a01b0384163b155b1561095257604051639996b31560e01b81526001600160a01b03851660048201526024016104e1565b50805b9392505050565b80511561096c5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6001600160a01b038116811461098557600080fd5b600080604083850312156109b057600080fd5b82356109bb81610988565b915060208301356109cb81610988565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156109ff57600080fd5b8235610a0a81610988565b9150602083013567ffffffffffffffff80821115610a2757600080fd5b818501915085601f830112610a3b57600080fd5b813581811115610a4d57610a4d6109d6565b604051601f8201601f19908116603f01168101908382118183101715610a7557610a756109d6565b81604052828152886020848701011115610a8e57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008083601f840112610ac257600080fd5b50813567ffffffffffffffff811115610ada57600080fd5b602083019150836020828501011115610af257600080fd5b9250929050565b60008060008060608587031215610b0f57600080fd5b8435610b1a81610988565b935060208501359250604085013567ffffffffffffffff811115610b3d57600080fd5b610b4987828801610ab0565b95989497509550505050565b60005b83811015610b70578181015183820152602001610b58565b50506000910152565b6020815260008251806020840152610b98816040850160208701610b55565b601f01601f19169190910160400192915050565b600080600080600080600060c0888a031215610bc757600080fd5b8735610bd281610988565b9650602088013560ff81168114610be857600080fd5b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff811115610c1957600080fd5b610c258a828b01610ab0565b989b979a50959850939692959293505050565b600060208284031215610c4a57600080fd5b5035919050565b6001600160f81b03198881168252871660018201526bffffffffffffffffffffffff19606087811b8216600284015286901b1660168201526b637265617465536368656d6160a01b602a8201526036810184905260008284605684013750600091016056019081529695505050505050565b600060208284031215610cd557600080fd5b5051919050565b600060208284031215610cee57600080fd5b815161095581610988565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b60008251610d4b818460208701610b55565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122004327f7acb789b0212fc0886f4f174a5f4b4b46a13dbbb20db5383f95211b15d64736f6c63430008170033" }, "0x0000000000000000000000000000000000004444": { "comment": "Proxy: Smart contract to manage credential definitions", "balance": "0", - "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212202bb3e818f8e7f23c5970e203f84012b1e8339cbb5380d39199eb3da2d17147c364736f6c63430008170033", + "code": "0x6080604052600a600c565b005b60186014601a565b6051565b565b6000604c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e808015606f573d6000f35b3d6000fdfea26469706673582212208de99705f21830b33bf2bd4a57ce70f27ec58ac48b2c88e1c96b59a11978ef8164736f6c63430008170033", "storage": { "0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000009999", - "0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000019999", + "0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000018888", "0000000000000000000000000000000000000000000000000000000000000002": "0x0000000000000000000000000000000000000000000000000000000000005555", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000c3afef8725f44662a4589e33d0d13a88c18a4756" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x00000000000000000000000097fa08cd747ea254194e6ed783126688b7b955d7" } }, - "0xc3afef8725f44662a4589e33d0d13a88c18a4756": { + "0x97fa08cd747ea254194e6ed783126688b7b955d7": { "comment": "Implementation: Smart contract to manage credential definitions", "balance": "0", - "code": "0x6080604052600436106100555760003560e01c80634cc562d41461005a5780634f1ef2861461007c57806352d1902d1461008f5780636170c48a146100b7578063ad3cb1cc146100e4578063c0c53b8b14610122575b600080fd5b34801561006657600080fd5b5061007a610075366004610f27565b610142565b005b61007a61008a3660046110b6565b610514565b34801561009b57600080fd5b506100a4610533565b6040519081526020015b60405180910390f35b3480156100c357600080fd5b506100d76100d2366004611148565b610550565b6040516100ae91906111d9565b3480156100f057600080fd5b50610115604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100ae919061120c565b34801561012e57600080fd5b5061007a61013d36600461121f565b6106af565b87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604051600392506101899150839061126a565b90815260405190819003602001902060010154156101c557806040516341d617b960e01b81526004016101bc919061120c565b60405180910390fd5b84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060025460405163bd7fc5eb60e01b81526001600160a01b03909116925063bd7fc5eb915061022b90849060040161120c565b6000604051808303816000875af115801561024a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102729190810190611286565b5087878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506001546040516366874f2560e01b81526001600160a01b0390911692506366874f2591506102d990849060040161120c565b60a060405180830381865afa925050508015610312575060408051601f3d908101601f1916820190925261030f91810190611353565b60015b6103b7573d808015610340576040519150601f19603f3d011682016040523d82523d6000602084013e610345565b606091505b506103578163186a887560e11b6107c3565b156103775781604051634c92543b60e01b81526004016101bc919061120c565b61038881631859e3bb60e11b6107c3565b156103a8578160405163046cb69560e21b81526004016101bc919061120c565b6103b1816107f3565b5061042e565b80516001600160a01b031633148015906103e7575080602001516001600160a01b0316336001600160a01b031614155b1561040757604051633fcc3f1760e01b81523360048201526024016101bc565b80608001511561042c57816040516350943b5760e11b81526004016101bc919061120c565b505b610477898989898f8f8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092969594939250506107ff9050565b848460038d8d60405161048b9291906113df565b908152604051908190036020019020916104a6919083611471565b504260038c8c6040516104ba9291906113df565b908152604051908190036020018120600101919091557f4f0e13d45b6c20e62fb843b05270cf51d91c9cb535dbd5fe03abcc9bbd39d796906104ff908d908d90611530565b60405180910390a15050505050505050505050565b61051c6108bd565b61052582610964565b61052f82826109ca565b5050565b600061053d610a8c565b506000805160206115ea83398151915290565b610558610eb2565b82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040516003925061059f9150839061126a565b908152604051908190036020019020600101546000036105d457806040516305c96b5360e01b81526004016101bc919061120c565b600384846040516105e69291906113df565b908152602001604051809103902060405180604001604052908160008201805461060f906113ef565b80601f016020809104026020016040519081016040528092919081815260200182805461063b906113ef565b80156106885780601f1061065d57610100808354040283529160200191610688565b820191906000526020600020905b81548152906001019060200180831161066b57829003601f168201915b50505091835250506040805160208082019092526001939093015483520152949350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806106f8575080546001600160401b03808416911610155b156107165760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b17815561074085610ad5565b600180546001600160a01b038681166001600160a01b0319928316179092556002805492861692909116919091179055805468ff0000000000000000191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b600080838060200190518101906107da919061155f565b6001600160e01b03198481169116149150505b92915050565b60208101815182018082fd5b600084846040518060400160405280601881526020017f2f616e6f6e63726564732f76302f434c41494d5f4445462f00000000000000008152508585604051806040016040528060018152602001602f60f81b81525060405160200161086a96959493929190611589565b604051602081830303815290604052905061089661088782610aff565b61089088610aff565b90610b0a565b6108b55785604051638ada824b60e01b81526004016101bc919061120c565b505050505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061094457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166109386000805160206115ea833981519152546001600160a01b031690565b6001600160a01b031614155b156109625760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b1580156109af57600080fd5b505afa1580156109c3573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610a24575060408051601f3d908101601f19168201909252610a21918101906115d0565b60015b610a4c57604051634c9c8ce360e01b81526001600160a01b03831660048201526024016101bc565b6000805160206115ea8339815191528114610a7d57604051632a87526960e21b8152600481018290526024016101bc565b610a878383610b1d565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109625760405163703e46dd60e11b815260040160405180910390fd5b610add610b73565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006107ed82610bbc565b6000610b168383610bd0565b9392505050565b610b2682610c1d565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115610b6b57610a878282610c82565b61052f610cf8565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661096257604051631afcd79f60e31b815260040160405180910390fd5b600080602083019050610b16818451610d17565b60006001600160801b0383811690831680821015610bf3576000925050506107ed565b8481831115610c0957610c068683610d23565b90505b610c138186610d76565b9695505050505050565b806001600160a01b03163b600003610c5357604051634c9c8ce360e01b81526001600160a01b03821660048201526024016101bc565b6000805160206115ea83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051610c9f919061126a565b600060405180830381855af49150503d8060008114610cda576040519150601f19603f3d011682016040523d82523d6000602084013e610cdf565b606091505b5091509150610cef858383610db8565b95945050505050565b34156109625760405163b398979f60e01b815260040160405180910390fd5b6000610b168383610e14565b60006001600160801b03831680831115610d50576040516365f4e9df60e01b815260040160405180910390fd5b610d6e610d5d8560801c90565b60801b6001600160801b0385161790565b949350505050565b60006001600160801b038381169083168114610d965760009150506107ed565b610d6e610da38560801c90565b610dad8560801c90565b839081902091201490565b606082610dcd57610dc882610e20565b610b16565b8151158015610de457506001600160a01b0384163b155b15610e0d57604051639996b31560e01b81526001600160a01b03851660048201526024016101bc565b5092915050565b6000610b168383610e4c565b805115610e305780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b60006001600160801b03831115610e765760405163fee7506f60e01b815260040160405180910390fd5b6001600160801b03821115610e9e57604051633b6b098d60e01b815260040160405180910390fd5b506001600160801b031660809190911b1790565b604051806040016040528060608152602001610eda6040518060200160405280600081525090565b905290565b60008083601f840112610ef157600080fd5b5081356001600160401b03811115610f0857600080fd5b602083019150836020828501011115610f2057600080fd5b9250929050565b6000806000806000806000806080898b031215610f4357600080fd5b88356001600160401b0380821115610f5a57600080fd5b610f668c838d01610edf565b909a50985060208b0135915080821115610f7f57600080fd5b610f8b8c838d01610edf565b909850965060408b0135915080821115610fa457600080fd5b610fb08c838d01610edf565b909650945060608b0135915080821115610fc957600080fd5b50610fd68b828c01610edf565b999c989b5096995094979396929594505050565b6001600160a01b0381168114610e4957600080fd5b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561103757611037610fff565b60405290565b604051602081016001600160401b038111828210171561103757611037610fff565b604051601f8201601f191681016001600160401b038111828210171561108757611087610fff565b604052919050565b60006001600160401b038211156110a8576110a8610fff565b50601f01601f191660200190565b600080604083850312156110c957600080fd5b82356110d481610fea565b915060208301356001600160401b038111156110ef57600080fd5b8301601f8101851361110057600080fd5b803561111361110e8261108f565b61105f565b81815286602083850101111561112857600080fd5b816020840160208301376000602083830101528093505050509250929050565b6000806020838503121561115b57600080fd5b82356001600160401b0381111561117157600080fd5b61117d85828601610edf565b90969095509350505050565b60005b838110156111a457818101518382015260200161118c565b50506000910152565b600081518084526111c5816020860160208601611189565b601f01601f19169290920160200192915050565b6020815260008251604060208401526111f560608401826111ad565b905060208401515160408401528091505092915050565b602081526000610b1660208301846111ad565b60008060006060848603121561123457600080fd5b833561123f81610fea565b9250602084013561124f81610fea565b9150604084013561125f81610fea565b809150509250925092565b6000825161127c818460208701611189565b9190910192915050565b6000602080838503121561129957600080fd5b82516001600160401b03808211156112b057600080fd5b9084019081860360408112156112c557600080fd5b6112cd611015565b8351838111156112dc57600080fd5b84019250601f830188136112ef57600080fd5b82516112fd61110e8261108f565b818152898783870101111561131157600080fd5b61132082888301898801611189565b825250601f19820185131561133457600080fd5b61133c61103d565b938501518452938401929092525090949350505050565b600060a0828403121561136557600080fd5b60405160a081018181106001600160401b038211171561138757611387610fff565b604052825161139581610fea565b815260208301516113a581610fea565b806020830152506040830151604082015260608301516060820152608083015180151581146113d357600080fd5b60808201529392505050565b8183823760009101908152919050565b600181811c9082168061140357607f821691505b60208210810361142357634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610a87576000816000526020600020601f850160051c810160208610156114525750805b601f850160051c820191505b818110156108b55782815560010161145e565b6001600160401b0383111561148857611488610fff565b61149c8361149683546113ef565b83611429565b6000601f8411600181146114d057600085156114b85750838201355b600019600387901b1c1916600186901b1783556109c3565b600083815260209020601f19861690835b8281101561150157868501358255602094850194600190920191016114e1565b508682101561151e5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006020828403121561157157600080fd5b81516001600160e01b031981168114610b1657600080fd5b8587823760008682016000815286516115a6818360208b01611189565b0184868237600090850190815283516115c3818360208801611189565b0198975050505050505050565b6000602082840312156115e257600080fd5b505191905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212209bb751a24a6453497c874c242fd2e90fc4c30f4f36b1db84b22749efca339e2b64736f6c63430008170033" + "code": "0x6080604052600436106100705760003560e01c8063bbc742411161004e578063bbc74241146100f0578063c0c53b8b14610110578063eaa760c214610130578063f062236b1461015d57600080fd5b80634f1ef2861461007557806352d1902d1461008a578063ad3cb1cc146100b2575b600080fd5b610088610083366004610a5c565b61017d565b005b34801561009657600080fd5b5061009f61019c565b6040519081526020015b60405180910390f35b3480156100be57600080fd5b506100e3604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100a99190610b44565b3480156100fc57600080fd5b5061008861010b366004610bc0565b6101b9565b34801561011c57600080fd5b5061008861012b366004610c2a565b6101ce565b34801561013c57600080fd5b5061009f61014b366004610c75565b60036020526000908152604090205481565b34801561016957600080fd5b50610088610178366004610c8e565b6102e5565b610185610348565b61018e826103ef565b610198828261044e565b5050565b60006101a6610515565b50600080516020610e4183398151915290565b6101c785338686868661055e565b5050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806102185750805467ffffffffffffffff808416911610155b156102365760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b17815561026185610732565b600180546001600160a01b038681166001600160a01b0319928316179092556002805492861692909116919091179055805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b60405160009061030b90601960f81b90839030908d908a908a908a908a90602001610d23565b60405160208183030381529060405280519060200120905061033d896103348b848c8c8c61075c565b8787878761055e565b505050505050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806103cf57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166103c3600080516020610e41833981519152546001600160a01b031690565b6001600160a01b031614155b156103ed5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561043a57600080fd5b505afa1580156101c7573d6000803e3d6000fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156104a8575060408051601f3d908101601f191682019092526104a591810190610dae565b60015b6104d557604051634c9c8ce360e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610e41833981519152811461050657604051632a87526960e21b8152600481018290526024016104cc565b610510838361080d565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103ed5760405163703e46dd60e11b815260040160405180910390fd5b6000848152600360205260409020548490156105905760405163b1a7a2af60e01b8152600481018290526024016104cc565b6001546040516310e67a9d60e31b81526001600160a01b03808a16600483015289928992911690638733d4e890602401602060405180830381865afa1580156105dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106019190610dc7565b6001600160a01b0316816001600160a01b0316146106455760405163cc41100960e01b81526001600160a01b038084166004830152821660248201526044016104cc565b600254604051637553b06160e11b81526004810188905287916001600160a01b03169063eaa760c2906024016020604051808303816000875af1158015610690573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b49190610dae565b6000036106d75760405163063de83560e21b8152600481018290526024016104cc565b600088815260036020526040908190204390555188907fb244582b6218e1202021c674f5f9ba330f9393f8359101bb96445efeedff3db39061071e908c908a908a90610de4565b60405180910390a250505050505050505050565b61073a610863565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040805160008082526020820180845287905260ff8616928201929092526060810184905260808101839052819060019060a0016020604051602081039080840390855afa1580156107b2573d6000803e3d6000fd5b505050602060405103519050806001600160a01b0316876001600160a01b0316146108035760405163cc41100960e01b81526001600160a01b038089166004830152821660248201526044016104cc565b9695505050505050565b610816826108ac565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a280511561085b576105108282610911565b610198610987565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166103ed57604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b6000036108e257604051634c9c8ce360e01b81526001600160a01b03821660048201526024016104cc565b600080516020610e4183398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161092e9190610e24565b600060405180830381855af49150503d8060008114610969576040519150601f19603f3d011682016040523d82523d6000602084013e61096e565b606091505b509150915061097e8583836109a6565b95945050505050565b34156103ed5760405163b398979f60e01b815260040160405180910390fd5b6060826109bb576109b682610a05565b6109fe565b81511580156109d257506001600160a01b0384163b155b156109fb57604051639996b31560e01b81526001600160a01b03851660048201526024016104cc565b50805b9392505050565b805115610a155780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6001600160a01b0381168114610a2e57600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610a6f57600080fd5b8235610a7a81610a31565b9150602083013567ffffffffffffffff80821115610a9757600080fd5b818501915085601f830112610aab57600080fd5b813581811115610abd57610abd610a46565b604051601f8201601f19908116603f01168101908382118183101715610ae557610ae5610a46565b81604052828152886020848701011115610afe57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b83811015610b3b578181015183820152602001610b23565b50506000910152565b6020815260008251806020840152610b63816040850160208701610b20565b601f01601f19169190910160400192915050565b60008083601f840112610b8957600080fd5b50813567ffffffffffffffff811115610ba157600080fd5b602083019150836020828501011115610bb957600080fd5b9250929050565b600080600080600060808688031215610bd857600080fd5b8535610be381610a31565b94506020860135935060408601359250606086013567ffffffffffffffff811115610c0d57600080fd5b610c1988828901610b77565b969995985093965092949392505050565b600080600060608486031215610c3f57600080fd5b8335610c4a81610a31565b92506020840135610c5a81610a31565b91506040840135610c6a81610a31565b809150509250925092565b600060208284031215610c8757600080fd5b5035919050565b60008060008060008060008060e0898b031215610caa57600080fd5b8835610cb581610a31565b9750602089013560ff81168114610ccb57600080fd5b965060408901359550606089013594506080890135935060a0890135925060c089013567ffffffffffffffff811115610d0357600080fd5b610d0f8b828c01610b77565b999c989b5096995094979396929594505050565b6001600160f81b03198981168252881660018201526bffffffffffffffffffffffff19606088811b8216600284015287901b1660168201527f63726561746543726564656e7469616c446566696e6974696f6e000000000000602a82015260448101859052606481018490526000828460848401375060009101608401908152979650505050505050565b600060208284031215610dc057600080fd5b5051919050565b600060208284031215610dd957600080fd5b81516109fe81610a31565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b60008251610e36818460208701610b20565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212200e0babf8db311bee606a13b3bbbda0b81acf97f50dbe34a186627f036317833f64736f6c63430008170033" } } } diff --git a/network/config/nodes/validator5/key b/network/config/nodes/validator5/key index b544c183..bbab15bd 100644 --- a/network/config/nodes/validator5/key +++ b/network/config/nodes/validator5/key @@ -1 +1 @@ -0x485486605b905d3b93020710f00a0fd07886f0bed128900f0ffcaff6a9412dd8 \ No newline at end of file +0xcab177e8e28012e7e8ae143174eb3efdacbe84aedb30e8fc88e8530ca47fb88b \ No newline at end of file diff --git a/smart_contracts/README.md b/smart_contracts/README.md index 77503813..ff1f593b 100644 --- a/smart_contracts/README.md +++ b/smart_contracts/README.md @@ -30,18 +30,20 @@ The following folders should be generated as the result: ### Main Contracts -* `contracts/auth/AccountControl.sol` - contract to manage permissions for account transactions +* [AccountControl](./contracts/auth/AccountControlInterface.sol) - contract to manage permissions for transactions and new contracts deployment * [AccountControl TS contract wrapper class](./contracts-ts/AccountControl.ts) -* `contracts/auth/RoleControl.sol` - contract to manage (assign/revoke) account roles. +* [RoleControl](./contracts/auth/RoleControlInterface.sol) - contract to manage (assign/revoke) account roles. * [RoleControl TS contract wrapper class](./contracts-ts/RoleControl.ts) -* `contracts/cl/CredentialDefinitionRegistry` - contract to manage (create/resolve) credential definitions - * [CredentialDefinitionRegistry TS contract wrapper class](./contracts-ts/CredentialDefinitionRegistry.ts) -* `contracts/cl/SchemaRegistry` - contract to manager (create/resolve) schemas +* [EthereumExtDidRegistry](./contracts/did/EthereumExtDidRegistry.sol) - [Ethereum DID Registry](https://github.com/uport-project/ethr-did-registry/tree/master) extended with permission checks + * [DidRegistry TS contract wrapper class](./contracts-ts/EthereumExtDidRegistry.ts) +* [SchemaRegistry](./contracts/cl/SchemaRegistryInterface.sol) - contract to manage Schemas * [SchemaRegistry TS contract wrapper class](./contracts-ts/SchemaRegistry.ts) -* `contracts/did/DidRegistry` - contract to manage (create/update/deactivate/resolve) DID doucments - * [DidRegistry TS contract wrapper class](./contracts-ts/DidRegistry.ts) -* `contracts/network/ValidatorControl.sol` - contract to manage network validator nodes. +* [CredentialDefinitionRegistry](./contracts/cl/CredentialDefinitionRegistryInterface.sol) - contract to manage CL Credential Definitions + * [CredentialDefinitionRegistry TS contract wrapper class](./contracts-ts/CredentialDefinitionRegistry.ts) +* [ValidatorControl](./contracts/network/ValidatorControlInterface.sol) - contract to manage network validator nodes. * [ValidatorControl TS contract wrapper class](./contracts-ts/ValidatorControl.ts) +* [UpgradeControl](./contracts/upgrade/UpgradeControlInterface.sol) - contract to control deployed smart contracts and their versions (proposing and approving new versions). + * [Upgrading TS contract wrapper class](./contracts-ts/UpgradeControl.ts) ### Demos @@ -51,14 +53,10 @@ You can find sample scripts demonstrating the usage of deployed contracts in the ``` > yarn demo/account ``` -* [Demo flow](./demos/flow.ts) - create/resolve DID/Schema/Credential Definition using `did:indy2` method. +* [Demo flow](./demos/flow.ts) - create/resolve DID/Schema/Credential Definition. ``` > yarn demo/flow ``` -* [Demo flow](./demos/flow-with-did-ethr.ts) - create/resolve DID/Schema/Credential Definition using `did:ethr` method. - ``` - > yarn demo/flow-with-did-ethr - ``` * [Roles management](./demos/role-control.ts) - get/assign/revoke role to/from account. ``` > yarn demo/roles @@ -74,17 +72,11 @@ You can find sample scripts demonstrating the usage of deployed contracts in the ### Helper Scripts -* `genesis` - helper scripts to generate genesis blocks for injecting contracts. - - > Find more details regarding the scripts in the [genesis section](#inject-contracts-into-network-genesis) of this document. - -## Inject contracts into network genesis - -### Prerequisites +* [Genesis](./scripts/genesis) - helper scripts to generate genesis state for injecting smart contracts. -* `socl` tool must be installed on the machine. +> `socl` tool must be installed on the machine. -This section describes how to inject smart contracts into the genesis state of the network. +#### Steps 1. Prepare the [input file](scripts/genesis/config.ts) with the initial state of each contract. @@ -93,12 +85,12 @@ This section describes how to inject smart contracts into the genesis state of t yarn solc-compile ``` -* `artifacts` and `compiled-contracts` folders with compiled contracts will be generated as the result of the execution. + * `artifacts` and `compiled-contracts` folders with compiled contracts will be generated as the result of the execution. 3. Execute script generating the contracts content for the network genesis file: > yarn genesis/generate -* `ContractsGenesis.json` file will be generated as the result + * `ContractsGenesis.json` file will be generated as the result 4. Put the whole block into the `alloc` section of the network genesis file. diff --git a/smart_contracts/contracts-ts/CredentialDefinitionRegistry.ts b/smart_contracts/contracts-ts/CredentialDefinitionRegistry.ts index dd455d97..cd86820d 100644 --- a/smart_contracts/contracts-ts/CredentialDefinitionRegistry.ts +++ b/smart_contracts/contracts-ts/CredentialDefinitionRegistry.ts @@ -1,5 +1,6 @@ +import { getBytes, keccak256, Signature, toUtf8Bytes, toUtf8String } from 'ethers' +import { CredentialDefinitionCreatedEvent } from '../typechain-types/contracts/cl/CredentialDefinitionRegistry' import { Contract } from '../utils/contract' -import { CredentialDefinitionRecord, mapCredentialDefinitionRecord } from './types' export class CredentialDefinitionRegistry extends Contract { public static readonly defaultAddress = '0x0000000000000000000000000000000000004444' @@ -8,13 +9,42 @@ export class CredentialDefinitionRegistry extends Contract { super(CredentialDefinitionRegistry.name, sender) } - public async createCredentialDefinition(id: string, issuerId: string, schemaId: string, credDef: string) { - const tx = await this.instance.createCredentialDefinition(id, issuerId, schemaId, credDef) + public async createCredentialDefinition(identity: string, id: string, schemaId: string, credDef: string) { + const tx = await this.instance.createCredentialDefinition( + identity, + keccak256(toUtf8Bytes(id)), + keccak256(toUtf8Bytes(schemaId)), + toUtf8Bytes(credDef), + ) return tx.wait() } - public async resolveCredentialDefinition(id: string): Promise { - const result = await this.instance.resolveCredentialDefinition(id) - return mapCredentialDefinitionRecord(result) + public async createCredentialDefinitionSigned( + identity: string, + id: string, + schemaId: string, + credDef: string, + signature: Signature, + ) { + const tx = await this.instance.createCredentialDefinitionSigned( + identity, + signature.v, + signature.r, + signature.s, + keccak256(toUtf8Bytes(id)), + keccak256(toUtf8Bytes(schemaId)), + toUtf8Bytes(credDef), + ) + return tx.wait() + } + + public async created(id: string): Promise { + return this.instance.created(keccak256(toUtf8Bytes(id))) + } + + public async resolveCredentialDefinition(id: string): Promise { + const filer = await this.instance.filters.CredentialDefinitionCreated(keccak256(toUtf8Bytes(id))) + const events = await this.instance.queryFilter(filer) + return toUtf8String(getBytes(events[0].args[2])) } } diff --git a/smart_contracts/contracts-ts/EthereumDIDRegistry.ts b/smart_contracts/contracts-ts/EthereumExtDidRegistry.ts similarity index 83% rename from smart_contracts/contracts-ts/EthereumDIDRegistry.ts rename to smart_contracts/contracts-ts/EthereumExtDidRegistry.ts index ea36fe43..02d3f68d 100644 --- a/smart_contracts/contracts-ts/EthereumDIDRegistry.ts +++ b/smart_contracts/contracts-ts/EthereumExtDidRegistry.ts @@ -1,16 +1,21 @@ +import { encodeBytes32String, toUtf8Bytes } from 'ethers' import { Contract } from '../utils/contract' -export class EthereumDIDRegistry extends Contract { +export class EthereumExtDidRegistry extends Contract { public static readonly defaultAddress = '0x0000000000000000000000000000000000018888' constructor(sender?: any) { - super(EthereumDIDRegistry.name, sender) + super(EthereumExtDidRegistry.name, sender) } public async identityOwner(identity: string): Promise { return await this.instance.identityOwner(identity) } + public async changed(identity: string) { + return await this.instance.changed(identity) + } + public async changeOwner(identity: string, newOwner: string) { const tx = await this.instance.changeOwner(identity, newOwner) return tx.wait() @@ -30,13 +35,13 @@ export class EthereumDIDRegistry extends Contract { return tx.wait() } - public async setAttribute(identity: string, name: string, value: Uint8Array, validity: number) { - const tx = await this.instance.setAttribute(identity, name, value, validity) + public async setAttribute(identity: string, name: string, value: string, validity: number) { + const tx = await this.instance.setAttribute(identity, encodeBytes32String(name), toUtf8Bytes(value), validity) return tx.wait() } - public async revokeAttribute(identity: string, name: string, value: Uint8Array) { - const tx = await this.instance.revokeAttribute(identity, name, value) + public async revokeAttribute(identity: string, name: string, value: string) { + const tx = await this.instance.revokeAttribute(identity, encodeBytes32String(name), toUtf8Bytes(value)) return tx.wait() } diff --git a/smart_contracts/contracts-ts/SchemaRegistry.ts b/smart_contracts/contracts-ts/SchemaRegistry.ts index fb017ad5..41b5fba7 100644 --- a/smart_contracts/contracts-ts/SchemaRegistry.ts +++ b/smart_contracts/contracts-ts/SchemaRegistry.ts @@ -1,5 +1,6 @@ +import { getBytes, keccak256, Signature, toUtf8Bytes, toUtf8String } from 'ethers' +import { SchemaCreatedEvent } from '../typechain-types/contracts/cl/SchemaRegistryInterface' import { Contract } from '../utils/contract' -import { mapSchemaRecord, SchemaRecord } from './types' export class SchemaRegistry extends Contract { public static readonly defaultAddress = '0x0000000000000000000000000000000000005555' @@ -8,13 +9,30 @@ export class SchemaRegistry extends Contract { super(SchemaRegistry.name, sender) } - public async createSchema(id: string, issuerId: string, schema: string) { - const tx = await this.instance.createSchema(id, issuerId, schema) + public async createSchema(identity: string, id: string, schema: string) { + const tx = await this.instance.createSchema(identity, keccak256(toUtf8Bytes(id)), toUtf8Bytes(schema)) return tx.wait() } - public async resolveSchema(id: string): Promise { - const result = await this.instance.resolveSchema(id) - return mapSchemaRecord(result) + public async createSchemaSigned(identity: string, id: string, schema: string, signature: Signature) { + const tx = await this.instance.createSchemaSigned( + identity, + signature.v, + signature.r, + signature.s, + keccak256(toUtf8Bytes(id)), + toUtf8Bytes(schema), + ) + return tx.wait() + } + + public async created(id: string): Promise { + return this.instance.created(keccak256(toUtf8Bytes(id))) + } + + public async resolveSchema(schemaId: string): Promise { + const filer = await this.instance.filters.SchemaCreated(keccak256(toUtf8Bytes(schemaId))) + const events = await this.instance.queryFilter(filer) + return toUtf8String(getBytes(events[0].args[2])) } } diff --git a/smart_contracts/contracts-ts/index.ts b/smart_contracts/contracts-ts/index.ts index e322b9bf..5666ab2c 100644 --- a/smart_contracts/contracts-ts/index.ts +++ b/smart_contracts/contracts-ts/index.ts @@ -1,10 +1,7 @@ export * from './AccountControl' export * from './CredentialDefinitionRegistry' -export * from './IndyDidRegistry' -export * from './EthereumDIDRegistry' +export * from './EthereumExtDidRegistry' export * from './RoleControl' export * from './SchemaRegistry' -export * from './UniversalDidReolver' export * from './UpgradeControl' export * from './ValidatorControl' -export * from './types' diff --git a/smart_contracts/contracts/cl/CLRegistry.sol b/smart_contracts/contracts/cl/CLRegistry.sol index 8692d595..5e098a6f 100644 --- a/smart_contracts/contracts/cl/CLRegistry.sol +++ b/smart_contracts/contracts/cl/CLRegistry.sol @@ -1,34 +1,33 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.20; -import { DidNotFound, IncorrectDid } from "../did/DidErrors.sol"; -import { DidMetadata } from "../did/DidTypes.sol"; -import { UniversalDidResolverInterface } from "../did/UniversalDidResolverInterface.sol"; -import { Errors } from "../utils/Errors.sol"; -import { InvalidIssuerId, IssuerHasBeenDeactivated, IssuerNotFound, UnauthorizedIssuer } from "./ClErrors.sol"; +import { UnauthorizedIssuer } from "./ClErrors.sol"; +import { EthereumExtDidRegistry } from "../did/EthereumExtDidRegistry.sol"; contract CLRegistry { /** - * @dev Reference to the contract that resolves DIDs + * @dev Reference to the DID registry contract */ - UniversalDidResolverInterface internal _didResolver; + EthereumExtDidRegistry internal _didRegistry; - /** - * @dev Check that the Issuer DID exist, authorized for sender, and active. - * @param id The Issuer's DID. - */ - modifier _validIssuer(string memory id) { - try _didResolver.resolveMetadata(id) returns (DidMetadata memory metadata) { - if (msg.sender != metadata.owner && msg.sender != metadata.sender) { - revert UnauthorizedIssuer(msg.sender); - } - if (metadata.deactivated) revert IssuerHasBeenDeactivated(id); - } catch (bytes memory reason) { - if (Errors.equals(reason, DidNotFound.selector)) revert IssuerNotFound(id); - if (Errors.equals(reason, IncorrectDid.selector)) revert InvalidIssuerId(id); - - Errors.rethrow(reason); + modifier _validIssuer(address identity, address actor) { + if (actor != _didRegistry.identityOwner(identity)) { + revert UnauthorizedIssuer(identity, actor); } _; } + + function _checkSignature( + address identity, + bytes32 hash, + uint8 sigV, + bytes32 sigR, + bytes32 sigS + ) internal pure returns (address) { + address signer = ecrecover(hash, sigV, sigR, sigS); + if (identity != signer) { + revert UnauthorizedIssuer(identity, signer); + } + return signer; + } } diff --git a/smart_contracts/contracts/cl/ClErrors.sol b/smart_contracts/contracts/cl/ClErrors.sol index 76371fe4..d01b6324 100644 --- a/smart_contracts/contracts/cl/ClErrors.sol +++ b/smart_contracts/contracts/cl/ClErrors.sol @@ -1,66 +1,36 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.20; -/** - * @notice Error that occurs when the specified issuer is not found. - * @param id Issuer ID. - */ -error IssuerNotFound(string id); - -/** - * @notice Error that occurs when the provided issuer ID is invalid. - * @param id Issuer ID. - */ -error InvalidIssuerId(string id); - -/** - * @notice Error that occurs when attempting to perform an operation on a deactivated issuer. - * @param id Issuer ID. - */ -error IssuerHasBeenDeactivated(string id); - // Schema errors -/** - * @notice Error that occurs when the provided schema ID is invalid. - * @param id Schema ID. - */ -error InvalidSchemaId(string id); - /** * @notice Error that occurs when trying to create an already existing schema. * @param id Schema ID. */ -error SchemaAlreadyExist(string id); +error SchemaAlreadyExist(bytes32 id); /** * @notice Error that occurs when the specified schema is not found. * @param id Schema ID. */ -error SchemaNotFound(string id); +error SchemaNotFound(bytes32 id); // CredDef errors -/** - * @notice Error that occurs when the provided credential definition ID is invalid. - * @param id Credential definition ID. - */ -error InvalidCredentialDefinitionId(string id); - /** * @notice Error that occurs when trying to create an existing credential definition. * @param id Credential definition ID. */ -error CredentialDefinitionAlreadyExist(string id); +error CredentialDefinitionAlreadyExist(bytes32 id); /** * @notice Error that occurs when the specified credential definition is not found. * @param id Credential definition ID. */ -error CredentialDefinitionNotFound(string id); +error CredentialDefinitionNotFound(bytes32 id); /** * @notice Error that occurs when issuer DID of Schema or CredentialDefinition is not owned by sender. * @param sender Sender account address. */ -error UnauthorizedIssuer(address sender); +error UnauthorizedIssuer(address sender, address owner); diff --git a/smart_contracts/contracts/cl/CredentialDefinitionRegistry.sol b/smart_contracts/contracts/cl/CredentialDefinitionRegistry.sol index 91a60c62..5c03cb2f 100644 --- a/smart_contracts/contracts/cl/CredentialDefinitionRegistry.sol +++ b/smart_contracts/contracts/cl/CredentialDefinitionRegistry.sol @@ -1,17 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.20; -import { UniversalDidResolverInterface } from "../did/UniversalDidResolverInterface.sol"; import { ControlledUpgradeable } from "../upgrade/ControlledUpgradeable.sol"; -import { CredentialDefinitionRecord } from "./CredentialDefinitionTypes.sol"; import { CredentialDefinitionRegistryInterface } from "./CredentialDefinitionRegistryInterface.sol"; -import { CredentialDefinitionValidator } from "./CredentialDefinitionValidator.sol"; -import { CredentialDefinitionAlreadyExist, CredentialDefinitionNotFound } from "./ClErrors.sol"; +import { CredentialDefinitionAlreadyExist, SchemaNotFound } from "./ClErrors.sol"; import { CLRegistry } from "./CLRegistry.sol"; import { SchemaRegistryInterface } from "./SchemaRegistryInterface.sol"; - -using CredentialDefinitionValidator for string; +import { EthereumExtDidRegistry } from "../did/EthereumExtDidRegistry.sol"; contract CredentialDefinitionRegistry is CredentialDefinitionRegistryInterface, ControlledUpgradeable, CLRegistry { /** @@ -20,63 +16,79 @@ contract CredentialDefinitionRegistry is CredentialDefinitionRegistryInterface, SchemaRegistryInterface private _schemaRegistry; /** - * Mapping Credential Definition ID to its Credential Definition Details and Metadata. + * Mapping to track created credential definitions by their id to block number. */ - mapping(string id => CredentialDefinitionRecord credentialDefinitionRecord) private _credDefs; + mapping(bytes32 id => uint block) public created; /** * Checks the uniqueness of the credential definition ID */ - modifier _uniqueCredDefId(string memory id) { - if (_credDefs[id].metadata.created != 0) revert CredentialDefinitionAlreadyExist(id); - _; - } - - /** - * Checks that the credential definition exist - */ - modifier _credDefExist(string memory id) { - if (_credDefs[id].metadata.created == 0) revert CredentialDefinitionNotFound(id); + modifier _uniqueCredDefId(bytes32 id) { + if (created[id] != 0) revert CredentialDefinitionAlreadyExist(id); _; } /** - * Сhecks that the schema exist + * Checks that the schema exist */ - modifier _schemaExist(string memory id) { - _schemaRegistry.resolveSchema(id); + modifier _schemaExist(bytes32 id) { + if (_schemaRegistry.created(id) == 0) revert SchemaNotFound(id); _; } function initialize( address upgradeControlAddress, - address didResolverAddress, + address ethereumExtDidRegistry, address schemaRegistryAddress ) public reinitializer(1) { _initializeUpgradeControl(upgradeControlAddress); - _didResolver = UniversalDidResolverInterface(didResolverAddress); + _didRegistry = EthereumExtDidRegistry(ethereumExtDidRegistry); _schemaRegistry = SchemaRegistryInterface(schemaRegistryAddress); } /// @inheritdoc CredentialDefinitionRegistryInterface function createCredentialDefinition( - string calldata id, - string calldata issuerId, - string calldata schemaId, - string calldata credDef - ) public virtual _uniqueCredDefId(id) _schemaExist(schemaId) _validIssuer(issuerId) { - id.validateIdSyntax(issuerId, schemaId); - - _credDefs[id].credDef = credDef; - _credDefs[id].metadata.created = block.timestamp; - - emit CredentialDefinitionCreated(id); + address identity, + bytes32 id, + bytes32 schemaId, + bytes calldata credDef + ) public virtual { + _createCredentialDefinition(identity, msg.sender, id, schemaId, credDef); } /// @inheritdoc CredentialDefinitionRegistryInterface - function resolveCredentialDefinition( - string calldata id - ) public view virtual _credDefExist(id) returns (CredentialDefinitionRecord memory credentialDefinitionRecord) { - return _credDefs[id]; + function createCredentialDefinitionSigned( + address identity, + uint8 sigV, + bytes32 sigR, + bytes32 sigS, + bytes32 id, + bytes32 schemaId, + bytes calldata credDef + ) public virtual { + bytes32 hash = keccak256( + abi.encodePacked( + bytes1(0x19), + bytes1(0), + address(this), + identity, + "createCredentialDefinition", + id, + schemaId, + credDef + ) + ); + _createCredentialDefinition(identity, _checkSignature(identity, hash, sigV, sigR, sigS), id, schemaId, credDef); + } + + function _createCredentialDefinition( + address identity, + address actor, + bytes32 id, + bytes32 schemaId, + bytes calldata credDef + ) internal _uniqueCredDefId(id) _validIssuer(identity, actor) _schemaExist(schemaId) { + created[id] = block.number; + emit CredentialDefinitionCreated(id, actor, credDef); } } diff --git a/smart_contracts/contracts/cl/CredentialDefinitionRegistryInterface.sol b/smart_contracts/contracts/cl/CredentialDefinitionRegistryInterface.sol index 37497641..18e5248b 100644 --- a/smart_contracts/contracts/cl/CredentialDefinitionRegistryInterface.sol +++ b/smart_contracts/contracts/cl/CredentialDefinitionRegistryInterface.sol @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.20; -import { CredentialDefinitionRecord } from "./CredentialDefinitionTypes.sol"; - interface CredentialDefinitionRegistryInterface { /** - * @dev Event that is sent when a Credential Definition is created + * @dev Event that is sent when a Credential Definition is created. * - * @param credentialDefinitionId ID of created credential definition + * @param id KECCAK256 hash of credential definition id. + * @param identity Account address of credential definition issuer. + * @param credDef AnonCreds credential definition object as bytes. */ - event CredentialDefinitionCreated(string credentialDefinitionId); + event CredentialDefinitionCreated(bytes32 indexed id, address identity, bytes credDef); /** * @dev Creates a new Credential Definition. @@ -20,33 +20,53 @@ interface CredentialDefinitionRegistryInterface { * This function can revert with following errors: * - `CredentialDefinitionAlreadyExist`: Raised if Credential Definition with provided ID already exist. * - `SchemaNotFound`: Raised if the associated schema doesn't exist. - * - `IssuerNotFound`: Raised if the associated issuer doesn't exist. - * - `IssuerHasBeenDeactivated`: Raised if the associated issuer is not active. - * - `InvalidCredentialDefinitionId`: Raised if the Credential Definition ID syntax is invalid. * - `UnauthorizedIssuer`: Raised when an issuer DID specified in CredentialDefinition is not owned by sender * - * @param id Id of credential definition to be created. - * @param issuerId Id of credential definition issuer. - * @param schemaId Id of credential definition schema. - * @param credDef AnonCreds credential definition as JSON string. + * @param identity Account address of credential definition issuer. + * @param id KECCAK256 hash of credential definition id to be created. + * @param schemaId KECCAK256 hash of schema id. + * @param credDef AnonCreds credential definition object as bytes. */ function createCredentialDefinition( - string calldata id, - string calldata issuerId, - string calldata schemaId, - string calldata credDef + address identity, + bytes32 id, + bytes32 schemaId, + bytes calldata credDef ) external; /** - * @dev Resolve the Credential Definition associated with the given ID. + * @dev Endorse a new Credential Definition. + * + * Once the Credential Definition is created, this function emits a `CredentialDefinitionCreated` event + * with the new Credential Definition's ID. * - * If no matching Credential Definition is found, the function revert with `CredentialDefinitionNotFound` error + * This function can revert with following errors: + * - `CredentialDefinitionAlreadyExist`: Raised if Credential Definition with provided ID already exist. + * - `SchemaNotFound`: Raised if the associated schema doesn't exist. + * - `UnauthorizedIssuer`: Raised when an issuer DID specified in CredentialDefinition is not owned by sender * - * @param id The ID of the Credential Definition to be resolved. + * @param identity Account address of credential definition issuer. + * @param sigR Part of EcDSA signature. + * @param sigV Part of EcDSA signature. + * @param sigS Part of EcDSA signature. + * @param id KECCAK256 hash of credential definition id to be created. + * @param schemaId KECCAK256 hash of schema id. + * @param credDef AnonCreds credential definition object as bytes. + */ + function createCredentialDefinitionSigned( + address identity, + uint8 sigV, + bytes32 sigR, + bytes32 sigS, + bytes32 id, + bytes32 schemaId, + bytes calldata credDef + ) external; + + /** + * @dev Get the block number when a schema was created. * - * @return credentialDefinitionRecord Returns the credential definition with metadata. + * @param id KECCAK256 hash of credential definition id. */ - function resolveCredentialDefinition( - string calldata id - ) external returns (CredentialDefinitionRecord memory credentialDefinitionRecord); + function created(bytes32 id) external returns (uint256 block); } diff --git a/smart_contracts/contracts/cl/CredentialDefinitionTypes.sol b/smart_contracts/contracts/cl/CredentialDefinitionTypes.sol deleted file mode 100644 index 6811749d..00000000 --- a/smart_contracts/contracts/cl/CredentialDefinitionTypes.sol +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.20; - -/** - * @title CredentialDefinitionRecord - * @dev This struct holds the details of a credential definition - * and its associated metadata. - * - * @param credDef - Credential definition as a JSON string. - * @param metadata - Additional metadata associated with the credential definition. - */ -struct CredentialDefinitionRecord { - string credDef; - CredentialDefinitionMetadata metadata; -} - -/** - * @title CredentialDefinitionMetadata - * @dev This struct holds additional metadata for a credential definition. - * - * @param created - Timestamp indicating when the credential definition was created. - */ -struct CredentialDefinitionMetadata { - uint256 created; -} diff --git a/smart_contracts/contracts/cl/CredentialDefinitionValidator.sol b/smart_contracts/contracts/cl/CredentialDefinitionValidator.sol deleted file mode 100644 index a311f0c8..00000000 --- a/smart_contracts/contracts/cl/CredentialDefinitionValidator.sol +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.20; - -import { InvalidCredentialDefinitionId } from "./ClErrors.sol"; - -import { toSlice } from "@dk1a/solidity-stringutils/src/StrSlice.sol"; - -using { toSlice } for string; - -library CredentialDefinitionValidator { - string private constant _DELIMITER = "/"; - string private constant _CRED_DEF_ID_MIDDLE_PART = "/anoncreds/v0/CLAIM_DEF/"; - string private constant _ANONCREDS_TYPE = "CL"; - - /** - * @dev Validates the Credential Definition ID syntax - */ - function validateIdSyntax(string memory self, string calldata issuerId, string calldata schemaId) internal pure { - string memory credDefId = string.concat(issuerId, _CRED_DEF_ID_MIDDLE_PART, schemaId, _DELIMITER); - - if (!self.toSlice().startsWith(credDefId.toSlice())) revert InvalidCredentialDefinitionId(self); - } -} diff --git a/smart_contracts/contracts/cl/SchemaRegistry.sol b/smart_contracts/contracts/cl/SchemaRegistry.sol index a60f7106..dae52e7d 100644 --- a/smart_contracts/contracts/cl/SchemaRegistry.sol +++ b/smart_contracts/contracts/cl/SchemaRegistry.sol @@ -1,62 +1,59 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.20; -import { UniversalDidResolverInterface } from "../did/UniversalDidResolverInterface.sol"; import { ControlledUpgradeable } from "../upgrade/ControlledUpgradeable.sol"; -import { SchemaAlreadyExist, SchemaNotFound } from "./ClErrors.sol"; +import { SchemaAlreadyExist } from "./ClErrors.sol"; import { SchemaRegistryInterface } from "./SchemaRegistryInterface.sol"; -import { SchemaRecord } from "./SchemaTypes.sol"; -import { SchemaValidator } from "./SchemaValidator.sol"; import { CLRegistry } from "./CLRegistry.sol"; - -using SchemaValidator for string; +import { EthereumExtDidRegistry } from "../did/EthereumExtDidRegistry.sol"; contract SchemaRegistry is SchemaRegistryInterface, ControlledUpgradeable, CLRegistry { /** - * Mapping Schema ID to its Schema Details and Metadata. + * Mapping to track created schemas by their id to the block number when it was created. */ - mapping(string id => SchemaRecord SchemaRecord) private _schemas; + mapping(bytes32 id => uint block) public created; /** * Checks the uniqueness of the Schema ID */ - modifier _uniqueSchemaId(string memory id) { - if (_schemas[id].metadata.created != 0) revert SchemaAlreadyExist(id); - _; - } - - /** - * Checks that the Schema exist - */ - modifier _schemaExist(string memory id) { - if (_schemas[id].metadata.created == 0) revert SchemaNotFound(id); + modifier _uniqueSchemaId(bytes32 id) { + if (created[id] != 0) revert SchemaAlreadyExist(id); _; } - function initialize(address upgradeControlAddress, address didResolverAddress) public reinitializer(1) { + function initialize(address upgradeControlAddress, address ethereumExtDidRegistry) public reinitializer(1) { _initializeUpgradeControl(upgradeControlAddress); - _didResolver = UniversalDidResolverInterface(didResolverAddress); + _didRegistry = EthereumExtDidRegistry(ethereumExtDidRegistry); } /// @inheritdoc SchemaRegistryInterface - function createSchema( - string calldata id, - string calldata issuerId, - string calldata schema - ) public virtual _uniqueSchemaId(id) _validIssuer(issuerId) { - id.validateIdSyntax(issuerId); - - _schemas[id].schema = schema; - _schemas[id].metadata.created = block.timestamp; - - emit SchemaCreated(id); + function createSchema(address identity, bytes32 id, bytes calldata schema) public virtual { + _createSchema(identity, msg.sender, id, schema); } /// @inheritdoc SchemaRegistryInterface - function resolveSchema( - string calldata id - ) public view virtual _schemaExist(id) returns (SchemaRecord memory schemaRecord) { - return _schemas[id]; + function createSchemaSigned( + address identity, + uint8 sigV, + bytes32 sigR, + bytes32 sigS, + bytes32 id, + bytes calldata schema + ) public virtual { + bytes32 hash = keccak256( + abi.encodePacked(bytes1(0x19), bytes1(0), address(this), identity, "createSchema", id, schema) + ); + _createSchema(identity, _checkSignature(identity, hash, sigV, sigR, sigS), id, schema); + } + + function _createSchema( + address identity, + address actor, + bytes32 id, + bytes calldata schema + ) internal _uniqueSchemaId(id) _validIssuer(identity, actor) { + created[id] = block.number; + emit SchemaCreated(id, actor, schema); } } diff --git a/smart_contracts/contracts/cl/SchemaRegistryInterface.sol b/smart_contracts/contracts/cl/SchemaRegistryInterface.sol index 2a9ba4d4..c1c8f5cf 100644 --- a/smart_contracts/contracts/cl/SchemaRegistryInterface.sol +++ b/smart_contracts/contracts/cl/SchemaRegistryInterface.sol @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.20; -import { SchemaRecord } from "./SchemaTypes.sol"; - interface SchemaRegistryInterface { /** - * @dev Event that is sent when a Schema is created + * @dev Event that is sent when a Schema is created. * - * @param schemaId Created Schema ID + * @param id KECCAK256 hash of created schema id. + * @param identity Account address of schema issuer . + * @param schema AnonCreds schema object as bytes. */ - event SchemaCreated(string schemaId); + event SchemaCreated(bytes32 indexed id, address identity, bytes schema); /** * @dev Creates a new Schema. @@ -19,24 +19,44 @@ interface SchemaRegistryInterface { * * This function can revert with following errors: * - `SchemaAlreadyExist`: Raised if Schema with provided ID already exist. - * - `IssuerNotFound`: Raised if the associated issuer doesn't exist. - * - `IssuerHasBeenDeactivated`: Raised if the associated issuer is not active. * - `UnauthorizedIssuer`: Raised when an issuer DID specified in Schema is not owned by sender * - * @param id Id of schema to be created. - * @param issuerId Id of schema issuer. - * @param schema AnonCreds schema as JSON string. + * @param identity Account address of schema issuer. + * @param id KECCAK256 hash of schema id to be created. + * @param schema AnonCreds schema object as bytes. */ - function createSchema(string calldata id, string calldata issuerId, string calldata schema) external; + function createSchema(address identity, bytes32 id, bytes calldata schema) external; /** - * @dev Resolve the Schema associated with the given ID. + * @dev Endorse a new Schema. * - * If no matching Schema is found, the function revert with `SchemaNotFound` error + * Once the Schema is created, this function emits a `SchemaCreated` event + * with the new Schema ID. + * + * This function can revert with following errors: + * - `SchemaAlreadyExist`: Raised if Schema with provided ID already exist. + * - `UnauthorizedIssuer`: Raised when an issuer DID specified in Schema is not owned by sender * - * @param id The ID of the Schema to be resolved. + * @param identity Account address of schema issuer. + * @param sigV Part of EcDSA signature. + * @param sigR Part of EcDSA signature. + * @param sigS Part of EcDSA signature. + * @param id KECCAK256 hash of schema id to be created. + * @param schema AnonCreds schema object as bytes. + */ + function createSchemaSigned( + address identity, + uint8 sigV, + bytes32 sigR, + bytes32 sigS, + bytes32 id, + bytes calldata schema + ) external; + + /** + * @dev Get the block number when a schema was created. * - * @return schemaRecord Returns the Schema with Metadata. + * @param id KECCAK256 hash of schema id. */ - function resolveSchema(string calldata id) external returns (SchemaRecord memory schemaRecord); + function created(bytes32 id) external returns (uint256 block); } diff --git a/smart_contracts/contracts/cl/SchemaTypes.sol b/smart_contracts/contracts/cl/SchemaTypes.sol deleted file mode 100644 index 56688e0e..00000000 --- a/smart_contracts/contracts/cl/SchemaTypes.sol +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.20; - -/** - * @title SchemaRecord - * @dev This struct holds the details of a schema - * and its associated metadata. - * - * @param schema - Schema as a JSON string. - * @param metadata - Additional metadata associated with the schema. - */ -struct SchemaRecord { - string schema; - SchemaMetadata metadata; -} - -/** - * @title SchemaMetadata - * @dev This struct holds additional metadata for a schema. - * - * @param created - Timestamp indicating when the schema was created. - */ -struct SchemaMetadata { - uint256 created; -} diff --git a/smart_contracts/contracts/cl/SchemaValidator.sol b/smart_contracts/contracts/cl/SchemaValidator.sol deleted file mode 100644 index 7be6215d..00000000 --- a/smart_contracts/contracts/cl/SchemaValidator.sol +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.20; - -import { InvalidSchemaId } from "./ClErrors.sol"; - -import { toSlice } from "@dk1a/solidity-stringutils/src/StrSlice.sol"; - -using { toSlice } for string; - -library SchemaValidator { - string private constant _DELIMITER = "/"; - string private constant _SCHEMA_ID_MIDDLE_PART = "/anoncreds/v0/SCHEMA/"; - - /** - * @dev Validates the Schema ID syntax - */ - function validateIdSyntax(string memory self, string calldata issuerId) internal pure { - string memory schemaId = string.concat(issuerId, _SCHEMA_ID_MIDDLE_PART); - - if (!self.toSlice().startsWith(schemaId.toSlice())) revert InvalidSchemaId(self); - } -} diff --git a/smart_contracts/contracts/did/DidErrors.sol b/smart_contracts/contracts/did/DidErrors.sol deleted file mode 100644 index 4c0a5ae2..00000000 --- a/smart_contracts/contracts/did/DidErrors.sol +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.20; - -/** - * @dev Error that occurs when the specified DID is not found. - */ -error DidNotFound(string did); - -/** - * @dev Error that occurs when trying to create an already existing DID. - */ -error DidAlreadyExist(string did); - -/** - * @dev Error that occurs when trying to perform an operation with a deactivated DID. - */ -error DidHasBeenDeactivated(string did); - -/** - * @dev Error that occurs when message sender address is nether DID owner or original creator. - */ -error UnauthorizedSender(address sender); - -/** - * @dev Error that occurs when the specified DID is incorrect. - */ -error IncorrectDid(string did); diff --git a/smart_contracts/contracts/did/DidTypes.sol b/smart_contracts/contracts/did/DidTypes.sol deleted file mode 100644 index 6e6ede82..00000000 --- a/smart_contracts/contracts/did/DidTypes.sol +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.20; - -/** - * @dev DidRecord holds the DID Document and its associated metadata - */ -struct DidRecord { - string document; - DidMetadata metadata; -} - -/** - * @dev DidMetadata holds additional properties associated with the DID - */ -struct DidMetadata { - address owner; - address sender; - uint256 created; - uint256 updated; - bool deactivated; -} diff --git a/smart_contracts/contracts/did/IndyDidRegistry.sol b/smart_contracts/contracts/did/IndyDidRegistry.sol deleted file mode 100644 index ff581359..00000000 --- a/smart_contracts/contracts/did/IndyDidRegistry.sol +++ /dev/null @@ -1,90 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.20; - -import { ControlledUpgradeable } from "../upgrade/ControlledUpgradeable.sol"; - -import { DidAlreadyExist, DidHasBeenDeactivated, DidNotFound, UnauthorizedSender } from "./DidErrors.sol"; -import { IndyDidRegistryInterface } from "./IndyDidRegistryInterface.sol"; -import { DidRecord } from "./DidTypes.sol"; -import { IndyDidValidator } from "./IndyDidValidator.sol"; - -contract IndyDidRegistry is IndyDidRegistryInterface, ControlledUpgradeable { - /** - * @dev Mapping DID to its corresponding DID Document/Metadata. - */ - mapping(string did => DidRecord didRecord) private _dids; - - /** - * Checks that DID already exists - */ - modifier _didExist(string memory did) { - if (_dids[did].metadata.created == 0) revert DidNotFound(did); - _; - } - - /** - * Checks that the DID has not yet been added - */ - modifier _didNotExist(string memory did) { - if (_dids[did].metadata.created != 0) revert DidAlreadyExist(did); - _; - } - - /** - * Checks that the DID has not been deactivated - */ - modifier _didIsActive(string memory did) { - if (_dids[did].metadata.deactivated) revert DidHasBeenDeactivated(did); - _; - } - - /** - * Checks that method was called either by did owner or sender - */ - modifier _senderIsAuthorized(string memory did) { - // FIXME: once we add strict role and endorsement, the check here should be either owner or Trustee - if (msg.sender != _dids[did].metadata.owner && msg.sender != _dids[did].metadata.sender) - revert UnauthorizedSender(msg.sender); - _; - } - - function initialize(address upgradeControlAddress) public reinitializer(1) { - _initializeUpgradeControl(upgradeControlAddress); - } - - /// @inheritdoc IndyDidRegistryInterface - function createDid(address identity, string calldata did, string calldata document) public _didNotExist(did) { - IndyDidValidator.validateDidSyntax(did); - - _dids[did].document = document; - _dids[did].metadata.owner = identity; - _dids[did].metadata.sender = msg.sender; - _dids[did].metadata.created = block.timestamp; - _dids[did].metadata.updated = block.timestamp; - - emit DIDCreated(did); - } - - /// @inheritdoc IndyDidRegistryInterface - function updateDid( - string calldata did, - string calldata document - ) public _didExist(did) _didIsActive(did) _senderIsAuthorized(did) { - _dids[did].document = document; - _dids[did].metadata.updated = block.timestamp; - - emit DIDUpdated(did); - } - - /// @inheritdoc IndyDidRegistryInterface - function deactivateDid(string calldata did) public _didExist(did) _didIsActive(did) _senderIsAuthorized(did) { - _dids[did].metadata.deactivated = true; - - emit DIDDeactivated(did); - } - - /// @inheritdoc IndyDidRegistryInterface - function resolveDid(string calldata did) public view virtual _didExist(did) returns (DidRecord memory didRecord) { - return _dids[did]; - } -} diff --git a/smart_contracts/contracts/did/IndyDidRegistryInterface.sol b/smart_contracts/contracts/did/IndyDidRegistryInterface.sol deleted file mode 100644 index 3e8765eb..00000000 --- a/smart_contracts/contracts/did/IndyDidRegistryInterface.sol +++ /dev/null @@ -1,83 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.20; - -import { DidRecord } from "./DidTypes.sol"; - -/** - * @dev The interface that defines functions for managing DID documents. - */ -interface IndyDidRegistryInterface { - /** - * @dev Event that is sent when a DID Document is created. - * - * @param did Created DID. - */ - event DIDCreated(string did); - - /** - * @dev Event that is sent when a DID Document is updated. - * - * @param did Updated DID. - */ - event DIDUpdated(string did); - - /** - * @dev Event that is sent when a DID Document is deactivated. - * - * @param did Deactivated DID. - */ - event DIDDeactivated(string did); - - /** - * @dev Creates a new DID. - * - * @param identity Address of DID owner. - * @param did The new DID. - * @param document The new DID Document as JSON string. - */ - function createDid(address identity, string calldata did, string calldata document) external; - - /** - * @dev Updates an existing DID. - * - * Restrictions: - * - * - DID must not already exist; otherwise, will revert with a `DidAlreadyExist` error. - * - DID must be active; otherwise, will revert with a `DidHasBeenDeactivated` error. - * - Sender address must be equal either to DID owner or creator; otherwise, will revert with a `UnauthorizedSender` error. - * - * Events: - * - On successful DID update, will emit a `DIDUpdated` event. - * - * @param did The DID to update. - * @param document The updated DID Document as JSON string. - */ - function updateDid(string calldata did, string calldata document) external; - - /** - * @dev Deactivates a DID. - * - * Restrictions: - * - DID must be active; otherwise, will revert with a `DidHasBeenDeactivated` error. - * - DID must exist; otherwise, will revert with a `DidNotFound` error. - * - Sender address must be equal either to DID owner or creator; otherwise, will revert with a `UnauthorizedSender` error. - * - * Events: - * - On successful DID deactivation, will emit a `DIDDeactivated` event. - * - * @param did The DID to be deactivated. - */ - function deactivateDid(string calldata did) external; - - /** - * @dev Function to resolve DID Document for the given DID. - * - * Restrictions: - * - DID must exist; otherwise, will revert with a `DidNotFound` error. - * - * @param did The DID to be resolved. - * - * @return didRecord The resolved DID document associated with provided DID. - */ - function resolveDid(string calldata did) external view returns (DidRecord memory didRecord); -} diff --git a/smart_contracts/contracts/did/IndyDidValidator.sol b/smart_contracts/contracts/did/IndyDidValidator.sol deleted file mode 100644 index 2caa5ad5..00000000 --- a/smart_contracts/contracts/did/IndyDidValidator.sol +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.20; - -import { StringUtils } from "../utils/StringUtils.sol"; -import { DidUtils, ParsedDid } from "../utils/DidUtils.sol"; -import { IncorrectDid } from "./DidErrors.sol"; - -using StringUtils for string; - -library IndyDidValidator { - function validateDidSyntax(string memory did) public view { - ParsedDid memory parsedDid = DidUtils.parseDid(did); - - if (!DidUtils.isIndyMethod(parsedDid.method)) revert IncorrectDid(did); - - uint256 identifierLength = parsedDid.identifier.length(); - if (identifierLength != 21 && identifierLength != 22) revert IncorrectDid(did); - } -} diff --git a/smart_contracts/contracts/did/UniversalDidResolver.sol b/smart_contracts/contracts/did/UniversalDidResolver.sol deleted file mode 100644 index 9752a8f0..00000000 --- a/smart_contracts/contracts/did/UniversalDidResolver.sol +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.20; - -import { ControlledUpgradeable } from "../upgrade/ControlledUpgradeable.sol"; -import { UnsupportedOperation } from "../utils/Errors.sol"; -import { DidUtils, ParsedDid } from "../utils/DidUtils.sol"; -import { IncorrectDid } from "./DidErrors.sol"; -import { IndyDidRegistryInterface } from "./IndyDidRegistryInterface.sol"; -import { EthereumExtDidRegistry } from "./EthereumExtDidRegistry.sol"; -import { DidMetadata } from "./DidTypes.sol"; -import { UniversalDidResolverInterface } from "./UniversalDidResolverInterface.sol"; - -contract UniversalDidResolver is UniversalDidResolverInterface, ControlledUpgradeable { - IndyDidRegistryInterface internal _indyDidRegistry; - EthereumExtDidRegistry internal _ethereumDIDRegistry; - - function initialize( - address upgradeControlAddress, - address indyDidRegistry, - address ethereumDIDRegistryAddress - ) public reinitializer(1) { - _initializeUpgradeControl(upgradeControlAddress); - _indyDidRegistry = IndyDidRegistryInterface(indyDidRegistry); - _ethereumDIDRegistry = EthereumExtDidRegistry(ethereumDIDRegistryAddress); - } - - /// @inheritdoc UniversalDidResolverInterface - function resolveDocument(string calldata did) public view override returns (string memory document) { - ParsedDid memory parsedDid = DidUtils.parseDid(did); - - if (DidUtils.isIndyMethod(parsedDid.method)) { - return _indyDidRegistry.resolveDid(did).document; - } else { - revert UnsupportedOperation( - "UniversalDidResolver.resolveDocument", - string.concat("Unsupported DID Method: '", parsedDid.method, "'") - ); - } - } - - /// @inheritdoc UniversalDidResolverInterface - function resolveMetadata(string calldata did) public view override returns (DidMetadata memory metadata) { - ParsedDid memory parsedDid = DidUtils.parseDid(did); - - if (DidUtils.isEthereumMethod(parsedDid.method)) { - address identity = DidUtils.convertEthereumIdentifierToAddress(parsedDid.identifier); - - if (identity == address(0)) revert IncorrectDid(did); - - address identityOwner = _ethereumDIDRegistry.identityOwner(identity); - return DidMetadata(identityOwner, address(0), 0, 0, false); - } else if (DidUtils.isIndyMethod(parsedDid.method)) { - return _indyDidRegistry.resolveDid(did).metadata; - } else { - revert UnsupportedOperation( - "UniversalDidResolver.resolveMetadata", - string.concat("Unsupported DID Method: '", parsedDid.method, "'") - ); - } - } -} diff --git a/smart_contracts/contracts/did/UniversalDidResolverInterface.sol b/smart_contracts/contracts/did/UniversalDidResolverInterface.sol deleted file mode 100644 index 8306a05a..00000000 --- a/smart_contracts/contracts/did/UniversalDidResolverInterface.sol +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.20; - -import { DidMetadata } from "./DidTypes.sol"; - -/** - * @title The interface that defines functions to resolve DID from various DID registries - */ -interface UniversalDidResolverInterface { - /** - * @dev Function to resolve DID Document for the given DID. - * - * Restrictions: - * - DID must exist; otherwise, will revert with a `DidNotFound` error. - * - * @param did The DID to be resolved. - * - * @return document The resolved DID document associated with provided DID. - */ - function resolveDocument(string memory did) external view returns (string memory document); - - /** - * @dev Function to resolve DID Metadata for the given DID. - * - * Restrictions: - * - DID must exist; otherwise, will revert with a `DidNotFound` error. - * - * @param did The DID which metadata to be resolved. - * - * @return metadata The resolved DID metadata associated with provided DID. - */ - function resolveMetadata(string memory did) external view returns (DidMetadata memory metadata); -} diff --git a/smart_contracts/contracts/network/ValidatorControlInterface.sol b/smart_contracts/contracts/network/ValidatorControlInterface.sol index fbf04b74..89d54aa3 100644 --- a/smart_contracts/contracts/network/ValidatorControlInterface.sol +++ b/smart_contracts/contracts/network/ValidatorControlInterface.sol @@ -66,12 +66,6 @@ interface ValidatorControlInterface { */ error ValidatorNotFound(address validator); - /** - * @dev Gets the list of active validators. - * @return A array of the active validators. - */ - function getValidators() external view returns (address[] memory); - /** * @dev Adds a new validator to the list. * @@ -104,4 +98,10 @@ interface ValidatorControlInterface { * - On successful validator removal, will emit a `ValidatorRemoved` event. */ function removeValidator(address validator) external; + + /** + * @dev Gets the list of active validators. + * @return A array of the active validators. + */ + function getValidators() external view returns (address[] memory); } diff --git a/smart_contracts/contracts/utils/DidUtils.sol b/smart_contracts/contracts/utils/DidUtils.sol deleted file mode 100644 index 88fc4b63..00000000 --- a/smart_contracts/contracts/utils/DidUtils.sol +++ /dev/null @@ -1,88 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.20; - -import { StrSlice, toSlice } from "@dk1a/solidity-stringutils/src/StrSlice.sol"; -import { IncorrectDid } from "../did/DidErrors.sol"; -import { StringUtils } from "./StringUtils.sol"; - -string constant DID_ETHR_METHOD = "ethr"; -string constant DID_INDY_METHOD = "indy"; -string constant DID_INDY_2_METHOD = "indy2"; -string constant DID_SOV_METHOD = "sov"; - -struct ParsedDid { - string method; - string identifier; -} - -using { toSlice } for string; - -library DidUtils { - string private constant _DID_PREFIX = "did"; - string private constant _DID_DELIMETER = ":"; - uint16 private constant _ADDRESS_HEX_STRING_LENGTH = 22; - - /** - * @dev Parses a DID string and returns its components. - * @param did The DID string to be parsed. - * @return ParsedDid A struct containing the method and identifier of the DID. - */ - function parseDid(string memory did) internal view returns (ParsedDid memory) { - StrSlice didSlice = did.toSlice(); - StrSlice delimeterSlice = _DID_DELIMETER.toSlice(); - StrSlice component; - bool found; - - // Extract and check 'did' prefix. - (found, component, didSlice) = didSlice.splitOnce(delimeterSlice); - if (!found || !component.eq(_DID_PREFIX.toSlice())) revert IncorrectDid(did); - - // Extract the DID method. - (found, component, didSlice) = didSlice.splitOnce(delimeterSlice); - if (!found) revert IncorrectDid(did); - - ParsedDid memory parsedDid; - parsedDid.method = component.toString(); - - // Extract the DID identifier. - (, , component) = didSlice.rsplitOnce(_DID_DELIMETER.toSlice()); - parsedDid.identifier = component.toString(); - - return parsedDid; - } - - /** - * @dev Converts a given Ethereum identifier to an Ethereum address. - * @param identifier The Ethereum identifier to be converted. - * @return The Ethereum address derived from the identifier, or the zero address if the identifier is incorrect. - */ - function convertEthereumIdentifierToAddress(string memory identifier) internal view returns (address) { - if (!(StringUtils.length(identifier) != _ADDRESS_HEX_STRING_LENGTH)) return address(0); - - bytes memory identifierBytes = StringUtils.hexToBytes(identifier); - - return address(uint160(bytes20(identifierBytes))); - } - - /** - * @dev Checks if a given method string corresponds to the Ethereum method identifier. - * @param method The method string to check. - * @return Returns `true` if the method string matches the Ethereum method identifier, `false` otherwise. - */ - function isEthereumMethod(string memory method) internal pure returns (bool) { - return method.toSlice().eq(DID_ETHR_METHOD.toSlice()); - } - - /** - * @dev Checks if a given method string corresponds to any of the Indy method identifiers. - * @param method The method string to check. - * @return Returns `true` if the method string matches any of the Indy method identifiers, `false` otherwise. - */ - function isIndyMethod(string memory method) internal pure returns (bool) { - StrSlice methodSlice = method.toSlice(); - return - methodSlice.eq(DID_INDY_METHOD.toSlice()) || - methodSlice.eq(DID_INDY_2_METHOD.toSlice()) || - methodSlice.eq(DID_SOV_METHOD.toSlice()); - } -} diff --git a/smart_contracts/contracts/utils/Errors.sol b/smart_contracts/contracts/utils/Errors.sol index c0f892ea..2fbb5bc7 100644 --- a/smart_contracts/contracts/utils/Errors.sol +++ b/smart_contracts/contracts/utils/Errors.sol @@ -1,25 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.20; -/** - * @dev Error that occurs when a required field is not provided. - * @param name The name of the required field. - */ -error FieldRequired(string name); - -/** - * @dev Error that occurs when provided two or more fields, which should not be provided together - * @param names Names of the conflicting fields - */ -error ConflictingFields(string names); - -/** - * @dev Error that occurs when the operation is not supported or cannot be performed. - * @param operation Name of the operation being performed - * @param description A brief error descriptiion - */ -error UnsupportedOperation(string operation, string description); - /** * @title Errors * @dev A library that provides utility functions for error handling. diff --git a/smart_contracts/contracts/utils/StringUtils.sol b/smart_contracts/contracts/utils/StringUtils.sol index befad2ff..a03610c0 100644 --- a/smart_contracts/contracts/utils/StringUtils.sol +++ b/smart_contracts/contracts/utils/StringUtils.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.20; -import { StrSlice, toSlice } from "@dk1a/solidity-stringutils/src/StrSlice.sol"; +import { toSlice } from "@dk1a/solidity-stringutils/src/StrSlice.sol"; using { toSlice } for string; @@ -51,46 +51,4 @@ library StringUtils { function hasHexPrefix(string memory str) internal pure returns (bool) { return str.toSlice().startsWith(_HEX_PREFIX.toSlice()); } - - /** - * @dev Converts a hexadecimal string to bytes. - * @param hexString The hexadecimal string to be converted. - * @return The bytes represented by the hexadecimal string, or the zero bytes if the hex is incorrect. - */ - function hexToBytes(string memory hexString) internal view returns (bytes memory) { - StrSlice hexStringSlice = hexString.toSlice(); - StrSlice hexPrefixSlice = _HEX_PREFIX.toSlice(); - - // Check and remove hex prefix - if (!hexStringSlice.startsWith(_HEX_PREFIX.toSlice())) return _ZERO_BYTES; - hexString = hexStringSlice.stripPrefix(hexPrefixSlice).toString(); - - bytes memory hexStringBytes = bytes(hexString); - bytes memory resultBytes = new bytes(hexStringBytes.length / 2); - for (uint256 i = 0; i < resultBytes.length; i++) { - (uint8 firstByte, bool firstByteValid) = _hexCharToByte(hexStringBytes[2 * i]); - if (!firstByteValid) return _ZERO_BYTES; - - (uint8 secondByte, bool secondByteValid) = _hexCharToByte(hexStringBytes[2 * i + 1]); - if (!secondByteValid) return _ZERO_BYTES; - - resultBytes[i] = bytes1(firstByte * 16 + secondByte); - } - return resultBytes; - } - - /** - * Converts a single hexadecimal character to a byte - */ - function _hexCharToByte(bytes1 hexChar) private pure returns (uint8, bool) { - if (hexChar >= _ASCII_0 && hexChar <= _ASCII_9) { - return (uint8(hexChar) - uint8(_ASCII_0), true); - } else if (hexChar >= _ASCII_CAPITAL_A && hexChar <= _ASCII_CAPITAL_F) { - return (10 + uint8(hexChar) - uint8(_ASCII_CAPITAL_A), true); - } else if (hexChar >= _ASCII_SMALL_A && hexChar <= _ASCII_SMALL_F) { - return (10 + uint8(hexChar) - uint8(_ASCII_SMALL_A), true); - } else { - return (0, false); - } - } } diff --git a/smart_contracts/demos/flow-with-did-ethr.ts b/smart_contracts/demos/flow-with-did-ethr.ts deleted file mode 100644 index dca26e7e..00000000 --- a/smart_contracts/demos/flow-with-did-ethr.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { encodeBytes32String, toUtf8Bytes } from 'ethers' -import environment from '../environment' -import { Actor } from './utils/actor' -import { ROLES } from '../contracts-ts' -import { createCredentialDefinitionObject, createSchemaObject } from '../utils' -import assert from 'assert' - -async function demo() { - let receipt: any - - const trustee = await new Actor(environment.accounts.account1).init() - const faber = await new Actor().init() - const alice = await new Actor().init() - const unauthorized = await new Actor().init() - - console.log('1. Trustee assign ENDORSER role to Faber') - receipt = await trustee.roleControl.assignRole(ROLES.ENDORSER, faber.address) - console.log(`Role ${ROLES.ENDORSER} assigned to account ${faber.address}. Receipt: ${JSON.stringify(receipt)}`) - - console.log('2. Try set service attribute to DID document by an unauthorized account') - await assert.rejects( - unauthorized.ethereumDIDRegistry.setAttribute( - unauthorized.address, - encodeBytes32String('did/svc/did-communication'), - toUtf8Bytes('https://example.com'), - 86400, - ), - (err) => { - console.log(JSON.stringify(err)) - return true - }, - ) - - console.log('3. Faber sets service attribute to DID document (Optional)') - receipt = await faber.ethereumDIDRegistry.setAttribute( - faber.address, - encodeBytes32String('did/svc/did-communication'), - toUtf8Bytes('https://example.com'), - 86400, - ) - console.log(`Attribute created for id ${faber.address}. Receipt: ${JSON.stringify(receipt)}`) - - console.log("4. Faber creates a Test Schema using the 'did:ethr' DID as the issuer") - const { id: schemaId, schema } = createSchemaObject({ issuerId: faber.didEthr }) - receipt = await faber.schemaRegistry.createSchema(schemaId, faber.didEthr, schema) - console.log(`Schema created for id ${schemaId}. Receipt: ${JSON.stringify(receipt)}`) - - console.log('5. Faber resolves Test Schema to ensure its written') - const resolvedSchema = await faber.schemaRegistry.resolveSchema(schemaId) - console.log(`Schema resolved for ${schemaId}. Schema: ${resolvedSchema.schema}`) - - console.log("6. Faber create a Test Credential Definition using the 'did:ethr' DID as the issuer") - const { id: credentialDefinitionId, credDef: credentialDefinition } = createCredentialDefinitionObject({ - issuerId: faber.didEthr, - schemaId: schemaId, - }) - receipt = await faber.credentialDefinitionRegistry.createCredentialDefinition( - credentialDefinitionId, - faber.didEthr, - schemaId, - credentialDefinition, - ) - console.log(`Credential Definition created for id ${credentialDefinitionId}. Receipt: ${JSON.stringify(receipt)}`) - - console.log('7. Faber resolves Test Credential Definition to ensure its written') - const resolvedCredentialDefinition = await faber.credentialDefinitionRegistry.resolveCredentialDefinition( - credentialDefinitionId, - ) - console.log( - `Credential Definition resolved for ${credentialDefinitionId}. Credential Definition: ${resolvedCredentialDefinition.credDef}`, - ) - - console.log('8. Alice resolves Test Schema') - const testSchema = await alice.schemaRegistry.resolveSchema(schemaId) - console.log(`Schema resolved for ${schemaId}. Schema: ${testSchema.schema}`) - - console.log('9. Alice resolves Test Credential Definition') - const testCredentialDefinition = await alice.credentialDefinitionRegistry.resolveCredentialDefinition( - credentialDefinitionId, - ) - console.log( - `Credential Definition resolved for ${credentialDefinitionId}. Credential Definition: ${testCredentialDefinition.credDef}`, - ) -} - -if (require.main === module) { - demo() -} - -module.exports = exports = demo diff --git a/smart_contracts/demos/flow.ts b/smart_contracts/demos/flow.ts index 9567aff0..b102a9ce 100644 --- a/smart_contracts/demos/flow.ts +++ b/smart_contracts/demos/flow.ts @@ -2,6 +2,7 @@ import environment from '../environment' import { Actor } from './utils/actor' import { ROLES } from '../contracts-ts' import { createCredentialDefinitionObject, createSchemaObject } from '../utils' +import assert from 'assert' async function demo() { let receipt: any @@ -9,59 +10,71 @@ async function demo() { const trustee = await new Actor(environment.accounts.account1).init() const faber = await new Actor().init() const alice = await new Actor().init() + const unauthorized = await new Actor().init() console.log('1. Trustee assign ENDORSER role to Faber') receipt = await trustee.roleControl.assignRole(ROLES.ENDORSER, faber.address) console.log(`Role ${ROLES.ENDORSER} assigned to account ${faber.address}. Receipt: ${JSON.stringify(receipt)}`) - console.log('2. Faber creates DID Document') - receipt = await faber.didRegistry.createDid(faber.address, faber.did, faber.didDocument) - console.log(`Did Document created for DID ${faber.did}. Receipt: ${JSON.stringify(receipt)}`) + console.log('2. Try set service attribute to DID document by an unauthorized account') + await assert.rejects( + unauthorized.ethereumDIDRegistry.setAttribute( + unauthorized.address, + 'did/svc/did-communication', + 'https://example.com', + 86400, + ), + (err) => { + console.log(JSON.stringify(err)) + return true + }, + ) + + console.log('3. Faber sets service attribute to DID document (Optional)') + receipt = await faber.ethereumDIDRegistry.setAttribute( + faber.address, + 'did/svc/did-communication', + 'https://example.com', + 86400, + ) + console.log(`Attribute created for id ${faber.address}. Receipt: ${JSON.stringify(receipt)}`) - console.log('3. Faber creates Test Schema') - const { id: schemaId, schema } = createSchemaObject({ issuerId: faber.did }) - receipt = await faber.schemaRegistry.createSchema(schemaId, faber.did, schema) + console.log("4. Faber creates a Test Schema using the 'did:ethr' DID as the issuer") + const { id: schemaId, schema } = createSchemaObject({ issuer: faber.address }) + receipt = await faber.schemaRegistry.createSchema(faber.address, schemaId, schema) console.log(`Schema created for id ${schemaId}. Receipt: ${JSON.stringify(receipt)}`) - console.log('4. Faber resolves Test Schema to ensure its written') - const resolvedSchema = await faber.schemaRegistry.resolveSchema(schemaId) - console.log(`Schema resolved for ${schemaId}. Schema: ${resolvedSchema.schema}`) + console.log('5. Faber resolves Test Schema to ensure its written') + const resolvedSchema = await alice.schemaRegistry.resolveSchema(schemaId) + console.log(`Schema resolved for ${schemaId}. Schema: ${resolvedSchema}`) - console.log('5. Faber create Test Credential Definition') + console.log("6. Faber create a Test Credential Definition using the 'did:ethr' DID as the issuer") const { id: credentialDefinitionId, credDef: credentialDefinition } = createCredentialDefinitionObject({ - issuerId: faber.did, + issuer: faber.address, schemaId: schemaId, }) receipt = await faber.credentialDefinitionRegistry.createCredentialDefinition( + faber.address, credentialDefinitionId, - faber.did, schemaId, credentialDefinition, ) console.log(`Credential Definition created for id ${credentialDefinitionId}. Receipt: ${JSON.stringify(receipt)}`) - console.log('6. Trustee resolves Test Credential Definition to ensure its written') - const resolvedCredentialDefinition = await faber.credentialDefinitionRegistry.resolveCredentialDefinition( - credentialDefinitionId, - ) - console.log( - `Credential Definition resolved for ${credentialDefinitionId}. Credential Definition: ${resolvedCredentialDefinition.credDef}`, - ) - - console.log("7. ALice resolves Faber's Did Document") - const faberDidDocument = await alice.didRegistry.resolveDid(faber.did) - console.log(`Did Document resolved for ${faber.did}. DID Document: ${faberDidDocument?.document}`) + console.log('7. Faber resolves Test Credential Definition to ensure its written') + const resolvedCredDef = await faber.credentialDefinitionRegistry.resolveCredentialDefinition(credentialDefinitionId) + console.log(`Credential Definition resolved for ${credentialDefinitionId}. Credential Definition: ${resolvedCredDef}`) console.log('8. Alice resolves Test Schema') - const testSchema = await alice.schemaRegistry.resolveSchema(schemaId) - console.log(`Schema resolved for ${schemaId}. Schema: ${testSchema.schema}`) + const testResolvedSchema = await alice.schemaRegistry.resolveSchema(schemaId) + console.log(`Schema resolved for ${schemaId}. Schema: ${testResolvedSchema}`) console.log('9. Alice resolves Test Credential Definition') - const testCredentialDefinition = await alice.credentialDefinitionRegistry.resolveCredentialDefinition( + const testResolvedCredDef = await alice.credentialDefinitionRegistry.resolveCredentialDefinition( credentialDefinitionId, ) console.log( - `Credential Definition resolved for ${credentialDefinitionId}. Credential Definition: ${testCredentialDefinition.credDef}`, + `Credential Definition resolved for ${credentialDefinitionId}. Credential Definition: ${testResolvedCredDef}`, ) } diff --git a/smart_contracts/demos/utils/actor.ts b/smart_contracts/demos/utils/actor.ts index bdb7f59b..c1df3607 100644 --- a/smart_contracts/demos/utils/actor.ts +++ b/smart_contracts/demos/utils/actor.ts @@ -1,11 +1,10 @@ import { RoleControl, - IndyDidRegistry, SchemaRegistry, CredentialDefinitionRegistry, ValidatorControl, UpgradeControl, - EthereumDIDRegistry, + EthereumExtDidRegistry, } from '../../contracts-ts' import { Account, AccountInfo } from '../../utils' @@ -13,8 +12,7 @@ export class Actor { public account: Account public roleControl!: RoleControl public validatorControl!: ValidatorControl - public didRegistry!: IndyDidRegistry - public ethereumDIDRegistry!: EthereumDIDRegistry + public ethereumDIDRegistry!: EthereumExtDidRegistry public schemaRegistry!: SchemaRegistry public credentialDefinitionRegistry!: CredentialDefinitionRegistry public upgradeControl!: UpgradeControl @@ -26,9 +24,8 @@ export class Actor { public async init() { this.roleControl = await new RoleControl(this.account).getInstance(RoleControl.defaultAddress) this.validatorControl = await new ValidatorControl(this.account).getInstance(ValidatorControl.defaultAddress) - this.didRegistry = await new IndyDidRegistry(this.account).getInstance(IndyDidRegistry.defaultAddress) - this.ethereumDIDRegistry = await new EthereumDIDRegistry(this.account).getInstance( - EthereumDIDRegistry.defaultAddress, + this.ethereumDIDRegistry = await new EthereumExtDidRegistry(this.account).getInstance( + EthereumExtDidRegistry.defaultAddress, ) this.schemaRegistry = await new SchemaRegistry(this.account).getInstance(SchemaRegistry.defaultAddress) this.credentialDefinitionRegistry = await new CredentialDefinitionRegistry(this.account).getInstance( diff --git a/smart_contracts/package-lock.json b/smart_contracts/package-lock.json deleted file mode 100644 index 3f2cae92..00000000 --- a/smart_contracts/package-lock.json +++ /dev/null @@ -1,11363 +0,0 @@ -{ - "name": "@consensys-software/smart_contracts", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@consensys-software/smart_contracts", - "version": "1.0.0", - "license": "Apache-2.0", - "dependencies": { - "@ethereumjs/common": "^4.0.0", - "@ethereumjs/tx": "^5.0.0", - "@nomicfoundation/hardhat-ethers": "^3.0.0", - "@nomicfoundation/hardhat-network-helpers": "^1.0.0", - "@nomicfoundation/hardhat-toolbox": "^3.0.0", - "@nomicfoundation/hardhat-verify": "^1.0.0", - "async-promise-pool": "^1.0.6", - "ethers": "6.7.1", - "fs-extra": "^10.0.0", - "hardhat-gas-reporter": "^1.0.8", - "solc": "0.8.10", - "web3": "1.10.2", - "web3js-quorum": "22.4.0" - } - }, - "node_modules/@adraffy/ens-normalize": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.9.2.tgz", - "integrity": "sha512-0h+FrQDqe2Wn+IIGFkTCd4aAwTJ+7834Ek1COohCyV26AXhwQ7WQaz+4F/nLOeVl/3BtWHOHLPsq46V8YB46Eg==" - }, - "node_modules/@chainsafe/as-sha256": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz", - "integrity": "sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==", - "peer": true - }, - "node_modules/@chainsafe/persistent-merkle-tree": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz", - "integrity": "sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==", - "peer": true, - "dependencies": { - "@chainsafe/as-sha256": "^0.3.1" - } - }, - "node_modules/@chainsafe/ssz": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.9.4.tgz", - "integrity": "sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==", - "peer": true, - "dependencies": { - "@chainsafe/as-sha256": "^0.3.1", - "@chainsafe/persistent-merkle-tree": "^0.4.2", - "case": "^1.6.3" - } - }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "peer": true, - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@ethereumjs/common": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-4.0.0.tgz", - "integrity": "sha512-eVa0/nC15mpotD8HOq6jB883SCWUkLjibr2jLPmPrx4FfmewXqFeh4drgR2sHjq3qWKxpCLK+5qsSJgtXwIzJQ==", - "dependencies": { - "@ethereumjs/util": "^9.0.0", - "crc": "^4.3.2" - } - }, - "node_modules/@ethereumjs/rlp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-5.0.0.tgz", - "integrity": "sha512-WuS1l7GJmB0n0HsXLozCoEFc9IwYgf3l0gCkKVYgR67puVF1O4OpEaN0hWmm1c+iHUHFCKt1hJrvy5toLg+6ag==", - "bin": { - "rlp": "bin/rlp" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@ethereumjs/tx": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-5.0.0.tgz", - "integrity": "sha512-bJBC/jHVIbwvZBVsK0Ls70NzxJ8Q3UvPwskG1LO6+ryVGKY0y1bhRreo0/gR3vTkuRjD+x5QTYV6fIY16tswJA==", - "dependencies": { - "@ethereumjs/common": "^4.0.0", - "@ethereumjs/rlp": "^5.0.0", - "@ethereumjs/util": "^9.0.0", - "ethereum-cryptography": "^2.1.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "c-kzg": "^2.1.0" - }, - "peerDependenciesMeta": { - "c-kzg": { - "optional": true - } - } - }, - "node_modules/@ethereumjs/util": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-9.0.0.tgz", - "integrity": "sha512-V8062I+ZXfFxtFLp7xsPeiT1IxDaVOZaM78nGj1gsWUFeZ8SgADMLDKWehp+muTy1JRbVoXFljZ1qoyv9ji/2g==", - "dependencies": { - "@ethereumjs/rlp": "^5.0.0", - "ethereum-cryptography": "^2.1.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "c-kzg": "^2.1.0" - }, - "peerDependenciesMeta": { - "c-kzg": { - "optional": true - } - } - }, - "node_modules/@ethersproject/abi": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", - "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } - }, - "node_modules/@ethersproject/abstract-provider": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", - "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/networks": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/web": "^5.7.0" - } - }, - "node_modules/@ethersproject/abstract-signer": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", - "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0" - } - }, - "node_modules/@ethersproject/address": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", - "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/rlp": "^5.7.0" - } - }, - "node_modules/@ethersproject/base64": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", - "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0" - } - }, - "node_modules/@ethersproject/basex": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", - "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "peer": true, - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/properties": "^5.7.0" - } - }, - "node_modules/@ethersproject/bignumber": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", - "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "bn.js": "^5.2.1" - } - }, - "node_modules/@ethersproject/bytes": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", - "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/logger": "^5.7.0" - } - }, - "node_modules/@ethersproject/constants": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", - "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bignumber": "^5.7.0" - } - }, - "node_modules/@ethersproject/contracts": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", - "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "peer": true, - "dependencies": { - "@ethersproject/abi": "^5.7.0", - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/transactions": "^5.7.0" - } - }, - "node_modules/@ethersproject/hash": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", - "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/base64": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } - }, - "node_modules/@ethersproject/hdnode": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", - "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "peer": true, - "dependencies": { - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/basex": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/pbkdf2": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/sha2": "^5.7.0", - "@ethersproject/signing-key": "^5.7.0", - "@ethersproject/strings": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/wordlists": "^5.7.0" - } - }, - "node_modules/@ethersproject/json-wallets": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", - "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "peer": true, - "dependencies": { - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/hdnode": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/pbkdf2": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/random": "^5.7.0", - "@ethersproject/strings": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "aes-js": "3.0.0", - "scrypt-js": "3.0.1" - } - }, - "node_modules/@ethersproject/json-wallets/node_modules/aes-js": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", - "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==", - "peer": true - }, - "node_modules/@ethersproject/keccak256": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", - "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "js-sha3": "0.8.0" - } - }, - "node_modules/@ethersproject/logger": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", - "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ] - }, - "node_modules/@ethersproject/networks": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", - "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/logger": "^5.7.0" - } - }, - "node_modules/@ethersproject/pbkdf2": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", - "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "peer": true, - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/sha2": "^5.7.0" - } - }, - "node_modules/@ethersproject/properties": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", - "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/logger": "^5.7.0" - } - }, - "node_modules/@ethersproject/providers": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", - "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "peer": true, - "dependencies": { - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/base64": "^5.7.0", - "@ethersproject/basex": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/networks": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/random": "^5.7.0", - "@ethersproject/rlp": "^5.7.0", - "@ethersproject/sha2": "^5.7.0", - "@ethersproject/strings": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/web": "^5.7.0", - "bech32": "1.1.4", - "ws": "7.4.6" - } - }, - "node_modules/@ethersproject/providers/node_modules/ws": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", - "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", - "peer": true, - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/@ethersproject/random": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", - "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "peer": true, - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0" - } - }, - "node_modules/@ethersproject/rlp": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", - "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0" - } - }, - "node_modules/@ethersproject/sha2": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", - "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "peer": true, - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "hash.js": "1.1.7" - } - }, - "node_modules/@ethersproject/signing-key": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", - "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "bn.js": "^5.2.1", - "elliptic": "6.5.4", - "hash.js": "1.1.7" - } - }, - "node_modules/@ethersproject/solidity": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", - "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "peer": true, - "dependencies": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/sha2": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } - }, - "node_modules/@ethersproject/strings": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", - "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/logger": "^5.7.0" - } - }, - "node_modules/@ethersproject/transactions": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", - "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/rlp": "^5.7.0", - "@ethersproject/signing-key": "^5.7.0" - } - }, - "node_modules/@ethersproject/units": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", - "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "peer": true, - "dependencies": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/logger": "^5.7.0" - } - }, - "node_modules/@ethersproject/wallet": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", - "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "peer": true, - "dependencies": { - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/hdnode": "^5.7.0", - "@ethersproject/json-wallets": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/random": "^5.7.0", - "@ethersproject/signing-key": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/wordlists": "^5.7.0" - } - }, - "node_modules/@ethersproject/web": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", - "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/base64": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } - }, - "node_modules/@ethersproject/wordlists": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", - "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "peer": true, - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "peer": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "peer": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "peer": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, - "node_modules/@metamask/eth-sig-util": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz", - "integrity": "sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==", - "peer": true, - "dependencies": { - "ethereumjs-abi": "^0.6.8", - "ethereumjs-util": "^6.2.1", - "ethjs-util": "^0.1.6", - "tweetnacl": "^1.0.3", - "tweetnacl-util": "^0.15.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/@metamask/eth-sig-util/node_modules/@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "peer": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@metamask/eth-sig-util/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "peer": true - }, - "node_modules/@metamask/eth-sig-util/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "peer": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@metamask/eth-sig-util/node_modules/ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "peer": true, - "dependencies": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - }, - "node_modules/@noble/curves": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz", - "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==", - "dependencies": { - "@noble/hashes": "1.3.1" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/hashes": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", - "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/secp256k1": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz", - "integrity": "sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ] - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "peer": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "peer": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "peer": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nomicfoundation/ethereumjs-block": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.2.tgz", - "integrity": "sha512-hSe6CuHI4SsSiWWjHDIzWhSiAVpzMUcDRpWYzN0T9l8/Rz7xNn3elwVOJ/tAyS0LqL6vitUD78Uk7lQDXZun7Q==", - "peer": true, - "dependencies": { - "@nomicfoundation/ethereumjs-common": "4.0.2", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "@nomicfoundation/ethereumjs-trie": "6.0.2", - "@nomicfoundation/ethereumjs-tx": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "ethereum-cryptography": "0.1.3", - "ethers": "^5.7.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-block/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "peer": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-block/node_modules/ethers": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", - "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "peer": true, - "dependencies": { - "@ethersproject/abi": "5.7.0", - "@ethersproject/abstract-provider": "5.7.0", - "@ethersproject/abstract-signer": "5.7.0", - "@ethersproject/address": "5.7.0", - "@ethersproject/base64": "5.7.0", - "@ethersproject/basex": "5.7.0", - "@ethersproject/bignumber": "5.7.0", - "@ethersproject/bytes": "5.7.0", - "@ethersproject/constants": "5.7.0", - "@ethersproject/contracts": "5.7.0", - "@ethersproject/hash": "5.7.0", - "@ethersproject/hdnode": "5.7.0", - "@ethersproject/json-wallets": "5.7.0", - "@ethersproject/keccak256": "5.7.0", - "@ethersproject/logger": "5.7.0", - "@ethersproject/networks": "5.7.1", - "@ethersproject/pbkdf2": "5.7.0", - "@ethersproject/properties": "5.7.0", - "@ethersproject/providers": "5.7.2", - "@ethersproject/random": "5.7.0", - "@ethersproject/rlp": "5.7.0", - "@ethersproject/sha2": "5.7.0", - "@ethersproject/signing-key": "5.7.0", - "@ethersproject/solidity": "5.7.0", - "@ethersproject/strings": "5.7.0", - "@ethersproject/transactions": "5.7.0", - "@ethersproject/units": "5.7.0", - "@ethersproject/wallet": "5.7.0", - "@ethersproject/web": "5.7.1", - "@ethersproject/wordlists": "5.7.0" - } - }, - "node_modules/@nomicfoundation/ethereumjs-blockchain": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.2.tgz", - "integrity": "sha512-8UUsSXJs+MFfIIAKdh3cG16iNmWzWC/91P40sazNvrqhhdR/RtGDlFk2iFTGbBAZPs2+klZVzhRX8m2wvuvz3w==", - "peer": true, - "dependencies": { - "@nomicfoundation/ethereumjs-block": "5.0.2", - "@nomicfoundation/ethereumjs-common": "4.0.2", - "@nomicfoundation/ethereumjs-ethash": "3.0.2", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "@nomicfoundation/ethereumjs-trie": "6.0.2", - "@nomicfoundation/ethereumjs-tx": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "abstract-level": "^1.0.3", - "debug": "^4.3.3", - "ethereum-cryptography": "0.1.3", - "level": "^8.0.0", - "lru-cache": "^5.1.1", - "memory-level": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-blockchain/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "peer": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-common": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.2.tgz", - "integrity": "sha512-I2WGP3HMGsOoycSdOTSqIaES0ughQTueOsddJ36aYVpI3SN8YSusgRFLwzDJwRFVIYDKx/iJz0sQ5kBHVgdDwg==", - "peer": true, - "dependencies": { - "@nomicfoundation/ethereumjs-util": "9.0.2", - "crc-32": "^1.2.0" - } - }, - "node_modules/@nomicfoundation/ethereumjs-ethash": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.2.tgz", - "integrity": "sha512-8PfoOQCcIcO9Pylq0Buijuq/O73tmMVURK0OqdjhwqcGHYC2PwhbajDh7GZ55ekB0Px197ajK3PQhpKoiI/UPg==", - "peer": true, - "dependencies": { - "@nomicfoundation/ethereumjs-block": "5.0.2", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "abstract-level": "^1.0.3", - "bigint-crypto-utils": "^3.0.23", - "ethereum-cryptography": "0.1.3" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-ethash/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "peer": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-evm": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.2.tgz", - "integrity": "sha512-rBLcUaUfANJxyOx9HIdMX6uXGin6lANCulIm/pjMgRqfiCRMZie3WKYxTSd8ZE/d+qT+zTedBF4+VHTdTSePmQ==", - "peer": true, - "dependencies": { - "@ethersproject/providers": "^5.7.1", - "@nomicfoundation/ethereumjs-common": "4.0.2", - "@nomicfoundation/ethereumjs-tx": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "debug": "^4.3.3", - "ethereum-cryptography": "0.1.3", - "mcl-wasm": "^0.7.1", - "rustbn.js": "~0.2.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-evm/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "peer": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-rlp": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.2.tgz", - "integrity": "sha512-QwmemBc+MMsHJ1P1QvPl8R8p2aPvvVcKBbvHnQOKBpBztEo0omN0eaob6FeZS/e3y9NSe+mfu3nNFBHszqkjTA==", - "peer": true, - "bin": { - "rlp": "bin/rlp" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-statemanager": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.2.tgz", - "integrity": "sha512-dlKy5dIXLuDubx8Z74sipciZnJTRSV/uHG48RSijhgm1V7eXYFC567xgKtsKiVZB1ViTP9iFL4B6Je0xD6X2OA==", - "peer": true, - "dependencies": { - "@nomicfoundation/ethereumjs-common": "4.0.2", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "debug": "^4.3.3", - "ethereum-cryptography": "0.1.3", - "ethers": "^5.7.1", - "js-sdsl": "^4.1.4" - } - }, - "node_modules/@nomicfoundation/ethereumjs-statemanager/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "peer": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-statemanager/node_modules/ethers": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", - "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "peer": true, - "dependencies": { - "@ethersproject/abi": "5.7.0", - "@ethersproject/abstract-provider": "5.7.0", - "@ethersproject/abstract-signer": "5.7.0", - "@ethersproject/address": "5.7.0", - "@ethersproject/base64": "5.7.0", - "@ethersproject/basex": "5.7.0", - "@ethersproject/bignumber": "5.7.0", - "@ethersproject/bytes": "5.7.0", - "@ethersproject/constants": "5.7.0", - "@ethersproject/contracts": "5.7.0", - "@ethersproject/hash": "5.7.0", - "@ethersproject/hdnode": "5.7.0", - "@ethersproject/json-wallets": "5.7.0", - "@ethersproject/keccak256": "5.7.0", - "@ethersproject/logger": "5.7.0", - "@ethersproject/networks": "5.7.1", - "@ethersproject/pbkdf2": "5.7.0", - "@ethersproject/properties": "5.7.0", - "@ethersproject/providers": "5.7.2", - "@ethersproject/random": "5.7.0", - "@ethersproject/rlp": "5.7.0", - "@ethersproject/sha2": "5.7.0", - "@ethersproject/signing-key": "5.7.0", - "@ethersproject/solidity": "5.7.0", - "@ethersproject/strings": "5.7.0", - "@ethersproject/transactions": "5.7.0", - "@ethersproject/units": "5.7.0", - "@ethersproject/wallet": "5.7.0", - "@ethersproject/web": "5.7.1", - "@ethersproject/wordlists": "5.7.0" - } - }, - "node_modules/@nomicfoundation/ethereumjs-trie": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.2.tgz", - "integrity": "sha512-yw8vg9hBeLYk4YNg5MrSJ5H55TLOv2FSWUTROtDtTMMmDGROsAu+0tBjiNGTnKRi400M6cEzoFfa89Fc5k8NTQ==", - "peer": true, - "dependencies": { - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "@types/readable-stream": "^2.3.13", - "ethereum-cryptography": "0.1.3", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-trie/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "peer": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-tx": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.2.tgz", - "integrity": "sha512-T+l4/MmTp7VhJeNloMkM+lPU3YMUaXdcXgTGCf8+ZFvV9NYZTRLFekRwlG6/JMmVfIfbrW+dRRJ9A6H5Q/Z64g==", - "peer": true, - "dependencies": { - "@chainsafe/ssz": "^0.9.2", - "@ethersproject/providers": "^5.7.2", - "@nomicfoundation/ethereumjs-common": "4.0.2", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "ethereum-cryptography": "0.1.3" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-tx/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "peer": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-util": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.2.tgz", - "integrity": "sha512-4Wu9D3LykbSBWZo8nJCnzVIYGvGCuyiYLIJa9XXNVt1q1jUzHdB+sJvx95VGCpPkCT+IbLecW6yfzy3E1bQrwQ==", - "peer": true, - "dependencies": { - "@chainsafe/ssz": "^0.10.0", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "ethereum-cryptography": "0.1.3" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-util/node_modules/@chainsafe/persistent-merkle-tree": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz", - "integrity": "sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw==", - "peer": true, - "dependencies": { - "@chainsafe/as-sha256": "^0.3.1" - } - }, - "node_modules/@nomicfoundation/ethereumjs-util/node_modules/@chainsafe/ssz": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.10.2.tgz", - "integrity": "sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg==", - "peer": true, - "dependencies": { - "@chainsafe/as-sha256": "^0.3.1", - "@chainsafe/persistent-merkle-tree": "^0.5.0" - } - }, - "node_modules/@nomicfoundation/ethereumjs-util/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "peer": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-vm": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.2.tgz", - "integrity": "sha512-Bj3KZT64j54Tcwr7Qm/0jkeZXJMfdcAtRBedou+Hx0dPOSIgqaIr0vvLwP65TpHbak2DmAq+KJbW2KNtIoFwvA==", - "peer": true, - "dependencies": { - "@nomicfoundation/ethereumjs-block": "5.0.2", - "@nomicfoundation/ethereumjs-blockchain": "7.0.2", - "@nomicfoundation/ethereumjs-common": "4.0.2", - "@nomicfoundation/ethereumjs-evm": "2.0.2", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "@nomicfoundation/ethereumjs-statemanager": "2.0.2", - "@nomicfoundation/ethereumjs-trie": "6.0.2", - "@nomicfoundation/ethereumjs-tx": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "debug": "^4.3.3", - "ethereum-cryptography": "0.1.3", - "mcl-wasm": "^0.7.1", - "rustbn.js": "~0.2.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-vm/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "peer": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/hardhat-chai-matchers": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.2.tgz", - "integrity": "sha512-9Wu9mRtkj0U9ohgXYFbB/RQDa+PcEdyBm2suyEtsJf3PqzZEEjLUZgWnMjlFhATMk/fp3BjmnYVPrwl+gr8oEw==", - "peer": true, - "dependencies": { - "@types/chai-as-promised": "^7.1.3", - "chai-as-promised": "^7.1.1", - "deep-eql": "^4.0.1", - "ordinal": "^1.0.3" - }, - "peerDependencies": { - "@nomicfoundation/hardhat-ethers": "^3.0.0", - "chai": "^4.2.0", - "ethers": "^6.1.0", - "hardhat": "^2.9.4" - } - }, - "node_modules/@nomicfoundation/hardhat-ethers": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.4.tgz", - "integrity": "sha512-k9qbLoY7qn6C6Y1LI0gk2kyHXil2Tauj4kGzQ8pgxYXIGw8lWn8tuuL72E11CrlKaXRUvOgF0EXrv/msPI2SbA==", - "dependencies": { - "debug": "^4.1.1", - "lodash.isequal": "^4.5.0" - }, - "peerDependencies": { - "ethers": "^6.1.0", - "hardhat": "^2.0.0" - } - }, - "node_modules/@nomicfoundation/hardhat-network-helpers": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.9.tgz", - "integrity": "sha512-OXWCv0cHpwLUO2u7bFxBna6dQtCC2Gg/aN/KtJLO7gmuuA28vgmVKYFRCDUqrbjujzgfwQ2aKyZ9Y3vSmDqS7Q==", - "dependencies": { - "ethereumjs-util": "^7.1.4" - }, - "peerDependencies": { - "hardhat": "^2.9.5" - } - }, - "node_modules/@nomicfoundation/hardhat-toolbox": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-3.0.0.tgz", - "integrity": "sha512-MsteDXd0UagMksqm9KvcFG6gNKYNa3GGNCy73iQ6bEasEgg2v8Qjl6XA5hjs8o5UD5A3153B6W2BIVJ8SxYUtA==", - "peerDependencies": { - "@nomicfoundation/hardhat-chai-matchers": "^2.0.0", - "@nomicfoundation/hardhat-ethers": "^3.0.0", - "@nomicfoundation/hardhat-network-helpers": "^1.0.0", - "@nomicfoundation/hardhat-verify": "^1.0.0", - "@typechain/ethers-v6": "^0.4.0", - "@typechain/hardhat": "^8.0.0", - "@types/chai": "^4.2.0", - "@types/mocha": ">=9.1.0", - "@types/node": ">=12.0.0", - "chai": "^4.2.0", - "ethers": "^6.4.0", - "hardhat": "^2.11.0", - "hardhat-gas-reporter": "^1.0.8", - "solidity-coverage": "^0.8.1", - "ts-node": ">=8.0.0", - "typechain": "^8.2.0", - "typescript": ">=4.5.0" - } - }, - "node_modules/@nomicfoundation/hardhat-verify": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-verify/-/hardhat-verify-1.1.1.tgz", - "integrity": "sha512-9QsTYD7pcZaQFEA3tBb/D/oCStYDiEVDN7Dxeo/4SCyHRSm86APypxxdOMEPlGmXsAvd+p1j/dTODcpxb8aztA==", - "dependencies": { - "@ethersproject/abi": "^5.1.2", - "@ethersproject/address": "^5.0.2", - "cbor": "^8.1.0", - "chalk": "^2.4.2", - "debug": "^4.1.1", - "lodash.clonedeep": "^4.5.0", - "semver": "^6.3.0", - "table": "^6.8.0", - "undici": "^5.14.0" - }, - "peerDependencies": { - "hardhat": "^2.0.4" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.1.tgz", - "integrity": "sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg==", - "peer": true, - "engines": { - "node": ">= 12" - }, - "optionalDependencies": { - "@nomicfoundation/solidity-analyzer-darwin-arm64": "0.1.1", - "@nomicfoundation/solidity-analyzer-darwin-x64": "0.1.1", - "@nomicfoundation/solidity-analyzer-freebsd-x64": "0.1.1", - "@nomicfoundation/solidity-analyzer-linux-arm64-gnu": "0.1.1", - "@nomicfoundation/solidity-analyzer-linux-arm64-musl": "0.1.1", - "@nomicfoundation/solidity-analyzer-linux-x64-gnu": "0.1.1", - "@nomicfoundation/solidity-analyzer-linux-x64-musl": "0.1.1", - "@nomicfoundation/solidity-analyzer-win32-arm64-msvc": "0.1.1", - "@nomicfoundation/solidity-analyzer-win32-ia32-msvc": "0.1.1", - "@nomicfoundation/solidity-analyzer-win32-x64-msvc": "0.1.1" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer-darwin-arm64": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz", - "integrity": "sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "peer": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer-darwin-x64": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.1.tgz", - "integrity": "sha512-XhQG4BaJE6cIbjAVtzGOGbK3sn1BO9W29uhk9J8y8fZF1DYz0Doj8QDMfpMu+A6TjPDs61lbsmeYodIDnfveSA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "peer": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer-freebsd-x64": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-freebsd-x64/-/solidity-analyzer-freebsd-x64-0.1.1.tgz", - "integrity": "sha512-GHF1VKRdHW3G8CndkwdaeLkVBi5A9u2jwtlS7SLhBc8b5U/GcoL39Q+1CSO3hYqePNP+eV5YI7Zgm0ea6kMHoA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "peer": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer-linux-arm64-gnu": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.1.tgz", - "integrity": "sha512-g4Cv2fO37ZsUENQ2vwPnZc2zRenHyAxHcyBjKcjaSmmkKrFr64yvzeNO8S3GBFCo90rfochLs99wFVGT/0owpg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer-linux-arm64-musl": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.1.tgz", - "integrity": "sha512-WJ3CE5Oek25OGE3WwzK7oaopY8xMw9Lhb0mlYuJl/maZVo+WtP36XoQTb7bW/i8aAdHW5Z+BqrHMux23pvxG3w==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-gnu": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.1.tgz", - "integrity": "sha512-5WN7leSr5fkUBBjE4f3wKENUy9HQStu7HmWqbtknfXkkil+eNWiBV275IOlpXku7v3uLsXTOKpnnGHJYI2qsdA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-musl": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.1.tgz", - "integrity": "sha512-KdYMkJOq0SYPQMmErv/63CwGwMm5XHenEna9X9aB8mQmhDBrYrlAOSsIPgFCUSL0hjxE3xHP65/EPXR/InD2+w==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer-win32-arm64-msvc": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-arm64-msvc/-/solidity-analyzer-win32-arm64-msvc-0.1.1.tgz", - "integrity": "sha512-VFZASBfl4qiBYwW5xeY20exWhmv6ww9sWu/krWSesv3q5hA0o1JuzmPHR4LPN6SUZj5vcqci0O6JOL8BPw+APg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "peer": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer-win32-ia32-msvc": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-ia32-msvc/-/solidity-analyzer-win32-ia32-msvc-0.1.1.tgz", - "integrity": "sha512-JnFkYuyCSA70j6Si6cS1A9Gh1aHTEb8kOTBApp/c7NRTFGNMH8eaInKlyuuiIbvYFhlXW4LicqyYuWNNq9hkpQ==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "peer": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer-win32-x64-msvc": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.1.tgz", - "integrity": "sha512-HrVJr6+WjIXGnw3Q9u6KQcbZCtk0caVWhCdFADySvRyUxJ8PnzlaP+MhwNE8oyT8OZ6ejHBRrrgjSqDCFXGirw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "peer": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@scure/base": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.3.tgz", - "integrity": "sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==", - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip32": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.1.tgz", - "integrity": "sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A==", - "dependencies": { - "@noble/curves": "~1.1.0", - "@noble/hashes": "~1.3.1", - "@scure/base": "~1.1.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip39": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", - "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", - "dependencies": { - "@noble/hashes": "~1.3.0", - "@scure/base": "~1.1.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@sentry/core": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", - "integrity": "sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==", - "peer": true, - "dependencies": { - "@sentry/hub": "5.30.0", - "@sentry/minimal": "5.30.0", - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/core/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "peer": true - }, - "node_modules/@sentry/hub": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", - "integrity": "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==", - "peer": true, - "dependencies": { - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/hub/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "peer": true - }, - "node_modules/@sentry/minimal": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz", - "integrity": "sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==", - "peer": true, - "dependencies": { - "@sentry/hub": "5.30.0", - "@sentry/types": "5.30.0", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/minimal/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "peer": true - }, - "node_modules/@sentry/node": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz", - "integrity": "sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==", - "peer": true, - "dependencies": { - "@sentry/core": "5.30.0", - "@sentry/hub": "5.30.0", - "@sentry/tracing": "5.30.0", - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "cookie": "^0.4.1", - "https-proxy-agent": "^5.0.0", - "lru_map": "^0.3.3", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/node/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "peer": true - }, - "node_modules/@sentry/tracing": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz", - "integrity": "sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==", - "peer": true, - "dependencies": { - "@sentry/hub": "5.30.0", - "@sentry/minimal": "5.30.0", - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/tracing/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "peer": true - }, - "node_modules/@sentry/types": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", - "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/utils": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", - "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", - "peer": true, - "dependencies": { - "@sentry/types": "5.30.0", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/utils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "peer": true - }, - "node_modules/@sindresorhus/is": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/@solidity-parser/parser": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.5.tgz", - "integrity": "sha512-6dKnHZn7fg/iQATVEzqyUOyEidbn05q7YA2mQ9hC0MMXhhV3/JrsxmFSYZAcr7j1yUP700LLhTruvJ3MiQmjJg==", - "dependencies": { - "antlr4ts": "^0.5.0-alpha.4" - } - }, - "node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", - "dependencies": { - "defer-to-connect": "^2.0.1" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/@tsconfig/node10": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "peer": true - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "peer": true - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "peer": true - }, - "node_modules/@tsconfig/node16": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", - "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "peer": true - }, - "node_modules/@typechain/ethers-v6": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@typechain/ethers-v6/-/ethers-v6-0.4.3.tgz", - "integrity": "sha512-TrxBsyb4ryhaY9keP6RzhFCviWYApcLCIRMPyWaKp2cZZrfaM3QBoxXTnw/eO4+DAY3l+8O0brNW0WgeQeOiDA==", - "peer": true, - "dependencies": { - "lodash": "^4.17.15", - "ts-essentials": "^7.0.1" - }, - "peerDependencies": { - "ethers": "6.x", - "typechain": "^8.3.1", - "typescript": ">=4.7.0" - } - }, - "node_modules/@typechain/hardhat": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@typechain/hardhat/-/hardhat-8.0.3.tgz", - "integrity": "sha512-MytSmJJn+gs7Mqrpt/gWkTCOpOQ6ZDfRrRT2gtZL0rfGe4QrU4x9ZdW15fFbVM/XTa+5EsKiOMYXhRABibNeng==", - "peer": true, - "dependencies": { - "fs-extra": "^9.1.0" - }, - "peerDependencies": { - "@typechain/ethers-v6": "^0.4.3", - "ethers": "^6.1.0", - "hardhat": "^2.9.9", - "typechain": "^8.3.1" - } - }, - "node_modules/@typechain/hardhat/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "peer": true, - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@types/bn.js": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.1.tgz", - "integrity": "sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/cacheable-request": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", - "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", - "dependencies": { - "@types/http-cache-semantics": "*", - "@types/keyv": "^3.1.4", - "@types/node": "*", - "@types/responselike": "^1.0.0" - } - }, - "node_modules/@types/chai": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.6.tgz", - "integrity": "sha512-VOVRLM1mBxIRxydiViqPcKn6MIxZytrbMpd6RJLIWKxUNr3zux8no0Oc7kJx0WAPIitgZ0gkrDS+btlqQpubpw==", - "peer": true - }, - "node_modules/@types/chai-as-promised": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-7.1.6.tgz", - "integrity": "sha512-cQLhk8fFarRVZAXUQV1xEnZgMoPxqKojBvRkqPCKPQCzEhpbbSKl1Uu75kDng7k5Ln6LQLUmNBjLlFthCgm1NA==", - "peer": true, - "dependencies": { - "@types/chai": "*" - } - }, - "node_modules/@types/concat-stream": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.1.tgz", - "integrity": "sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/form-data": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", - "integrity": "sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", - "peer": true, - "dependencies": { - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "node_modules/@types/http-cache-semantics": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", - "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" - }, - "node_modules/@types/keyv": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", - "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==", - "peer": true - }, - "node_modules/@types/minimatch": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", - "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", - "peer": true - }, - "node_modules/@types/mocha": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.1.tgz", - "integrity": "sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==", - "peer": true - }, - "node_modules/@types/node": { - "version": "20.5.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.9.tgz", - "integrity": "sha512-PcGNd//40kHAS3sTlzKB9C9XL4K0sTup8nbG5lC14kzEteTNuAFh9u5nA0o5TWnSG2r/JNPRXFVcHJIIeRlmqQ==" - }, - "node_modules/@types/pbkdf2": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", - "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/prettier": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", - "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", - "peer": true - }, - "node_modules/@types/qs": { - "version": "6.9.8", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.8.tgz", - "integrity": "sha512-u95svzDlTysU5xecFNTgfFG5RUWu1A9P0VzgpcIiGZA9iraHOdSzcxMxQ55DyeRaGCSxQi7LxXDI4rzq/MYfdg==" - }, - "node_modules/@types/readable-stream": { - "version": "2.3.15", - "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-2.3.15.tgz", - "integrity": "sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==", - "peer": true, - "dependencies": { - "@types/node": "*", - "safe-buffer": "~5.1.1" - } - }, - "node_modules/@types/readable-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "peer": true - }, - "node_modules/@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/abbrev": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q==", - "peer": true - }, - "node_modules/abortcontroller-polyfill": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz", - "integrity": "sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ==" - }, - "node_modules/abstract-level": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/abstract-level/-/abstract-level-1.0.3.tgz", - "integrity": "sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==", - "peer": true, - "dependencies": { - "buffer": "^6.0.3", - "catering": "^2.1.0", - "is-buffer": "^2.0.5", - "level-supports": "^4.0.0", - "level-transcoder": "^1.0.1", - "module-error": "^1.0.1", - "queue-microtask": "^1.2.3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "peer": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "peer": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/address": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/address/-/address-1.2.2.tgz", - "integrity": "sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==", - "peer": true, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/adm-zip": { - "version": "0.4.16", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", - "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==", - "peer": true, - "engines": { - "node": ">=0.3.0" - } - }, - "node_modules/aes-js": { - "version": "4.0.0-beta.5", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", - "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==" - }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "peer": true, - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "peer": true, - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", - "optional": true, - "peer": true, - "engines": { - "node": ">=0.4.2" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "peer": true, - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/antlr4ts": { - "version": "0.5.0-alpha.4", - "resolved": "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz", - "integrity": "sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ==" - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "peer": true - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "peer": true - }, - "node_modules/array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", - "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", - "dependencies": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array.prototype.reduce": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.6.tgz", - "integrity": "sha512-UW+Mz8LG/sPSU8jRDCjVr6J/ZKAGpHfwrZ6kWTG5qCxIEiXdVshqGnu5vEZA8S1y6X4aCSbQZ0/EEsfvEvBiSg==", - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-array-method-boxes-properly": "^1.0.0", - "is-string": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", - "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", - "is-array-buffer": "^3.0.2", - "is-shared-array-buffer": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/asap": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==" - }, - "node_modules/asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "peer": true, - "engines": { - "node": "*" - } - }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", - "peer": true - }, - "node_modules/async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" - }, - "node_modules/async-promise-pool": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/async-promise-pool/-/async-promise-pool-1.0.6.tgz", - "integrity": "sha512-44DZ4fOHtnioeblfWNgf2EoOFTf0B72t/j4vY4ZnG+3AcWOkQKaByUfDhZUz647zBZFvlGEBvJgbJJyg/lTWZw==", - "dependencies": { - "babel-runtime": "^6.26.0" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "peer": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" - }, - "node_modules/babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", - "dependencies": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "node_modules/base-x": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", - "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, - "node_modules/bcrypt-pbkdf/node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" - }, - "node_modules/bech32": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", - "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", - "peer": true - }, - "node_modules/bigint-crypto-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.3.0.tgz", - "integrity": "sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg==", - "peer": true, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/bignumber.js": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", - "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", - "engines": { - "node": "*" - } - }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/blakejs": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", - "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" - }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" - }, - "node_modules/bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" - }, - "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/body-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/body-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/body-parser/node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" - }, - "node_modules/browser-level": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browser-level/-/browser-level-1.0.1.tgz", - "integrity": "sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ==", - "peer": true, - "dependencies": { - "abstract-level": "^1.0.2", - "catering": "^2.1.1", - "module-error": "^1.0.2", - "run-parallel-limit": "^1.1.0" - } - }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" - }, - "node_modules/browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dependencies": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "dependencies": { - "base-x": "^3.0.2" - } - }, - "node_modules/bs58check": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", - "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", - "dependencies": { - "bs58": "^4.0.0", - "create-hash": "^1.1.0", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "peer": true, - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" - }, - "node_modules/buffer-to-arraybuffer": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz", - "integrity": "sha512-3dthu5CYiVB1DEJp61FtApNnNndTckcqe4pFcLdvHtrpG+kcyekCJKg4MRiDcFW7A6AODnXB9U4dwQiCW5kzJQ==" - }, - "node_modules/buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" - }, - "node_modules/bufferutil": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", - "integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==", - "hasInstallScript": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, - "node_modules/busboy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", - "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", - "dependencies": { - "streamsearch": "^1.1.0" - }, - "engines": { - "node": ">=10.16.0" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/cacheable-lookup": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-6.1.0.tgz", - "integrity": "sha512-KJ/Dmo1lDDhmW2XDPMo+9oiy/CeqosPguPCrgcVzKyZrL6pM1gU2GmPY/xo6OQPTUaA/c0kwHuywB4E6nmT9ww==", - "engines": { - "node": ">=10.6.0" - } - }, - "node_modules/cacheable-request": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", - "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", - "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^6.0.1", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cacheable-request/node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cacheable-request/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/case": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/case/-/case-1.6.3.tgz", - "integrity": "sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==", - "peer": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" - }, - "node_modules/catering": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/catering/-/catering-2.1.1.tgz", - "integrity": "sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/cbor": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/cbor/-/cbor-8.1.0.tgz", - "integrity": "sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==", - "dependencies": { - "nofilter": "^3.1.0" - }, - "engines": { - "node": ">=12.19" - } - }, - "node_modules/chai": { - "version": "4.3.8", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.8.tgz", - "integrity": "sha512-vX4YvVVtxlfSZ2VecZgFUTU5qPCYsobVI2O9FmwEXBhDigYGQA6jRXCycIs1yJnnWbZ6/+a2zNIF5DfVCcJBFQ==", - "peer": true, - "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^4.1.2", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", - "pathval": "^1.1.1", - "type-detect": "^4.0.5" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chai-as-promised": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.1.tgz", - "integrity": "sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==", - "peer": true, - "dependencies": { - "check-error": "^1.0.2" - }, - "peerDependencies": { - "chai": ">= 2.1.2 < 5" - } - }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/charenc": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", - "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", - "engines": { - "node": "*" - } - }, - "node_modules/check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", - "peer": true, - "engines": { - "node": "*" - } - }, - "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "peer": true, - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" - }, - "node_modules/ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "peer": true - }, - "node_modules/cids": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", - "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", - "deprecated": "This module has been superseded by the multiformats module", - "dependencies": { - "buffer": "^5.5.0", - "class-is": "^1.1.0", - "multibase": "~0.6.0", - "multicodec": "^1.0.0", - "multihashes": "~0.4.15" - }, - "engines": { - "node": ">=4.0.0", - "npm": ">=3.0.0" - } - }, - "node_modules/cids/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/cids/node_modules/multicodec": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-1.0.4.tgz", - "integrity": "sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg==", - "deprecated": "This module has been superseded by the multiformats module", - "dependencies": { - "buffer": "^5.6.0", - "varint": "^5.0.0" - } - }, - "node_modules/cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/class-is": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", - "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==" - }, - "node_modules/classic-level": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.3.0.tgz", - "integrity": "sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==", - "hasInstallScript": true, - "peer": true, - "dependencies": { - "abstract-level": "^1.0.2", - "catering": "^2.1.0", - "module-error": "^1.0.1", - "napi-macros": "^2.2.2", - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/cli-table3": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.1.tgz", - "integrity": "sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==", - "dependencies": { - "object-assign": "^4.1.0", - "string-width": "^2.1.1" - }, - "engines": { - "node": ">=6" - }, - "optionalDependencies": { - "colors": "^1.1.2" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "peer": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/cliui/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==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/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==", - "peer": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/clone-response": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", - "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", - "dependencies": { - "mimic-response": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "node_modules/colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/command-exists": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", - "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==" - }, - "node_modules/command-line-args": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", - "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", - "peer": true, - "dependencies": { - "array-back": "^3.1.0", - "find-replace": "^3.0.0", - "lodash.camelcase": "^4.3.0", - "typical": "^4.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/command-line-usage": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", - "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", - "peer": true, - "dependencies": { - "array-back": "^4.0.2", - "chalk": "^2.4.2", - "table-layout": "^1.0.2", - "typical": "^5.2.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/command-line-usage/node_modules/array-back": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", - "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/command-line-usage/node_modules/typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/commander": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", - "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", - "engines": { - "node": ">= 12" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "engines": [ - "node >= 0.8" - ], - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "node_modules/concat-stream/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/concat-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/concat-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-hash": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/content-hash/-/content-hash-2.5.2.tgz", - "integrity": "sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw==", - "dependencies": { - "cids": "^0.7.1", - "multicodec": "^0.5.5", - "multihashes": "^0.4.15" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", - "peer": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" - }, - "node_modules/core-js": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", - "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", - "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", - "hasInstallScript": true - }, - "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" - }, - "node_modules/cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/crc": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/crc/-/crc-4.3.2.tgz", - "integrity": "sha512-uGDHf4KLLh2zsHa8D8hIQ1H/HtFQhyHrc0uhHBcoKGol/Xnb+MPYfUMw7cvON6ze/GUESTudKayDcJC5HnJv1A==", - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "buffer": ">=6.0.3" - }, - "peerDependenciesMeta": { - "buffer": { - "optional": true - } - } - }, - "node_modules/crc-32": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", - "bin": { - "crc32": "bin/crc32.njs" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dependencies": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "node_modules/create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "peer": true - }, - "node_modules/cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dependencies": { - "node-fetch": "^2.6.12" - } - }, - "node_modules/crypt": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", - "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", - "engines": { - "node": "*" - } - }, - "node_modules/d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "dependencies": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/death": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/death/-/death-1.1.0.tgz", - "integrity": "sha512-vsV6S4KVHvTGxbEcij7hkWRv0It+sGGWVOM67dQde/o5Xjnr+KmLjxWJii2uEObIrt1CcM9w0Yaovx+iOlIL+w==", - "peer": true - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/decode-uri-component": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", - "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", - "engines": { - "node": ">=0.10" - } - }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/decompress-response/node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", - "peer": true, - "dependencies": { - "type-detect": "^4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "peer": true, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "peer": true - }, - "node_modules/defer-to-connect": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", - "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", - "engines": { - "node": ">=10" - } - }, - "node_modules/define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", - "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/detect-port": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-1.5.1.tgz", - "integrity": "sha512-aBzdj76lueB6uUst5iAs7+0H/oOjqI5D16XUWxlWMIMROhcM0rfsNVk93zTngq1dDNpoXRr++Sus7ETAExppAQ==", - "peer": true, - "dependencies": { - "address": "^1.0.1", - "debug": "4" - }, - "bin": { - "detect": "bin/detect-port.js", - "detect-port": "bin/detect-port.js" - } - }, - "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", - "peer": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/difflib": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/difflib/-/difflib-0.2.4.tgz", - "integrity": "sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w==", - "peer": true, - "dependencies": { - "heap": ">= 0.2.0" - }, - "engines": { - "node": "*" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "peer": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/dom-walk": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", - "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==" - }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "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/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/enquirer": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", - "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", - "peer": true, - "dependencies": { - "ansi-colors": "^4.1.1", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/es-abstract": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", - "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "arraybuffer.prototype.slice": "^1.0.1", - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "es-set-tostringtag": "^2.0.1", - "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.2.1", - "get-symbol-description": "^1.0.0", - "globalthis": "^1.0.3", - "gopd": "^1.0.1", - "has": "^1.0.3", - "has-property-descriptors": "^1.0.0", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.5", - "is-array-buffer": "^3.0.2", - "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "is-string": "^1.0.7", - "is-typed-array": "^1.1.10", - "is-weakref": "^1.0.2", - "object-inspect": "^1.12.3", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.0", - "safe-array-concat": "^1.0.0", - "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.7", - "string.prototype.trimend": "^1.0.6", - "string.prototype.trimstart": "^1.0.6", - "typed-array-buffer": "^1.0.0", - "typed-array-byte-length": "^1.0.0", - "typed-array-byte-offset": "^1.0.0", - "typed-array-length": "^1.0.4", - "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.10" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-abstract/node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-array-method-boxes-properly": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", - "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==" - }, - "node_modules/es-set-tostringtag": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", - "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", - "dependencies": { - "get-intrinsic": "^1.1.3", - "has": "^1.0.3", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es5-ext": { - "version": "0.10.62", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz", - "integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==", - "hasInstallScript": true, - "dependencies": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "next-tick": "^1.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", - "dependencies": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" - }, - "node_modules/es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "dependencies": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/escodegen": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", - "integrity": "sha512-yhi5S+mNTOuRvyW4gWlg5W1byMaQGWWSYHXsuFZ7GBo7tpyOwi2EdzMP/QWxh9hwkD2m+wDVHJsxhRIj+v/b/A==", - "peer": true, - "dependencies": { - "esprima": "^2.7.1", - "estraverse": "^1.9.1", - "esutils": "^2.0.2", - "optionator": "^0.8.1" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=0.12.0" - }, - "optionalDependencies": { - "source-map": "~0.2.0" - } - }, - "node_modules/esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==", - "peer": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/estraverse": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", - "integrity": "sha512-25w1fMXQrGdoquWnScXZGckOv+Wes+JDnuN/+7ex3SauFRS72r2lFDec0EKPt2YD1wUJ/IrfEex+9yp4hfSOJA==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/eth-ens-namehash": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz", - "integrity": "sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw==", - "dependencies": { - "idna-uts46-hx": "^2.3.1", - "js-sha3": "^0.5.7" - } - }, - "node_modules/eth-ens-namehash/node_modules/js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g==" - }, - "node_modules/eth-gas-reporter": { - "version": "0.2.25", - "resolved": "https://registry.npmjs.org/eth-gas-reporter/-/eth-gas-reporter-0.2.25.tgz", - "integrity": "sha512-1fRgyE4xUB8SoqLgN3eDfpDfwEfRxh2Sz1b7wzFbyQA+9TekMmvSjjoRu9SKcSVyK+vLkLIsVbJDsTWjw195OQ==", - "dependencies": { - "@ethersproject/abi": "^5.0.0-beta.146", - "@solidity-parser/parser": "^0.14.0", - "cli-table3": "^0.5.0", - "colors": "1.4.0", - "ethereum-cryptography": "^1.0.3", - "ethers": "^4.0.40", - "fs-readdir-recursive": "^1.1.0", - "lodash": "^4.17.14", - "markdown-table": "^1.1.3", - "mocha": "^7.1.1", - "req-cwd": "^2.0.0", - "request": "^2.88.0", - "request-promise-native": "^1.0.5", - "sha1": "^1.1.1", - "sync-request": "^6.0.0" - }, - "peerDependencies": { - "@codechecks/client": "^0.1.0" - }, - "peerDependenciesMeta": { - "@codechecks/client": { - "optional": true - } - } - }, - "node_modules/eth-gas-reporter/node_modules/@noble/hashes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz", - "integrity": "sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ] - }, - "node_modules/eth-gas-reporter/node_modules/@scure/bip32": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.5.tgz", - "integrity": "sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "@noble/hashes": "~1.2.0", - "@noble/secp256k1": "~1.7.0", - "@scure/base": "~1.1.0" - } - }, - "node_modules/eth-gas-reporter/node_modules/@scure/bip39": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.1.tgz", - "integrity": "sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "@noble/hashes": "~1.2.0", - "@scure/base": "~1.1.0" - } - }, - "node_modules/eth-gas-reporter/node_modules/aes-js": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", - "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==" - }, - "node_modules/eth-gas-reporter/node_modules/ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/eth-gas-reporter/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "engines": { - "node": ">=6" - } - }, - "node_modules/eth-gas-reporter/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/eth-gas-reporter/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "node_modules/eth-gas-reporter/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/eth-gas-reporter/node_modules/chokidar": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", - "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", - "dependencies": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.1.1" - } - }, - "node_modules/eth-gas-reporter/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "node_modules/eth-gas-reporter/node_modules/debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eth-gas-reporter/node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eth-gas-reporter/node_modules/diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/eth-gas-reporter/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, - "node_modules/eth-gas-reporter/node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eth-gas-reporter/node_modules/ethereum-cryptography": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz", - "integrity": "sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==", - "dependencies": { - "@noble/hashes": "1.2.0", - "@noble/secp256k1": "1.7.1", - "@scure/bip32": "1.1.5", - "@scure/bip39": "1.1.1" - } - }, - "node_modules/eth-gas-reporter/node_modules/ethers": { - "version": "4.0.49", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.49.tgz", - "integrity": "sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg==", - "dependencies": { - "aes-js": "3.0.0", - "bn.js": "^4.11.9", - "elliptic": "6.5.4", - "hash.js": "1.1.3", - "js-sha3": "0.5.7", - "scrypt-js": "2.0.4", - "setimmediate": "1.0.4", - "uuid": "2.0.1", - "xmlhttprequest": "1.8.0" - } - }, - "node_modules/eth-gas-reporter/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/eth-gas-reporter/node_modules/flat": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz", - "integrity": "sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==", - "dependencies": { - "is-buffer": "~2.0.3" - }, - "bin": { - "flat": "cli.js" - } - }, - "node_modules/eth-gas-reporter/node_modules/fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "deprecated": "\"Please update to latest v2.3 or v2.2\"", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/eth-gas-reporter/node_modules/glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "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/eth-gas-reporter/node_modules/hash.js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.0" - } - }, - "node_modules/eth-gas-reporter/node_modules/js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g==" - }, - "node_modules/eth-gas-reporter/node_modules/js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/eth-gas-reporter/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/eth-gas-reporter/node_modules/log-symbols": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", - "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", - "dependencies": { - "chalk": "^2.4.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/eth-gas-reporter/node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/eth-gas-reporter/node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/eth-gas-reporter/node_modules/mocha": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.2.0.tgz", - "integrity": "sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ==", - "dependencies": { - "ansi-colors": "3.2.3", - "browser-stdout": "1.3.1", - "chokidar": "3.3.0", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "3.0.0", - "minimatch": "3.0.4", - "mkdirp": "0.5.5", - "ms": "2.1.1", - "node-environment-flags": "1.0.6", - "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", - "wide-align": "1.1.3", - "yargs": "13.3.2", - "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha" - }, - "engines": { - "node": ">= 8.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" - } - }, - "node_modules/eth-gas-reporter/node_modules/ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - }, - "node_modules/eth-gas-reporter/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/eth-gas-reporter/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/eth-gas-reporter/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/eth-gas-reporter/node_modules/readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", - "dependencies": { - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/eth-gas-reporter/node_modules/scrypt-js": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", - "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==" - }, - "node_modules/eth-gas-reporter/node_modules/setimmediate": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", - "integrity": "sha512-/TjEmXQVEzdod/FFskf3o7oOAsGhHf2j1dZqRFbDzq4F3mvvxflIIi4Hd3bLQE9y/CpwqfSQam5JakI/mi3Pog==" - }, - "node_modules/eth-gas-reporter/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/eth-gas-reporter/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/eth-gas-reporter/node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eth-gas-reporter/node_modules/supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/eth-gas-reporter/node_modules/uuid": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", - "integrity": "sha512-nWg9+Oa3qD2CQzHIP4qKUqwNfzKn8P0LtFhotaCTFchsV7ZfDhAybeip/HZVeMIpZi9JgY1E3nUlwaCmZT1sEg==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details." - }, - "node_modules/eth-gas-reporter/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/eth-gas-reporter/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/eth-gas-reporter/node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "node_modules/eth-gas-reporter/node_modules/yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - }, - "node_modules/eth-gas-reporter/node_modules/yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", - "dependencies": { - "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/eth-lib": { - "version": "0.1.29", - "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.29.tgz", - "integrity": "sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ==", - "dependencies": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "nano-json-stream-parser": "^0.1.2", - "servify": "^0.1.12", - "ws": "^3.0.0", - "xhr-request-promise": "^0.1.2" - } - }, - "node_modules/eth-lib/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "node_modules/eth-lib/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/eth-lib/node_modules/ws": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", - "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", - "dependencies": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" - } - }, - "node_modules/ethereum-bloom-filters": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.10.tgz", - "integrity": "sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA==", - "dependencies": { - "js-sha3": "^0.8.0" - } - }, - "node_modules/ethereum-cryptography": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz", - "integrity": "sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug==", - "dependencies": { - "@noble/curves": "1.1.0", - "@noble/hashes": "1.3.1", - "@scure/bip32": "1.3.1", - "@scure/bip39": "1.2.1" - } - }, - "node_modules/ethereumjs-abi": { - "version": "0.6.8", - "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", - "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", - "peer": true, - "dependencies": { - "bn.js": "^4.11.8", - "ethereumjs-util": "^6.0.0" - } - }, - "node_modules/ethereumjs-abi/node_modules/@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "peer": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/ethereumjs-abi/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "peer": true - }, - "node_modules/ethereumjs-abi/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "peer": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/ethereumjs-abi/node_modules/ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "peer": true, - "dependencies": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - }, - "node_modules/ethereumjs-common": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz", - "integrity": "sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA==", - "deprecated": "New package name format for new versions: @ethereumjs/common. Please update." - }, - "node_modules/ethereumjs-tx": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", - "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", - "deprecated": "New package name format for new versions: @ethereumjs/tx. Please update.", - "dependencies": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - } - }, - "node_modules/ethereumjs-tx/node_modules/@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/ethereumjs-tx/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "node_modules/ethereumjs-tx/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/ethereumjs-tx/node_modules/ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "dependencies": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - }, - "node_modules/ethereumjs-util": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", - "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", - "dependencies": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "rlp": "^2.2.4" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/ethereumjs-util/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/ethers": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.7.1.tgz", - "integrity": "sha512-qX5kxIFMfg1i+epfgb0xF4WM7IqapIIu50pOJ17aebkxxa4BacW5jFrQRmCJpDEg2ZK2oNtR5QjrQ1WDBF29dA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/ethers-io/" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@adraffy/ens-normalize": "1.9.2", - "@noble/hashes": "1.1.2", - "@noble/secp256k1": "1.7.1", - "@types/node": "18.15.13", - "aes-js": "4.0.0-beta.5", - "tslib": "2.4.0", - "ws": "8.5.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/ethers/node_modules/@noble/hashes": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.2.tgz", - "integrity": "sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ] - }, - "node_modules/ethers/node_modules/@types/node": { - "version": "18.15.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", - "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==" - }, - "node_modules/ethjs-unit": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", - "integrity": "sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==", - "dependencies": { - "bn.js": "4.11.6", - "number-to-bn": "1.7.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, - "node_modules/ethjs-unit/node_modules/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==" - }, - "node_modules/ethjs-util": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", - "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", - "dependencies": { - "is-hex-prefixed": "1.0.0", - "strip-hex-prefix": "1.0.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, - "node_modules/eventemitter3": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", - "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==" - }, - "node_modules/evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.1", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/express/node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/express/node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/express/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/express/node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/express/node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/ext": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", - "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", - "dependencies": { - "type": "^2.7.2" - } - }, - "node_modules/ext/node_modules/type": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", - "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "engines": [ - "node >=0.6.0" - ] - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", - "peer": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "peer": true - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "peer": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/finalhandler/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/find-replace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", - "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", - "peer": true, - "dependencies": { - "array-back": "^3.0.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", - "peer": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "peer": true, - "bin": { - "flat": "cli.js" - } - }, - "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dependencies": { - "is-callable": "^1.1.3" - } - }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "engines": { - "node": "*" - } - }, - "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/form-data-encoder": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.1.tgz", - "integrity": "sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg==" - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fp-ts": { - "version": "1.19.3", - "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.3.tgz", - "integrity": "sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==", - "peer": true - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/fs-minipass": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", - "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", - "dependencies": { - "minipass": "^2.6.0" - } - }, - "node_modules/fs-readdir-recursive": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", - "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==" - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "peer": true, - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "node_modules/function.prototype.name": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", - "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "functions-have-names": "^1.2.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "peer": true - }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", - "peer": true, - "engines": { - "node": "*" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-port": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", - "integrity": "sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==", - "engines": { - "node": ">=4" - } - }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "dependencies": { - "assert-plus": "^1.0.0" - } - }, - "node_modules/ghost-testrpc": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/ghost-testrpc/-/ghost-testrpc-0.0.2.tgz", - "integrity": "sha512-i08dAEgJ2g8z5buJIrCTduwPIhih3DP+hOCTyyryikfV8T0bNvHnGXO67i0DD1H4GBDETTclPy9njZbfluQYrQ==", - "peer": true, - "dependencies": { - "chalk": "^2.4.2", - "node-emoji": "^1.10.0" - }, - "bin": { - "testrpc-sc": "index.js" - } - }, - "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "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": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/global": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", - "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==", - "dependencies": { - "min-document": "^2.19.0", - "process": "^0.11.10" - } - }, - "node_modules/global-modules": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", - "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", - "peer": true, - "dependencies": { - "global-prefix": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/global-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", - "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", - "peer": true, - "dependencies": { - "ini": "^1.3.5", - "kind-of": "^6.0.2", - "which": "^1.3.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/globalthis": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", - "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", - "dependencies": { - "define-properties": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/globby": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", - "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", - "peer": true, - "dependencies": { - "@types/glob": "^7.1.1", - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.0.3", - "glob": "^7.1.3", - "ignore": "^5.1.1", - "merge2": "^1.2.3", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/got": { - "version": "12.1.0", - "resolved": "https://registry.npmjs.org/got/-/got-12.1.0.tgz", - "integrity": "sha512-hBv2ty9QN2RdbJJMK3hesmSkFTjVIHyIDDbssCKnSmq62edGgImJWD10Eb1k77TiV1bxloxqcFAVK8+9pkhOig==", - "dependencies": { - "@sindresorhus/is": "^4.6.0", - "@szmarczak/http-timer": "^5.0.1", - "@types/cacheable-request": "^6.0.2", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^6.0.4", - "cacheable-request": "^7.0.2", - "decompress-response": "^6.0.0", - "form-data-encoder": "1.7.1", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" - }, - "node_modules/growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "engines": { - "node": ">=4.x" - } - }, - "node_modules/handlebars": { - "version": "4.7.8", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", - "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", - "peer": true, - "dependencies": { - "minimist": "^1.2.5", - "neo-async": "^2.6.2", - "source-map": "^0.6.1", - "wordwrap": "^1.0.0" - }, - "bin": { - "handlebars": "bin/handlebars" - }, - "engines": { - "node": ">=0.4.7" - }, - "optionalDependencies": { - "uglify-js": "^3.1.4" - } - }, - "node_modules/handlebars/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/hardhat": { - "version": "2.17.2", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.17.2.tgz", - "integrity": "sha512-oUv40jBeHw0dKpbyQ+iH9cmNMziweLoTW3MnkNxJ2Gc0KGLrQR/1n4vV4xY60zn2LdmRgnwPqy3CgtY0mfwIIA==", - "peer": true, - "dependencies": { - "@ethersproject/abi": "^5.1.2", - "@metamask/eth-sig-util": "^4.0.0", - "@nomicfoundation/ethereumjs-block": "5.0.2", - "@nomicfoundation/ethereumjs-blockchain": "7.0.2", - "@nomicfoundation/ethereumjs-common": "4.0.2", - "@nomicfoundation/ethereumjs-evm": "2.0.2", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "@nomicfoundation/ethereumjs-statemanager": "2.0.2", - "@nomicfoundation/ethereumjs-trie": "6.0.2", - "@nomicfoundation/ethereumjs-tx": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "@nomicfoundation/ethereumjs-vm": "7.0.2", - "@nomicfoundation/solidity-analyzer": "^0.1.0", - "@sentry/node": "^5.18.1", - "@types/bn.js": "^5.1.0", - "@types/lru-cache": "^5.1.0", - "adm-zip": "^0.4.16", - "aggregate-error": "^3.0.0", - "ansi-escapes": "^4.3.0", - "chalk": "^2.4.2", - "chokidar": "^3.4.0", - "ci-info": "^2.0.0", - "debug": "^4.1.1", - "enquirer": "^2.3.0", - "env-paths": "^2.2.0", - "ethereum-cryptography": "^1.0.3", - "ethereumjs-abi": "^0.6.8", - "find-up": "^2.1.0", - "fp-ts": "1.19.3", - "fs-extra": "^7.0.1", - "glob": "7.2.0", - "immutable": "^4.0.0-rc.12", - "io-ts": "1.10.4", - "keccak": "^3.0.2", - "lodash": "^4.17.11", - "mnemonist": "^0.38.0", - "mocha": "^10.0.0", - "p-map": "^4.0.0", - "raw-body": "^2.4.1", - "resolve": "1.17.0", - "semver": "^6.3.0", - "solc": "0.7.3", - "source-map-support": "^0.5.13", - "stacktrace-parser": "^0.1.10", - "tsort": "0.0.1", - "undici": "^5.14.0", - "uuid": "^8.3.2", - "ws": "^7.4.6" - }, - "bin": { - "hardhat": "internal/cli/bootstrap.js" - }, - "peerDependencies": { - "ts-node": "*", - "typescript": "*" - }, - "peerDependenciesMeta": { - "ts-node": { - "optional": true - }, - "typescript": { - "optional": true - } - } - }, - "node_modules/hardhat-gas-reporter": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/hardhat-gas-reporter/-/hardhat-gas-reporter-1.0.9.tgz", - "integrity": "sha512-INN26G3EW43adGKBNzYWOlI3+rlLnasXTwW79YNnUhXPDa+yHESgt639dJEs37gCjhkbNKcRRJnomXEuMFBXJg==", - "dependencies": { - "array-uniq": "1.0.3", - "eth-gas-reporter": "^0.2.25", - "sha1": "^1.1.1" - }, - "peerDependencies": { - "hardhat": "^2.0.2" - } - }, - "node_modules/hardhat/node_modules/@noble/hashes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz", - "integrity": "sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "peer": true - }, - "node_modules/hardhat/node_modules/@scure/bip32": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.5.tgz", - "integrity": "sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "peer": true, - "dependencies": { - "@noble/hashes": "~1.2.0", - "@noble/secp256k1": "~1.7.0", - "@scure/base": "~1.1.0" - } - }, - "node_modules/hardhat/node_modules/@scure/bip39": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.1.tgz", - "integrity": "sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "peer": true, - "dependencies": { - "@noble/hashes": "~1.2.0", - "@scure/base": "~1.1.0" - } - }, - "node_modules/hardhat/node_modules/commander": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", - "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", - "peer": true - }, - "node_modules/hardhat/node_modules/ethereum-cryptography": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz", - "integrity": "sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==", - "peer": true, - "dependencies": { - "@noble/hashes": "1.2.0", - "@noble/secp256k1": "1.7.1", - "@scure/bip32": "1.1.5", - "@scure/bip39": "1.1.1" - } - }, - "node_modules/hardhat/node_modules/fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "peer": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/hardhat/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "peer": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/hardhat/node_modules/solc": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.7.3.tgz", - "integrity": "sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==", - "peer": true, - "dependencies": { - "command-exists": "^1.2.8", - "commander": "3.0.2", - "follow-redirects": "^1.12.1", - "fs-extra": "^0.30.0", - "js-sha3": "0.8.0", - "memorystream": "^0.3.1", - "require-from-string": "^2.0.0", - "semver": "^5.5.0", - "tmp": "0.0.33" - }, - "bin": { - "solcjs": "solcjs" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/hardhat/node_modules/solc/node_modules/fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", - "peer": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - }, - "node_modules/hardhat/node_modules/solc/node_modules/jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", - "peer": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/hardhat/node_modules/solc/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "peer": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/hardhat/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "peer": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/hardhat/node_modules/ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", - "peer": true, - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dependencies": { - "get-intrinsic": "^1.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "bin": { - "he": "bin/he" - } - }, - "node_modules/heap": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.7.tgz", - "integrity": "sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==", - "peer": true - }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/http-basic": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-8.1.3.tgz", - "integrity": "sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==", - "dependencies": { - "caseless": "^0.12.0", - "concat-stream": "^1.6.2", - "http-response-object": "^3.0.1", - "parse-cache-control": "^1.0.1" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/http-https": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/http-https/-/http-https-1.0.0.tgz", - "integrity": "sha512-o0PWwVCSp3O0wS6FvNr6xfBCHgt0m1tvPLFOCc2iFDKTRAXhB7m8klDf7ErowFH8POa6dVdGatKU5I1YYwzUyg==" - }, - "node_modules/http-response-object": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz", - "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", - "dependencies": { - "@types/node": "^10.0.3" - } - }, - "node_modules/http-response-object/node_modules/@types/node": { - "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" - }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, - "node_modules/http2-wrapper": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", - "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" - }, - "engines": { - "node": ">=10.19.0" - } - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "peer": true, - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/idna-uts46-hx": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz", - "integrity": "sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==", - "dependencies": { - "punycode": "2.1.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/idna-uts46-hx/node_modules/punycode": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz", - "integrity": "sha512-Yxz2kRwT90aPiWEMHVYnEf4+rhwF1tBmmZ4KepCP+Wkium9JxtWnUm1nqGwpiAHr/tnTSeHqr3wb++jgSkXjhA==", - "engines": { - "node": ">=6" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "peer": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/immutable": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.4.tgz", - "integrity": "sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==", - "peer": true - }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "peer": true - }, - "node_modules/internal-slot": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", - "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", - "dependencies": { - "get-intrinsic": "^1.2.0", - "has": "^1.0.3", - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "peer": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/io-ts": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/io-ts/-/io-ts-1.10.4.tgz", - "integrity": "sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g==", - "peer": true, - "dependencies": { - "fp-ts": "^1.0.0" - } - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-array-buffer": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", - "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dependencies": { - "has-bigints": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "engines": { - "node": ">=4" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "engines": { - "node": ">=4" - } - }, - "node_modules/is-function": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz", - "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==" - }, - "node_modules/is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-hex-prefixed": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", - "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, - "node_modules/is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", - "dependencies": { - "call-bind": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-typed-array": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", - "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", - "dependencies": { - "which-typed-array": "^1.1.11" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" - }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", - "dependencies": { - "call-bind": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" - }, - "node_modules/js-sdsl": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.2.tgz", - "integrity": "sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w==", - "peer": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/js-sdsl" - } - }, - "node_modules/js-sha3": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "peer": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==" - }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" - }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" - }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/jsonschema": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", - "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", - "peer": true, - "engines": { - "node": "*" - } - }, - "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/keccak": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.3.tgz", - "integrity": "sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ==", - "hasInstallScript": true, - "dependencies": { - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/keyv": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", - "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", - "dependencies": { - "json-buffer": "3.0.1" - } - }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==", - "optionalDependencies": { - "graceful-fs": "^4.1.9" - } - }, - "node_modules/level": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/level/-/level-8.0.0.tgz", - "integrity": "sha512-ypf0jjAk2BWI33yzEaaotpq7fkOPALKAgDBxggO6Q9HGX2MRXn0wbP1Jn/tJv1gtL867+YOjOB49WaUF3UoJNQ==", - "peer": true, - "dependencies": { - "browser-level": "^1.0.1", - "classic-level": "^1.2.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/level" - } - }, - "node_modules/level-supports": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-4.0.1.tgz", - "integrity": "sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==", - "peer": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/level-transcoder": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/level-transcoder/-/level-transcoder-1.0.1.tgz", - "integrity": "sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==", - "peer": true, - "dependencies": { - "buffer": "^6.0.3", - "module-error": "^1.0.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "peer": true, - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", - "peer": true, - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "peer": true - }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" - }, - "node_modules/lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" - }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==" - }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "peer": true, - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-symbols/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "peer": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/log-symbols/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "peer": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/log-symbols/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "peer": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/log-symbols/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "peer": true - }, - "node_modules/log-symbols/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/log-symbols/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "peer": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/loupe": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", - "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", - "peer": true, - "dependencies": { - "get-func-name": "^2.0.0" - } - }, - "node_modules/lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lru_map": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", - "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==", - "peer": true - }, - "node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "peer": true, - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "peer": true - }, - "node_modules/markdown-table": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-1.1.3.tgz", - "integrity": "sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q==" - }, - "node_modules/mcl-wasm": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.9.tgz", - "integrity": "sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ==", - "peer": true, - "engines": { - "node": ">=8.9.0" - } - }, - "node_modules/md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/memory-level": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/memory-level/-/memory-level-1.0.0.tgz", - "integrity": "sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og==", - "peer": true, - "dependencies": { - "abstract-level": "^1.0.0", - "functional-red-black-tree": "^1.0.1", - "module-error": "^1.0.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/memorystream": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "peer": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/micro-ftch": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/micro-ftch/-/micro-ftch-0.3.1.tgz", - "integrity": "sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==" - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "peer": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "engines": { - "node": ">=4" - } - }, - "node_modules/min-document": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", - "integrity": "sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ==", - "dependencies": { - "dom-walk": "^0.1.0" - } - }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" - }, - "node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/minipass": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "dependencies": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "node_modules/minizlib": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", - "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", - "dependencies": { - "minipass": "^2.9.0" - } - }, - "node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dependencies": { - "minimist": "^1.2.6" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/mkdirp-promise": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", - "integrity": "sha512-Hepn5kb1lJPtVW84RFT40YG1OddBNTOVUZR2bzQUHc+Z03en8/3uX0+060JDhcEzyO08HmipsN9DcnFMxhIL9w==", - "deprecated": "This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.", - "dependencies": { - "mkdirp": "*" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mnemonist": { - "version": "0.38.5", - "resolved": "https://registry.npmjs.org/mnemonist/-/mnemonist-0.38.5.tgz", - "integrity": "sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg==", - "peer": true, - "dependencies": { - "obliterator": "^2.0.0" - } - }, - "node_modules/mocha": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", - "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", - "peer": true, - "dependencies": { - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.4", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "5.0.1", - "ms": "2.1.3", - "nanoid": "3.3.3", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "workerpool": "6.2.1", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha.js" - }, - "engines": { - "node": ">= 14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" - } - }, - "node_modules/mocha/node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/mocha/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==", - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/mocha/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mocha/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "peer": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mocha/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/mocha/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "peer": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mocha/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", - "peer": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "peer": true - }, - "node_modules/mocha/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "peer": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mocha/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "peer": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mocha/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/mocha/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "peer": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/mock-fs": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.14.0.tgz", - "integrity": "sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw==" - }, - "node_modules/module-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/module-error/-/module-error-1.0.2.tgz", - "integrity": "sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==", - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/multibase": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", - "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", - "deprecated": "This module has been superseded by the multiformats module", - "dependencies": { - "base-x": "^3.0.8", - "buffer": "^5.5.0" - } - }, - "node_modules/multibase/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/multicodec": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-0.5.7.tgz", - "integrity": "sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA==", - "deprecated": "This module has been superseded by the multiformats module", - "dependencies": { - "varint": "^5.0.0" - } - }, - "node_modules/multihashes": { - "version": "0.4.21", - "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-0.4.21.tgz", - "integrity": "sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw==", - "dependencies": { - "buffer": "^5.5.0", - "multibase": "^0.7.0", - "varint": "^5.0.0" - } - }, - "node_modules/multihashes/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/multihashes/node_modules/multibase": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.7.0.tgz", - "integrity": "sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==", - "deprecated": "This module has been superseded by the multiformats module", - "dependencies": { - "base-x": "^3.0.8", - "buffer": "^5.5.0" - } - }, - "node_modules/nano-json-stream-parser": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz", - "integrity": "sha512-9MqxMH/BSJC7dnLsEMPyfN5Dvoo49IsPFYMcHw3Bcfc2kN0lpHRBSzlMSVx4HGyJ7s9B31CyBTVehWJoQ8Ctew==" - }, - "node_modules/nanoid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", - "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", - "peer": true, - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/napi-macros": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz", - "integrity": "sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==", - "peer": true - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "peer": true - }, - "node_modules/next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" - }, - "node_modules/node-addon-api": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" - }, - "node_modules/node-emoji": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz", - "integrity": "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==", - "peer": true, - "dependencies": { - "lodash": "^4.17.21" - } - }, - "node_modules/node-environment-flags": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", - "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", - "dependencies": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" - } - }, - "node_modules/node-environment-flags/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-gyp-build": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.1.tgz", - "integrity": "sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==", - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, - "node_modules/nofilter": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz", - "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", - "engines": { - "node": ">=12.19" - } - }, - "node_modules/nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==", - "peer": true, - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/number-to-bn": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", - "integrity": "sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig==", - "dependencies": { - "bn.js": "4.11.6", - "strip-hex-prefix": "1.0.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, - "node_modules/number-to-bn/node_modules/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==" - }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "engines": { - "node": "*" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dependencies": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.getownpropertydescriptors": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.7.tgz", - "integrity": "sha512-PrJz0C2xJ58FNn11XV2lr4Jt5Gzl94qpy9Lu0JlfEj14z88sqbSBJCBEzdlNUCzY2gburhbrwOZ5BHCmuNUy0g==", - "dependencies": { - "array.prototype.reduce": "^1.0.6", - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "safe-array-concat": "^1.0.0" - }, - "engines": { - "node": ">= 0.8" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/obliterator": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", - "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==", - "peer": true - }, - "node_modules/oboe": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.5.tgz", - "integrity": "sha512-zRFWiF+FoicxEs3jNI/WYUrVEgA7DeET/InK0XQuudGHRg8iIob3cNPrJTKaz4004uaA9Pbe+Dwa8iluhjLZWA==", - "dependencies": { - "http-https": "^1.0.0" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "peer": true, - "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/ordinal": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/ordinal/-/ordinal-1.0.3.tgz", - "integrity": "sha512-cMddMgb2QElm8G7vdaa02jhUNbTSrhsgAGUz1OokD83uJTwSUn+nKoNoKVVaRa08yF6sgfO7Maou1+bgLd9rdQ==", - "peer": true - }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", - "engines": { - "node": ">=12.20" - } - }, - "node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "peer": true, - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", - "peer": true, - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "peer": true, - "dependencies": { - "aggregate-error": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/parse-cache-control": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", - "integrity": "sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==" - }, - "node_modules/parse-headers": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.5.tgz", - "integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==" - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "engines": { - "node": ">=4" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "peer": true - }, - "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "peer": true, - "engines": { - "node": "*" - } - }, - "node_modules/pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "peer": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", - "peer": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "node_modules/promise": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", - "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", - "dependencies": { - "asap": "~2.0.6" - } - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" - }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "engines": { - "node": ">=6" - } - }, - "node_modules/qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/query-string": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", - "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", - "dependencies": { - "decode-uri-component": "^0.2.0", - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "peer": true - }, - "node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "peer": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", - "peer": true, - "dependencies": { - "resolve": "^1.1.6" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/recursive-readdir": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", - "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", - "peer": true, - "dependencies": { - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/reduce-flatten": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", - "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" - }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", - "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "functions-have-names": "^1.2.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/req-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/req-cwd/-/req-cwd-2.0.0.tgz", - "integrity": "sha512-ueoIoLo1OfB6b05COxAA9UpeoscNpYyM+BqYlA7H6LVF4hKGPXQQSSaD2YmvDVJMkk4UDpAHIeU1zG53IqjvlQ==", - "dependencies": { - "req-from": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/req-from": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/req-from/-/req-from-2.0.0.tgz", - "integrity": "sha512-LzTfEVDVQHBRfjOUMgNBA+V6DWsSnoeKzf42J7l0xa/B4jyPOuuF5MlNSmomLNGemWTnV2TIdjSSLnEn95fOQA==", - "dependencies": { - "resolve-from": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/request-promise-core": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", - "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", - "dependencies": { - "lodash": "^4.17.19" - }, - "engines": { - "node": ">=0.10.0" - }, - "peerDependencies": { - "request": "^2.34" - } - }, - "node_modules/request-promise-native": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", - "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", - "deprecated": "request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142", - "dependencies": { - "request-promise-core": "1.1.4", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - }, - "engines": { - "node": ">=0.12.0" - }, - "peerDependencies": { - "request": "^2.34" - } - }, - "node_modules/request/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" - }, - "node_modules/resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "peer": true, - "dependencies": { - "path-parse": "^1.0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-alpn": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" - }, - "node_modules/resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/responselike": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", - "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", - "dependencies": { - "lowercase-keys": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/responselike/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "peer": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "node_modules/rlp": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", - "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", - "dependencies": { - "bn.js": "^5.2.0" - }, - "bin": { - "rlp": "bin/rlp" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "peer": true, - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/run-parallel-limit": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz", - "integrity": "sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "peer": true, - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/rustbn.js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", - "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==", - "peer": true - }, - "node_modules/safe-array-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", - "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", - "has-symbols": "^1.0.3", - "isarray": "^2.0.5" - }, - "engines": { - "node": ">=0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/safe-array-concat/node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safe-regex-test": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", - "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "is-regex": "^1.1.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/sc-istanbul": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/sc-istanbul/-/sc-istanbul-0.4.6.tgz", - "integrity": "sha512-qJFF/8tW/zJsbyfh/iT/ZM5QNHE3CXxtLJbZsL+CzdJLBsPD7SedJZoUA4d8iAcN2IoMp/Dx80shOOd2x96X/g==", - "peer": true, - "dependencies": { - "abbrev": "1.0.x", - "async": "1.x", - "escodegen": "1.8.x", - "esprima": "2.7.x", - "glob": "^5.0.15", - "handlebars": "^4.0.1", - "js-yaml": "3.x", - "mkdirp": "0.5.x", - "nopt": "3.x", - "once": "1.x", - "resolve": "1.1.x", - "supports-color": "^3.1.0", - "which": "^1.1.1", - "wordwrap": "^1.0.0" - }, - "bin": { - "istanbul": "lib/cli.js" - } - }, - "node_modules/sc-istanbul/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "peer": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/sc-istanbul/node_modules/glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==", - "peer": true, - "dependencies": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - } - }, - "node_modules/sc-istanbul/node_modules/has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sc-istanbul/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "peer": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/sc-istanbul/node_modules/js-yaml/node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "peer": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/sc-istanbul/node_modules/resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==", - "peer": true - }, - "node_modules/sc-istanbul/node_modules/supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==", - "peer": true, - "dependencies": { - "has-flag": "^1.0.0" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/scrypt-js": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" - }, - "node_modules/secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", - "hasInstallScript": true, - "dependencies": { - "elliptic": "^6.5.4", - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/send/node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", - "peer": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/servify": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", - "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", - "dependencies": { - "body-parser": "^1.16.0", - "cors": "^2.8.1", - "express": "^4.14.0", - "request": "^2.79.0", - "xhr": "^2.3.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" - }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "node_modules/sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "bin": { - "sha.js": "bin.js" - } - }, - "node_modules/sha1": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz", - "integrity": "sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA==", - "dependencies": { - "charenc": ">= 0.0.1", - "crypt": ">= 0.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/shelljs": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", - "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", - "peer": true, - "dependencies": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - }, - "bin": { - "shjs": "bin/shjs" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/simple-get": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.2.tgz", - "integrity": "sha512-Ijd/rV5o+mSBBs4F/x9oDPtTx9Zb6X9brmnXvMW4J7IR15ngi9q5xxqWBKU744jTZiaXtxaPL7uHG6vtN8kUkw==", - "dependencies": { - "decompress-response": "^3.3.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "node_modules/simple-get/node_modules/decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==", - "dependencies": { - "mimic-response": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/slice-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/slice-ansi/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/solc": { - "version": "0.8.10", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.10.tgz", - "integrity": "sha512-I/Mcn6J5bEtJqveNLplQm9IRrhemm6v+qkw5S2+wM4x9HItJ1sYdrqVTN3j4DMhFDM3ZbvM0QywVzpPx666PHw==", - "dependencies": { - "command-exists": "^1.2.8", - "commander": "^8.1.0", - "follow-redirects": "^1.12.1", - "fs-extra": "^0.30.0", - "js-sha3": "0.8.0", - "memorystream": "^0.3.1", - "require-from-string": "^2.0.0", - "semver": "^5.5.0", - "tmp": "0.0.33" - }, - "bin": { - "solcjs": "solcjs" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/solc/node_modules/fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - }, - "node_modules/solc/node_modules/jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/solc/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/solidity-coverage": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.4.tgz", - "integrity": "sha512-xeHOfBOjdMF6hWTbt42iH4x+7j1Atmrf5OldDPMxI+i/COdExUxszOswD9qqvcBTaLGiOrrpnh9UZjSpt4rBsg==", - "peer": true, - "dependencies": { - "@ethersproject/abi": "^5.0.9", - "@solidity-parser/parser": "^0.16.0", - "chalk": "^2.4.2", - "death": "^1.1.0", - "detect-port": "^1.3.0", - "difflib": "^0.2.4", - "fs-extra": "^8.1.0", - "ghost-testrpc": "^0.0.2", - "global-modules": "^2.0.0", - "globby": "^10.0.1", - "jsonschema": "^1.2.4", - "lodash": "^4.17.15", - "mocha": "7.1.2", - "node-emoji": "^1.10.0", - "pify": "^4.0.1", - "recursive-readdir": "^2.2.2", - "sc-istanbul": "^0.4.5", - "semver": "^7.3.4", - "shelljs": "^0.8.3", - "web3-utils": "^1.3.6" - }, - "bin": { - "solidity-coverage": "plugins/bin.js" - }, - "peerDependencies": { - "hardhat": "^2.11.0" - } - }, - "node_modules/solidity-coverage/node_modules/@solidity-parser/parser": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.1.tgz", - "integrity": "sha512-PdhRFNhbTtu3x8Axm0uYpqOy/lODYQK+MlYSgqIsq2L8SFYEHJPHNUiOTAJbDGzNjjr1/n9AcIayxafR/fWmYw==", - "peer": true, - "dependencies": { - "antlr4ts": "^0.5.0-alpha.4" - } - }, - "node_modules/solidity-coverage/node_modules/ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/solidity-coverage/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/solidity-coverage/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "peer": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/solidity-coverage/node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/solidity-coverage/node_modules/chokidar": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", - "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", - "peer": true, - "dependencies": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.1.1" - } - }, - "node_modules/solidity-coverage/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "peer": true, - "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "node_modules/solidity-coverage/node_modules/debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", - "peer": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/solidity-coverage/node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/solidity-coverage/node_modules/diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "peer": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/solidity-coverage/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "peer": true - }, - "node_modules/solidity-coverage/node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "peer": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/solidity-coverage/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "peer": true, - "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/solidity-coverage/node_modules/flat": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz", - "integrity": "sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==", - "peer": true, - "dependencies": { - "is-buffer": "~2.0.3" - }, - "bin": { - "flat": "cli.js" - } - }, - "node_modules/solidity-coverage/node_modules/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "peer": true, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/solidity-coverage/node_modules/fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "deprecated": "\"Please update to latest v2.3 or v2.2\"", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "peer": true, - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/solidity-coverage/node_modules/glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "peer": true, - "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/solidity-coverage/node_modules/js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "peer": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/solidity-coverage/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "peer": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/solidity-coverage/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "peer": true, - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/solidity-coverage/node_modules/log-symbols": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", - "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", - "peer": true, - "dependencies": { - "chalk": "^2.4.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/solidity-coverage/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "peer": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/solidity-coverage/node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/solidity-coverage/node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "peer": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/solidity-coverage/node_modules/mocha": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.1.2.tgz", - "integrity": "sha512-o96kdRKMKI3E8U0bjnfqW4QMk12MwZ4mhdBTf+B5a1q9+aq2HRnj+3ZdJu0B/ZhJeK78MgYuv6L8d/rA5AeBJA==", - "peer": true, - "dependencies": { - "ansi-colors": "3.2.3", - "browser-stdout": "1.3.1", - "chokidar": "3.3.0", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "3.0.0", - "minimatch": "3.0.4", - "mkdirp": "0.5.5", - "ms": "2.1.1", - "node-environment-flags": "1.0.6", - "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", - "wide-align": "1.1.3", - "yargs": "13.3.2", - "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha" - }, - "engines": { - "node": ">= 8.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" - } - }, - "node_modules/solidity-coverage/node_modules/ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "peer": true - }, - "node_modules/solidity-coverage/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==", - "peer": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/solidity-coverage/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "peer": true, - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/solidity-coverage/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/solidity-coverage/node_modules/readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", - "peer": true, - "dependencies": { - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/solidity-coverage/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "peer": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/solidity-coverage/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "peer": true, - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/solidity-coverage/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "peer": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/solidity-coverage/node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/solidity-coverage/node_modules/supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", - "peer": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/solidity-coverage/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "peer": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/solidity-coverage/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "peer": true, - "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/solidity-coverage/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==", - "peer": true - }, - "node_modules/solidity-coverage/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "peer": true - }, - "node_modules/solidity-coverage/node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "peer": true, - "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "node_modules/solidity-coverage/node_modules/yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "peer": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - }, - "node_modules/solidity-coverage/node_modules/yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", - "peer": true, - "dependencies": { - "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/source-map": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", - "integrity": "sha512-CBdZ2oa/BHhS4xj5DlhjWNHcan57/5YuvfdLf17iVmIpd9KRm+DFLmC6nBNj+6Ua7Kt3TmOjDpQT1aTYOQtoUA==", - "optional": true, - "peer": true, - "dependencies": { - "amdefine": ">=0.0.4" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "peer": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/source-map-support/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" - }, - "node_modules/sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sshpk/node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" - }, - "node_modules/stacktrace-parser": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz", - "integrity": "sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==", - "peer": true, - "dependencies": { - "type-fest": "^0.7.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/stacktrace-parser/node_modules/type-fest": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", - "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/streamsearch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", - "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/strict-uri-encode": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", - "integrity": "sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string-format": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/string-format/-/string-format-2.0.0.tgz", - "integrity": "sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==", - "peer": true - }, - "node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/string.prototype.trim": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", - "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimend": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", - "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", - "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-hex-prefix": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", - "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", - "dependencies": { - "is-hex-prefixed": "1.0.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "peer": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/swarm-js": { - "version": "0.1.42", - "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.42.tgz", - "integrity": "sha512-BV7c/dVlA3R6ya1lMlSSNPLYrntt0LUq4YMgy3iwpCIc6rZnS5W2wUoctarZ5pXlpKtxDDf9hNziEkcfrxdhqQ==", - "dependencies": { - "bluebird": "^3.5.0", - "buffer": "^5.0.5", - "eth-lib": "^0.1.26", - "fs-extra": "^4.0.2", - "got": "^11.8.5", - "mime-types": "^2.1.16", - "mkdirp-promise": "^5.0.1", - "mock-fs": "^4.1.0", - "setimmediate": "^1.0.5", - "tar": "^4.0.2", - "xhr-request": "^1.0.1" - } - }, - "node_modules/swarm-js/node_modules/@szmarczak/http-timer": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", - "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", - "dependencies": { - "defer-to-connect": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/swarm-js/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/swarm-js/node_modules/cacheable-lookup": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", - "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", - "engines": { - "node": ">=10.6.0" - } - }, - "node_modules/swarm-js/node_modules/fs-extra": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", - "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "node_modules/swarm-js/node_modules/got": { - "version": "11.8.6", - "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", - "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", - "dependencies": { - "@sindresorhus/is": "^4.0.0", - "@szmarczak/http-timer": "^4.0.5", - "@types/cacheable-request": "^6.0.1", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^5.0.3", - "cacheable-request": "^7.0.2", - "decompress-response": "^6.0.0", - "http2-wrapper": "^1.0.0-beta.5.2", - "lowercase-keys": "^2.0.0", - "p-cancelable": "^2.0.0", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=10.19.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, - "node_modules/swarm-js/node_modules/http2-wrapper": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", - "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.0.0" - }, - "engines": { - "node": ">=10.19.0" - } - }, - "node_modules/swarm-js/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/swarm-js/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/swarm-js/node_modules/p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/swarm-js/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/sync-request": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.1.0.tgz", - "integrity": "sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw==", - "dependencies": { - "http-response-object": "^3.0.1", - "sync-rpc": "^1.2.1", - "then-request": "^6.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/sync-rpc": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/sync-rpc/-/sync-rpc-1.3.6.tgz", - "integrity": "sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw==", - "dependencies": { - "get-port": "^3.1.0" - } - }, - "node_modules/table": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", - "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", - "dependencies": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table-layout": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", - "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", - "peer": true, - "dependencies": { - "array-back": "^4.0.1", - "deep-extend": "~0.6.0", - "typical": "^5.2.0", - "wordwrapjs": "^4.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/table-layout/node_modules/array-back": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", - "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/table-layout/node_modules/typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/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/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, - "node_modules/table/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/tar": { - "version": "4.4.19", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz", - "integrity": "sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==", - "dependencies": { - "chownr": "^1.1.4", - "fs-minipass": "^1.2.7", - "minipass": "^2.9.0", - "minizlib": "^1.3.3", - "mkdirp": "^0.5.5", - "safe-buffer": "^5.2.1", - "yallist": "^3.1.1" - }, - "engines": { - "node": ">=4.5" - } - }, - "node_modules/then-request": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/then-request/-/then-request-6.0.2.tgz", - "integrity": "sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA==", - "dependencies": { - "@types/concat-stream": "^1.6.0", - "@types/form-data": "0.0.33", - "@types/node": "^8.0.0", - "@types/qs": "^6.2.31", - "caseless": "~0.12.0", - "concat-stream": "^1.6.0", - "form-data": "^2.2.0", - "http-basic": "^8.1.1", - "http-response-object": "^3.0.1", - "promise": "^8.0.0", - "qs": "^6.4.0" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/then-request/node_modules/@types/node": { - "version": "8.10.66", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz", - "integrity": "sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==" - }, - "node_modules/timed-out": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "integrity": "sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "node_modules/ts-command-line-args": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/ts-command-line-args/-/ts-command-line-args-2.5.1.tgz", - "integrity": "sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw==", - "peer": true, - "dependencies": { - "chalk": "^4.1.0", - "command-line-args": "^5.1.1", - "command-line-usage": "^6.1.0", - "string-format": "^2.0.0" - }, - "bin": { - "write-markdown": "dist/write-markdown.js" - } - }, - "node_modules/ts-command-line-args/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "peer": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/ts-command-line-args/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "peer": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/ts-command-line-args/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "peer": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/ts-command-line-args/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "peer": true - }, - "node_modules/ts-command-line-args/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ts-command-line-args/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "peer": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ts-essentials": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-7.0.3.tgz", - "integrity": "sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==", - "peer": true, - "peerDependencies": { - "typescript": ">=3.7.0" - } - }, - "node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", - "peer": true, - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, - "node_modules/ts-node/node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "peer": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" - }, - "node_modules/tsort": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", - "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", - "peer": true - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", - "peer": true - }, - "node_modules/tweetnacl-util": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", - "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", - "peer": true - }, - "node_modules/type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" - }, - "node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "peer": true, - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/typechain": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/typechain/-/typechain-8.3.1.tgz", - "integrity": "sha512-fA7clol2IP/56yq6vkMTR+4URF1nGjV82Wx6Rf09EsqD4tkzMAvEaqYxVFCavJm/1xaRga/oD55K+4FtuXwQOQ==", - "peer": true, - "dependencies": { - "@types/prettier": "^2.1.1", - "debug": "^4.3.1", - "fs-extra": "^7.0.0", - "glob": "7.1.7", - "js-sha3": "^0.8.0", - "lodash": "^4.17.15", - "mkdirp": "^1.0.4", - "prettier": "^2.3.1", - "ts-command-line-args": "^2.2.0", - "ts-essentials": "^7.0.1" - }, - "bin": { - "typechain": "dist/cli/cli.js" - }, - "peerDependencies": { - "typescript": ">=4.3.0" - } - }, - "node_modules/typechain/node_modules/fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "peer": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/typechain/node_modules/glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "peer": true, - "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": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/typechain/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "peer": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/typechain/node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "peer": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/typechain/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "peer": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/typed-array-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", - "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", - "is-typed-array": "^1.1.10" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/typed-array-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", - "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", - "dependencies": { - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-byte-offset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", - "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", - "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-length": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", - "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", - "dependencies": { - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "is-typed-array": "^1.1.9" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" - }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, - "node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", - "peer": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/typical": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", - "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/uglify-js": { - "version": "3.17.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", - "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", - "optional": true, - "peer": true, - "bin": { - "uglifyjs": "bin/uglifyjs" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/ultron": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", - "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==" - }, - "node_modules/unbox-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", - "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", - "dependencies": { - "call-bind": "^1.0.2", - "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/undici": { - "version": "5.24.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.24.0.tgz", - "integrity": "sha512-OKlckxBjFl0oXxcj9FU6oB8fDAaiRUq+D8jrFWGmOfI/gIyjk/IeS75LMzgYKUaeHzLUcYvf9bbJGSrUwTfwwQ==", - "dependencies": { - "busboy": "^1.6.0" - }, - "engines": { - "node": ">=14.0" - } - }, - "node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/url-set-query": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-set-query/-/url-set-query-1.0.0.tgz", - "integrity": "sha512-3AChu4NiXquPfeckE5R5cGdiHCMWJx1dwCWOmWIL4KHAziJNOFIYJlpGFeKDvwLPHovZRCxK3cYlwzqI9Vp+Gg==" - }, - "node_modules/utf-8-validate": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "hasInstallScript": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, - "node_modules/utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", - "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==" - }, - "node_modules/util": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", - "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", - "dependencies": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "which-typed-array": "^1.1.2" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "peer": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "peer": true - }, - "node_modules/varint": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "node_modules/web3": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.10.2.tgz", - "integrity": "sha512-DAtZ3a3ruPziE80uZ3Ob0YDZxt6Vk2un/F5BcBrxO70owJ9Z1Y2+loZmbh1MoAmoLGjA/SUSHeUtid3fYmBaog==", - "hasInstallScript": true, - "dependencies": { - "web3-bzz": "1.10.2", - "web3-core": "1.10.2", - "web3-eth": "1.10.2", - "web3-eth-personal": "1.10.2", - "web3-net": "1.10.2", - "web3-shh": "1.10.2", - "web3-utils": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-bzz": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.10.2.tgz", - "integrity": "sha512-vLOfDCj6198Qc7esDrCKeFA/M3ZLbowsaHQ0hIL4NmIHoq7lU8aSRTa5AI+JBh8cKN1gVryJsuW2ZCc5bM4I4Q==", - "hasInstallScript": true, - "dependencies": { - "@types/node": "^12.12.6", - "got": "12.1.0", - "swarm-js": "^0.1.40" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-bzz/node_modules/@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" - }, - "node_modules/web3-core": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.10.2.tgz", - "integrity": "sha512-qTn2UmtE8tvwMRsC5pXVdHxrQ4uZ6jiLgF5DRUVtdi7dPUmX18Dp9uxKfIfhGcA011EAn8P6+X7r3pvi2YRxBw==", - "dependencies": { - "@types/bn.js": "^5.1.1", - "@types/node": "^12.12.6", - "bignumber.js": "^9.0.0", - "web3-core-helpers": "1.10.2", - "web3-core-method": "1.10.2", - "web3-core-requestmanager": "1.10.2", - "web3-utils": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-core-helpers": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.10.2.tgz", - "integrity": "sha512-1JfaNtox6/ZYJHNoI+QVc2ObgwEPeGF+YdxHZQ7aF5605BmlwM1Bk3A8xv6mg64jIRvEq1xX6k9oG6x7p1WgXQ==", - "dependencies": { - "web3-eth-iban": "1.10.2", - "web3-utils": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-core-method": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.10.2.tgz", - "integrity": "sha512-gG6ES+LOuo01MJHML4gnEt702M8lcPGMYZoX8UjZzmEebGrPYOY9XccpCrsFgCeKgQzM12SVnlwwpMod1+lcLg==", - "dependencies": { - "@ethersproject/transactions": "^5.6.2", - "web3-core-helpers": "1.10.2", - "web3-core-promievent": "1.10.2", - "web3-core-subscriptions": "1.10.2", - "web3-utils": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-core-promievent": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.10.2.tgz", - "integrity": "sha512-Qkkb1dCDOU8dZeORkcwJBQRAX+mdsjx8LqFBB+P4W9QgwMqyJ6LXda+y1XgyeEVeKEmY1RCeTq9Y94q1v62Sfw==", - "dependencies": { - "eventemitter3": "4.0.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-core-requestmanager": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.10.2.tgz", - "integrity": "sha512-nlLeNJUu6fR+ZbJr2k9Du/nN3VWwB4AJPY4r6nxUODAmykgJq57T21cLP/BEk6mbiFQYGE9TrrPhh4qWxQEtAw==", - "dependencies": { - "util": "^0.12.5", - "web3-core-helpers": "1.10.2", - "web3-providers-http": "1.10.2", - "web3-providers-ipc": "1.10.2", - "web3-providers-ws": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-core-subscriptions": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.10.2.tgz", - "integrity": "sha512-MiWcKjz4tco793EPPPLc/YOJmYUV3zAfxeQH/UVTfBejMfnNvmfwKa2SBKfPIvKQHz/xI5bV2TF15uvJEucU7w==", - "dependencies": { - "eventemitter3": "4.0.4", - "web3-core-helpers": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-core/node_modules/@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" - }, - "node_modules/web3-eth": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.10.2.tgz", - "integrity": "sha512-s38rhrntyhGShmXC4R/aQtfkpcmev9c7iZwgb9CDIBFo7K8nrEJvqIOyajeZTxnDIiGzTJmrHxiKSadii5qTRg==", - "dependencies": { - "web3-core": "1.10.2", - "web3-core-helpers": "1.10.2", - "web3-core-method": "1.10.2", - "web3-core-subscriptions": "1.10.2", - "web3-eth-abi": "1.10.2", - "web3-eth-accounts": "1.10.2", - "web3-eth-contract": "1.10.2", - "web3-eth-ens": "1.10.2", - "web3-eth-iban": "1.10.2", - "web3-eth-personal": "1.10.2", - "web3-net": "1.10.2", - "web3-utils": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-eth-abi": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.10.2.tgz", - "integrity": "sha512-pY4fQUio7W7ZRSLf+vsYkaxJqaT/jHcALZjIxy+uBQaYAJ3t6zpQqMZkJB3Dw7HUODRJ1yI0NPEFGTnkYf/17A==", - "dependencies": { - "@ethersproject/abi": "^5.6.3", - "web3-utils": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-eth-accounts": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.10.2.tgz", - "integrity": "sha512-6/HhCBYAXN/f553/SyxS9gY62NbLgpD1zJpENcvRTDpJN3Znvli1cmpl5Q3ZIUJkvHnG//48EWfWh0cbb3fbKQ==", - "dependencies": { - "@ethereumjs/common": "2.5.0", - "@ethereumjs/tx": "3.3.2", - "@ethereumjs/util": "^8.1.0", - "eth-lib": "0.2.8", - "scrypt-js": "^3.0.1", - "uuid": "^9.0.0", - "web3-core": "1.10.2", - "web3-core-helpers": "1.10.2", - "web3-core-method": "1.10.2", - "web3-utils": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-eth-accounts/node_modules/@ethereumjs/common": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.5.0.tgz", - "integrity": "sha512-DEHjW6e38o+JmB/NO3GZBpW4lpaiBpkFgXF6jLcJ6gETBYpEyaA5nTimsWBUJR3Vmtm/didUEbNjajskugZORg==", - "dependencies": { - "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.1" - } - }, - "node_modules/web3-eth-accounts/node_modules/@ethereumjs/rlp": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", - "integrity": "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==", - "bin": { - "rlp": "bin/rlp" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/web3-eth-accounts/node_modules/@ethereumjs/tx": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.3.2.tgz", - "integrity": "sha512-6AaJhwg4ucmwTvw/1qLaZUX5miWrwZ4nLOUsKyb/HtzS3BMw/CasKhdi1ims9mBKeK9sOJCH4qGKOBGyJCeeog==", - "dependencies": { - "@ethereumjs/common": "^2.5.0", - "ethereumjs-util": "^7.1.2" - } - }, - "node_modules/web3-eth-accounts/node_modules/@ethereumjs/util": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", - "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", - "dependencies": { - "@ethereumjs/rlp": "^4.0.1", - "ethereum-cryptography": "^2.0.0", - "micro-ftch": "^0.3.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/web3-eth-accounts/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "node_modules/web3-eth-accounts/node_modules/eth-lib": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", - "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", - "dependencies": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" - } - }, - "node_modules/web3-eth-accounts/node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/web3-eth-contract": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.10.2.tgz", - "integrity": "sha512-CZLKPQRmupP/+OZ5A/CBwWWkBiz5B/foOpARz0upMh1yjb0dEud4YzRW2gJaeNu0eGxDLsWVaXhUimJVGYprQw==", - "dependencies": { - "@types/bn.js": "^5.1.1", - "web3-core": "1.10.2", - "web3-core-helpers": "1.10.2", - "web3-core-method": "1.10.2", - "web3-core-promievent": "1.10.2", - "web3-core-subscriptions": "1.10.2", - "web3-eth-abi": "1.10.2", - "web3-utils": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-eth-ens": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.10.2.tgz", - "integrity": "sha512-kTQ42UdNHy4BQJHgWe97bHNMkc3zCMBKKY7t636XOMxdI/lkRdIjdE5nQzt97VjQvSVasgIWYKRAtd8aRaiZiQ==", - "dependencies": { - "content-hash": "^2.5.2", - "eth-ens-namehash": "2.0.8", - "web3-core": "1.10.2", - "web3-core-helpers": "1.10.2", - "web3-core-promievent": "1.10.2", - "web3-eth-abi": "1.10.2", - "web3-eth-contract": "1.10.2", - "web3-utils": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-eth-iban": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.10.2.tgz", - "integrity": "sha512-y8+Ii2XXdyHQMFNL2NWpBnXe+TVJ4ryvPlzNhObRRnIo4O4nLIXS010olLDMayozDzoUlmzCmBZJYc9Eev1g7A==", - "dependencies": { - "bn.js": "^5.2.1", - "web3-utils": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-eth-personal": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.10.2.tgz", - "integrity": "sha512-+vEbJsPUJc5J683y0c2aN645vXC+gPVlFVCQu4IjPvXzJrAtUfz26+IZ6AUOth4fDJPT0f1uSLS5W2yrUdw9BQ==", - "dependencies": { - "@types/node": "^12.12.6", - "web3-core": "1.10.2", - "web3-core-helpers": "1.10.2", - "web3-core-method": "1.10.2", - "web3-net": "1.10.2", - "web3-utils": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-eth-personal/node_modules/@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" - }, - "node_modules/web3-net": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.10.2.tgz", - "integrity": "sha512-w9i1t2z7dItagfskhaCKwpp6W3ylUR88gs68u820y5f8yfK5EbPmHc6c2lD8X9ZrTnmDoeOpIRCN/RFPtZCp+g==", - "dependencies": { - "web3-core": "1.10.2", - "web3-core-method": "1.10.2", - "web3-utils": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-providers-http": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.10.2.tgz", - "integrity": "sha512-G8abKtpkyKGpRVKvfjIF3I4O/epHP7mxXWN8mNMQLkQj1cjMFiZBZ13f+qI77lNJN7QOf6+LtNdKrhsTGU72TA==", - "dependencies": { - "abortcontroller-polyfill": "^1.7.5", - "cross-fetch": "^4.0.0", - "es6-promise": "^4.2.8", - "web3-core-helpers": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-providers-ipc": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.10.2.tgz", - "integrity": "sha512-lWbn6c+SgvhLymU8u4Ea/WOVC0Gqs7OJUvauejWz+iLycxeF0xFNyXnHVAi42ZJDPVI3vnfZotafoxcNNL7Sug==", - "dependencies": { - "oboe": "2.1.5", - "web3-core-helpers": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-providers-ws": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.10.2.tgz", - "integrity": "sha512-3nYSiP6grI5GvpkSoehctSywfCTodU21VY8bUtXyFHK/IVfDooNtMpd5lVIMvXVAlaxwwrCfjebokaJtKH2Iag==", - "dependencies": { - "eventemitter3": "4.0.4", - "web3-core-helpers": "1.10.2", - "websocket": "^1.0.32" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-shh": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.10.2.tgz", - "integrity": "sha512-UP0Kc3pHv9uULFu0+LOVfPwKBSJ6B+sJ5KflF7NyBk6TvNRxlpF3hUhuaVDCjjB/dDUR6T0EQeg25FA2uzJbag==", - "hasInstallScript": true, - "dependencies": { - "web3-core": "1.10.2", - "web3-core-method": "1.10.2", - "web3-core-subscriptions": "1.10.2", - "web3-net": "1.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-utils": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.2.tgz", - "integrity": "sha512-TdApdzdse5YR+5GCX/b/vQnhhbj1KSAtfrDtRW7YS0kcWp1gkJsN62gw6GzCaNTeXookB7UrLtmDUuMv65qgow==", - "dependencies": { - "@ethereumjs/util": "^8.1.0", - "bn.js": "^5.2.1", - "ethereum-bloom-filters": "^1.0.6", - "ethereum-cryptography": "^2.1.2", - "ethjs-unit": "0.1.6", - "number-to-bn": "1.7.0", - "randombytes": "^2.1.0", - "utf8": "3.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/web3-utils/node_modules/@ethereumjs/rlp": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", - "integrity": "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==", - "bin": { - "rlp": "bin/rlp" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/web3-utils/node_modules/@ethereumjs/util": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", - "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", - "dependencies": { - "@ethereumjs/rlp": "^4.0.1", - "ethereum-cryptography": "^2.0.0", - "micro-ftch": "^0.3.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/web3js-quorum": { - "version": "22.4.0", - "resolved": "https://registry.npmjs.org/web3js-quorum/-/web3js-quorum-22.4.0.tgz", - "integrity": "sha512-mrziohkZGBXQnN6j9i96KoFQxreOljwFrjce6FiPChIsw7gP0WLb9S/g0+lgl4ODudrXHr5I0KEOLd+6Myo91w==", - "dependencies": { - "ethereumjs-tx": "^2.1.2", - "ethereumjs-util": "6.2.1", - "lodash": "^4.17.21", - "request-promise-native": "^1.0.9", - "rlp": "2.2.7" - }, - "peerDependencies": { - "web3": "^1.x" - } - }, - "node_modules/web3js-quorum/node_modules/@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/web3js-quorum/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "node_modules/web3js-quorum/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/web3js-quorum/node_modules/ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "dependencies": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "node_modules/websocket": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", - "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", - "dependencies": { - "bufferutil": "^4.0.1", - "debug": "^2.2.0", - "es5-ext": "^0.10.50", - "typedarray-to-buffer": "^3.1.5", - "utf-8-validate": "^5.0.2", - "yaeti": "^0.0.6" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/websocket/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/websocket/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-module": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", - "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" - }, - "node_modules/which-typed-array": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", - "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", - "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dependencies": { - "string-width": "^1.0.2 || 2" - } - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "peer": true - }, - "node_modules/wordwrapjs": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", - "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", - "peer": true, - "dependencies": { - "reduce-flatten": "^2.0.0", - "typical": "^5.2.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/wordwrapjs/node_modules/typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/workerpool": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", - "peer": true - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "peer": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "peer": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "peer": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/wrap-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "peer": true - }, - "node_modules/wrap-ansi/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==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/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==", - "peer": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, - "node_modules/ws": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xhr": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", - "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==", - "dependencies": { - "global": "~4.4.0", - "is-function": "^1.0.1", - "parse-headers": "^2.0.0", - "xtend": "^4.0.0" - } - }, - "node_modules/xhr-request": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.1.0.tgz", - "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", - "dependencies": { - "buffer-to-arraybuffer": "^0.0.5", - "object-assign": "^4.1.1", - "query-string": "^5.0.1", - "simple-get": "^2.7.0", - "timed-out": "^4.0.1", - "url-set-query": "^1.0.0", - "xhr": "^2.0.4" - } - }, - "node_modules/xhr-request-promise": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz", - "integrity": "sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg==", - "dependencies": { - "xhr-request": "^1.1.0" - } - }, - "node_modules/xmlhttprequest": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", - "integrity": "sha512-58Im/U0mlVBLM38NdZjHyhuMtCqa61469k2YP/AaPbvCoV9aQGUpbJBj1QRm2ytRiVQBD/fsw7L2bJGDVQswBA==", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "engines": { - "node": ">=0.4" - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yaeti": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==", - "engines": { - "node": ">=0.10.32" - } - }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" - }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "peer": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "peer": true, - "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs/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==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/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==", - "peer": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} diff --git a/smart_contracts/package.json b/smart_contracts/package.json index 7653a6bb..f4e34834 100644 --- a/smart_contracts/package.json +++ b/smart_contracts/package.json @@ -18,7 +18,6 @@ "demo/roles": "yarn run-on-besu demos/role-control.ts", "demo/validators": "yarn run-on-besu demos/validator-control.ts", "demo/flow": "yarn run-on-besu demos/flow.ts", - "demo/flow-with-did-ethr": "yarn run-on-besu demos/flow-with-did-ethr.ts", "demo/account": "yarn run-on-besu demos/account-control.ts", "demo/upgrade": "yarn run-on-besu demos/upgrade-control.ts", "genesis/generate": "ts-node scripts/genesis/generate.ts", @@ -39,7 +38,7 @@ "ethers": "6.8.0", "ethr-did-registry": "^1.2.0", "fs-extra": "^10.0.0", - "hardhat-gas-reporter": "^1.0.8", + "hardhat-gas-reporter": "^1.0.9", "prettier-plugin-solidity": "^1.1.3", "solc": "0.8.20", "web3": "1.10.2", @@ -56,14 +55,14 @@ "@types/fs-extra": "^11.0.2", "@types/mocha": "^9.0.0", "chai": "^4.3.0", - "hardhat": "^2.17.2", + "hardhat": "^2.19.4", "hardhat-dependency-compiler": "^1.1.3", "hardhat-storage-layout": "^0.1.7", "husky": "^8.0.3", "prettier": "^2.7.1", "solhint": "^3.6.2", "solhint-plugin-prettier": "^0.0.5", - "solidity-coverage": "^0.8.4", + "solidity-coverage": "^0.8.6", "ts-node": "^10.2.1", "tslint": "^6.1.3", "tslint-config-prettier": "^1.18.0", diff --git a/smart_contracts/scripts/genesis/config.ts b/smart_contracts/scripts/genesis/config.ts index 163057ce..45974daf 100644 --- a/smart_contracts/scripts/genesis/config.ts +++ b/smart_contracts/scripts/genesis/config.ts @@ -2,11 +2,8 @@ import { AccountControlConfig, CredentialDefinitionsConfig, EthereumDidRegistryConfig, - IndyDidRegistryConfig, - IndyDidValidatorConfig, RolesConfig, SchemasConfig, - UniversalDidResolverConfig, ValidatorsConfig, } from './contracts' import { UpgradeControlConfig } from './contracts/upgradeControl' @@ -18,27 +15,21 @@ export const outFile = 'ContractsGenesis.json' export interface Config { accountControl: AccountControlConfig credentialDefinitionRegistry: CredentialDefinitionsConfig - indyDidValidator: IndyDidValidatorConfig - indyDidRegistry: IndyDidRegistryConfig ethereumDidRegistry: EthereumDidRegistryConfig roleControl: RolesConfig schemaRegistry: SchemasConfig - universalDidResolver: UniversalDidResolverConfig upgradeControl: UpgradeControlConfig validatorControl: ValidatorsConfig } const contractsAddresses = { - didValidator: '0x0000000000000000000000000000000000002222', - didRegistry: '0x0000000000000000000000000000000000003333', credentialDefinitionRegistry: '0x0000000000000000000000000000000000004444', schemas: '0x0000000000000000000000000000000000005555', roles: '0x0000000000000000000000000000000000006666', validators: '0x0000000000000000000000000000000000007777', accountControl: '0x0000000000000000000000000000000000008888', upgradeControl: '0x0000000000000000000000000000000000009999', - universalDidResolver: '0x000000000000000000000000000000000019999', - ethereumDIDRegistry: '0x0000000000000000000000000000000000018888', + ethereumDidRegistry: '0x0000000000000000000000000000000000018888', } export const config: Config = { @@ -57,29 +48,14 @@ export const config: Config = { description: 'Smart contract to manage credential definitions', data: { credentialDefinitions: [], - universalDidResolverAddress: contractsAddresses.universalDidResolver, + ethereumDidRegistry: contractsAddresses.ethereumDidRegistry, schemaRegistryAddress: contractsAddresses.schemas, upgradeControlAddress: contractsAddresses.upgradeControl, }, }, - indyDidValidator: { - name: 'IndyDidValidator', - address: contractsAddresses.didValidator, - description: 'Library to validate DID', - }, - indyDidRegistry: { - name: 'IndyDidRegistry', - address: contractsAddresses.didRegistry, - description: 'Smart contract to manage DIDs', - libraries: { 'contracts/did/IndyDidValidator.sol:IndyDidValidator': contractsAddresses.didValidator }, - data: { - dids: [], - upgradeControlAddress: contractsAddresses.upgradeControl, - }, - }, ethereumDidRegistry: { name: 'EthereumExtDidRegistry', - address: contractsAddresses.ethereumDIDRegistry, + address: contractsAddresses.ethereumDidRegistry, description: 'Ethereum registry for ERC-1056 ethr did methods', }, roleControl: { @@ -123,17 +99,7 @@ export const config: Config = { description: 'Smart contract to manage schemas', data: { schemas: [], - universalDidResolverAddress: contractsAddresses.universalDidResolver, - upgradeControlAddress: contractsAddresses.upgradeControl, - }, - }, - universalDidResolver: { - name: 'UniversalDidResolver', - address: contractsAddresses.universalDidResolver, - description: 'Smart contract to resolve DIDs from various DID registries', - data: { - etheriumDidRegistryAddress: contractsAddresses.ethereumDIDRegistry, - didRegistryAddress: contractsAddresses.didRegistry, + ethereumDidRegistry: contractsAddresses.ethereumDidRegistry, upgradeControlAddress: contractsAddresses.upgradeControl, }, }, diff --git a/smart_contracts/scripts/genesis/contracts/credentialDefinitionRegistry.ts b/smart_contracts/scripts/genesis/contracts/credentialDefinitionRegistry.ts index 5a989ae1..bd3cd55a 100644 --- a/smart_contracts/scripts/genesis/contracts/credentialDefinitionRegistry.ts +++ b/smart_contracts/scripts/genesis/contracts/credentialDefinitionRegistry.ts @@ -6,7 +6,7 @@ import { buildProxySection, slots } from '../helpers' export interface CredentialDefinitionsConfig extends ContractConfig { data: { credentialDefinitions: Array<{ id: string; data: { name: string } }> - universalDidResolverAddress: string + ethereumDidRegistry: string schemaRegistryAddress: string upgradeControlAddress: string } @@ -19,7 +19,7 @@ export function credentialDefinitionRegistry() { // address of upgrade control contact stored in slot 0 storage[slots['0']] = padLeft(data.upgradeControlAddress, 64) // address of DID registry contact stored in slot 1 - storage[slots['1']] = padLeft(data.universalDidResolverAddress, 64) + storage[slots['1']] = padLeft(data.ethereumDidRegistry, 64) // address of schema registry contact stored in slot 2 storage[slots['2']] = padLeft(data.schemaRegistryAddress, 64) return buildProxySection(name, address, description, storage) diff --git a/smart_contracts/scripts/genesis/contracts/index.ts b/smart_contracts/scripts/genesis/contracts/index.ts index 58c83a6b..d9d9ba09 100644 --- a/smart_contracts/scripts/genesis/contracts/index.ts +++ b/smart_contracts/scripts/genesis/contracts/index.ts @@ -1,10 +1,7 @@ export * from './accountControl' export * from './credentialDefinitionRegistry' -export * from './indyDidRegistry' -export * from './indyDidValidator' export * from './ethereumDidRegistry' export * from './roleControl' export * from './schemaRegistry' -export * from './universalDidResolver' export * from './upgradeControl' export * from './validatorControl' diff --git a/smart_contracts/scripts/genesis/contracts/indyDidRegistry.ts b/smart_contracts/scripts/genesis/contracts/indyDidRegistry.ts deleted file mode 100644 index aef6b6db..00000000 --- a/smart_contracts/scripts/genesis/contracts/indyDidRegistry.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { padLeft } from 'web3-utils' -import { config } from '../config' -import { ContractConfig } from '../contractConfig' -import { buildProxySection, slots } from '../helpers' - -export interface IndyDidRegistryConfig extends ContractConfig { - libraries: { [libraryName: string]: string } - data: { - dids: Array<{ id: string; data: any }> - upgradeControlAddress: string - } -} - -export function indyDidRegistry() { - const { name, address, description, libraries, data } = config.indyDidRegistry - const storage: any = {} - - storage[slots['0']] = padLeft(data.upgradeControlAddress, 64) - return buildProxySection(name, address, description, storage, libraries) -} diff --git a/smart_contracts/scripts/genesis/contracts/indyDidValidator.ts b/smart_contracts/scripts/genesis/contracts/indyDidValidator.ts deleted file mode 100644 index 4072121c..00000000 --- a/smart_contracts/scripts/genesis/contracts/indyDidValidator.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { config } from '../config' -import { ContractConfig } from '../contractConfig' -import { buildSection } from '../helpers' - -export interface IndyDidValidatorConfig extends ContractConfig {} - -export function indyDidValidator() { - const { name, address, description } = config.indyDidValidator - const storage: any = {} - return buildSection(name, address, description, storage) -} diff --git a/smart_contracts/scripts/genesis/contracts/schemaRegistry.ts b/smart_contracts/scripts/genesis/contracts/schemaRegistry.ts index 1e751142..187f2d9c 100644 --- a/smart_contracts/scripts/genesis/contracts/schemaRegistry.ts +++ b/smart_contracts/scripts/genesis/contracts/schemaRegistry.ts @@ -6,7 +6,7 @@ import { buildProxySection, slots } from '../helpers' export interface SchemasConfig extends ContractConfig { data: { schemas: Array<{ id: string; data: { name: string } }> - universalDidResolverAddress: string + ethereumDidRegistry: string upgradeControlAddress: string } } @@ -18,6 +18,6 @@ export function schemaRegistry() { // address of upgrade control contact stored in slot 0 storage[slots['0']] = padLeft(data.upgradeControlAddress, 64) // address of DID resolver contact stored in slot 1 - storage[slots['1']] = padLeft(data.universalDidResolverAddress, 64) + storage[slots['1']] = padLeft(data.ethereumDidRegistry, 64) return buildProxySection(name, address, description, storage) } diff --git a/smart_contracts/scripts/genesis/contracts/universalDidResolver.ts b/smart_contracts/scripts/genesis/contracts/universalDidResolver.ts deleted file mode 100644 index 9f9bcdb3..00000000 --- a/smart_contracts/scripts/genesis/contracts/universalDidResolver.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { padLeft } from 'web3-utils' -import { config } from '../config' -import { ContractConfig } from '../contractConfig' -import { buildProxySection, slots } from '../helpers' - -export interface UniversalDidResolverConfig extends ContractConfig { - data: { - didRegistryAddress: string - etheriumDidRegistryAddress: string - upgradeControlAddress: string - } -} - -export function universalDidResolver() { - const { name, address, description, data } = config.universalDidResolver - const storage: any = {} - - // address of upgrade control contact stored in slot 0 - storage[slots['0']] = padLeft(data.upgradeControlAddress, 64) - // address of DID registry contact stored in slot 1 - storage[slots['1']] = padLeft(data.didRegistryAddress, 64) - // address of etherium DID registry contact stored in slot 2 - storage[slots['2']] = padLeft(data.etheriumDidRegistryAddress, 64) - return buildProxySection(name, address, description, storage) -} diff --git a/smart_contracts/scripts/genesis/generate.ts b/smart_contracts/scripts/genesis/generate.ts index a0abfcba..93d5737f 100644 --- a/smart_contracts/scripts/genesis/generate.ts +++ b/smart_contracts/scripts/genesis/generate.ts @@ -4,11 +4,8 @@ import { accountControl, credentialDefinitionRegistry, ethereumDidRegistry, - indyDidRegistry, - indyDidValidator, roleControl, schemaRegistry, - universalDidResolver, upgradeControl, validatorControl, } from './contracts' @@ -19,10 +16,7 @@ function main() { ...roleControl(), ...validatorControl(), ...upgradeControl(), - ...indyDidValidator(), - ...indyDidRegistry(), ...ethereumDidRegistry(), - ...universalDidResolver(), ...schemaRegistry(), ...credentialDefinitionRegistry(), } diff --git a/smart_contracts/test/cl/CredentialDefinitionRegistry.spec.ts b/smart_contracts/test/cl/CredentialDefinitionRegistry.spec.ts index 6fe07670..7faeb5b8 100644 --- a/smart_contracts/test/cl/CredentialDefinitionRegistry.spec.ts +++ b/smart_contracts/test/cl/CredentialDefinitionRegistry.spec.ts @@ -1,37 +1,46 @@ import { expect } from 'chai' -import { IndyDidRegistry } from '../../contracts-ts' +import { keccak256, toUtf8Bytes } from 'ethers' +import { EthereumExtDidRegistry } from '../../contracts-ts' import { createCredentialDefinitionObject } from '../../utils' import { createDid, createSchema, + createSchemaSigned, deployCredentialDefinitionRegistry, + signCredDefEndorsementData, TestableCredentialDefinitionRegistry, TestableSchemaRegistry, + testActorAddress, + testActorPrivateKey, } from '../utils/contract-helpers' import { ClErrors } from '../utils/errors' import { TestAccounts } from '../utils/test-entities' describe('CredentialDefinitionRegistry', function () { - let didRegistry: IndyDidRegistry + let didRegistry: EthereumExtDidRegistry let schemaRegistry: TestableSchemaRegistry let credentialDefinitionRegistry: TestableCredentialDefinitionRegistry let testAccounts: TestAccounts let schemaId: string - const issuerId = 'did:indy2:mainnet:SEp33q43PsdP7nDATyySSH' + let issuer: string beforeEach(async function () { const { - indyDidRegistry: didRegistryInit, + didRegistry: didRegistryInit, schemaRegistry: schemaRegistryInit, credentialDefinitionRegistry: credentialDefinitionRegistryInit, testAccounts: testAccountsInit, } = await deployCredentialDefinitionRegistry() + issuer = testAccountsInit.trustee.account.address didRegistryInit.connect(testAccountsInit.trustee.account) schemaRegistryInit.connect(testAccountsInit.trustee.account) credentialDefinitionRegistryInit.connect(testAccountsInit.trustee.account) + + const issuerId = `did:ethr:mainnet:${issuer}` await createDid(didRegistryInit, testAccountsInit.trustee.account.address, issuerId) - const { id } = await createSchema(schemaRegistryInit, issuerId) + + const { id } = await createSchema(schemaRegistryInit, issuer) didRegistry = didRegistryInit testAccounts = testAccountsInit @@ -41,117 +50,133 @@ describe('CredentialDefinitionRegistry', function () { }) describe('Add/Resolve Credential Definition', function () { - it('Should create and resolve Credential Definition', async function () { - const { id, credDef } = createCredentialDefinitionObject({ issuerId, schemaId }) + it('Should create Credential Definition', async function () { + const { id, credDef } = createCredentialDefinitionObject({ issuer, schemaId }) - await credentialDefinitionRegistry.createCredentialDefinition(id, issuerId, schemaId, credDef) - const result = await credentialDefinitionRegistry.resolveCredentialDefinition(id) + await credentialDefinitionRegistry.createCredentialDefinition(issuer, id, schemaId, credDef) - expect(result.credDef).to.be.deep.equal(credDef) + const created = await credentialDefinitionRegistry.created(id) + expect(created).to.be.not.equal(0) }) - it('Should fail if resolving Credential Definition does not exist', async function () { - const { id } = createCredentialDefinitionObject({ issuerId, schemaId }) + it('Should return zero created block a non-existing credential definition', async function () { + const { id } = createCredentialDefinitionObject({ issuer, schemaId }) - await expect(credentialDefinitionRegistry.resolveCredentialDefinition(id)) - .to.be.revertedWithCustomError(credentialDefinitionRegistry.baseInstance, ClErrors.CredentialDefinitionNotFound) - .withArgs(id) + const created = await credentialDefinitionRegistry.created(id) + expect(created).to.be.equal(0) }) it('Should fail if Credential Definition is being already exists', async function () { - const { id, credDef } = createCredentialDefinitionObject({ issuerId, schemaId }) + const { id, credDef } = createCredentialDefinitionObject({ issuer, schemaId }) - await credentialDefinitionRegistry.createCredentialDefinition(id, issuerId, schemaId, credDef) + await credentialDefinitionRegistry.createCredentialDefinition(issuer, id, schemaId, credDef) - await expect(credentialDefinitionRegistry.createCredentialDefinition(id, issuerId, schemaId, credDef)) + await expect(credentialDefinitionRegistry.createCredentialDefinition(issuer, id, schemaId, credDef)) .to.be.revertedWithCustomError( credentialDefinitionRegistry.baseInstance, ClErrors.CredentialDefinitionAlreadyExist, ) - .withArgs(id) - }) - - it('Should fail if Credential Definition is being created with non-existing Issuer', async function () { - const unknownIssuerId = 'did:indy2:mainnet:GEzcdDLhCpGCYRHW82kjHd' - const { id, credDef } = createCredentialDefinitionObject({ issuerId: unknownIssuerId, schemaId }) - - await expect(credentialDefinitionRegistry.createCredentialDefinition(id, unknownIssuerId, schemaId, credDef)) - .to.be.revertedWithCustomError(credentialDefinitionRegistry.baseInstance, ClErrors.IssuerNotFound) - .withArgs(unknownIssuerId) - }) - - it('Should fail if Credential Definition is being created with inactive Issuer', async function () { - didRegistry.deactivateDid(issuerId) - - const { id, credDef } = createCredentialDefinitionObject({ issuerId, schemaId }) - - await expect(credentialDefinitionRegistry.createCredentialDefinition(id, issuerId, schemaId, credDef)) - .to.be.revertedWithCustomError(credentialDefinitionRegistry.baseInstance, ClErrors.IssuerHasBeenDeactivated) - .withArgs(issuerId) + .withArgs(keccak256(toUtf8Bytes(id))) }) it('Should fail if Credential Definition is being created with non-existing Schema', async function () { const unknownSchemaId = 'did:indy2:mainnet:SEp33q43PsdP7nDATyySSH/anoncreds/v0/SCHEMA/Test/1.0.0' - const { id, credDef } = createCredentialDefinitionObject({ issuerId, schemaId: unknownSchemaId }) + const { id, credDef } = createCredentialDefinitionObject({ issuer, schemaId: unknownSchemaId }) - await expect(credentialDefinitionRegistry.createCredentialDefinition(id, issuerId, unknownSchemaId, credDef)) - .to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.SchemaNotFound) - .withArgs(unknownSchemaId) + await expect(credentialDefinitionRegistry.createCredentialDefinition(issuer, id, unknownSchemaId, credDef)) + .to.be.revertedWithCustomError(credentialDefinitionRegistry.baseInstance, ClErrors.SchemaNotFound) + .withArgs(keccak256(toUtf8Bytes(unknownSchemaId))) }) it('Should fail if Credential Definition is being created with not owned Issuer DID', async function () { const issuerId2 = 'did:indy2:mainnet:SEp33q43PsdP7nDATyyDDA' - const { id, credDef } = createCredentialDefinitionObject({ issuerId, schemaId }) - - didRegistry.connect(testAccounts.trustee2.account) - credentialDefinitionRegistry.connect(testAccounts.trustee2.account) - - await createDid(didRegistry, testAccounts.trustee2.account.address, issuerId2) - await expect(credentialDefinitionRegistry.createCredentialDefinition(id, issuerId, schemaId, credDef)) + const { id, credDef } = createCredentialDefinitionObject({ issuer, schemaId }) + + await expect( + credentialDefinitionRegistry.createCredentialDefinition( + testAccounts.trustee2.account.address, + id, + schemaId, + credDef, + ), + ) .to.be.revertedWithCustomError(credentialDefinitionRegistry.baseInstance, ClErrors.UnauthorizedIssuer) - .withArgs(testAccounts.trustee2.account.address) - }) - - it('Should fail if Credential Definition is being with invalid ID', async function () { - const { credDef } = createCredentialDefinitionObject({ issuerId, schemaId }) - const id = 'Gs6cQcvrtWoZKsbBhD3dQJ:3:CL:140384:mctc' - - await expect(credentialDefinitionRegistry.createCredentialDefinition(id, issuerId, schemaId, credDef)) - .to.be.revertedWithCustomError( - credentialDefinitionRegistry.baseInstance, - ClErrors.InvalidCredentialDefinitionId, - ) - .withArgs(id) + .withArgs(testAccounts.trustee2.account.address, testAccounts.trustee.account.address) }) }) - describe('Add/Resolve Credential Definition with did:ethr Issuer', function () { - it('Should create and resolve Credential Definition', async function () { - const ethrIssuerId = `did:ethr:${testAccounts.trustee.account.address}` - const { id, credDef } = createCredentialDefinitionObject({ issuerId: ethrIssuerId, schemaId }) - - await credentialDefinitionRegistry.createCredentialDefinition(id, ethrIssuerId, schemaId, credDef) - const result = await credentialDefinitionRegistry.resolveCredentialDefinition(id) - - expect(result.credDef).to.be.deep.equal(credDef) + describe('Endorse/Resolve Credential Definition with did:ethr Issuer', function () { + it('Should endorse and resolve Credential Definition', async function () { + const { id: ethSchemaId } = await createSchemaSigned(schemaRegistry, testActorAddress) + + const { id, credDef } = createCredentialDefinitionObject({ issuer: testActorAddress, schemaId: ethSchemaId }) + const signature = await signCredDefEndorsementData( + credentialDefinitionRegistry, + testActorAddress, + testActorPrivateKey, + id, + ethSchemaId, + credDef, + ) + + await credentialDefinitionRegistry.createCredentialDefinitionSigned( + testActorAddress, + id, + ethSchemaId, + credDef, + signature, + ) + + const created = await credentialDefinitionRegistry.created(id) + expect(created).to.be.not.equal(0) }) - it('Should fail if Credential Definition is being created with not owned Issuer DID', async function () { - const ethrIssuerId = `did:ethr:${testAccounts.trustee2.account.address}` - const { id, credDef } = createCredentialDefinitionObject({ issuerId: ethrIssuerId, schemaId }) - - await expect(credentialDefinitionRegistry.createCredentialDefinition(id, ethrIssuerId, schemaId, credDef)) - .to.be.revertedWithCustomError(credentialDefinitionRegistry.baseInstance, ClErrors.UnauthorizedIssuer) - .withArgs(testAccounts.trustee.account.address) + it('Should fail if Credential Definition is being endorsed with not owned Issuer DID', async function () { + const { id: ethSchemaId } = await createSchemaSigned(schemaRegistry, testActorAddress) + const { id, credDef } = createCredentialDefinitionObject({ issuer: testActorAddress, schemaId: ethSchemaId }) + + const signature = await signCredDefEndorsementData( + credentialDefinitionRegistry, + testAccounts.trustee2.account.address, + testActorPrivateKey, + id, + ethSchemaId, + credDef, + ) + await expect( + credentialDefinitionRegistry.createCredentialDefinitionSigned( + testAccounts.trustee2.account.address, + id, + ethSchemaId, + credDef, + signature, + ), + ) + .to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.UnauthorizedIssuer) + .withArgs(testAccounts.trustee2.account.address, testActorAddress) }) - it('Should fail if Credential Definition is being created with invalid Issuer ID', async function () { - const invalidIssuerId = 'did:ethr:ab$ddfgh354345' - const { id, credDef } = createCredentialDefinitionObject({ issuerId: invalidIssuerId, schemaId }) - - await expect(credentialDefinitionRegistry.createCredentialDefinition(id, invalidIssuerId, schemaId, credDef)) - .to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.InvalidIssuerId) - .withArgs(invalidIssuerId) + it('Should fail if Schema is being endorsed with invalid signature', async function () { + const { id: ethSchemaId } = await createSchemaSigned(schemaRegistry, testActorAddress) + const { id, credDef } = createCredentialDefinitionObject({ issuer: testActorAddress, schemaId: ethSchemaId }) + + const signature = await signCredDefEndorsementData( + credentialDefinitionRegistry, + testActorAddress, + testActorPrivateKey, + 'different id passed into signature', + ethSchemaId, + credDef, + ) + await expect( + credentialDefinitionRegistry.createCredentialDefinitionSigned( + testActorAddress, + id, + schemaId, + credDef, + signature, + ), + ).to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.UnauthorizedIssuer) }) }) }) diff --git a/smart_contracts/test/cl/SchemaRegistry.spec.ts b/smart_contracts/test/cl/SchemaRegistry.spec.ts index 0316eee1..9a11f2a7 100644 --- a/smart_contracts/test/cl/SchemaRegistry.spec.ts +++ b/smart_contracts/test/cl/SchemaRegistry.spec.ts @@ -1,25 +1,36 @@ import { expect } from 'chai' -import { IndyDidRegistry, SchemaRegistry } from '../../contracts-ts' +import { keccak256, toUtf8Bytes } from 'ethers' +import { EthereumExtDidRegistry, SchemaRegistry } from '../../contracts-ts' import { createSchemaObject } from '../../utils' -import { createDid, deploySchemaRegistry, TestableSchemaRegistry } from '../utils/contract-helpers' +import { + createDid, + deploySchemaRegistry, + signSchemaEndorsementData, + TestableSchemaRegistry, + testActorAddress, + testActorPrivateKey, +} from '../utils/contract-helpers' import { ClErrors } from '../utils/errors' import { TestAccounts } from '../utils/test-entities' describe('SchemaRegistry', function () { - let didRegistry: IndyDidRegistry + let didRegistry: EthereumExtDidRegistry let schemaRegistry: TestableSchemaRegistry let testAccounts: TestAccounts - const issuerId = 'did:indy2:mainnet:SEp33q43PsdP7nDATyySSH' + let issuer: string beforeEach(async function () { const { - indyDidRegistry: didRegistryInit, + didRegistry: didRegistryInit, schemaRegistry: schemaRegistryInit, testAccounts: testAccountsInit, } = await deploySchemaRegistry() + issuer = testAccountsInit.trustee.account.address didRegistryInit.connect(testAccountsInit.trustee.account) schemaRegistryInit.connect(testAccountsInit.trustee.account) + + const issuerId = `did:ethr:mainnet:${issuer}` await createDid(didRegistryInit, testAccountsInit.trustee.account.address, issuerId) didRegistry = didRegistryInit @@ -28,104 +39,81 @@ describe('SchemaRegistry', function () { }) describe('Add/Resolve Schema', function () { - it('Should create and resolve Schema', async function () { - const { id, schema } = createSchemaObject({ issuerId }) + it('Should create Schema', async function () { + const { id, schema } = createSchemaObject({ issuer }) - await schemaRegistry.createSchema(id, issuerId, schema) - const result = await schemaRegistry.resolveSchema(id) + await schemaRegistry.createSchema(issuer, id, schema) - expect(result.schema).to.be.deep.equal(schema) + const created = await schemaRegistry.created(id) + expect(created).to.be.not.equal(0) }) - it('Should fail if resolving a non-existing schema', async function () { - const { id, schema } = createSchemaObject({ issuerId }) + it('Should return zero created block a non-existing schema', async function () { + const { id } = createSchemaObject({ issuer }) - await expect(schemaRegistry.resolveSchema(id)) - .to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.SchemaNotFound) - .withArgs(id) + const created = await schemaRegistry.created(id) + expect(created).to.be.equal(0) }) it('Should fail if Schema is being created already exists', async function () { - const { id, schema } = createSchemaObject({ issuerId }) + const { id, schema } = createSchemaObject({ issuer }) - await schemaRegistry.createSchema(id, issuerId, schema) + await schemaRegistry.createSchema(issuer, id, schema) - await expect(schemaRegistry.createSchema(id, issuerId, schema)) + await expect(schemaRegistry.createSchema(issuer, id, schema)) .to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.SchemaAlreadyExist) - .withArgs(id) - }) - - it('Should fail if Schema is being created with non-existing Issuer', async function () { - const unknownIssuerId = 'did:indy2:mainnet:GEzcdDLhCpGCYRHW82kjHd' - const { id, schema } = createSchemaObject({ issuerId: unknownIssuerId }) - - await expect(schemaRegistry.createSchema(id, unknownIssuerId, schema)) - .to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.IssuerNotFound) - .withArgs(unknownIssuerId) - }) - - it('Should fail if Schema is being created with inactive Issuer', async function () { - didRegistry.deactivateDid(issuerId) - - const { id, schema } = createSchemaObject({ issuerId }) - - await expect(schemaRegistry.createSchema(id, issuerId, schema)) - .to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.IssuerHasBeenDeactivated) - .withArgs(issuerId) - }) - - it('Should fail if Schema is being created with invalid Schema ID', async function () { - const { schema } = createSchemaObject({ issuerId }) - const id = 'SEp33q43PsdP7nDATyySSH:2:BasicSchema:1.0.0' - - await expect(schemaRegistry.createSchema(id, issuerId, schema)) - .to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.InvalidSchemaId) - .withArgs(id) + .withArgs(keccak256(toUtf8Bytes(id))) }) it('Should fail if Schema is being created with not owned Issuer DID', async function () { - const issuerId2 = 'did:indy2:mainnet:SEp33q43PsdP7nDATyyDDA' - const { id, schema } = createSchemaObject({ issuerId }) + const { id, schema } = createSchemaObject({ issuer }) - didRegistry.connect(testAccounts.trustee2.account) - schemaRegistry.connect(testAccounts.trustee2.account) - - await createDid(didRegistry, testAccounts.trustee2.account.address, issuerId2) - await expect(schemaRegistry.createSchema(id, issuerId, schema)) + await expect(schemaRegistry.createSchema(testAccounts.trustee2.account.address, id, schema)) .to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.UnauthorizedIssuer) - .withArgs(testAccounts.trustee2.account.address) + .withArgs(testAccounts.trustee2.account.address, testAccounts.trustee.account.address) }) }) - describe('Add/Resolve Schema with did:ethr Issuer', function () { - it('Should create and resolve Schema', async function () { - const ethrIssuerId = `did:ethr:${testAccounts.trustee.account.address}` - - const { id, schema } = createSchemaObject({ issuerId: ethrIssuerId }) + describe('Endorse/Resolve Schema with did:ethr Issuer', function () { + it('Should endorse Schema', async function () { + const { id, schema } = createSchemaObject({ issuer: testActorAddress }) - await schemaRegistry.createSchema(id, ethrIssuerId, schema) - const result = await schemaRegistry.resolveSchema(id) + const sig = await signSchemaEndorsementData(schemaRegistry, testActorAddress, testActorPrivateKey, id, schema) - expect(result.schema).to.be.deep.equal(schema) + await schemaRegistry.createSchemaSigned(testActorAddress, id, schema, sig) + const created = await schemaRegistry.created(id) + expect(created).to.be.not.equal(0) }) - it('Should fail if Schema is being created with not owned Issuer DID', async function () { - const ethrIssuerId = `did:ethr:${testAccounts.trustee2.account.address}` - - const { id, schema } = createSchemaObject({ issuerId: ethrIssuerId }) - - await expect(schemaRegistry.createSchema(id, ethrIssuerId, schema)) + it('Should fail if Schema is being endorsed with not owned Issuer DID', async function () { + const { id, schema } = createSchemaObject({ issuer: testAccounts.trustee2.account.address }) + + const sig = await signSchemaEndorsementData( + schemaRegistry, + testAccounts.trustee2.account.address, + testActorPrivateKey, + id, + schema, + ) + await expect(schemaRegistry.createSchemaSigned(testAccounts.trustee2.account.address, id, schema, sig)) .to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.UnauthorizedIssuer) - .withArgs(testAccounts.trustee.account.address) + .withArgs(testAccounts.trustee2.account.address, testActorAddress) }) - it('Should fail if Schema is being created with invalid Issuer ID', async function () { - const invalidIssuerId = 'did:ethr:ab$ddfgh354345' - const { id, schema } = createSchemaObject({ issuerId: invalidIssuerId }) - - await expect(schemaRegistry.createSchema(id, invalidIssuerId, schema)) - .to.be.revertedWithCustomError(schemaRegistry.baseInstance, ClErrors.InvalidIssuerId) - .withArgs(invalidIssuerId) + it('Should fail if Schema is being endorsed with invalid signature', async function () { + const { id, schema } = createSchemaObject({ issuer: testActorAddress }) + + const sig = await signSchemaEndorsementData( + schemaRegistry, + testActorAddress, + testActorPrivateKey, + 'different id passed into signature', + schema, + ) + await expect(schemaRegistry.createSchemaSigned(testActorAddress, id, schema, sig)).to.be.revertedWithCustomError( + schemaRegistry.baseInstance, + ClErrors.UnauthorizedIssuer, + ) }) }) }) diff --git a/smart_contracts/test/did/DidRegistry.spec.ts b/smart_contracts/test/did/DidRegistry.spec.ts index ea4996c8..9a3aece3 100644 --- a/smart_contracts/test/did/DidRegistry.spec.ts +++ b/smart_contracts/test/did/DidRegistry.spec.ts @@ -1,181 +1,25 @@ import { expect } from 'chai' -import { createBaseDidDocument } from '../../utils/entity-factories' -import { deployIndyDidRegistry, TestableIndyDidRegistry } from '../utils/contract-helpers' -import { IndyDidValidator } from '../utils/contract-helpers' -import { DidError } from '../utils/errors' +import { deployDidRegistry, TestableDidRegistry } from '../utils/contract-helpers' import { TestAccounts } from '../utils/test-entities' describe('DIDContract', function () { - let didRegistry: TestableIndyDidRegistry - let didValidator: IndyDidValidator + let didRegistry: TestableDidRegistry let testAccounts: TestAccounts beforeEach(async function () { - const { - indyDidRegistry: didRegistryInit, - indyDidValidator: didValidatorInit, - testAccounts: testAccountsInit, - } = await deployIndyDidRegistry() + const { didRegistry: didRegistryInit, testAccounts: testAccountsInit } = await deployDidRegistry() didRegistry = didRegistryInit - didValidator = didValidatorInit testAccounts = testAccountsInit didRegistry.connect(testAccounts.trustee.account) }) describe('Create DID', function () { - it('Should create and resolve DID document', async function () { - const did: string = 'did:indy2:testnet:SEp33q43PsdP7nDATyySSH' - const didDocument = createBaseDidDocument(did) - - await didRegistry.createDid(testAccounts.noRole.account.address, did, didDocument) - - const { document } = await didRegistry.resolveDid(did) - - expect(document).to.be.deep.equal(didDocument) - }) - - it('Should fail if resolving DID does not exist', async function () { - const did: string = 'did:indy2:testnet:SEp33q43PsdP7nDATyySSH' - - await expect(didRegistry.resolveDid(did)) - .to.revertedWithCustomError(didRegistry.baseInstance, DidError.DidNotFound) - .withArgs(did) - }) - - it('Should fail if the DID being created already exists', async function () { - const did: string = 'did:indy2:testnet:SEp33q43PsdP7nDATyySSH' - const didDocument = createBaseDidDocument(did) - - await didRegistry.createDid(testAccounts.noRole.account.address, did, didDocument) - - await expect(didRegistry.createDid(testAccounts.noRole2.account.address, did, didDocument)) - .to.be.revertedWithCustomError(didRegistry.baseInstance, DidError.DidAlreadyExist) - .withArgs(did) - }) - - it('Should fail if an incorrect schema is provided for the DID', async function () { - const did: string = 'indy:indy2:testnet:SEp33q43PsdP7nDATyySSH' - const didDocument = createBaseDidDocument(did) - - await expect(didRegistry.createDid(testAccounts.noRole.account.address, did, didDocument)) - .to.be.revertedWithCustomError(didValidator.baseInstance, DidError.IncorrectDid) - .withArgs(did) - }) - - it('Should fail if an unsupported DID method is provided', async function () { - const did: string = 'did:indy3:testnet:SEp33q43PsdP7nDATyySSH' - const didDocument = createBaseDidDocument(did) - - await expect(didRegistry.createDid(testAccounts.noRole.account.address, did, didDocument)) - .to.be.revertedWithCustomError(didValidator.baseInstance, DidError.IncorrectDid) - .withArgs(did) - }) - - it('Should fail if an incorrect DID method-specific-id is provided', async function () { - const did: string = 'did:indy3:testnet:123456789' - const didDocument = createBaseDidDocument(did) - - await expect(didRegistry.createDid(testAccounts.noRole.account.address, did, didDocument)) - .revertedWithCustomError(didValidator.baseInstance, DidError.IncorrectDid) - .withArgs(did) - }) - }) - - describe('Update DID', function () { - it('Should update DID document', async function () { - const did: string = 'did:indy2:testnet:SEp33q43PsdP7nDATyySSH' - const didDocument = createBaseDidDocument(did) - - await didRegistry.createDid(testAccounts.noRole.account.address, did, didDocument) - - await didRegistry.updateDid(did, didDocument) - - const { document } = await didRegistry.resolveDid(did) - - expect(document).to.be.deep.equal(didDocument) - }) - - it('Should fail if the DID creator is not an update txn sender', async function () { - const did: string = 'did:indy2:testnet:SEp33q43PsdP7nDATyySSH' - const didDocument = createBaseDidDocument(did) - - await didRegistry.createDid(testAccounts.noRole.account.address, did, didDocument) - - didRegistry.connect(testAccounts.trustee2.account) - await expect(didRegistry.updateDid(did, didDocument)).to.revertedWithCustomError( - didRegistry.baseInstance, - DidError.UnauthorizedSender, - ) - }) - - it('Should fail if the DID being updated does not exists', async function () { - const did: string = 'did:indy2:testnet:SEp33q43PsdP7nDATyySSH' - const didDocument = createBaseDidDocument(did) - - await expect(didRegistry.updateDid(did, didDocument)) - .to.revertedWithCustomError(didRegistry.baseInstance, DidError.DidNotFound) - .withArgs(did) - }) - - it('Should fail if the DID being updated is deactivated', async function () { - const did: string = 'did:indy2:testnet:SEp33q43PsdP7nDATyySSH' - const didDocument = createBaseDidDocument(did) - - await didRegistry.createDid(testAccounts.noRole.account.address, did, didDocument) - await didRegistry.deactivateDid(did) - - await expect(didRegistry.updateDid(did, didDocument)) - .to.revertedWithCustomError(didRegistry.baseInstance, DidError.DidHasBeenDeactivated) - .withArgs(did) - }) - }) - - describe('Deactivate DID', function () { - it('Should deactivate DID document', async function () { - const did: string = 'did:indy2:testnet:SEp33q43PsdP7nDATyySSH' - const didDocument = createBaseDidDocument(did) - - await didRegistry.createDid(testAccounts.noRole.account.address, did, didDocument) - await didRegistry.deactivateDid(did) - - const didStorage = await didRegistry.resolveDid(did) - - expect(didStorage.metadata.deactivated).is.true - }) - - it('Should fail if the DID has already been deactivated', async function () { - const did: string = 'did:indy2:testnet:SEp33q43PsdP7nDATyySSH' - const didDocument = createBaseDidDocument(did) - - await didRegistry.createDid(testAccounts.noRole.account.address, did, didDocument) - await didRegistry.deactivateDid(did) - - await expect(didRegistry.deactivateDid(did)) - .to.revertedWithCustomError(didRegistry.baseInstance, DidError.DidHasBeenDeactivated) - .withArgs(did) - }) - - it('Should fail if the DID being deactivated does not exists', async function () { - const did: string = 'did:indy2:testnet:SEp33q43PsdP7nDATyySSH' - - await expect(didRegistry.deactivateDid(did)) - .to.revertedWithCustomError(didRegistry.baseInstance, DidError.DidNotFound) - .withArgs(did) - }) - - it('Should fail if the DID creator is not an deactivate txn sender', async function () { - const did: string = 'did:indy2:testnet:SEp33q43PsdP7nDATyySSH' - const didDocument = createBaseDidDocument(did) - - await didRegistry.createDid(testAccounts.noRole.account.address, did, didDocument) - - didRegistry.connect(testAccounts.trustee2.account) - await expect(didRegistry.deactivateDid(did)).to.revertedWithCustomError( - didRegistry.baseInstance, - DidError.UnauthorizedSender, - ) + it('Create DID Works', async function () { + // We do not need to cover DID Registry with tests as it's already done in the original contract + const changed = await didRegistry.changed(testAccounts.trustee.account.address) + expect(changed).to.be.equal(0) }) }) }) diff --git a/smart_contracts/test/did/UniversalDidResolver.spec.ts b/smart_contracts/test/did/UniversalDidResolver.spec.ts deleted file mode 100644 index c875c6c5..00000000 --- a/smart_contracts/test/did/UniversalDidResolver.spec.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { loadFixture } from '@nomicfoundation/hardhat-network-helpers' -import { expect } from 'chai' -import { createBaseDidDocument } from '../../utils' -import { deployUniversalDidResolver, TestableUniversalDidResolver } from '../utils/contract-helpers' -import { DidError } from '../utils/errors' -import { TestAccounts } from '../utils/test-entities' - -describe('UniversalDidResolver', function () { - const did = 'did:indy2:testnet:SEp33q43PsdP7nDATyySSH' - const indy2DidDocument = createBaseDidDocument(did) - - let universalDidResolver: TestableUniversalDidResolver - let testAccounts: TestAccounts - - async function deployUniversalDidResolverFixture() { - const { - universalDidReolver: universalDidReolverInit, - indyDidRegistry, - testAccounts: testAccountsInit, - } = await deployUniversalDidResolver() - - indyDidRegistry.connect(testAccountsInit.trustee.account) - await indyDidRegistry.createDid(testAccountsInit.trustee.account.address, did, indy2DidDocument) - - return { universalDidReolverInit, testAccountsInit } - } - - beforeEach(async function () { - const { universalDidReolverInit, testAccountsInit } = await loadFixture(deployUniversalDidResolverFixture) - - universalDidResolver = universalDidReolverInit - testAccounts = testAccountsInit - - universalDidResolver.connect(testAccounts.trustee.account) - }) - - describe('Resolve did:indy2', function () { - it('Should resolve DID document', async function () { - const document = await universalDidResolver.resolveDocument(did) - - expect(document).to.be.deep.equal(indy2DidDocument) - }) - - it('Should resolve DID metadata', async function () { - const metadata = await universalDidResolver.resolveMetadata(did) - - expect(metadata).to.contain({ - owner: testAccounts.trustee.account.address, - deactivated: false, - }) - }) - }) - - describe('Resolve did:ethr', function () { - it('Should resolve DID metadata', async function () { - const didEthr = `did:ethr:${testAccounts.trustee.account.address}` - const metadata = await universalDidResolver.resolveMetadata(didEthr) - - expect(metadata).to.contain({ - owner: testAccounts.trustee.account.address, - deactivated: false, - }) - }) - - it('Should fail if an incorrect DID method-specific-id is provided', async function () { - const incorrectDid = 'did:ethr:ab$ddfgh354345' - - await expect(universalDidResolver.resolveMetadata(incorrectDid)) - .revertedWithCustomError(universalDidResolver.baseInstance, DidError.IncorrectDid) - .withArgs(incorrectDid) - }) - }) -}) diff --git a/smart_contracts/test/utils/contract-helpers.ts b/smart_contracts/test/utils/contract-helpers.ts index e8ba3083..13927b0a 100644 --- a/smart_contracts/test/utils/contract-helpers.ts +++ b/smart_contracts/test/utils/contract-helpers.ts @@ -1,26 +1,17 @@ +import { concat, getAddress, getBytes, keccak256, SigningKey, toUtf8Bytes } from 'ethers' import { CredentialDefinitionRegistry, - IndyDidRegistry, + EthereumExtDidRegistry, RoleControl, SchemaRegistry, - UniversalDidResolver, UpgradeControl, ValidatorControl, } from '../../contracts-ts' -import { Contract, createBaseDidDocument, createSchemaObject } from '../../utils' +import { Contract, createSchemaObject } from '../../utils' import { getTestAccounts, ZERO_ADDRESS } from './test-entities' -export class EthereumDIDRegistry extends testableContractMixin(Contract) { - constructor() { - super(EthereumDIDRegistry.name) - } -} - -export class IndyDidValidator extends testableContractMixin(Contract) { - constructor() { - super(IndyDidValidator.name) - } -} +export const testActorAddress = '0x2036C6CD85692F0Fb2C26E6c6B2ECed9e4478Dfd' +export const testActorPrivateKey = getBytes('0xa285ab66393c5fdda46d6fbad9e27fafd438254ab72ad5acb681a0e9f20f5d7b') export class UpgradablePrototype extends testableContractMixin(Contract) { public get version(): Promise { @@ -28,7 +19,7 @@ export class UpgradablePrototype extends testableContractMixin(Contract) { } } -export class TestableIndyDidRegistry extends testableContractMixin(IndyDidRegistry) {} +export class TestableDidRegistry extends testableContractMixin(EthereumExtDidRegistry) {} export class TestableSchemaRegistry extends testableContractMixin(SchemaRegistry) {} @@ -40,7 +31,13 @@ export class TestableValidatorControl extends testableContractMixin(ValidatorCon export class TestableUpgradeControl extends testableContractMixin(UpgradeControl) {} -export class TestableUniversalDidResolver extends testableContractMixin(UniversalDidResolver) {} +function testableContractMixin Contract>(Base: T) { + return class extends Base { + public get baseInstance() { + return this.instance + } + } +} export async function deployRoleControl() { const roleControl = await new RoleControl().deployProxy({ params: [ZERO_ADDRESS] }) @@ -49,63 +46,88 @@ export async function deployRoleControl() { return { roleControl, testAccounts } } -export async function deployIndyDidRegistry() { +export async function deployDidRegistry() { const { testAccounts } = await deployRoleControl() - const indyDidValidator = await new IndyDidValidator().deploy() - const indyDidRegistry = await new TestableIndyDidRegistry().deployProxy({ + const didRegistry = await new TestableDidRegistry().deployProxy({ params: [ZERO_ADDRESS], - libraries: [indyDidValidator], - }) - - return { indyDidRegistry, indyDidValidator, testAccounts } -} - -export async function deployUniversalDidResolver() { - const { indyDidRegistry, testAccounts } = await deployIndyDidRegistry() - const ethereumDIDRegistry = await new EthereumDIDRegistry().deploy() - - const universalDidReolver = await new TestableUniversalDidResolver().deployProxy({ - params: [ZERO_ADDRESS, indyDidRegistry.address, ethereumDIDRegistry.address], }) - return { universalDidReolver, ethereumDIDRegistry, indyDidRegistry, testAccounts } + return { didRegistry, testAccounts } } export async function deploySchemaRegistry() { - const { universalDidReolver, indyDidRegistry, testAccounts } = await deployUniversalDidResolver() + const { didRegistry, testAccounts } = await deployDidRegistry() const schemaRegistry = await new TestableSchemaRegistry().deployProxy({ - params: [ZERO_ADDRESS, universalDidReolver.address], + params: [ZERO_ADDRESS, didRegistry.address], }) - return { universalDidReolver, indyDidRegistry, schemaRegistry, testAccounts } + return { didRegistry, schemaRegistry, testAccounts } } export async function deployCredentialDefinitionRegistry() { - const { universalDidReolver, indyDidRegistry, schemaRegistry, testAccounts } = await deploySchemaRegistry() + const { didRegistry, schemaRegistry, testAccounts } = await deploySchemaRegistry() const credentialDefinitionRegistry = await new TestableCredentialDefinitionRegistry().deployProxy({ - params: [ZERO_ADDRESS, universalDidReolver.address, schemaRegistry.address], + params: [ZERO_ADDRESS, didRegistry.address, schemaRegistry.address], }) - return { credentialDefinitionRegistry, universalDidReolver, indyDidRegistry, schemaRegistry, testAccounts } + return { credentialDefinitionRegistry, didRegistry, schemaRegistry, testAccounts } +} + +export async function createDid(didRegistry: EthereumExtDidRegistry, identity: string, did: string) { + // DID assume to be created by default + return did } -export async function createDid(didRegistry: IndyDidRegistry, identity: string, did: string) { - const didDocument = createBaseDidDocument(did) - await didRegistry.createDid(identity, did, didDocument) - return didDocument +export async function signEndorsementData(privateKey: Uint8Array, contract: string, data: string) { + const dataToSign = concat(['0x1900', getAddress(contract), data]) + return new SigningKey(privateKey).sign(keccak256(dataToSign)) } -export async function createSchema(schemaRegistry: SchemaRegistry, issuerId: string) { - const { id, schema } = createSchemaObject({ issuerId }) - await schemaRegistry.createSchema(id, issuerId, schema) +export async function signSchemaEndorsementData( + schemaRegistry: SchemaRegistry, + identity: string, + privateKey: Uint8Array, + id: string, + schema: string, +) { + return signEndorsementData( + privateKey, + schemaRegistry.address!, + concat([identity, toUtf8Bytes('createSchema'), getBytes(keccak256(toUtf8Bytes(id)), 'hex'), toUtf8Bytes(schema)]), + ) +} + +export async function createSchema(schemaRegistry: SchemaRegistry, issuer: string) { + const { id, schema } = createSchemaObject({ issuer }) + await schemaRegistry.createSchema(issuer, id, schema) return { id, schema } } -function testableContractMixin Contract>(Base: T) { - return class extends Base { - public get baseInstance() { - return this.instance - } - } +export async function createSchemaSigned(schemaRegistry: SchemaRegistry, issuer: string) { + const { id, schema } = createSchemaObject({ issuer }) + const signature = await signSchemaEndorsementData(schemaRegistry, issuer, testActorPrivateKey, id, schema) + await schemaRegistry.createSchemaSigned(issuer, id, schema, signature) + return { id, schema } +} + +export async function signCredDefEndorsementData( + credentialDefinitionRegistry: CredentialDefinitionRegistry, + identity: string, + privateKey: Uint8Array, + id: string, + schemaId: string, + credDef: string, +) { + return signEndorsementData( + privateKey, + credentialDefinitionRegistry.address!, + concat([ + identity, + toUtf8Bytes('createCredentialDefinition'), + getBytes(keccak256(toUtf8Bytes(id)), 'hex'), + getBytes(keccak256(toUtf8Bytes(schemaId)), 'hex'), + toUtf8Bytes(credDef), + ]), + ) } diff --git a/smart_contracts/test/utils/errors.ts b/smart_contracts/test/utils/errors.ts index b4e79d43..681f02c6 100644 --- a/smart_contracts/test/utils/errors.ts +++ b/smart_contracts/test/utils/errors.ts @@ -8,33 +8,17 @@ export namespace AuthErrors { } export namespace ClErrors { - export const IssuerNotFound = 'IssuerNotFound' - export const IssuerHasBeenDeactivated = 'IssuerHasBeenDeactivated' - export const InvalidIssuerId = 'InvalidIssuerId' export const UnauthorizedIssuer = 'UnauthorizedIssuer' // Schema errors - export const InvalidSchemaId = 'InvalidSchemaId' export const SchemaAlreadyExist = 'SchemaAlreadyExist' export const SchemaNotFound = 'SchemaNotFound' // CredDef errors - export const InvalidCredentialDefinitionId = 'InvalidCredentialDefinitionId' - export const UnsupportedCredentialDefinitionType = 'UnsupportedCredentialDefinitionType' export const CredentialDefinitionAlreadyExist = 'CredentialDefinitionAlreadyExist' export const CredentialDefinitionNotFound = 'CredentialDefinitionNotFound' } -export namespace DidError { - export const AuthenticationKeyRequired = 'AuthenticationKeyRequired' - export const AuthenticationKeyNotFound = 'AuthenticationKeyNotFound' - export const DidNotFound = 'DidNotFound' - export const DidAlreadyExist = 'DidAlreadyExist' - export const DidHasBeenDeactivated = 'DidHasBeenDeactivated' - export const IncorrectDid = 'IncorrectDid' - export const UnauthorizedSender = 'UnauthorizedSender' -} - export namespace ProxyError { export const ERC1967InvalidImplementation = 'ERC1967InvalidImplementation' } diff --git a/smart_contracts/utils/contract.ts b/smart_contracts/utils/contract.ts index fbfbc8b1..0b60425e 100644 --- a/smart_contracts/utils/contract.ts +++ b/smart_contracts/utils/contract.ts @@ -4,10 +4,10 @@ import { host } from '../environment' export class Contract { public address?: string + public instance: any protected readonly name: string protected readonly signer?: Signer - protected instance: any constructor(name: string, sender?: any) { this.name = name diff --git a/smart_contracts/utils/entity-factories.ts b/smart_contracts/utils/entity-factories.ts index 38e741b5..6065054d 100644 --- a/smart_contracts/utils/entity-factories.ts +++ b/smart_contracts/utils/entity-factories.ts @@ -23,18 +23,19 @@ export function createBaseDidDocument(did: string) { } interface CreateSchemaParams { - issuerId: string + issuer: string name?: string version?: string attrNames?: string[] } export function createSchemaObject({ - issuerId, + issuer, name = 'BasicIdentity', version = '1.0.0', attrNames = ['First Name', 'Last Name'], }: CreateSchemaParams) { + const issuerId = `did:ethr:${issuer}` const id = `${issuerId}/anoncreds/v0/SCHEMA/${name}/${version}` return { id, @@ -49,7 +50,7 @@ export function createSchemaObject({ } interface CreateCredentialDefinitionParams { - issuerId: string + issuer: string schemaId: string credDefType?: string tag?: string @@ -57,7 +58,7 @@ interface CreateCredentialDefinitionParams { } export function createCredentialDefinitionObject({ - issuerId, + issuer, schemaId, credDefType = 'CL', tag = 'BasicIdentity', @@ -68,6 +69,7 @@ export function createCredentialDefinitionObject({ z: '632...005', }, }: CreateCredentialDefinitionParams) { + const issuerId = `did:ethr:${issuer}` const id = `${issuerId}/anoncreds/v0/CLAIM_DEF/${schemaId}/${tag}` return { id, diff --git a/smart_contracts/yarn.lock b/smart_contracts/yarn.lock index fcac9dd8..c2cf706e 100644 --- a/smart_contracts/yarn.lock +++ b/smart_contracts/yarn.lock @@ -179,7 +179,7 @@ "@ethereumjs/rlp" "^5.0.0" ethereum-cryptography "^2.1.2" -"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.0.0-beta.146", "@ethersproject/abi@^5.0.9", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.6.3", "@ethersproject/abi@^5.7.0": +"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.0.9", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.6.3", "@ethersproject/abi@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== @@ -521,6 +521,11 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" +"@fastify/busboy@^2.0.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.0.tgz#0709e9f4cb252351c609c6e6d8d6779a8d25edff" + integrity sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA== + "@jridgewell/resolve-uri@^3.0.3": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" @@ -1068,6 +1073,11 @@ dependencies: antlr4ts "^0.5.0-alpha.4" +"@solidity-parser/parser@^0.18.0": + version "0.18.0" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.18.0.tgz#8e77a02a09ecce957255a2f48c9a7178ec191908" + integrity sha512-yfORGUIPgLck41qyN7nbwJRAx17/jAIXCTanHOJZhB6PJ1iAk/84b/xlsVKFSyNyLXIj0dhppoE0+CRws7wlzA== + "@szmarczak/http-timer@^4.0.5": version "4.0.6" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807" @@ -1398,11 +1408,6 @@ amdefine@>=0.0.4: resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" integrity sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg== -ansi-colors@3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" - integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== - ansi-colors@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -1425,17 +1430,12 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1" integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw== -ansi-regex@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" - integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== - ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^3.2.0, ansi-styles@^3.2.1: +ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -1459,7 +1459,7 @@ antlr4ts@^0.5.0-alpha.4: resolved "https://registry.yarnpkg.com/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz#71702865a87478ed0b40c0709f422cf14d51652a" integrity sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ== -anymatch@~3.1.1, anymatch@~3.1.2: +anymatch@~3.1.2: version "3.1.3" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== @@ -1528,17 +1528,6 @@ array.prototype.findlast@^1.2.2: es-shim-unscopables "^1.0.0" get-intrinsic "^1.2.1" -array.prototype.reduce@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/array.prototype.reduce/-/array.prototype.reduce-1.0.6.tgz#63149931808c5fc1e1354814923d92d45f7d96d5" - integrity sha512-UW+Mz8LG/sPSU8jRDCjVr6J/ZKAGpHfwrZ6kWTG5qCxIEiXdVshqGnu5vEZA8S1y6X4aCSbQZ0/EEsfvEvBiSg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.22.1" - es-array-method-boxes-properly "^1.0.0" - is-string "^1.0.7" - arraybuffer.prototype.slice@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz#98bd561953e3e74bb34938e77647179dfe6e9f12" @@ -1633,12 +1622,12 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== -axios@^1.4.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.5.1.tgz#11fbaa11fc35f431193a9564109c88c1f27b585f" - integrity sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A== +axios@^1.4.0, axios@^1.5.1: + version "1.6.7" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.7.tgz#7b48c2e27c96f9c68a2f8f31e2ab19f59b06b0a7" + integrity sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA== dependencies: - follow-redirects "^1.15.0" + follow-redirects "^1.15.4" form-data "^4.0.0" proxy-from-env "^1.1.0" @@ -1877,13 +1866,6 @@ builtin-modules@^1.1.1: resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" integrity sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ== -busboy@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" - integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== - dependencies: - streamsearch "^1.1.0" - bytes@3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" @@ -1925,11 +1907,6 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camelcase@^5.0.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - camelcase@^6.0.0: version "6.3.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" @@ -2011,21 +1988,6 @@ check-error@^1.0.2: resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== -chokidar@3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.0.tgz#12c0714668c55800f659e262d4962a97faf554a6" - integrity sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A== - dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.2.0" - optionalDependencies: - fsevents "~2.1.1" - chokidar@3.5.3, chokidar@^3.4.0: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" @@ -2101,15 +2063,6 @@ cli-table3@^0.5.0: optionalDependencies: colors "^1.1.2" -cliui@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" - integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== - dependencies: - string-width "^3.1.0" - strip-ansi "^5.2.0" - wrap-ansi "^5.1.0" - cliui@^7.0.2: version "7.0.4" resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" @@ -2380,13 +2333,6 @@ debug@2.6.9, debug@^2.2.0: dependencies: ms "2.0.0" -debug@3.2.6: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - debug@4, debug@4.3.4, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -2394,11 +2340,6 @@ debug@4, debug@4.3.4, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3: dependencies: ms "2.1.2" -decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== - decamelize@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" @@ -2445,7 +2386,7 @@ defer-to-connect@^2.0.0, defer-to-connect@^2.0.1: resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== -define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: +define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== @@ -2476,11 +2417,6 @@ detect-port@^1.3.0: address "^1.0.1" debug "4" -diff@3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - diff@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" @@ -2536,11 +2472,6 @@ elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.4: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -2623,11 +2554,6 @@ es-abstract@^1.22.1: unbox-primitive "^1.0.2" which-typed-array "^1.1.10" -es-array-method-boxes-properly@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" - integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== - es-set-tostringtag@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" @@ -2694,16 +2620,16 @@ escape-html@~1.0.3: resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - escape-string-regexp@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + escodegen@1.8.x: version "1.8.1" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" @@ -2758,23 +2684,21 @@ eth-ens-namehash@2.0.8: js-sha3 "^0.5.7" eth-gas-reporter@^0.2.25: - version "0.2.25" - resolved "https://registry.yarnpkg.com/eth-gas-reporter/-/eth-gas-reporter-0.2.25.tgz#546dfa946c1acee93cb1a94c2a1162292d6ff566" - integrity sha512-1fRgyE4xUB8SoqLgN3eDfpDfwEfRxh2Sz1b7wzFbyQA+9TekMmvSjjoRu9SKcSVyK+vLkLIsVbJDsTWjw195OQ== + version "0.2.27" + resolved "https://registry.yarnpkg.com/eth-gas-reporter/-/eth-gas-reporter-0.2.27.tgz#928de8548a674ed64c7ba0bf5795e63079150d4e" + integrity sha512-femhvoAM7wL0GcI8ozTdxfuBtBFJ9qsyIAsmKVjlWAHUbdnnXHt+lKzz/kmldM5lA9jLuNHGwuIxorNpLbR1Zw== dependencies: - "@ethersproject/abi" "^5.0.0-beta.146" "@solidity-parser/parser" "^0.14.0" + axios "^1.5.1" cli-table3 "^0.5.0" colors "1.4.0" ethereum-cryptography "^1.0.3" - ethers "^4.0.40" + ethers "^5.7.2" fs-readdir-recursive "^1.1.0" lodash "^4.17.14" markdown-table "^1.1.3" - mocha "^7.1.1" + mocha "^10.2.0" req-cwd "^2.0.0" - request "^2.88.0" - request-promise-native "^1.0.5" sha1 "^1.1.1" sync-request "^6.0.0" @@ -2905,21 +2829,6 @@ ethers@6.8.0: tslib "2.4.0" ws "8.5.0" -ethers@^4.0.40: - version "4.0.49" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.49.tgz#0eb0e9161a0c8b4761be547396bbe2fb121a8894" - integrity sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg== - dependencies: - aes-js "3.0.0" - bn.js "^4.11.9" - elliptic "6.5.4" - hash.js "1.1.3" - js-sha3 "0.5.7" - scrypt-js "2.0.4" - setimmediate "1.0.4" - uuid "2.0.1" - xmlhttprequest "1.8.0" - ethers@^5.7.1, ethers@^5.7.2: version "5.7.2" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" @@ -3119,13 +3028,6 @@ find-replace@^3.0.0: dependencies: array-back "^3.0.1" -find-up@3.0.0, find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - find-up@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" @@ -3141,27 +3043,15 @@ find-up@^2.1.0: dependencies: locate-path "^2.0.0" -flat@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.1.tgz#a392059cc382881ff98642f5da4dde0a959f309b" - integrity sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA== - dependencies: - is-buffer "~2.0.3" - flat@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== -follow-redirects@^1.12.1: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== - -follow-redirects@^1.15.0: - version "1.15.3" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" - integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== +follow-redirects@^1.12.1, follow-redirects@^1.15.4: + version "1.15.5" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" + integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== for-each@^0.3.3: version "0.3.3" @@ -3301,11 +3191,6 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@~2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" - integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== - fsevents@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" @@ -3336,15 +3221,15 @@ functions-have-names@^1.2.3: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== -get-caller-file@^2.0.1, get-caller-file@^2.0.5: +get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" - integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== + version "2.0.2" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" + integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0, get-intrinsic@^1.2.1: version "1.2.1" @@ -3396,25 +3281,13 @@ ghost-testrpc@^0.0.2: chalk "^2.4.2" node-emoji "^1.10.0" -glob-parent@^5.1.2, glob-parent@~5.1.0, glob-parent@~5.1.2: +glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" -glob@7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - 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" - glob@7.1.7: version "7.1.7" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" @@ -3566,11 +3439,6 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - handlebars@^4.0.1: version "4.7.8" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.8.tgz#41c42c18b1be2365439188c77c6afae71c0cd9e9" @@ -3601,7 +3469,7 @@ hardhat-dependency-compiler@^1.1.3: resolved "https://registry.yarnpkg.com/hardhat-dependency-compiler/-/hardhat-dependency-compiler-1.1.3.tgz#1e49e23f68878bd713f860c66648a711bc4a4a79" integrity sha512-bCDqsOxGST6WkbMvj4lPchYWidNSSBm5CFnkyAex1T11cGmr9otZTGl81W6f9pmrtBXbKCvr3OSuNJ6Q394sAw== -hardhat-gas-reporter@^1.0.8: +hardhat-gas-reporter@^1.0.9: version "1.0.9" resolved "https://registry.yarnpkg.com/hardhat-gas-reporter/-/hardhat-gas-reporter-1.0.9.tgz#9a2afb354bc3b6346aab55b1c02ca556d0e16450" integrity sha512-INN26G3EW43adGKBNzYWOlI3+rlLnasXTwW79YNnUhXPDa+yHESgt639dJEs37gCjhkbNKcRRJnomXEuMFBXJg== @@ -3617,10 +3485,10 @@ hardhat-storage-layout@^0.1.7: dependencies: console-table-printer "^2.9.0" -hardhat@^2.17.2: - version "2.17.3" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.17.3.tgz#4cb15f2afdea5f108970ed72e5b81e6e53052cfb" - integrity sha512-SFZoYVXW1bWJZrIIKXOA+IgcctfuKXDwENywiYNT2dM3YQc4fXNaTbuk/vpPzHIF50upByx4zW5EqczKYQubsA== +hardhat@^2.19.4: + version "2.19.4" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.19.4.tgz#5112c30295d8be2e18e55d847373c50483ed1902" + integrity sha512-fTQJpqSt3Xo9Mn/WrdblNGAfcANM6XC3tAEi6YogB4s02DmTf93A8QsGb8uR0KR8TFcpcS8lgiW4ugAIYpnbrQ== dependencies: "@ethersproject/abi" "^5.1.2" "@metamask/eth-sig-util" "^4.0.0" @@ -3703,7 +3571,7 @@ has-proto@^1.0.1: resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== -has-symbols@^1.0.0, has-symbols@^1.0.2, has-symbols@^1.0.3: +has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== @@ -3731,14 +3599,6 @@ hash-base@^3.0.0: readable-stream "^3.6.0" safe-buffer "^5.2.0" -hash.js@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" - integrity sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.0" - hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" @@ -3972,7 +3832,7 @@ is-boolean-object@^1.1.0: call-bind "^1.0.2" has-tostringtag "^1.0.0" -is-buffer@^2.0.5, is-buffer@~2.0.3: +is-buffer@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== @@ -4153,29 +4013,21 @@ js-sdsl@^4.1.4: resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.2.tgz#2e3c031b1f47d3aca8b775532e3ebb0818e7f847" integrity sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w== -js-sha3@0.5.7, js-sha3@^0.5.7: - version "0.5.7" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" - integrity sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g== - js-sha3@0.8.0, js-sha3@^0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== +js-sha3@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" + integrity sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g== + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@3.13.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - js-yaml@3.x, js-yaml@^3.13.1: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" @@ -4334,14 +4186,6 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - locate-path@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" @@ -4374,13 +4218,6 @@ lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" - integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== - dependencies: - chalk "^2.4.2" - log-symbols@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" @@ -4547,13 +4384,6 @@ minimalistic-crypto-utils@^1.0.1: dependencies: brace-expansion "^1.1.7" -minimatch@3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - minimatch@5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" @@ -4600,13 +4430,6 @@ mkdirp@*: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50" integrity sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg== -mkdirp@0.5.5: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - mkdirp@0.5.x, mkdirp@^0.5.3, mkdirp@^0.5.5: version "0.5.6" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" @@ -4626,37 +4449,7 @@ mnemonist@^0.38.0: dependencies: obliterator "^2.0.0" -mocha@7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.1.2.tgz#8e40d198acf91a52ace122cd7599c9ab857b29e6" - integrity sha512-o96kdRKMKI3E8U0bjnfqW4QMk12MwZ4mhdBTf+B5a1q9+aq2HRnj+3ZdJu0B/ZhJeK78MgYuv6L8d/rA5AeBJA== - dependencies: - ansi-colors "3.2.3" - browser-stdout "1.3.1" - chokidar "3.3.0" - debug "3.2.6" - diff "3.5.0" - escape-string-regexp "1.0.5" - find-up "3.0.0" - glob "7.1.3" - growl "1.10.5" - he "1.2.0" - js-yaml "3.13.1" - log-symbols "3.0.0" - minimatch "3.0.4" - mkdirp "0.5.5" - ms "2.1.1" - node-environment-flags "1.0.6" - object.assign "4.1.0" - strip-json-comments "2.0.1" - supports-color "6.0.0" - which "1.3.1" - wide-align "1.1.3" - yargs "13.3.2" - yargs-parser "13.1.2" - yargs-unparser "1.6.0" - -mocha@^10.0.0: +mocha@^10.0.0, mocha@^10.2.0: version "10.2.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8" integrity sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg== @@ -4683,36 +4476,6 @@ mocha@^10.0.0: yargs-parser "20.2.4" yargs-unparser "2.0.0" -mocha@^7.1.1: - version "7.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.2.0.tgz#01cc227b00d875ab1eed03a75106689cfed5a604" - integrity sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ== - dependencies: - ansi-colors "3.2.3" - browser-stdout "1.3.1" - chokidar "3.3.0" - debug "3.2.6" - diff "3.5.0" - escape-string-regexp "1.0.5" - find-up "3.0.0" - glob "7.1.3" - growl "1.10.5" - he "1.2.0" - js-yaml "3.13.1" - log-symbols "3.0.0" - minimatch "3.0.4" - mkdirp "0.5.5" - ms "2.1.1" - node-environment-flags "1.0.6" - object.assign "4.1.0" - strip-json-comments "2.0.1" - supports-color "6.0.0" - which "1.3.1" - wide-align "1.1.3" - yargs "13.3.2" - yargs-parser "13.1.2" - yargs-unparser "1.6.0" - mock-fs@^4.1.0: version "4.14.0" resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.14.0.tgz#ce5124d2c601421255985e6e94da80a7357b1b18" @@ -4728,17 +4491,12 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== -ms@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3, ms@^2.1.1: +ms@2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -4825,14 +4583,6 @@ node-emoji@^1.10.0: dependencies: lodash "^4.17.21" -node-environment-flags@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.6.tgz#a30ac13621f6f7d674260a54dede048c3982c088" - integrity sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw== - dependencies: - object.getownpropertydescriptors "^2.0.3" - semver "^5.7.0" - node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.12: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" @@ -4890,21 +4640,11 @@ object-inspect@^1.12.3, object-inspect@^1.9.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== -object-keys@^1.0.11, object-keys@^1.1.1: +object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== -object.assign@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - object.assign@^4.1.4: version "4.1.4" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" @@ -4915,17 +4655,6 @@ object.assign@^4.1.4: has-symbols "^1.0.3" object-keys "^1.1.1" -object.getownpropertydescriptors@^2.0.3: - version "2.1.7" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.7.tgz#7a466a356cd7da4ba8b9e94ff6d35c3eeab5d56a" - integrity sha512-PrJz0C2xJ58FNn11XV2lr4Jt5Gzl94qpy9Lu0JlfEj14z88sqbSBJCBEzdlNUCzY2gburhbrwOZ5BHCmuNUy0g== - dependencies: - array.prototype.reduce "^1.0.6" - call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.22.1" - safe-array-concat "^1.0.0" - obliterator@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-2.0.4.tgz#fa650e019b2d075d745e44f1effeb13a2adbe816" @@ -4991,13 +4720,6 @@ p-limit@^1.1.0: dependencies: p-try "^1.0.0" -p-limit@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - p-limit@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" @@ -5012,13 +4734,6 @@ p-locate@^2.0.0: dependencies: p-limit "^1.1.0" -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== - dependencies: - p-limit "^2.0.0" - p-locate@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" @@ -5038,11 +4753,6 @@ p-try@^1.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -5321,13 +5031,6 @@ readable-stream@^3.6.0: string_decoder "^1.1.1" util-deprecate "^1.0.1" -readdirp@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.2.0.tgz#c30c33352b12c96dfb4b895421a49fd5a9593839" - integrity sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ== - dependencies: - picomatch "^2.0.4" - readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -5389,7 +5092,7 @@ request-promise-core@1.1.4: dependencies: lodash "^4.17.19" -request-promise-native@^1.0.5, request-promise-native@^1.0.9: +request-promise-native@^1.0.9: version "1.0.9" resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28" integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== @@ -5398,7 +5101,7 @@ request-promise-native@^1.0.5, request-promise-native@^1.0.9: stealthy-require "^1.1.1" tough-cookie "^2.3.3" -request@^2.79.0, request@^2.88.0: +request@^2.79.0: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== @@ -5434,11 +5137,6 @@ require-from-string@^2.0.0, require-from-string@^2.0.2: resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - resolve-alpn@^1.0.0, resolve-alpn@^1.2.0: version "1.2.1" resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" @@ -5601,11 +5299,6 @@ sc-istanbul@^0.4.5: which "^1.1.1" wordwrap "^1.0.0" -scrypt-js@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.4.tgz#32f8c5149f0797672e551c07e230f834b6af5f16" - integrity sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw== - scrypt-js@3.0.1, scrypt-js@^3.0.0, scrypt-js@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" @@ -5620,7 +5313,7 @@ secp256k1@^4.0.1: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" -semver@^5.3.0, semver@^5.5.0, semver@^5.7.0: +semver@^5.3.0, semver@^5.5.0: version "5.7.2" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== @@ -5684,16 +5377,6 @@ servify@^0.1.12: request "^2.79.0" xhr "^2.3.3" -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== - -setimmediate@1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.4.tgz#20e81de622d4a02588ce0c8da8973cbcf1d3138f" - integrity sha512-/TjEmXQVEzdod/FFskf3o7oOAsGhHf2j1dZqRFbDzq4F3mvvxflIIi4Hd3bLQE9y/CpwqfSQam5JakI/mi3Pog== - setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" @@ -5848,13 +5531,13 @@ solidity-comments-extractor@^0.0.7: resolved "https://registry.yarnpkg.com/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz#99d8f1361438f84019795d928b931f4e5c39ca19" integrity sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw== -solidity-coverage@^0.8.4: - version "0.8.4" - resolved "https://registry.yarnpkg.com/solidity-coverage/-/solidity-coverage-0.8.4.tgz#c57a21979f5e86859c5198de9fbae2d3bc6324a5" - integrity sha512-xeHOfBOjdMF6hWTbt42iH4x+7j1Atmrf5OldDPMxI+i/COdExUxszOswD9qqvcBTaLGiOrrpnh9UZjSpt4rBsg== +solidity-coverage@^0.8.6: + version "0.8.6" + resolved "https://registry.yarnpkg.com/solidity-coverage/-/solidity-coverage-0.8.6.tgz#c7b18dc9edfeba11064726c37d96265f689c9478" + integrity sha512-vV03mA/0nNMskOdVwNarUcqk0N/aYdelxAbf6RZ5l84FcYHbqDTr2JXyeYMp4bT48qHtAQjnKrygW1FrECyWNw== dependencies: "@ethersproject/abi" "^5.0.9" - "@solidity-parser/parser" "^0.16.0" + "@solidity-parser/parser" "^0.18.0" chalk "^2.4.2" death "^1.1.0" detect-port "^1.3.0" @@ -5865,7 +5548,7 @@ solidity-coverage@^0.8.4: globby "^10.0.1" jsonschema "^1.2.4" lodash "^4.17.15" - mocha "7.1.2" + mocha "^10.2.0" node-emoji "^1.10.0" pify "^4.0.1" recursive-readdir "^2.2.2" @@ -5931,11 +5614,6 @@ stealthy-require@^1.1.1: resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" integrity sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g== -streamsearch@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" - integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== - strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" @@ -5946,7 +5624,7 @@ string-format@^2.0.0: resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b" integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA== -"string-width@^1.0.2 || 2", string-width@^2.1.1: +string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -5954,15 +5632,6 @@ string-format@^2.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^3.0.0, string-width@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -6020,13 +5689,6 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -6041,23 +5703,11 @@ strip-hex-prefix@1.0.0: dependencies: is-hex-prefixed "1.0.0" -strip-json-comments@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== - strip-json-comments@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -supports-color@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" - integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== - dependencies: - has-flag "^3.0.0" - supports-color@8.1.1: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" @@ -6476,11 +6126,11 @@ unbox-primitive@^1.0.2: which-boxed-primitive "^1.0.2" undici@^5.14.0: - version "5.24.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.24.0.tgz#6133630372894cfeb3c3dab13b4c23866bd344b5" - integrity sha512-OKlckxBjFl0oXxcj9FU6oB8fDAaiRUq+D8jrFWGmOfI/gIyjk/IeS75LMzgYKUaeHzLUcYvf9bbJGSrUwTfwwQ== + version "5.28.2" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.2.tgz#fea200eac65fc7ecaff80a023d1a0543423b4c91" + integrity sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w== dependencies: - busboy "^1.6.0" + "@fastify/busboy" "^2.0.0" unfetch@^4.2.0: version "4.2.0" @@ -6547,11 +6197,6 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== -uuid@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.1.tgz#c2a30dedb3e535d72ccf82e343941a50ba8533ac" - integrity sha512-nWg9+Oa3qD2CQzHIP4qKUqwNfzKn8P0LtFhotaCTFchsV7ZfDhAybeip/HZVeMIpZi9JgY1E3nUlwaCmZT1sEg== - uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" @@ -6868,11 +6513,6 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" -which-module@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" - integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ== - which-typed-array@^1.1.10, which-typed-array@^1.1.11, which-typed-array@^1.1.2: version "1.1.11" resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.11.tgz#99d691f23c72aab6768680805a271b69761ed61a" @@ -6884,20 +6524,13 @@ which-typed-array@^1.1.10, which-typed-array@^1.1.11, which-typed-array@^1.1.2: gopd "^1.0.1" has-tostringtag "^1.0.0" -which@1.3.1, which@^1.1.1, which@^1.3.1: +which@^1.1.1, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" -wide-align@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - word-wrap@~1.2.3: version "1.2.5" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" @@ -6921,15 +6554,6 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -wrap-ansi@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" - integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== - dependencies: - ansi-styles "^3.2.0" - string-width "^3.0.0" - strip-ansi "^5.0.0" - wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -6998,21 +6622,11 @@ xhr@^2.0.4, xhr@^2.3.3: parse-headers "^2.0.0" xtend "^4.0.0" -xmlhttprequest@1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" - integrity sha512-58Im/U0mlVBLM38NdZjHyhuMtCqa61469k2YP/AaPbvCoV9aQGUpbJBj1QRm2ytRiVQBD/fsw7L2bJGDVQswBA== - xtend@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== -y18n@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" - integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== - y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" @@ -7033,14 +6647,6 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yargs-parser@13.1.2, yargs-parser@^13.1.2: - version "13.1.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" - integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@20.2.4: version "20.2.4" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" @@ -7051,15 +6657,6 @@ yargs-parser@^20.2.2: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs-unparser@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" - integrity sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== - dependencies: - flat "^4.1.0" - lodash "^4.17.15" - yargs "^13.3.0" - yargs-unparser@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" @@ -7070,22 +6667,6 @@ yargs-unparser@2.0.0: flat "^5.0.2" is-plain-obj "^2.1.0" -yargs@13.3.2, yargs@^13.3.0: - version "13.3.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" - integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.2" - yargs@16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" diff --git a/vdr/Cargo.lock b/vdr/Cargo.lock index ac8f0c04..54a6490a 100644 --- a/vdr/Cargo.lock +++ b/vdr/Cargo.lock @@ -26,6 +26,21 @@ dependencies = [ "memchr", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anstyle" version = "1.0.4" @@ -103,7 +118,7 @@ dependencies = [ "log", "parking", "polling", - "rustix 0.37.24", + "rustix 0.37.27", "slab", "socket2 0.4.9", "waker-fn", @@ -168,6 +183,18 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +[[package]] +name = "auto_impl" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -189,6 +216,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "base64" version = "0.13.1" @@ -197,9 +230,15 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bitflags" @@ -291,6 +330,9 @@ name = "bytes" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +dependencies = [ + "serde", +] [[package]] name = "cc" @@ -307,6 +349,20 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41daef31d7a747c5c847246f36de49ced6f7403b4cdabc807a97b5cc184cda7a" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.52.0", +] + [[package]] name = "concurrent-queue" version = "2.3.0" @@ -316,6 +372,25 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "const-hex" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5104de16b218eddf8e34ffe2f86f74bfa4e61e95a1b89732fccf6325efd0557" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "convert_case" version = "0.4.0" @@ -324,9 +399,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -334,9 +409,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" @@ -362,6 +437,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -372,6 +459,51 @@ dependencies = [ "typenum", ] +[[package]] +name = "darling" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -401,7 +533,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", + "const-oid", "crypto-common", + "subtle", ] [[package]] @@ -410,12 +544,45 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + [[package]] name = "either" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "encoding_rs" version = "0.8.33" @@ -446,23 +613,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] @@ -531,6 +687,33 @@ dependencies = [ "uint", ] +[[package]] +name = "ethers-core" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918b1a9ba585ea61022647def2f27c29ba19f6d2a4a4c8f68a9ae97fd5769737" +dependencies = [ + "arrayvec", + "bytes", + "chrono", + "const-hex", + "elliptic-curve", + "ethabi", + "generic-array", + "k256", + "num_enum", + "open-fastrlp", + "rand", + "rlp", + "serde", + "serde_json", + "strum", + "tempfile", + "thiserror", + "tiny-keccak", + "unicode-xid", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -552,6 +735,16 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -587,9 +780,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -728,6 +921,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -761,11 +955,22 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "h2" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", @@ -773,7 +978,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap", "slab", "tokio", "tokio-util", @@ -795,12 +1000,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.14.1" @@ -813,7 +1012,7 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "bytes", "headers-core", "http", @@ -831,6 +1030,12 @@ dependencies = [ "http", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "hermit-abi" version = "0.3.3" @@ -843,11 +1048,20 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -856,9 +1070,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -885,9 +1099,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -900,7 +1114,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2 0.5.5", "tokio", "tower-service", "tracing", @@ -920,6 +1134,35 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "iana-time-zone" +version = "0.1.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.4.0" @@ -930,6 +1173,16 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "impl-codec" version = "0.6.0" @@ -968,16 +1221,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - [[package]] name = "indexmap" version = "2.0.2" @@ -985,23 +1228,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.1", + "hashbrown", ] [[package]] -name = "indy2_vdr" +name = "indy-besu-vdr" version = "0.0.1" dependencies = [ "async-std", "async-trait", + "base64 0.21.7", "bs58", + "chrono", "env_logger", "ethabi", "ethereum", "ethereum-types", + "ethers-core", "futures", "hex", "log", + "log-derive", "mockall", "once_cell", "rand", @@ -1009,6 +1256,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", + "sha3", "thiserror", "web-sys", "web3", @@ -1031,14 +1279,14 @@ checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ "hermit-abi", "libc", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" @@ -1047,8 +1295,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", - "rustix 0.38.15", - "windows-sys", + "rustix 0.38.30", + "windows-sys 0.48.0", ] [[package]] @@ -1090,6 +1338,19 @@ dependencies = [ "serde_json", ] +[[package]] +name = "k256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f01b677d82ef7a676aa37e099defd83a28e15687112cafdd112d60236b6115b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", +] + [[package]] name = "keccak" version = "0.1.4" @@ -1116,9 +1377,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[package]] +name = "libm" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "linux-raw-sys" @@ -1128,15 +1395,15 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.8" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -1151,6 +1418,18 @@ dependencies = [ "value-bag", ] +[[package]] +name = "log-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a42526bb432bcd1b43571d5f163984effa25409a29f1a3242a54d0577d55bcf" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "memchr" version = "2.6.4" @@ -1174,13 +1453,13 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1228,6 +1507,16 @@ dependencies = [ "tempfile", ] +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", + "libm", +] + [[package]] name = "num_cpus" version = "1.16.0" @@ -1238,6 +1527,27 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.37", +] + [[package]] name = "object" version = "0.32.1" @@ -1259,11 +1569,36 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "open-fastrlp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", + "ethereum-types", + "open-fastrlp-derive", +] + +[[package]] +name = "open-fastrlp-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" +dependencies = [ + "bytes", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "openssl" -version = "0.10.57" +version = "0.10.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" dependencies = [ "bitflags 2.4.0", "cfg-if", @@ -1293,9 +1628,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.93" +version = "0.9.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" dependencies = [ "cc", "libc", @@ -1347,22 +1682,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" @@ -1407,11 +1742,21 @@ dependencies = [ "futures-io", ] +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "polling" @@ -1426,7 +1771,7 @@ dependencies = [ "libc", "log", "pin-project-lite", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1486,6 +1831,30 @@ dependencies = [ "toml_edit", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" version = "1.0.67" @@ -1495,6 +1864,22 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "proptest" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +dependencies = [ + "bitflags 2.4.0", + "lazy_static", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax 0.8.2", + "unarray", +] + [[package]] name = "quote" version = "1.0.33" @@ -1540,11 +1925,20 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] + [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] @@ -1558,7 +1952,7 @@ dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax", + "regex-syntax 0.7.5", ] [[package]] @@ -1569,7 +1963,7 @@ checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.7.5", ] [[package]] @@ -1578,13 +1972,19 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + [[package]] name = "reqwest" -version = "0.11.20" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -1605,6 +2005,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", "tokio-native-tls", "tower-service", @@ -1615,6 +2016,16 @@ dependencies = [ "winreg", ] +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + [[package]] name = "rlp" version = "0.5.2" @@ -1660,31 +2071,37 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.24" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4279d76516df406a8bd37e7dff53fd37d1a093f997a3c34a5c21658c126db06d" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ "bitflags 1.3.2", "errno", "io-lifetimes", "libc", "linux-raw-sys 0.3.8", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "rustix" -version = "0.38.15" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f9da0cbd88f9f09e7814e388301c8414c51c62aa6ce1e4b5c551d49d96e531" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.8", - "windows-sys", + "linux-raw-sys 0.4.13", + "windows-sys 0.52.0", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "ryu" version = "1.0.15" @@ -1718,11 +2135,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -1731,6 +2148,20 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + [[package]] name = "secp256k1" version = "0.27.0" @@ -1793,9 +2224,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.19" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "send_wrapper" @@ -1881,6 +2312,17 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "sha3" version = "0.10.8" @@ -1900,6 +2342,16 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core", +] + [[package]] name = "slab" version = "0.4.9" @@ -1911,9 +2363,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "2593d31f82ead8df961d8bd23a64c2ccf2eb5dd34b0a34bfb4dd54011c72009e" [[package]] name = "socket2" @@ -1932,7 +2384,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1950,12 +2402,56 @@ dependencies = [ "sha-1", ] +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" + +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.37", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + [[package]] name = "syn" version = "1.0.109" @@ -1978,6 +2474,27 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tap" version = "1.0.1" @@ -1986,15 +2503,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand 2.0.1", "redox_syscall", - "rustix 0.38.15", - "windows-sys", + "rustix 0.38.30", + "windows-sys 0.52.0", ] [[package]] @@ -2072,7 +2589,7 @@ dependencies = [ "signal-hook-registry", "socket2 0.5.5", "tokio-macros", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -2109,9 +2626,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -2134,7 +2651,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.2", + "indexmap", "toml_datetime", "winnow", ] @@ -2176,9 +2693,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" @@ -2198,11 +2715,17 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -2219,14 +2742,20 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna", + "idna 0.5.0", "percent-encoding", ] @@ -2352,7 +2881,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5388522c899d1e1c96a4c307e3797e0f697ba7c77dd8e0e625ecba9dd0342937" dependencies = [ "arrayvec", - "base64 0.21.4", + "base64 0.21.7", "bytes", "derive_more", "ethabi", @@ -2362,7 +2891,7 @@ dependencies = [ "getrandom", "headers", "hex", - "idna", + "idna 0.4.0", "js-sys", "jsonrpc-core", "log", @@ -2430,13 +2959,31 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", ] [[package]] @@ -2445,13 +2992,28 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -2460,42 +3022,84 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" version = "0.5.15" @@ -2512,7 +3116,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ "cfg-if", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -2523,3 +3127,9 @@ checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" dependencies = [ "tap", ] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/vdr/Cargo.toml b/vdr/Cargo.toml index 268d3eb8..f87b3ff7 100644 --- a/vdr/Cargo.toml +++ b/vdr/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "indy2_vdr" +name = "indy-besu-vdr" description = "A client library for interacting with Indy Ledger 2.0." version = "0.0.1" authors = ["Artem Ivanov "] @@ -8,7 +8,7 @@ license = "Apache-2.0" readme = "./README.md" [lib] -name = "indy2_vdr" +name = "indy_besu_vdr" path = "src/lib.rs" crate-type = ["rlib", "cdylib"] @@ -21,26 +21,31 @@ migration = [] [dependencies] log = "0.4" +log-derive = "0.4.1" async-std = { version = "1.12.0", features = ["attributes", "tokio1"] } async-trait = "0.1.73" +base64 = "0.21.7" +bs58 = "0.5.0" +chrono = "0.4.31" ethereum = "0.15.0" ethereum-types = "0.14.1" ethabi = "18.0.0" +ethers-core = "2.0.12" hex = "0.4.3" futures = "0.3.28" once_cell = "1.18.0" rand = { version = "0.8.5", optional = true } secp256k1 = { version = "0.28.0", optional = true, features = ["recovery", "rand"] } +sha3 = "0.10.8" serde = "1.0.188" serde_derive = "1.0.188" serde_json = "1.0.107" thiserror = "1.0.49" -web3 = { version = "0.19.0", optional = true } +web3 = { version = "0.20.0", optional = true } web-sys = { version = "0.3.64", optional = true, features = ["Window"] } -web3-wasm = { package = "web3", version = "0.19.0", default-features = false, features = ["wasm", "http", "http-tls"], optional = true } +web3-wasm = { package = "web3", version = "0.20.0", default-features = false, features = ["wasm", "http", "http-tls"], optional = true } [dev-dependencies] mockall = "0.12.0" -bs58 = "0.5.0" env_logger = "0.10.0" rand = "0.8.5" \ No newline at end of file diff --git a/vdr/README.md b/vdr/README.md index b3ad3104..f00409ee 100644 --- a/vdr/README.md +++ b/vdr/README.md @@ -35,7 +35,7 @@ To use vdr, add this to your `Cargo.toml`: ``` [dependencies] -indy2_vdr = { path = "../path/to/crate" } +indy_besu_vdr = { path = "../path/to/crate" } ``` ## Code formatting @@ -67,11 +67,11 @@ cargo +nightly fmt RUST_TEST_THREADS=1 cargo test --features "ledger_test" ``` -# Logging +## Logging - To see the logs, please set `RUST_LOG` environment variable to desired log level: `info`, `debug`, `trace` etc. -## FFI +## Wrappers ### Kotlin, Python, Swift @@ -83,4 +83,4 @@ See instructions [here](./uniffi/README.md). `Indy-VDR` library uses [wasm-bindgen](https://rustwasm.github.io/wasm-bindgen/) to generate bindings for JavaScript, NodeJs, WebAssembly. -See instructions [here](./wasm/README.md). \ No newline at end of file +See instructions [here](./wasm/README.md). diff --git a/vdr/src/client/client.rs b/vdr/src/client/client.rs index 8168642b..091ed6b7 100644 --- a/vdr/src/client/client.rs +++ b/vdr/src/client/client.rs @@ -1,6 +1,10 @@ -use std::collections::HashMap; +use std::{ + collections::HashMap, + fmt::{Debug, Formatter}, +}; -use log::{info, trace, warn}; +use log::warn; +use log_derive::{logfn, logfn_inputs}; use crate::{ client::{ @@ -8,8 +12,11 @@ use crate::{ Client, Contract, QuorumHandler, }, error::{VdrError, VdrResult}, - types::{ContractConfig, ContractSpec, PingStatus, Transaction, TransactionType}, - Address, QuorumConfig, + types::{ + Block, ContractConfig, ContractSpec, EventLog, EventQuery, PingStatus, Transaction, + TransactionType, + }, + Address, BlockDetails, QuorumConfig, }; pub struct LedgerClient { @@ -30,18 +37,14 @@ impl LedgerClient { /// /// # Returns /// client to use for building and sending transactions + #[logfn(Info)] + #[logfn_inputs(Debug)] pub fn new( chain_id: u64, rpc_node: &str, contract_configs: &[ContractConfig], quorum_config: Option<&QuorumConfig>, ) -> VdrResult { - trace!( - "Started creating new LedgerClient. Chain id: {}, node address: {}", - chain_id, - rpc_node - ); - let client = Box::new(Web3Client::new(rpc_node)?); let contracts = Self::init_contracts(&client, contract_configs)?; @@ -57,12 +60,6 @@ impl LedgerClient { contracts, quorum_handler, }; - - info!( - "Created new LedgerClient. Chain id: {}, node address: {}", - chain_id, rpc_node - ); - Ok(ledger_client) } @@ -70,8 +67,13 @@ impl LedgerClient { /// /// # Returns /// ping status + #[logfn(Info)] + #[logfn_inputs(Debug)] pub async fn ping(&self) -> VdrResult { - self.client.ping().await + match self.client.get_block(None).await { + Ok(block) => Ok(PingStatus::ok(block.number, block.timestamp)), + Err(err) => Ok(PingStatus::err(err.to_string().as_str())), + } } /// Submit prepared transaction to the ledger @@ -83,6 +85,8 @@ impl LedgerClient { /// #Returns /// transaction execution result: /// depending on the type it will be either result bytes or block hash + #[logfn(Info)] + #[logfn_inputs(Debug)] pub async fn submit_transaction(&self, transaction: &Transaction) -> VdrResult> { let result = match transaction.type_ { TransactionType::Read => { @@ -100,6 +104,21 @@ impl LedgerClient { Ok(result) } + /// Submit prepared events query to the ledger + /// + /// #Params + /// `query` - events query to submit + /// + /// #Returns + /// log events received from the ledger + #[logfn(Info)] + #[logfn_inputs(Debug)] + pub async fn query_events(&self, query: &EventQuery) -> VdrResult> { + let events = self.client.query_events(query).await?; + // TODO: Check quorum for events + Ok(events) + } + /// Get receipt for the given block hash /// /// # Params @@ -107,13 +126,23 @@ impl LedgerClient { /// /// # Returns /// receipt for the given block + #[logfn(Info)] + #[logfn_inputs(Debug)] pub async fn get_receipt(&self, hash: &[u8]) -> VdrResult { self.client.get_receipt(hash).await } - pub(crate) async fn get_transaction_count(&self, address: &Address) -> VdrResult> { - let nonce = self.client.get_transaction_count(address).await?; - Ok(nonce.to_vec()) + /// Get a number of transactions sent by the given account address + /// + /// # Params + /// `address` - target account address + /// + /// # Returns + /// number of sent transaction + #[logfn(Info)] + #[logfn_inputs(Debug)] + pub(crate) async fn get_transaction_count(&self, address: &Address) -> VdrResult { + self.client.get_transaction_count(address).await } pub(crate) fn contract(&self, name: &str) -> VdrResult<&dyn Contract> { @@ -133,6 +162,8 @@ impl LedgerClient { self.chain_id } + #[logfn(Info)] + #[logfn_inputs(Debug)] fn init_contracts( client: &Web3Client, contract_configs: &[ContractConfig], @@ -163,23 +194,39 @@ impl LedgerClient { Ok(contracts) } + + #[logfn(Info)] + #[logfn_inputs(Debug)] + pub(crate) async fn get_block(&self, block: Option<&Block>) -> VdrResult { + self.client + .get_block(block.map(|block| block.value())) + .await + } +} + +impl Debug for LedgerClient { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, r#"LedgerClient {{ chain_id: {} }}"#, self.chain_id) + } } #[cfg(test)] pub mod test { use super::*; + use crate::types::EventLog; use async_trait::async_trait; use once_cell::sync::Lazy; use std::{env, fs}; pub const CHAIN_ID: u64 = 1337; pub const CONTRACTS_SPEC_BASE_PATH: &str = "../smart_contracts/artifacts/contracts/"; - pub const DID_REGISTRY_SPEC_PATH: &str = "did/IndyDidRegistry.sol/IndyDidRegistry.json"; pub const SCHEMA_REGISTRY_SPEC_PATH: &str = "cl/SchemaRegistry.sol/SchemaRegistry.json"; pub const CRED_DEF_REGISTRY_SPEC_PATH: &str = "cl/CredentialDefinitionRegistry.sol/CredentialDefinitionRegistry.json"; pub const VALIDATOR_CONTROL_PATH: &str = "network/ValidatorControl.sol/ValidatorControl.json"; pub const ROLE_CONTROL_PATH: &str = "auth/RoleControl.sol/RoleControl.json"; + pub const ETHR_DID_REGISTRY_PATH: &str = + "did/EthereumExtDidRegistry.sol/EthereumExtDidRegistry.json"; pub const RPC_NODE_ADDRESS: &str = "http://127.0.0.1:8545"; pub const CLIENT_NODE_ADDRESSES: [&str; 4] = [ "http://127.0.0.1:21001", @@ -187,10 +234,7 @@ pub mod test { "http://127.0.0.1:21003", "http://127.0.0.1:21004", ]; - pub static DEFAULT_NONCE: Lazy> = Lazy::new(|| vec![0, 0, 0, 0]); - - pub static DID_REGISTRY_ADDRESS: Lazy
= - Lazy::new(|| Address::from("0x0000000000000000000000000000000000003333")); + pub const DEFAULT_NONCE: u64 = 0; pub static SCHEMA_REGISTRY_ADDRESS: Lazy
= Lazy::new(|| Address::from("0x0000000000000000000000000000000000005555")); @@ -204,6 +248,9 @@ pub mod test { pub static ROLE_CONTROL_ADDRESS: Lazy
= Lazy::new(|| Address::from("0x0000000000000000000000000000000000006666")); + pub static ETHR_DID_REGISTRY_ADDRESS: Lazy
= + Lazy::new(|| Address::from("0x0000000000000000000000000000000000018888")); + pub static TRUSTEE_ACC: Lazy
= Lazy::new(|| Address::from("0xf0e2db6c8dc6c681bb5d6ad121a107f300e9b2b5")); @@ -223,11 +270,6 @@ pub mod test { fn contracts() -> Vec { vec![ - ContractConfig { - address: DID_REGISTRY_ADDRESS.to_string(), - spec_path: Some(build_contract_path(DID_REGISTRY_SPEC_PATH)), - spec: None, - }, ContractConfig { address: SCHEMA_REGISTRY_ADDRESS.to_string(), spec_path: Some(build_contract_path(SCHEMA_REGISTRY_SPEC_PATH)), @@ -248,25 +290,30 @@ pub mod test { spec_path: Some(build_contract_path(ROLE_CONTROL_PATH)), spec: None, }, + ContractConfig { + address: ETHR_DID_REGISTRY_ADDRESS.to_string(), + spec_path: Some(build_contract_path(ETHR_DID_REGISTRY_PATH)), + spec: None, + }, ] } pub fn client() -> LedgerClient { - LedgerClient::new( - CHAIN_ID, - RPC_NODE_ADDRESS, - &contracts(), - Some(&QuorumConfig::default()), - ) - .unwrap() + LedgerClient::new(CHAIN_ID, RPC_NODE_ADDRESS, &contracts(), None).unwrap() } pub struct MockClient {} + impl Debug for MockClient { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, r#"MockClient {{ }}"#) + } + } + #[async_trait] impl Client for MockClient { - async fn get_transaction_count(&self, _address: &Address) -> VdrResult<[u64; 4]> { - Ok([0, 0, 0, 0]) + async fn get_transaction_count(&self, _address: &Address) -> VdrResult { + Ok(0) } async fn submit_transaction(&self, _transaction: &[u8]) -> VdrResult> { @@ -277,11 +324,15 @@ pub mod test { todo!() } + async fn query_events(&self, _query: &EventQuery) -> VdrResult> { + todo!() + } + async fn get_receipt(&self, _hash: &[u8]) -> VdrResult { todo!() } - async fn ping(&self) -> VdrResult { + async fn get_block(&self, _block: Option) -> VdrResult { todo!() } @@ -319,7 +370,10 @@ pub mod test { #[async_std::test] async fn client_ping_test() { let client = client(); - assert_eq!(PingStatus::ok(), client.ping().await.unwrap()) + match client.ping().await.unwrap().status { + Status::Ok { .. } => {} + Status::Err { .. } => assert!(false, "Ping status expected to be `Ok`."), + } } #[async_std::test] @@ -334,7 +388,7 @@ pub mod test { .unwrap(); match client.ping().await.unwrap().status { Status::Err { .. } => {} - Status::Ok => assert!(false, "Ping status expected to be `Err`."), + Status::Ok { .. } => assert!(false, "Ping status expected to be `Err`."), } } } diff --git a/vdr/src/client/implementation/web3/client.rs b/vdr/src/client/implementation/web3/client.rs index 4e369004..eb46b2de 100644 --- a/vdr/src/client/implementation/web3/client.rs +++ b/vdr/src/client/implementation/web3/client.rs @@ -1,28 +1,41 @@ use crate::{ client::Client, error::{VdrError, VdrResult}, - types::PingStatus, - Address, Transaction, + types::EventQuery, + Address, Block, BlockDetails, Transaction, }; use async_trait::async_trait; +use ethereum_types::{H160, U64}; use log::{trace, warn}; +use log_derive::{logfn, logfn_inputs}; use serde_json::json; -use std::{str::FromStr, time::Duration}; +use std::{ + fmt::{Debug, Formatter}, + str::FromStr, + time::Duration, +}; #[cfg(not(feature = "wasm"))] use web3::{ api::Eth, transports::Http, - types::{Address as EthAddress, Bytes, CallRequest, TransactionId, H256}, + types::{ + Address as EthAddress, BlockId, BlockNumber, Bytes, CallRequest, FilterBuilder, + TransactionId, H256, + }, Web3, }; +use crate::types::EventLog; #[cfg(feature = "wasm")] use web3_wasm::{ api::Eth, transports::Http, - types::{Address as EthAddress, Bytes, CallRequest, TransactionId, H256}, + types::{ + Address as EthAddress, BlockId, BlockNumber, Bytes, CallRequest, FilterBuilder, + TransactionId, H256, + }, Web3, }; @@ -34,18 +47,16 @@ const POLL_INTERVAL: u64 = 200; const NUMBER_TX_CONFIRMATIONS: usize = 1; // FIXME: what number of confirmation events should we wait? 2n+1? impl Web3Client { + #[logfn(Info)] + #[logfn_inputs(Debug)] pub fn new(node_address: &str) -> VdrResult { - trace!( - "Started creating new Web3Client. Node address: {}", - node_address - ); + trace!("Web3Client::new >>> node_address: {}", node_address); let transport = Http::new(node_address).map_err(|_| VdrError::ClientNodeUnreachable)?; let web3 = Web3::new(transport); let web3_client = Web3Client { client: web3 }; - trace!("Created new Web3Client. Node address: {}", node_address); - + trace!("Web3Client::new <<<"); Ok(web3_client) } @@ -57,7 +68,9 @@ impl Web3Client { #[cfg_attr(not(feature = "wasm"), async_trait)] #[cfg_attr(feature = "wasm", async_trait(? Send))] impl Client for Web3Client { - async fn get_transaction_count(&self, address: &crate::Address) -> VdrResult<[u64; 4]> { + async fn get_transaction_count(&self, address: &Address) -> VdrResult { + trace!("Web3Client::get_transaction_count(address: {:?})", address); + let account_address = EthAddress::from_str(address.as_ref()).map_err(|_| { VdrError::ClientInvalidTransaction(format!( "Invalid transaction sender address {:?}", @@ -65,19 +78,20 @@ impl Client for Web3Client { )) })?; - let nonce = self + let count = self .client .eth() .transaction_count(account_address, None) - .await - .unwrap(); + .await? + .as_u64(); - Ok(nonce.0) + trace!("Web3Client::get_transaction_count() -> {:?}", count); + Ok(count) } async fn submit_transaction(&self, transaction: &[u8]) -> VdrResult> { trace!( - "Submit transaction process has started. Transaction: {:?}", + "Web3Client::submit_transaction(transaction: {:?})", transaction ); @@ -88,16 +102,19 @@ impl Client for Web3Client { Duration::from_millis(POLL_INTERVAL), NUMBER_TX_CONFIRMATIONS, ) - .await?; - - trace!("Submitted transaction: {:?}", transaction); + .await? + .transaction_hash + .0 + .to_vec(); - Ok(receipt.transaction_hash.0.to_vec()) + trace!("Web3Client::submit_transaction() -> {:?}", receipt); + Ok(receipt) } async fn call_transaction(&self, to: &str, transaction: &[u8]) -> VdrResult> { trace!( - "Call transaction process has started. Transaction: {:?}", + "Web3Client::call_transaction(to: {:?}, transaction: {:?})", + to, transaction ); @@ -118,14 +135,87 @@ impl Client for Web3Client { .to(address) .data(Bytes(transaction.to_vec())) .build(); - let response = self.client.eth().call(request, None).await?; + let response = self.client.eth().call(request, None).await?.0.to_vec(); + + trace!("Web3Client::call_transaction() -> {:?}", response); + Ok(response) + } - trace!("Called transaction: {:?}", transaction); + async fn query_events(&self, query: &EventQuery) -> VdrResult> { + trace!("Web3Client::query_events(query: {:?})", query); + + let address = H160::from_str(query.address.as_ref()).map_err(|_| { + VdrError::ClientInvalidTransaction(format!( + "Invalid transaction target address {:?}", + query.address + )) + })?; + + let from_block = match query.from_block { + Some(ref block) => BlockNumber::Number(U64::from(block.value())), + None => BlockNumber::Earliest, + }; + + let to_block = match query.to_block { + Some(ref block) => BlockNumber::Number(U64::from(block.value())), + None => BlockNumber::Latest, + }; + + let event_signature = match query.event_signature { + Some(ref event_signature) => Some(H256::from_str(event_signature).map_err(|_| { + VdrError::ClientInvalidTransaction(format!( + "Unable to convert event signature into H256 {:?}", + event_signature + )) + })?), + None => None, + }; - Ok(response.0.to_vec()) + let event_filter = match query.event_filter { + Some(ref event_filter) => Some(H256::from_str(event_filter).map_err(|_| { + VdrError::ClientInvalidTransaction(format!( + "Unable to convert event filter into H256 {:?}", + event_filter + )) + })?), + None => None, + }; + + let filter = FilterBuilder::default() + .address(vec![address]) + .topics( + event_signature.map(|event_signature| vec![event_signature]), + event_filter.map(|event_filter| vec![event_filter]), + None, + None, + ) + .from_block(from_block) + .to_block(to_block) + .build(); + + let logs = self + .client + .eth() + .logs(filter) + .await + .map_err(|_| VdrError::GetTransactionError("Could not query events".to_string()))?; + + let events: Vec = logs + .into_iter() + .map(|log| EventLog { + topics: log.topics, + data: log.data.0, + block: Block::from(log.block_number.unwrap_or_default().as_u64()), + }) + .collect(); + + trace!("Web3Client::query_events() -> {:?}", events); + Ok(events) } async fn get_receipt(&self, hash: &[u8]) -> VdrResult { + trace!("Web3Client::get_receipt(hash: {:?})", hash); + let receipt = self .client .eth() @@ -139,25 +229,37 @@ impl Client for Web3Client { vdr_error }) - .map(|receipt| json!(receipt).to_string()); + .map(|receipt| json!(receipt).to_string())?; - trace!("Got receipt: {:?}", receipt); - - receipt + trace!("Web3Client::query_events() -> {:?}", receipt); + Ok(receipt) } - async fn ping(&self) -> VdrResult { - let ping_result = match self.client.eth().block_number().await { - Ok(_current_block) => Ok(PingStatus::ok()), - Err(_) => Ok(PingStatus::err("Could not get current network block")), - }; + async fn get_block(&self, block: Option) -> VdrResult { + trace!("Web3Client::ping()"); - trace!("Ping result: {:?}", ping_result); + let block_id = match block { + Some(block) => BlockId::Number(BlockNumber::Number(U64::from(block))), + None => BlockId::Number(BlockNumber::Latest), + }; - ping_result + match self.client.eth().block(block_id).await { + Ok(Some(block)) => Ok(BlockDetails { + number: block.number.unwrap().as_u64(), + timestamp: block.timestamp.as_u64(), + }), + _ => Err(VdrError::ClientInvalidState( + "Could not get current network block".to_string(), + )), + } } async fn get_transaction(&self, transaction_hash: &[u8]) -> VdrResult> { + trace!( + "Web3Client::get_transaction(transaction_hash: {:?})", + transaction_hash + ); + let transaction_id = TransactionId::Hash(H256::from_slice(transaction_hash)); let transaction = self .client @@ -177,12 +279,20 @@ impl Client for Web3Client { .to .map(|from| Address::from(from.to_string().as_str())) .unwrap_or_default(), - nonce: Some(transaction.nonce.0.to_vec()), + nonce: Some(transaction.nonce.as_u64()), chain_id: 0, data: transaction.input.0.to_vec(), signature: Default::default(), hash: Some(transaction.hash.as_bytes().to_vec()), }); + + trace!("Web3Client::get_transaction() -> {:?}", transaction); Ok(transaction) } } + +impl Debug for Web3Client { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, r#"Web3Client {{ }}"#) + } +} diff --git a/vdr/src/client/implementation/web3/contract.rs b/vdr/src/client/implementation/web3/contract.rs index 110e0b46..b86794dc 100644 --- a/vdr/src/client/implementation/web3/contract.rs +++ b/vdr/src/client/implementation/web3/contract.rs @@ -1,23 +1,26 @@ use crate::{ client::{implementation::web3::client::Web3Client, Contract}, error::{VdrError, VdrResult}, - types::{ContractOutput, ContractSpec}, + types::ContractSpec, Address, }; +use std::fmt::{Debug, Formatter}; +use ethabi::Event; use log::{trace, warn}; +use log_derive::{logfn, logfn_inputs}; use std::str::FromStr; #[cfg(not(feature = "wasm"))] use web3::{ contract::Contract as Web3ContractImpl, - ethabi::{Address as EthAddress, Function, Token}, + ethabi::{Address as EthAddress, Function}, transports::Http, }; #[cfg(feature = "wasm")] use web3_wasm::{ contract::Contract as Web3ContractImpl, - ethabi::{Address as EthAddress, Function, Token}, + ethabi::{Address as EthAddress, Function}, transports::Http, }; @@ -32,7 +35,11 @@ impl Web3Contract { address: &str, contract_spec: &ContractSpec, ) -> VdrResult { - trace!("Started creating new Web3Contract. Address: {:?}", address); + trace!( + "Web3Contract::new >>> address: {:?}, address: {:?}", + address, + contract_spec + ); let abi = serde_json::to_vec(&contract_spec.abi).map_err(|err| { let vdr_error = VdrError::CommonInvalidData(format!( @@ -57,14 +64,23 @@ impl Web3Contract { let contract = Web3ContractImpl::from_json(web3_client.eth(), parsed_address, abi.as_slice())?; - trace!("Created new contract: {:?}", contract); - + trace!("Web3Contract::new <<< contract: {:?}", contract); Ok(Web3Contract { contract, address: Address::from(address), }) } +} +impl Contract for Web3Contract { + #[logfn(Trace)] + #[logfn_inputs(Trace)] + fn address(&self) -> &Address { + &self.address + } + + #[logfn(Trace)] + #[logfn_inputs(Trace)] fn function(&self, name: &str) -> VdrResult<&Function> { self.contract.abi().function(name).map_err(|err| { let vdr_error = VdrError::from(err); @@ -77,51 +93,25 @@ impl Web3Contract { vdr_error }) } -} - -impl Contract for Web3Contract { - fn address(&self) -> &Address { - &self.address - } - fn encode_input(&self, method: &str, params: &[Token]) -> VdrResult> { - trace!("Input params: {:?} encoding has started", params); - - let encoded_input = self.function(method)?.encode_input(params).map_err(|err| { + #[logfn(Trace)] + #[logfn_inputs(Trace)] + fn event(&self, name: &str) -> VdrResult<&Event> { + self.contract.abi().event(name).map_err(|err| { let vdr_error = VdrError::from(err); warn!( - "Error: {:?} during encoding input params: {:?}", - vdr_error, params + "Error: {:?} during getting smart contract function: {}", + vdr_error, name ); vdr_error - }); - - trace!( - "Input params: {:?} encoding has finished. Result: {:?}", - params, - encoded_input - ); - - encoded_input + }) } +} - fn decode_output(&self, method: &str, output: &[u8]) -> VdrResult { - trace!("Output: {:?} decoding has started", output); - - let decoded_output = self - .function(method)? - .decode_output(output) - .map_err(VdrError::from) - .map(ContractOutput::from); - - trace!( - "Output: {:?} decoding has finished. Result: {:?}", - output, - decoded_output - ); - - decoded_output +impl Debug for Web3Contract { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, r#"Web3Contract {{ address: {:?} }}"#, self.address) } } diff --git a/vdr/src/client/mod.rs b/vdr/src/client/mod.rs index 6213a6f5..405b64bb 100644 --- a/vdr/src/client/mod.rs +++ b/vdr/src/client/mod.rs @@ -3,24 +3,23 @@ pub mod constants; pub mod implementation; pub mod quorum; -use crate::{ - error::VdrResult, - types::{Address, ContractOutput, ContractParam, PingStatus}, - Transaction, -}; +use crate::{error::VdrResult, types::Address, BlockDetails, Transaction}; use async_trait::async_trait; +use ethabi::{Event, Function}; +use std::fmt::Debug; pub use client::LedgerClient; pub use constants::*; pub use quorum::{QuorumConfig, QuorumHandler}; +use crate::types::{EventLog, EventQuery}; #[cfg(test)] use mockall::automock; #[cfg_attr(test, automock)] #[cfg_attr(not(feature = "wasm"), async_trait)] #[cfg_attr(feature = "wasm", async_trait(?Send))] -pub trait Client: Sync + Send { +pub trait Client: Sync + Send + Debug { /// Retrieve count of transaction for the given account /// /// # Params @@ -28,7 +27,7 @@ pub trait Client: Sync + Send { /// /// # Returns /// number of transactions - async fn get_transaction_count(&self, address: &Address) -> VdrResult<[u64; 4]>; + async fn get_transaction_count(&self, address: &Address) -> VdrResult; /// Submit transaction to the ledger /// @@ -49,6 +48,16 @@ pub trait Client: Sync + Send { /// result data of transaction execution async fn call_transaction(&self, to: &str, transaction: &[u8]) -> VdrResult>; + /// Send a prepared query for retrieving log events on the ledger + /// + /// #Params + /// param: client: Ledger - client (Ethereum client - for example web3::Http) + /// param: query: EventQuery - query to send + /// + /// #Returns + /// logs - list of received events + async fn query_events(&self, query: &EventQuery) -> VdrResult>; + /// Get the receipt for the given block hash /// /// # Params @@ -58,11 +67,11 @@ pub trait Client: Sync + Send { /// receipt as JSON string for the requested block async fn get_receipt(&self, hash: &[u8]) -> VdrResult; - /// Check client connection (passed node is alive and return valid ledger data) + /// Get details for the given block /// /// # Returns - /// ledger status - async fn ping(&self) -> VdrResult; + /// Block details + async fn get_block(&self, block: Option) -> VdrResult; /// Get the transaction for the given transaction hash /// @@ -74,30 +83,22 @@ pub trait Client: Sync + Send { async fn get_transaction(&self, hash: &[u8]) -> VdrResult>; } -pub trait Contract: Sync + Send { +pub trait Contract: Sync + Send + Debug { /// Get the address of deployed contract /// /// # Returns /// address of the deployed contract. Should be used to execute contract methods fn address(&self) -> &Address; - /// Encode data required for the execution of a contract method - /// - /// # Params - /// - `method` method to execute - /// - `params` data to pass/encode for contract execution + /// Get the contract function /// /// # Returns - /// encoded data to set into transaction - fn encode_input(&self, method: &str, params: &[ContractParam]) -> VdrResult>; + /// Contract function + fn function(&self, name: &str) -> VdrResult<&Function>; - /// Decode the value (bytes) returned as the result of the execution of a contract method - /// - /// # Params - /// - `method` method to execute - /// - `output` data to decode (returned as result of sending call transaction) + /// Get the contract event /// /// # Returns - /// contract execution result in decoded form - fn decode_output(&self, method: &str, output: &[u8]) -> VdrResult; + /// Contract event + fn event(&self, name: &str) -> VdrResult<&Event>; } diff --git a/vdr/src/client/quorum.rs b/vdr/src/client/quorum.rs index 0f814dfe..c444ca21 100644 --- a/vdr/src/client/quorum.rs +++ b/vdr/src/client/quorum.rs @@ -1,5 +1,3 @@ -use std::{sync::Arc, time::Duration}; - use futures::{ channel::{ mpsc, @@ -7,17 +5,21 @@ use futures::{ }, StreamExt, }; - use log::trace; +use log_derive::{logfn, logfn_inputs}; +use serde_derive::{Deserialize, Serialize}; +use std::{ + fmt::{Debug, Formatter}, + sync::Arc, + time::Duration, +}; use crate::{ client::implementation::web3::client::Web3Client, Client, Transaction, TransactionType, VdrError, VdrResult, }; -use serde_derive::{Deserialize, Serialize}; - -#[derive(Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct QuorumConfig { pub nodes: Vec, pub request_retries: Option, @@ -37,6 +39,8 @@ pub struct QuorumHandler { } impl QuorumHandler { + #[logfn(Info)] + #[logfn_inputs(Debug)] pub fn new(config: QuorumConfig) -> VdrResult { let clients = config .nodes @@ -47,7 +51,7 @@ impl QuorumHandler { }) .collect::, VdrError>>()?; - Ok(QuorumHandler { + let handler = QuorumHandler { clients, request_retries: config.request_retries.unwrap_or(DEFAULT_REQUEST_RETRIES), request_timeout: Duration::from_millis( @@ -56,9 +60,12 @@ impl QuorumHandler { retry_interval: Duration::from_millis( config.retry_interval.unwrap_or(DEFAULT_RETRY_INTERVAL), ), - }) + }; + Ok(handler) } + #[logfn(Info)] + #[logfn_inputs(Debug)] #[allow(clippy::too_many_arguments)] async fn send_transaction_with_retries( mut sender: Sender>, @@ -70,8 +77,6 @@ impl QuorumHandler { request_timeout: Duration, retry_interval: Duration, ) { - trace!("Started eth_call task for transaction: {:?}", data); - for _ in 1..request_retries { match type_ { TransactionType::Write => { @@ -113,10 +118,10 @@ impl QuorumHandler { } }; } - - trace!("Finished eth_call task for transaction: {:?}", data); } + #[logfn(Info)] + #[logfn_inputs(Debug)] async fn wait_for_quorum( &self, mut receiver: Receiver>, @@ -140,13 +145,13 @@ impl QuorumHandler { quorum_reached } + #[logfn(Info)] + #[logfn_inputs(Debug)] pub async fn check( &self, transaction: &Transaction, expected_result: &[u8], ) -> VdrResult { - trace!("Started quorum check for transaction: {:?}", transaction); - let clients_count = self.clients.len(); let (sender, receiver) = mpsc::channel::>(clients_count); @@ -196,10 +201,8 @@ impl QuorumHandler { let quorum_reached = self.wait_for_quorum(receiver, expected_result).await; if quorum_reached { - trace!("Quorum succeed for transaction: {:?}", transaction); Ok(quorum_reached) } else { - trace!("Quorum failed for transaction: {:?}", transaction); Err(VdrError::QuorumNotReached(format!( "Quorum not reached for transaction: {:?}", transaction @@ -208,6 +211,20 @@ impl QuorumHandler { } } +impl Debug for QuorumHandler { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!( + f, + r#"QuorumHandler {{ + request_retries: {}, + request_timeout: {:?}, + retry_interval: {:?} + }}"#, + self.request_retries, self.request_timeout, self.retry_interval + ) + } +} + #[cfg(test)] pub mod test { use super::*; diff --git a/vdr/src/contracts/auth/mod.rs b/vdr/src/contracts/auth/mod.rs index b1893517..7a058f04 100644 --- a/vdr/src/contracts/auth/mod.rs +++ b/vdr/src/contracts/auth/mod.rs @@ -1,5 +1,5 @@ -pub mod role; pub mod role_control; +pub mod types; -pub use role::*; pub use role_control::*; +pub use types::*; diff --git a/vdr/src/contracts/auth/role.rs b/vdr/src/contracts/auth/role.rs deleted file mode 100644 index 554b2bf5..00000000 --- a/vdr/src/contracts/auth/role.rs +++ /dev/null @@ -1,117 +0,0 @@ -use log::trace; - -use crate::{ - error::VdrError, - types::{ContractOutput, ContractParam}, -}; - -#[repr(u8)] -#[derive(Clone, Copy, PartialEq, Debug)] -pub enum Role { - Empty = 0, - Trustee = 1, - Endorser = 2, - Steward = 3, -} - -pub type HasRole = bool; -pub type RoleIndex = u8; - -impl From for ContractParam { - fn from(value: Role) -> Self { - trace!("Role: {:?} convert into ContractParam has started", value); - - let role_index: RoleIndex = value.into(); - let role_contract_param = ContractParam::Uint(role_index.into()); - - trace!( - "Role: {:?} convert into ContractParam has finished. Result: {:?}", - value, - role_contract_param - ); - - role_contract_param - } -} - -impl TryFrom for Role { - type Error = VdrError; - - fn try_from(value: ContractOutput) -> Result { - trace!("Role convert from ContractOutput: {:?} has started", value); - - let role_index = value.get_u8(0)?; - let role = Role::try_from(role_index)?; - - trace!( - "Role convert from ContractOutput: {:?} has finished. Result: {:?}", - value, - role - ); - - Ok(role) - } -} - -impl From for RoleIndex { - fn from(value: Role) -> Self { - trace!("Role: {:?} convert into RoleIndex has started", value); - - let role_index = value as u8; - - trace!( - "Role: {:?} convert into RoleIndex has finished. Result: {}", - value, - role_index - ); - - role_index - } -} - -impl TryFrom for Role { - type Error = VdrError; - - fn try_from(index: RoleIndex) -> Result { - trace!("Role convert from RoleIndex: {} has started", index); - - let result = match index { - 0 => Ok(Role::Empty), - 1 => Ok(Role::Trustee), - 2 => Ok(Role::Endorser), - 3 => Ok(Role::Steward), - _ => Err(VdrError::ContractInvalidResponseData( - "Invalid role provided".to_string(), - )), - }; - - trace!( - "Role convert from RoleIndex: {} has finished. Result: {:?}", - index, - result - ); - - result - } -} - -impl TryFrom for HasRole { - type Error = VdrError; - - fn try_from(value: ContractOutput) -> Result { - trace!( - "HasRole convert from ContractOutput: {:?} has started", - value - ); - - let has_role = value.get_bool(0)?; - - trace!( - "HasRole convert from ContractOutput: {:?} has finished. Result: {}", - value, - has_role - ); - - Ok(has_role) - } -} diff --git a/vdr/src/contracts/auth/role_control.rs b/vdr/src/contracts/auth/role_control.rs index 3ab00972..4987e877 100644 --- a/vdr/src/contracts/auth/role_control.rs +++ b/vdr/src/contracts/auth/role_control.rs @@ -4,7 +4,7 @@ use crate::{ error::VdrResult, types::{Address, Transaction, TransactionBuilder, TransactionParser, TransactionType}, }; -use log::{debug, info}; +use log_derive::{logfn, logfn_inputs}; const CONTRACT_NAME: &str = "RoleControl"; const METHOD_ASSIGN_ROLE: &str = "assignRole"; @@ -22,33 +22,23 @@ const METHOD_GET_ROLE: &str = "getRole"; /// /// # Returns /// Write transaction to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] pub async fn build_assign_role_transaction( client: &LedgerClient, from: &Address, role: &Role, account: &Address, ) -> VdrResult { - debug!( - "{} txn build has started. Sender: {:?}, assignee: {:?}, role: {:?}", - METHOD_ASSIGN_ROLE, from, account, role - ); - - let transaction = TransactionBuilder::new() + TransactionBuilder::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_ASSIGN_ROLE) - .add_param((*role).into()) - .add_param(account.try_into()?) + .add_param(role)? + .add_param(account)? .set_type(TransactionType::Write) .set_from(from) .build(client) - .await?; - - info!( - "{} txn build has finished. Result: {:?}", - METHOD_ASSIGN_ROLE, transaction - ); - - Ok(transaction) + .await } /// Build transaction to execute RoleControl.revokeRole contract method to revoke a role from an account @@ -61,33 +51,23 @@ pub async fn build_assign_role_transaction( /// /// # Returns /// Write transaction to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] pub async fn build_revoke_role_transaction( client: &LedgerClient, from: &Address, role: &Role, account: &Address, ) -> VdrResult { - debug!( - "{} txn build has started. Sender: {:?}, revokee: {:?}, role: {:?}", - METHOD_REVOKE_ROLE, from, account, role - ); - - let transaction = TransactionBuilder::new() + TransactionBuilder::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_REVOKE_ROLE) - .add_param((*role).into()) - .add_param(account.try_into()?) + .add_param(role)? + .add_param(account)? .set_type(TransactionType::Write) .set_from(from) .build(client) - .await?; - - info!( - "{} txn build has finished. Result: {:?}", - METHOD_REVOKE_ROLE, transaction - ); - - Ok(transaction) + .await } /// Build transaction to execute RoleControl.hasRole contract method to check an account has a role @@ -99,31 +79,21 @@ pub async fn build_revoke_role_transaction( /// /// # Returns /// Read transaction to submit +#[logfn(Info)] +#[logfn_inputs(Debug)] pub async fn build_has_role_transaction( client: &LedgerClient, role: &Role, account: &Address, ) -> VdrResult { - debug!( - "{} txn build has started. Account to check: {:?}, role: {:?}", - METHOD_HAS_ROLE, account, role - ); - - let transaction = TransactionBuilder::new() + TransactionBuilder::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_HAS_ROLE) - .add_param((*role).into()) - .add_param(account.try_into()?) + .add_param(role)? + .add_param(account)? .set_type(TransactionType::Read) .build(client) - .await?; - - info!( - "{} txn build has finished. Result {:?}", - METHOD_HAS_ROLE, transaction - ); - - Ok(transaction) + .await } /// Build transaction to execute RoleControl.getRole contract method to get account's role @@ -134,29 +104,19 @@ pub async fn build_has_role_transaction( /// /// # Returns /// Read transaction to submit +#[logfn(Info)] +#[logfn_inputs(Debug)] pub async fn build_get_role_transaction( client: &LedgerClient, account: &Address, ) -> VdrResult { - debug!( - "{} txn build has started. Account to get: {:?}", - METHOD_GET_ROLE, account, - ); - - let transaction = TransactionBuilder::new() + TransactionBuilder::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_GET_ROLE) - .add_param(account.try_into()?) + .add_param(account)? .set_type(TransactionType::Read) .build(client) - .await?; - - info!( - "{} txn build has finished. Result: {:?}", - METHOD_GET_ROLE, transaction - ); - - Ok(transaction) + .await } /// Parse the result of execution RoleControl.HasRole contract method to check an account has a role @@ -167,23 +127,13 @@ pub async fn build_get_role_transaction( /// /// # Returns /// Account has role result +#[logfn(Info)] +#[logfn_inputs(Debug)] pub fn parse_has_role_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult { - debug!( - "{} result parse has started. Bytes to parse: {:?}", - METHOD_HAS_ROLE, bytes - ); - - let has_result = TransactionParser::new() + TransactionParser::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_HAS_ROLE) - .parse::(client, bytes)?; - - info!( - "{} result parse has finished. Result: {:?}", - METHOD_HAS_ROLE, has_result - ); - - Ok(has_result) + .parse::(client, bytes) } /// Parse the result of execution RoleControl.GetRole contract method to get account's role @@ -194,23 +144,13 @@ pub fn parse_has_role_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult VdrResult { - debug!( - "{} result parse has started. Bytes to parse: {:?}", - METHOD_GET_ROLE, bytes - ); - - let role = TransactionParser::new() + TransactionParser::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_GET_ROLE) - .parse::(client, bytes)?; - - info!( - "{} result parse has finished. Result: {:?}", - METHOD_GET_ROLE, role - ); - - Ok(role) + .parse::(client, bytes) } #[cfg(test)] diff --git a/vdr/src/contracts/auth/types/mod.rs b/vdr/src/contracts/auth/types/mod.rs new file mode 100644 index 00000000..246380d9 --- /dev/null +++ b/vdr/src/contracts/auth/types/mod.rs @@ -0,0 +1,3 @@ +pub mod role; + +pub use role::*; diff --git a/vdr/src/contracts/auth/types/role.rs b/vdr/src/contracts/auth/types/role.rs new file mode 100644 index 00000000..8d8fa321 --- /dev/null +++ b/vdr/src/contracts/auth/types/role.rs @@ -0,0 +1,64 @@ +use crate::{ + error::VdrError, + types::{ContractOutput, ContractParam}, +}; + +#[repr(u8)] +#[derive(Clone, Copy, PartialEq, Debug)] +pub enum Role { + Empty = 0, + Trustee = 1, + Endorser = 2, + Steward = 3, +} + +pub type HasRole = bool; +pub type RoleIndex = u8; + +impl TryFrom<&Role> for ContractParam { + type Error = VdrError; + + fn try_from(value: &Role) -> Result { + let role_index: RoleIndex = (*value).into(); + Ok(ContractParam::Uint(role_index.into())) + } +} + +impl TryFrom for Role { + type Error = VdrError; + + fn try_from(value: ContractOutput) -> Result { + let role_index = value.get_u8(0)?; + Role::try_from(role_index) + } +} + +impl From for RoleIndex { + fn from(value: Role) -> Self { + value as u8 + } +} + +impl TryFrom for Role { + type Error = VdrError; + + fn try_from(index: RoleIndex) -> Result { + match index { + 0 => Ok(Role::Empty), + 1 => Ok(Role::Trustee), + 2 => Ok(Role::Endorser), + 3 => Ok(Role::Steward), + _ => Err(VdrError::ContractInvalidResponseData( + "Invalid role provided".to_string(), + )), + } + } +} + +impl TryFrom for HasRole { + type Error = VdrError; + + fn try_from(value: ContractOutput) -> Result { + value.get_bool(0) + } +} diff --git a/vdr/src/contracts/cl/credential_definition_registry.rs b/vdr/src/contracts/cl/credential_definition_registry.rs index 02b4d03d..f624c169 100644 --- a/vdr/src/contracts/cl/credential_definition_registry.rs +++ b/vdr/src/contracts/cl/credential_definition_registry.rs @@ -1,18 +1,24 @@ -use log::{debug, info}; +use log_derive::{logfn, logfn_inputs}; use crate::{ client::LedgerClient, contracts::cl::types::{ - credential_definition::{CredentialDefinition, CredentialDefinitionRecord}, + credential_definition::{CredentialDefinition, CredentialDefinitionCreatedEvent}, credential_definition_id::CredentialDefinitionId, }, error::VdrResult, - types::{Address, Transaction, TransactionBuilder, TransactionParser, TransactionType}, + types::{ + Address, EventParser, EventQueryBuilder, MethodParam, Transaction, TransactionBuilder, + TransactionEndorsingDataBuilder, TransactionParser, TransactionType, + }, + Block, EventLog, EventQuery, SignatureData, TransactionEndorsingData, VdrError, }; const CONTRACT_NAME: &str = "CredentialDefinitionRegistry"; const METHOD_CREATE_CREDENTIAL_DEFINITION: &str = "createCredentialDefinition"; -const METHOD_RESOLVE_CREDENTIAL_DEFINITION: &str = "resolveCredentialDefinition"; +const METHOD_CREATE_CREDENTIAL_DEFINITION_SIGNED: &str = "createCredentialDefinitionSigned"; +const METHOD_CREDENTIAL_DEFINITION_CREATED: &str = "created"; +const EVENT_CREDENTIAL_DEFINITION_CREATED: &str = "CredentialDefinitionCreated"; /// Build transaction to execute CredentialDefinitionRegistry.createCredentialDefinition contract /// method to create a new Credential Definition @@ -25,107 +31,224 @@ const METHOD_RESOLVE_CREDENTIAL_DEFINITION: &str = "resolveCredentialDefinition" /// /// # Returns /// Write transaction to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] pub async fn build_create_credential_definition_transaction( client: &LedgerClient, from: &Address, id: &CredentialDefinitionId, credential_definition: &CredentialDefinition, ) -> VdrResult { - debug!( - "{} txn build has started. Sender: {:?}, CredentialDefinition: {:?}", - METHOD_CREATE_CREDENTIAL_DEFINITION, from, credential_definition - ); - // TODO: validate credential definition - - let transaction = TransactionBuilder::new() + let identity = Address::try_from(&credential_definition.issuer_id)?; + TransactionBuilder::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_CREATE_CREDENTIAL_DEFINITION) - .add_param(id.into()) - .add_param((&credential_definition.issuer_id).into()) - .add_param((&credential_definition.schema_id).into()) - .add_param(credential_definition.into()) + .add_param(&identity)? + .add_param(id)? + .add_param(&credential_definition.schema_id)? + .add_param(credential_definition)? .set_type(TransactionType::Write) .set_from(from) .build(client) - .await?; - - info!( - "{} txn build has finished. Result: {:?}", - METHOD_CREATE_CREDENTIAL_DEFINITION, transaction - ); + .await +} - Ok(transaction) +/// Prepared data for endorsing CredentialDefinitionRegistry.createCredentialDefinition contract method +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `id` id of credential definition to be created +/// - `credential_definition` Credential Definition object matching to the specification - https://hyperledger.github.io/anoncreds-spec/#term:credential-definition +/// +/// #Returns +/// data: TransactionEndorsingData - transaction endorsement data to sign +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_create_credential_definition_endorsing_data( + client: &LedgerClient, + id: &CredentialDefinitionId, + credential_definition: &CredentialDefinition, +) -> VdrResult { + let identity = Address::try_from(&credential_definition.issuer_id)?; + TransactionEndorsingDataBuilder::new() + .set_contract(CONTRACT_NAME) + .set_identity(&identity) + .add_param(&identity)? + .add_param(MethodParam::from(METHOD_CREATE_CREDENTIAL_DEFINITION))? + .add_param(id)? + .add_param(&credential_definition.schema_id)? + .add_param(credential_definition)? + .build(client) + .await } -/// Build transaction to execute CredentialDefinitionRegistry.resolveCredentialDefinition contract -/// method to retrieve an existing Credential Definition by the given id +/// Build transaction to execute CredentialDefinitionRegistry.createCredentialDefinitionSigned contract method to +/// endorse a new Credential Definition +/// Endorsing version of the method - sender is not identity owner /// -/// # Params -/// - `client` client connected to the network where contract will be executed -/// - `id` id of Credential Definition to resolve +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `id` id of credential definition to be created +/// - `credential_definition` Credential Definition object matching to the specification - https://hyperledger.github.io/anoncreds-spec/#term:credential-definition +/// - `signature` signature of schema issuer /// -/// # Returns -/// Read transaction to submit -pub async fn build_resolve_credential_definition_transaction( +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_create_credential_definition_signed_transaction( client: &LedgerClient, + from: &Address, id: &CredentialDefinitionId, + credential_definition: &CredentialDefinition, + signature: &SignatureData, ) -> VdrResult { - debug!( - "{} txn build has started. CredentialDefinitionId: {:?}", - METHOD_RESOLVE_CREDENTIAL_DEFINITION, id - ); - // TODO: validate credential definition + let identity = Address::try_from(&credential_definition.issuer_id)?; + TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_CREATE_CREDENTIAL_DEFINITION_SIGNED) + .add_param(&identity)? + .add_param(signature.v())? + .add_param(signature.r())? + .add_param(signature.s())? + .add_param(id)? + .add_param(&credential_definition.schema_id)? + .add_param(credential_definition)? + .set_type(TransactionType::Write) + .set_from(from) + .build(client) + .await +} - let transaction = TransactionBuilder::new() +/// Build transaction to execute CredentialDefinitionRegistry.credDefs contract method to get +/// block number when a Credential Definition was created +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `id` identifier of target credential definition +/// +/// #Returns +/// transaction: Transaction - prepared read transaction object to submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_get_credential_definition_created_transaction( + client: &LedgerClient, + id: &CredentialDefinitionId, +) -> VdrResult { + TransactionBuilder::new() .set_contract(CONTRACT_NAME) - .set_method(METHOD_RESOLVE_CREDENTIAL_DEFINITION) - .add_param(id.into()) + .set_method(METHOD_CREDENTIAL_DEFINITION_CREATED) + .add_param(id)? .set_type(TransactionType::Read) .build(client) - .await?; - - info!( - "{} txn build has finished. Result: {:?}", - METHOD_RESOLVE_CREDENTIAL_DEFINITION, transaction - ); + .await +} - Ok(transaction) +/// Build event query to get CredentialDefinitionRegistry.CredentialDefinitionCreated event from the ledger +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `id` identifier of target credential definition +/// - `from_block` start block +/// - `to_block` finish block +/// +/// #Returns +/// query: EventQuery - prepared event query to send +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_get_credential_definition_query( + client: &LedgerClient, + id: &CredentialDefinitionId, + from_block: Option<&Block>, + to_block: Option<&Block>, +) -> VdrResult { + EventQueryBuilder::new() + .set_contract(CONTRACT_NAME) + .set_from_block(from_block.cloned()) + .set_to_block(to_block.cloned()) + .set_event_filer(id.to_filter()) + .build(client) } -/// Parse the result of execution CredentialDefinitionRegistry.resolveCredentialDefinition contract -/// method to receive a Credential Definition associated with the id +/// Parse the result of execution CredentialDefinitionRegistry.credDefs contract method to receive +/// block number when a credential definition was created /// /// # Params /// - `client` client connected to the network where contract will be executed /// - `bytes` result bytes returned from the ledger /// /// # Returns -/// parsed Credential Definition -pub fn parse_resolve_credential_definition_result( +/// Block when the credential definition was created +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub fn parse_credential_definition_created_result( client: &LedgerClient, bytes: &[u8], -) -> VdrResult { - debug!( - "{} result parse has started. Bytes to parse: {:?}", - METHOD_RESOLVE_CREDENTIAL_DEFINITION, bytes - ); +) -> VdrResult { + TransactionParser::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_CREDENTIAL_DEFINITION_CREATED) + .parse::(client, bytes) +} - let credential_definition = TransactionParser::new() +/// Parse CredentialDefinitionRegistry.CredentialDefinitionCreated from the event log. +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Parsed Credential Definition event object +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub fn parse_credential_definition_created_event( + client: &LedgerClient, + log: &EventLog, +) -> VdrResult { + // TODO: validate schema + EventParser::new() .set_contract(CONTRACT_NAME) - .set_method(METHOD_RESOLVE_CREDENTIAL_DEFINITION) - .parse::(client, bytes)? - .credential_definition; + .set_event(EVENT_CREDENTIAL_DEFINITION_CREATED) + .parse(client, log) +} - // TODO: validate credential definition +/// Single step function to resolve a Credential Definition for the given ID +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `id` id of schema to resolve +/// +/// # Returns +/// Resolved Credential Definition object +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn resolve_credential_definition( + client: &LedgerClient, + id: &CredentialDefinitionId, +) -> VdrResult { + let transaction = build_get_credential_definition_created_transaction(client, id).await?; + let response = client.submit_transaction(&transaction).await?; + let created_block = parse_credential_definition_created_result(client, &response)?; - info!( - "{} result parse has finished. Result: {:?}", - METHOD_RESOLVE_CREDENTIAL_DEFINITION, credential_definition - ); + let schema_query = build_get_credential_definition_query( + client, + id, + Some(&created_block), + Some(&created_block), + ) + .await?; + let events = client.query_events(&schema_query).await?; - Ok(credential_definition) + if events.len() != 1 { + return Err(VdrError::ClientInvalidResponse( + format!("Unable to resolve schema: Unexpected amout of schema created events received for id: {:?}", id) + )); + } + + let cred_def = parse_credential_definition_created_event(client, &events[0])?.cred_def; + Ok(cred_def) } #[cfg(test)] @@ -174,50 +297,32 @@ pub mod test { nonce: Some(DEFAULT_NONCE.clone()), chain_id: CHAIN_ID, data: vec![ - 76, 197, 98, 212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 160, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 151, 100, 105, 100, 58, 105, 110, 100, 121, 50, 58, - 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, 107, 103, - 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 47, 97, 110, 111, - 110, 99, 114, 101, 100, 115, 47, 118, 48, 47, 67, 76, 65, 73, 77, 95, 68, 69, - 70, 47, 100, 105, 100, 58, 105, 110, 100, 121, 50, 58, 116, 101, 115, 116, 110, - 101, 116, 58, 51, 76, 112, 106, 115, 122, 107, 103, 84, 109, 69, 51, 113, 84, - 104, 103, 101, 50, 53, 70, 90, 119, 47, 97, 110, 111, 110, 99, 114, 101, 100, - 115, 47, 118, 48, 47, 83, 67, 72, 69, 77, 65, 47, 70, 49, 68, 67, 108, 97, 70, - 69, 122, 105, 51, 116, 47, 49, 46, 48, 46, 48, 47, 100, 101, 102, 97, 117, 108, - 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 100, 105, 100, 58, 105, 110, - 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, - 122, 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 0, + 187, 199, 66, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 226, 219, 108, 141, + 198, 198, 129, 187, 93, 106, 209, 33, 161, 7, 243, 0, 233, 178, 181, 109, 71, + 26, 149, 232, 163, 135, 235, 109, 104, 137, 85, 62, 141, 209, 156, 9, 33, 105, + 94, 200, 254, 71, 119, 190, 195, 248, 17, 17, 141, 239, 177, 34, 27, 23, 130, + 143, 227, 3, 94, 147, 14, 185, 63, 10, 50, 145, 115, 71, 104, 106, 145, 232, + 190, 123, 84, 240, 64, 217, 94, 167, 52, 119, 152, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 79, 100, 105, 100, 58, 105, 110, 100, 121, 50, 58, 116, 101, 115, 116, - 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, 107, 103, 84, 109, 69, 51, 113, - 84, 104, 103, 101, 50, 53, 70, 90, 119, 47, 97, 110, 111, 110, 99, 114, 101, - 100, 115, 47, 118, 48, 47, 83, 67, 72, 69, 77, 65, 47, 70, 49, 68, 67, 108, 97, - 70, 69, 122, 105, 51, 116, 47, 49, 46, 48, 46, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 123, 34, 99, 114, 101, 100, 68, 101, - 102, 84, 121, 112, 101, 34, 58, 34, 67, 76, 34, 44, 34, 105, 115, 115, 117, - 101, 114, 73, 100, 34, 58, 34, 100, 105, 100, 58, 105, 110, 100, 121, 50, 58, - 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, 107, 103, - 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 34, 44, 34, 115, - 99, 104, 101, 109, 97, 73, 100, 34, 58, 34, 100, 105, 100, 58, 105, 110, 100, - 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, - 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 47, 97, - 110, 111, 110, 99, 114, 101, 100, 115, 47, 118, 48, 47, 83, 67, 72, 69, 77, 65, - 47, 70, 49, 68, 67, 108, 97, 70, 69, 122, 105, 51, 116, 47, 49, 46, 48, 46, 48, - 34, 44, 34, 116, 97, 103, 34, 58, 34, 100, 101, 102, 97, 117, 108, 116, 34, 44, - 34, 118, 97, 108, 117, 101, 34, 58, 123, 34, 110, 34, 58, 34, 55, 55, 57, 46, - 46, 46, 51, 57, 55, 34, 44, 34, 114, 99, 116, 120, 116, 34, 58, 34, 55, 55, 52, - 46, 46, 46, 57, 55, 55, 34, 44, 34, 115, 34, 58, 34, 55, 53, 48, 46, 46, 56, - 57, 51, 34, 44, 34, 122, 34, 58, 34, 54, 51, 50, 46, 46, 46, 48, 48, 53, 34, - 125, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, + 0, 1, 42, 123, 34, 105, 115, 115, 117, 101, 114, 73, 100, 34, 58, 34, 100, 105, + 100, 58, 101, 116, 104, 114, 58, 116, 101, 115, 116, 110, 101, 116, 58, 48, + 120, 102, 48, 101, 50, 100, 98, 54, 99, 56, 100, 99, 54, 99, 54, 56, 49, 98, + 98, 53, 100, 54, 97, 100, 49, 50, 49, 97, 49, 48, 55, 102, 51, 48, 48, 101, 57, + 98, 50, 98, 53, 34, 44, 34, 115, 99, 104, 101, 109, 97, 73, 100, 34, 58, 34, + 100, 105, 100, 58, 101, 116, 104, 114, 58, 116, 101, 115, 116, 110, 101, 116, + 58, 48, 120, 102, 48, 101, 50, 100, 98, 54, 99, 56, 100, 99, 54, 99, 54, 56, + 49, 98, 98, 53, 100, 54, 97, 100, 49, 50, 49, 97, 49, 48, 55, 102, 51, 48, 48, + 101, 57, 98, 50, 98, 53, 47, 97, 110, 111, 110, 99, 114, 101, 100, 115, 47, + 118, 48, 47, 83, 67, 72, 69, 77, 65, 47, 70, 49, 68, 67, 108, 97, 70, 69, 122, + 105, 51, 116, 47, 49, 46, 48, 46, 48, 34, 44, 34, 99, 114, 101, 100, 68, 101, + 102, 84, 121, 112, 101, 34, 58, 34, 67, 76, 34, 44, 34, 116, 97, 103, 34, 58, + 34, 100, 101, 102, 97, 117, 108, 116, 34, 44, 34, 118, 97, 108, 117, 101, 34, + 58, 123, 34, 110, 34, 58, 34, 55, 55, 57, 46, 46, 46, 51, 57, 55, 34, 44, 34, + 114, 99, 116, 120, 116, 34, 58, 34, 55, 55, 52, 46, 46, 46, 57, 55, 55, 34, 44, + 34, 115, 34, 58, 34, 55, 53, 48, 46, 46, 56, 57, 51, 34, 44, 34, 122, 34, 58, + 34, 54, 51, 50, 46, 46, 46, 48, 48, 53, 34, 125, 125, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], signature: RwLock::new(None), hash: None, @@ -230,7 +335,7 @@ pub mod test { use super::*; #[async_std::test] - async fn build_resolve_credential_definition_transaction_test() { + async fn build_get_credential_definition_query_test() { init_env_logger(); let client = mock_client(); let (id, _) = credential_definition( @@ -238,73 +343,59 @@ pub mod test { &SchemaId::from(SCHEMA_ID), Some(CREDENTIAL_DEFINITION_TAG), ); - let transaction = build_resolve_credential_definition_transaction(&client, &id) + let query = build_get_credential_definition_query(&client, &id, None, None) .await .unwrap(); - let expected_transaction = Transaction { - type_: TransactionType::Read, - from: None, - to: CRED_DEF_REGISTRY_ADDRESS.clone(), - nonce: None, - chain_id: CHAIN_ID, - data: vec![ - 97, 112, 196, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 151, 100, 105, 100, 58, 105, - 110, 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, - 115, 122, 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, - 119, 47, 97, 110, 111, 110, 99, 114, 101, 100, 115, 47, 118, 48, 47, 67, 76, - 65, 73, 77, 95, 68, 69, 70, 47, 100, 105, 100, 58, 105, 110, 100, 121, 50, 58, - 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, 107, 103, - 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 47, 97, 110, 111, - 110, 99, 114, 101, 100, 115, 47, 118, 48, 47, 83, 67, 72, 69, 77, 65, 47, 70, - 49, 68, 67, 108, 97, 70, 69, 122, 105, 51, 116, 47, 49, 46, 48, 46, 48, 47, - 100, 101, 102, 97, 117, 108, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, - ], - signature: RwLock::new(None), - hash: None, + let expected_query = EventQuery { + address: CRED_DEF_REGISTRY_ADDRESS.clone(), + from_block: None, + to_block: None, + event_signature: None, + event_filter: Some( + "6d471a95e8a387eb6d6889553e8dd19c0921695ec8fe4777bec3f811118defb1".to_string(), + ), }; - assert_eq!(expected_transaction, transaction); + assert_eq!(expected_query, query); } } - mod parse_resolve_credential_definition_result { - use super::*; - - #[test] - fn parse_resolve_credential_definition_result_test() { - init_env_logger(); - let client = mock_client(); - let data = vec![ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 166, 63, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 123, 34, 99, 114, - 101, 100, 68, 101, 102, 84, 121, 112, 101, 34, 58, 34, 67, 76, 34, 44, 34, 105, - 115, 115, 117, 101, 114, 73, 100, 34, 58, 34, 100, 105, 100, 58, 105, 110, 100, - 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, - 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 34, 44, 34, - 115, 99, 104, 101, 109, 97, 73, 100, 34, 58, 34, 100, 105, 100, 58, 105, 110, 100, - 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, - 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 47, 97, - 110, 111, 110, 99, 114, 101, 100, 115, 47, 118, 48, 47, 83, 67, 72, 69, 77, 65, 47, - 70, 49, 68, 67, 108, 97, 70, 69, 122, 105, 51, 116, 47, 49, 46, 48, 46, 48, 34, 44, - 34, 116, 97, 103, 34, 58, 34, 100, 101, 102, 97, 117, 108, 116, 34, 44, 34, 118, - 97, 108, 117, 101, 34, 58, 123, 34, 110, 34, 58, 34, 55, 55, 57, 46, 46, 46, 51, - 57, 55, 34, 44, 34, 114, 99, 116, 120, 116, 34, 58, 34, 55, 55, 52, 46, 46, 46, 57, - 55, 55, 34, 44, 34, 115, 34, 58, 34, 55, 53, 48, 46, 46, 56, 57, 51, 34, 44, 34, - 122, 34, 58, 34, 54, 51, 50, 46, 46, 46, 48, 48, 53, 34, 125, 125, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - ]; - let parsed_cred_def = - parse_resolve_credential_definition_result(&client, &data).unwrap(); - let (_, expected_cred_def) = credential_definition( - &DID::from(ISSUER_ID), - &SchemaId::from(SCHEMA_ID), - Some(CREDENTIAL_DEFINITION_TAG), - ); - assert_eq!(expected_cred_def, parsed_cred_def); - } - } + // mod parse_resolve_credential_definition_result { + // use super::*; + // + // #[test] + // fn parse_resolve_credential_definition_result_test() { + // init_env_logger(); + // let client = mock_client(); + // let data = vec![ + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 166, 63, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 123, 34, 99, 114, + // 101, 100, 68, 101, 102, 84, 121, 112, 101, 34, 58, 34, 67, 76, 34, 44, 34, 105, + // 115, 115, 117, 101, 114, 73, 100, 34, 58, 34, 100, 105, 100, 58, 105, 110, 100, + // 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, + // 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 34, 44, 34, + // 115, 99, 104, 101, 109, 97, 73, 100, 34, 58, 34, 100, 105, 100, 58, 105, 110, 100, + // 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, + // 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 47, 97, + // 110, 111, 110, 99, 114, 101, 100, 115, 47, 118, 48, 47, 83, 67, 72, 69, 77, 65, 47, + // 70, 49, 68, 67, 108, 97, 70, 69, 122, 105, 51, 116, 47, 49, 46, 48, 46, 48, 34, 44, + // 34, 116, 97, 103, 34, 58, 34, 100, 101, 102, 97, 117, 108, 116, 34, 44, 34, 118, + // 97, 108, 117, 101, 34, 58, 123, 34, 110, 34, 58, 34, 55, 55, 57, 46, 46, 46, 51, + // 57, 55, 34, 44, 34, 114, 99, 116, 120, 116, 34, 58, 34, 55, 55, 52, 46, 46, 46, 57, + // 55, 55, 34, 44, 34, 115, 34, 58, 34, 55, 53, 48, 46, 46, 56, 57, 51, 34, 44, 34, + // 122, 34, 58, 34, 54, 51, 50, 46, 46, 46, 48, 48, 53, 34, 125, 125, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // ]; + // let parsed_cred_def = + // parse_resolve_credential_definition_result(&client, &data).unwrap(); + // let (_, expected_cred_def) = credential_definition( + // &DID::from(ISSUER_ID), + // &SchemaId::from(SCHEMA_ID), + // Some(CREDENTIAL_DEFINITION_TAG), + // ); + // assert_eq!(expected_cred_def, parsed_cred_def); + // } + // } } diff --git a/vdr/src/contracts/cl/mod.rs b/vdr/src/contracts/cl/mod.rs index cedf4949..c7603490 100644 --- a/vdr/src/contracts/cl/mod.rs +++ b/vdr/src/contracts/cl/mod.rs @@ -2,8 +2,12 @@ pub mod credential_definition_registry; pub mod schema_registry; pub mod types; -pub use types::{schema::Schema, schema_id::SchemaId}; +pub use types::{ + schema::{Schema, SchemaCreatedEvent}, + schema_id::SchemaId, +}; pub use types::{ - credential_definition::CredentialDefinition, credential_definition_id::CredentialDefinitionId, + credential_definition::{CredentialDefinition, CredentialDefinitionCreatedEvent}, + credential_definition_id::CredentialDefinitionId, }; diff --git a/vdr/src/contracts/cl/schema_registry.rs b/vdr/src/contracts/cl/schema_registry.rs index a6fc2094..4c2502c1 100644 --- a/vdr/src/contracts/cl/schema_registry.rs +++ b/vdr/src/contracts/cl/schema_registry.rs @@ -1,18 +1,24 @@ -use log::{debug, info}; +use log_derive::{logfn, logfn_inputs}; use crate::{ client::LedgerClient, contracts::cl::types::{ - schema::{Schema, SchemaRecord}, + schema::{Schema, SchemaCreatedEvent}, schema_id::SchemaId, }, error::VdrResult, - types::{Address, Transaction, TransactionBuilder, TransactionParser, TransactionType}, + types::{ + Address, EventParser, EventQueryBuilder, MethodParam, Transaction, TransactionBuilder, + TransactionEndorsingDataBuilder, TransactionParser, TransactionType, + }, + Block, EventLog, EventQuery, SignatureData, TransactionEndorsingData, VdrError, }; const CONTRACT_NAME: &str = "SchemaRegistry"; const METHOD_CREATE_SCHEMA: &str = "createSchema"; -const METHOD_RESOLVE_SCHEMA: &str = "resolveSchema"; +const METHOD_CREATE_SCHEMA_SIGNED: &str = "createSchemaSigned"; +const METHOD_SCHEMA_CREATED: &str = "created"; +const EVENT_SCHEMA_CREATED: &str = "SchemaCreated"; /// Build transaction to execute SchemaRegistry.createSchema contract method to create a new Schema /// @@ -24,98 +30,216 @@ const METHOD_RESOLVE_SCHEMA: &str = "resolveSchema"; /// /// # Returns /// Write transaction to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] pub async fn build_create_schema_transaction( client: &LedgerClient, from: &Address, id: &SchemaId, schema: &Schema, ) -> VdrResult { - debug!( - "{} txn build has started. Sender: {:?}, schema: {:?}", - METHOD_CREATE_SCHEMA, from, schema - ); - // TODO: validate schema - - let transaction = TransactionBuilder::new() + let identity = Address::try_from(&schema.issuer_id)?; + TransactionBuilder::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_CREATE_SCHEMA) - .add_param(id.into()) - .add_param((&schema.issuer_id).into()) - .add_param(schema.into()) + .add_param(&identity)? + .add_param(id)? + .add_param(schema)? .set_type(TransactionType::Write) .set_from(from) .build(client) - .await?; - - info!( - "{} txn build has finished. Result: {:?}", - METHOD_CREATE_SCHEMA, transaction - ); + .await +} - Ok(transaction) +/// Prepared data for execution of SchemaRegistry.createSchema contract method to endorse a new Schema +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `id` id of schema to be created +/// - `schema` Schema object matching to the specification - https://hyperledger.github.io/anoncreds-spec/#term:schema +/// +/// #Returns +/// data: TransactionEndorsingData - transaction endorsement data to sign +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_create_schema_endorsing_data( + client: &LedgerClient, + id: &SchemaId, + schema: &Schema, +) -> VdrResult { + let identity = Address::try_from(&schema.issuer_id)?; + TransactionEndorsingDataBuilder::new() + .set_contract(CONTRACT_NAME) + .set_identity(&identity) + .add_param(&identity)? + .add_param(MethodParam::from(METHOD_CREATE_SCHEMA))? + .add_param(id)? + .add_param(schema)? + .build(client) + .await } -/// Build transaction to execute SchemaRegistry.resolveSchema contract method to retrieve an existing Schema by the given id +/// Build transaction to execute SchemaRegistry.createSchemaSigned contract method to +/// endorse a new Schema +/// Endorsing version of the method - sender is not identity owner /// -/// # Params -/// - `client` client connected to the network where contract will be executed -/// - `id` id of Schema to resolve +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `id` id of schema to be created +/// - `schema` Schema object matching to the specification - https://hyperledger.github.io/anoncreds-spec/#term:schema +/// - `signature` signature of schema issuer /// -/// # Returns -/// Read transaction to submit -pub async fn build_resolve_schema_transaction( +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_create_schema_signed_transaction( client: &LedgerClient, + sender: &Address, id: &SchemaId, + schema: &Schema, + signature: &SignatureData, ) -> VdrResult { - debug!( - "{} txn build has started. Schema ID: {:?}", - METHOD_RESOLVE_SCHEMA, id - ); + let identity = Address::try_from(&schema.issuer_id)?; + TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_CREATE_SCHEMA_SIGNED) + .add_param(&identity)? + .add_param(signature.v())? + .add_param(signature.r())? + .add_param(signature.s())? + .add_param(id)? + .add_param(schema)? + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await +} - let transaction = TransactionBuilder::new() +/// Build transaction to execute SchemaRegistry.schemasCreated contract method to get +/// block number when Schema was created +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `id` identifier of target schema +/// +/// #Returns +/// transaction: Transaction - prepared read transaction object to submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_get_schema_created_transaction( + client: &LedgerClient, + id: &SchemaId, +) -> VdrResult { + TransactionBuilder::new() .set_contract(CONTRACT_NAME) - .set_method(METHOD_RESOLVE_SCHEMA) - .add_param(id.into()) + .set_method(METHOD_SCHEMA_CREATED) + .add_param(id)? .set_type(TransactionType::Read) .build(client) - .await?; - - info!( - "{} txn build has finished. Result: {:?}", - METHOD_RESOLVE_SCHEMA, transaction - ); + .await +} - Ok(transaction) +/// Build event query to get SchemaRegistry.SchemaCreated event from the ledger +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `id` identifier of target schema +/// - `from_block` start block +/// - `to_block` finish block +/// +/// #Returns +/// query: EventQuery - prepared event query to send +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_get_schema_query( + client: &LedgerClient, + id: &SchemaId, + from_block: Option<&Block>, + to_block: Option<&Block>, +) -> VdrResult { + EventQueryBuilder::new() + .set_contract(CONTRACT_NAME) + .set_from_block(from_block.cloned()) + .set_to_block(to_block.cloned()) + .set_event_filer(id.to_filter()) + .build(client) } -/// Parse the result of execution SchemaRegistry.resolveSchema contract method to receive a Schema associated with the id +/// Parse the result of execution SchemaRegistry.schemas contract method to receive +/// block number when a schema was created /// /// # Params /// - `client` client connected to the network where contract will be executed /// - `bytes` result bytes returned from the ledger /// /// # Returns -/// parsed Schema -pub fn parse_resolve_schema_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult { - debug!( - "{} result parse has started. Bytes to parse: {:?}", - METHOD_RESOLVE_SCHEMA, bytes - ); - - let schema = TransactionParser::new() +/// Block when the schema was created +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub fn parse_schema_created_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult { + TransactionParser::new() .set_contract(CONTRACT_NAME) - .set_method(METHOD_RESOLVE_SCHEMA) - .parse::(client, bytes)? - .schema; + .set_method(METHOD_SCHEMA_CREATED) + .parse::(client, bytes) +} +/// Parse SchemaRegistry.SchemaCreated from the event log. +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Parsed Schema object +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub fn parse_schema_created_event( + client: &LedgerClient, + log: &EventLog, +) -> VdrResult { // TODO: validate schema + EventParser::new() + .set_contract(CONTRACT_NAME) + .set_event(EVENT_SCHEMA_CREATED) + .parse(client, log) +} + +/// Single step function to resolve a Schema for the given ID +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `id` id of schema to resolve +/// +/// # Returns +/// Resolved Schema object +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn resolve_schema(client: &LedgerClient, id: &SchemaId) -> VdrResult { + let transaction = build_get_schema_created_transaction(client, id).await?; + let response = client.submit_transaction(&transaction).await?; + let created_block = parse_schema_created_result(client, &response)?; - info!( - "{} result parse has finished. Result: {:?}", - METHOD_RESOLVE_SCHEMA, schema - ); + let schema_query = + build_get_schema_query(client, id, Some(&created_block), Some(&created_block)).await?; + let events = client.query_events(&schema_query).await?; + if events.is_empty() { + return Err(VdrError::ClientInvalidResponse(format!( + "Schema not found for id: {:?}", + id + ))); + } + + if events.len() > 1 { + return Err(VdrError::ClientInvalidResponse(format!( + "More then one schema resolved for the given id: {:?}", + id + ))); + } + + let schema = parse_schema_created_event(client, &events[0])?.schema; Ok(schema) } @@ -152,31 +276,22 @@ pub mod test { nonce: Some(DEFAULT_NONCE.clone()), chain_id: CHAIN_ID, data: vec![ - 54, 206, 23, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 79, 100, 105, 100, 58, 105, 110, 100, 121, 50, 58, 116, 101, 115, 116, - 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, 107, 103, 84, 109, 69, 51, 113, - 84, 104, 103, 101, 50, 53, 70, 90, 119, 47, 97, 110, 111, 110, 99, 114, 101, - 100, 115, 47, 118, 48, 47, 83, 67, 72, 69, 77, 65, 47, 70, 49, 68, 67, 108, 97, - 70, 69, 122, 105, 51, 116, 47, 49, 46, 48, 46, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 89, 21, 183, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 226, 219, 108, 141, + 198, 198, 129, 187, 93, 106, 209, 33, 161, 7, 243, 0, 233, 178, 181, 34, 27, + 23, 130, 143, 227, 3, 94, 147, 14, 185, 63, 10, 50, 145, 115, 71, 104, 106, + 145, 232, 190, 123, 84, 240, 64, 217, 94, 167, 52, 119, 152, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 100, 105, 100, 58, 105, 110, 100, - 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, - 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 134, 123, 34, 97, 116, 116, 114, 78, 97, 109, 101, 115, 34, 58, 91, 34, 70, - 105, 114, 115, 116, 32, 78, 97, 109, 101, 34, 44, 34, 76, 97, 115, 116, 32, 78, - 97, 109, 101, 34, 93, 44, 34, 105, 115, 115, 117, 101, 114, 73, 100, 34, 58, - 34, 100, 105, 100, 58, 105, 110, 100, 121, 50, 58, 116, 101, 115, 116, 110, - 101, 116, 58, 51, 76, 112, 106, 115, 122, 107, 103, 84, 109, 69, 51, 113, 84, - 104, 103, 101, 50, 53, 70, 90, 119, 34, 44, 34, 110, 97, 109, 101, 34, 58, 34, - 70, 49, 68, 67, 108, 97, 70, 69, 122, 105, 51, 116, 34, 44, 34, 118, 101, 114, - 115, 105, 111, 110, 34, 58, 34, 49, 46, 48, 46, 48, 34, 125, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 153, 123, 34, 105, 115, 115, 117, 101, 114, 73, 100, 34, 58, 34, + 100, 105, 100, 58, 101, 116, 104, 114, 58, 116, 101, 115, 116, 110, 101, 116, + 58, 48, 120, 102, 48, 101, 50, 100, 98, 54, 99, 56, 100, 99, 54, 99, 54, 56, + 49, 98, 98, 53, 100, 54, 97, 100, 49, 50, 49, 97, 49, 48, 55, 102, 51, 48, 48, + 101, 57, 98, 50, 98, 53, 34, 44, 34, 110, 97, 109, 101, 34, 58, 34, 70, 49, 68, + 67, 108, 97, 70, 69, 122, 105, 51, 116, 34, 44, 34, 118, 101, 114, 115, 105, + 111, 110, 34, 58, 34, 49, 46, 48, 46, 48, 34, 44, 34, 97, 116, 116, 114, 78, + 97, 109, 101, 115, 34, 58, 91, 34, 70, 105, 114, 115, 116, 32, 78, 97, 109, + 101, 34, 44, 34, 76, 97, 115, 116, 32, 78, 97, 109, 101, 34, 93, 125, 0, 0, 0, + 0, 0, 0, 0, ], signature: RwLock::new(None), hash: None, @@ -185,67 +300,57 @@ pub mod test { } } - mod build_resolve_schema_transaction { + mod build_get_schema_query { use super::*; #[async_std::test] - async fn build_resolve_schema_transaction_test() { + async fn build_get_schema_query_test() { init_env_logger(); let client = mock_client(); let (id, _) = schema(&DID::from(ISSUER_ID), Some(SCHEMA_NAME)); - let transaction = build_resolve_schema_transaction(&client, &id) + let query = build_get_schema_query(&client, &id, None, None) .await .unwrap(); - let expected_transaction = Transaction { - type_: TransactionType::Read, - from: None, - to: SCHEMA_REGISTRY_ADDRESS.clone(), - nonce: None, - chain_id: CHAIN_ID, - data: vec![ - 189, 127, 197, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 100, 105, 100, 58, 105, - 110, 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, - 115, 122, 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, - 119, 47, 97, 110, 111, 110, 99, 114, 101, 100, 115, 47, 118, 48, 47, 83, 67, - 72, 69, 77, 65, 47, 70, 49, 68, 67, 108, 97, 70, 69, 122, 105, 51, 116, 47, 49, - 46, 48, 46, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - ], - signature: RwLock::new(None), - hash: None, + let expected_query = EventQuery { + address: SCHEMA_REGISTRY_ADDRESS.clone(), + from_block: None, + to_block: None, + event_signature: None, + event_filter: Some( + "221b17828fe3035e930eb93f0a32917347686a91e8be7b54f040d95ea7347798".to_string(), + ), }; - assert_eq!(expected_transaction, transaction); - } - } - - mod parse_resolve_schema_result { - use super::*; - use crate::contracts::did::types::did::DID; - - #[test] - fn parse_resolve_schema_result_test() { - init_env_logger(); - let client = mock_client(); - let data = vec![ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 166, 63, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 123, 34, 97, 116, - 116, 114, 78, 97, 109, 101, 115, 34, 58, 91, 34, 70, 105, 114, 115, 116, 32, 78, - 97, 109, 101, 34, 44, 34, 76, 97, 115, 116, 32, 78, 97, 109, 101, 34, 93, 44, 34, - 105, 115, 115, 117, 101, 114, 73, 100, 34, 58, 34, 100, 105, 100, 58, 105, 110, - 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, - 122, 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 34, - 44, 34, 110, 97, 109, 101, 34, 58, 34, 70, 49, 68, 67, 108, 97, 70, 69, 122, 105, - 51, 116, 34, 44, 34, 118, 101, 114, 115, 105, 111, 110, 34, 58, 34, 49, 46, 48, 46, - 48, 34, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, - ]; - let parsed_schema = parse_resolve_schema_result(&client, &data).unwrap(); - let (_, expected_schema) = schema(&DID::from(ISSUER_ID), Some(SCHEMA_NAME)); - assert_eq!(expected_schema, parsed_schema); + assert_eq!(expected_query, query); } } + // + // mod parse_resolve_schema_result { + // use super::*; + // use crate::contracts::did::types::did::DID; + // + // #[test] + // fn parse_resolve_schema_result_test() { + // init_env_logger(); + // let client = mock_client(); + // let data = vec![ + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 166, 63, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 123, 34, 97, 116, + // 116, 114, 78, 97, 109, 101, 115, 34, 58, 91, 34, 70, 105, 114, 115, 116, 32, 78, + // 97, 109, 101, 34, 44, 34, 76, 97, 115, 116, 32, 78, 97, 109, 101, 34, 93, 44, 34, + // 105, 115, 115, 117, 101, 114, 73, 100, 34, 58, 34, 100, 105, 100, 58, 105, 110, + // 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, + // 122, 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 34, + // 44, 34, 110, 97, 109, 101, 34, 58, 34, 70, 49, 68, 67, 108, 97, 70, 69, 122, 105, + // 51, 116, 34, 44, 34, 118, 101, 114, 115, 105, 111, 110, 34, 58, 34, 49, 46, 48, 46, + // 48, 34, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + // 0, 0, 0, + // ]; + // let parsed_schema = parse_resolve_schema_result(&client, &data).unwrap(); + // let (_, expected_schema) = schema(&DID::from(ISSUER_ID), Some(SCHEMA_NAME)); + // assert_eq!(expected_schema, parsed_schema); + // } + // } } diff --git a/vdr/src/contracts/cl/types/credential_definition.rs b/vdr/src/contracts/cl/types/credential_definition.rs index eddd1d33..d7288ceb 100644 --- a/vdr/src/contracts/cl/types/credential_definition.rs +++ b/vdr/src/contracts/cl/types/credential_definition.rs @@ -1,19 +1,10 @@ +use crate::{error::VdrError, types::ContractParam, Address}; + use crate::{ - error::VdrError, - types::{ContractOutput, ContractParam}, + contracts::{cl::types::schema_id::SchemaId, did::types::did::DID}, + types::ContractEvent, }; - -use crate::contracts::{cl::types::schema_id::SchemaId, did::types::did::DID}; -use log::trace; use serde_derive::{Deserialize, Serialize}; -use serde_json::json; - -#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct CredentialDefinitionRecord { - pub credential_definition: CredentialDefinition, - pub metadata: CredentialDefinitionMetadata, -} #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct CredentialDefinition { @@ -33,103 +24,50 @@ pub enum CredentialDefinitionTypes { CL, } -#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] -pub struct CredentialDefinitionMetadata { - pub created: u64, -} - -impl From<&CredentialDefinition> for ContractParam { - fn from(value: &CredentialDefinition) -> Self { - trace!( - "CredentialDefinition: {:?} convert into ContractParam has started", - value - ); - - let cred_def_contract_param = ContractParam::String(json!(value).to_string()); - - trace!( - "CredentialDefinition: {:?} convert into ContractParam has finished. Result: {:?}", - value, - cred_def_contract_param - ); - - cred_def_contract_param +impl AsRef for CredentialDefinitionTypes { + fn as_ref(&self) -> &str { + match self { + CredentialDefinitionTypes::CL => "CL", + } } } -impl TryFrom<&ContractOutput> for CredentialDefinition { +impl TryFrom<&CredentialDefinition> for ContractParam { type Error = VdrError; - fn try_from(value: &ContractOutput) -> Result { - trace!( - "CredentialDefinition convert from ContractOutput: {:?} has started", - value - ); - - let cred_def = serde_json::from_str(&value.get_string(0)?).map_err(|err| { - VdrError::ContractInvalidResponseData(format!( - "Unable to parse CredentialDefinition from the response. Err: {:?}", - err - )) - })?; - - trace!( - "CredentialDefinition convert from ContractOutput: {:?} has finished. Result: {:?}", - value, - cred_def - ); - - Ok(cred_def) + fn try_from(value: &CredentialDefinition) -> Result { + serde_json::to_vec(value) + .map(ContractParam::Bytes) + .map_err(|_| VdrError::ContractInvalidInputData) } } -impl TryFrom for CredentialDefinitionMetadata { - type Error = VdrError; - - fn try_from(value: ContractOutput) -> Result { - trace!( - "CredentialDefinitionMetadata convert from ContractOutput: {:?} has started", - value - ); - - let created = value.get_u128(0)?; - let cred_def_metadata = CredentialDefinitionMetadata { - created: created as u64, - }; - - trace!( - "CredentialDefinitionMetadata convert from ContractOutput: {:?} has finished. Result: {:?}", - value, cred_def_metadata - ); - - Ok(cred_def_metadata) - } +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +pub struct CredentialDefinitionCreatedEvent { + pub id_hash: String, + pub identity: Address, + pub cred_def: CredentialDefinition, } -impl TryFrom for CredentialDefinitionRecord { +impl TryFrom for CredentialDefinitionCreatedEvent { type Error = VdrError; - fn try_from(value: ContractOutput) -> Result { - trace!( - "CredentialDefinitionWithMeta convert from ContractOutput: {:?} has started", - value - ); - - let output_tuple = value.get_tuple(0)?; - let credential_definition = CredentialDefinition::try_from(&output_tuple)?; - let metadata = output_tuple.get_tuple(1)?; - - let cred_def_with_metadata = CredentialDefinitionRecord { - credential_definition, - metadata: CredentialDefinitionMetadata::try_from(metadata)?, - }; - - trace!( - "CredentialDefinitionWithMeta convert from ContractOutput: {:?} has finished. Result: {:?}", - value, cred_def_with_metadata - ); + fn try_from(log: ContractEvent) -> Result { + let id = log.get_fixed_bytes(0)?; + let identity = log.get_address(1)?; + let schema_bytes = log.get_bytes(2)?; + let cred_def = serde_json::from_slice(&schema_bytes).map_err(|err| { + VdrError::ContractInvalidResponseData(format!( + "Unable to parse credential definition from contract event. Err: {:?}", + err + )) + })?; - Ok(cred_def_with_metadata) + Ok(CredentialDefinitionCreatedEvent { + id_hash: hex::encode(id), + identity, + cred_def, + }) } } @@ -147,7 +85,7 @@ pub mod test { }; use serde_json::json; - pub const _CREDENTIAL_DEFINITION_ID: &str = "did:indy2:testnet:3LpjszkgTmE3qThge25FZw/anoncreds/v0/CLAIM_DEF/did:indy2:testnet:3LpjszkgTmE3qThge25FZw/anoncreds/v0/SCHEMA/F1DClaFEzi3t/1.0.0/default"; + pub const _CREDENTIAL_DEFINITION_ID: &str = "did:ethr:testnet:0xf0e2db6c8dc6c681bb5d6ad121a107f300e9b2b5/anoncreds/v0/CLAIM_DEF/did:ethr:testnet:0xf0e2db6c8dc6c681bb5d6ad121a107f300e9b2b5/anoncreds/v0/SCHEMA/F1DClaFEzi3t/1.0.0/default"; pub const CREDENTIAL_DEFINITION_TAG: &str = "default"; pub fn credential_definition_id( @@ -191,7 +129,7 @@ pub mod test { &SchemaId::from(SCHEMA_ID), Some(CREDENTIAL_DEFINITION_TAG), ); - ContractParam::String(json!(cred_def).to_string()) + ContractParam::Bytes(serde_json::to_vec(&cred_def).unwrap()) } mod convert_into_contract_param { @@ -204,24 +142,8 @@ pub mod test { &SchemaId::from(SCHEMA_ID), Some(CREDENTIAL_DEFINITION_TAG), ); - let param: ContractParam = (&credential_definition).into(); + let param: ContractParam = (&credential_definition).try_into().unwrap(); assert_eq!(cred_def_param(), param); } } - - mod convert_into_object { - use super::*; - - #[test] - fn convert_contract_output_into_cred_def() { - let data = ContractOutput::new(vec![cred_def_param()]); - let converted = CredentialDefinition::try_from(&data).unwrap(); - let (_, credential_definition) = credential_definition( - &DID::from(ISSUER_ID), - &SchemaId::from(SCHEMA_ID), - Some(CREDENTIAL_DEFINITION_TAG), - ); - assert_eq!(credential_definition, converted); - } - } } diff --git a/vdr/src/contracts/cl/types/credential_definition_id.rs b/vdr/src/contracts/cl/types/credential_definition_id.rs index c2ab0a06..6c95e9fd 100644 --- a/vdr/src/contracts/cl/types/credential_definition_id.rs +++ b/vdr/src/contracts/cl/types/credential_definition_id.rs @@ -1,6 +1,7 @@ -use crate::{contracts::did::types::did::DID, types::ContractParam}; -use log::trace; +use crate::{contracts::did::types::did::DID, types::ContractParam, VdrError}; + use serde_derive::{Deserialize, Serialize}; +use sha3::Digest; #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] pub struct CredentialDefinitionId(String); @@ -9,7 +10,7 @@ impl CredentialDefinitionId { const ID_PATH: &'static str = "anoncreds/v0/CLAIM_DEF"; pub fn build(issuer_id: &DID, schema_id: &str, tag: &str) -> CredentialDefinitionId { - let cred_def_id = CredentialDefinitionId::from( + CredentialDefinitionId::from( format!( "{}/{}/{}/{}", issuer_id.as_ref(), @@ -18,17 +19,23 @@ impl CredentialDefinitionId { tag ) .as_str(), - ); + ) + } - trace!("Created new CredentialDefinitionId: {:?}", cred_def_id); + pub fn hash(&self) -> Vec { + sha3::Keccak256::digest(self.0.as_bytes()).to_vec() + } - cred_def_id + pub(crate) fn to_filter(&self) -> String { + hex::encode(self.hash()) } } -impl From<&CredentialDefinitionId> for ContractParam { - fn from(id: &CredentialDefinitionId) -> Self { - ContractParam::String(id.to_string()) +impl TryFrom<&CredentialDefinitionId> for ContractParam { + type Error = VdrError; + + fn try_from(value: &CredentialDefinitionId) -> Result { + Ok(ContractParam::FixedBytes(value.hash())) } } diff --git a/vdr/src/contracts/cl/types/schema.rs b/vdr/src/contracts/cl/types/schema.rs index 20d225fa..3ba933e7 100644 --- a/vdr/src/contracts/cl/types/schema.rs +++ b/vdr/src/contracts/cl/types/schema.rs @@ -1,19 +1,11 @@ use crate::{ error::VdrError, types::{ContractOutput, ContractParam}, + Address, }; -use crate::contracts::did::types::did::DID; -use log::trace; +use crate::{contracts::did::types::did::DID, types::ContractEvent}; use serde_derive::{Deserialize, Serialize}; -use serde_json::json; - -#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct SchemaRecord { - pub schema: Schema, - pub metadata: SchemaMetadata, -} #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Schema { @@ -25,24 +17,13 @@ pub struct Schema { pub attr_names: Vec, } -#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] -pub struct SchemaMetadata { - pub created: u64, -} - -impl From<&Schema> for ContractParam { - fn from(value: &Schema) -> Self { - trace!("Schema: {:?} convert into ContractParam has started", value); - - let schema_contract_param = ContractParam::String(json!(value).to_string()); - - trace!( - "Schema: {:?} convert into ContractParam has finished. Result: {:?}", - value, - schema_contract_param - ); +impl TryFrom<&Schema> for ContractParam { + type Error = VdrError; - schema_contract_param + fn try_from(value: &Schema) -> Result { + serde_json::to_vec(value) + .map(ContractParam::Bytes) + .map_err(|_| VdrError::ContractInvalidInputData) } } @@ -50,77 +31,41 @@ impl TryFrom<&ContractOutput> for Schema { type Error = VdrError; fn try_from(value: &ContractOutput) -> Result { - trace!( - "Schema convert from ContractOutput: {:?} has started", - value - ); - - let schema = serde_json::from_str(&value.get_string(0)?).map_err(|err| { + serde_json::from_str(&value.get_string(0)?).map_err(|err| { VdrError::ContractInvalidResponseData(format!( "Unable to parse Schema from the response. Err: {:?}", err )) - })?; - - trace!( - "Schema convert from ContractOutput: {:?} has finished. Result: {:?}", - value, - schema - ); - - Ok(schema) + }) } } -impl TryFrom for SchemaMetadata { - type Error = VdrError; - - fn try_from(value: ContractOutput) -> Result { - trace!( - "SchemaMetadata convert from ContractOutput: {:?} has started", - value - ); - - let created = value.get_u128(0)?; - let schema_metadata = SchemaMetadata { - created: created as u64, - }; - - trace!( - "SchemaMetadata convert from ContractOutput: {:?} has finished. Result: {:?}", - value, - schema_metadata - ); - - Ok(schema_metadata) - } +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +pub struct SchemaCreatedEvent { + pub id_hash: String, + pub identity: Address, + pub schema: Schema, } -impl TryFrom for SchemaRecord { +impl TryFrom for SchemaCreatedEvent { type Error = VdrError; - fn try_from(value: ContractOutput) -> Result { - trace!( - "SchemaWithMeta convert from ContractOutput: {:?} has started", - value - ); - - let output_tuple = value.get_tuple(0)?; - let schema = Schema::try_from(&output_tuple)?; - let metadata = output_tuple.get_tuple(1)?; + fn try_from(log: ContractEvent) -> Result { + let id = log.get_fixed_bytes(0)?; + let identity = log.get_address(1)?; + let schema_bytes = log.get_bytes(2)?; + let schema = serde_json::from_slice(&schema_bytes).map_err(|err| { + VdrError::ContractInvalidResponseData(format!( + "Unable to parse schema from contract event. Err: {:?}", + err + )) + })?; - let schema_with_meta = SchemaRecord { + Ok(SchemaCreatedEvent { + id_hash: hex::encode(id), + identity, schema, - metadata: SchemaMetadata::try_from(metadata)?, - }; - - trace!( - "SchemaWithMeta convert from ContractOutput: {:?} has finished. Result: {:?}", - value, - schema_with_meta - ); - - Ok(schema_with_meta) + }) } } @@ -133,7 +78,7 @@ pub mod test { }; pub const SCHEMA_ID: &str = - "did:indy2:testnet:3LpjszkgTmE3qThge25FZw/anoncreds/v0/SCHEMA/F1DClaFEzi3t/1.0.0"; + "did:ethr:testnet:0xf0e2db6c8dc6c681bb5d6ad121a107f300e9b2b5/anoncreds/v0/SCHEMA/F1DClaFEzi3t/1.0.0"; pub const SCHEMA_NAME: &str = "F1DClaFEzi3t"; pub const SCHEMA_VERSION: &str = "1.0.0"; pub const SCHEMA_ATTRIBUTE_FIRST_NAME: &str = "First Name"; @@ -160,7 +105,7 @@ pub mod test { fn schema_param() -> ContractParam { let (_, schema) = schema(&DID::from(ISSUER_ID), Some(SCHEMA_NAME)); - ContractParam::String(json!(schema).to_string()) + ContractParam::Bytes(serde_json::to_vec(&schema).unwrap()) } mod convert_into_contract_param { @@ -169,20 +114,8 @@ pub mod test { #[test] fn convert_schema_into_contract_param_test() { let (_, schema) = schema(&DID::from(ISSUER_ID), Some(SCHEMA_NAME)); - let param: ContractParam = (&schema).into(); + let param: ContractParam = (&schema).try_into().unwrap(); assert_eq!(schema_param(), param); } } - - mod convert_into_object { - use super::*; - - #[test] - fn convert_contract_output_into_schema() { - let data = ContractOutput::new(vec![schema_param()]); - let converted = Schema::try_from(&data).unwrap(); - let (_, schema) = schema(&DID::from(ISSUER_ID), Some(SCHEMA_NAME)); - assert_eq!(schema, converted); - } - } } diff --git a/vdr/src/contracts/cl/types/schema_id.rs b/vdr/src/contracts/cl/types/schema_id.rs index 648b9a0f..0a1dfc48 100644 --- a/vdr/src/contracts/cl/types/schema_id.rs +++ b/vdr/src/contracts/cl/types/schema_id.rs @@ -1,6 +1,7 @@ -use crate::{contracts::did::types::did::DID, types::ContractParam}; -use log::trace; +use crate::{contracts::did::types::did::DID, types::ContractParam, VdrError}; + use serde_derive::{Deserialize, Serialize}; +use sha3::Digest; #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] pub struct SchemaId(String); @@ -9,7 +10,7 @@ impl SchemaId { const ID_PATH: &'static str = "anoncreds/v0/SCHEMA"; pub fn build(issuer_id: &DID, name: &str, version: &str) -> SchemaId { - let schema_id = SchemaId::from( + SchemaId::from( format!( "{}/{}/{}/{}", issuer_id.as_ref(), @@ -18,17 +19,23 @@ impl SchemaId { version ) .as_str(), - ); + ) + } - trace!("Created new SchemaId: {:?}", schema_id); + pub fn hash(&self) -> Vec { + sha3::Keccak256::digest(self.0.as_bytes()).to_vec() + } - schema_id + pub(crate) fn to_filter(&self) -> String { + hex::encode(self.hash()) } } -impl From<&SchemaId> for ContractParam { - fn from(id: &SchemaId) -> Self { - ContractParam::String(id.to_string()) +impl TryFrom<&SchemaId> for ContractParam { + type Error = VdrError; + + fn try_from(value: &SchemaId) -> Result { + Ok(ContractParam::FixedBytes(value.hash())) } } diff --git a/vdr/src/contracts/did/did_ethr_registry.rs b/vdr/src/contracts/did/did_ethr_registry.rs new file mode 100644 index 00000000..055f4a3f --- /dev/null +++ b/vdr/src/contracts/did/did_ethr_registry.rs @@ -0,0 +1,1157 @@ +use log_derive::{logfn, logfn_inputs}; + +use crate::{ + client::LedgerClient, + contracts::{ + did::{ + did_ethr_resolver, + types::{ + did_doc_attribute::{DelegateType, DidDocAttribute, Validity}, + did_events::{DidAttributeChanged, DidDelegateChanged, DidEvents, DidOwnerChanged}, + }, + DidResolutionOptions, + }, + DidDocumentWithMeta, + }, + error::VdrResult, + types::{ + Address, EventLog, EventParser, EventQuery, EventQueryBuilder, MethodParam, Transaction, + TransactionBuilder, TransactionEndorsingDataBuilder, TransactionParser, TransactionType, + UintBytesParam, + }, + Block, Nonce, SignatureData, TransactionEndorsingData, VdrError, DID, +}; + +const CONTRACT_NAME: &str = "EthereumExtDidRegistry"; + +const METHOD_DID_CHANGED: &str = "changed"; +const METHOD_DID_NONCE: &str = "nonce"; +const METHOD_DID_OWNER: &str = "owners"; +const METHOD_CHANGE_OWNER: &str = "changeOwner"; +const METHOD_CHANGE_OWNER_SIGNED: &str = "changeOwnerSigned"; +const METHOD_ADD_DELEGATE: &str = "addDelegate"; +const METHOD_ADD_DELEGATE_SIGNED: &str = "addDelegateSigned"; +const METHOD_REVOKE_DELEGATE: &str = "revokeDelegate"; +const METHOD_REVOKE_DELEGATE_SIGNED: &str = "revokeDelegateSigned"; +const METHOD_SET_ATTRIBUTE: &str = "setAttribute"; +const METHOD_SET_ATTRIBUTE_SIGNED: &str = "setAttributeSigned"; +const METHOD_REVOKE_ATTRIBUTE: &str = "revokeAttribute"; +const METHOD_REVOKE_ATTRIBUTE_SIGNED: &str = "revokeAttributeSigned"; + +const EVENT_DID_ATTRIBUTE_CHANGED: &str = "DIDAttributeChanged"; +const EVENT_DID_DELEGATE_CHANGED: &str = "DIDDelegateChanged"; +const EVENT_DID_OWNER_CHANGED: &str = "DIDOwnerChanged"; + +pub const ETHR_DID_METHOD: &str = "ethr"; + +// TODO: In current implementation all methods accept DID but contract API accept identity account address +// Should we change it? + +/// Build transaction to execute EthereumExtDidRegistry.changeOwner contract method to +/// change the owner of ether DID +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address (Must be DID owner) +/// - `did` DID to change ownership +/// - `new_owner` account address of new owner +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_did_change_owner_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + new_owner: &Address, +) -> VdrResult { + let identity = Address::try_from(did)?; + TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_CHANGE_OWNER) + .add_param(&identity)? + .add_param(new_owner)? + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await +} + +/// Prepared data for endorsing EthereumExtDidRegistry.changeOwner contract method +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to change ownership +/// - `new_owner` account address of new owner +/// +/// #Returns +/// data: TransactionEndorsingData - transaction endorsement data to sign +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_did_change_owner_endorsing_data( + client: &LedgerClient, + did: &DID, + new_owner: &Address, +) -> VdrResult { + let identity = Address::try_from(did)?; + let nonce = resolve_identity_nonce(client, &identity).await?; + TransactionEndorsingDataBuilder::new() + .set_contract(CONTRACT_NAME) + .set_identity(&identity) + .add_param(&nonce)? + .add_param(&identity)? + .add_param(MethodParam::from(METHOD_CHANGE_OWNER))? + .add_param(new_owner)? + .build(client) + .await +} + +/// Build transaction to execute EthereumExtDidRegistry.changeOwnerSigned contract method to +/// change the owner of ether DID +/// Endorsing version of the method - sender is not identity owner +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address +/// - `did` DID to change ownership +/// - `new_owner` account address of new owner +/// - `signature` signature of DID identity owner +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_did_change_owner_signed_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + new_owner: &Address, + signature: &SignatureData, +) -> VdrResult { + let identity = Address::try_from(did)?; + TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_CHANGE_OWNER_SIGNED) + .add_param(&identity)? + .add_param(signature.v())? + .add_param(signature.r())? + .add_param(signature.s())? + .add_param(new_owner)? + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await +} + +/// Build transaction to execute EthereumExtDidRegistry.addDelegate contract method to add a delegate. +/// An identity can assign multiple delegates to manage signing on their behalf for specific purposes. +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address (Must be DID owner) +/// - `did` DID to add a delegate +/// - `delegate_type` type of delegation (`veriKey` or `sigAuth`) +/// - `delegate` account address of delegate +/// - `validity` delegate validity time +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_did_add_delegate_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, + validity: &Validity, +) -> VdrResult { + let identity = Address::try_from(did)?; + TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_ADD_DELEGATE) + .add_param(&identity)? + .add_param(delegate_type)? + .add_param(delegate)? + .add_param(validity)? + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await +} + +/// Prepared data for endorsing EthereumExtDidRegistry.addDelegate contract method +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to add a delegate +/// - `delegate_type` type of delegation (`veriKey` or `sigAuth`) +/// - `delegate` account address of delegate +/// - `validity` delegate validity time +/// +/// #Returns +/// data: TransactionEndorsingData - transaction endorsement data to sign +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_did_add_delegate_endorsing_data( + client: &LedgerClient, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, + validity: &Validity, +) -> VdrResult { + let identity = Address::try_from(did)?; + let nonce = resolve_identity_nonce(client, &identity).await?; + TransactionEndorsingDataBuilder::new() + .set_contract(CONTRACT_NAME) + .set_identity(&identity) + .add_param(&nonce)? + .add_param(&identity)? + .add_param(MethodParam::from(METHOD_ADD_DELEGATE))? + .add_param(delegate_type)? + .add_param(delegate)? + .add_param(UintBytesParam::from(validity.0))? + .build(client) + .await +} + +/// Build transaction to execute EthereumExtDidRegistry.addDelegateSigned contract method to add a delegate. +/// An identity can assign multiple delegates to manage signing on their behalf for specific purposes. +/// +/// Endorsing version of the method - sender is not identity owner +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address +/// - `did` DID to add a delegate +/// - `delegate_type` type of delegation (`veriKey` or `sigAuth`) +/// - `delegate` account address of delegate +/// - `validity` delegate validity time +/// - `signature` signature of DID identity owner +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_did_add_delegate_signed_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, + validity: &Validity, + signature: &SignatureData, +) -> VdrResult { + let identity = Address::try_from(did)?; + TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_ADD_DELEGATE_SIGNED) + .add_param(&identity)? + .add_param(signature.v())? + .add_param(signature.r())? + .add_param(signature.s())? + .add_param(delegate_type)? + .add_param(delegate)? + .add_param(validity)? + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await +} + +/// Build transaction to execute EthereumExtDidRegistry.revokeDelegate contract method to revoke a delegate. +/// An identity can assign multiple delegates to manage signing on their behalf for specific purposes. +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address (Must be DID owner) +/// - `did` DID to revoke a delegate +/// - `delegate_type` type of delegation (`veriKey` or `sigAuth`) +/// - `delegate` account address of delegate +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_did_revoke_delegate_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, +) -> VdrResult { + let identity = Address::try_from(did)?; + TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_REVOKE_DELEGATE) + .add_param(&identity)? + .add_param(delegate_type)? + .add_param(delegate)? + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await +} + +/// Prepared data for endorsing EthereumExtDidRegistry.revokeDelegate contract method +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to add a delegate +/// - `delegate_type` type of delegation (`veriKey` or `sigAuth`) +/// - `delegate` account address of delegate +/// +/// #Returns +/// data: TransactionEndorsingData - transaction endorsement data to sign +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_did_revoke_delegate_endorsing_data( + client: &LedgerClient, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, +) -> VdrResult { + let identity = Address::try_from(did)?; + let nonce = resolve_identity_nonce(client, &identity).await?; + TransactionEndorsingDataBuilder::new() + .set_contract(CONTRACT_NAME) + .set_identity(&identity) + .add_param(&nonce)? + .add_param(&identity)? + .add_param(MethodParam::from(METHOD_REVOKE_DELEGATE))? + .add_param(delegate_type)? + .add_param(delegate)? + .build(client) + .await +} + +/// Build transaction to execute EthereumExtDidRegistry.revokeDelegateSigned contract method to revoke a delegate. +/// An identity can assign multiple delegates to manage signing on their behalf for specific purposes. +/// +/// Endorsing version of the method - sender is not identity owner +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address +/// - `did` DID to revoke a delegate +/// - `delegate_type` type of delegation (`veriKey` or `sigAuth`) +/// - `delegate` account address of delegate +/// - `signature` signature of DID identity owner +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_did_revoke_delegate_signed_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + delegate_type: &DelegateType, + delegate: &Address, + signature: &SignatureData, +) -> VdrResult { + let identity = Address::try_from(did)?; + TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_REVOKE_DELEGATE_SIGNED) + .add_param(&identity)? + .add_param(signature.v())? + .add_param(signature.r())? + .add_param(signature.s())? + .add_param(delegate_type)? + .add_param(delegate)? + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await +} + +/// Build transaction to execute EthereumExtDidRegistry.setAttribute contract method to add +/// a non ledger DID associated attribute. +/// An identity may need to publish some information that is only needed off-chain but +/// still requires the security benefits of using a blockchain. +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address (Must be DID owner) +/// - `did` DID to add an attribute +/// - `attribute` attribute to add +/// - `validity` attribute validity time +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_did_set_attribute_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + attribute: &DidDocAttribute, + validity: &Validity, +) -> VdrResult { + let identity = Address::try_from(did)?; + TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_SET_ATTRIBUTE) + .add_param(&identity)? + .add_param(&attribute.name()?)? + .add_param(&attribute.value()?)? + .add_param(validity)? + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await +} + +/// Prepared data for endorsing EthereumExtDidRegistry.setAttribute contract method +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to add an attribute +/// - `attribute` attribute to add +/// - `validity` attribute validity time +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_did_set_attribute_endorsing_data( + client: &LedgerClient, + did: &DID, + attribute: &DidDocAttribute, + validity: &Validity, +) -> VdrResult { + let identity = Address::try_from(did)?; + let nonce = resolve_identity_nonce(client, &identity).await?; + TransactionEndorsingDataBuilder::new() + .set_contract(CONTRACT_NAME) + .set_identity(&identity) + .add_param(&nonce)? + .add_param(&identity)? + .add_param(MethodParam::from(METHOD_SET_ATTRIBUTE))? + .add_param(&attribute.name()?)? + .add_param(&attribute.value()?)? + .add_param(UintBytesParam::from(validity.0))? + .build(client) + .await +} + +/// Build transaction to execute EthereumExtDidRegistry.setAttributeSigned contract method to add +/// a non ledger DID associated attribute. +/// An identity may need to publish some information that is only needed off-chain but +/// still requires the security benefits of using a blockchain. +/// +/// Endorsing version of the method - sender is not identity owner +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address +/// - `did` DID to add an attribute +/// - `attribute` attribute to add +/// - `validity` attribute validity time +/// - `signature` signature of DID identity owner +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_did_set_attribute_signed_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + attribute: &DidDocAttribute, + validity: &Validity, + signature: &SignatureData, +) -> VdrResult { + let identity = Address::try_from(did)?; + TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_SET_ATTRIBUTE_SIGNED) + .add_param(&identity)? + .add_param(signature.v())? + .add_param(signature.r())? + .add_param(signature.s())? + .add_param(&attribute.name()?)? + .add_param(&attribute.value()?)? + .add_param(validity)? + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await +} + +/// Build transaction to execute EthereumExtDidRegistry.revokeAttribute contract method to revoke +/// a non ledger DID associated attribute. +/// An identity may need to publish some information that is only needed off-chain but +/// still requires the security benefits of using a blockchain. +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address (Must be DID owner) +/// - `did` DID to revoke an attribute +/// - `attribute` attribute to add +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_did_revoke_attribute_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + attribute: &DidDocAttribute, +) -> VdrResult { + let identity = Address::try_from(did)?; + TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_REVOKE_ATTRIBUTE) + .add_param(&identity)? + .add_param(&attribute.name()?)? + .add_param(&attribute.value()?)? + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await +} + +/// Prepared data for endorsing EthereumExtDidRegistry.revokeAttribute contract method +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to add an attribute +/// - `attribute` attribute to add +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_did_revoke_attribute_endorsing_data( + client: &LedgerClient, + did: &DID, + attribute: &DidDocAttribute, +) -> VdrResult { + let identity = Address::try_from(did)?; + let nonce = resolve_identity_nonce(client, &identity).await?; + TransactionEndorsingDataBuilder::new() + .set_contract(CONTRACT_NAME) + .set_identity(&identity) + .add_param(&nonce)? + .add_param(&identity)? + .add_param(MethodParam::from(METHOD_REVOKE_ATTRIBUTE))? + .add_param(&attribute.name()?)? + .add_param(&attribute.value()?)? + .build(client) + .await +} + +/// Build transaction to execute EthereumExtDidRegistry.revokeAttributeSigned contract method to revoke +/// a non ledger DID associated attribute. +/// An identity may need to publish some information that is only needed off-chain but +/// still requires the security benefits of using a blockchain. +/// +/// Endorsing version of the method - sender is not identity owner +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `sender` sender account address +/// - `did` DID to revoke an attribute +/// - `attribute` attribute to add +/// - `signature` signature of DID identity owner +/// +/// #Returns +/// transaction: Transaction - prepared write transaction object to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_did_revoke_attribute_signed_transaction( + client: &LedgerClient, + sender: &Address, + did: &DID, + attribute: &DidDocAttribute, + signature: &SignatureData, +) -> VdrResult { + let identity = Address::try_from(did)?; + TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_REVOKE_ATTRIBUTE_SIGNED) + .add_param(&identity)? + .add_param(signature.v())? + .add_param(signature.r())? + .add_param(signature.s())? + .add_param(&attribute.name()?)? + .add_param(&attribute.value()?)? + .set_type(TransactionType::Write) + .set_from(sender) + .build(client) + .await +} + +/// Build transaction to execute EthereumExtDidRegistry.owners contract method to get +/// an account address owning the DID. +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` target DID +/// +/// #Returns +/// transaction: Transaction - prepared read transaction object to submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_get_did_owner_transaction( + client: &LedgerClient, + did: &DID, +) -> VdrResult { + let identity = Address::try_from(did)?; + TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_DID_OWNER) + .add_param(&identity)? + .set_type(TransactionType::Read) + .build(client) + .await +} + +/// Build transaction to execute EthereumExtDidRegistry.changed contract method to get +/// block number when DID was changed last time +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` target DID +/// +/// #Returns +/// transaction: Transaction - prepared read transaction object to submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_get_did_changed_transaction( + client: &LedgerClient, + did: &DID, +) -> VdrResult { + let identity = Address::try_from(did)?; + TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_DID_CHANGED) + .add_param(&identity)? + .set_type(TransactionType::Read) + .build(client) + .await +} + +/// Build transaction to execute EthereumExtDidRegistry.nonce contract method to get signing +/// nonce needed for endorsement +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` target DID +/// +/// #Returns +/// transaction: Transaction - prepared read transaction object to submit +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_get_identity_nonce_transaction( + client: &LedgerClient, + identity: &Address, +) -> VdrResult { + TransactionBuilder::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_DID_NONCE) + .add_param(identity)? + .set_type(TransactionType::Read) + .build(client) + .await +} + +/// Build event query to obtain log DID associated events from the ledger +/// +/// #Params +/// - `client` client connected to the network where contract will be executed +/// - `did` target DID +/// - `from_block` start block +/// - `to_block` finish block +/// +/// #Returns +/// query: EventQuery - prepared event query to send +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn build_get_did_events_query( + client: &LedgerClient, + did: &DID, + from_block: Option<&Block>, + to_block: Option<&Block>, +) -> VdrResult { + let address = Address::try_from(did)?; + EventQueryBuilder::new() + .set_contract(CONTRACT_NAME) + .set_from_block(from_block.cloned()) + .set_to_block(to_block.cloned()) + .set_event_filer(address.to_filter()) + .build(client) +} + +/// Parse the result of execution EthereumExtDidRegistry.changed contract method to receive +/// a block number when DID was changed last time +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Block number +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub fn parse_did_changed_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult { + TransactionParser::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_DID_CHANGED) + .parse::(client, bytes) +} + +/// Parse the result of execution EthereumExtDidRegistry.owners contract method to receive +/// an account address owning the DID. +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Owner account address +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub fn parse_did_owner_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult
{ + TransactionParser::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_DID_OWNER) + .parse::
(client, bytes) +} + +/// Parse the result of execution EthereumExtDidRegistry.nonce contract method to receive +/// a signing nonce needed for endorsement +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Nonce to use for endorsing +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub fn parse_did_nonce_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult { + TransactionParser::new() + .set_contract(CONTRACT_NAME) + .set_method(METHOD_DID_NONCE) + .parse::(client, bytes) +} + +/// Parse DidAttributeChangedEvent from the event log. +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Parsed DidAttributeChanged event object +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub fn parse_did_attribute_changed_event_response( + client: &LedgerClient, + log: &EventLog, +) -> VdrResult { + EventParser::new() + .set_contract(CONTRACT_NAME) + .set_event(EVENT_DID_ATTRIBUTE_CHANGED) + .parse::(client, log) +} + +/// Parse DidDelegateChangedEvent from the event log. +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Parsed DidDelegateChanged event object +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub fn parse_did_delegate_changed_event_response( + client: &LedgerClient, + log: &EventLog, +) -> VdrResult { + EventParser::new() + .set_contract(CONTRACT_NAME) + .set_event(EVENT_DID_DELEGATE_CHANGED) + .parse::(client, log) +} + +/// Parse DidOwnerChangedEvent from the event log. +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Parsed DidOwnerChanged event object +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub fn parse_did_owner_changed_event_response( + client: &LedgerClient, + log: &EventLog, +) -> VdrResult { + EventParser::new() + .set_contract(CONTRACT_NAME) + .set_event(EVENT_DID_OWNER_CHANGED) + .parse::(client, log) +} + +/// Parse DID associated event from the event log (it can be one of: DidAttributeChanged, DidDelegateChanged, DidOwnerChanged). +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `bytes` result bytes returned from the ledger +/// +/// # Returns +/// Parsed DID event object +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub fn parse_did_event_response(client: &LedgerClient, event: &EventLog) -> VdrResult { + let contract = client.contract(CONTRACT_NAME)?; + + let event_signature = event.topics.first().ok_or_else(|| { + VdrError::ContractInvalidResponseData("Unable to get event topic".to_string()) + })?; + + let did_attribute_changed_event_signature = + contract.event(EVENT_DID_ATTRIBUTE_CHANGED)?.signature(); + let did_delegate_changed_event_signature = + contract.event(EVENT_DID_DELEGATE_CHANGED)?.signature(); + let did_owner_changed_event_signature = contract.event(EVENT_DID_OWNER_CHANGED)?.signature(); + + if event_signature.eq(&did_attribute_changed_event_signature) { + return parse_did_attribute_changed_event_response(client, event) + .map(DidEvents::AttributeChangedEvent); + } + + if event_signature.eq(&did_delegate_changed_event_signature) { + return parse_did_delegate_changed_event_response(client, event) + .map(DidEvents::DelegateChanged); + } + + if event_signature.eq(&did_owner_changed_event_signature) { + return parse_did_owner_changed_event_response(client, event).map(DidEvents::OwnerChanged); + } + + Err(VdrError::ContractInvalidResponseData(format!( + "Unexpected contract event. Event signature: {:?}", + event_signature + ))) +} + +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn resolve_identity_nonce(client: &LedgerClient, identity: &Address) -> VdrResult { + let transaction = build_get_identity_nonce_transaction(client, identity).await?; + let response = client.submit_transaction(&transaction).await?; + parse_did_nonce_result(client, &response) +} + +/// Single step function to resolve a DidDocument with metadata for the given DID +/// +/// # Params +/// - `client` client connected to the network where contract will be executed +/// - `did` DID to get a DID Document and metadata +/// - `options` Resolution options +/// +/// # Returns +/// Parsed DID event object +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub async fn resolve_did( + client: &LedgerClient, + did: &DID, + options: Option<&DidResolutionOptions>, +) -> VdrResult { + did_ethr_resolver::resolve_did(client, did, options).await +} + +#[cfg(test)] +pub mod test { + use super::*; + use crate::{ + client::client::test::{ + mock_client, CHAIN_ID, DEFAULT_NONCE, ETHR_DID_REGISTRY_ADDRESS, IDENTITY_ACC, + TRUSTEE_ACC, + }, + contracts::{ + did::types::{ + did::DID, + did_doc::test::{SERVICE_ENDPOINT, SERVICE_TYPE}, + did_doc_attribute::{ + PublicKeyAttribute, PublicKeyPurpose, PublicKeyType, ServiceAttribute, + }, + }, + ServiceEndpoint, + }, + utils::init_env_logger, + }; + use std::sync::RwLock; + + fn did() -> DID { + DID::from(format!("did:ethr:{}", IDENTITY_ACC.as_ref()).as_str()) + } + + pub fn service() -> DidDocAttribute { + DidDocAttribute::Service(ServiceAttribute { + type_: SERVICE_TYPE.to_string(), + service_endpoint: ServiceEndpoint::String(SERVICE_ENDPOINT.to_string()), + }) + } + + pub fn public_key() -> DidDocAttribute { + DidDocAttribute::PublicKey(PublicKeyAttribute { + purpose: PublicKeyPurpose::Enc, + type_: PublicKeyType::X25519KeyAgreementKey2020, + public_key_hex: None, + public_key_base64: None, + public_key_base58: Some("FbQWLPRhTH95MCkQUeFYdiSoQt8zMwetqfWoxqPgaq7x".to_string()), + public_key_pem: None, + }) + } + + pub fn public_key_2() -> DidDocAttribute { + DidDocAttribute::PublicKey(PublicKeyAttribute { + purpose: PublicKeyPurpose::Enc, + type_: PublicKeyType::Ed25519VerificationKey2020, + public_key_base58: Some("H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV".to_string()), + ..PublicKeyAttribute::default() + }) + } + + pub fn public_key_3() -> DidDocAttribute { + DidDocAttribute::PublicKey(PublicKeyAttribute { + purpose: PublicKeyPurpose::VeriKey, + type_: PublicKeyType::EcdsaSecp256k1VerificationKey2020, + public_key_hex: Some( + "02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71".to_string(), + ), + ..PublicKeyAttribute::default() + }) + } + + pub fn validity() -> Validity { + Validity::from(1000) + } + + mod build_did_change_owner_transaction { + use super::*; + + #[async_std::test] + async fn build_did_change_owner_transaction_test() { + init_env_logger(); + let client = mock_client(); + let transaction = + build_did_change_owner_transaction(&client, &IDENTITY_ACC, &did(), &TRUSTEE_ACC) + .await + .unwrap(); + let expected_transaction = Transaction { + type_: TransactionType::Write, + from: Some(IDENTITY_ACC.clone()), + to: ETHR_DID_REGISTRY_ADDRESS.clone(), + nonce: Some(DEFAULT_NONCE.clone()), + chain_id: CHAIN_ID, + data: vec![ + 240, 13, 75, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 185, 5, 148, 0, 220, 208, + 81, 88, 255, 216, 202, 9, 41, 55, 152, 157, 210, 123, 59, 220, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 240, 226, 219, 108, 141, 198, 198, 129, 187, 93, 106, 209, + 33, 161, 7, 243, 0, 233, 178, 181, + ], + signature: RwLock::new(None), + hash: None, + }; + assert_eq!(expected_transaction, transaction); + } + } + + mod build_did_add_delegate_transaction { + use super::*; + + #[async_std::test] + async fn build_did_add_delegate_transaction_test() { + init_env_logger(); + let client = mock_client(); + let transaction = build_did_add_delegate_transaction( + &client, + &IDENTITY_ACC, + &did(), + &DelegateType::VeriKey, + &TRUSTEE_ACC, + &validity(), + ) + .await + .unwrap(); + let expected_transaction = Transaction { + type_: TransactionType::Write, + from: Some(IDENTITY_ACC.clone()), + to: ETHR_DID_REGISTRY_ADDRESS.clone(), + nonce: Some(DEFAULT_NONCE.clone()), + chain_id: CHAIN_ID, + data: vec![ + 167, 6, 141, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 185, 5, 148, 0, 220, 208, + 81, 88, 255, 216, 202, 9, 41, 55, 152, 157, 210, 123, 59, 220, 118, 101, 114, + 105, 75, 101, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 226, 219, 108, 141, + 198, 198, 129, 187, 93, 106, 209, 33, 161, 7, 243, 0, 233, 178, 181, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 232, + ], + signature: RwLock::new(None), + hash: None, + }; + assert_eq!(expected_transaction, transaction); + } + } + + mod build_did_revoke_delegate_transaction { + use super::*; + + #[async_std::test] + async fn build_did_revoke_delegate_transaction_test() { + init_env_logger(); + let client = mock_client(); + let transaction = build_did_revoke_delegate_transaction( + &client, + &IDENTITY_ACC, + &did(), + &DelegateType::VeriKey, + &TRUSTEE_ACC, + ) + .await + .unwrap(); + let expected_transaction = Transaction { + type_: TransactionType::Write, + from: Some(IDENTITY_ACC.clone()), + to: ETHR_DID_REGISTRY_ADDRESS.clone(), + nonce: Some(DEFAULT_NONCE.clone()), + chain_id: CHAIN_ID, + data: vec![ + 128, 178, 159, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 185, 5, 148, 0, 220, + 208, 81, 88, 255, 216, 202, 9, 41, 55, 152, 157, 210, 123, 59, 220, 118, 101, + 114, 105, 75, 101, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 226, 219, 108, + 141, 198, 198, 129, 187, 93, 106, 209, 33, 161, 7, 243, 0, 233, 178, 181, + ], + signature: RwLock::new(None), + hash: None, + }; + assert_eq!(expected_transaction, transaction); + } + } + + mod build_did_set_attribute_transaction { + use super::*; + + #[async_std::test] + async fn build_did_set_service_attribute_transaction_test() { + init_env_logger(); + let client = mock_client(); + let transaction = build_did_set_attribute_transaction( + &client, + &IDENTITY_ACC, + &did(), + &service(), + &validity(), + ) + .await + .unwrap(); + let expected_transaction = Transaction { + type_: TransactionType::Write, + from: Some(IDENTITY_ACC.clone()), + to: ETHR_DID_REGISTRY_ADDRESS.clone(), + nonce: Some(DEFAULT_NONCE.clone()), + chain_id: CHAIN_ID, + data: vec![ + 122, 212, 176, 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 185, 5, 148, 0, 220, + 208, 81, 88, 255, 216, 202, 9, 41, 55, 152, 157, 210, 123, 59, 220, 100, 105, + 100, 47, 115, 118, 99, 47, 83, 101, 114, 118, 105, 99, 101, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 232, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 18, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97, 109, 112, 108, 101, 46, + 99, 111, 109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + signature: RwLock::new(None), + hash: None, + }; + assert_eq!(expected_transaction, transaction); + } + + #[async_std::test] + async fn build_did_set_key_attribute_transaction_test() { + init_env_logger(); + let client = mock_client(); + let transaction = build_did_set_attribute_transaction( + &client, + &IDENTITY_ACC, + &did(), + &public_key(), + &validity(), + ) + .await + .unwrap(); + let expected_transaction = Transaction { + type_: TransactionType::Write, + from: Some(IDENTITY_ACC.clone()), + to: ETHR_DID_REGISTRY_ADDRESS.clone(), + nonce: Some(DEFAULT_NONCE.clone()), + chain_id: CHAIN_ID, + data: vec![ + 122, 212, 176, 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 185, 5, 148, 0, 220, + 208, 81, 88, 255, 216, 202, 9, 41, 55, 152, 157, 210, 123, 59, 220, 100, 105, + 100, 47, 112, 117, 98, 47, 88, 50, 53, 53, 49, 57, 47, 101, 110, 99, 47, 98, + 97, 115, 101, 53, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 232, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 32, 216, 211, 241, 73, 138, 202, 20, 247, 254, 92, 152, 102, 20, + 103, 236, 224, 41, 108, 66, 163, 228, 133, 29, 248, 18, 225, 230, 17, 163, 84, + 230, 43, + ], + signature: RwLock::new(None), + hash: None, + }; + assert_eq!(expected_transaction, transaction); + } + } + + mod build_did_revoke_attribute_transaction { + use super::*; + + #[async_std::test] + async fn build_did_revoke_attribute_transaction_test() { + init_env_logger(); + let client = mock_client(); + let transaction = + build_did_revoke_attribute_transaction(&client, &IDENTITY_ACC, &did(), &service()) + .await + .unwrap(); + let expected_transaction = Transaction { + type_: TransactionType::Write, + from: Some(IDENTITY_ACC.clone()), + to: ETHR_DID_REGISTRY_ADDRESS.clone(), + nonce: Some(DEFAULT_NONCE.clone()), + chain_id: CHAIN_ID, + data: vec![ + 0, 192, 35, 218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 185, 5, 148, 0, 220, 208, + 81, 88, 255, 216, 202, 9, 41, 55, 152, 157, 210, 123, 59, 220, 100, 105, 100, + 47, 115, 118, 99, 47, 83, 101, 114, 118, 105, 99, 101, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 104, 116, 116, + 112, 58, 47, 47, 101, 120, 97, 109, 112, 108, 101, 46, 99, 111, 109, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + signature: RwLock::new(None), + hash: None, + }; + assert_eq!(expected_transaction, transaction); + } + } +} diff --git a/vdr/src/contracts/did/did_ethr_resolver.rs b/vdr/src/contracts/did/did_ethr_resolver.rs new file mode 100644 index 00000000..5f438ab2 --- /dev/null +++ b/vdr/src/contracts/did/did_ethr_resolver.rs @@ -0,0 +1,398 @@ +use chrono::Utc; +use log_derive::{logfn, logfn_inputs}; + +use crate::{ + contracts::{ + did::{types::did_doc_attribute::PublicKeyPurpose, DidResolutionError}, + types::did::ParsedDid, + DidDocumentWithMeta, DidMetadata, DidResolutionMetadata, DID_RESOLUTION_FORMAT, + }, + did_ethr_registry::{ + build_get_did_changed_transaction, build_get_did_events_query, parse_did_changed_result, + parse_did_event_response, ETHR_DID_METHOD, + }, + Block, DelegateType, DidAttributeChanged, DidDelegateChanged, DidDocAttribute, DidDocument, + DidDocumentBuilder, DidEvents, DidOwnerChanged, DidResolutionOptions, LedgerClient, VdrResult, + VerificationKeyType, DID, +}; + +#[logfn(Info)] +#[logfn_inputs(Debug)] +pub(crate) async fn resolve_did( + client: &LedgerClient, + did: &DID, + options: Option<&DidResolutionOptions>, +) -> VdrResult { + // Parse DID + let parsed_did = match ParsedDid::try_from(did) { + Ok(did) => did, + Err(_) => { + return Ok(DidDocumentWithMeta { + did_document: None, + did_document_metadata: DidMetadata::default(), + did_resolution_metadata: DidResolutionMetadata { + content_type: None, + error: Some(DidResolutionError::InvalidDid), + message: Some(format!("Not a valid did: {}", did.as_ref())), + }, + }); + } + }; + if parsed_did.method != ETHR_DID_METHOD { + return Ok(DidDocumentWithMeta { + did_document: None, + did_document_metadata: DidMetadata::default(), + did_resolution_metadata: DidResolutionMetadata { + content_type: None, + error: Some(DidResolutionError::MethodNotSupported), + message: Some(format!( + "DID Method is not supported: {}", + parsed_did.method + )), + }, + }); + } + + let did = parsed_did.as_short_did(); + + let block_tag = options.and_then(|options| options.block_tag.as_ref()); + let accept = options.and_then(|options| options.accept.as_deref()); + + match accept.as_deref() { + Some(DID_RESOLUTION_FORMAT) | None => { + // ok + } + Some(accept) => { + return Ok(DidDocumentWithMeta { + did_document: None, + did_document_metadata: DidMetadata::default(), + did_resolution_metadata: DidResolutionMetadata { + content_type: None, + error: Some(DidResolutionError::RepresentationNotSupported), + message: Some(format!( + "VDR does not support the requested 'accept' format: {}", + accept + )), + }, + }); + } + } + + match _resolve_did(client, &did, block_tag).await { + Ok((did_document, did_metadata)) => Ok(DidDocumentWithMeta { + did_document: Some(did_document), + did_document_metadata: did_metadata, + did_resolution_metadata: DidResolutionMetadata { + content_type: accept.map(String::from), + error: None, + message: None, + }, + }), + Err(err) => Ok(DidDocumentWithMeta { + did_document: None, + did_document_metadata: DidMetadata::default(), + did_resolution_metadata: DidResolutionMetadata { + content_type: None, + error: Some(DidResolutionError::NotFound), + message: Some(err.to_string()), + }, + }), + } +} + +#[logfn(Trace)] +#[logfn_inputs(Trace)] +pub(crate) async fn _resolve_did( + client: &LedgerClient, + did: &DID, + block: Option<&Block>, +) -> VdrResult<(DidDocument, DidMetadata)> { + // Build base DID document for ethr DID + let mut did_doc_builder = DidDocumentBuilder::base_for_did(did, client.chain_id())?; + + // TODO: support the case when DID identifier is public key + + // Query block number when DID was changed last time + let did_changed_block = get_did_changed_block(client, did).await?; + + // if DID has not been ever changed, we do not need to query events and just return base did document + if did_changed_block.is_none() { + let did_document = did_doc_builder.build(); + return Ok((did_document, DidMetadata::default())); + } + + let mut version_id: Option = None; + let mut next_version_id: Option = None; + + // time in seconds for attributes validity check + let now = match block { + Some(block) => { + // request block time if the resolution happens for specific block + client.get_block(Some(block)).await?.timestamp + } + None => { + // else current time + Utc::now().timestamp() as u64 + } + }; + + // request events for a specific block until previous exists + let did_history = receive_did_history(client, did, did_changed_block).await?; + + // assemble Did Document from the history events + // iterate in the reverse order -> oldest to newest + for (event_block, event) in did_history.into_iter().rev() { + match block { + // if we resolve DID for specific block we need to skip all blocks higher + Some(block) if event_block.value() > block.value() => { + if next_version_id.is_none() { + next_version_id = Some(event_block) + } + continue; + } + _ => { + version_id = Some(event_block); + } + } + + // handle event + handle_did_event(&mut did_doc_builder, &event, client, now)?; + + // break for deactivate DID -> minimal DID Document will be returned + if did_doc_builder.deactivated() { + break; + } + } + + let did_document_metadata = build_did_metadata( + client, + did_doc_builder.deactivated(), + version_id.as_ref(), + next_version_id.as_ref(), + ) + .await?; + let did_document = did_doc_builder.build(); + Ok((did_document, did_document_metadata)) +} + +#[logfn(Trace)] +#[logfn_inputs(Trace)] +async fn get_did_changed_block(client: &LedgerClient, did: &DID) -> VdrResult { + let transaction = build_get_did_changed_transaction(client, did).await?; + let response = client.submit_transaction(&transaction).await?; + parse_did_changed_result(client, &response) +} + +#[logfn(Trace)] +#[logfn_inputs(Trace)] +async fn receive_did_history( + client: &LedgerClient, + did: &DID, + first_block: Block, +) -> VdrResult> { + let mut history: Vec<(Block, DidEvents)> = Vec::new(); + let mut previous_block: Option = Some(first_block); + while previous_block.is_some() { + let transaction = build_get_did_events_query( + client, + did, + previous_block.as_ref(), + previous_block.as_ref(), + ) + .await?; + let logs = client.query_events(&transaction).await?; + + // if no logs, break the loop as nothing to add to the change history + if logs.is_empty() { + break; + } + + // parse events + for log in logs { + let event = parse_did_event_response(client, &log)?; + previous_block = Some(event.previous_change()); + history.push((log.block, event)); + } + } + Ok(history) +} + +#[logfn(Trace)] +#[logfn_inputs(Trace)] +fn handle_did_owner_changed( + did_doc_builder: &mut DidDocumentBuilder, + event: &DidOwnerChanged, +) -> VdrResult<()> { + if event.owner.is_null() { + // DID is considered to be deactivated + did_doc_builder.deactivate(); + return Ok(()); + } + + let controller = DID::build(ETHR_DID_METHOD, None, event.owner.as_ref()); + did_doc_builder.set_controller(controller.as_ref()); + Ok(()) +} + +#[logfn(Trace)] +#[logfn_inputs(Trace)] +fn handle_did_delegate_changed( + did_doc_builder: &mut DidDocumentBuilder, + event: &DidDelegateChanged, + now: u64, + client: &LedgerClient, +) -> VdrResult<()> { + let event_index = event.key(); + let delegate_type = DelegateType::try_from(event.delegate_type.as_slice())?; + + if event.valid_to > now { + did_doc_builder.add_delegate_key( + &event_index, + &VerificationKeyType::EcdsaSecp256k1RecoveryMethod2020, + Some(event.delegate.as_blockchain_id(client.chain_id()).as_str()), + None, + None, + None, + None, + ); + + match delegate_type { + DelegateType::VeriKey => { + did_doc_builder.add_assertion_method_reference(&event_index)?; + } + DelegateType::SigAuth => { + did_doc_builder.add_authentication_reference(&event_index)?; + } + } + } else { + // delegate expired + did_doc_builder.remove_delegate_key(&event_index)?; + match delegate_type { + DelegateType::VeriKey => { + did_doc_builder.remove_assertion_method_reference(&event_index)?; + } + DelegateType::SigAuth => { + did_doc_builder.remove_authentication_reference(&event_index)?; + } + } + }; + Ok(()) +} + +#[logfn(Trace)] +#[logfn_inputs(Trace)] +fn handle_did_attribute_changed( + did_doc_builder: &mut DidDocumentBuilder, + event: &DidAttributeChanged, + now: u64, +) -> VdrResult<()> { + let event_index = event.key(); + let attribute = DidDocAttribute::try_from(event)?; + + match attribute { + DidDocAttribute::PublicKey(key) => { + if event.valid_to > now { + did_doc_builder.add_delegate_key( + &event_index, + &key.type_.into(), + None, + None, + key.public_key_hex.as_deref(), + key.public_key_base58.as_deref(), + key.public_key_base64.as_deref(), + ); + + match key.purpose { + PublicKeyPurpose::VeriKey => { + did_doc_builder.add_assertion_method_reference(&event_index)?; + } + PublicKeyPurpose::SigAuth => { + did_doc_builder.add_authentication_reference(&event_index)?; + } + PublicKeyPurpose::Enc => { + did_doc_builder.add_key_agreement_reference(&event_index)?; + } + } + } else { + // key expired + did_doc_builder.remove_delegate_key(&event_index)?; + match key.purpose { + PublicKeyPurpose::VeriKey => { + did_doc_builder.remove_assertion_method_reference(&event_index)?; + } + PublicKeyPurpose::SigAuth => { + did_doc_builder.remove_authentication_reference(&event_index)?; + } + PublicKeyPurpose::Enc => { + did_doc_builder.remove_key_agreement_reference(&event_index)?; + } + } + } + } + DidDocAttribute::Service(service) => { + if event.valid_to > now { + did_doc_builder.add_service( + &event_index, + None, + &service.type_, + &service.service_endpoint, + ); + } else { + did_doc_builder.remove_service(&event_index)?; + } + } + }; + Ok(()) +} + +#[logfn(Trace)] +#[logfn_inputs(Trace)] +fn handle_did_event( + did_doc_builder: &mut DidDocumentBuilder, + event: &DidEvents, + client: &LedgerClient, + now: u64, +) -> VdrResult<()> { + match event { + DidEvents::OwnerChanged(event) => handle_did_owner_changed(did_doc_builder, event), + DidEvents::DelegateChanged(event) => { + handle_did_delegate_changed(did_doc_builder, event, now, client) + } + DidEvents::AttributeChangedEvent(event) => { + handle_did_attribute_changed(did_doc_builder, event, now) + } + } +} + +#[logfn(Trace)] +#[logfn_inputs(Trace)] +async fn build_did_metadata( + client: &LedgerClient, + deactivated: bool, + version_id: Option<&Block>, + next_version_id: Option<&Block>, +) -> VdrResult { + let (updated, version_id) = match version_id { + Some(version_id) => { + let block = client.get_block(Some(version_id)).await?; + (Some(block.timestamp), Some(block.number)) + } + None => (None, None), + }; + + let (next_update, next_version_id) = match next_version_id { + Some(next_version_id) => { + let block = client.get_block(Some(next_version_id)).await?; + (Some(block.timestamp), Some(block.number)) + } + None => (None, None), + }; + + Ok(DidMetadata { + deactivated: Some(deactivated), + updated, + version_id, + next_update, + next_version_id, + }) +} diff --git a/vdr/src/contracts/did/did_registry.rs b/vdr/src/contracts/did/did_registry.rs deleted file mode 100644 index 095d7607..00000000 --- a/vdr/src/contracts/did/did_registry.rs +++ /dev/null @@ -1,501 +0,0 @@ -use log::{debug, info}; - -use crate::{ - client::LedgerClient, - contracts::did::types::{ - did::DID, - did_doc::{DidDocument, DidRecord}, - }, - error::VdrResult, - types::{Address, Transaction, TransactionBuilder, TransactionParser, TransactionType}, -}; - -const CONTRACT_NAME: &str = "IndyDidRegistry"; -const METHOD_CREATE_DID: &str = "createDid"; -const METHOD_UPDATE_DID: &str = "updateDid"; -const METHOD_DEACTIVATE_DID: &str = "deactivateDid"; -const METHOD_RESOLVE_DID: &str = "resolveDid"; - -/// Build transaction to execute IndyDidRegistry.createDid contract method to create a new DID -/// -/// # Params -/// - `client` client connected to the network where contract will be executed -/// - `from` transaction sender account address -/// - `identity` DID owner account address -/// - `did` DID to be created -/// - `did_doc` DID Document matching to the specification: https://www.w3.org/TR/did-core/ -/// -/// # Returns -/// Write transaction to sign and submit -pub async fn build_create_did_transaction( - client: &LedgerClient, - from: &Address, - identity: &Address, - did: &DID, - did_doc: &DidDocument, -) -> VdrResult { - debug!( - "{} txn build has started. Sender: {:?}, DidDocument: {:?}", - METHOD_CREATE_DID, from, did_doc - ); - - let transaction = TransactionBuilder::new() - .set_contract(CONTRACT_NAME) - .set_method(METHOD_CREATE_DID) - .add_param(identity.try_into()?) - .add_param(did.into()) - .add_param(did_doc.into()) - .set_type(TransactionType::Write) - .set_from(from) - .build(client) - .await?; - - info!( - "{} txn build has finished. Result: {:?}", - METHOD_CREATE_DID, transaction - ); - - Ok(transaction) -} - -/// Build transaction to execute IndyDidRegistry.updateDid contract method to update DID document for an existing DID -/// -/// # Params -/// - `client` client connected to the network where contract will be executed -/// - `from` transaction sender account address -/// - `did` DID to be updated -/// - `did_doc` new DID Document matching to the specification: https://www.w3.org/TR/did-core/ -/// -/// # Returns -/// Write transaction to sign and submit -pub async fn build_update_did_transaction( - client: &LedgerClient, - from: &Address, - did: &DID, - did_doc: &DidDocument, -) -> VdrResult { - debug!( - "{} txn build has started. Sender: {:?}, DidDocument: {:?}", - METHOD_UPDATE_DID, from, did_doc - ); - - let transaction = TransactionBuilder::new() - .set_contract(CONTRACT_NAME) - .set_method(METHOD_UPDATE_DID) - .add_param(did.into()) - .add_param(did_doc.into()) - .set_type(TransactionType::Write) - .set_from(from) - .build(client) - .await?; - - info!( - "{} txn build has finished. Result: {:?}", - METHOD_UPDATE_DID, transaction - ); - - Ok(transaction) -} - -/// Build transaction to execute IndyDidRegistry.deactivateDid contract method to deactivate an existing DID -/// -/// # Params -/// - `client` client connected to the network where contract will be executed -/// - `from` transaction sender account address -/// - `did` DID to deactivate -/// -/// # Returns -/// Write transaction to sign and submit -pub async fn build_deactivate_did_transaction( - client: &LedgerClient, - from: &Address, - did: &DID, -) -> VdrResult { - debug!( - "{} txn build has started. Sender: {:?}, Did: {:?}", - METHOD_DEACTIVATE_DID, from, did - ); - - let transaction = TransactionBuilder::new() - .set_contract(CONTRACT_NAME) - .set_method(METHOD_DEACTIVATE_DID) - .add_param(did.into()) - .set_type(TransactionType::Write) - .set_from(from) - .build(client) - .await?; - - info!( - "{} txn build has finished. Result: {:?}", - METHOD_DEACTIVATE_DID, transaction - ); - - Ok(transaction) -} - -/// Build transaction to execute IndyDidRegistry.resolveDid contract method to receive a DID Document associated with the DID -/// -/// # Params -/// - `client` client connected to the network where contract will be executed -/// - `did` target DID to receive DID Document -/// -/// # Returns -/// Read transaction to submit -pub async fn build_resolve_did_transaction( - client: &LedgerClient, - did: &DID, -) -> VdrResult { - debug!( - "{} txn build has started. Did: {:?}", - METHOD_RESOLVE_DID, did - ); - - let transaction = TransactionBuilder::new() - .set_contract(CONTRACT_NAME) - .set_method(METHOD_RESOLVE_DID) - .add_param(did.into()) - .set_type(TransactionType::Read) - .build(client) - .await?; - - info!( - "{} txn build has finished. Result: {:?}", - METHOD_RESOLVE_DID, transaction - ); - - Ok(transaction) -} - -/// Parse the result of execution IndyDidRegistry.resolveDid contract method to receive a DID Document associated with the DID -/// -/// # Params -/// - `client` client connected to the network where contract will be executed -/// - `bytes` result bytes returned from the ledger -/// -/// # Returns -/// parsed DID Document -pub fn parse_resolve_did_result(client: &LedgerClient, bytes: &[u8]) -> VdrResult { - debug!( - "{} result parse has started. Bytes to parse: {:?}", - METHOD_RESOLVE_DID, bytes - ); - - let document = TransactionParser::new() - .set_contract(CONTRACT_NAME) - .set_method(METHOD_RESOLVE_DID) - .parse::(client, bytes)? - .document; - - info!( - "{} result parse has finished. Result: {:?}", - METHOD_RESOLVE_DID, document - ); - - Ok(document) -} - -#[cfg(test)] -pub mod test { - use super::*; - use crate::{ - client::client::test::{ - mock_client, CHAIN_ID, DEFAULT_NONCE, DID_REGISTRY_ADDRESS, TRUSTEE_ACC, - }, - contracts::did::types::{ - did::DID, - did_doc::test::{did_doc, ISSUER_ID}, - }, - utils::init_env_logger, - }; - use std::sync::RwLock; - - mod build_create_did_transaction { - use super::*; - use crate::{ - client::client::test::{mock_client, IDENTITY_ACC}, - contracts::{ - did::types::did_doc::test::service, StringOrVector, VerificationMethod, - VerificationMethodOrReference, - }, - VerificationKeyType, - }; - - #[async_std::test] - async fn build_create_did_transaction_test() { - init_env_logger(); - let client = mock_client(); - let did = DID::from(ISSUER_ID); - let did_doc = did_doc(Some(ISSUER_ID)); - let transaction = - build_create_did_transaction(&client, &TRUSTEE_ACC, &IDENTITY_ACC, &did, &did_doc) - .await - .unwrap(); - let expected_transaction = Transaction { - type_: TransactionType::Write, - from: Some(TRUSTEE_ACC.clone()), - to: DID_REGISTRY_ADDRESS.clone(), - nonce: Some(DEFAULT_NONCE.clone()), - chain_id: CHAIN_ID, - data: vec![ - 30, 113, 85, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 185, 5, 148, 0, 220, 208, - 81, 88, 255, 216, 202, 9, 41, 55, 152, 157, 210, 123, 59, 220, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 100, 105, 100, 58, 105, 110, 100, 121, - 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, 107, - 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 25, - 123, 34, 64, 99, 111, 110, 116, 101, 120, 116, 34, 58, 91, 34, 104, 116, 116, - 112, 115, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 110, - 115, 47, 100, 105, 100, 47, 118, 49, 34, 93, 44, 34, 97, 108, 115, 111, 75, - 110, 111, 119, 110, 65, 115, 34, 58, 91, 93, 44, 34, 97, 115, 115, 101, 114, - 116, 105, 111, 110, 77, 101, 116, 104, 111, 100, 34, 58, 91, 93, 44, 34, 97, - 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 105, 111, 110, 34, 58, 91, 34, - 100, 105, 100, 58, 105, 110, 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, - 116, 58, 51, 76, 112, 106, 115, 122, 107, 103, 84, 109, 69, 51, 113, 84, 104, - 103, 101, 50, 53, 70, 90, 119, 35, 75, 69, 89, 45, 49, 34, 93, 44, 34, 99, 97, - 112, 97, 98, 105, 108, 105, 116, 121, 68, 101, 108, 101, 103, 97, 116, 105, - 111, 110, 34, 58, 91, 93, 44, 34, 99, 97, 112, 97, 98, 105, 108, 105, 116, 121, - 73, 110, 118, 111, 99, 97, 116, 105, 111, 110, 34, 58, 91, 93, 44, 34, 99, 111, - 110, 116, 114, 111, 108, 108, 101, 114, 34, 58, 91, 93, 44, 34, 105, 100, 34, - 58, 34, 100, 105, 100, 58, 105, 110, 100, 121, 50, 58, 116, 101, 115, 116, 110, - 101, 116, 58, 51, 76, 112, 106, 115, 122, 107, 103, 84, 109, 69, 51, 113, 84, - 104, 103, 101, 50, 53, 70, 90, 119, 34, 44, 34, 107, 101, 121, 65, 103, 114, - 101, 101, 109, 101, 110, 116, 34, 58, 91, 93, 44, 34, 115, 101, 114, 118, 105, - 99, 101, 34, 58, 91, 93, 44, 34, 118, 101, 114, 105, 102, 105, 99, 97, 116, - 105, 111, 110, 77, 101, 116, 104, 111, 100, 34, 58, 91, 123, 34, 99, 111, 110, - 116, 114, 111, 108, 108, 101, 114, 34, 58, 34, 100, 105, 100, 58, 105, 110, - 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, - 122, 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, - 34, 44, 34, 105, 100, 34, 58, 34, 100, 105, 100, 58, 105, 110, 100, 121, 50, - 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, 107, - 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 35, 75, 69, - 89, 45, 49, 34, 44, 34, 112, 117, 98, 108, 105, 99, 75, 101, 121, 77, 117, 108, - 116, 105, 98, 97, 115, 101, 34, 58, 34, 122, 65, 75, 74, 80, 51, 102, 55, 66, - 68, 54, 87, 52, 105, 87, 69, 81, 57, 106, 119, 110, 100, 86, 84, 67, 66, 113, - 56, 117, 97, 50, 85, 116, 116, 56, 69, 69, 106, 74, 54, 86, 120, 115, 102, 34, - 44, 34, 116, 121, 112, 101, 34, 58, 34, 69, 100, 50, 53, 53, 49, 57, 86, 101, - 114, 105, 102, 105, 99, 97, 116, 105, 111, 110, 75, 101, 121, 50, 48, 49, 56, - 34, 125, 93, 125, 0, 0, 0, 0, 0, 0, 0, - ], - signature: RwLock::new(None), - hash: None, - }; - assert_eq!(expected_transaction, transaction); - } - - #[async_std::test] - async fn build_create_did_transaction_with_two_keys_and_service_test() { - init_env_logger(); - let client = mock_client(); - - let did = DID::from("did:indy2:testnet:3LpjszkgTmE3qThge25FZw"); - let did_doc = DidDocument { - context: StringOrVector::Vector(vec!["https://www.w3.org/ns/did/v1".to_string()]), - id: DID::from("did:indy2:testnet:3LpjszkgTmE3qThge25FZw"), - controller: StringOrVector::Vector(vec![]), - verification_method: vec![ - VerificationMethod { - id: "did:indy2:testnet:3LpjszkgTmE3qThge25FZw#KEY-1".to_string(), - type_: VerificationKeyType::Ed25519VerificationKey2018, - controller: "did:indy2:testnet:3LpjszkgTmE3qThge25FZw".to_string(), - public_key_multibase: Some("8rnQ4gvtEYi59DMAzN7FyCVatVATkFo7wPXVMy38WmvG".to_string()), - public_key_jwk: None, - }, - VerificationMethod { - id: "did:indy2:testnet:3LpjszkgTmE3qThge25FZw#KEY-2".to_string(), - type_: VerificationKeyType::EcdsaSecp256k1VerificationKey2019, - controller: "did:indy2:testnet:3LpjszkgTmE3qThge25FZw".to_string(), - public_key_multibase: Some("NaqS2qSLZTJcuKLvFAoBSeRFXeivDfyoUqvSs8DQ4ajydz4KbUvT6vdJyz8i9gJEqGjFkCN27niZhoAbQLgk3imn".to_string()), - public_key_jwk: None, - }, - ], - authentication: vec![ - VerificationMethodOrReference::String("did:indy2:testnet:3LpjszkgTmE3qThge25FZw#KEY-1".to_string()), - VerificationMethodOrReference::String("did:indy2:testnet:3LpjszkgTmE3qThge25FZw#KEY-2".to_string()), - ], - assertion_method: vec![], - capability_invocation: vec![], - capability_delegation: vec![], - key_agreement: vec![], - service: vec![ - service("did:indy2:testnet:3LpjszkgTmE3qThge25FZw#SERVICE-1") - ], - also_known_as: Some(vec![]), - }; - let transaction = - build_create_did_transaction(&client, &TRUSTEE_ACC, &IDENTITY_ACC, &did, &did_doc) - .await - .unwrap(); - let expected_transaction = Transaction { - type_: TransactionType::Write, - from: Some(TRUSTEE_ACC.clone()), - to: DID_REGISTRY_ADDRESS.clone(), - nonce: Some(DEFAULT_NONCE.clone()), - chain_id: CHAIN_ID, - data: vec![ - 30, 113, 85, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 185, 5, 148, 0, 220, 208, - 81, 88, 255, 216, 202, 9, 41, 55, 152, 157, 210, 123, 59, 220, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 100, 105, 100, 58, 105, 110, 100, 121, - 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, 107, - 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 203, - 123, 34, 64, 99, 111, 110, 116, 101, 120, 116, 34, 58, 91, 34, 104, 116, 116, - 112, 115, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, 103, 47, 110, - 115, 47, 100, 105, 100, 47, 118, 49, 34, 93, 44, 34, 97, 108, 115, 111, 75, - 110, 111, 119, 110, 65, 115, 34, 58, 91, 93, 44, 34, 97, 115, 115, 101, 114, - 116, 105, 111, 110, 77, 101, 116, 104, 111, 100, 34, 58, 91, 93, 44, 34, 97, - 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 105, 111, 110, 34, 58, 91, 34, - 100, 105, 100, 58, 105, 110, 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, - 116, 58, 51, 76, 112, 106, 115, 122, 107, 103, 84, 109, 69, 51, 113, 84, 104, - 103, 101, 50, 53, 70, 90, 119, 35, 75, 69, 89, 45, 49, 34, 44, 34, 100, 105, - 100, 58, 105, 110, 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, - 76, 112, 106, 115, 122, 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, - 53, 70, 90, 119, 35, 75, 69, 89, 45, 50, 34, 93, 44, 34, 99, 97, 112, 97, 98, - 105, 108, 105, 116, 121, 68, 101, 108, 101, 103, 97, 116, 105, 111, 110, 34, - 58, 91, 93, 44, 34, 99, 97, 112, 97, 98, 105, 108, 105, 116, 121, 73, 110, 118, - 111, 99, 97, 116, 105, 111, 110, 34, 58, 91, 93, 44, 34, 99, 111, 110, 116, - 114, 111, 108, 108, 101, 114, 34, 58, 91, 93, 44, 34, 105, 100, 34, 58, 34, - 100, 105, 100, 58, 105, 110, 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, - 116, 58, 51, 76, 112, 106, 115, 122, 107, 103, 84, 109, 69, 51, 113, 84, 104, - 103, 101, 50, 53, 70, 90, 119, 34, 44, 34, 107, 101, 121, 65, 103, 114, 101, - 101, 109, 101, 110, 116, 34, 58, 91, 93, 44, 34, 115, 101, 114, 118, 105, 99, - 101, 34, 58, 91, 123, 34, 105, 100, 34, 58, 34, 100, 105, 100, 58, 105, 110, - 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, - 122, 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, - 35, 83, 69, 82, 86, 73, 67, 69, 45, 49, 34, 44, 34, 115, 101, 114, 118, 105, - 99, 101, 69, 110, 100, 112, 111, 105, 110, 116, 34, 58, 34, 49, 50, 55, 46, 48, - 46, 48, 46, 49, 58, 53, 53, 53, 53, 34, 44, 34, 116, 121, 112, 101, 34, 58, 34, - 68, 73, 68, 67, 111, 109, 109, 83, 101, 114, 118, 105, 99, 101, 34, 125, 93, - 44, 34, 118, 101, 114, 105, 102, 105, 99, 97, 116, 105, 111, 110, 77, 101, 116, - 104, 111, 100, 34, 58, 91, 123, 34, 99, 111, 110, 116, 114, 111, 108, 108, 101, - 114, 34, 58, 34, 100, 105, 100, 58, 105, 110, 100, 121, 50, 58, 116, 101, 115, - 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, 107, 103, 84, 109, 69, 51, - 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 34, 44, 34, 105, 100, 34, 58, 34, - 100, 105, 100, 58, 105, 110, 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, - 116, 58, 51, 76, 112, 106, 115, 122, 107, 103, 84, 109, 69, 51, 113, 84, 104, - 103, 101, 50, 53, 70, 90, 119, 35, 75, 69, 89, 45, 49, 34, 44, 34, 112, 117, - 98, 108, 105, 99, 75, 101, 121, 77, 117, 108, 116, 105, 98, 97, 115, 101, 34, - 58, 34, 56, 114, 110, 81, 52, 103, 118, 116, 69, 89, 105, 53, 57, 68, 77, 65, - 122, 78, 55, 70, 121, 67, 86, 97, 116, 86, 65, 84, 107, 70, 111, 55, 119, 80, - 88, 86, 77, 121, 51, 56, 87, 109, 118, 71, 34, 44, 34, 116, 121, 112, 101, 34, - 58, 34, 69, 100, 50, 53, 53, 49, 57, 86, 101, 114, 105, 102, 105, 99, 97, 116, - 105, 111, 110, 75, 101, 121, 50, 48, 49, 56, 34, 125, 44, 123, 34, 99, 111, - 110, 116, 114, 111, 108, 108, 101, 114, 34, 58, 34, 100, 105, 100, 58, 105, - 110, 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, - 115, 122, 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, - 119, 34, 44, 34, 105, 100, 34, 58, 34, 100, 105, 100, 58, 105, 110, 100, 121, - 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, 115, 122, 107, - 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, 119, 35, 75, 69, - 89, 45, 50, 34, 44, 34, 112, 117, 98, 108, 105, 99, 75, 101, 121, 77, 117, 108, - 116, 105, 98, 97, 115, 101, 34, 58, 34, 78, 97, 113, 83, 50, 113, 83, 76, 90, - 84, 74, 99, 117, 75, 76, 118, 70, 65, 111, 66, 83, 101, 82, 70, 88, 101, 105, - 118, 68, 102, 121, 111, 85, 113, 118, 83, 115, 56, 68, 81, 52, 97, 106, 121, - 100, 122, 52, 75, 98, 85, 118, 84, 54, 118, 100, 74, 121, 122, 56, 105, 57, - 103, 74, 69, 113, 71, 106, 70, 107, 67, 78, 50, 55, 110, 105, 90, 104, 111, 65, - 98, 81, 76, 103, 107, 51, 105, 109, 110, 34, 44, 34, 116, 121, 112, 101, 34, - 58, 34, 69, 99, 100, 115, 97, 83, 101, 99, 112, 50, 53, 54, 107, 49, 86, 101, - 114, 105, 102, 105, 99, 97, 116, 105, 111, 110, 75, 101, 121, 50, 48, 49, 57, - 34, 125, 93, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, - ], - signature: RwLock::new(None), - hash: None, - }; - assert_eq!(expected_transaction, transaction); - } - } - - mod build_resolve_did_transaction { - use super::*; - - #[async_std::test] - async fn build_resolve_did_transaction_test() { - init_env_logger(); - let client = mock_client(); - let transaction = build_resolve_did_transaction(&client, &DID::from(ISSUER_ID)) - .await - .unwrap(); - let expected_transaction = Transaction { - type_: TransactionType::Read, - from: None, - to: DID_REGISTRY_ADDRESS.clone(), - nonce: None, - chain_id: CHAIN_ID, - data: vec![ - 54, 51, 133, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 100, 105, 100, 58, 105, - 110, 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 51, 76, 112, 106, - 115, 122, 107, 103, 84, 109, 69, 51, 113, 84, 104, 103, 101, 50, 53, 70, 90, - 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - ], - signature: RwLock::new(None), - hash: None, - }; - assert_eq!(expected_transaction, transaction); - } - } - - mod parse_resolve_did_result { - use super::*; - - #[test] - fn parse_resolve_did_result_with_metadata_test() { - init_env_logger(); - let client = mock_client(); - let issuer_did = "did:indy2:testnet:Q6Wvnm4v6ENzRC2mkUPkYR"; - - let data = vec![ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 185, 5, 148, 0, - 220, 208, 81, 88, 255, 216, 202, 9, 41, 55, 152, 157, 210, 123, 59, 220, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 226, 219, 108, 141, 198, 198, 129, 187, 93, 106, - 209, 33, 161, 7, 243, 0, 233, 178, 181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 166, 60, 159, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 166, 60, 159, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2, 25, 123, 34, 64, 99, 111, 110, 116, 101, 120, 116, 34, 58, 91, - 34, 104, 116, 116, 112, 115, 58, 47, 47, 119, 119, 119, 46, 119, 51, 46, 111, 114, - 103, 47, 110, 115, 47, 100, 105, 100, 47, 118, 49, 34, 93, 44, 34, 97, 108, 115, - 111, 75, 110, 111, 119, 110, 65, 115, 34, 58, 91, 93, 44, 34, 97, 115, 115, 101, - 114, 116, 105, 111, 110, 77, 101, 116, 104, 111, 100, 34, 58, 91, 93, 44, 34, 97, - 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 105, 111, 110, 34, 58, 91, 34, 100, - 105, 100, 58, 105, 110, 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, - 81, 54, 87, 118, 110, 109, 52, 118, 54, 69, 78, 122, 82, 67, 50, 109, 107, 85, 80, - 107, 89, 82, 35, 75, 69, 89, 45, 49, 34, 93, 44, 34, 99, 97, 112, 97, 98, 105, 108, - 105, 116, 121, 68, 101, 108, 101, 103, 97, 116, 105, 111, 110, 34, 58, 91, 93, 44, - 34, 99, 97, 112, 97, 98, 105, 108, 105, 116, 121, 73, 110, 118, 111, 99, 97, 116, - 105, 111, 110, 34, 58, 91, 93, 44, 34, 99, 111, 110, 116, 114, 111, 108, 108, 101, - 114, 34, 58, 91, 93, 44, 34, 105, 100, 34, 58, 34, 100, 105, 100, 58, 105, 110, - 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 81, 54, 87, 118, 110, 109, - 52, 118, 54, 69, 78, 122, 82, 67, 50, 109, 107, 85, 80, 107, 89, 82, 34, 44, 34, - 107, 101, 121, 65, 103, 114, 101, 101, 109, 101, 110, 116, 34, 58, 91, 93, 44, 34, - 115, 101, 114, 118, 105, 99, 101, 34, 58, 91, 93, 44, 34, 118, 101, 114, 105, 102, - 105, 99, 97, 116, 105, 111, 110, 77, 101, 116, 104, 111, 100, 34, 58, 91, 123, 34, - 99, 111, 110, 116, 114, 111, 108, 108, 101, 114, 34, 58, 34, 100, 105, 100, 58, - 105, 110, 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, 116, 58, 81, 54, 87, 118, - 110, 109, 52, 118, 54, 69, 78, 122, 82, 67, 50, 109, 107, 85, 80, 107, 89, 82, 34, - 44, 34, 105, 100, 34, 58, 34, 100, 105, 100, 58, 105, 110, 100, 121, 50, 58, 116, - 101, 115, 116, 110, 101, 116, 58, 81, 54, 87, 118, 110, 109, 52, 118, 54, 69, 78, - 122, 82, 67, 50, 109, 107, 85, 80, 107, 89, 82, 35, 75, 69, 89, 45, 49, 34, 44, 34, - 112, 117, 98, 108, 105, 99, 75, 101, 121, 77, 117, 108, 116, 105, 98, 97, 115, 101, - 34, 58, 34, 122, 65, 75, 74, 80, 51, 102, 55, 66, 68, 54, 87, 52, 105, 87, 69, 81, - 57, 106, 119, 110, 100, 86, 84, 67, 66, 113, 56, 117, 97, 50, 85, 116, 116, 56, 69, - 69, 106, 74, 54, 86, 120, 115, 102, 34, 44, 34, 116, 121, 112, 101, 34, 58, 34, 69, - 100, 50, 53, 53, 49, 57, 86, 101, 114, 105, 102, 105, 99, 97, 116, 105, 111, 110, - 75, 101, 121, 50, 48, 49, 56, 34, 125, 93, 125, 0, 0, 0, 0, 0, 0, 0, - ]; - let parsed_did_doc = parse_resolve_did_result(&client, &data).unwrap(); - assert_eq!(did_doc(Some(issuer_did)), parsed_did_doc); - } - } -} diff --git a/vdr/src/contracts/did/mod.rs b/vdr/src/contracts/did/mod.rs index a0beec66..93b6289c 100644 --- a/vdr/src/contracts/did/mod.rs +++ b/vdr/src/contracts/did/mod.rs @@ -1,5 +1,7 @@ -pub mod did_registry; +pub mod did_ethr_registry; pub mod types; -pub use did_registry::*; -pub use types::{did_doc::*, did_doc_builder::*}; +pub(crate) mod did_ethr_resolver; + +pub use did_ethr_registry::*; +pub use types::{did::DID, did_doc::*, did_doc_attribute::*}; diff --git a/vdr/src/contracts/did/types/did.rs b/vdr/src/contracts/did/types/did.rs index d5a6e21a..d10227d9 100644 --- a/vdr/src/contracts/did/types/did.rs +++ b/vdr/src/contracts/did/types/did.rs @@ -1,20 +1,18 @@ -use crate::ContractParam; +use crate::{ContractParam, VdrError}; use serde_derive::{Deserialize, Serialize}; +pub const DID_PREFIX: &str = "did"; + #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] pub struct DID(String); impl DID { - pub const DID_PREFIX: &'static str = "did"; - - pub fn build(method: &str, network: &str, id: &str) -> DID { - DID::from(format!("{}:{}:{}:{}", Self::DID_PREFIX, method, network, id).as_str()) - } -} - -impl From<&DID> for ContractParam { - fn from(id: &DID) -> Self { - ContractParam::String(id.to_string()) + pub fn build(method: &str, network: Option<&str>, id: &str) -> DID { + if let Some(network) = network { + DID(format!("{}:{}:{}:{}", DID_PREFIX, method, network, id)) + } else { + DID(format!("{}:{}:{}", DID_PREFIX, method, id)) + } } } @@ -35,3 +33,45 @@ impl ToString for DID { self.0.to_string() } } + +impl TryFrom<&DID> for ContractParam { + type Error = VdrError; + + fn try_from(value: &DID) -> Result { + Ok(ContractParam::String(value.to_string())) + } +} + +#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +pub(crate) struct ParsedDid { + pub(crate) method: String, + pub(crate) network: Option, + pub(crate) identifier: String, +} + +impl ParsedDid { + pub(crate) fn as_short_did(&self) -> DID { + DID::from(format!("{}:{}:{}", DID_PREFIX, self.method, self.identifier).as_str()) + } +} + +impl TryFrom<&DID> for ParsedDid { + type Error = VdrError; + + fn try_from(did: &DID) -> Result { + let parts = did.as_ref().split(':').collect::>(); + match parts.len() { + 3 => Ok(ParsedDid { + method: parts[1].to_string(), + network: None, + identifier: parts[2].to_string(), + }), + 4 => Ok(ParsedDid { + method: parts[1].to_string(), + network: Some(parts[2].to_string()), + identifier: parts[3].to_string(), + }), + _ => Err(VdrError::ContractInvalidInputData), + } + } +} diff --git a/vdr/src/contracts/did/types/did_doc.rs b/vdr/src/contracts/did/types/did_doc.rs index e89b15a9..2f1d990c 100644 --- a/vdr/src/contracts/did/types/did_doc.rs +++ b/vdr/src/contracts/did/types/did_doc.rs @@ -1,21 +1,36 @@ -use crate::{ - error::VdrError, - types::{ContractOutput, ContractParam}, - Address, -}; +use crate::{error::VdrError, Block}; use crate::contracts::did::types::did::DID; -use log::trace; +use log::warn; use serde_derive::{Deserialize, Serialize}; -use serde_json::{json, Value}; -pub const CONTEXT: &str = "https://www.w3.org/ns/did/v1"; +pub const BASE_CONTEXT: &str = "https://www.w3.org/ns/did/v1"; +pub const SECPK_CONTEXT: &str = "https://w3id.org/security/suites/secp256k1recovery-2020/v2"; +pub const KEYS_CONTEXT: &str = "https://w3id.org/security/v3-unstable"; +pub const DID_RESOLUTION_FORMAT: &str = "application/did+ld+json"; -#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct DidDocumentWithMeta { + #[serde(skip_serializing_if = "Option::is_none")] + pub did_document: Option, + pub did_document_metadata: DidMetadata, + pub did_resolution_metadata: DidResolutionMetadata, +} + +#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct DidResolutionMetadata { + pub content_type: Option, + pub error: Option, + pub message: Option, +} + +#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] -pub struct DidRecord { - pub document: DidDocument, - pub metadata: DidMetadata, +pub struct DidResolutionOptions { + pub accept: Option, + pub block_tag: Option, } #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] @@ -24,24 +39,42 @@ pub struct DidDocument { #[serde(rename = "@context")] pub context: StringOrVector, pub id: DID, - pub controller: StringOrVector, + #[serde(skip_serializing_if = "Option::is_none")] + pub controller: Option, pub verification_method: Vec, + #[serde(default)] pub authentication: Vec, + #[serde(default)] pub assertion_method: Vec, + #[serde(skip_serializing_if = "Vec::is_empty")] + #[serde(default)] pub capability_invocation: Vec, + #[serde(skip_serializing_if = "Vec::is_empty")] + #[serde(default)] pub capability_delegation: Vec, + #[serde(skip_serializing_if = "Vec::is_empty")] + #[serde(default)] pub key_agreement: Vec, + #[serde(skip_serializing_if = "Vec::is_empty")] + #[serde(default)] pub service: Vec, + #[serde(skip_serializing_if = "Option::is_none")] pub also_known_as: Option>, } -#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] pub struct DidMetadata { - pub owner: Address, - pub sender: Address, - pub created: u64, - pub updated: u64, - pub deactivated: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub deactivated: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub version_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub updated: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub next_version_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub next_update: Option, } #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] @@ -52,9 +85,15 @@ pub struct VerificationMethod { pub type_: VerificationKeyType, pub controller: String, #[serde(skip_serializing_if = "Option::is_none")] + pub blockchain_account_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub public_key_multibase: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub public_key_jwk: Option, + pub public_key_hex: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub public_key_base58: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub public_key_base64: Option, } #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] @@ -66,6 +105,68 @@ pub enum VerificationKeyType { X25519KeyAgreementKey2020, JsonWebKey2020, EcdsaSecp256k1VerificationKey2019, + EcdsaSecp256k1VerificationKey2020, + EcdsaSecp256k1RecoveryMethod2020, +} + +impl ToString for VerificationKeyType { + fn to_string(&self) -> String { + match self { + VerificationKeyType::Ed25519VerificationKey2018 => { + "Ed25519VerificationKey2018".to_string() + } + VerificationKeyType::X25519KeyAgreementKey2019 => { + "X25519KeyAgreementKey2019".to_string() + } + VerificationKeyType::Ed25519VerificationKey2020 => { + "Ed25519VerificationKey2020".to_string() + } + VerificationKeyType::X25519KeyAgreementKey2020 => { + "X25519KeyAgreementKey2020".to_string() + } + VerificationKeyType::JsonWebKey2020 => "JsonWebKey2020".to_string(), + VerificationKeyType::EcdsaSecp256k1VerificationKey2019 + | VerificationKeyType::EcdsaSecp256k1VerificationKey2020 => { + "EcdsaSecp256k1VerificationKey2019".to_string() + } + VerificationKeyType::EcdsaSecp256k1RecoveryMethod2020 => { + "EcdsaSecp256k1RecoveryMethod2020".to_string() + } + } + } +} + +impl TryFrom<&str> for VerificationKeyType { + type Error = VdrError; + + fn try_from(value: &str) -> Result { + match value { + "Ed25519VerificationKey2018" => Ok(VerificationKeyType::Ed25519VerificationKey2018), + "X25519KeyAgreementKey2019" => Ok(VerificationKeyType::X25519KeyAgreementKey2019), + "Ed25519VerificationKey2020" => Ok(VerificationKeyType::Ed25519VerificationKey2020), + "X25519KeyAgreementKey2020" => Ok(VerificationKeyType::X25519KeyAgreementKey2020), + "JsonWebKey2020" => Ok(VerificationKeyType::JsonWebKey2020), + "EcdsaSecp256k1RecoveryMethod2020" => { + Ok(VerificationKeyType::EcdsaSecp256k1RecoveryMethod2020) + } + "EcdsaSecp256k1VerificationKey2019" => { + Ok(VerificationKeyType::EcdsaSecp256k1VerificationKey2020) + } + _type => Err({ + let vdr_error = VdrError::CommonInvalidData(format!( + "Unexpected verification key type {}", + _type + )); + + warn!( + "Error: {} during converting VerificationKeyType from String: {} ", + vdr_error, value + ); + + vdr_error + }), + } + } } #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] @@ -109,143 +210,52 @@ pub enum StringOrVector { impl Default for StringOrVector { fn default() -> Self { - let vector = StringOrVector::Vector(Vec::new()); - - trace!("Created new StringOrVector::Vector: {:?}", vector); - - vector - } -} - -impl From<&DidDocument> for ContractParam { - fn from(value: &DidDocument) -> Self { - trace!( - "DidDocument: {:?} convert into ContractParam has started", - value - ); - - let did_doc_contract_param = ContractParam::String(json!(value).to_string()); - - trace!( - "DidDocument convert into ContractParam has finished. Result: {:?}", - did_doc_contract_param - ); - - did_doc_contract_param - } -} - -impl TryFrom<&ContractOutput> for DidDocument { - type Error = VdrError; - - fn try_from(value: &ContractOutput) -> Result { - trace!( - "DidDocument convert from ContractOutput: {:?} has started", - value - ); - - let did_doc = serde_json::from_str(&value.get_string(0)?).map_err(|err| { - VdrError::ContractInvalidResponseData(format!( - "Unable to parse DID Document from the response. Err: {:?}", - err - )) - })?; - - trace!( - "DidDocument convert from ContractOutput has finished. Result: {:?}", - did_doc - ); - - Ok(did_doc) - } -} - -impl TryFrom for DidMetadata { - type Error = VdrError; - - fn try_from(value: ContractOutput) -> Result { - trace!( - "DidMetadata convert from ContractOutput: {:?} has started", - value - ); - - let owner = value.get_address(0)?; - let sender = value.get_address(1)?; - let created = value.get_u128(2)? as u64; - let updated = value.get_u128(3)? as u64; - let deactivated = value.get_bool(4)?; - - let did_metadata = DidMetadata { - owner, - sender, - created, - updated, - deactivated, - }; - - trace!( - "DidMetadata convert from ContractOutput has finished. Result: {:?}", - did_metadata - ); - - Ok(did_metadata) + StringOrVector::Vector(Vec::new()) } } -impl TryFrom for DidRecord { - type Error = VdrError; - - fn try_from(value: ContractOutput) -> Result { - trace!( - "DidDocumentWithMeta convert from ContractOutput: {:?} has started", - value - ); - - let output_tuple = value.get_tuple(0)?; - let document = DidDocument::try_from(&output_tuple)?; - let metadata = output_tuple.get_tuple(1)?; - - let did_doc_with_metadata = DidRecord { - document, - metadata: DidMetadata::try_from(metadata)?, - }; - - trace!( - "DidDocumentWithMeta convert from ContractOutput has finished. Result: {:?}", - did_doc_with_metadata - ); - - Ok(did_doc_with_metadata) - } +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +pub enum DidResolutionError { + /* + * The resolver has failed to construct the DID document. + * This can be caused by a network issue, a wrong registry address or malformed logs while parsing the registry + * history. Please inspect the `DIDResolutionMetadata.message` to debug further. + */ + #[serde(rename = "notFound")] + NotFound, + /* + * The resolver does not know how to resolve the given DID. Most likely it is not a `did:ethr`. + */ + #[serde(rename = "invalidDid")] + InvalidDid, + /* + * The resolver does not support the 'accept' format requested with `DidResolutionOptions`. + */ + #[serde(rename = "representationNotSupported")] + RepresentationNotSupported, + /* + * If an invalid DID URL is detected + */ + #[serde(rename = "invalidDidUrl")] + InvalidDidUrl, + /* + * DID method is not supported + */ + #[serde(rename = "methodNotSupported")] + MethodNotSupported, } #[cfg(test)] pub mod test { use super::*; - use crate::utils::rand_bytes; - - pub const ISSUER_ID: &str = "did:indy2:testnet:3LpjszkgTmE3qThge25FZw"; - pub const CONTEXT: &str = "https://www.w3.org/ns/did/v1"; - pub const MULTIBASE_KEY: &str = "zAKJP3f7BD6W4iWEQ9jwndVTCBq8ua2Utt8EEjJ6Vxsf"; - pub const SERVICE_ENDPOINT: &str = "127.0.0.1:5555"; - pub const SERVICE_TYPE: &str = "DIDCommService"; - pub const KEY_1: &str = "KEY-1"; - - pub fn verification_method(id: &str) -> VerificationMethod { - VerificationMethod { - id: format!("{}#{}", id, KEY_1), - type_: VerificationKeyType::Ed25519VerificationKey2018, - controller: id.to_string(), - public_key_multibase: Some(MULTIBASE_KEY.to_string()), - public_key_jwk: None, - } - } + use serde_json::json; - pub fn verification_relationship(id: &str) -> VerificationMethodOrReference { - VerificationMethodOrReference::String(format!("{}#{}", id, KEY_1)) - } + pub const TEST_DID_ETHR: &str = "did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a"; + pub const ISSUER_ID: &str = "did:ethr:testnet:0xf0e2db6c8dc6c681bb5d6ad121a107f300e9b2b5"; + pub const SERVICE_ENDPOINT: &str = "http://example.com"; + pub const SERVICE_TYPE: &str = "Service"; - pub fn service(id: &str) -> Service { + pub fn _service(id: &str) -> Service { Service { id: id.to_string(), type_: SERVICE_TYPE.to_string(), @@ -253,52 +263,34 @@ pub mod test { } } - pub fn new_id() -> String { - format!( - "did:indy2:testnet:{}", - &bs58::encode(rand_bytes()).into_string() - ) - } - - pub fn did_doc(id: Option<&str>) -> DidDocument { - let id = id.map(String::from).unwrap_or_else(new_id); - DidDocument { - context: StringOrVector::Vector(vec![CONTEXT.to_string()]), - id: DID::from(id.as_str()), - controller: StringOrVector::Vector(vec![]), - verification_method: vec![verification_method(&id)], - authentication: vec![verification_relationship(&id)], - assertion_method: vec![], - capability_invocation: vec![], - capability_delegation: vec![], - key_agreement: vec![], - service: vec![], - also_known_as: Some(vec![]), - } - } - - fn did_doc_param() -> ContractParam { - ContractParam::String(json!(did_doc(Some(ISSUER_ID))).to_string()) - } - - mod convert_into_contract_param { - use super::*; - - #[test] - fn convert_did_doc_into_contract_param_test() { - let param: ContractParam = (&did_doc(Some(ISSUER_ID))).into(); - assert_eq!(did_doc_param(), param); - } - } - - mod convert_into_object { - use super::*; - - #[test] - fn convert_contract_output_into_did_doc() { - let data = ContractOutput::new(vec![did_doc_param()]); - let converted = DidDocument::try_from(&data).unwrap(); - assert_eq!(did_doc(Some(ISSUER_ID)), converted); - } + pub fn default_ethr_did_document(chain_id: Option) -> DidDocument { + let chain_id = chain_id.unwrap_or(1); + let blockchain_account_id = format!( + "eip155:{}:0xb9c5714089478a327f09197987f16f9e5d936e8a", + chain_id + ); + serde_json::from_value(json!({ + "@context": [ + "https://www.w3.org/ns/did/v1", + "https://w3id.org/security/suites/secp256k1recovery-2020/v2", + "https://w3id.org/security/v3-unstable" + ], + "id": "did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a", + "verificationMethod": [ + { + "id": "did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller", + "type": "EcdsaSecp256k1RecoveryMethod2020", + "controller": "did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a", + "blockchainAccountId": blockchain_account_id + } + ], + "authentication": [ + "did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller" + ], + "assertionMethod": [ + "did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller" + ] + })) + .unwrap() } } diff --git a/vdr/src/contracts/did/types/did_doc_attribute.rs b/vdr/src/contracts/did/types/did_doc_attribute.rs new file mode 100644 index 00000000..cd8913db --- /dev/null +++ b/vdr/src/contracts/did/types/did_doc_attribute.rs @@ -0,0 +1,401 @@ +use crate::{ + contracts::{ + did::types::did_events::{DidAttributeChanged, DidEvents}, + ServiceEndpoint, + }, + types::ContractParam, + utils::{format_bytes32_string, parse_bytes32_string}, + VdrError, VdrResult, VerificationKeyType, +}; +use base64::Engine; +use ethabi::Uint; +use serde_derive::{Deserialize, Serialize}; +use serde_json::json; +use std::str::from_utf8; + +#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct PublicKeyAttribute { + pub purpose: PublicKeyPurpose, + #[serde(rename = "type")] + pub type_: PublicKeyType, + #[serde(skip_serializing_if = "Option::is_none")] + pub public_key_hex: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub public_key_base64: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub public_key_base58: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub public_key_pem: Option, +} + +impl PublicKeyAttribute { + pub fn encoding(&self) -> VdrResult<&str> { + if self.public_key_base58.is_some() { + return Ok("base58"); + } + if self.public_key_hex.is_some() { + return Ok("hex"); + } + if self.public_key_base64.is_some() { + return Ok("base64"); + } + Err(VdrError::ContractInvalidInputData) + } + + pub fn value(&self) -> VdrResult> { + if let Some(ref public_key_base58) = self.public_key_base58 { + return bs58::decode(&public_key_base58).into_vec().map_err(|err| { + VdrError::CommonInvalidData(format!( + "Unable to decode base58 public key. Err: {:?}", + err + )) + }); + } + if let Some(ref public_key_hex) = self.public_key_hex { + return hex::decode(public_key_hex).map_err(|err| { + VdrError::CommonInvalidData(format!( + "Unable to decode hex public key. Err: {:?}", + err + )) + }); + } + if let Some(ref public_key_base64) = self.public_key_base64 { + return base64::engine::general_purpose::URL_SAFE_NO_PAD + .decode(public_key_base64) + .map_err(|err| { + VdrError::CommonInvalidData(format!( + "Unable to decode base64 public key. Err: {:?}", + err + )) + }); + } + Err(VdrError::ContractInvalidInputData) + } +} + +#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +pub enum PublicKeyPurpose { + #[default] + #[serde(rename = "veriKey")] + VeriKey, + #[serde(rename = "sigAuth")] + SigAuth, + #[serde(rename = "enc")] + Enc, +} + +impl AsRef for PublicKeyPurpose { + fn as_ref(&self) -> &str { + match self { + PublicKeyPurpose::VeriKey => "veriKey", + PublicKeyPurpose::SigAuth => "sigAuth", + PublicKeyPurpose::Enc => "enc", + } + } +} + +impl TryFrom<&str> for PublicKeyPurpose { + type Error = VdrError; + + fn try_from(value: &str) -> Result { + match value { + "veriKey" => Ok(PublicKeyPurpose::VeriKey), + "sigAuth" => Ok(PublicKeyPurpose::SigAuth), + "enc" => Ok(PublicKeyPurpose::Enc), + value => Err(VdrError::CommonInvalidData(format!( + "Unexpected public key purpose {}", + value + ))), + } + } +} + +#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +pub enum DelegateType { + #[default] + #[serde(rename = "veriKey")] + VeriKey, + #[serde(rename = "sigAuth")] + SigAuth, +} + +impl AsRef for DelegateType { + fn as_ref(&self) -> &str { + match self { + DelegateType::VeriKey => "veriKey", + DelegateType::SigAuth => "sigAuth", + } + } +} + +impl TryFrom<&str> for DelegateType { + type Error = VdrError; + + fn try_from(value: &str) -> Result { + match value { + "veriKey" => Ok(DelegateType::VeriKey), + "sigAuth" => Ok(DelegateType::SigAuth), + value => Err(VdrError::CommonInvalidData(format!( + "Unexpected public key delegate type {}", + value + ))), + } + } +} + +impl TryFrom<&DelegateType> for ContractParam { + type Error = VdrError; + + fn try_from(value: &DelegateType) -> Result { + let name = format_bytes32_string(value.as_ref())?.to_vec(); + Ok(ContractParam::FixedBytes(name)) + } +} + +impl TryFrom<&[u8]> for DelegateType { + type Error = VdrError; + + fn try_from(value: &[u8]) -> Result { + let str = parse_bytes32_string(value)?; + Self::try_from(str) + } +} + +#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +pub enum PublicKeyType { + #[default] + Ed25519VerificationKey2020, + X25519KeyAgreementKey2020, + EcdsaSecp256k1VerificationKey2020, +} + +impl PublicKeyType { + pub fn to_name(&self) -> &str { + match self { + PublicKeyType::EcdsaSecp256k1VerificationKey2020 => "Secp256k1", + PublicKeyType::Ed25519VerificationKey2020 => "Ed25519", + PublicKeyType::X25519KeyAgreementKey2020 => "X25519", + } + } + + pub fn from_name(name: &str) -> VdrResult { + match name { + "Secp256k1" => Ok(PublicKeyType::EcdsaSecp256k1VerificationKey2020), + "Ed25519" => Ok(PublicKeyType::Ed25519VerificationKey2020), + "X25519" => Ok(PublicKeyType::X25519KeyAgreementKey2020), + value => Err(VdrError::CommonInvalidData(format!( + "Unexpected public key type {}", + value + ))), + } + } +} + +impl From for VerificationKeyType { + fn from(value: PublicKeyType) -> Self { + match value { + PublicKeyType::EcdsaSecp256k1VerificationKey2020 => { + VerificationKeyType::EcdsaSecp256k1VerificationKey2020 + } + PublicKeyType::Ed25519VerificationKey2020 => { + VerificationKeyType::Ed25519VerificationKey2020 + } + PublicKeyType::X25519KeyAgreementKey2020 => { + VerificationKeyType::X25519KeyAgreementKey2020 + } + } + } +} + +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ServiceAttribute { + #[serde(rename = "type")] + pub type_: String, + pub service_endpoint: ServiceEndpoint, +} + +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +#[serde(untagged)] +pub enum DidDocAttribute { + PublicKey(PublicKeyAttribute), + Service(ServiceAttribute), +} + +impl DidDocAttribute { + pub(crate) fn name(&self) -> VdrResult { + match self { + DidDocAttribute::PublicKey(key) => { + let key_encoding = key.encoding()?; + Ok(DidDocAttributeName(format!( + "did/pub/{}/{}/{}", + key.type_.to_name(), + key.purpose.as_ref(), + key_encoding + ))) + } + DidDocAttribute::Service(service) => { + Ok(DidDocAttributeName(format!("did/svc/{}", service.type_))) + } + } + } + + pub(crate) fn value(&self) -> VdrResult { + match self { + DidDocAttribute::PublicKey(key) => Ok(DidDocAttributeValue(key.value()?)), + DidDocAttribute::Service(ref service) => { + let value = match &service.service_endpoint { + ServiceEndpoint::String(endpoint) => endpoint.to_string(), + service => json!(service).to_string(), + }; + Ok(DidDocAttributeValue(value.as_bytes().to_vec())) + } + } + } +} + +impl TryFrom for DidDocAttribute { + type Error = VdrError; + + fn try_from(value: DidEvents) -> Result { + match value { + DidEvents::AttributeChangedEvent(event) => { + DidDocAttribute::try_from(&event).map_err(VdrError::from) + } + _ => Err(VdrError::CommonInvalidData( + "Unable to get DidDocAttribute from event.".to_string(), + )), + } + } +} + +impl TryFrom<&DidAttributeChanged> for DidDocAttribute { + type Error = VdrError; + + fn try_from(event: &DidAttributeChanged) -> Result { + let parts: Vec<&str> = event.name.split('/').collect(); + + let kind = parts.get(1).ok_or_else(|| { + VdrError::CommonInvalidData( + "Unable to convert DIDAttributeChangedEvent into DidDocAttribute".to_string(), + ) + })?; + + match *kind { + "pub" => { + // key attribute + let type_ = parts.get(2).ok_or_else(|| VdrError::CommonInvalidData( + format!("Unable to convert DIDAttributeChangedEvent into public key DidDocAttribute. `type` not found {}", event.name) + ))?; + let purpose = parts.get(3).ok_or_else(|| VdrError::CommonInvalidData( + format!("Unable to convert DIDAttributeChangedEvent into public key DidDocAttribute. `purpose` not found {}", event.name) + ))?; + let encoding = parts.get(4).ok_or_else(|| VdrError::CommonInvalidData( + format!("Unable to convert DIDAttributeChangedEvent into public key DidDocAttribute. `encoding` not found {}", event.name) + ))?; + + let mut public_key = PublicKeyAttribute { + purpose: PublicKeyPurpose::try_from(*purpose)?, + type_: PublicKeyType::from_name(type_)?, + public_key_hex: None, + public_key_base64: None, + public_key_base58: None, + public_key_pem: None, + }; + + match *encoding { + "base58" => { + public_key.public_key_base58 = + Some(bs58::encode(&event.value).into_string()); + } + "hex" => { + public_key.public_key_hex = Some(hex::encode(&event.value)); + } + "base64" => { + let base64_encoded_key = + base64::engine::general_purpose::URL_SAFE_NO_PAD.encode(&event.value); + public_key.public_key_base64 = Some(base64_encoded_key); + } + value => { + return Err(VdrError::CommonInvalidData( + format!("Unable to convert DIDAttributeChangedEvent into public key DidDocAttribute. `encoding` not found {}", value) + )); + } + } + + Ok(DidDocAttribute::PublicKey(public_key)) + } + "svc" => { + // service attribute + let type_ = parts.get(2).ok_or_else(|| VdrError::CommonInvalidData( + format!("Unable to convert DIDAttributeChangedEvent into service DidDocAttribute. `type` not found {}", event.name) + ))?; + + let value = from_utf8(&event.value) + .map_err(|err| VdrError::CommonInvalidData( + format!("Unable to convert DIDAttributeChangedEvent into service DidDocAttribute. Failed to parse value: {}", err) + ))?; + + let service_endpoint = if value.starts_with('{') { + // if JSON + serde_json::from_slice(&event.value) + .map_err(|err| VdrError::CommonInvalidData( + format!("Unable to convert DIDAttributeChangedEvent into service DidDocAttribute. Failed to parse value: {}", err) + ))? + } else { + ServiceEndpoint::String(value.to_string()) + }; + + Ok(DidDocAttribute::Service(ServiceAttribute { + type_: type_.to_string(), + service_endpoint, + })) + } + val => Err(VdrError::CommonInvalidData(format!( + "Unable to convert DIDAttributeChangedEvent into DidDocAttribute. Unknown kind: {}", + val + ))), + } + } +} + +#[derive(Debug)] +pub(crate) struct DidDocAttributeName(pub(crate) String); + +impl TryFrom<&DidDocAttributeName> for ContractParam { + type Error = VdrError; + + fn try_from(value: &DidDocAttributeName) -> Result { + let name = format_bytes32_string(&value.0)?.to_vec(); + Ok(ContractParam::FixedBytes(name)) + } +} + +#[derive(Debug)] +pub(crate) struct DidDocAttributeValue(pub(crate) Vec); + +impl TryFrom<&DidDocAttributeValue> for ContractParam { + type Error = VdrError; + + fn try_from(value: &DidDocAttributeValue) -> Result { + Ok(ContractParam::Bytes(value.0.to_vec())) + } +} + +#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] +pub struct Validity(pub(crate) u64); + +impl TryFrom<&Validity> for ContractParam { + type Error = VdrError; + + fn try_from(value: &Validity) -> Result { + Ok(ContractParam::Uint(Uint::from(value.0))) + } +} + +impl From for Validity { + fn from(value: u64) -> Self { + Validity(value) + } +} diff --git a/vdr/src/contracts/did/types/did_doc_builder.rs b/vdr/src/contracts/did/types/did_doc_builder.rs index b4ad199a..34860cb6 100644 --- a/vdr/src/contracts/did/types/did_doc_builder.rs +++ b/vdr/src/contracts/did/types/did_doc_builder.rs @@ -1,229 +1,319 @@ -use log::{trace, warn}; -use serde_json::Value; +use log::warn; +use log_derive::{logfn, logfn_inputs}; use crate::{ - contracts::did::types::{ - did::DID, - did_doc::{ + contracts::did::{ + types::did_doc::{ Service, ServiceEndpoint, StringOrVector, VerificationMethod, - VerificationMethodOrReference, CONTEXT, + VerificationMethodOrReference, BASE_CONTEXT, }, + KEYS_CONTEXT, SECPK_CONTEXT, }, error::{VdrError, VdrResult}, - DidDocument, VerificationKeyType, + Address, DidDocument, VerificationKeyType, DID, }; #[derive(Clone, Debug, Default, PartialEq)] pub struct DidDocumentBuilder { - pub context: StringOrVector, - pub id: DID, - pub controller: StringOrVector, - pub verification_method: Vec, - pub authentication: Vec, - pub assertion_method: Vec, - pub capability_invocation: Vec, - pub capability_delegation: Vec, - pub key_agreement: Vec, - pub service: Vec, - pub also_known_as: Option>, + context: StringOrVector, + id: DID, + controller: Option, + verification_method: Vec<(String, VerificationMethod)>, + authentication: Vec<(String, VerificationMethodOrReference)>, + assertion_method: Vec<(String, VerificationMethodOrReference)>, + capability_invocation: Vec<(String, VerificationMethodOrReference)>, + capability_delegation: Vec<(String, VerificationMethodOrReference)>, + key_agreement: Vec<(String, VerificationMethodOrReference)>, + service: Vec<(String, Service)>, + also_known_as: Option>, + deactivated: bool, + key_index: u32, + service_index: u32, } impl DidDocumentBuilder { + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn new() -> DidDocumentBuilder { - let did_doc_builder = DidDocumentBuilder { - context: StringOrVector::String(CONTEXT.to_string()), + DidDocumentBuilder { + context: StringOrVector::String(BASE_CONTEXT.to_string()), ..DidDocumentBuilder::default() - }; + } + } - trace!("Created newDidDocumentBuilder: {:?}", did_doc_builder); + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn base_for_did(did: &DID, chain_id: u64) -> VdrResult { + let identity = Address::try_from(did)?; + let kid = "controller"; + let id = format!("{}#controller", did.as_ref()); + + let mut did_doc_builder = DidDocumentBuilder::new(); + did_doc_builder.add_context(SECPK_CONTEXT); + did_doc_builder.add_context(KEYS_CONTEXT); + did_doc_builder.set_id(did); + did_doc_builder.add_verification_method( + kid, + &id, + &VerificationKeyType::EcdsaSecp256k1RecoveryMethod2020, + Some(identity.as_blockchain_id(chain_id).as_str()), + None, + None, + None, + None, + ); + did_doc_builder.add_authentication_reference(kid)?; + did_doc_builder.add_assertion_method_reference(kid)?; + Ok(did_doc_builder) + } - did_doc_builder + #[logfn_inputs(Trace)] + pub fn add_context(&mut self, context: &str) { + match self.context { + StringOrVector::String(ref base_context) => { + self.context = + StringOrVector::Vector(vec![base_context.to_string(), context.to_string()]) + } + StringOrVector::Vector(ref mut contexts) => contexts.push(context.to_string()), + }; } - pub fn set_id(mut self, id: &DID) -> DidDocumentBuilder { + #[logfn_inputs(Trace)] + pub fn set_id(&mut self, id: &DID) { self.id = id.to_owned(); - - trace!("Set id: {} to DidDocumentBuilder: {:?}", id.as_ref(), self); - - self } - pub fn set_controller(mut self, controller: &str) -> DidDocumentBuilder { - self.controller = StringOrVector::String(controller.to_string()); - - trace!( - "Set controller: {} to DidDocumentBuilder: {:?}", - controller, - self - ); - - self + #[logfn_inputs(Trace)] + pub fn set_controller(&mut self, controller: &str) { + self.controller = Some(StringOrVector::String(controller.to_string())); } + #[logfn_inputs(Trace)] + #[allow(clippy::too_many_arguments)] pub fn add_verification_method( - mut self, - type_: VerificationKeyType, - controller: &DID, - public_key_multibase: Option, - public_key_jwk: Option, - ) -> DidDocumentBuilder { - let id = format!( - "{}:KEY-{}", - self.id.as_ref(), - self.verification_method.len() + 1 - ); + &mut self, + key: &str, + id: &str, + type_: &VerificationKeyType, + blockchain_account_id: Option<&str>, + public_key_multibase: Option<&str>, + public_key_hex: Option<&str>, + public_key_base58: Option<&str>, + public_key_base64: Option<&str>, + ) { let verification_method = VerificationMethod { - id, - type_, - controller: controller.to_string(), - public_key_multibase, - public_key_jwk, + id: id.to_string(), + type_: type_.to_owned(), + controller: self.id.to_string(), + blockchain_account_id: blockchain_account_id.map(String::from), + public_key_multibase: public_key_multibase.map(String::from), + public_key_hex: public_key_hex.map(String::from), + public_key_base58: public_key_base58.map(String::from), + public_key_base64: public_key_base64.map(String::from), }; - self.verification_method.push(verification_method.clone()); - - trace!( - "Added VerificationMethod: {:?} to DidDocumentBuilder: {:?}", - verification_method, - self - ); + self.verification_method + .push((key.to_string(), verification_method)); + } - self + #[logfn_inputs(Trace)] + #[allow(clippy::too_many_arguments)] + pub fn add_delegate_key( + &mut self, + key: &str, + type_: &VerificationKeyType, + blockchain_account_id: Option<&str>, + public_key_multibase: Option<&str>, + public_key_hex: Option<&str>, + public_key_base58: Option<&str>, + public_key_base64: Option<&str>, + ) { + self.key_index += 1; + let id = format!("{}#delegate-{}", self.id.as_ref(), self.key_index); + let verification_method = VerificationMethod { + id, + type_: type_.to_owned(), + controller: self.id.to_string(), + blockchain_account_id: blockchain_account_id.map(String::from), + public_key_multibase: public_key_multibase.map(String::from), + public_key_hex: public_key_hex.map(String::from), + public_key_base58: public_key_base58.map(String::from), + public_key_base64: public_key_base64.map(String::from), + }; + self.verification_method + .push((key.to_string(), verification_method)); } - pub fn add_authentication_reference(mut self, index: usize) -> VdrResult { - let kid = self + #[logfn_inputs(Trace)] + pub fn remove_delegate_key(&mut self, key: &str) -> VdrResult<()> { + // revocation is counted as an event, so we need to increment index + self.key_index += 1; + let index = self .verification_method - .get(index) + .iter() + .position(|(k, _)| k == key) .ok_or_else(|| { - let vdr_error = - VdrError::CommonInvalidData("Missing verification method".to_string()); - - warn!( - "Error: {} during getting verification method by index: {} from DidDocumentBuilder: {:?}", - vdr_error, index, self - ); - - vdr_error - })? - .id - .to_string(); - let auth_reference = VerificationMethodOrReference::String(kid); - self.authentication.push(auth_reference.clone()); - - trace!( - "Added authentication reference: {:?} to DidDocumentBuilder: {:?}", - auth_reference, - self - ); + VdrError::CommonInvalidData(format!("Unable to find key for id: {}", key)) + })?; + self.verification_method.remove(index); + Ok(()) + } - Ok(self) + #[logfn_inputs(Trace)] + pub fn add_authentication_reference(&mut self, key: &str) -> VdrResult<()> { + let verification_method = Self::get_verification_method(self, key)?; + let auth_reference = + VerificationMethodOrReference::String(verification_method.id.to_string()); + self.authentication.push((key.to_string(), auth_reference)); + Ok(()) } - pub fn add_assertion_method_reference(mut self, index: usize) -> VdrResult { - let kid = Self::get_kid_by_index(&self, index)?; - let assertion_reference = VerificationMethodOrReference::String(kid); - self.assertion_method.push(assertion_reference.clone()); + #[logfn_inputs(Trace)] + pub fn remove_authentication_reference(&mut self, key: &str) -> VdrResult<()> { + let index = self + .authentication + .iter() + .position(|(k, _)| k == key) + .ok_or_else(|| { + VdrError::CommonInvalidData(format!("Unable to find key reference for id: {}", key)) + })?; + self.authentication.remove(index); + Ok(()) + } - trace!( - "Added assertion method reference: {:?} to DidDocumentBuilder: {:?}", - assertion_reference, - self - ); + #[logfn_inputs(Trace)] + pub fn add_assertion_method_reference(&mut self, key: &str) -> VdrResult<()> { + let verification_method = Self::get_verification_method(self, key)?; + let assertion_reference = + VerificationMethodOrReference::String(verification_method.id.to_string()); + self.assertion_method + .push((key.to_string(), assertion_reference)); + Ok(()) + } - Ok(self) + #[logfn_inputs(Trace)] + pub fn remove_assertion_method_reference(&mut self, key: &str) -> VdrResult<()> { + let index = self + .assertion_method + .iter() + .position(|(k, _)| k == key) + .ok_or_else(|| { + VdrError::CommonInvalidData(format!("Unable to find key reference for id: {}", key)) + })?; + self.assertion_method.remove(index); + Ok(()) } - pub fn add_capability_invocation_reference( - mut self, - index: usize, - ) -> VdrResult { - let kid = Self::get_kid_by_index(&self, index)?; - let capability_invocation_reference = VerificationMethodOrReference::String(kid); + #[logfn_inputs(Trace)] + pub fn add_capability_invocation_reference(&mut self, key: &str) -> VdrResult<()> { + let verification_method = Self::get_verification_method(self, key)?; + let capability_invocation_reference = + VerificationMethodOrReference::String(verification_method.id.to_string()); self.capability_invocation - .push(capability_invocation_reference.clone()); - - trace!( - "Added capability invocation reference: {:?} to DidDocumentBuilder: {:?}", - capability_invocation_reference, - self - ); + .push((key.to_string(), capability_invocation_reference)); + Ok(()) + } - Ok(self) + #[logfn_inputs(Trace)] + pub fn remove_capability_invocation_reference(&mut self, key: &str) -> VdrResult<()> { + let index = self + .capability_invocation + .iter() + .position(|(k, _)| k == key) + .ok_or_else(|| { + VdrError::CommonInvalidData(format!("Unable to find key reference for id: {}", key)) + })?; + self.capability_invocation.remove(index); + Ok(()) } - pub fn add_capability_delegation_reference( - mut self, - index: usize, - ) -> VdrResult { - let kid = Self::get_kid_by_index(&self, index)?; - let capability_delegation_reference = VerificationMethodOrReference::String(kid); + #[logfn_inputs(Trace)] + pub fn add_capability_delegation_reference(&mut self, key: &str) -> VdrResult<()> { + let verification_method = Self::get_verification_method(self, key)?; + let capability_delegation_reference = + VerificationMethodOrReference::String(verification_method.id.to_string()); self.capability_delegation - .push(capability_delegation_reference.clone()); - - trace!( - "Added capability delegation reference: {:?} to DidDocumentBuilder: {:?}", - capability_delegation_reference, - self - ); - - Ok(self) + .push((key.to_string(), capability_delegation_reference)); + Ok(()) } - pub fn add_key_agreement_reference(mut self, index: usize) -> VdrResult { - let kid = Self::get_kid_by_index(&self, index)?; - let key_agreement_reference = VerificationMethodOrReference::String(kid); - self.key_agreement.push(key_agreement_reference.clone()); + #[logfn_inputs(Trace)] + pub fn remove_capability_delegation_reference(&mut self, key: &str) -> VdrResult<()> { + let index = self + .capability_delegation + .iter() + .position(|(k, _)| k == key) + .ok_or_else(|| { + VdrError::CommonInvalidData(format!("Unable to find key reference for id: {}", key)) + })?; + self.capability_delegation.remove(index); + Ok(()) + } - trace!( - "Added key agreement reference: {:?} to DidDocumentBuilder: {:?}", - key_agreement_reference, - self - ); + #[logfn_inputs(Trace)] + pub fn add_key_agreement_reference(&mut self, key: &str) -> VdrResult<()> { + let verification_method = Self::get_verification_method(self, key)?; + let key_agreement_reference = + VerificationMethodOrReference::String(verification_method.id.to_string()); + self.key_agreement + .push((key.to_string(), key_agreement_reference)); + Ok(()) + } - Ok(self) + #[logfn_inputs(Trace)] + pub fn remove_key_agreement_reference(&mut self, key: &str) -> VdrResult<()> { + let index = self + .key_agreement + .iter() + .position(|(k, _)| k == key) + .ok_or_else(|| { + VdrError::CommonInvalidData(format!("Unable to find key reference for id: {}", key)) + })?; + self.key_agreement.remove(index); + Ok(()) } - pub fn add_service(mut self, type_: &str, endpoint: &str) -> DidDocumentBuilder { + #[logfn_inputs(Trace)] + pub fn add_service( + &mut self, + key: &str, + id: Option<&str>, + type_: &str, + endpoint: &ServiceEndpoint, + ) { + self.service_index += 1; + let id = id + .map(String::from) + .unwrap_or_else(|| format!("{}#service-{}", self.id.as_ref(), self.service_index)); let service = Service { - id: format!("#inline-{}", self.service.len() + 1), + id, type_: type_.to_string(), - service_endpoint: ServiceEndpoint::String(endpoint.to_string()), + service_endpoint: endpoint.clone(), }; - self.service.push(service.clone()); - - trace!( - "Added service: {:?} to DidDocumentBuilder: {:?}", - service, - self - ); - - self + self.service.push((key.to_string(), service)); } - pub fn build(self) -> DidDocument { - let did_document = DidDocument { - context: self.context, - id: self.id, - controller: self.controller, - verification_method: self.verification_method, - authentication: self.authentication, - assertion_method: self.assertion_method, - capability_invocation: self.capability_invocation, - capability_delegation: self.capability_delegation, - key_agreement: self.key_agreement, - service: self.service, - also_known_as: self.also_known_as, - }; - - trace!("Built DidDocument: {:?}", did_document); - - did_document + #[logfn_inputs(Trace)] + pub fn remove_service(&mut self, key: &str) -> VdrResult<()> { + self.service_index += 1; + let index = self + .service + .iter() + .position(|(k, _)| k == key) + .ok_or_else(|| { + VdrError::CommonInvalidData(format!("Unable to find service for id: {}", key)) + })?; + self.service.remove(index); + Ok(()) } - fn get_kid_by_index(&self, index: usize) -> VdrResult { - let kid = self + #[logfn(Trace)] + #[logfn_inputs(Trace)] + fn get_verification_method(&self, key: &str) -> VdrResult<&VerificationMethod> { + self .verification_method - .get(index) + .iter() + .find(|(k, _)| k == key) + .map(|(_, key)| key) .ok_or_else(|| { let vdr_error = VdrError::CommonInvalidData( @@ -231,15 +321,158 @@ impl DidDocumentBuilder { ); warn!( - "Error: {} during getting verification method by index: {} from DidDocumentBuilder: {:?}", - vdr_error, index, self + "Error: {} during getting verification method by key: {} from DidDocumentBuilder: {:?}", + vdr_error, key, self ); vdr_error - })? - .id - .to_string(); + }) + } + + pub fn deactivate(&mut self) { + self.deactivated = true; + } - Ok(kid) + pub fn deactivated(&self) -> bool { + self.deactivated + } + + #[logfn(Trace)] + pub fn build(self) -> DidDocument { + if self.deactivated { + return DidDocument { + context: StringOrVector::String(BASE_CONTEXT.to_string()), + id: self.id, + ..DidDocument::default() + }; + } + + DidDocument { + context: self.context, + id: self.id, + controller: self.controller, + verification_method: self + .verification_method + .into_iter() + .map(|(_, key)| key) + .collect(), + authentication: self + .authentication + .into_iter() + .map(|(_, key)| key) + .collect(), + assertion_method: self + .assertion_method + .into_iter() + .map(|(_, key)| key) + .collect(), + capability_invocation: self + .capability_invocation + .into_iter() + .map(|(_, key)| key) + .collect(), + capability_delegation: self + .capability_delegation + .into_iter() + .map(|(_, key)| key) + .collect(), + key_agreement: self.key_agreement.into_iter().map(|(_, key)| key).collect(), + service: self.service.into_iter().map(|(_, key)| key).collect(), + also_known_as: self.also_known_as, + } + } +} + +#[cfg(test)] +pub mod test { + use super::*; + use crate::contracts::types::did_doc::test::{ + default_ethr_did_document, SERVICE_ENDPOINT, SERVICE_TYPE, TEST_DID_ETHR, + }; + use serde_json::json; + + const KEY_1_INDEX: &str = "KEY_1"; + const KEY_2_INDEX: &str = "KEY_2"; + const KEY_3_INDEX: &str = "KEY_3"; + const SERVICE_1_INDEX: &str = "SERVICE_1"; + + #[test] + fn build_base_ethr_did_document_test() { + let did_document = DidDocumentBuilder::base_for_did(&DID::from(TEST_DID_ETHR), 1) + .unwrap() + .build(); + assert_eq!(default_ethr_did_document(None), did_document); + } + + #[test] + fn build_did_document_test() { + let mut builder = DidDocumentBuilder::base_for_did(&DID::from(TEST_DID_ETHR), 1).unwrap(); + builder.add_delegate_key( + KEY_1_INDEX, + &VerificationKeyType::EcdsaSecp256k1RecoveryMethod2020, + Some("eip155:1:0x12345678c498d9e26865f34fcaa57dbb935b0d74"), + None, + None, + None, + None, + ); + builder.add_delegate_key( + KEY_2_INDEX, + &VerificationKeyType::X25519KeyAgreementKey2020, + None, + None, + None, + Some("FbQWLPRhTH95MCkQUeFYdiSoQt8zMwetqfWoxqPgaq7x"), + None, + ); + builder.add_delegate_key( + KEY_3_INDEX, + &VerificationKeyType::EcdsaSecp256k1VerificationKey2020, + None, + None, + Some("02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71"), + None, + None, + ); + builder.add_assertion_method_reference(KEY_1_INDEX).unwrap(); + builder.add_assertion_method_reference(KEY_2_INDEX).unwrap(); + builder.add_authentication_reference(KEY_1_INDEX).unwrap(); + builder.add_key_agreement_reference(KEY_3_INDEX).unwrap(); + + builder.add_service( + SERVICE_1_INDEX, + None, + SERVICE_TYPE, + &ServiceEndpoint::String(SERVICE_ENDPOINT.to_string()), + ); + let did_document = builder.build(); + println!("{}", json!(did_document).to_string()); + + assert_eq!(4, did_document.verification_method.len()); + assert_eq!(3, did_document.assertion_method.len()); + assert_eq!(2, did_document.authentication.len()); + assert_eq!(1, did_document.key_agreement.len()); + assert_eq!(1, did_document.service.len()); + + assert_eq!( + format!("{}#controller", TEST_DID_ETHR), + did_document.verification_method[0].id + ); + assert_eq!( + format!("{}#delegate-1", TEST_DID_ETHR), + did_document.verification_method[1].id + ); + assert_eq!( + format!("{}#delegate-2", TEST_DID_ETHR), + did_document.verification_method[2].id + ); + assert_eq!( + format!("{}#delegate-3", TEST_DID_ETHR), + did_document.verification_method[3].id + ); + assert_eq!( + format!("{}#service-1", TEST_DID_ETHR), + did_document.service[0].id + ); } } diff --git a/vdr/src/contracts/did/types/did_events.rs b/vdr/src/contracts/did/types/did_events.rs new file mode 100644 index 00000000..3fee2e37 --- /dev/null +++ b/vdr/src/contracts/did/types/did_events.rs @@ -0,0 +1,132 @@ +use crate::{ + types::{Block, ContractEvent}, + utils::parse_bytes32_string, + Address, VdrError, +}; +use serde_derive::{Deserialize, Serialize}; + +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +pub enum DidEvents { + AttributeChangedEvent(DidAttributeChanged), + DelegateChanged(DidDelegateChanged), + OwnerChanged(DidOwnerChanged), +} + +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct DidAttributeChanged { + pub identity: Address, + pub name: String, + pub value: Vec, + pub valid_to: u64, + pub previous_change: Block, +} + +impl DidAttributeChanged { + pub(crate) fn key(&self) -> String { + format!("DidDocAttribute-{}-{:?}", self.name, self.value) + } +} + +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct DidDelegateChanged { + pub identity: Address, + pub delegate: Address, + pub delegate_type: Vec, + pub valid_to: u64, + pub previous_change: Block, +} + +impl DidDelegateChanged { + pub(crate) fn key(&self) -> String { + format!( + "DelegateChanged-{:?}-{}", + self.delegate_type, + self.delegate.as_ref() + ) + } +} + +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct DidOwnerChanged { + pub identity: Address, + pub owner: Address, + pub previous_change: Block, +} + +impl DidOwnerChanged { + #[allow(unused)] + pub(crate) fn key(&self) -> String { + format!("DidOwnerChanged-{}", self.owner.as_ref()) + } +} + +impl TryFrom for DidAttributeChanged { + type Error = VdrError; + + fn try_from(log: ContractEvent) -> Result { + let identity = log.get_address(0)?; + let name = log.get_fixed_bytes(1)?; + let value = log.get_bytes(2)?; + let valid_to = log.get_uint(3)?; + let previous_change = Block::from(log.get_uint(4)?); + + let name = parse_bytes32_string(name.as_slice())?.to_string(); + + Ok(DidAttributeChanged { + identity, + name, + value, + valid_to, + previous_change, + }) + } +} + +impl TryFrom for DidDelegateChanged { + type Error = VdrError; + + fn try_from(value: ContractEvent) -> Result { + let identity = value.get_address(0)?; + let delegate = value.get_address(1)?; + let delegate_type = value.get_fixed_bytes(2)?; + let valid_to = value.get_uint(3)?; + let previous_change = Block::from(value.get_uint(4)?); + + Ok(DidDelegateChanged { + identity, + delegate, + delegate_type, + valid_to, + previous_change, + }) + } +} + +impl TryFrom for DidOwnerChanged { + type Error = VdrError; + + fn try_from(value: ContractEvent) -> Result { + let identity = value.get_address(0)?; + let owner = value.get_address(1)?; + let previous_change = Block::from(value.get_uint(2)?); + + Ok(DidOwnerChanged { + identity, + owner, + previous_change, + }) + } +} + +impl DidEvents { + pub fn previous_change(&self) -> Block { + match self { + DidEvents::AttributeChangedEvent(event) => event.previous_change.clone(), + DidEvents::DelegateChanged(event) => event.previous_change.clone(), + DidEvents::OwnerChanged(event) => event.previous_change.clone(), + } + } +} diff --git a/vdr/src/contracts/did/types/mod.rs b/vdr/src/contracts/did/types/mod.rs index 196ad82f..57ce79cd 100644 --- a/vdr/src/contracts/did/types/mod.rs +++ b/vdr/src/contracts/did/types/mod.rs @@ -1,3 +1,5 @@ pub mod did; pub mod did_doc; -pub mod did_doc_builder; +pub mod did_doc_attribute; +pub(crate) mod did_doc_builder; +pub mod did_events; diff --git a/vdr/src/contracts/mod.rs b/vdr/src/contracts/mod.rs index ed1b7311..6adc8488 100644 --- a/vdr/src/contracts/mod.rs +++ b/vdr/src/contracts/mod.rs @@ -5,8 +5,5 @@ pub mod network; pub use auth::{role_control, Role}; pub use cl::{credential_definition_registry, schema_registry, CredentialDefinition, Schema}; -pub use did::{ - did_registry, DidDocument, DidRecord, Service, ServiceEndpoint, StringOrVector, - VerificationMethod, VerificationMethodOrReference, -}; +pub use did::*; pub use network::validator_control; diff --git a/vdr/src/contracts/network/validator_control.rs b/vdr/src/contracts/network/validator_control.rs index 86d7ceb5..8a95956a 100644 --- a/vdr/src/contracts/network/validator_control.rs +++ b/vdr/src/contracts/network/validator_control.rs @@ -1,4 +1,4 @@ -use log::{debug, info}; +use log_derive::{logfn, logfn_inputs}; use crate::{ error::VdrResult, @@ -22,31 +22,21 @@ const METHOD_GET_VALIDATORS: &str = "getValidators"; /// /// # Returns /// Write transaction to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] pub async fn build_add_validator_transaction( client: &LedgerClient, from: &Address, validator_address: &Address, ) -> VdrResult { - debug!( - "{} txn build has started. Sender: {:?}, validator address: {:?}", - METHOD_ADD_VALIDATOR, from, validator_address - ); - - let transaction = TransactionBuilder::new() + TransactionBuilder::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_ADD_VALIDATOR) - .add_param(validator_address.try_into()?) + .add_param(validator_address)? .set_type(TransactionType::Write) .set_from(from) .build(client) - .await?; - - info!( - "{} txn build has finished. Result: {:?}", - METHOD_ADD_VALIDATOR, transaction - ); - - Ok(transaction) + .await } /// Build transaction to execute ValidatorControl.removeValidator contract method to remove an existing Validator @@ -58,31 +48,21 @@ pub async fn build_add_validator_transaction( /// /// # Returns /// Write transaction to sign and submit +#[logfn(Info)] +#[logfn_inputs(Debug)] pub async fn build_remove_validator_transaction( client: &LedgerClient, from: &Address, validator_address: &Address, ) -> VdrResult { - debug!( - "{} txn build has started. Sender: {:?}, validator address: {:?}", - METHOD_REMOVE_VALIDATOR, from, validator_address - ); - - let transaction = TransactionBuilder::new() + TransactionBuilder::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_REMOVE_VALIDATOR) - .add_param(validator_address.try_into()?) + .add_param(validator_address)? .set_type(TransactionType::Write) .set_from(from) .build(client) - .await?; - - info!( - "{} txn build has finished. Result: {:?}", - METHOD_REMOVE_VALIDATOR, transaction - ); - - Ok(transaction) + .await } /// Build transaction to execute ValidatorControl.getValidators contract method to get existing validators @@ -92,22 +72,15 @@ pub async fn build_remove_validator_transaction( /// /// # Returns /// Read transaction to submit +#[logfn(Info)] +#[logfn_inputs(Debug)] pub async fn build_get_validators_transaction(client: &LedgerClient) -> VdrResult { - debug!("{} txn build has started", METHOD_GET_VALIDATORS,); - - let transaction = TransactionBuilder::new() + TransactionBuilder::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_GET_VALIDATORS) .set_type(TransactionType::Read) .build(client) - .await?; - - info!( - "{} txn build has finished. Result: {:?}", - METHOD_GET_VALIDATORS, transaction - ); - - Ok(transaction) + .await } /// Parse the result of execution ValidatorControl.getValidators contract method to get existing validators @@ -118,26 +91,16 @@ pub async fn build_get_validators_transaction(client: &LedgerClient) -> VdrResul /// /// # Returns /// Parsed validator addresses +#[logfn(Info)] +#[logfn_inputs(Debug)] pub fn parse_get_validators_result( client: &LedgerClient, bytes: &[u8], ) -> VdrResult { - debug!( - "{} result parse has started. Bytes to parse: {:?}", - METHOD_GET_VALIDATORS, bytes - ); - - let result = TransactionParser::new() + TransactionParser::new() .set_contract(CONTRACT_NAME) .set_method(METHOD_GET_VALIDATORS) - .parse::(client, bytes)?; - - info!( - "{} result parse has finished. Result: {:?}", - METHOD_GET_VALIDATORS, result - ); - - Ok(result) + .parse::(client, bytes) } #[cfg(test)] diff --git a/vdr/src/contracts/network/validator_info.rs b/vdr/src/contracts/network/validator_info.rs index 50621ba3..592c9dd5 100644 --- a/vdr/src/contracts/network/validator_info.rs +++ b/vdr/src/contracts/network/validator_info.rs @@ -1,5 +1,3 @@ -use log::trace; - use crate::{error::VdrError, types::ContractOutput, Address}; pub type ValidatorAddresses = Vec
; @@ -8,18 +6,6 @@ impl TryFrom for ValidatorAddresses { type Error = VdrError; fn try_from(value: ContractOutput) -> Result { - trace!( - "ValidatorAddresses convert from ContractOutput: {:?} has started", - value - ); - - let validator_addresses = value.get_address_array(0); - - trace!( - "ValidatorAddresses convert from ContractOutput has finished. Result: {:?}", - validator_addresses - ); - - validator_addresses + value.get_address_array(0) } } diff --git a/vdr/src/error/mod.rs b/vdr/src/error/mod.rs index 7afc96e8..dd5deb74 100644 --- a/vdr/src/error/mod.rs +++ b/vdr/src/error/mod.rs @@ -1,4 +1,3 @@ -use log::trace; use serde_json::json; #[cfg(not(feature = "wasm"))] @@ -64,35 +63,22 @@ pub type VdrResult = Result; impl From for VdrError { fn from(value: Web3Error) -> Self { - let vdr_error = match value { + match value { Web3Error::Unreachable => VdrError::ClientNodeUnreachable, Web3Error::InvalidResponse(err) => VdrError::ClientInvalidResponse(err), Web3Error::Rpc(err) => VdrError::ClientTransactionReverted(json!(err).to_string()), + Web3Error::Revert(err) => VdrError::ClientTransactionReverted(err), _ => VdrError::ClientUnexpectedError(value.to_string()), - }; - - trace!( - "VdrError convert from web3::Error has finished. Result: {:?}", - vdr_error - ); - - vdr_error + } } } impl From for VdrError { fn from(value: Web3EthabiError) -> Self { - let vdr_error = match value { + match value { Web3EthabiError::InvalidName(name) => VdrError::ContractInvalidName(name), _ => VdrError::ContractInvalidInputData, - }; - - trace!( - "VdrError convert from web3::ethabi::Error has finished. Result: {:?}", - vdr_error - ); - - vdr_error + } } } diff --git a/vdr/src/lib.rs b/vdr/src/lib.rs index 3881d72b..707d2f3a 100644 --- a/vdr/src/lib.rs +++ b/vdr/src/lib.rs @@ -21,16 +21,20 @@ pub use contracts::{ cl::{ credential_definition_registry, schema_registry, types::{ - credential_definition::CredentialDefinition, - credential_definition_id::CredentialDefinitionId, schema::Schema, schema_id::SchemaId, + credential_definition::{CredentialDefinition, CredentialDefinitionCreatedEvent}, + credential_definition_id::CredentialDefinitionId, + schema::{Schema, SchemaCreatedEvent}, + schema_id::SchemaId, }, }, did::{ - did_registry, + did_ethr_registry, types::{ did::DID, - did_doc::{DidDocument, VerificationKeyType}, + did_doc::{DidDocument, DidResolutionOptions, VerificationKeyType}, + did_doc_attribute::{DelegateType, DidDocAttribute, Validity}, did_doc_builder::DidDocumentBuilder, + did_events::{DidAttributeChanged, DidDelegateChanged, DidEvents, DidOwnerChanged}, }, }, network::validator_control, diff --git a/vdr/src/migration/credential_definition.rs b/vdr/src/migration/credential_definition.rs index 711754b5..e1faa86b 100644 --- a/vdr/src/migration/credential_definition.rs +++ b/vdr/src/migration/credential_definition.rs @@ -1,10 +1,13 @@ use crate::{ - contracts::did::types::did::DID, + contracts::{ + cl::types::credential_definition::CredentialDefinitionTypes, did::types::did::DID, + }, error::{VdrError, VdrResult}, migration::{DID_METHOD, NETWORK}, CredentialDefinition, CredentialDefinitionId, SchemaId, }; -use log::{trace, warn}; +use log::warn; +use log_derive::{logfn, logfn_inputs}; use serde_derive::{Deserialize, Serialize}; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] @@ -13,7 +16,7 @@ pub struct IndyCredentialDefinitionFormat { #[serde(rename = "schemaId")] pub schema_id: String, #[serde(rename = "type")] - pub type_: String, + pub type_: CredentialDefinitionTypes, pub tag: String, pub value: serde_json::Value, #[serde(default)] @@ -21,12 +24,9 @@ pub struct IndyCredentialDefinitionFormat { } impl CredentialDefinitionId { + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn from_indy_format(id: &str) -> VdrResult { - trace!( - "CredentialDefinitionId convert from Indy format: {} has started", - id - ); - let parts: Vec<&str> = id.split(':').collect(); let id = parts.get(0).ok_or_else(|| { let vdr_error = VdrError::CommonInvalidData("Invalid indy cred def id".to_string()); @@ -59,38 +59,21 @@ impl CredentialDefinitionId { vdr_error })?; - let issuer_did = DID::build(DID_METHOD, NETWORK, id); + let issuer_did = DID::build(DID_METHOD, Some(NETWORK), id); let cred_def_id = CredentialDefinitionId::build(&issuer_did, schema_id, tag); - - trace!( - "CredentialDefinitionId convert from Indy format: {} has finished. Result: {:?}", - id, - cred_def_id - ); - Ok(cred_def_id) } } impl CredentialDefinition { + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn from_indy_format(credential_definition: &str) -> VdrResult { - trace!( - "CredentialDefinition convert from Indy format: {} has started", - credential_definition - ); - let indy_cred_def: IndyCredentialDefinitionFormat = serde_json::from_str(&credential_definition) .map_err(|_err| VdrError::CommonInvalidData("Invalid indy cred def".to_string()))?; let besu_cred_def = CredentialDefinition::try_from(indy_cred_def); - - trace!( - "CredentialDefinition convert from Indy format: {} has finished. Result: {:?}", - credential_definition, - besu_cred_def - ); - besu_cred_def } } @@ -98,12 +81,9 @@ impl CredentialDefinition { impl TryFrom for CredentialDefinition { type Error = VdrError; + #[logfn(Trace)] + #[logfn_inputs(Trace)] fn try_from(cred_def: IndyCredentialDefinitionFormat) -> Result { - trace!( - "CredentialDefinition convert from IndyCredentialDefinitionFormat: {:?} has started", - cred_def - ); - let parts: Vec<&str> = cred_def.id.split(':').collect(); let id = parts.get(0).ok_or_else(|| { let vdr_error = VdrError::CommonInvalidData("Invalid indy cred def id".to_string()); @@ -112,62 +92,38 @@ impl TryFrom for CredentialDefinition { vdr_error })?; - let schema_id_seq_no = parts.get(3).ok_or_else(|| { - let vdr_error = VdrError::CommonInvalidData("Invalid indy cred def id".to_string()); - - warn!("Error: {:?} during converting CredentialDefinition from IndyCredentialDefinitionFormat", vdr_error); - - vdr_error - })?; - let issuer_id = DID::build(DID_METHOD, NETWORK, id); + let issuer_id = DID::build(DID_METHOD, Some(NETWORK), id); // TODO: How to deal with schema_id - now it's just sequence number? let schema_id = cred_def.schema_id.to_string(); let besu_cred_def = CredentialDefinition { - id: CredentialDefinitionId::build(&issuer_id, schema_id_seq_no, &cred_def.tag), issuer_id, schema_id: SchemaId::from(schema_id.as_str()), - cred_def_type: cred_def.type_.to_string(), + cred_def_type: cred_def.type_.clone(), tag: cred_def.tag.to_string(), value: cred_def.value.clone(), }; - - trace!( - "CredentialDefinition convert from IndyCredentialDefinitionFormat: {:?} has finished. Result: {:?}", - cred_def, besu_cred_def - ); - Ok(besu_cred_def) } } impl Into for &CredentialDefinition { + #[logfn(Trace)] + #[logfn_inputs(Trace)] fn into(self) -> IndyCredentialDefinitionFormat { - trace!( - "CredentialDefinition: {:?} convert into IndyCredentialDefinitionFormat has started", - self - ); - - let indy_cred_def = IndyCredentialDefinitionFormat { + IndyCredentialDefinitionFormat { id: format!( "{}:3:{}:{}:{}", self.issuer_id.as_ref(), - self.cred_def_type, + self.cred_def_type.as_ref(), self.schema_id.as_ref(), self.tag ), schema_id: self.schema_id.to_string(), - type_: self.cred_def_type.to_string(), + type_: self.cred_def_type.clone(), tag: self.tag.to_string(), value: self.value.clone(), ver: "1.0".to_string(), - }; - - trace!( - "CredentialDefinition: {:?} convert into IndyCredentialDefinitionFormat has finished. Result: {:?}", - self, indy_cred_def - ); - - indy_cred_def + } } } diff --git a/vdr/src/migration/schema.rs b/vdr/src/migration/schema.rs index 5e109538..d056ffcb 100644 --- a/vdr/src/migration/schema.rs +++ b/vdr/src/migration/schema.rs @@ -4,7 +4,8 @@ use crate::{ migration::{DID_METHOD, NETWORK}, Schema, SchemaId, }; -use log::{trace, warn}; +use log::warn; +use log_derive::{logfn, logfn_inputs}; use serde_derive::{Deserialize, Serialize}; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] @@ -21,9 +22,9 @@ pub struct IndySchemaFormat { } impl SchemaId { + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn from_indy_format(id: &str) -> VdrResult { - trace!("SchemaId convert from Indy format: {} has started", id); - let parts: Vec<&str> = id.split(':').collect(); let id = parts.get(0).ok_or_else(|| { let vdr_error = VdrError::CommonInvalidData("Invalid indy schema id".to_string()); @@ -55,24 +56,17 @@ impl SchemaId { vdr_error })?; - let issuer_did = DID::build(DID_METHOD, NETWORK, id); + let issuer_did = DID::build(DID_METHOD, Some(NETWORK), id); let besu_schema_id = SchemaId::build(&issuer_did, name, version); - - trace!( - "SchemaId convert from Indy format: {} has finished. Result: {:?}", - id, - besu_schema_id - ); - Ok(besu_schema_id) } } impl Schema { + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn from_indy_format(schema: &str) -> VdrResult { - trace!("Schema convert from Indy format: {} has started", schema); - let indy_schema: IndySchemaFormat = serde_json::from_str(&schema).map_err(|_err| { let vdr_error = VdrError::CommonInvalidData("Invalid indy schema".to_string()); @@ -84,27 +78,16 @@ impl Schema { vdr_error })?; - let besu_schema = Schema::try_from(indy_schema); - - trace!( - "Schema convert from Indy format: {} has finished. Result: {:?}", - schema, - besu_schema - ); - - besu_schema + Schema::try_from(indy_schema) } } impl TryFrom for Schema { type Error = VdrError; + #[logfn(Trace)] + #[logfn_inputs(Trace)] fn try_from(schema: IndySchemaFormat) -> Result { - trace!( - "Schema convert from IndySchemaFormat: {:?} has started", - schema - ); - let parts: Vec<&str> = schema.id.split(':').collect(); let id = parts.get(0).ok_or_else(|| { let vdr_error = VdrError::CommonInvalidData("Invalid indy schema".to_string()); @@ -116,34 +99,23 @@ impl TryFrom for Schema { vdr_error })?; - let issuer_id = DID::build(DID_METHOD, NETWORK, id); + let issuer_id = DID::build(DID_METHOD, Some(NETWORK), id); let besu_schema = Schema { - id: SchemaId::build(&issuer_id, &schema.name, &schema.version), issuer_id, name: schema.name.to_string(), version: schema.version.to_string(), attr_names: schema.attr_names.clone(), }; - - trace!( - "Schema convert from IndySchemaFormat: {:?} has finished. Result: {:?}", - schema, - besu_schema - ); - Ok(besu_schema) } } impl Into for &Schema { + #[logfn(Trace)] + #[logfn_inputs(Trace)] fn into(self) -> IndySchemaFormat { - trace!( - "Schema: {:?} convert into IndySchemaFormat has started", - self - ); - - let indy_schema = IndySchemaFormat { + IndySchemaFormat { id: format!( "{}:2:{}:{}", self.issuer_id.as_ref(), @@ -155,14 +127,6 @@ impl Into for &Schema { attr_names: self.attr_names.clone(), seq_no: None, ver: "1.0".to_string(), - }; - - trace!( - "Schema: {:?} convert into IndySchemaFormat has finished. Result: {:?}", - self, - indy_schema - ); - - indy_schema + } } } diff --git a/vdr/src/signer/basic_signer.rs b/vdr/src/signer/basic_signer.rs index 2bc02c99..38f47c62 100644 --- a/vdr/src/signer/basic_signer.rs +++ b/vdr/src/signer/basic_signer.rs @@ -1,8 +1,12 @@ use crate::error::{VdrError, VdrResult}; use log::warn; +use log_derive::{logfn, logfn_inputs}; use secp256k1::{All, Message, PublicKey, Secp256k1, SecretKey}; -use std::collections::HashMap; +use std::{ + collections::HashMap, + fmt::{Debug, Formatter}, +}; use crate::types::{Address, SignatureData}; use std::str::FromStr; @@ -19,6 +23,8 @@ pub struct BasicSigner { } impl BasicSigner { + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn new() -> VdrResult { Ok(BasicSigner { secp: Secp256k1::new(), @@ -26,6 +32,8 @@ impl BasicSigner { }) } + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn create_key(&mut self, private_key: Option<&str>) -> VdrResult<(Address, Vec)> { let (account, key_pair) = self.create_account(private_key)?; let public_key_bytes = key_pair.public_key.serialize_uncompressed().to_vec(); @@ -33,6 +41,8 @@ impl BasicSigner { Ok((account, public_key_bytes)) } + #[logfn(Trace)] + #[logfn_inputs(Trace)] fn key_for_account(&self, account: &str) -> VdrResult<&KeyPair> { self.keys.get(account).ok_or_else(|| { let vdr_error = VdrError::SignerMissingKey(account.to_string()); @@ -46,11 +56,15 @@ impl BasicSigner { }) } + #[logfn(Trace)] + #[logfn_inputs(Trace)] fn account_from_key(&self, public_key: &PublicKey) -> String { let hash = keccak256(&public_key.serialize_uncompressed()[1..]); format!("0x{}", hex::encode(&hash[12..])) } + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn create_account(&self, private_key: Option<&str>) -> VdrResult<(Address, KeyPair)> { let private_key = match private_key { Some(private_key) => SecretKey::from_str(private_key)?, @@ -65,6 +79,8 @@ impl BasicSigner { Ok((address, key_pair)) } + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn sign(&self, message: &[u8], account: &str) -> VdrResult { let key = self.key_for_account(account)?; let message = Message::from_digest_slice(message)?; @@ -79,6 +95,18 @@ impl BasicSigner { } } +impl Debug for BasicSigner { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, r#"BasicSigner {{ }}"#) + } +} + +impl Debug for KeyPair { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, r#"KeyPair {{ }}"#) + } +} + #[cfg(test)] pub mod test { use super::*; diff --git a/vdr/src/test.rs b/vdr/src/test.rs index 242dbeba..64647cd4 100644 --- a/vdr/src/test.rs +++ b/vdr/src/test.rs @@ -1,64 +1,21 @@ use crate::{ - client::client::test::{client, IDENTITY_ACC}, + client::client::test::client, contracts::{ auth::Role, - cl::{ - schema_registry, - types::{credential_definition::test::credential_definition, schema::test::schema}, - CredentialDefinition, Schema, SchemaId, - }, - did::{ - did_registry, - types::{did::DID, did_doc::test::did_doc}, - DidDocument, - }, + cl::types::{credential_definition::test::credential_definition, schema::test::schema}, + did::{DID, ETHR_DID_METHOD}, }, error::VdrResult, signer::basic_signer::{ test::{basic_signer, TRUSTEE_ACC}, BasicSigner, }, - types::{Address, Transaction}, - LedgerClient, + types::{Address, SignatureData, Transaction}, + LedgerClient, TransactionEndorsingData, }; -async fn create_did(client: &LedgerClient, signer: &crate::BasicSigner) -> DidDocument { - let did_doc = did_doc(None); - let transaction = did_registry::build_create_did_transaction( - &client, - &TRUSTEE_ACC, - &IDENTITY_ACC, - &did_doc.id, - &did_doc, - ) - .await - .unwrap(); - - let sign_bytes = transaction.get_signing_bytes().unwrap(); - let signature = signer.sign(&sign_bytes, TRUSTEE_ACC.as_ref()).unwrap(); - transaction.set_signature(signature); - - client.submit_transaction(&transaction).await.unwrap(); - did_doc -} - -pub async fn create_schema( - client: &LedgerClient, - issuer_id: &DID, - signer: &crate::BasicSigner, -) -> (SchemaId, Schema) { - let (id, schema) = schema(issuer_id, None); - let transaction = - schema_registry::build_create_schema_transaction(&client, &TRUSTEE_ACC, &id, &schema) - .await - .unwrap(); - - let sign_bytes = transaction.get_signing_bytes().unwrap(); - let signature = signer.sign(&sign_bytes, TRUSTEE_ACC.as_ref()).unwrap(); - transaction.set_signature(signature); - - client.submit_transaction(&transaction).await.unwrap(); - (id, schema) +fn did(address: &Address) -> DID { + DID::build(ETHR_DID_METHOD, None, address.as_ref()) } async fn sign_and_submit_transaction( @@ -73,44 +30,316 @@ async fn sign_and_submit_transaction( client.get_receipt(&block_hash).await.unwrap() } +fn sign_endorsing_data(data: &TransactionEndorsingData, signer: &BasicSigner) -> SignatureData { + signer + .sign(&data.get_signing_bytes().unwrap(), data.from.as_ref()) + .unwrap() +} + mod did { use super::*; - use crate::{client::client::test::IDENTITY_ACC, did_registry}; + use crate::{ + contracts::{ + did::{ + did_ethr_registry, + did_ethr_registry::test::{public_key, service, validity}, + types::{ + did_doc::test::{default_ethr_did_document, TEST_DID_ETHR}, + did_doc_attribute::DidDocAttribute, + }, + DID, + }, + types::did::ParsedDid, + }, + did_ethr_registry::test::{public_key_2, public_key_3}, + Address, LedgerClient, Validity, VdrResult, + }; - pub(crate) async fn build_and_submit_create_did_doc_transaction( + async fn endorse_set_did_attribute( client: &LedgerClient, - did_doc: &DidDocument, + did: &DID, + attribute: &DidDocAttribute, + validity: &Validity, + signer: &BasicSigner, + ) { + let transaction_endorsing_data = did_ethr_registry::build_did_set_attribute_endorsing_data( + client, did, attribute, validity, + ) + .await + .unwrap(); + + let signature = sign_endorsing_data(&transaction_endorsing_data, signer); + + let transaction = did_ethr_registry::build_did_set_attribute_signed_transaction( + client, + &TRUSTEE_ACC, + did, + attribute, + validity, + &signature, + ) + .await + .unwrap(); + + sign_and_submit_transaction(&client, transaction, &signer).await; + } + + async fn endorse_revoke_did_attribute( + client: &LedgerClient, + did: &DID, + attribute: &DidDocAttribute, signer: &BasicSigner, ) -> String { - let transaction = did_registry::build_create_did_transaction( - &client, + let transaction_endorsing_data = + did_ethr_registry::build_did_revoke_attribute_endorsing_data(client, did, attribute) + .await + .unwrap(); + + let signature = sign_endorsing_data(&transaction_endorsing_data, signer); + + let transaction = did_ethr_registry::build_did_revoke_attribute_signed_transaction( + client, &TRUSTEE_ACC, - &IDENTITY_ACC, - &did_doc.id, - did_doc, + did, + attribute, + &signature, ) .await .unwrap(); - sign_and_submit_transaction(client, transaction, signer).await + sign_and_submit_transaction(&client, transaction, &signer).await } #[async_std::test] - async fn demo_build_and_submit_did_transaction_test() -> VdrResult<()> { + async fn demo_create_did_ethr() -> VdrResult<()> { let signer = basic_signer(); let client = client(); - // write - let did_doc = did_doc(None); - let receipt = build_and_submit_create_did_doc_transaction(&client, &did_doc, &signer).await; - println!("Receipt: {}", receipt); + let did = super::did(&TRUSTEE_ACC.clone()); - // read - let transaction = did_registry::build_resolve_did_transaction(&client, &did_doc.id) + // read DID changed block -> it must be none + let transaction = did_ethr_registry::build_get_did_changed_transaction(&client, &did) + .await + .unwrap(); + let result = client.submit_transaction(&transaction).await.unwrap(); + let changed = did_ethr_registry::parse_did_changed_result(&client, &result).unwrap(); + assert!(changed.is_none()); + + // add service attribute to DID + let transaction = did_ethr_registry::build_did_set_attribute_transaction( + &client, + &TRUSTEE_ACC, + &did, + &service(), + &validity(), + ) + .await + .unwrap(); + sign_and_submit_transaction(&client, transaction, &signer).await; + + // Read DID events + let transaction = did_ethr_registry::build_get_did_events_query(&client, &did, None, None) + .await + .unwrap(); + let events = client.query_events(&transaction).await.unwrap(); + assert_eq!(1, events.len()); + let event = did_ethr_registry::parse_did_event_response(&client, &events[0]).unwrap(); + let _attribute: DidDocAttribute = event.try_into().unwrap(); + + // read DID changed block -> it must be NOT none + let transaction = did_ethr_registry::build_get_did_changed_transaction(&client, &did) .await .unwrap(); let result = client.submit_transaction(&transaction).await.unwrap(); - let resolved_did_doc = did_registry::parse_resolve_did_result(&client, &result).unwrap(); - assert_eq!(did_doc, resolved_did_doc); + let changed = did_ethr_registry::parse_did_changed_result(&client, &result).unwrap(); + assert!(!changed.is_none()); + + // add service key to DID + let transaction = did_ethr_registry::build_did_set_attribute_transaction( + &client, + &TRUSTEE_ACC, + &did, + &public_key(), + &validity(), + ) + .await + .unwrap(); + sign_and_submit_transaction(&client, transaction, &signer).await; + + // resolve DID document + let did_doc_with_meta = did_ethr_registry::resolve_did(&client, &did, None) + .await + .unwrap(); + let did_document = did_doc_with_meta.did_document.unwrap(); + assert_eq!(1, did_document.service.len()); + assert_eq!(2, did_document.verification_method.len()); + assert_eq!( + false, + did_doc_with_meta.did_document_metadata.deactivated.unwrap() + ); + + Ok(()) + } + + #[async_std::test] + async fn demo_endorse_did_ethr() -> VdrResult<()> { + let mut signer = basic_signer(); + let client = client(); + let (identity, _) = signer.create_key(None)?; + + let did = super::did(&identity); + + // endorse service attribute + endorse_set_did_attribute(&client, &did, &service(), &validity(), &signer).await; + + // endorse key attribute + endorse_set_did_attribute(&client, &did, &public_key(), &validity(), &signer).await; + + // resolve DID document + let did_doc_with_meta = did_ethr_registry::resolve_did(&client, &did, None) + .await + .unwrap(); + let did_document = did_doc_with_meta.did_document.unwrap(); + assert_eq!(1, did_document.service.len()); + assert_eq!(2, did_document.verification_method.len()); + + Ok(()) + } + + #[async_std::test] + async fn demo_did_ethr_deactivate() -> VdrResult<()> { + let mut signer = basic_signer(); + let client = client(); + let (identity, _) = signer.create_key(None)?; + + let did = super::did(&identity); + + // add service attribute + let service = service(); + let validity = validity(); + endorse_set_did_attribute(&client, &did, &service, &validity, &signer).await; + + // deactivate DID + let new_owner = Address::null(); + let transaction_endorsing_data = + did_ethr_registry::build_did_change_owner_endorsing_data(&client, &did, &new_owner) + .await + .unwrap(); + + let signature = sign_endorsing_data(&transaction_endorsing_data, &signer); + + let transaction = did_ethr_registry::build_did_change_owner_signed_transaction( + &client, + &TRUSTEE_ACC, + &did, + &new_owner, + &signature, + ) + .await + .unwrap(); + sign_and_submit_transaction(&client, transaction, &signer).await; + + // Resole DID document + let did_doc_with_meta = did_ethr_registry::resolve_did(&client, &did, None) + .await + .unwrap(); + let did_document = did_doc_with_meta.did_document.unwrap(); + + // DID is deactivated + assert!(did_doc_with_meta.did_document_metadata.deactivated.unwrap()); + + // DID Document is empty + let parse_did = ParsedDid::try_from(&did).unwrap(); + assert_eq!(parse_did.as_short_did(), did_document.id); + assert_eq!(0, did_document.service.len()); + assert_eq!(0, did_document.verification_method.len()); + assert_eq!(0, did_document.authentication.len()); + assert_eq!(0, did_document.assertion_method.len()); + + Ok(()) + } + + #[async_std::test] + async fn demo_did_add_remove_attribute() -> VdrResult<()> { + let mut signer = basic_signer(); + let client = client(); + let (identity, _) = signer.create_key(None)?; + + let did = super::did(&identity); + + // set service attribute + let service = service(); + let validity = validity(); + endorse_set_did_attribute(&client, &did, &service, &validity, &signer).await; + + // set first key attribute + let public_key = public_key(); + endorse_set_did_attribute(&client, &did, &public_key, &validity, &signer).await; + + // set second key attribute + let public_key_2 = public_key_2(); + endorse_set_did_attribute(&client, &did, &public_key_2, &validity, &signer).await; + + // resolve DID document + let did_doc_with_meta = did_ethr_registry::resolve_did(&client, &did, None) + .await + .unwrap(); + let did_document_before_remove = did_doc_with_meta.did_document.unwrap(); + assert_eq!(1, did_document_before_remove.service.len()); + assert_eq!(3, did_document_before_remove.verification_method.len()); + assert_eq!(2, did_document_before_remove.key_agreement.len()); + assert_eq!(1, did_document_before_remove.authentication.len()); + assert_eq!(1, did_document_before_remove.assertion_method.len()); + + // remove service and second key + endorse_revoke_did_attribute(&client, &did, &public_key, &signer).await; + endorse_revoke_did_attribute(&client, &did, &service, &signer).await; + + // resolve DID document + let did_doc_with_meta = did_ethr_registry::resolve_did(&client, &did, None) + .await + .unwrap(); + let did_document_after_remove = did_doc_with_meta.did_document.unwrap(); + assert_eq!(0, did_document_after_remove.service.len()); + assert_eq!(2, did_document_after_remove.verification_method.len()); + assert_eq!(1, did_document_after_remove.key_agreement.len()); + assert_eq!(1, did_document_after_remove.authentication.len()); + assert_eq!(1, did_document_after_remove.assertion_method.len()); + + // add third key + let public_key_3 = public_key_3(); + endorse_set_did_attribute(&client, &did, &public_key_3, &validity, &signer).await; + + // resolve DID document + let did_doc_with_meta = did_ethr_registry::resolve_did(&client, &did, None) + .await + .unwrap(); + let did_document_after_add = did_doc_with_meta.did_document.unwrap(); + assert_eq!(0, did_document_after_add.service.len()); + assert_eq!(3, did_document_after_add.verification_method.len()); + assert_eq!(1, did_document_after_add.key_agreement.len()); + assert_eq!(1, did_document_after_add.authentication.len()); + assert_eq!(2, did_document_after_add.assertion_method.len()); + + Ok(()) + } + + #[async_std::test] + async fn demo_resolve_offchain_did() -> VdrResult<()> { + let client = client(); + + let did = DID::from(TEST_DID_ETHR); + + // Resole DID document + let did_doc_with_meta = did_ethr_registry::resolve_did(&client, &did, None) + .await + .unwrap(); + let did_document = did_doc_with_meta.did_document.unwrap(); + + // DID Document is empty + assert_eq!( + default_ethr_did_document(Some(client.chain_id())), + did_document + ); Ok(()) } @@ -118,42 +347,79 @@ mod did { mod schema { use super::*; - use crate::{schema_registry, SchemaId}; + use crate::{schema_registry, LedgerClient, Schema, SchemaId, DID}; - pub(crate) async fn build_and_submit_create_schema_transaction( + pub(crate) async fn endorse_schema( client: &LedgerClient, - id: &SchemaId, - schema: &Schema, + did: &DID, signer: &BasicSigner, - ) -> String { - let transaction = - schema_registry::build_create_schema_transaction(&client, &TRUSTEE_ACC, id, schema) + ) -> (SchemaId, Schema) { + let (schema_id, schema) = schema(did, None); + let transaction_endorsing_data = + schema_registry::build_create_schema_endorsing_data(client, &schema_id, &schema) .await .unwrap(); - sign_and_submit_transaction(client, transaction, signer).await + + let signature = sign_endorsing_data(&transaction_endorsing_data, signer); + + let transaction = schema_registry::build_create_schema_signed_transaction( + client, + &TRUSTEE_ACC.clone(), + &schema_id, + &schema, + &signature, + ) + .await + .unwrap(); + sign_and_submit_transaction(client, transaction, signer).await; + (schema_id, schema) } #[async_std::test] - async fn demo_build_and_submit_transaction_test() -> VdrResult<()> { + async fn demo_create_schema() -> VdrResult<()> { let signer = basic_signer(); let client = client(); - // create DID Document - let did_doc = create_did(&client, &signer).await; + // create DID + let did = super::did(&TRUSTEE_ACC.clone()); // write - let (schema_id, schema) = schema(&did_doc.id, None); - let receipt = - build_and_submit_create_schema_transaction(&client, &schema_id, &schema, &signer).await; - println!("Receipt: {}", receipt); + let (schema_id, schema) = schema(&did, None); + let transaction = schema_registry::build_create_schema_transaction( + &client, + &TRUSTEE_ACC.clone(), + &schema_id, + &schema, + ) + .await + .unwrap(); + sign_and_submit_transaction(&client, transaction, &signer).await; // read - let transaction = schema_registry::build_resolve_schema_transaction(&client, &schema_id) + let resolved_schema = schema_registry::resolve_schema(&client, &schema_id) + .await + .unwrap(); + assert_eq!(schema, resolved_schema); + + Ok(()) + } + + #[async_std::test] + async fn demo_endorse_schema() -> VdrResult<()> { + let mut signer = basic_signer(); + let client = client(); + let (identity, _) = signer.create_key(None)?; + + // create DID + let did = super::did(&identity); + + // endorse schema + let (schema_id, schema) = endorse_schema(&client, &did, &signer).await; + + // read + let resolved_schema = schema_registry::resolve_schema(&client, &schema_id) .await .unwrap(); - let result = client.submit_transaction(&transaction).await.unwrap(); - let resolved_schema = - schema_registry::parse_resolve_schema_result(&client, &result).unwrap(); assert_eq!(schema, resolved_schema); Ok(()) @@ -162,60 +428,100 @@ mod schema { mod credential_definition { use super::*; - use crate::{credential_definition_registry, CredentialDefinitionId}; + use crate::{credential_definition_registry, schema_registry}; - pub(crate) async fn build_and_submit_create_cred_def_transaction( - client: &LedgerClient, - id: &CredentialDefinitionId, - cred_def: &CredentialDefinition, - signer: &BasicSigner, - ) -> String { + #[async_std::test] + async fn demo_create_credential_definition() -> VdrResult<()> { + let signer = basic_signer(); + let client = client(); + + // create DID + let did = super::did(&TRUSTEE_ACC.clone()); + + // create Schema + let (schema_id, schema) = schema(&did, None); + let transaction = schema_registry::build_create_schema_transaction( + &client, + &TRUSTEE_ACC, + &schema_id, + &schema, + ) + .await + .unwrap(); + sign_and_submit_transaction(&client, transaction, &signer).await; + + // write + let (credential_definition_id, credential_definition) = + credential_definition(&did, &schema_id, None); let transaction = credential_definition_registry::build_create_credential_definition_transaction( &client, &TRUSTEE_ACC, - id, - cred_def, + &credential_definition_id, + &credential_definition, ) .await .unwrap(); - sign_and_submit_transaction(client, transaction, signer).await + sign_and_submit_transaction(&client, transaction, &signer).await; + + // read + let resolved_credential_definition = + credential_definition_registry::resolve_credential_definition( + &client, + &credential_definition_id, + ) + .await + .unwrap(); + assert_eq!(credential_definition, resolved_credential_definition); + + Ok(()) } #[async_std::test] - async fn demo_build_and_submit_transaction_test() -> VdrResult<()> { - let signer = basic_signer(); + async fn demo_endorse_credential_definition() -> VdrResult<()> { + let mut signer = basic_signer(); let client = client(); + let (identity, _) = signer.create_key(None)?; + + // create DID Document + let did = super::did(&identity); - // create DID Document and Schema - let did_doc = create_did(&client, &signer).await; - let (schema_id, _) = create_schema(&client, &did_doc.id, &signer).await; + // create Schema + let (schema_id, _) = super::schema::endorse_schema(&client, &did, &signer).await; // write let (credential_definition_id, credential_definition) = - credential_definition(&did_doc.id, &schema_id, None); - let receipt = build_and_submit_create_cred_def_transaction( - &client, - &credential_definition_id, - &credential_definition, - &signer, - ) - .await; - println!("Receipt: {}", receipt); + credential_definition(&did, &schema_id, None); + let transaction_endorsing_data = + credential_definition_registry::build_create_credential_definition_endorsing_data( + &client, + &credential_definition_id, + &credential_definition, + ) + .await + .unwrap(); + + let signature = sign_endorsing_data(&transaction_endorsing_data, &signer); - // read let transaction = - credential_definition_registry::build_resolve_credential_definition_transaction( + credential_definition_registry::build_create_credential_definition_signed_transaction( &client, + &TRUSTEE_ACC.clone(), &credential_definition_id, + &credential_definition, + &signature, ) .await .unwrap(); - let result = client.submit_transaction(&transaction).await.unwrap(); + sign_and_submit_transaction(&client, transaction, &signer).await; + + // read let resolved_credential_definition = - credential_definition_registry::parse_resolve_credential_definition_result( - &client, &result, + credential_definition_registry::resolve_credential_definition( + &client, + &credential_definition_id, ) + .await .unwrap(); assert_eq!(credential_definition, resolved_credential_definition); @@ -298,26 +604,24 @@ mod role { let client = client(); let role_to_assign = Role::Endorser; - let receipt = build_and_submit_assign_role_transaction( + build_and_submit_assign_role_transaction( &client, &assignee_account, &role_to_assign, &signer, ) .await; - println!("Receipt: {}", receipt); let assigned_role = build_and_submit_get_role_transaction(&client, &assignee_account).await; assert_eq!(role_to_assign, assigned_role); - let receipt = build_and_submit_revoke_role_transaction( + build_and_submit_revoke_role_transaction( &client, &assignee_account, &role_to_assign, &signer, ) .await; - println!("Receipt: {}", receipt); let has_role = build_and_submit_has_role_transaction(&client, &role_to_assign, &assignee_account) @@ -391,19 +695,14 @@ mod validator { ) .await; - let receipt = - build_and_submit_add_validator_transaction(&client, &new_validator_address, &signer) - .await; - println!("Receipt: {}", receipt); + build_and_submit_add_validator_transaction(&client, &new_validator_address, &signer).await; let validator_list = build_and_submit_get_validators_transaction(&client).await; assert_eq!(validator_list.len(), 5); assert!(validator_list.contains(&new_validator_address)); - let receipt = - build_and_submit_remove_validator_transaction(&client, &new_validator_address, &signer) - .await; - println!("Receipt: {}", receipt); + build_and_submit_remove_validator_transaction(&client, &new_validator_address, &signer) + .await; let validator_list = build_and_submit_get_validators_transaction(&client).await; assert_eq!(validator_list.len(), 4); diff --git a/vdr/src/types/address.rs b/vdr/src/types/address.rs index d87b2ad3..84643110 100644 --- a/vdr/src/types/address.rs +++ b/vdr/src/types/address.rs @@ -1,17 +1,37 @@ use crate::{ error::VdrError, types::{ContractOutput, ContractParam}, + DID, }; +use crate::contracts::types::did::ParsedDid; use ethereum_types::Address as Address_; -use log::trace; use serde::{Deserialize, Serialize}; use std::str::FromStr; +const PREFIX: &str = "0x"; +const NULL_ADDRESS: &str = "0x0000000000000000000000000000000000000000"; + #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] pub struct Address(String); -const PREFIX: &str = "0x"; +impl Address { + pub(crate) fn to_filter(&self) -> String { + format!("000000000000000000000000{}", &self.0[2..]) + } + + pub fn as_blockchain_id(&self, chain_id: u64) -> String { + format!("eip155:{}:{}", chain_id, self.as_ref()) + } + + pub fn null() -> Address { + Address::from(NULL_ADDRESS) + } + + pub fn is_null(&self) -> bool { + self.as_ref() == NULL_ADDRESS + } +} impl From<&str> for Address { fn from(address: &str) -> Self { @@ -39,23 +59,12 @@ impl TryInto for &Address { type Error = VdrError; fn try_into(self) -> Result { - trace!("Address: {:?} convert into ContractParam has started", self); - let acc_address = Address_::from_str(self.as_ref()).map_err(|err| { VdrError::CommonInvalidData(format!( "Unable to parse account address. Err: {:?}", err.to_string() )) })?; - - let acc_address_contract_param = ContractParam::Address(acc_address); - - trace!( - "Address: {:?} convert into ContractParam has finished. Result: {:?}", - self, - acc_address_contract_param - ); - Ok(ContractParam::Address(acc_address)) } } @@ -64,19 +73,15 @@ impl TryFrom for Address { type Error = VdrError; fn try_from(value: ContractOutput) -> Result { - trace!( - "Address convert from ContractOutput: {:?} has started", - value - ); - - let acc_address = Address(value.get_string(0)?); + value.get_address(0) + } +} - trace!( - "Address convert from ContractOutput: {:?} has finished. Result: {:?}", - value, - acc_address - ); +impl TryFrom<&DID> for Address { + type Error = VdrError; - Ok(acc_address) + fn try_from(did: &DID) -> Result { + let parsed_did = ParsedDid::try_from(did)?; + Ok(Address::from(parsed_did.identifier.as_str())) } } diff --git a/vdr/src/types/contract.rs b/vdr/src/types/contract.rs index 6d731902..ff1f822b 100644 --- a/vdr/src/types/contract.rs +++ b/vdr/src/types/contract.rs @@ -3,8 +3,10 @@ use crate::{ Address, }; -use ethabi::Token; -use log::{trace, warn}; +use crate::utils::format_bytes32; +use ethabi::{Log, Token}; +use log::warn; +use log_derive::{logfn, logfn_inputs}; use serde::{Deserialize, Serialize}; /// Contract configuration @@ -30,6 +32,8 @@ pub struct ContractSpec { impl ContractSpec { /// Read and parse contract specification from a JSON file + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn from_file(spec_path: &str) -> VdrResult { let contract_spec = std::fs::read_to_string(spec_path).map_err(|err| { let vdr_error = VdrError::ContractInvalidSpec(format!( @@ -44,7 +48,7 @@ impl ContractSpec { vdr_error })?; - let contract_spec = serde_json::from_str(&contract_spec).map_err(|err| { + serde_json::from_str(&contract_spec).map_err(|err| { let vdr_error = VdrError::ContractInvalidSpec(format!( "Unable to parse contract specification. Err: {:?}", err.to_string() @@ -56,14 +60,7 @@ impl ContractSpec { ); vdr_error - }); - - trace!( - "Read contract specification from file. Result: {:?}", - contract_spec - ); - - contract_spec + }) } } @@ -72,9 +69,10 @@ pub type ContractParam = Token; /// Helper wrapper for more convenient parsing of the contract execution results #[derive(Debug)] -pub struct ContractOutput(Vec); +pub(crate) struct ContractOutput(Vec); impl ContractOutput { + #[allow(unused)] pub fn new(data: Vec) -> ContractOutput { ContractOutput(data) } @@ -83,113 +81,51 @@ impl ContractOutput { self.0.is_empty() } - pub fn size(&self) -> usize { - self.0.len() - } - - pub fn into_iter(self) -> impl Iterator { - self.0.into_iter() - } - + #[allow(unused)] pub fn get_tuple(&self, index: usize) -> VdrResult { - self.0 - .get(index) - .ok_or_else(|| { - VdrError::ContractInvalidResponseData("Missing tuple value".to_string()) - })? - .clone() + self.get_item(index)? .into_tuple() .ok_or_else(|| VdrError::ContractInvalidResponseData("Missing tuple value".to_string())) .map(ContractOutput) } pub fn get_string(&self, index: usize) -> VdrResult { - self.0 - .get(index) - .ok_or_else(|| { - VdrError::ContractInvalidResponseData("Missing string value".to_string()) - })? - .clone() - .into_string() - .ok_or_else(|| { - VdrError::ContractInvalidResponseData("Missing string value".to_string()) - }) + self.get_item(index)?.into_string().ok_or_else(|| { + VdrError::ContractInvalidResponseData("Missing string value".to_string()) + }) } pub fn get_address(&self, index: usize) -> VdrResult
{ - let address_str = self - .0 - .get(index) - .ok_or_else(|| { - VdrError::ContractInvalidResponseData("Missing address value".to_string()) - })? - .clone() - .to_string(); + let address_str = self.get_item(index)?.to_string(); Ok(Address::from(address_str.as_str())) } pub fn get_bool(&self, index: usize) -> VdrResult { - self.0 - .get(index) - .ok_or_else(|| VdrError::ContractInvalidResponseData("Missing bool value".to_string()))? - .clone() + self.get_item(index)? .into_bool() .ok_or_else(|| VdrError::ContractInvalidResponseData("Missing bool value".to_string())) } - pub fn get_u128(&self, index: usize) -> VdrResult { + pub fn get_u8(&self, index: usize) -> VdrResult { Ok(self - .0 - .get(index) - .ok_or_else(|| VdrError::ContractInvalidResponseData("Missing uint value".to_string()))? - .clone() + .get_item(index)? .into_uint() .ok_or_else(|| VdrError::ContractInvalidResponseData("Missing uint value".to_string()))? - .as_u128()) + .as_u32() as u8) } - pub fn get_u8(&self, index: usize) -> VdrResult { + pub fn get_u64(&self, index: usize) -> VdrResult { Ok(self - .0 - .get(index) - .ok_or_else(|| VdrError::ContractInvalidResponseData("Missing uint value".to_string()))? - .clone() + .get_item(index)? .into_uint() .ok_or_else(|| VdrError::ContractInvalidResponseData("Missing uint value".to_string()))? - .as_u32() as u8) - } - - pub fn get_string_array(&self, index: usize) -> VdrResult> { - self.0 - .get(index) - .ok_or_else(|| { - VdrError::ContractInvalidResponseData("Missing string array value".to_string()) - })? - .clone() - .into_array() - .ok_or_else(|| { - VdrError::ContractInvalidResponseData("Missing string array value".to_string()) - })? - .into_iter() - .map(|token| { - token.into_string().ok_or_else(|| { - VdrError::ContractInvalidResponseData("Missing string value".to_string()) - }) - }) - .collect() + .as_u64()) } pub fn get_address_array(&self, index: usize) -> VdrResult> { Ok(self - .0 - .get(index) - .ok_or_else(|| { - VdrError::ContractInvalidResponseData( - "Missing address string array value".to_string(), - ) - })? - .clone() + .get_item(index)? .into_array() .ok_or_else(|| { VdrError::ContractInvalidResponseData( @@ -201,32 +137,108 @@ impl ContractOutput { .collect()) } - pub fn get_objects_array(&self, index: usize) -> VdrResult> { - let tokens = self + fn get_item(&self, index: usize) -> VdrResult { + self.0.get(index).cloned().ok_or_else(|| { + VdrError::ContractInvalidResponseData("Missing address value".to_string()) + }) + } +} + +impl From> for ContractOutput { + fn from(value: Vec) -> Self { + ContractOutput(value) + } +} + +/// Helper wrapper for more convenient parsing of the contract event logs +#[derive(Debug)] +pub(crate) struct ContractEvent(Log); + +impl ContractEvent { + pub fn is_empty(&self) -> bool { + self.0.params.is_empty() + } + + pub fn get_address(&self, index: usize) -> VdrResult
{ + let address_str = self.get_item(index)?.into_address().ok_or_else(|| { + VdrError::ContractInvalidResponseData("Missing address value".to_string()) + })?; + + Ok(Address::from(hex::encode(address_str.0).as_str())) + } + + pub fn get_fixed_bytes(&self, index: usize) -> VdrResult> { + self.get_item(index)?.into_fixed_bytes().ok_or_else(|| { + VdrError::ContractInvalidResponseData("Missing address value".to_string()) + }) + } + + pub fn get_bytes(&self, index: usize) -> VdrResult> { + self.get_item(index)?.into_bytes().ok_or_else(|| { + VdrError::ContractInvalidResponseData("Missing address value".to_string()) + }) + } + + pub fn get_uint(&self, index: usize) -> VdrResult { + self.get_item(index)? + .into_uint() + .ok_or_else(|| { + VdrError::ContractInvalidResponseData("Missing address value".to_string()) + }) + .map(|uint| uint.as_u64()) + } + + fn get_item(&self, index: usize) -> VdrResult { + Ok(self .0 + .params .get(index) .ok_or_else(|| { - VdrError::ContractInvalidResponseData("Missing object array value".to_string()) + VdrError::ContractInvalidResponseData("Missing address value".to_string()) })? .clone() - .into_array() - .ok_or_else(|| { - VdrError::ContractInvalidResponseData("Missing object array value".to_string()) - })?; - - let mut result: Vec = Vec::new(); - for item in tokens.into_iter() { - let item = item.into_tuple().ok_or_else(|| { - VdrError::ContractInvalidResponseData("Missing object value".to_string()) - })?; - result.push(ContractOutput(item)) - } - Ok(result) + .value) } } -impl From> for ContractOutput { - fn from(value: Vec) -> Self { - ContractOutput(value) +impl From for ContractEvent { + fn from(value: Log) -> Self { + ContractEvent(value) + } +} + +#[derive(Debug)] +pub(crate) struct UintBytesParam(u64); + +impl From for UintBytesParam { + fn from(value: u64) -> Self { + UintBytesParam(value) + } +} + +impl TryFrom for ContractParam { + type Error = VdrError; + + fn try_from(value: UintBytesParam) -> Result { + Ok(ContractParam::FixedBytes( + format_bytes32(value.0.to_be_bytes().as_slice())?.to_vec(), + )) + } +} + +#[derive(Debug)] +pub(crate) struct MethodParam(&'static str); + +impl From<&'static str> for MethodParam { + fn from(value: &'static str) -> Self { + MethodParam(value) + } +} + +impl TryFrom for ContractParam { + type Error = VdrError; + + fn try_from(value: MethodParam) -> Result { + Ok(ContractParam::String(value.0.to_string())) } } diff --git a/vdr/src/types/event_query.rs b/vdr/src/types/event_query.rs new file mode 100644 index 00000000..b61787c8 --- /dev/null +++ b/vdr/src/types/event_query.rs @@ -0,0 +1,176 @@ +use crate::{ + types::{transaction::Block, ContractEvent}, + Address, LedgerClient, VdrError, VdrResult, +}; +use ethabi::{Hash, RawLog}; +use log::warn; +use log_derive::{logfn, logfn_inputs}; +use serde_derive::{Deserialize, Serialize}; +use std::fmt::Debug; + +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct EventQuery { + pub address: Address, + #[serde(skip_serializing_if = "Option::is_none")] + pub from_block: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub to_block: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub event_signature: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub event_filter: Option, +} + +#[derive(Clone, Debug, Default, PartialEq)] +pub(crate) struct EventQueryBuilder { + contract: String, + from_block: Option, + to_block: Option, + event_signature: Option, + event_filter: Option, +} + +impl EventQueryBuilder { + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn new() -> EventQueryBuilder { + EventQueryBuilder::default() + } + + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn set_contract(mut self, contract: &str) -> EventQueryBuilder { + self.contract = contract.to_string(); + self + } + + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn set_from_block(mut self, from_block: Option) -> EventQueryBuilder { + self.from_block = from_block; + self + } + + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn set_to_block(mut self, to_block: Option) -> EventQueryBuilder { + self.to_block = to_block; + self + } + + #[logfn(Trace)] + #[logfn_inputs(Trace)] + #[allow(unused)] + pub fn set_event_signature(mut self, event_signature: String) -> EventQueryBuilder { + self.event_signature = Some(event_signature); + self + } + + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn set_event_filer(mut self, event_filter: String) -> EventQueryBuilder { + self.event_filter = Some(event_filter); + self + } + + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn build(self, client: &LedgerClient) -> VdrResult { + let contract = client.contract(&self.contract)?; + let query = EventQuery { + address: contract.address().to_owned(), + from_block: self.from_block, + to_block: self.to_block, + event_signature: self.event_signature, + event_filter: self.event_filter, + }; + Ok(query) + } +} + +#[derive(Clone, Debug, Default, PartialEq)] +pub(crate) struct EventParser { + contract: String, + event: String, +} + +impl EventParser { + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn new() -> EventParser { + EventParser::default() + } + + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn set_contract(mut self, contract: &str) -> EventParser { + self.contract = contract.to_string(); + self + } + + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn set_event(mut self, event: &str) -> EventParser { + self.event = event.to_string(); + self + } + + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn parse + Debug>( + self, + client: &LedgerClient, + log: &EventLog, + ) -> VdrResult { + if log.data.is_empty() { + let vdr_error = + VdrError::ContractInvalidResponseData("Unable to parse event log".to_string()); + + warn!("Error: {:?} during event log parsing", vdr_error); + + return Err(vdr_error); + } + + let contract = client.contract(&self.contract)?; + let event = contract.event(&self.event)?; + let raw_log = RawLog { + topics: log.topics.clone(), + data: log.data.clone(), + }; + let parsed_log = event.parse_log(raw_log).map(ContractEvent::from)?; + + if parsed_log.is_empty() { + let vdr_error = + VdrError::ContractInvalidResponseData("Unable to parse response".to_string()); + + warn!("Error: {:?} during transaction output parse", vdr_error); + + return Err(vdr_error); + } + + T::try_from(parsed_log) + } +} + +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +pub struct EventLog { + pub topics: Vec, + pub data: Vec, + pub block: Block, +} + +impl EventLog { + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn new(topics: Vec>, data: Vec, block: u64) -> EventLog { + EventLog { + topics: topics + .iter() + .map(|topic| ethereum_types::H256::from_slice(topic)) + .collect(), + data, + block: Block::from(block), + } + } +} diff --git a/vdr/src/types/mod.rs b/vdr/src/types/mod.rs index 70d7a540..ff618a10 100644 --- a/vdr/src/types/mod.rs +++ b/vdr/src/types/mod.rs @@ -1,11 +1,24 @@ mod address; mod contract; +mod event_query; +mod signature; mod status; mod transaction; pub use address::Address; pub use contract::{ContractConfig, ContractSpec}; -pub(crate) use contract::{ContractOutput, ContractParam}; +pub use event_query::{EventLog, EventQuery}; +pub use signature::SignatureData; pub use status::{PingStatus, Status}; -pub use transaction::{SignatureData, Transaction, TransactionSignature, TransactionType}; -pub(crate) use transaction::{TransactionBuilder, TransactionParser}; +pub use transaction::{ + Block, BlockDetails, Nonce, Transaction, TransactionEndorsingData, TransactionSignature, + TransactionType, +}; + +pub(crate) use contract::{ + ContractEvent, ContractOutput, ContractParam, MethodParam, UintBytesParam, +}; +pub(crate) use event_query::{EventParser, EventQueryBuilder}; +pub(crate) use transaction::{ + TransactionBuilder, TransactionEndorsingDataBuilder, TransactionParser, +}; diff --git a/vdr/src/types/signature.rs b/vdr/src/types/signature.rs new file mode 100644 index 00000000..4903c53c --- /dev/null +++ b/vdr/src/types/signature.rs @@ -0,0 +1,57 @@ +use crate::{types::ContractParam, VdrError}; +use serde_derive::{Deserialize, Serialize}; + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct SignatureData { + /// recovery ID using for public key recovery + pub recovery_id: u64, + /// ECDSA signature + pub signature: Vec, +} + +impl SignatureData { + pub(crate) fn v(&self) -> SignatureV { + SignatureV(self.recovery_id) + } + + pub(crate) fn r(&self) -> SignatureR { + SignatureR(self.signature[..32].to_vec()) + } + + pub(crate) fn s(&self) -> SignatureS { + SignatureS(self.signature[32..].to_vec()) + } +} + +#[derive(Debug)] +pub(crate) struct SignatureV(pub u64); + +impl TryFrom for ContractParam { + type Error = VdrError; + + fn try_from(value: SignatureV) -> Result { + Ok(ContractParam::Uint((value.0 + 27).into())) + } +} + +#[derive(Debug)] +pub(crate) struct SignatureR(pub Vec); + +impl TryFrom for ContractParam { + type Error = VdrError; + + fn try_from(value: SignatureR) -> Result { + Ok(ContractParam::FixedBytes(value.0)) + } +} + +#[derive(Debug)] +pub(crate) struct SignatureS(pub Vec); + +impl TryFrom for ContractParam { + type Error = VdrError; + + fn try_from(value: SignatureS) -> Result { + Ok(ContractParam::FixedBytes(value.0)) + } +} diff --git a/vdr/src/types/status.rs b/vdr/src/types/status.rs index 7ef72028..5df3782c 100644 --- a/vdr/src/types/status.rs +++ b/vdr/src/types/status.rs @@ -8,13 +8,23 @@ pub struct PingStatus { #[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum Status { - Ok, - Err { msg: String }, + Ok { + block_number: u64, + block_timestamp: u64, + }, + Err { + msg: String, + }, } impl PingStatus { - pub fn ok() -> PingStatus { - PingStatus { status: Status::Ok } + pub fn ok(block_number: u64, block_timestamp: u64) -> PingStatus { + PingStatus { + status: Status::Ok { + block_number, + block_timestamp, + }, + } } pub fn err(err: &str) -> PingStatus { diff --git a/vdr/src/types/transaction.rs b/vdr/src/types/transaction.rs index e0a7612d..0d81add3 100644 --- a/vdr/src/types/transaction.rs +++ b/vdr/src/types/transaction.rs @@ -1,16 +1,21 @@ +use ethabi::Uint; use ethereum::{ EnvelopedEncodable, LegacyTransaction, LegacyTransactionMessage, TransactionAction, TransactionSignature as EthTransactionSignature, }; use ethereum_types::{H160, H256, U256}; -use log::{trace, warn}; +use log::warn; +use log_derive::{logfn, logfn_inputs}; use serde_derive::{Deserialize, Serialize}; -use std::{str::FromStr, sync::RwLock}; +use sha3::Digest; +use std::{fmt::Debug, str::FromStr, sync::RwLock}; use crate::{ client::{GAS_LIMIT, GAS_PRICE}, error::{VdrError, VdrResult}, - types::{Address, ContractOutput, ContractParam}, + types::{ + contract::UintBytesParam, signature::SignatureData, Address, ContractOutput, ContractParam, + }, LedgerClient, }; @@ -37,7 +42,7 @@ pub struct Transaction { pub to: Address, /// nonce - count of transaction sent by account #[serde(skip_serializing_if = "Option::is_none")] - pub nonce: Option>, + pub nonce: Option, /// chain id of the ledger pub chain_id: u64, /// transaction payload @@ -48,14 +53,6 @@ pub struct Transaction { pub hash: Option>, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct SignatureData { - /// recovery ID using for public key recovery - pub recovery_id: u64, - /// ECDSA signature - pub signature: Vec, -} - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct TransactionSignature { pub v: u64, @@ -64,13 +61,15 @@ pub struct TransactionSignature { } impl Transaction { + #[logfn(Info)] + #[logfn_inputs(Debug)] pub fn new( type_: TransactionType, from: Option
, to: Address, chain_id: u64, data: Vec, - nonce: Option>, + nonce: Option, signature: Option, ) -> Transaction { Transaction { @@ -85,6 +84,8 @@ impl Transaction { } } + #[logfn(Info)] + #[logfn_inputs(Debug)] pub fn get_signing_bytes(&self) -> VdrResult> { let eth_transaction: LegacyTransactionMessage = LegacyTransactionMessage { nonce: self.get_nonce()?, @@ -99,17 +100,19 @@ impl Transaction { Ok(hash.as_bytes().to_vec()) } + #[logfn(Info)] + #[logfn_inputs(Debug)] pub fn set_signature(&self, signature_data: SignatureData) { - let v = signature_data.recovery_id + 35 + self.chain_id * 2; - let transaction_signature = TransactionSignature { - v, - r: signature_data.signature[..32].to_vec(), - s: signature_data.signature[32..].to_vec(), - }; let mut signature = self.signature.write().unwrap(); - *signature = Some(transaction_signature) + *signature = Some(TransactionSignature { + v: signature_data.v().0 + 35 + self.chain_id * 2, + r: signature_data.r().0, + s: signature_data.s().0, + }) } + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn encode(&self) -> VdrResult> { let transaction = LegacyTransaction { nonce: self.get_nonce()?, @@ -123,6 +126,8 @@ impl Transaction { Ok(transaction.encode().to_vec()) } + #[logfn(Trace)] + #[logfn_inputs(Trace)] fn get_to(&self) -> VdrResult { H160::from_str(self.to.as_ref()).map_err(|_| { VdrError::ClientInvalidTransaction(format!( @@ -132,19 +137,17 @@ impl Transaction { }) } + #[logfn(Trace)] + #[logfn_inputs(Trace)] fn get_nonce(&self) -> VdrResult { - let nonce: [u64; 4] = self - .nonce - .as_ref() - .ok_or_else(|| { - VdrError::ClientInvalidTransaction("Transaction `nonce` is not set".to_string()) - })? - .clone() - .try_into() - .map_err(|_| VdrError::CommonInvalidData("Invalid nonce provided".to_string()))?; - Ok(U256(nonce)) + let nonce = self.nonce.ok_or_else(|| { + VdrError::ClientInvalidTransaction("Transaction `nonce` is not set".to_string()) + })?; + Ok(U256::from(nonce)) } + #[logfn(Trace)] + #[logfn_inputs(Trace)] fn get_transaction_signature(&self) -> VdrResult { let signature = self.signature.read().unwrap(); let signature = signature @@ -178,8 +181,24 @@ impl PartialEq for Transaction { } } +#[cfg(test)] +impl Clone for Transaction { + fn clone(&self) -> Self { + Transaction { + type_: self.type_.clone(), + from: self.from.clone(), + to: self.to.clone(), + nonce: self.nonce.clone(), + chain_id: self.chain_id.clone(), + data: self.data.clone(), + signature: RwLock::new(self.signature.read().unwrap().clone()), + hash: self.hash.clone(), + } + } +} + #[derive(Clone, Debug, Default, PartialEq)] -pub struct TransactionBuilder { +pub(crate) struct TransactionBuilder { contract: String, method: String, from: Option
, @@ -189,65 +208,59 @@ pub struct TransactionBuilder { } impl TransactionBuilder { + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn new() -> TransactionBuilder { TransactionBuilder::default() } + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn set_contract(mut self, contract: &str) -> TransactionBuilder { - trace!( - "Set contract: {} to TransactionBuilder: {:?}", - contract, - self - ); - self.contract = contract.to_string(); - self } + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn set_method(mut self, method: &str) -> TransactionBuilder { - trace!("Set method: {} to TransactionBuilder: {:?}", method, self); - self.method = method.to_string(); - self } - pub fn add_param(mut self, param: ContractParam) -> TransactionBuilder { - trace!( - "Add ContractParam: {:?} to TransactionBuilder: {:?}", - param, - self - ); - - self.params.push(param); - - self + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn add_param + Debug>( + mut self, + param: T, + ) -> VdrResult { + self.params.push(param.try_into()?); + Ok(self) } + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn set_type(mut self, type_: TransactionType) -> TransactionBuilder { - trace!( - "Set TransactionType: {:?} to TransactionBuilder: {:?}", - type_, - self - ); - self.type_ = type_; - self } + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn set_from(mut self, from: &Address) -> TransactionBuilder { - trace!("Set from: {:?} to TransactionBuilder: {:?}", from, self); - self.from = Some(from.clone()); - self } + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub async fn build(self, client: &LedgerClient) -> VdrResult { let contract = client.contract(&self.contract)?; - let data = contract.encode_input(&self.method, &self.params)?; + + let data = contract + .function(&self.method)? + .encode_input(&self.params)?; + let nonce = match self.type_ { TransactionType::Write => { let from = self.from.as_ref().ok_or_else(|| { @@ -255,9 +268,7 @@ impl TransactionBuilder { "Transaction `sender` is not set".to_string(), ) })?; - - let nonce = client.get_transaction_count(from).await?; - Some(nonce.to_vec()) + Some(client.get_transaction_count(from).await?) } TransactionType::Read => None, }; @@ -272,45 +283,40 @@ impl TransactionBuilder { signature: RwLock::new(None), hash: None, }; - - trace!("Built transaction: {:?}", transaction); - Ok(transaction) } } #[derive(Clone, Debug, Default, PartialEq)] -pub struct TransactionParser { +pub(crate) struct TransactionParser { contract: String, method: String, } impl TransactionParser { + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn new() -> TransactionParser { TransactionParser::default() } + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn set_contract(mut self, contract: &str) -> TransactionParser { self.contract = contract.to_string(); - - trace!( - "Set contract: {} to TransactionParser: {:?}", - contract, - self - ); - self } + #[logfn(Trace)] + #[logfn_inputs(Trace)] pub fn set_method(mut self, method: &str) -> TransactionParser { self.method = method.to_string(); - - trace!("Set method: {} to TransactionParser: {:?}", method, self); - self } - pub fn parse>( + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn parse + Debug>( self, client: &LedgerClient, bytes: &[u8], @@ -324,7 +330,10 @@ impl TransactionParser { return Err(vdr_error); } let contract = client.contract(&self.contract)?; - let output = contract.decode_output(&self.method, bytes)?; + let output = contract + .function(&self.method)? + .decode_output(bytes) + .map(ContractOutput::from)?; if output.is_empty() { let vdr_error = @@ -335,24 +344,154 @@ impl TransactionParser { return Err(vdr_error); } - trace!("Decoded transaction output: {:?}", output); - T::try_from(output) } } -#[cfg(test)] -impl std::clone::Clone for Transaction { - fn clone(&self) -> Self { - Transaction { - type_: self.type_.clone(), - from: self.from.clone(), - to: self.to.clone(), - nonce: self.nonce.clone(), - chain_id: self.chain_id.clone(), - data: self.data.clone(), - signature: RwLock::new(self.signature.read().unwrap().clone()), - hash: self.hash.clone(), - } +/// Transaction Endorsing object +#[derive(Debug, Default, Serialize, Deserialize)] +pub struct TransactionEndorsingData { + pub to: Address, + pub from: Address, + pub params: Vec, +} + +impl TransactionEndorsingData { + const PREFIX: u8 = 0x19; + const VERSION: u8 = 0x0; + + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn get_signing_bytes(&self) -> VdrResult> { + let mut tokens = vec![ + ContractParam::Uint(Uint::from(Self::PREFIX)), + ContractParam::FixedBytes(vec![Self::VERSION]), + (&self.to).try_into()?, + ]; + tokens.extend_from_slice(self.params.as_slice()); + + let encoded = ethers_core::abi::encode_packed(&tokens).unwrap(); + let hash = sha3::Keccak256::digest(encoded).to_vec(); + Ok(hash) + } +} + +#[derive(Debug, Default)] +pub(crate) struct TransactionEndorsingDataBuilder { + contract: String, + identity: Address, + params: Vec, +} + +impl TransactionEndorsingDataBuilder { + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn new() -> TransactionEndorsingDataBuilder { + TransactionEndorsingDataBuilder::default() + } + + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn set_contract(mut self, contract: &str) -> TransactionEndorsingDataBuilder { + self.contract = contract.to_string(); + self + } + + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn set_identity(mut self, identity: &Address) -> TransactionEndorsingDataBuilder { + self.identity = identity.to_owned(); + self + } + + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub fn add_param + Debug>( + mut self, + param: T, + ) -> VdrResult { + self.params.push(param.try_into()?); + Ok(self) + } + + #[logfn(Trace)] + #[logfn_inputs(Trace)] + pub async fn build(self, client: &LedgerClient) -> VdrResult { + let contract = client.contract(&self.contract)?; + Ok(TransactionEndorsingData { + to: contract.address().to_owned(), + from: self.identity.to_owned(), + params: self.params, + }) + } +} + +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +pub struct Block(u64); + +impl Block { + pub fn value(&self) -> u64 { + self.0 } + + pub fn is_none(&self) -> bool { + self.0 == 0 + } +} + +impl From for Block { + fn from(value: u64) -> Self { + Block(value) + } +} + +impl TryFrom for Block { + type Error = VdrError; + + fn try_from(value: ContractOutput) -> Result { + Ok(Block::from(value.get_u64(0)?)) + } +} + +impl From<&Block> for ContractParam { + fn from(value: &Block) -> Self { + ContractParam::Uint(Uint::from(value.0)) + } +} + +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +pub struct Nonce(u64); + +impl Nonce { + pub fn value(&self) -> u64 { + self.0 + } +} + +impl From for Nonce { + fn from(value: u64) -> Self { + Nonce(value) + } +} + +impl TryFrom for Nonce { + type Error = VdrError; + + fn try_from(value: ContractOutput) -> Result { + Ok(Nonce::from(value.get_u64(0)?)) + } +} + +impl TryFrom<&Nonce> for ContractParam { + type Error = VdrError; + + fn try_from(value: &Nonce) -> Result { + UintBytesParam::from(value.0).try_into() + } +} + +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +pub struct BlockDetails { + pub number: u64, + pub timestamp: u64, } diff --git a/vdr/src/utils/common.rs b/vdr/src/utils/common.rs index 09a40980..4a2d7897 100644 --- a/vdr/src/utils/common.rs +++ b/vdr/src/utils/common.rs @@ -1,5 +1,5 @@ #[cfg(test)] -use rand::{distributions::Alphanumeric, Rng, RngCore}; +use rand::{distributions::Alphanumeric, Rng}; #[cfg(test)] pub fn rand_string() -> String { @@ -10,13 +10,6 @@ pub fn rand_string() -> String { .collect() } -#[cfg(test)] -pub fn rand_bytes() -> Vec { - let mut data = [0u8; 16]; - rand::thread_rng().fill_bytes(&mut data); - data.to_vec() -} - #[cfg(test)] pub fn init_env_logger() { let _ = env_logger::builder().is_test(true).try_init(); diff --git a/vdr/src/utils/mod.rs b/vdr/src/utils/mod.rs index bfe42f1f..fc2cd74a 100644 --- a/vdr/src/utils/mod.rs +++ b/vdr/src/utils/mod.rs @@ -1,4 +1,54 @@ mod common; +use log_derive::{logfn, logfn_inputs}; + +use crate::{VdrError, VdrResult}; #[cfg(test)] -pub use common::{init_env_logger, rand_bytes, rand_string}; +pub use common::{init_env_logger, rand_string}; + +#[logfn(Trace)] +#[logfn_inputs(Trace)] +pub fn format_bytes32_string(string: &str) -> VdrResult<[u8; 32]> { + let str_bytes = string.as_bytes(); + if str_bytes.len() > 32 { + return Err(VdrError::CommonInvalidData( + "Unable to represent string as bytes32".to_string(), + )); + } + + let mut bytes32: [u8; 32] = [0u8; 32]; + bytes32[..str_bytes.len()].copy_from_slice(str_bytes); + + Ok(bytes32) +} + +#[logfn(Trace)] +#[logfn_inputs(Trace)] +pub fn format_bytes32(bytes: &[u8]) -> VdrResult<[u8; 32]> { + if bytes.len() > 32 { + return Err(VdrError::CommonInvalidData( + "Unable to represent string as bytes32".to_string(), + )); + } + + let mut bytes32: [u8; 32] = [0u8; 32]; + bytes32[32 - bytes.len()..32].copy_from_slice(bytes); + + Ok(bytes32) +} + +#[logfn(Trace)] +#[logfn_inputs(Trace)] +pub fn parse_bytes32_string(bytes: &[u8]) -> VdrResult<&str> { + let mut length = 0; + while length < 32 && bytes[length] != 0 { + length += 1; + } + + std::str::from_utf8(&bytes[..length]).map_err(|err| { + VdrError::CommonInvalidData(format!( + "Unable to decode string from bytes. Err: {:?}", + err + )) + }) +} diff --git a/vdr/uniffi.toml b/vdr/uniffi.toml index b1c0d19f..2048895e 100644 --- a/vdr/uniffi.toml +++ b/vdr/uniffi.toml @@ -1,2 +1,2 @@ [bindings.kotlin] -cdylib_name = "indy2_vdr_uniffi" \ No newline at end of file +cdylib_name = "indy_besu_vdr_uniffi" \ No newline at end of file diff --git a/vdr/uniffi/Cargo.toml b/vdr/uniffi/Cargo.toml index b932c089..26914252 100644 --- a/vdr/uniffi/Cargo.toml +++ b/vdr/uniffi/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "indy2-vdr-uniffi" +name = "indy-besu-vdr-uniffi" description = "Uni-FFI bindings for Indy 2.0 VDR" version = "0.1.0" authors = [ @@ -10,7 +10,7 @@ license = "Apache-2.0" readme = "./README.md" [lib] -name = "indy2_vdr_uniffi" +name = "indy_besu_vdr_uniffi" path = "src/lib.rs" crate-type = ["rlib", "cdylib"] @@ -22,7 +22,7 @@ path = "src/bin.rs" default = [] [dependencies] -indy2_vdr = { path = ".." } +indy-besu-vdr = { path = ".." } serde = "1.0.188" serde_derive = "1.0.188" serde_json = "1.0.107" diff --git a/vdr/uniffi/README.md b/vdr/uniffi/README.md index 5e291de6..cdba8ab5 100644 --- a/vdr/uniffi/README.md +++ b/vdr/uniffi/README.md @@ -13,7 +13,7 @@ language ``: ``` cargo build --release -cargo run --bin uniffi-bindgen generate --library target/release/libindy2_vdr_uniffi.dylib --language --out-dir out +cargo run --bin uniffi-bindgen generate --library target/release/libindy_besu_vdr_uniffi.dylib --language --out-dir out ``` The check `out` directory which will contain generated bindings. diff --git a/vdr/uniffi/build.rs b/vdr/uniffi/build.rs index c01f70f5..9c9a00e4 100644 --- a/vdr/uniffi/build.rs +++ b/vdr/uniffi/build.rs @@ -1,3 +1,3 @@ fn main() { - uniffi::generate_scaffolding("src/indy2_vdr.udl").unwrap(); + uniffi::generate_scaffolding("src/indy_besu_vdr.udl").unwrap(); } diff --git a/vdr/uniffi/src/ffi/client.rs b/vdr/uniffi/src/ffi/client.rs index 88980d32..f17de2ed 100644 --- a/vdr/uniffi/src/ffi/client.rs +++ b/vdr/uniffi/src/ffi/client.rs @@ -1,12 +1,13 @@ use crate::{ ffi::{ error::VdrResult, + event_query::{EventLog, EventQuery}, transaction::Transaction, types::{ContractConfig, PingStatus, QuorumConfig}, }, VdrError, }; -use indy2_vdr::{ContractConfig as ContractConfig_, LedgerClient as LedgerClient_}; +use indy_besu_vdr::{ContractConfig as ContractConfig_, LedgerClient as LedgerClient_}; #[derive(uniffi::Object)] pub struct LedgerClient { @@ -48,6 +49,16 @@ impl LedgerClient { .map_err(VdrError::from) } + pub async fn query_events(&self, query: &EventQuery) -> VdrResult> { + Ok(self + .client + .query_events(&query.query) + .await? + .into_iter() + .map(EventLog::from) + .collect()) + } + pub async fn get_receipt(&self, hash: Vec) -> VdrResult { self.client.get_receipt(&hash).await.map_err(VdrError::from) } diff --git a/vdr/uniffi/src/ffi/contracts/credential_definition_registry.rs b/vdr/uniffi/src/ffi/contracts/credential_definition_registry.rs index bd871b68..6f2f5009 100644 --- a/vdr/uniffi/src/ffi/contracts/credential_definition_registry.rs +++ b/vdr/uniffi/src/ffi/contracts/credential_definition_registry.rs @@ -1,9 +1,11 @@ use crate::ffi::{ client::LedgerClient, error::{VdrError, VdrResult}, - transaction::Transaction, + event_query::{EventLog, EventQuery}, + transaction::{Transaction, TransactionEndorsingData}, + types::SignatureData, }; -use indy2_vdr::{credential_definition_registry, Address, CredentialDefinitionId}; +use indy_besu_vdr::{credential_definition_registry, Address, Block, CredentialDefinitionId}; use serde_json::json; #[uniffi::export(async_runtime = "tokio")] @@ -29,27 +31,111 @@ pub async fn build_create_credential_definition_transaction( } #[uniffi::export(async_runtime = "tokio")] -pub async fn build_resolve_credential_definition_transaction( +pub async fn build_create_credential_definition_endorsing_data( client: &LedgerClient, id: &str, + credential_definition: &str, +) -> VdrResult { + let credential_definition = + serde_json::from_str(credential_definition).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse credential definition. Err: {:?}", err), + })?; + credential_definition_registry::build_create_credential_definition_endorsing_data( + &client.client, + &CredentialDefinitionId::from(id), + &credential_definition, + ) + .await + .map(TransactionEndorsingData::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_create_credential_definition_signed_transaction( + client: &LedgerClient, + from: &str, + id: &str, + credential_definition: &str, + signature: SignatureData, ) -> VdrResult { - let transaction = - credential_definition_registry::build_resolve_credential_definition_transaction( - &client.client, - &CredentialDefinitionId::from(id), - ) - .await?; - Ok(Transaction { transaction }) + let credential_definition = + serde_json::from_str(credential_definition).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse credential definition. Err: {:?}", err), + })?; + credential_definition_registry::build_create_credential_definition_signed_transaction( + &client.client, + &Address::from(from), + &CredentialDefinitionId::from(id), + &credential_definition, + &signature.into(), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_get_credential_definition_created_transaction( + client: &LedgerClient, + id: &str, +) -> VdrResult { + credential_definition_registry::build_get_credential_definition_created_transaction( + &client.client, + &CredentialDefinitionId::from(id), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_get_credential_definition_query( + client: &LedgerClient, + id: &str, + from_block: Option, + to_block: Option, +) -> VdrResult { + credential_definition_registry::build_get_credential_definition_query( + &client.client, + &CredentialDefinitionId::from(id), + from_block.map(Block::from).as_ref(), + to_block.map(Block::from).as_ref(), + ) + .await + .map(EventQuery::from) + .map_err(VdrError::from) } #[uniffi::export] -pub fn parse_resolve_credential_definition_result( +pub fn parse_credential_definition_created_result( client: &LedgerClient, bytes: Vec, -) -> VdrResult { - let cred_def = credential_definition_registry::parse_resolve_credential_definition_result( +) -> VdrResult { + let create = credential_definition_registry::parse_credential_definition_created_result( &client.client, &bytes, )?; + Ok(create.value()) +} + +#[uniffi::export] +pub fn parse_credential_definition_created_event( + client: &LedgerClient, + log: EventLog, +) -> VdrResult { + let event = credential_definition_registry::parse_credential_definition_created_event( + &client.client, + &log.into(), + )?; + Ok(json!(event).to_string()) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn resolve_credential_definition(client: &LedgerClient, id: &str) -> VdrResult { + let cred_def = credential_definition_registry::resolve_credential_definition( + &client.client, + &CredentialDefinitionId::from(id), + ) + .await?; Ok(json!(cred_def).to_string()) } diff --git a/vdr/uniffi/src/ffi/contracts/did_ethr_registry.rs b/vdr/uniffi/src/ffi/contracts/did_ethr_registry.rs new file mode 100644 index 00000000..2710bb1e --- /dev/null +++ b/vdr/uniffi/src/ffi/contracts/did_ethr_registry.rs @@ -0,0 +1,555 @@ +use crate::ffi::{ + client::LedgerClient, + error::{VdrError, VdrResult}, + event_query::{EventLog, EventQuery}, + transaction::{Transaction, TransactionEndorsingData}, + types::SignatureData, +}; +use indy_besu_vdr::{ + did_ethr_registry, Address, Block, DelegateType, DidAttributeChanged as DidAttributeChanged_, + DidDelegateChanged as DidDelegateChanged_, DidDocAttribute, DidEvents as DidEvents_, + DidOwnerChanged as DidOwnerChanged_, + DidResolutionOptions as DidResolutionOptions_, Validity, DID, +}; +use serde_json::json; + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_change_owner_transaction( + client: &LedgerClient, + from: &str, + did: &str, + new_owner: &str, +) -> VdrResult { + did_ethr_registry::build_did_change_owner_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &Address::from(new_owner), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_change_owner_endorsing_data( + client: &LedgerClient, + did: &str, + new_owner: &str, +) -> VdrResult { + did_ethr_registry::build_did_change_owner_endorsing_data( + &client.client, + &DID::from(did), + &Address::from(new_owner), + ) + .await + .map(TransactionEndorsingData::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_change_owner_signed_transaction( + client: &LedgerClient, + from: &str, + did: &str, + new_owner: &str, + signature: SignatureData, +) -> VdrResult { + did_ethr_registry::build_did_change_owner_signed_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &Address::from(new_owner), + &signature.into(), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_add_delegate_transaction( + client: &LedgerClient, + from: &str, + did: &str, + delegate_type: &str, + delegate: &str, + validity: u64, +) -> VdrResult { + did_ethr_registry::build_did_add_delegate_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &DelegateType::try_from(delegate_type)?, + &Address::from(delegate), + &Validity::from(validity), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_add_delegate_endorsing_data( + client: &LedgerClient, + did: &str, + delegate_type: &str, + delegate: &str, + validity: u64, +) -> VdrResult { + did_ethr_registry::build_did_add_delegate_endorsing_data( + &client.client, + &DID::from(did), + &DelegateType::try_from(delegate_type)?, + &Address::from(delegate), + &Validity::from(validity), + ) + .await + .map(TransactionEndorsingData::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_add_delegate_signed_transaction( + client: &LedgerClient, + from: &str, + did: &str, + delegate_type: &str, + delegate: &str, + validity: u64, + signature: SignatureData, +) -> VdrResult { + did_ethr_registry::build_did_add_delegate_signed_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &DelegateType::try_from(delegate_type)?, + &Address::from(delegate), + &Validity::from(validity), + &signature.into(), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_revoke_delegate_transaction( + client: &LedgerClient, + from: &str, + did: &str, + delegate_type: &str, + delegate: &str, +) -> VdrResult { + did_ethr_registry::build_did_revoke_delegate_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &DelegateType::try_from(delegate_type)?, + &Address::from(delegate), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_revoke_delegate_endorsing_data( + client: &LedgerClient, + did: &str, + delegate_type: &str, + delegate: &str, +) -> VdrResult { + did_ethr_registry::build_did_revoke_delegate_endorsing_data( + &client.client, + &DID::from(did), + &DelegateType::try_from(delegate_type)?, + &Address::from(delegate), + ) + .await + .map(TransactionEndorsingData::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_revoke_delegate_signed_transaction( + client: &LedgerClient, + from: &str, + did: &str, + delegate_type: &str, + delegate: &str, + signature: SignatureData, +) -> VdrResult { + did_ethr_registry::build_did_revoke_delegate_signed_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &DelegateType::try_from(delegate_type)?, + &Address::from(delegate), + &signature.into(), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_set_attribute_transaction( + client: &LedgerClient, + from: &str, + did: &str, + attribute: &str, + validity: u64, +) -> VdrResult { + let attribute: DidDocAttribute = + serde_json::from_str(attribute).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse DID Attribute. Err: {:?}", err), + })?; + + did_ethr_registry::build_did_set_attribute_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &attribute, + &Validity::from(validity), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_set_attribute_endorsing_data( + client: &LedgerClient, + did: &str, + attribute: &str, + validity: u64, +) -> VdrResult { + let attribute: DidDocAttribute = + serde_json::from_str(attribute).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse DID Attribute. Err: {:?}", err), + })?; + + did_ethr_registry::build_did_set_attribute_endorsing_data( + &client.client, + &DID::from(did), + &attribute, + &Validity::from(validity), + ) + .await + .map(TransactionEndorsingData::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_set_attribute_signed_transaction( + client: &LedgerClient, + from: &str, + did: &str, + attribute: &str, + validity: u64, + signature: SignatureData, +) -> VdrResult { + let attribute: DidDocAttribute = + serde_json::from_str(attribute).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse DID Attribute. Err: {:?}", err), + })?; + + did_ethr_registry::build_did_set_attribute_signed_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &attribute, + &Validity::from(validity), + &signature.into(), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_revoke_attribute_transaction( + client: &LedgerClient, + from: &str, + did: &str, + attribute: &str, +) -> VdrResult { + let attribute: DidDocAttribute = + serde_json::from_str(attribute).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse DID Attribute. Err: {:?}", err), + })?; + + did_ethr_registry::build_did_revoke_attribute_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &attribute, + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_revoke_attribute_endorsing_data( + client: &LedgerClient, + did: &str, + attribute: &str, +) -> VdrResult { + let attribute: DidDocAttribute = + serde_json::from_str(attribute).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse DID Attribute. Err: {:?}", err), + })?; + + did_ethr_registry::build_did_revoke_attribute_endorsing_data( + &client.client, + &DID::from(did), + &attribute, + ) + .await + .map(TransactionEndorsingData::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_did_revoke_attribute_signed_transaction( + client: &LedgerClient, + from: &str, + did: &str, + attribute: &str, + signature: SignatureData, +) -> VdrResult { + let attribute: DidDocAttribute = + serde_json::from_str(attribute).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse DID Attribute. Err: {:?}", err), + })?; + + did_ethr_registry::build_did_revoke_attribute_signed_transaction( + &client.client, + &Address::from(from), + &DID::from(did), + &attribute, + &signature.into(), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_get_did_owner_transaction( + client: &LedgerClient, + did: &str, +) -> VdrResult { + did_ethr_registry::build_get_did_owner_transaction(&client.client, &DID::from(did)) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_get_did_changed_transaction( + client: &LedgerClient, + did: &str, +) -> VdrResult { + did_ethr_registry::build_get_did_changed_transaction(&client.client, &DID::from(did)) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_get_identity_nonce_transaction( + client: &LedgerClient, + identity: &str, +) -> VdrResult { + did_ethr_registry::build_get_identity_nonce_transaction( + &client.client, + &Address::from(identity), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_get_did_events_query( + client: &LedgerClient, + did: &str, + from_block: Option, + to_block: Option, +) -> VdrResult { + did_ethr_registry::build_get_did_events_query( + &client.client, + &DID::from(did), + from_block.map(Block::from).as_ref(), + to_block.map(Block::from).as_ref(), + ) + .await + .map(EventQuery::from) + .map_err(VdrError::from) +} + +#[uniffi::export] +pub fn parse_did_changed_result(client: &LedgerClient, bytes: Vec) -> VdrResult { + let block = did_ethr_registry::parse_did_changed_result(&client.client, &bytes)?; + Ok(block.value()) +} + +#[uniffi::export] +pub fn parse_did_owner_result(client: &LedgerClient, bytes: Vec) -> VdrResult { + let address = did_ethr_registry::parse_did_owner_result(&client.client, &bytes)?; + Ok(address.to_string()) +} + +#[uniffi::export] +pub fn parse_did_attribute_changed_event_response( + client: &LedgerClient, + log: EventLog, +) -> VdrResult { + did_ethr_registry::parse_did_attribute_changed_event_response(&client.client, &log.into()) + .map(DidAttributeChanged::from) + .map_err(VdrError::from) +} + +#[uniffi::export] +pub fn parse_did_delegate_changed_event_response( + client: &LedgerClient, + log: EventLog, +) -> VdrResult { + did_ethr_registry::parse_did_delegate_changed_event_response(&client.client, &log.into()) + .map(DidDelegateChanged::from) + .map_err(VdrError::from) +} + +#[uniffi::export] +pub fn parse_did_owner_changed_event_response( + client: &LedgerClient, + log: EventLog, +) -> VdrResult { + did_ethr_registry::parse_did_owner_changed_event_response(&client.client, &log.into()) + .map(DidOwnerChanged::from) + .map_err(VdrError::from) +} + +#[uniffi::export] +pub fn parse_did_event_response(client: &LedgerClient, log: EventLog) -> VdrResult { + did_ethr_registry::parse_did_event_response(&client.client, &log.into()) + .map(DidEvents::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn resolve_did( + client: &LedgerClient, + did: &str, + options: Option, +) -> VdrResult { + let options = match options { + Some(options) => Some(DidResolutionOptions_::try_from(options)?), + None => None, + }; + let did_with_meta = + did_ethr_registry::resolve_did(&client.client, &DID::from(did), options.as_ref()).await?; + Ok(json!(did_with_meta).to_string()) +} + +#[derive(uniffi::Record)] +pub struct DidAttributeChanged { + pub identity: String, + pub name: String, + pub value: Vec, + pub valid_to: u64, + pub previous_change: u64, +} + +impl From for DidAttributeChanged { + fn from(event: DidAttributeChanged_) -> Self { + DidAttributeChanged { + identity: event.identity.to_string(), + name: event.name, + value: event.value, + valid_to: event.valid_to, + previous_change: event.previous_change.value(), + } + } +} + +#[derive(uniffi::Record)] +pub struct DidDelegateChanged { + pub identity: String, + pub delegate: String, + pub delegate_type: Vec, + pub valid_to: u64, + pub previous_change: u64, +} + +impl From for DidDelegateChanged { + fn from(event: DidDelegateChanged_) -> Self { + DidDelegateChanged { + identity: event.identity.to_string(), + delegate: event.delegate.to_string(), + delegate_type: event.delegate_type, + valid_to: event.valid_to, + previous_change: event.previous_change.value(), + } + } +} + +#[derive(uniffi::Record)] +pub struct DidOwnerChanged { + pub identity: String, + pub owner: String, + pub previous_change: u64, +} + +impl From for DidOwnerChanged { + fn from(event: DidOwnerChanged_) -> Self { + DidOwnerChanged { + identity: event.identity.to_string(), + owner: event.owner.to_string(), + previous_change: event.previous_change.value(), + } + } +} + +#[derive(uniffi::Enum)] +pub enum DidEvents { + AttributeChangedEvent { event: DidAttributeChanged }, + DelegateChanged { event: DidDelegateChanged }, + OwnerChanged { event: DidOwnerChanged }, +} + +impl From for DidEvents { + fn from(event: DidEvents_) -> Self { + match event { + DidEvents_::AttributeChangedEvent(event) => DidEvents::AttributeChangedEvent { + event: event.into(), + }, + DidEvents_::DelegateChanged(event) => DidEvents::DelegateChanged { + event: event.into(), + }, + DidEvents_::OwnerChanged(event) => DidEvents::OwnerChanged { + event: event.into(), + }, + } + } +} + +#[derive(uniffi::Record)] +pub struct DidResolutionOptions { + pub accept: Option, + pub block_tag: Option, +} + +impl TryFrom for DidResolutionOptions_ { + type Error = VdrError; + + fn try_from(value: DidResolutionOptions) -> Result { + Ok(DidResolutionOptions_ { + accept: value.accept, + block_tag: value.block_tag.map(|block_tag| Block::from(block_tag)), + }) + } +} diff --git a/vdr/uniffi/src/ffi/contracts/did_registry.rs b/vdr/uniffi/src/ffi/contracts/did_registry.rs deleted file mode 100644 index d7ad36a3..00000000 --- a/vdr/uniffi/src/ffi/contracts/did_registry.rs +++ /dev/null @@ -1,82 +0,0 @@ -use crate::ffi::{ - client::LedgerClient, - error::{VdrError, VdrResult}, - transaction::Transaction, -}; -use indy2_vdr::{did_registry, Address, DID}; -use serde_json::json; - -#[uniffi::export(async_runtime = "tokio")] -pub async fn build_create_did_transaction( - client: &LedgerClient, - from: &str, - identity: &str, - did: &str, - did_doc: &str, -) -> VdrResult { - let did_doc = serde_json::from_str(did_doc).map_err(|err| VdrError::CommonInvalidData { - msg: format!("Unable to parse DID DDocument. Err: {:?}", err), - })?; - let transaction = - did_registry::build_create_did_transaction( - &client.client, - &Address::from(from), - &Address::from(identity), - &DID::from(did), - &did_doc, - ) - .await?; - Ok(Transaction { transaction }) -} - -#[uniffi::export(async_runtime = "tokio")] -pub async fn build_update_did_transaction( - client: &LedgerClient, - from: &str, - did: &str, - did_doc: &str, -) -> VdrResult { - let did_doc = serde_json::from_str(did_doc).map_err(|err| VdrError::CommonInvalidData { - msg: format!("Unable to parse DID DDocument. Err: {:?}", err), - })?; - let transaction = - did_registry::build_update_did_transaction( - &client.client, - &Address::from(from), - &DID::from(did), - &did_doc - ) - .await?; - Ok(Transaction { transaction }) -} - -#[uniffi::export(async_runtime = "tokio")] -pub async fn build_deactivate_did_transaction( - client: &LedgerClient, - from: &str, - did: &str, -) -> VdrResult { - let transaction = did_registry::build_deactivate_did_transaction( - &client.client, - &Address::from(from), - &DID::from(did), - ) - .await?; - Ok(Transaction { transaction }) -} - -#[uniffi::export(async_runtime = "tokio")] -pub async fn build_resolve_did_transaction( - client: &LedgerClient, - did: &str, -) -> VdrResult { - let transaction = - did_registry::build_resolve_did_transaction(&client.client, &DID::from(did)).await?; - Ok(Transaction { transaction }) -} - -#[uniffi::export] -pub fn parse_resolve_did_result(client: &LedgerClient, bytes: Vec) -> VdrResult { - let did_doc = did_registry::parse_resolve_did_result(&client.client, &bytes)?; - Ok(json!(did_doc).to_string()) -} diff --git a/vdr/uniffi/src/ffi/contracts/mod.rs b/vdr/uniffi/src/ffi/contracts/mod.rs index 26f2bef4..f7e7e433 100644 --- a/vdr/uniffi/src/ffi/contracts/mod.rs +++ b/vdr/uniffi/src/ffi/contracts/mod.rs @@ -1,5 +1,5 @@ pub mod credential_definition_registry; -pub mod did_registry; +pub mod did_ethr_registry; pub mod role_control; pub mod schema_registry; pub mod validator_control; diff --git a/vdr/uniffi/src/ffi/contracts/role_control.rs b/vdr/uniffi/src/ffi/contracts/role_control.rs index c91c9524..970548b9 100644 --- a/vdr/uniffi/src/ffi/contracts/role_control.rs +++ b/vdr/uniffi/src/ffi/contracts/role_control.rs @@ -3,7 +3,7 @@ use crate::ffi::{ error::{VdrError, VdrResult}, transaction::Transaction, }; -use indy2_vdr::{role_control, Address, Role}; +use indy_besu_vdr::{role_control, Address, Role}; #[uniffi::export(async_runtime = "tokio")] pub async fn build_assign_role_transaction( diff --git a/vdr/uniffi/src/ffi/contracts/schema_registry.rs b/vdr/uniffi/src/ffi/contracts/schema_registry.rs index b19af315..16f7befd 100644 --- a/vdr/uniffi/src/ffi/contracts/schema_registry.rs +++ b/vdr/uniffi/src/ffi/contracts/schema_registry.rs @@ -1,9 +1,11 @@ use crate::ffi::{ client::LedgerClient, error::{VdrError, VdrResult}, - transaction::Transaction, + event_query::{EventLog, EventQuery}, + transaction::{Transaction, TransactionEndorsingData}, + types::SignatureData, }; -use indy2_vdr::{schema_registry, Address, SchemaId}; +use indy_besu_vdr::{schema_registry, Address, Block, SchemaId}; use serde_json::json; #[uniffi::export(async_runtime = "tokio")] @@ -27,18 +29,90 @@ pub async fn build_create_schema_transaction( } #[uniffi::export(async_runtime = "tokio")] -pub async fn build_resolve_schema_transaction( +pub async fn build_create_schema_endorsing_data( client: &LedgerClient, id: &str, + schema: &str, +) -> VdrResult { + let schema = serde_json::from_str(schema).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse credential definition. Err: {:?}", err), + })?; + schema_registry::build_create_schema_endorsing_data( + &client.client, + &SchemaId::from(id), + &schema, + ) + .await + .map(TransactionEndorsingData::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_create_schema_signed_transaction( + client: &LedgerClient, + from: &str, + id: &str, + schema: &str, + signature: SignatureData, ) -> VdrResult { - let transaction = - schema_registry::build_resolve_schema_transaction(&client.client, &SchemaId::from(id)) - .await?; - Ok(Transaction { transaction }) + let schema = serde_json::from_str(schema).map_err(|err| VdrError::CommonInvalidData { + msg: format!("Unable to parse credential definition. Err: {:?}", err), + })?; + schema_registry::build_create_schema_signed_transaction( + &client.client, + &Address::from(from), + &SchemaId::from(id), + &schema, + &signature.into(), + ) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_get_schema_created_transaction( + client: &LedgerClient, + id: &str, +) -> VdrResult { + schema_registry::build_get_schema_created_transaction(&client.client, &SchemaId::from(id)) + .await + .map(Transaction::from) + .map_err(VdrError::from) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn build_get_schema_query( + client: &LedgerClient, + id: &str, + from_block: Option, + to_block: Option, +) -> VdrResult { + schema_registry::build_get_schema_query( + &client.client, + &SchemaId::from(id), + from_block.map(Block::from).as_ref(), + to_block.map(Block::from).as_ref(), + ) + .await + .map(EventQuery::from) + .map_err(VdrError::from) } #[uniffi::export] -pub fn parse_resolve_schema_result(client: &LedgerClient, bytes: Vec) -> VdrResult { - let schema = schema_registry::parse_resolve_schema_result(&client.client, &bytes)?; +pub fn parse_schema_created_result(client: &LedgerClient, bytes: Vec) -> VdrResult { + let create = schema_registry::parse_schema_created_result(&client.client, &bytes)?; + Ok(create.value()) +} + +#[uniffi::export] +pub fn parse_schema_created_event(client: &LedgerClient, log: EventLog) -> VdrResult { + let event = schema_registry::parse_schema_created_event(&client.client, &log.into())?; + Ok(json!(event).to_string()) +} + +#[uniffi::export(async_runtime = "tokio")] +pub async fn resolve_schema(client: &LedgerClient, id: &str) -> VdrResult { + let schema = schema_registry::resolve_schema(&client.client, &SchemaId::from(id)).await?; Ok(json!(schema).to_string()) } diff --git a/vdr/uniffi/src/ffi/contracts/validator_control.rs b/vdr/uniffi/src/ffi/contracts/validator_control.rs index c43ae73e..9fdab119 100644 --- a/vdr/uniffi/src/ffi/contracts/validator_control.rs +++ b/vdr/uniffi/src/ffi/contracts/validator_control.rs @@ -1,5 +1,5 @@ use crate::ffi::{client::LedgerClient, error::VdrResult, transaction::Transaction}; -use indy2_vdr::{validator_control, Address}; +use indy_besu_vdr::{validator_control, Address}; use serde_json::json; #[uniffi::export(async_runtime = "tokio")] diff --git a/vdr/uniffi/src/ffi/error.rs b/vdr/uniffi/src/ffi/error.rs index 3565d756..dd210c10 100644 --- a/vdr/uniffi/src/ffi/error.rs +++ b/vdr/uniffi/src/ffi/error.rs @@ -1,4 +1,4 @@ -use indy2_vdr::VdrError as VdrError_; +use indy_besu_vdr::VdrError as VdrError_; #[derive(thiserror::Error, Debug, uniffi::Error)] pub enum VdrError { @@ -60,9 +60,7 @@ impl From for VdrError { fn from(error: VdrError_) -> Self { match error { VdrError_::ClientNodeUnreachable => VdrError::ClientNodeUnreachable, - VdrError_::ClientInvalidTransaction(msg) => { - VdrError::ClientInvalidTransaction { msg } - } + VdrError_::ClientInvalidTransaction(msg) => VdrError::ClientInvalidTransaction { msg }, VdrError_::ClientInvalidResponse(msg) => VdrError::ClientInvalidResponse { msg }, VdrError_::ClientTransactionReverted(msg) => { VdrError::ClientTransactionReverted { msg } diff --git a/vdr/uniffi/src/ffi/event_query.rs b/vdr/uniffi/src/ffi/event_query.rs new file mode 100644 index 00000000..29d4e542 --- /dev/null +++ b/vdr/uniffi/src/ffi/event_query.rs @@ -0,0 +1,61 @@ +use indy_besu_vdr::{Address, Block, EventLog as EventLog_, EventQuery as EventQuery_}; + +#[derive(uniffi::Object)] +pub struct EventQuery { + pub query: EventQuery_, +} + +#[uniffi::export] +impl EventQuery { + #[uniffi::constructor] + pub fn new( + address: String, + from_block: Option, + to_block: Option, + event_signature: Option, + event_filter: Option, + ) -> EventQuery { + EventQuery { + query: EventQuery_ { + address: Address::from(address.as_str()), + from_block: from_block.map(Block::from), + to_block: to_block.map(Block::from), + event_signature, + event_filter, + }, + } + } +} + +impl From for EventQuery { + fn from(query: EventQuery_) -> Self { + EventQuery { query } + } +} + +#[derive(uniffi::Record)] +pub struct EventLog { + pub topics: Vec>, + pub data: Vec, + pub block: u64, +} + +impl From for EventLog { + fn from(log: EventLog_) -> Self { + EventLog { + topics: log + .topics + .into_iter() + .map(|topic| topic.0.to_vec()) + .collect(), + data: log.data, + block: log.block.value(), + } + } +} + +impl Into for EventLog { + fn into(self) -> EventLog_ { + EventLog_::new(self.topics, self.data, self.block) + } +} diff --git a/vdr/uniffi/src/ffi/mod.rs b/vdr/uniffi/src/ffi/mod.rs index 50021ef2..c552bb07 100644 --- a/vdr/uniffi/src/ffi/mod.rs +++ b/vdr/uniffi/src/ffi/mod.rs @@ -1,11 +1,13 @@ pub mod client; pub mod contracts; pub mod error; +pub mod event_query; pub mod transaction; pub mod types; pub use client::*; pub use contracts::*; pub use error::*; +pub use event_query::*; pub use transaction::*; pub use types::*; diff --git a/vdr/uniffi/src/ffi/transaction.rs b/vdr/uniffi/src/ffi/transaction.rs index 97158966..1595697e 100644 --- a/vdr/uniffi/src/ffi/transaction.rs +++ b/vdr/uniffi/src/ffi/transaction.rs @@ -2,7 +2,9 @@ use crate::ffi::{ error::{VdrError, VdrResult}, types::{SignatureData, TransactionSignature, TransactionType}, }; -use indy2_vdr::{Address, Transaction as Transaction_}; +use indy_besu_vdr::{ + Address, Transaction as Transaction_, TransactionEndorsingData as TransactionEndorsingData_, +}; #[derive(uniffi::Object)] pub struct Transaction { @@ -18,7 +20,7 @@ impl Transaction { to: String, chain_id: u64, data: Vec, - nonce: Option>, + nonce: Option, signature: Option, ) -> Transaction { Transaction { @@ -42,3 +44,27 @@ impl Transaction { self.transaction.set_signature(signature_data.into()) } } + +impl From for Transaction { + fn from(transaction: Transaction_) -> Self { + Transaction { transaction } + } +} + +#[derive(uniffi::Object)] +pub struct TransactionEndorsingData { + pub data: TransactionEndorsingData_, +} + +#[uniffi::export] +impl TransactionEndorsingData { + pub fn get_signing_bytes(&self) -> VdrResult> { + self.data.get_signing_bytes().map_err(VdrError::from) + } +} + +impl From for TransactionEndorsingData { + fn from(data: TransactionEndorsingData_) -> Self { + TransactionEndorsingData { data } + } +} diff --git a/vdr/uniffi/src/ffi/types.rs b/vdr/uniffi/src/ffi/types.rs index 6ac676ac..4a61c548 100644 --- a/vdr/uniffi/src/ffi/types.rs +++ b/vdr/uniffi/src/ffi/types.rs @@ -1,5 +1,5 @@ use crate::JsonValue; -use indy2_vdr::{ +use indy_besu_vdr::{ ContractConfig as ContractConfig_, ContractSpec as ContractSpec_, PingStatus as PingStatus_, QuorumConfig as QuorumConfig_, SignatureData as SignatureData_, Status as Status_, TransactionSignature as TransactionSignature_, TransactionType as TransactionType_, @@ -12,8 +12,13 @@ pub struct PingStatus { #[derive(uniffi::Enum)] pub enum Status { - Ok, - Err { msg: String }, + Ok { + block_number: u64, + block_timestamp: u64, + }, + Err { + msg: String, + }, } #[derive(uniffi::Record)] @@ -67,7 +72,13 @@ impl From for PingStatus { impl From for Status { fn from(status: Status_) -> Self { match status { - Status_::Ok => Status::Ok, + Status_::Ok { + block_number, + block_timestamp, + } => Status::Ok { + block_number, + block_timestamp, + }, Status_::Err { msg } => Status::Err { msg }, } } diff --git a/vdr/uniffi/src/indy2_vdr.udl b/vdr/uniffi/src/indy_besu_vdr.udl similarity index 67% rename from vdr/uniffi/src/indy2_vdr.udl rename to vdr/uniffi/src/indy_besu_vdr.udl index 706bbea2..c09fef34 100644 --- a/vdr/uniffi/src/indy2_vdr.udl +++ b/vdr/uniffi/src/indy_besu_vdr.udl @@ -1,3 +1,3 @@ // This file is required for UNI-FFI binding generation -namespace indy2_vdr {}; +namespace indy_besu_vdr {}; diff --git a/vdr/uniffi/src/lib.rs b/vdr/uniffi/src/lib.rs index 375abbd9..b072beeb 100644 --- a/vdr/uniffi/src/lib.rs +++ b/vdr/uniffi/src/lib.rs @@ -18,4 +18,4 @@ impl UniffiCustomTypeConverter for JsonValue { } uniffi::custom_type!(JsonValue, String); -uniffi::include_scaffolding!("indy2_vdr"); +uniffi::include_scaffolding!("indy_besu_vdr"); diff --git a/vdr/wasm/Cargo.toml b/vdr/wasm/Cargo.toml index 8860b59b..c497e323 100644 --- a/vdr/wasm/Cargo.toml +++ b/vdr/wasm/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "indy2-vdr-wasm" +name = "indy-besu-vdr-wasm" description = "JavaScript bindings for Indy 2.0 VDR" version = "0.1.0" authors = [ @@ -11,14 +11,14 @@ readme = "./README.md" [lib] crate-type = ["cdylib", "rlib"] -name = "indy2_vdr_wasm" +name = "indy_besu_vdr_wasm" path = "src/lib.rs" [features] default = [] [dependencies] -indy2_vdr = { path = "..", default-features = false, features = ['wasm'] } +indy-besu-vdr = { path = "..", default-features = false, features = ['wasm'] } wasm-bindgen = "0.2.87" wasm-bindgen-futures = "0.4.37" js-sys = "0.3.64" diff --git a/vdr/wasm/demo/node/package.json b/vdr/wasm/demo/node/package.json index 33cf03a8..c2050fbe 100644 --- a/vdr/wasm/demo/node/package.json +++ b/vdr/wasm/demo/node/package.json @@ -1,7 +1,7 @@ { - "name": "indy2-vdr-wasm-demo", + "name": "indy-besu-vdr-wasm-demo", "version": "0.1.0", - "description": "NodeJS demo for indy2-vdr wasm bindings", + "description": "NodeJS demo for indy-besu-vdr wasm bindings", "scripts": { "start": "ts-node src/main.ts", "check": "tslint -c tslint.json 'src/**/*.ts'" @@ -11,7 +11,7 @@ "dependencies": { "@types/bs58": "^4.0.4", "bs58": "^5.0.0", - "indy2-vdr": "file:../../pkg", + "indy-besu-vdr": "file:../../pkg", "secp256k1": "5.0.0", "typescript": "^4.5.2" }, diff --git a/vdr/wasm/demo/node/src/main.ts b/vdr/wasm/demo/node/src/main.ts index d1750eec..993598dd 100644 --- a/vdr/wasm/demo/node/src/main.ts +++ b/vdr/wasm/demo/node/src/main.ts @@ -1,77 +1,95 @@ import fs from "fs"; import secp256k1 from "secp256k1"; -import bs58 from "bs58"; -import { randomBytes } from 'crypto' -import { LedgerClient, IndyDidRegistry } from "indy2-vdr"; +import { LedgerClient, EthrDidRegistry, SchemaRegistry } from "indy-besu-vdr"; const chainId = 1337 const nodeAddress = 'http://127.0.0.1:8545' // set path to the compiled contract -const didRegistryConfig = { - address: '0x0000000000000000000000000000000000003333', - specPath: '/Users/indy-besu/smart_contracts/artifacts/contracts/did/IndyDidRegistry.sol/IndyDidRegistry.json' +const didEthrRegistryConfig = { + address: '0x0000000000000000000000000000000000018888', + specPath: '/Users/indy-besu/smart_contracts/artifacts/contracts/did/EthereumExtDidRegistry.sol/EthereumExtDidRegistry.json' +} +const schemaRegistryConfig = { + address: '0x0000000000000000000000000000000000005555', + specPath: '/Users/indy-besu/smart_contracts/artifacts/contracts/cl/SchemaRegistry.sol/SchemaRegistry.json' } -const account = '0xf0e2db6c8dc6c681bb5d6ad121a107f300e9b2b5' -const identity = '0xb9059400dcd05158ffd8ca092937989dd27b3bdc' -const secret = Uint8Array.from([ 139, 187, 177, 179, 69, 175, 86, 181, 96, 165, 178, 11, 212, 176, 237, 28, 216, 204, 153, 88, 161, 98, 98, 188, 117, 17, 132, 83, 203, 84, 109, 247 ]) -async function main() { +const trustee = { + address: '0xf0e2db6c8dc6c681bb5d6ad121a107f300e9b2b5', + secret: Uint8Array.from([ 139, 187, 177, 179, 69, 175, 86, 181, 96, 165, 178, 11, 212, 176, 237, 28, 216, 204, 153, 88, 161, 98, 98, 188, 117, 17, 132, 83, 203, 84, 109, 247 ]) +} +const identity = { + address: '0xce70ce892768d46caf120b600dec29ed20198982', + secret: Uint8Array.from([126, 218, 51, 235, 106, 56, 168, 226, 49, 234, 92, 61, 233, 13, 242, 75, 137, 130, 228, 222, 148, 239, 14, 63, 135, 13, 140, 163, 134, 166, 49, 50]) +} + +function sign(message: Uint8Array, key: Uint8Array) { + let signature = secp256k1.ecdsaSign(message, key) + return { + recovery_id: signature.recid, + signature: signature.signature + } +} + +async function demo() { console.log('1. Init client') const contractConfigs = [ { - "address": didRegistryConfig.address, - "spec": JSON.parse(fs.readFileSync(didRegistryConfig.specPath, 'utf8')), + "address": didEthrRegistryConfig.address, + "spec": JSON.parse(fs.readFileSync(didEthrRegistryConfig.specPath, 'utf8')), + }, + { + "address": schemaRegistryConfig.address, + "spec": JSON.parse(fs.readFileSync(schemaRegistryConfig.specPath, 'utf8')), } ] const client = new LedgerClient(chainId, nodeAddress, contractConfigs, null) const status = await client.ping() console.log('Status: ' + JSON.stringify(status, null, 2)) - console.log('2. Publish DID Document') - const did = 'did:indy2:' + bs58.encode(randomBytes(16)) - const kid = did + '#KEY-1' - const didDoc = { - "@context": [ "https://www.w3.org/ns/did/v1" ], - "id": did, - "verificationMethod": [ - { - "controller": did, - "id": kid, - "publicKeyMultibase": "zAKJP3f7BD6W4iWEQ9jwndVTCBq8ua2Utt8EEjJ6Vxsf", - "type": "Ed25519VerificationKey2018" - } - ], - "authentication": [ kid ], - "alsoKnownAs": [], - "assertionMethod": [], - "capabilityDelegation": [], - "capabilityInvocation": [], - "controller": [], - "keyAgreement": [], - "service": [] - } - console.log('DID Document: ' + JSON.stringify(didDoc, null, 2)) - let transaction = await IndyDidRegistry.buildCreateDidTransaction(client, account, identity, did, didDoc) - const bytesToSign = transaction.getSigningBytes() - const signature = secp256k1.ecdsaSign(bytesToSign, secret) - transaction.setSignature({ - recovery_id: signature.recid, - signature: signature.signature - }) - - const txnHash = await client.submitTransaction(transaction) - console.log('Transaction hash: ' + txnHash) - - const receipt = await client.getReceipt(txnHash) + console.log('2. Publish and Modify DID') + const did = 'did:ethr:' + identity.address + const serviceAttribute = {"serviceEndpoint":"http://10.0.0.2","type":"TestService"} + let endorsingData = await EthrDidRegistry.buildDidSetAttributeEndorsingData(client, did, serviceAttribute, BigInt(100000)) + let authorSignature = sign(endorsingData.getSigningBytes(), identity.secret) + let transaction = await EthrDidRegistry.buildDidSetAttributeSignedTransaction(client, trustee.address, did, serviceAttribute, BigInt(100000), authorSignature) + let transactionSignature = sign(transaction.getSigningBytes(), trustee.secret) + transaction.setSignature(transactionSignature) + let txnHash = await client.submitTransaction(transaction) + let receipt = await client.getReceipt(txnHash) console.log('Transaction receipt: ' + receipt) console.log('3. Resolve DID Document') - transaction = await IndyDidRegistry.buildResolveDidTransaction(client, didDoc.id) - const response = await client.submitTransaction(transaction) - const resolvedDidDoc = IndyDidRegistry.parseResolveDidResult(client, response) - console.log('Resolved DID Document: ' + JSON.stringify(resolvedDidDoc, null, 2)) + const didWithMeta = await EthrDidRegistry.resolveDid(client, did, null) + console.log('Resolved DID Document: ' + JSON.stringify(didWithMeta, null, 2)) + + console.log('4. Publish Schema') + const name = (Math.random() + 1).toString(36).substring(7) + const schemaId = `did:ethr:test:${identity.address}/anoncreds/v0/SCHEMA/${name}/1.0.0` + const schema = { + "attrNames": [ "First Name", "Last Name" ], + "issuerId": `did:ethr:test:${identity.address}`, + "name": name, + "version": "1.0.0" + } + let schemaEndorsingData = await SchemaRegistry.buildCreateSchemaEndorsingData(client, schemaId, schema) + authorSignature = sign(schemaEndorsingData.getSigningBytes(), identity.secret) + transaction = await SchemaRegistry.buildCreateSchemaSignedTransaction(client, trustee.address, schemaId, schema, authorSignature) + transactionSignature = sign(transaction.getSigningBytes(), trustee.secret) + transaction.setSignature(transactionSignature) + txnHash = await client.submitTransaction(transaction) + receipt = await client.getReceipt(txnHash) + console.log(' Schema Transaction receipt: ' + receipt) + + console.log('5. Resolve Schema') + const resolvedSchema = await SchemaRegistry.resolveSchema(client, schemaId) + console.log(' Resolved Schema: ' + JSON.stringify(resolvedSchema, null, 2)) +} + +async function main() { + await demo() } main() diff --git a/vdr/wasm/src/client.rs b/vdr/wasm/src/client.rs index ae3c2b6c..e4834c5c 100644 --- a/vdr/wasm/src/client.rs +++ b/vdr/wasm/src/client.rs @@ -3,10 +3,11 @@ use std::rc::Rc; use wasm_bindgen::prelude::*; use wasm_bindgen_futures::future_to_promise; -use indy2_vdr::{ContractConfig, LedgerClient, QuorumConfig}; +use indy_besu_vdr::{ContractConfig, LedgerClient, QuorumConfig}; use crate::{ error::{JsResult, Result}, + event_query::EventQueryWrapper, transaction::TransactionWrapper, }; @@ -57,6 +58,17 @@ impl LedgerClientWrapper { }) } + #[wasm_bindgen(js_name = queryEvents)] + pub async fn query_events(&self, query: &EventQueryWrapper) -> Promise { + let client = self.0.clone(); + let query = query.0.clone(); + future_to_promise(async move { + let response = client.query_events(&query).await.as_js()?; + let result: JsValue = serde_wasm_bindgen::to_value(&response)?; + Ok(result) + }) + } + #[wasm_bindgen(js_name = getReceipt)] pub async fn get_receipt(&self, hash: Vec) -> Promise { let client = self.0.clone(); diff --git a/vdr/wasm/src/contracts/credential_definition_registry.rs b/vdr/wasm/src/contracts/credential_definition_registry.rs index 293103bb..d1bca190 100644 --- a/vdr/wasm/src/contracts/credential_definition_registry.rs +++ b/vdr/wasm/src/contracts/credential_definition_registry.rs @@ -1,5 +1,6 @@ -use indy2_vdr::{ - credential_definition_registry, Address, CredentialDefinition, CredentialDefinitionId, +use indy_besu_vdr::{ + credential_definition_registry, Address, Block, CredentialDefinition, CredentialDefinitionId, + EventLog, SignatureData, }; use std::rc::Rc; use wasm_bindgen::prelude::*; @@ -7,7 +8,8 @@ use wasm_bindgen::prelude::*; use crate::{ client::LedgerClientWrapper, error::{JsResult, Result}, - transaction::TransactionWrapper, + event_query::EventQueryWrapper, + transaction::{TransactionEndorsingDataWrapper, TransactionWrapper}, }; #[wasm_bindgen(js_name = CredentialDefinitionRegistry)] @@ -35,14 +37,57 @@ impl CredentialDefinitionRegistry { Ok(TransactionWrapper(Rc::new(transaction))) } - #[wasm_bindgen(js_name = buildResolveCredentialDefinitionTransaction)] - pub async fn build_resolve_credential_definition_transaction( + #[wasm_bindgen(js_name = buildCreateSchemaEndorsingData)] + pub async fn build_create_schema_endorsing_data( client: &LedgerClientWrapper, id: &str, + cred_def: JsValue, + ) -> Result { + let cred_def: CredentialDefinition = serde_wasm_bindgen::from_value(cred_def)?; + let id = CredentialDefinitionId::from(id); + let data = + credential_definition_registry::build_create_credential_definition_endorsing_data( + &client.0, &id, &cred_def, + ) + .await + .as_js()?; + Ok(TransactionEndorsingDataWrapper(Rc::new(data))) + } + + #[wasm_bindgen(js_name = buildCreateCredentialDefinitionSignedTransaction)] + pub async fn build_create_credential_definition_signed_transaction( + client: &LedgerClientWrapper, + from: &str, + id: &str, + cred_def: JsValue, + signature_data: JsValue, ) -> Result { + let client = client.0.clone(); + let cred_def: CredentialDefinition = serde_wasm_bindgen::from_value(cred_def)?; + let address = Address::from(from); let id = CredentialDefinitionId::from(id); + let signature_data: SignatureData = serde_wasm_bindgen::from_value(signature_data)?; let transaction = - credential_definition_registry::build_resolve_credential_definition_transaction( + credential_definition_registry::build_create_credential_definition_signed_transaction( + &client, + &address, + &id, + &cred_def, + &signature_data, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildGetCredentialDefinitionCreatedTransaction)] + pub async fn build_get_credential_definition_created_transaction( + client: &LedgerClientWrapper, + id: &str, + ) -> Result { + let id = CredentialDefinitionId::from(id); + let transaction = + credential_definition_registry::build_get_credential_definition_created_transaction( &client.0, &id, ) .await @@ -50,15 +95,63 @@ impl CredentialDefinitionRegistry { Ok(TransactionWrapper(Rc::new(transaction))) } - #[wasm_bindgen(js_name = parseResolveCredentialDefinitionResult)] - pub fn parse_resolve_credential_definition_result( + #[wasm_bindgen(js_name = buildGetCredentialDefinitionQuery)] + pub async fn build_get_credential_definition_query( + client: &LedgerClientWrapper, + id: &str, + from_block: Option, + to_block: Option, + ) -> Result { + let id = CredentialDefinitionId::from(id); + let from_block = from_block.map(Block::from); + let to_block = to_block.map(Block::from); + let query = credential_definition_registry::build_get_credential_definition_query( + &client.0, + &id, + from_block.as_ref(), + to_block.as_ref(), + ) + .await + .as_js()?; + Ok(EventQueryWrapper(Rc::new(query))) + } + + #[wasm_bindgen(js_name = parseCredentialDefinitionCreatedResult)] + pub fn parse_credential_definition_created_result( client: &LedgerClientWrapper, bytes: Vec, - ) -> Result { - let cred_def = credential_definition_registry::parse_resolve_credential_definition_result( + ) -> Result { + let block = credential_definition_registry::parse_credential_definition_created_result( &client.0, &bytes, ) .as_js()?; + Ok(block.value()) + } + + #[wasm_bindgen(js_name = parseCredentialDefinitionCreatedEvent)] + pub fn parse_credential_definition_created_event( + client: &LedgerClientWrapper, + log: JsValue, + ) -> Result { + let log: EventLog = serde_wasm_bindgen::from_value(log)?; + let event = credential_definition_registry::parse_credential_definition_created_event( + &client.0, &log, + ) + .as_js()?; + let result: JsValue = serde_wasm_bindgen::to_value(&event)?; + Ok(result) + } + + #[wasm_bindgen(js_name = resolveCredentialDefinition)] + pub async fn resolve_credential_definition( + client: &LedgerClientWrapper, + id: &str, + ) -> Result { + let id = CredentialDefinitionId::from(id); + let cred_def = + credential_definition_registry::resolve_credential_definition(&client.0, &id) + .await + .as_js()?; let result: JsValue = serde_wasm_bindgen::to_value(&cred_def)?; Ok(result) } diff --git a/vdr/wasm/src/contracts/did_ethr_registry.rs b/vdr/wasm/src/contracts/did_ethr_registry.rs new file mode 100644 index 00000000..5eef7241 --- /dev/null +++ b/vdr/wasm/src/contracts/did_ethr_registry.rs @@ -0,0 +1,493 @@ +use indy_besu_vdr::{ + did_ethr_registry, Address, Block, DelegateType, DidDocAttribute, DidResolutionOptions, + EventLog, SignatureData, Validity, DID, +}; +use std::rc::Rc; +use wasm_bindgen::prelude::*; + +use crate::{ + client::LedgerClientWrapper, + error::{JsResult, Result}, + event_query::EventQueryWrapper, + transaction::{TransactionEndorsingDataWrapper, TransactionWrapper}, +}; + +#[wasm_bindgen(js_name = EthrDidRegistry)] +pub struct EthrDidRegistry; + +#[wasm_bindgen(js_class = EthrDidRegistry)] +impl EthrDidRegistry { + #[wasm_bindgen(js_name = buildDidChangeOwnerTransaction)] + pub async fn build_did_change_owner_transaction( + client: &LedgerClientWrapper, + sender: &str, + did: &str, + new_owner: &str, + ) -> Result { + let sender = Address::from(sender); + let did = DID::from(did); + let new_owner = Address::from(new_owner); + let transaction = did_ethr_registry::build_did_change_owner_transaction( + &client.0, &sender, &did, &new_owner, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidChangeOwnerEndorsingData)] + pub async fn build_did_change_owner_endorsing_data( + client: &LedgerClientWrapper, + did: &str, + new_owner: &str, + ) -> Result { + let did = DID::from(did); + let new_owner = Address::from(new_owner); + let data = + did_ethr_registry::build_did_change_owner_endorsing_data(&client.0, &did, &new_owner) + .await + .as_js()?; + Ok(TransactionEndorsingDataWrapper(Rc::new(data))) + } + + #[wasm_bindgen(js_name = buildDidChangeOwnerSignedTransaction)] + pub async fn build_did_change_owner_signed_transaction( + client: &LedgerClientWrapper, + sender: &str, + did: &str, + new_owner: &str, + signature_data: JsValue, + ) -> Result { + let sender = Address::from(sender); + let did = DID::from(did); + let new_owner = Address::from(new_owner); + let signature_data: SignatureData = serde_wasm_bindgen::from_value(signature_data)?; + let transaction = did_ethr_registry::build_did_change_owner_signed_transaction( + &client.0, + &sender, + &did, + &new_owner, + &signature_data, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidAddDelegateTransaction)] + pub async fn build_did_add_delegate_transaction( + client: &LedgerClientWrapper, + sender: &str, + did: &str, + delegate_type: &str, + delegate: &str, + validity: u64, + ) -> Result { + let sender = Address::from(sender); + let did = DID::from(did); + let delegate_type = DelegateType::try_from(delegate_type).as_js()?; + let delegate = Address::from(delegate); + let validity = Validity::from(validity); + let transaction = did_ethr_registry::build_did_add_delegate_transaction( + &client.0, + &sender, + &did, + &delegate_type, + &delegate, + &validity, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidAddDelegateEndorsingData)] + pub async fn build_did_add_delegate_endorsing_data( + client: &LedgerClientWrapper, + did: &str, + delegate_type: &str, + delegate: &str, + validity: u64, + ) -> Result { + let did = DID::from(did); + let delegate_type = DelegateType::try_from(delegate_type).as_js()?; + let delegate = Address::from(delegate); + let validity = Validity::from(validity); + let transaction = did_ethr_registry::build_did_add_delegate_endorsing_data( + &client.0, + &did, + &delegate_type, + &delegate, + &validity, + ) + .await + .as_js()?; + Ok(TransactionEndorsingDataWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidAddDelegateSignedTransaction)] + pub async fn build_did_add_delegate_signed_transaction( + client: &LedgerClientWrapper, + sender: &str, + did: &str, + delegate_type: &str, + delegate: &str, + validity: u64, + signature_data: JsValue, + ) -> Result { + let sender = Address::from(sender); + let did = DID::from(did); + let delegate_type = DelegateType::try_from(delegate_type).as_js()?; + let delegate = Address::from(delegate); + let validity = Validity::from(validity); + let signature_data: SignatureData = serde_wasm_bindgen::from_value(signature_data)?; + let transaction = did_ethr_registry::build_did_add_delegate_signed_transaction( + &client.0, + &sender, + &did, + &delegate_type, + &delegate, + &validity, + &signature_data, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidRevokeDelegateTransaction)] + pub async fn build_did_revoke_delegate_transaction( + client: &LedgerClientWrapper, + sender: &str, + did: &str, + delegate_type: &str, + delegate: &str, + ) -> Result { + let sender = Address::from(sender); + let did = DID::from(did); + let delegate_type = DelegateType::try_from(delegate_type).as_js()?; + let delegate = Address::from(delegate); + let transaction = did_ethr_registry::build_did_revoke_delegate_transaction( + &client.0, + &sender, + &did, + &delegate_type, + &delegate, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidRevokeDelegateEndorsingData)] + pub async fn build_did_revoke_delegate_endorsing_data( + client: &LedgerClientWrapper, + did: &str, + delegate_type: &str, + delegate: &str, + ) -> Result { + let did = DID::from(did); + let delegate_type = DelegateType::try_from(delegate_type).as_js()?; + let delegate = Address::from(delegate); + let transaction = did_ethr_registry::build_did_revoke_delegate_endorsing_data( + &client.0, + &did, + &delegate_type, + &delegate, + ) + .await + .as_js()?; + Ok(TransactionEndorsingDataWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidRevokeDelegateSignedTransaction)] + pub async fn build_did_revoke_delegate_signed_transaction( + client: &LedgerClientWrapper, + sender: &str, + did: &str, + delegate_type: &str, + delegate: &str, + signature_data: JsValue, + ) -> Result { + let sender = Address::from(sender); + let did = DID::from(did); + let delegate_type = DelegateType::try_from(delegate_type).as_js()?; + let delegate = Address::from(delegate); + let signature_data: SignatureData = serde_wasm_bindgen::from_value(signature_data)?; + let transaction = did_ethr_registry::build_did_revoke_delegate_signed_transaction( + &client.0, + &sender, + &did, + &delegate_type, + &delegate, + &signature_data, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidSetAttributeTransaction)] + pub async fn build_did_set_attribute_transaction( + client: &LedgerClientWrapper, + sender: &str, + did: &str, + attribute: JsValue, + validity: u64, + ) -> Result { + let sender = Address::from(sender); + let did = DID::from(did); + let did_attribute: DidDocAttribute = serde_wasm_bindgen::from_value(attribute)?; + let validity = Validity::from(validity); + let transaction = did_ethr_registry::build_did_set_attribute_transaction( + &client.0, + &sender, + &did, + &did_attribute, + &validity, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidSetAttributeEndorsingData)] + pub async fn build_did_set_attribute_endorsing_data( + client: &LedgerClientWrapper, + did: &str, + attribute: JsValue, + validity: u64, + ) -> Result { + let did = DID::from(did); + let did_attribute: DidDocAttribute = serde_wasm_bindgen::from_value(attribute)?; + let validity = Validity::from(validity); + let transaction = did_ethr_registry::build_did_set_attribute_endorsing_data( + &client.0, + &did, + &did_attribute, + &validity, + ) + .await + .as_js()?; + Ok(TransactionEndorsingDataWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidSetAttributeSignedTransaction)] + pub async fn build_did_set_attribute_signed_transaction( + client: &LedgerClientWrapper, + sender: &str, + did: &str, + attribute: JsValue, + validity: u64, + signature_data: JsValue, + ) -> Result { + let sender = Address::from(sender); + let did = DID::from(did); + let did_attribute: DidDocAttribute = serde_wasm_bindgen::from_value(attribute)?; + let validity = Validity::from(validity); + let signature_data: SignatureData = serde_wasm_bindgen::from_value(signature_data)?; + let transaction = did_ethr_registry::build_did_set_attribute_signed_transaction( + &client.0, + &sender, + &did, + &did_attribute, + &validity, + &signature_data, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidRevokeAttributeTransaction)] + pub async fn build_did_revoke_attribute_transaction( + client: &LedgerClientWrapper, + sender: &str, + did: &str, + attribute: JsValue, + ) -> Result { + let sender = Address::from(sender); + let did = DID::from(did); + let did_attribute: DidDocAttribute = serde_wasm_bindgen::from_value(attribute)?; + let transaction = did_ethr_registry::build_did_revoke_attribute_transaction( + &client.0, + &sender, + &did, + &did_attribute, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidRevokeAttributeEndorsingData)] + pub async fn build_did_revoke_attribute_endorsing_data( + client: &LedgerClientWrapper, + did: &str, + attribute: JsValue, + ) -> Result { + let did = DID::from(did); + let did_attribute: DidDocAttribute = serde_wasm_bindgen::from_value(attribute)?; + let transaction = did_ethr_registry::build_did_revoke_attribute_endorsing_data( + &client.0, + &did, + &did_attribute, + ) + .await + .as_js()?; + Ok(TransactionEndorsingDataWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildDidRevokeAttributeSignedTransaction)] + pub async fn build_did_revoke_attribute_signed_transaction( + client: &LedgerClientWrapper, + sender: &str, + did: &str, + attribute: JsValue, + signature_data: JsValue, + ) -> Result { + let sender = Address::from(sender); + let did = DID::from(did); + let did_attribute: DidDocAttribute = serde_wasm_bindgen::from_value(attribute)?; + let signature_data: SignatureData = serde_wasm_bindgen::from_value(signature_data)?; + let transaction = did_ethr_registry::build_did_revoke_attribute_signed_transaction( + &client.0, + &sender, + &did, + &did_attribute, + &signature_data, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildGetDidOwnerTransaction)] + pub async fn build_get_did_owner_transaction( + client: &LedgerClientWrapper, + did: &str, + ) -> Result { + let did = DID::from(did); + let transaction = did_ethr_registry::build_get_did_owner_transaction(&client.0, &did) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildGetDidChangedTransaction)] + pub async fn build_get_did_changed_transaction( + client: &LedgerClientWrapper, + did: &str, + ) -> Result { + let did = DID::from(did); + let transaction = did_ethr_registry::build_get_did_changed_transaction(&client.0, &did) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildGetIdentityNonceTransaction)] + pub async fn build_get_identity_nonce_transaction( + client: &LedgerClientWrapper, + identity: &str, + ) -> Result { + let identity = Address::from(identity); + let transaction = + did_ethr_registry::build_get_identity_nonce_transaction(&client.0, &identity) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildGetDidEventsQuery)] + pub async fn build_get_did_events_query( + client: &LedgerClientWrapper, + did: &str, + from_block: Option, + to_block: Option, + ) -> Result { + let did = DID::from(did); + let from_block = from_block.map(Block::from); + let to_block = to_block.map(Block::from); + let query = did_ethr_registry::build_get_did_events_query( + &client.0, + &did, + from_block.as_ref(), + to_block.as_ref(), + ) + .await + .as_js()?; + Ok(EventQueryWrapper(Rc::new(query))) + } + + #[wasm_bindgen(js_name = parseDidChangedResult)] + pub fn parse_did_changed_result(client: &LedgerClientWrapper, bytes: Vec) -> Result { + let block = did_ethr_registry::parse_did_changed_result(&client.0, &bytes).as_js()?; + Ok(block.value()) + } + + #[wasm_bindgen(js_name = parseDidOwnerResult)] + pub fn parse_did_owner_result(client: &LedgerClientWrapper, bytes: Vec) -> Result { + let owner = did_ethr_registry::parse_did_owner_result(&client.0, &bytes).as_js()?; + Ok(owner.to_string()) + } + + #[wasm_bindgen(js_name = parseDidAttributeChangedEventResponse)] + pub fn parse_did_attribute_changed_event_response( + client: &LedgerClientWrapper, + log: JsValue, + ) -> Result { + let log: EventLog = serde_wasm_bindgen::from_value(log)?; + let event = did_ethr_registry::parse_did_attribute_changed_event_response(&client.0, &log) + .as_js()?; + let result: JsValue = serde_wasm_bindgen::to_value(&event)?; + Ok(result) + } + + #[wasm_bindgen(js_name = parseDidDelegateChangedEventResponse)] + pub fn parse_did_delegate_changed_event_response( + client: &LedgerClientWrapper, + log: JsValue, + ) -> Result { + let log: EventLog = serde_wasm_bindgen::from_value(log)?; + let event = did_ethr_registry::parse_did_delegate_changed_event_response(&client.0, &log) + .as_js()?; + let result: JsValue = serde_wasm_bindgen::to_value(&event)?; + Ok(result) + } + + #[wasm_bindgen(js_name = parseDidOwnerChangedEventResponse)] + pub fn parse_did_owner_changed_event_response( + client: &LedgerClientWrapper, + log: JsValue, + ) -> Result { + let log: EventLog = serde_wasm_bindgen::from_value(log)?; + let event = + did_ethr_registry::parse_did_owner_changed_event_response(&client.0, &log).as_js()?; + let result: JsValue = serde_wasm_bindgen::to_value(&event)?; + Ok(result) + } + + #[wasm_bindgen(js_name = parseDidEventResponse)] + pub fn parse_did_event_response(client: &LedgerClientWrapper, log: JsValue) -> Result { + let log: EventLog = serde_wasm_bindgen::from_value(log)?; + let event = did_ethr_registry::parse_did_event_response(&client.0, &log).as_js()?; + let result: JsValue = serde_wasm_bindgen::to_value(&event)?; + Ok(result) + } + + #[wasm_bindgen(js_name = resolveDid)] + pub async fn resolve_did( + client: &LedgerClientWrapper, + did: &str, + options: JsValue, + ) -> Result { + let did = DID::from(did); + let options: Option = serde_wasm_bindgen::from_value(options).ok(); + let did_with_meta = did_ethr_registry::resolve_did(&client.0, &did, options.as_ref()) + .await + .as_js()?; + let result: JsValue = serde_wasm_bindgen::to_value(&did_with_meta)?; + Ok(result) + } +} diff --git a/vdr/wasm/src/contracts/did_registry.rs b/vdr/wasm/src/contracts/did_registry.rs deleted file mode 100644 index daaebe30..00000000 --- a/vdr/wasm/src/contracts/did_registry.rs +++ /dev/null @@ -1,85 +0,0 @@ -use indy2_vdr::{did_registry, Address, DidDocument, DID}; -use std::rc::Rc; -use wasm_bindgen::prelude::*; - -use crate::{ - client::LedgerClientWrapper, - error::{JsResult, Result}, - transaction::TransactionWrapper, -}; - -#[wasm_bindgen(js_name = IndyDidRegistry)] -pub struct IndyDidRegistry; - -#[wasm_bindgen(js_class = IndyDidRegistry)] -impl IndyDidRegistry { - #[wasm_bindgen(js_name = buildCreateDidTransaction)] - pub async fn build_create_did_transaction( - client: &LedgerClientWrapper, - from: &str, - identity: &str, - did: &str, - did_doc: JsValue, - ) -> Result { - let did_doc: DidDocument = serde_wasm_bindgen::from_value(did_doc)?; - let address = Address::from(from); - let identity = Address::from(identity); - let did = DID::from(did); - let transaction = did_registry::build_create_did_transaction(&client.0, &address, &identity, &did, &did_doc) - .await - .as_js()?; - Ok(TransactionWrapper(Rc::new(transaction))) - } - - #[wasm_bindgen(js_name = buildUpdateDidTransaction)] - pub async fn build_update_did_transaction( - client: &LedgerClientWrapper, - from: &str, - did: &str, - did_doc: JsValue, - ) -> Result { - let did_doc: DidDocument = serde_wasm_bindgen::from_value(did_doc)?; - let address = Address::from(from); - let did = DID::from(did); - let transaction = did_registry::build_update_did_transaction(&client.0, &address, &did, &did_doc) - .await - .as_js()?; - Ok(TransactionWrapper(Rc::new(transaction))) - } - - #[wasm_bindgen(js_name = buildDeactivateDidTransaction)] - pub async fn build_deactivate_did_transaction( - client: &LedgerClientWrapper, - from: &str, - did: &str, - ) -> Result { - let address = Address::from(from); - let did = DID::from(did); - let transaction = did_registry::build_deactivate_did_transaction(&client.0, &address, &did) - .await - .as_js()?; - Ok(TransactionWrapper(Rc::new(transaction))) - } - - #[wasm_bindgen(js_name = buildResolveDidTransaction)] - pub async fn build_resolve_did_transaction( - client: &LedgerClientWrapper, - did: &str, - ) -> Result { - let did = DID::from(did); - let transaction = did_registry::build_resolve_did_transaction(&client.0, &did) - .await - .as_js()?; - Ok(TransactionWrapper(Rc::new(transaction))) - } - - #[wasm_bindgen(js_name = parseResolveDidResult)] - pub fn parse_resolve_did_result( - client: &LedgerClientWrapper, - bytes: Vec, - ) -> Result { - let did_doc = did_registry::parse_resolve_did_result(&client.0, &bytes).as_js()?; - let result: JsValue = serde_wasm_bindgen::to_value(&did_doc)?; - Ok(result) - } -} diff --git a/vdr/wasm/src/contracts/mod.rs b/vdr/wasm/src/contracts/mod.rs index 26f2bef4..f7e7e433 100644 --- a/vdr/wasm/src/contracts/mod.rs +++ b/vdr/wasm/src/contracts/mod.rs @@ -1,5 +1,5 @@ pub mod credential_definition_registry; -pub mod did_registry; +pub mod did_ethr_registry; pub mod role_control; pub mod schema_registry; pub mod validator_control; diff --git a/vdr/wasm/src/contracts/role_control.rs b/vdr/wasm/src/contracts/role_control.rs index 14365bef..905e98e0 100644 --- a/vdr/wasm/src/contracts/role_control.rs +++ b/vdr/wasm/src/contracts/role_control.rs @@ -1,4 +1,4 @@ -use indy2_vdr::{role_control, Address, Role}; +use indy_besu_vdr::{role_control, Address, Role}; use std::rc::Rc; use wasm_bindgen::prelude::*; diff --git a/vdr/wasm/src/contracts/schema_registry.rs b/vdr/wasm/src/contracts/schema_registry.rs index b7cc98ee..e103ffaa 100644 --- a/vdr/wasm/src/contracts/schema_registry.rs +++ b/vdr/wasm/src/contracts/schema_registry.rs @@ -1,11 +1,12 @@ -use indy2_vdr::{schema_registry, Address, Schema, SchemaId}; +use indy_besu_vdr::{schema_registry, Address, Block, EventLog, Schema, SchemaId, SignatureData}; use std::rc::Rc; use wasm_bindgen::prelude::*; use crate::{ client::LedgerClientWrapper, error::{JsResult, Result}, - transaction::TransactionWrapper, + event_query::EventQueryWrapper, + transaction::{TransactionEndorsingDataWrapper, TransactionWrapper}, }; #[wasm_bindgen(js_name = SchemaRegistry)] @@ -30,24 +31,103 @@ impl SchemaRegistry { Ok(TransactionWrapper(Rc::new(transaction))) } - #[wasm_bindgen(js_name = buildResolveSchemaTransaction)] - pub async fn build_resolve_schema_transaction( + #[wasm_bindgen(js_name = buildCreateSchemaEndorsingData)] + pub async fn build_create_schema_endorsing_data( + client: &LedgerClientWrapper, + id: &str, + schema: JsValue, + ) -> Result { + let schema: Schema = serde_wasm_bindgen::from_value(schema)?; + let id = SchemaId::from(id); + let data = schema_registry::build_create_schema_endorsing_data(&client.0, &id, &schema) + .await + .as_js()?; + Ok(TransactionEndorsingDataWrapper(Rc::new(data))) + } + + #[wasm_bindgen(js_name = buildCreateSchemaSignedTransaction)] + pub async fn build_create_schema_signed_transaction( + client: &LedgerClientWrapper, + from: &str, + id: &str, + schema: JsValue, + signature_data: JsValue, + ) -> Result { + let schema: Schema = serde_wasm_bindgen::from_value(schema)?; + let address = Address::from(from); + let id = SchemaId::from(id); + let signature_data: SignatureData = serde_wasm_bindgen::from_value(signature_data)?; + let transaction = schema_registry::build_create_schema_signed_transaction( + &client.0, + &address, + &id, + &schema, + &signature_data, + ) + .await + .as_js()?; + Ok(TransactionWrapper(Rc::new(transaction))) + } + + #[wasm_bindgen(js_name = buildGetSchemaCreatedTransaction)] + pub async fn build_get_schema_created_transaction( client: &LedgerClientWrapper, id: &str, ) -> Result { let id = SchemaId::from(id); - let transaction = schema_registry::build_resolve_schema_transaction(&client.0, &id) + let transaction = schema_registry::build_get_schema_created_transaction(&client.0, &id) .await .as_js()?; Ok(TransactionWrapper(Rc::new(transaction))) } - #[wasm_bindgen(js_name = parseResolveSchemaResult)] - pub fn parse_resolve_schema_result( + #[wasm_bindgen(js_name = buildGetSchemaQuery)] + pub async fn build_get_schema_query( + client: &LedgerClientWrapper, + id: &str, + from_block: Option, + to_block: Option, + ) -> Result { + let id = SchemaId::from(id); + let from_block = from_block.map(Block::from); + let to_block = to_block.map(Block::from); + let query = schema_registry::build_get_schema_query( + &client.0, + &id, + from_block.as_ref(), + to_block.as_ref(), + ) + .await + .as_js()?; + Ok(EventQueryWrapper(Rc::new(query))) + } + + #[wasm_bindgen(js_name = parseSchemaCreatedResult)] + pub fn parse_schema_created_result( client: &LedgerClientWrapper, bytes: Vec, + ) -> Result { + let block = schema_registry::parse_schema_created_result(&client.0, &bytes).as_js()?; + Ok(block.value()) + } + + #[wasm_bindgen(js_name = parseSchemaCreatedEvent)] + pub fn parse_schema_created_event( + client: &LedgerClientWrapper, + log: JsValue, ) -> Result { - let schema = schema_registry::parse_resolve_schema_result(&client.0, &bytes).as_js()?; + let log: EventLog = serde_wasm_bindgen::from_value(log)?; + let event = schema_registry::parse_schema_created_event(&client.0, &log).as_js()?; + let result: JsValue = serde_wasm_bindgen::to_value(&event)?; + Ok(result) + } + + #[wasm_bindgen(js_name = resolveSchema)] + pub async fn resolve_schema(client: &LedgerClientWrapper, id: &str) -> Result { + let id = SchemaId::from(id); + let schema = schema_registry::resolve_schema(&client.0, &id) + .await + .as_js()?; let result: JsValue = serde_wasm_bindgen::to_value(&schema)?; Ok(result) } diff --git a/vdr/wasm/src/contracts/validator_control.rs b/vdr/wasm/src/contracts/validator_control.rs index d5f806a0..34935328 100644 --- a/vdr/wasm/src/contracts/validator_control.rs +++ b/vdr/wasm/src/contracts/validator_control.rs @@ -1,4 +1,4 @@ -use indy2_vdr::{validator_control, Address}; +use indy_besu_vdr::{validator_control, Address}; use std::rc::Rc; use wasm_bindgen::prelude::*; diff --git a/vdr/wasm/src/error.rs b/vdr/wasm/src/error.rs index 724414c1..de9c1a80 100644 --- a/vdr/wasm/src/error.rs +++ b/vdr/wasm/src/error.rs @@ -1,4 +1,4 @@ -use indy2_vdr::VdrResult; +use indy_besu_vdr::VdrResult; use js_sys::Error as JsError; use wasm_bindgen::JsValue; diff --git a/vdr/wasm/src/event_query.rs b/vdr/wasm/src/event_query.rs new file mode 100644 index 00000000..88056202 --- /dev/null +++ b/vdr/wasm/src/event_query.rs @@ -0,0 +1,6 @@ +use indy_besu_vdr::EventQuery; +use std::rc::Rc; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen(js_name = EventQuery)] +pub struct EventQueryWrapper(pub(crate) Rc); diff --git a/vdr/wasm/src/lib.rs b/vdr/wasm/src/lib.rs index f0665266..a4c651d7 100644 --- a/vdr/wasm/src/lib.rs +++ b/vdr/wasm/src/lib.rs @@ -1,4 +1,5 @@ pub mod client; pub mod contracts; pub(crate) mod error; +pub mod event_query; pub mod transaction; diff --git a/vdr/wasm/src/transaction.rs b/vdr/wasm/src/transaction.rs index bef27cfc..7ca00ed5 100644 --- a/vdr/wasm/src/transaction.rs +++ b/vdr/wasm/src/transaction.rs @@ -1,4 +1,4 @@ -use indy2_vdr::{SignatureData, Transaction}; +use indy_besu_vdr::{SignatureData, Transaction, TransactionEndorsingData}; use std::rc::Rc; use wasm_bindgen::prelude::*; @@ -26,3 +26,15 @@ impl TransactionWrapper { Ok(()) } } + +#[wasm_bindgen(js_name = TransactionEndorsingData)] +pub struct TransactionEndorsingDataWrapper(pub(crate) Rc); + +#[wasm_bindgen(js_class = TransactionEndorsingData)] +impl TransactionEndorsingDataWrapper { + #[wasm_bindgen(js_name = getSigningBytes)] + pub fn get_signing_bytes(&self) -> Result> { + let bytes = self.0.get_signing_bytes().unwrap(); + Ok(bytes) + } +} diff --git a/vdr/wrappers/python/README.md b/vdr/wrappers/python/README.md index 9f5a5af5..cdcc0dc3 100644 --- a/vdr/wrappers/python/README.md +++ b/vdr/wrappers/python/README.md @@ -10,8 +10,8 @@ This is thin python package created on top of Indy Besu bindings generated using 1. Bindings building: * Build bindings as describe in uniffi [README.md](../../uniffi/README.md). - * Copy `uniffi/out/indy2_vdr` file and put into `wrappers/python/indy2_vdr` folder. - * Copy `uniffi/target/release/libindy2_vdr_uniffi.dylib` file and put into `wrappers/python/indy2_vdr` folder. + * Copy `uniffi/out/indy_besu_vdr` file and put into `wrappers/python/indy_besu_vdr` folder. + * Copy `uniffi/target/release/libindy_besu_vdr_uniffi.dylib` file and put into `wrappers/python/indy_besu_vdr` folder. 2. Package building: * Run the following commands: ``` diff --git a/vdr/wrappers/python/demo/test.py b/vdr/wrappers/python/demo/test.py index 68d04430..d41a0abd 100644 --- a/vdr/wrappers/python/demo/test.py +++ b/vdr/wrappers/python/demo/test.py @@ -1,81 +1,92 @@ import asyncio import json -import os -from eth_keys import keys - -import base58 +import secrets +import string -from indy2_vdr import * +from eth_keys import keys +from indy_besu_vdr import * # chain id of the running network chain_id = 1337 # address of an RPC node connected to the network node_address = 'http://127.0.0.1:8545' # address of deployed IndyDidRegistry smart contract -did_contact_address = '0x0000000000000000000000000000000000003333' +did_contact_address = '0x0000000000000000000000000000000000018888' +schema_contact_address = '0x0000000000000000000000000000000000005555' # Path to the compiled IndyDidRegistry smart contract -did_contact_spec_path = '/Users/indy-besu/smart_contracts/artifacts/contracts/did/IndyDidRegistry.sol/IndyDidRegistry.json' +did_contact_spec_path = '/Users/indy-besu/smart_contracts/artifacts/contracts/did/EthereumExtDidRegistry.sol/EthereumExtDidRegistry.json' +schema_contact_spec_path = '/Users/indy-besu/smart_contracts/artifacts/contracts/cl/SchemaRegistry.sol/SchemaRegistry.json' # Account address to use for sending transactions -account = '0xf0e2db6c8dc6c681bb5d6ad121a107f300e9b2b5' -identity = '0xb9059400dcd05158ffd8ca092937989dd27b3bdc' -# Account private key -account_key = '8bbbb1b345af56b560a5b20bd4b0ed1cd8cc9958a16262bc75118453cb546df7' +trustee = { + "address": '0xf0e2db6c8dc6c681bb5d6ad121a107f300e9b2b5', + "secret": '8bbbb1b345af56b560a5b20bd4b0ed1cd8cc9958a16262bc75118453cb546df7' +} +identity = { + "address": '0xce70ce892768d46caf120b600dec29ed20198982', + "secret": '7eda33eb6a38a8e231ea5c3de90df24b8982e4de94ef0e3f870d8ca386a63132' +} + + +def sign(secret: str, data: bytes): + signature = keys.PrivateKey(bytearray.fromhex(secret)).sign_msg_hash(data) + rec_id = int(signature[-1:][0]) + sig = signature[0:-1] + return SignatureData(rec_id, sig) async def demo(): print("1. Init client") contract_configs = [ - ContractConfig(did_contact_address, did_contact_spec_path, None) + ContractConfig(did_contact_address, did_contact_spec_path, None), + ContractConfig(schema_contact_address, schema_contact_spec_path, None), ] client = LedgerClient(chain_id, node_address, contract_configs, None) status = await client.ping() - print('Status: ' + str(status)) - - print("2. Publish DID Document") - did = 'did:indy2:testnet:' + str(base58.b58encode(os.urandom(16)).decode()) - kid = did + '#KEY-1' - did_doc = { - "@context": ["https://www.w3.org/ns/did/v1"], - "id": did, - "controller": [], - "verificationMethod": [ - { - "id": kid, - "type": "EcdsaSecp256k1VerificationKey2019", - "controller": did, - "publicKeyMultibase": "zQ3shnKp9QFbmV6Xj4YkoCg23DryaxNMTCJikSezYwLibafef" - } - ], - "authentication": [kid], - "assertionMethod": [], - "capabilityInvocation": [], - "capabilityDelegation": [], - "keyAgreement": [], - "service": [], - "alsoKnownAs": [] - } - - print('DID Document: ' + json.dumps(did_doc)) - - transaction = await build_create_did_transaction(client, account, identity, did, json.dumps(did_doc)) - bytes_to_sign = transaction.get_signing_bytes() - - signature = keys.PrivateKey(bytearray.fromhex(account_key)).sign_msg_hash(bytes_to_sign) - rec_id = int(signature[-1:][0]) - sig = signature[0:-1] - transaction.set_signature(SignatureData(rec_id, sig)) + print(' Status: ' + str(status)) + print("2. Publish DID") + did = 'did:ethr:' + identity['address'] + service_attribute = {"serviceEndpoint": "http://10.0.0.2", "type": "TestService"} + endorsing_data = await build_did_set_attribute_endorsing_data(client, did, json.dumps(service_attribute), 1000) + identity_signature = sign(identity["secret"], endorsing_data.get_signing_bytes()) + transaction = await build_did_set_attribute_signed_transaction(client, trustee["address"], did, + json.dumps(service_attribute), 1000, + identity_signature) + trustee_signature = sign(trustee["secret"], transaction.get_signing_bytes()) + transaction.set_signature(trustee_signature) txn_hash = await client.submit_transaction(transaction) - print('Transaction hash: ' + bytes(txn_hash).hex()) + print(' Transaction hash: ' + bytes(txn_hash).hex()) receipt = await client.get_receipt(txn_hash) - print('Transaction receipt: ' + str(receipt)) + print(' Transaction receipt: ' + str(receipt)) print("3. Resolve DID Document") - transaction = await build_resolve_did_transaction(client, did) - response = await client.submit_transaction(transaction) - resolved_did_doc = parse_resolve_did_result(client, response) - print('Resolved DID Document:' + resolved_did_doc) + resolved_did_doc = await resolve_did(client, did, None) + print(' Resolved DID Document:' + resolved_did_doc) + + print("4. Publish Schema") + name = ''.join(secrets.choice(string.ascii_uppercase + string.digits) for _ in range(6)) + schema_id = 'did:ethr:test:' + identity["address"] + '/anoncreds/v0/SCHEMA/' + name + '/1.0.0' + schema = { + "attrNames": ["First Name", "Last Name"], + "issuerId": 'did:ethr:test:' + identity["address"], + "name": name, + "version": "1.0.0" + } + endorsing_data = await build_create_schema_endorsing_data(client, schema_id, json.dumps(schema)) + identity_signature = sign(identity["secret"], endorsing_data.get_signing_bytes()) + transaction = await build_create_schema_signed_transaction(client, trustee["address"], schema_id, + json.dumps(schema), + identity_signature) + trustee_signature = sign(trustee["secret"], transaction.get_signing_bytes()) + transaction.set_signature(trustee_signature) + txn_hash = await client.submit_transaction(transaction) + print(' Transaction hash: ' + bytes(txn_hash).hex()) + receipt = await client.get_receipt(txn_hash) + print(' Transaction receipt: ' + str(receipt)) + print("5. Resolve Schema") + resolved_schema = await resolve_schema(client, schema_id) + print(' Resolved Schema:' + resolved_schema) if __name__ == "__main__": asyncio.get_event_loop().run_until_complete(demo()) diff --git a/vdr/wrappers/python/indy2_vdr/__init__.py b/vdr/wrappers/python/indy2_vdr/__init__.py deleted file mode 100644 index 15ada104..00000000 --- a/vdr/wrappers/python/indy2_vdr/__init__.py +++ /dev/null @@ -1,68 +0,0 @@ -"""Indy2 VDR Python wrapper""" -from .indy2_vdr import ( - InternalError, - Status, - TransactionType, - VdrError, - ContractConfig, - ContractSpec, - PingStatus, - SignatureData, - LedgerClient, - Transaction, - build_add_validator_transaction, - build_assign_role_transaction, - build_create_credential_definition_transaction, - build_create_did_transaction, - build_create_schema_transaction, - build_deactivate_did_transaction, - build_get_role_transaction, - build_get_validators_transaction, - build_has_role_transaction, - build_remove_validator_transaction, - build_resolve_credential_definition_transaction, - build_resolve_did_transaction, - build_resolve_schema_transaction, - build_revoke_role_transaction, - build_update_did_transaction, - parse_get_role_result, - parse_get_validators_result, - parse_has_role_result, - parse_resolve_credential_definition_result, - parse_resolve_did_result, - parse_resolve_schema_result -) - -__all__ = ( - "InternalError", - "Status", - "TransactionType", - "VdrError", - "ContractConfig", - "ContractSpec", - "PingStatus", - "SignatureData", - "LedgerClient", - "Transaction", - "build_add_validator_transaction", - "build_assign_role_transaction", - "build_create_credential_definition_transaction", - "build_create_did_transaction", - "build_create_schema_transaction", - "build_deactivate_did_transaction", - "build_get_role_transaction", - "build_get_validators_transaction", - "build_has_role_transaction", - "build_remove_validator_transaction", - "build_resolve_credential_definition_transaction", - "build_resolve_did_transaction", - "build_resolve_schema_transaction", - "build_revoke_role_transaction", - "build_update_did_transaction", - "parse_get_role_result", - "parse_get_validators_result", - "parse_has_role_result", - "parse_resolve_credential_definition_result", - "parse_resolve_did_result", - "parse_resolve_schema_result" -) diff --git a/vdr/wrappers/python/indy2_vdr/indy2_vdr.py b/vdr/wrappers/python/indy2_vdr/indy2_vdr.py deleted file mode 100644 index 1c91b326..00000000 --- a/vdr/wrappers/python/indy2_vdr/indy2_vdr.py +++ /dev/null @@ -1,2887 +0,0 @@ - - -# This file was autogenerated by some hot garbage in the `uniffi` crate. -# Trust me, you don't want to mess with it! - -# Common helper code. -# -# Ideally this would live in a separate .py file where it can be unittested etc -# in isolation, and perhaps even published as a re-useable package. -# -# However, it's important that the details of how this helper code works (e.g. the -# way that different builtin types are passed across the FFI) exactly match what's -# expected by the rust code on the other side of the interface. In practice right -# now that means coming from the exact some version of `uniffi` that was used to -# compile the rust component. The easiest way to ensure this is to bundle the Python -# helpers directly inline like we're doing here. - -import os -import sys -import ctypes -import enum -import struct -import contextlib -import datetime -import typing -import asyncio -import platform - -# Used for default argument values -_DEFAULT = object() - - -class _UniffiRustBuffer(ctypes.Structure): - _fields_ = [ - ("capacity", ctypes.c_int32), - ("len", ctypes.c_int32), - ("data", ctypes.POINTER(ctypes.c_char)), - ] - - @staticmethod - def alloc(size): - return _rust_call(_UniffiLib.ffi_indy2_vdr_uniffi_rustbuffer_alloc, size) - - @staticmethod - def reserve(rbuf, additional): - return _rust_call(_UniffiLib.ffi_indy2_vdr_uniffi_rustbuffer_reserve, rbuf, additional) - - def free(self): - return _rust_call(_UniffiLib.ffi_indy2_vdr_uniffi_rustbuffer_free, self) - - def __str__(self): - return "_UniffiRustBuffer(capacity={}, len={}, data={})".format( - self.capacity, - self.len, - self.data[0:self.len] - ) - - @contextlib.contextmanager - def alloc_with_builder(*args): - """Context-manger to allocate a buffer using a _UniffiRustBufferBuilder. - - The allocated buffer will be automatically freed if an error occurs, ensuring that - we don't accidentally leak it. - """ - builder = _UniffiRustBufferBuilder() - try: - yield builder - except: - builder.discard() - raise - - @contextlib.contextmanager - def consume_with_stream(self): - """Context-manager to consume a buffer using a _UniffiRustBufferStream. - - The _UniffiRustBuffer will be freed once the context-manager exits, ensuring that we don't - leak it even if an error occurs. - """ - try: - s = _UniffiRustBufferStream.from_rust_buffer(self) - yield s - if s.remaining() != 0: - raise RuntimeError("junk data left in buffer at end of consume_with_stream") - finally: - self.free() - - @contextlib.contextmanager - def read_with_stream(self): - """Context-manager to read a buffer using a _UniffiRustBufferStream. - - This is like consume_with_stream, but doesn't free the buffer afterwards. - It should only be used with borrowed `_UniffiRustBuffer` data. - """ - s = _UniffiRustBufferStream.from_rust_buffer(self) - yield s - if s.remaining() != 0: - raise RuntimeError("junk data left in buffer at end of read_with_stream") - -class _UniffiForeignBytes(ctypes.Structure): - _fields_ = [ - ("len", ctypes.c_int32), - ("data", ctypes.POINTER(ctypes.c_char)), - ] - - def __str__(self): - return "_UniffiForeignBytes(len={}, data={})".format(self.len, self.data[0:self.len]) - - -class _UniffiRustBufferStream: - """ - Helper for structured reading of bytes from a _UniffiRustBuffer - """ - - def __init__(self, data, len): - self.data = data - self.len = len - self.offset = 0 - - @classmethod - def from_rust_buffer(cls, buf): - return cls(buf.data, buf.len) - - def remaining(self): - return self.len - self.offset - - def _unpack_from(self, size, format): - if self.offset + size > self.len: - raise InternalError("read past end of rust buffer") - value = struct.unpack(format, self.data[self.offset:self.offset+size])[0] - self.offset += size - return value - - def read(self, size): - if self.offset + size > self.len: - raise InternalError("read past end of rust buffer") - data = self.data[self.offset:self.offset+size] - self.offset += size - return data - - def read_i8(self): - return self._unpack_from(1, ">b") - - def read_u8(self): - return self._unpack_from(1, ">B") - - def read_i16(self): - return self._unpack_from(2, ">h") - - def read_u16(self): - return self._unpack_from(2, ">H") - - def read_i32(self): - return self._unpack_from(4, ">i") - - def read_u32(self): - return self._unpack_from(4, ">I") - - def read_i64(self): - return self._unpack_from(8, ">q") - - def read_u64(self): - return self._unpack_from(8, ">Q") - - def read_float(self): - v = self._unpack_from(4, ">f") - return v - - def read_double(self): - return self._unpack_from(8, ">d") - - def read_c_size_t(self): - return self._unpack_from(ctypes.sizeof(ctypes.c_size_t) , "@N") - -class _UniffiRustBufferBuilder: - """ - Helper for structured writing of bytes into a _UniffiRustBuffer. - """ - - def __init__(self): - self.rbuf = _UniffiRustBuffer.alloc(16) - self.rbuf.len = 0 - - def finalize(self): - rbuf = self.rbuf - self.rbuf = None - return rbuf - - def discard(self): - if self.rbuf is not None: - rbuf = self.finalize() - rbuf.free() - - @contextlib.contextmanager - def _reserve(self, num_bytes): - if self.rbuf.len + num_bytes > self.rbuf.capacity: - self.rbuf = _UniffiRustBuffer.reserve(self.rbuf, num_bytes) - yield None - self.rbuf.len += num_bytes - - def _pack_into(self, size, format, value): - with self._reserve(size): - # XXX TODO: I feel like I should be able to use `struct.pack_into` here but can't figure it out. - for i, byte in enumerate(struct.pack(format, value)): - self.rbuf.data[self.rbuf.len + i] = byte - - def write(self, value): - with self._reserve(len(value)): - for i, byte in enumerate(value): - self.rbuf.data[self.rbuf.len + i] = byte - - def write_i8(self, v): - self._pack_into(1, ">b", v) - - def write_u8(self, v): - self._pack_into(1, ">B", v) - - def write_i16(self, v): - self._pack_into(2, ">h", v) - - def write_u16(self, v): - self._pack_into(2, ">H", v) - - def write_i32(self, v): - self._pack_into(4, ">i", v) - - def write_u32(self, v): - self._pack_into(4, ">I", v) - - def write_i64(self, v): - self._pack_into(8, ">q", v) - - def write_u64(self, v): - self._pack_into(8, ">Q", v) - - def write_float(self, v): - self._pack_into(4, ">f", v) - - def write_double(self, v): - self._pack_into(8, ">d", v) - - def write_c_size_t(self, v): - self._pack_into(ctypes.sizeof(ctypes.c_size_t) , "@N", v) -# A handful of classes and functions to support the generated data structures. -# This would be a good candidate for isolating in its own ffi-support lib. - -class InternalError(Exception): - pass - -class _UniffiRustCallStatus(ctypes.Structure): - """ - Error runtime. - """ - _fields_ = [ - ("code", ctypes.c_int8), - ("error_buf", _UniffiRustBuffer), - ] - - # These match the values from the uniffi::rustcalls module - CALL_SUCCESS = 0 - CALL_ERROR = 1 - CALL_PANIC = 2 - - def __str__(self): - if self.code == _UniffiRustCallStatus.CALL_SUCCESS: - return "_UniffiRustCallStatus(CALL_SUCCESS)" - elif self.code == _UniffiRustCallStatus.CALL_ERROR: - return "_UniffiRustCallStatus(CALL_ERROR)" - elif self.code == _UniffiRustCallStatus.CALL_PANIC: - return "_UniffiRustCallStatus(CALL_PANIC)" - else: - return "_UniffiRustCallStatus()" - -def _rust_call(fn, *args): - # Call a rust function - return _rust_call_with_error(None, fn, *args) - -def _rust_call_with_error(error_ffi_converter, fn, *args): - # Call a rust function and handle any errors - # - # This function is used for rust calls that return Result<> and therefore can set the CALL_ERROR status code. - # error_ffi_converter must be set to the _UniffiConverter for the error class that corresponds to the result. - call_status = _UniffiRustCallStatus(code=_UniffiRustCallStatus.CALL_SUCCESS, error_buf=_UniffiRustBuffer(0, 0, None)) - - args_with_error = args + (ctypes.byref(call_status),) - result = fn(*args_with_error) - _uniffi_check_call_status(error_ffi_converter, call_status) - return result - -def _uniffi_check_call_status(error_ffi_converter, call_status): - if call_status.code == _UniffiRustCallStatus.CALL_SUCCESS: - pass - elif call_status.code == _UniffiRustCallStatus.CALL_ERROR: - if error_ffi_converter is None: - call_status.error_buf.free() - raise InternalError("_rust_call_with_error: CALL_ERROR, but error_ffi_converter is None") - else: - raise error_ffi_converter.lift(call_status.error_buf) - elif call_status.code == _UniffiRustCallStatus.CALL_PANIC: - # When the rust code sees a panic, it tries to construct a _UniffiRustBuffer - # with the message. But if that code panics, then it just sends back - # an empty buffer. - if call_status.error_buf.len > 0: - msg = _UniffiConverterString.lift(call_status.error_buf) - else: - msg = "Unknown rust panic" - raise InternalError(msg) - else: - raise InternalError("Invalid _UniffiRustCallStatus code: {}".format( - call_status.code)) - -# A function pointer for a callback as defined by UniFFI. -# Rust definition `fn(handle: u64, method: u32, args: _UniffiRustBuffer, buf_ptr: *mut _UniffiRustBuffer) -> int` -_UNIFFI_FOREIGN_CALLBACK_T = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_ulonglong, ctypes.c_ulong, ctypes.POINTER(ctypes.c_char), ctypes.c_int, ctypes.POINTER(_UniffiRustBuffer)) - -# UniFFI future continuation -_UNIFFI_FUTURE_CONTINUATION_T = ctypes.CFUNCTYPE(None, ctypes.c_size_t, ctypes.c_int8) -class _UniffiPointerManagerCPython: - """ - Manage giving out pointers to Python objects on CPython - - This class is used to generate opaque pointers that reference Python objects to pass to Rust. - It assumes a CPython platform. See _UniffiPointerManagerGeneral for the alternative. - """ - - def new_pointer(self, obj): - """ - Get a pointer for an object as a ctypes.c_size_t instance - - Each call to new_pointer() must be balanced with exactly one call to release_pointer() - - This returns a ctypes.c_size_t. This is always the same size as a pointer and can be - interchanged with pointers for FFI function arguments and return values. - """ - # IncRef the object since we're going to pass a pointer to Rust - ctypes.pythonapi.Py_IncRef(ctypes.py_object(obj)) - # id() is the object address on CPython - # (https://docs.python.org/3/library/functions.html#id) - return id(obj) - - def release_pointer(self, address): - py_obj = ctypes.cast(address, ctypes.py_object) - obj = py_obj.value - ctypes.pythonapi.Py_DecRef(py_obj) - return obj - - def lookup(self, address): - return ctypes.cast(address, ctypes.py_object).value - -class _UniffiPointerManagerGeneral: - """ - Manage giving out pointers to Python objects on non-CPython platforms - - This has the same API as _UniffiPointerManagerCPython, but doesn't assume we're running on - CPython and is slightly slower. - - Instead of using real pointers, it maps integer values to objects and returns the keys as - c_size_t values. - """ - - def __init__(self): - self._map = {} - self._lock = threading.Lock() - self._current_handle = 0 - - def new_pointer(self, obj): - with self._lock: - handle = self._current_handle - self._current_handle += 1 - self._map[handle] = obj - return handle - - def release_pointer(self, handle): - with self._lock: - return self._map.pop(handle) - - def lookup(self, handle): - with self._lock: - return self._map[handle] - -# Pick an pointer manager implementation based on the platform -if platform.python_implementation() == 'CPython': - _UniffiPointerManager = _UniffiPointerManagerCPython # type: ignore -else: - _UniffiPointerManager = _UniffiPointerManagerGeneral # type: ignore -# Types conforming to `_UniffiConverterPrimitive` pass themselves directly over the FFI. -class _UniffiConverterPrimitive: - @classmethod - def lift(cls, value): - return value - - @classmethod - def lower(cls, value): - return value - -class _UniffiConverterPrimitiveInt(_UniffiConverterPrimitive): - @classmethod - def check_lower(cls, value): - try: - value = value.__index__() - except Exception: - raise TypeError("'{}' object cannot be interpreted as an integer".format(type(value).__name__)) - if not isinstance(value, int): - raise TypeError("__index__ returned non-int (type {})".format(type(value).__name__)) - if not cls.VALUE_MIN <= value < cls.VALUE_MAX: - raise ValueError("{} requires {} <= value < {}".format(cls.CLASS_NAME, cls.VALUE_MIN, cls.VALUE_MAX)) - -class _UniffiConverterPrimitiveFloat(_UniffiConverterPrimitive): - @classmethod - def check_lower(cls, value): - try: - value = value.__float__() - except Exception: - raise TypeError("must be real number, not {}".format(type(value).__name__)) - if not isinstance(value, float): - raise TypeError("__float__ returned non-float (type {})".format(type(value).__name__)) - -# Helper class for wrapper types that will always go through a _UniffiRustBuffer. -# Classes should inherit from this and implement the `read` and `write` static methods. -class _UniffiConverterRustBuffer: - @classmethod - def lift(cls, rbuf): - with rbuf.consume_with_stream() as stream: - return cls.read(stream) - - @classmethod - def lower(cls, value): - with _UniffiRustBuffer.alloc_with_builder() as builder: - cls.write(value, builder) - return builder.finalize() - -# Contains loading, initialization code, and the FFI Function declarations. -# Define some ctypes FFI types that we use in the library - -""" -Function pointer for a Rust task, which a callback function that takes a opaque pointer -""" -_UNIFFI_RUST_TASK = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_int8) - -def _uniffi_future_callback_t(return_type): - """ - Factory function to create callback function types for async functions - """ - return ctypes.CFUNCTYPE(None, ctypes.c_size_t, return_type, _UniffiRustCallStatus) - -def _uniffi_load_indirect(): - """ - This is how we find and load the dynamic library provided by the component. - For now we just look it up by name. - """ - if sys.platform == "darwin": - libname = "lib{}.dylib" - elif sys.platform.startswith("win"): - # As of python3.8, ctypes does not seem to search $PATH when loading DLLs. - # We could use `os.add_dll_directory` to configure the search path, but - # it doesn't feel right to mess with application-wide settings. Let's - # assume that the `.dll` is next to the `.py` file and load by full path. - libname = os.path.join( - os.path.dirname(__file__), - "{}.dll", - ) - else: - # Anything else must be an ELF platform - Linux, *BSD, Solaris/illumos - libname = "lib{}.so" - - libname = libname.format("indy2_vdr_uniffi") - path = os.path.join(os.path.dirname(__file__), libname) - lib = ctypes.cdll.LoadLibrary(path) - return lib - -def _uniffi_check_contract_api_version(lib): - # Get the bindings contract version from our ComponentInterface - bindings_contract_version = 25 - # Get the scaffolding contract version by calling the into the dylib - scaffolding_contract_version = lib.ffi_indy2_vdr_uniffi_uniffi_contract_version() - if bindings_contract_version != scaffolding_contract_version: - raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project") - -def _uniffi_check_api_checksums(lib): - if lib.uniffi_indy2_vdr_uniffi_checksum_func_build_add_validator_transaction() != 35462: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_build_assign_role_transaction() != 10839: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_build_create_credential_definition_transaction() != 40098: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_build_create_did_transaction() != 45601: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_build_create_schema_transaction() != 284: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_build_deactivate_did_transaction() != 15981: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_build_get_role_transaction() != 42615: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_build_get_validators_transaction() != 37745: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_build_has_role_transaction() != 5762: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_build_remove_validator_transaction() != 63664: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_build_resolve_credential_definition_transaction() != 5049: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_build_resolve_did_transaction() != 9327: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_build_resolve_schema_transaction() != 34558: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_build_revoke_role_transaction() != 25022: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_build_update_did_transaction() != 11590: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_parse_get_role_result() != 16295: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_parse_get_validators_result() != 9480: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_parse_has_role_result() != 51555: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_parse_resolve_credential_definition_result() != 23115: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_parse_resolve_did_result() != 46062: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_func_parse_resolve_schema_result() != 10762: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_method_ledgerclient_get_receipt() != 16895: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_method_ledgerclient_ping() != 3979: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_method_ledgerclient_submit_transaction() != 36998: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_method_transaction_get_signing_bytes() != 46925: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_method_transaction_set_signature() != 11161: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_constructor_ledgerclient_new() != 24727: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_indy2_vdr_uniffi_checksum_constructor_transaction_new() != 19150: - raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - -# A ctypes library to expose the extern-C FFI definitions. -# This is an implementation detail which will be called internally by the public API. - -_UniffiLib = _uniffi_load_indirect() -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_clone_ledgerclient.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_clone_ledgerclient.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_free_ledgerclient.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_free_ledgerclient.restype = None -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_constructor_ledgerclient_new.argtypes = ( - ctypes.c_uint64, - _UniffiRustBuffer, - _UniffiRustBuffer, - _UniffiRustBuffer, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_constructor_ledgerclient_new.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_method_ledgerclient_get_receipt.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_method_ledgerclient_get_receipt.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_method_ledgerclient_ping.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_method_ledgerclient_ping.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_method_ledgerclient_submit_transaction.argtypes = ( - ctypes.c_void_p, - ctypes.c_void_p, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_method_ledgerclient_submit_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_clone_transaction.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_clone_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_free_transaction.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_free_transaction.restype = None -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_constructor_transaction_new.argtypes = ( - _UniffiRustBuffer, - _UniffiRustBuffer, - _UniffiRustBuffer, - ctypes.c_uint64, - _UniffiRustBuffer, - _UniffiRustBuffer, - _UniffiRustBuffer, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_constructor_transaction_new.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_method_transaction_get_signing_bytes.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_method_transaction_get_signing_bytes.restype = _UniffiRustBuffer -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_method_transaction_set_signature.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_method_transaction_set_signature.restype = None -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_add_validator_transaction.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - _UniffiRustBuffer, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_add_validator_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_assign_role_transaction.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - ctypes.c_uint8, - _UniffiRustBuffer, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_assign_role_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_create_credential_definition_transaction.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - _UniffiRustBuffer, - _UniffiRustBuffer, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_create_credential_definition_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_create_did_transaction.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - _UniffiRustBuffer, - _UniffiRustBuffer, - _UniffiRustBuffer, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_create_did_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_create_schema_transaction.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - _UniffiRustBuffer, - _UniffiRustBuffer, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_create_schema_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_deactivate_did_transaction.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - _UniffiRustBuffer, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_deactivate_did_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_get_role_transaction.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_get_role_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_get_validators_transaction.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_get_validators_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_has_role_transaction.argtypes = ( - ctypes.c_void_p, - ctypes.c_uint8, - _UniffiRustBuffer, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_has_role_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_remove_validator_transaction.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - _UniffiRustBuffer, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_remove_validator_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_resolve_credential_definition_transaction.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_resolve_credential_definition_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_resolve_did_transaction.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_resolve_did_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_resolve_schema_transaction.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_resolve_schema_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_revoke_role_transaction.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - ctypes.c_uint8, - _UniffiRustBuffer, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_revoke_role_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_update_did_transaction.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - _UniffiRustBuffer, - _UniffiRustBuffer, -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_update_did_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_get_role_result.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_get_role_result.restype = ctypes.c_uint8 -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_get_validators_result.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_get_validators_result.restype = _UniffiRustBuffer -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_has_role_result.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_has_role_result.restype = ctypes.c_int8 -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_resolve_credential_definition_result.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_resolve_credential_definition_result.restype = _UniffiRustBuffer -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_resolve_did_result.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_resolve_did_result.restype = _UniffiRustBuffer -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_resolve_schema_result.argtypes = ( - ctypes.c_void_p, - _UniffiRustBuffer, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_resolve_schema_result.restype = _UniffiRustBuffer -_UniffiLib.ffi_indy2_vdr_uniffi_rustbuffer_alloc.argtypes = ( - ctypes.c_int32, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rustbuffer_alloc.restype = _UniffiRustBuffer -_UniffiLib.ffi_indy2_vdr_uniffi_rustbuffer_from_bytes.argtypes = ( - _UniffiForeignBytes, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rustbuffer_from_bytes.restype = _UniffiRustBuffer -_UniffiLib.ffi_indy2_vdr_uniffi_rustbuffer_free.argtypes = ( - _UniffiRustBuffer, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rustbuffer_free.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rustbuffer_reserve.argtypes = ( - _UniffiRustBuffer, - ctypes.c_int32, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rustbuffer_reserve.restype = _UniffiRustBuffer -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_u8.argtypes = ( - ctypes.c_void_p, - _UNIFFI_FUTURE_CONTINUATION_T, - ctypes.c_size_t, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_u8.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_u8.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_u8.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_u8.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_u8.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_u8.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_u8.restype = ctypes.c_uint8 -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_i8.argtypes = ( - ctypes.c_void_p, - _UNIFFI_FUTURE_CONTINUATION_T, - ctypes.c_size_t, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_i8.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_i8.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_i8.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_i8.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_i8.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_i8.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_i8.restype = ctypes.c_int8 -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_u16.argtypes = ( - ctypes.c_void_p, - _UNIFFI_FUTURE_CONTINUATION_T, - ctypes.c_size_t, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_u16.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_u16.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_u16.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_u16.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_u16.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_u16.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_u16.restype = ctypes.c_uint16 -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_i16.argtypes = ( - ctypes.c_void_p, - _UNIFFI_FUTURE_CONTINUATION_T, - ctypes.c_size_t, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_i16.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_i16.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_i16.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_i16.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_i16.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_i16.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_i16.restype = ctypes.c_int16 -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_u32.argtypes = ( - ctypes.c_void_p, - _UNIFFI_FUTURE_CONTINUATION_T, - ctypes.c_size_t, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_u32.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_u32.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_u32.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_u32.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_u32.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_u32.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_u32.restype = ctypes.c_uint32 -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_i32.argtypes = ( - ctypes.c_void_p, - _UNIFFI_FUTURE_CONTINUATION_T, - ctypes.c_size_t, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_i32.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_i32.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_i32.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_i32.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_i32.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_i32.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_i32.restype = ctypes.c_int32 -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_u64.argtypes = ( - ctypes.c_void_p, - _UNIFFI_FUTURE_CONTINUATION_T, - ctypes.c_size_t, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_u64.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_u64.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_u64.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_u64.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_u64.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_u64.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_u64.restype = ctypes.c_uint64 -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_i64.argtypes = ( - ctypes.c_void_p, - _UNIFFI_FUTURE_CONTINUATION_T, - ctypes.c_size_t, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_i64.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_i64.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_i64.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_i64.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_i64.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_i64.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_i64.restype = ctypes.c_int64 -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_f32.argtypes = ( - ctypes.c_void_p, - _UNIFFI_FUTURE_CONTINUATION_T, - ctypes.c_size_t, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_f32.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_f32.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_f32.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_f32.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_f32.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_f32.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_f32.restype = ctypes.c_float -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_f64.argtypes = ( - ctypes.c_void_p, - _UNIFFI_FUTURE_CONTINUATION_T, - ctypes.c_size_t, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_f64.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_f64.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_f64.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_f64.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_f64.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_f64.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_f64.restype = ctypes.c_double -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer.argtypes = ( - ctypes.c_void_p, - _UNIFFI_FUTURE_CONTINUATION_T, - ctypes.c_size_t, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_pointer.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_pointer.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer.restype = ctypes.c_void_p -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_rust_buffer.argtypes = ( - ctypes.c_void_p, - _UNIFFI_FUTURE_CONTINUATION_T, - ctypes.c_size_t, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_rust_buffer.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_rust_buffer.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_rust_buffer.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_rust_buffer.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_rust_buffer.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_rust_buffer.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_rust_buffer.restype = _UniffiRustBuffer -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_void.argtypes = ( - ctypes.c_void_p, - _UNIFFI_FUTURE_CONTINUATION_T, - ctypes.c_size_t, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_void.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_void.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_cancel_void.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_void.argtypes = ( - ctypes.c_void_p, -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_void.restype = None -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_void.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_void.restype = None -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_add_validator_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_add_validator_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_assign_role_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_assign_role_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_create_credential_definition_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_create_credential_definition_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_create_did_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_create_did_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_create_schema_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_create_schema_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_deactivate_did_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_deactivate_did_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_get_role_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_get_role_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_get_validators_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_get_validators_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_has_role_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_has_role_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_remove_validator_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_remove_validator_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_resolve_credential_definition_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_resolve_credential_definition_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_resolve_did_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_resolve_did_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_resolve_schema_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_resolve_schema_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_revoke_role_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_revoke_role_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_update_did_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_build_update_did_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_parse_get_role_result.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_parse_get_role_result.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_parse_get_validators_result.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_parse_get_validators_result.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_parse_has_role_result.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_parse_has_role_result.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_parse_resolve_credential_definition_result.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_parse_resolve_credential_definition_result.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_parse_resolve_did_result.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_parse_resolve_did_result.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_parse_resolve_schema_result.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_func_parse_resolve_schema_result.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_method_ledgerclient_get_receipt.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_method_ledgerclient_get_receipt.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_method_ledgerclient_ping.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_method_ledgerclient_ping.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_method_ledgerclient_submit_transaction.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_method_ledgerclient_submit_transaction.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_method_transaction_get_signing_bytes.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_method_transaction_get_signing_bytes.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_method_transaction_set_signature.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_method_transaction_set_signature.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_constructor_ledgerclient_new.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_constructor_ledgerclient_new.restype = ctypes.c_uint16 -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_constructor_transaction_new.argtypes = ( -) -_UniffiLib.uniffi_indy2_vdr_uniffi_checksum_constructor_transaction_new.restype = ctypes.c_uint16 -_UniffiLib.ffi_indy2_vdr_uniffi_uniffi_contract_version.argtypes = ( -) -_UniffiLib.ffi_indy2_vdr_uniffi_uniffi_contract_version.restype = ctypes.c_uint32 -_uniffi_check_contract_api_version(_UniffiLib) -_uniffi_check_api_checksums(_UniffiLib) - -# Async support# RustFuturePoll values -_UNIFFI_RUST_FUTURE_POLL_READY = 0 -_UNIFFI_RUST_FUTURE_POLL_MAYBE_READY = 1 - -# Stores futures for _uniffi_continuation_callback -_UniffiContinuationPointerManager = _UniffiPointerManager() - -# Continuation callback for async functions -# lift the return value or error and resolve the future, causing the async function to resume. -@_UNIFFI_FUTURE_CONTINUATION_T -def _uniffi_continuation_callback(future_ptr, poll_code): - (eventloop, future) = _UniffiContinuationPointerManager.release_pointer(future_ptr) - eventloop.call_soon_threadsafe(_uniffi_set_future_result, future, poll_code) - -def _uniffi_set_future_result(future, poll_code): - if not future.cancelled(): - future.set_result(poll_code) - -async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, lift_func, error_ffi_converter): - try: - eventloop = asyncio.get_running_loop() - - # Loop and poll until we see a _UNIFFI_RUST_FUTURE_POLL_READY value - while True: - future = eventloop.create_future() - ffi_poll( - rust_future, - _uniffi_continuation_callback, - _UniffiContinuationPointerManager.new_pointer((eventloop, future)), - ) - poll_code = await future - if poll_code == _UNIFFI_RUST_FUTURE_POLL_READY: - break - - return lift_func( - _rust_call_with_error(error_ffi_converter, ffi_complete, rust_future) - ) - finally: - ffi_free(rust_future) - -# Public interface members begin here. - - -class _UniffiConverterUInt8(_UniffiConverterPrimitiveInt): - CLASS_NAME = "u8" - VALUE_MIN = 0 - VALUE_MAX = 2**8 - - @staticmethod - def read(buf): - return buf.read_u8() - - @staticmethod - def write(value, buf): - buf.write_u8(value) - -class _UniffiConverterUInt64(_UniffiConverterPrimitiveInt): - CLASS_NAME = "u64" - VALUE_MIN = 0 - VALUE_MAX = 2**64 - - @staticmethod - def read(buf): - return buf.read_u64() - - @staticmethod - def write(value, buf): - buf.write_u64(value) - -class _UniffiConverterBool: - @classmethod - def check_lower(cls, value): - return not not value - - @classmethod - def lower(cls, value): - return 1 if value else 0 - - @staticmethod - def lift(value): - return value != 0 - - @classmethod - def read(cls, buf): - return cls.lift(buf.read_u8()) - - @classmethod - def write(cls, value, buf): - buf.write_u8(value) - -class _UniffiConverterString: - @staticmethod - def check_lower(value): - if not isinstance(value, str): - raise TypeError("argument must be str, not {}".format(type(value).__name__)) - return value - - @staticmethod - def read(buf): - size = buf.read_i32() - if size < 0: - raise InternalError("Unexpected negative string length") - utf8_bytes = buf.read(size) - return utf8_bytes.decode("utf-8") - - @staticmethod - def write(value, buf): - utf8_bytes = value.encode("utf-8") - buf.write_i32(len(utf8_bytes)) - buf.write(utf8_bytes) - - @staticmethod - def lift(buf): - with buf.consume_with_stream() as stream: - return stream.read(stream.remaining()).decode("utf-8") - - @staticmethod - def lower(value): - with _UniffiRustBuffer.alloc_with_builder() as builder: - builder.write(value.encode("utf-8")) - return builder.finalize() - -class _UniffiConverterBytes(_UniffiConverterRustBuffer): - @staticmethod - def read(buf): - size = buf.read_i32() - if size < 0: - raise InternalError("Unexpected negative byte string length") - return buf.read(size) - - @staticmethod - def check_lower(value): - try: - memoryview(value) - except TypeError: - raise TypeError("a bytes-like object is required, not {!r}".format(type(value).__name__)) - - @staticmethod - def write(value, buf): - buf.write_i32(len(value)) - buf.write(value) - - - -class LedgerClientProtocol(typing.Protocol): - def get_receipt(self, hash: "bytes"): - raise NotImplementedError - def ping(self, ): - raise NotImplementedError - def submit_transaction(self, transaction: "Transaction"): - raise NotImplementedError - -class LedgerClient: - - _pointer: ctypes.c_void_p - def __init__(self, chain_id: "int",node_address: "str",contract_configs: "typing.List[ContractConfig]",quorum_config: "typing.Optional[QuorumConfig]"): - _UniffiConverterUInt64.check_lower(chain_id) - - _UniffiConverterString.check_lower(node_address) - - _UniffiConverterSequenceTypeContractConfig.check_lower(contract_configs) - - _UniffiConverterOptionalTypeQuorumConfig.check_lower(quorum_config) - - self._pointer = _rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy2_vdr_uniffi_fn_constructor_ledgerclient_new, - _UniffiConverterUInt64.lower(chain_id), - _UniffiConverterString.lower(node_address), - _UniffiConverterSequenceTypeContractConfig.lower(contract_configs), - _UniffiConverterOptionalTypeQuorumConfig.lower(quorum_config)) - - def __del__(self): - # In case of partial initialization of instances. - pointer = getattr(self, "_pointer", None) - if pointer is not None: - _rust_call(_UniffiLib.uniffi_indy2_vdr_uniffi_fn_free_ledgerclient, pointer) - - def _uniffi_clone_pointer(self): - return _rust_call(_UniffiLib.uniffi_indy2_vdr_uniffi_fn_clone_ledgerclient, self._pointer) - - # Used by alternative constructors or any methods which return this type. - @classmethod - def _make_instance_(cls, pointer): - # Lightly yucky way to bypass the usual __init__ logic - # and just create a new instance with the required pointer. - inst = cls.__new__(cls) - inst._pointer = pointer - return inst - - - def get_receipt(self, hash: "bytes"): - _UniffiConverterBytes.check_lower(hash) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_method_ledgerclient_get_receipt( - self._uniffi_clone_pointer(), - _UniffiConverterBytes.lower(hash) - ), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_rust_buffer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_rust_buffer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_rust_buffer, - # lift function - _UniffiConverterString.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - - - - - - def ping(self, ): - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_method_ledgerclient_ping( - self._uniffi_clone_pointer(), - ), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_rust_buffer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_rust_buffer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_rust_buffer, - # lift function - _UniffiConverterTypePingStatus.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - - - - - - def submit_transaction(self, transaction: "Transaction"): - _UniffiConverterTypeTransaction.check_lower(transaction) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_method_ledgerclient_submit_transaction( - self._uniffi_clone_pointer(), - _UniffiConverterTypeTransaction.lower(transaction) - ), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_rust_buffer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_rust_buffer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_rust_buffer, - # lift function - _UniffiConverterBytes.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - - - - -class _UniffiConverterTypeLedgerClient: - - @staticmethod - def lift(value: int): - return LedgerClient._make_instance_(value) - - @staticmethod - def check_lower(value: LedgerClient): - if not isinstance(value, LedgerClient): - raise TypeError("Expected LedgerClient instance, {} found".format(type(value).__name__)) - - @staticmethod - def lower(value: LedgerClientProtocol): - if not isinstance(value, LedgerClient): - raise TypeError("Expected LedgerClient instance, {} found".format(type(value).__name__)) - return value._uniffi_clone_pointer() - - @classmethod - def read(cls, buf: _UniffiRustBuffer): - ptr = buf.read_u64() - if ptr == 0: - raise InternalError("Raw pointer value was null") - return cls.lift(ptr) - - @classmethod - def write(cls, value: LedgerClientProtocol, buf: _UniffiRustBuffer): - buf.write_u64(cls.lower(value)) - - - -class TransactionProtocol(typing.Protocol): - def get_signing_bytes(self, ): - raise NotImplementedError - def set_signature(self, signature_data: "SignatureData"): - raise NotImplementedError - -class Transaction: - - _pointer: ctypes.c_void_p - def __init__(self, type: "TransactionType",_from: "typing.Optional[str]",to: "str",chain_id: "int",data: "bytes",nonce: "typing.Optional[typing.List[int]]",signature: "typing.Optional[TransactionSignature]"): - _UniffiConverterTypeTransactionType.check_lower(type) - - _UniffiConverterOptionalString.check_lower(_from) - - _UniffiConverterString.check_lower(to) - - _UniffiConverterUInt64.check_lower(chain_id) - - _UniffiConverterBytes.check_lower(data) - - _UniffiConverterOptionalSequenceUInt64.check_lower(nonce) - - _UniffiConverterOptionalTypeTransactionSignature.check_lower(signature) - - self._pointer = _rust_call(_UniffiLib.uniffi_indy2_vdr_uniffi_fn_constructor_transaction_new, - _UniffiConverterTypeTransactionType.lower(type), - _UniffiConverterOptionalString.lower(_from), - _UniffiConverterString.lower(to), - _UniffiConverterUInt64.lower(chain_id), - _UniffiConverterBytes.lower(data), - _UniffiConverterOptionalSequenceUInt64.lower(nonce), - _UniffiConverterOptionalTypeTransactionSignature.lower(signature)) - - def __del__(self): - # In case of partial initialization of instances. - pointer = getattr(self, "_pointer", None) - if pointer is not None: - _rust_call(_UniffiLib.uniffi_indy2_vdr_uniffi_fn_free_transaction, pointer) - - def _uniffi_clone_pointer(self): - return _rust_call(_UniffiLib.uniffi_indy2_vdr_uniffi_fn_clone_transaction, self._pointer) - - # Used by alternative constructors or any methods which return this type. - @classmethod - def _make_instance_(cls, pointer): - # Lightly yucky way to bypass the usual __init__ logic - # and just create a new instance with the required pointer. - inst = cls.__new__(cls) - inst._pointer = pointer - return inst - - - def get_signing_bytes(self, ) -> "bytes": - return _UniffiConverterBytes.lift( - _rust_call_with_error( - _UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy2_vdr_uniffi_fn_method_transaction_get_signing_bytes,self._uniffi_clone_pointer(),) - ) - - - - - - - def set_signature(self, signature_data: "SignatureData"): - _UniffiConverterTypeSignatureData.check_lower(signature_data) - - _rust_call(_UniffiLib.uniffi_indy2_vdr_uniffi_fn_method_transaction_set_signature,self._uniffi_clone_pointer(), - _UniffiConverterTypeSignatureData.lower(signature_data)) - - - - - - -class _UniffiConverterTypeTransaction: - - @staticmethod - def lift(value: int): - return Transaction._make_instance_(value) - - @staticmethod - def check_lower(value: Transaction): - if not isinstance(value, Transaction): - raise TypeError("Expected Transaction instance, {} found".format(type(value).__name__)) - - @staticmethod - def lower(value: TransactionProtocol): - if not isinstance(value, Transaction): - raise TypeError("Expected Transaction instance, {} found".format(type(value).__name__)) - return value._uniffi_clone_pointer() - - @classmethod - def read(cls, buf: _UniffiRustBuffer): - ptr = buf.read_u64() - if ptr == 0: - raise InternalError("Raw pointer value was null") - return cls.lift(ptr) - - @classmethod - def write(cls, value: TransactionProtocol, buf: _UniffiRustBuffer): - buf.write_u64(cls.lower(value)) - - -class ContractConfig: - address: "str" - spec_path: "typing.Optional[str]" - spec: "typing.Optional[ContractSpec]" - @typing.no_type_check - def __init__(self, address: "str", spec_path: "typing.Optional[str]", spec: "typing.Optional[ContractSpec]"): - self.address = address - self.spec_path = spec_path - self.spec = spec - - def __str__(self): - return "ContractConfig(address={}, spec_path={}, spec={})".format(self.address, self.spec_path, self.spec) - - def __eq__(self, other): - if self.address != other.address: - return False - if self.spec_path != other.spec_path: - return False - if self.spec != other.spec: - return False - return True - -class _UniffiConverterTypeContractConfig(_UniffiConverterRustBuffer): - @staticmethod - def read(buf): - return ContractConfig( - address=_UniffiConverterString.read(buf), - spec_path=_UniffiConverterOptionalString.read(buf), - spec=_UniffiConverterOptionalTypeContractSpec.read(buf), - ) - - @staticmethod - def check_lower(value): - _UniffiConverterString.check_lower(value.address) - _UniffiConverterOptionalString.check_lower(value.spec_path) - _UniffiConverterOptionalTypeContractSpec.check_lower(value.spec) - - @staticmethod - def write(value, buf): - _UniffiConverterString.write(value.address, buf) - _UniffiConverterOptionalString.write(value.spec_path, buf) - _UniffiConverterOptionalTypeContractSpec.write(value.spec, buf) - - -class ContractSpec: - name: "str" - abi: "JsonValue" - @typing.no_type_check - def __init__(self, name: "str", abi: "JsonValue"): - self.name = name - self.abi = abi - - def __str__(self): - return "ContractSpec(name={}, abi={})".format(self.name, self.abi) - - def __eq__(self, other): - if self.name != other.name: - return False - if self.abi != other.abi: - return False - return True - -class _UniffiConverterTypeContractSpec(_UniffiConverterRustBuffer): - @staticmethod - def read(buf): - return ContractSpec( - name=_UniffiConverterString.read(buf), - abi=_UniffiConverterTypeJsonValue.read(buf), - ) - - @staticmethod - def check_lower(value): - _UniffiConverterString.check_lower(value.name) - _UniffiConverterTypeJsonValue.check_lower(value.abi) - - @staticmethod - def write(value, buf): - _UniffiConverterString.write(value.name, buf) - _UniffiConverterTypeJsonValue.write(value.abi, buf) - - -class PingStatus: - status: "Status" - @typing.no_type_check - def __init__(self, status: "Status"): - self.status = status - - def __str__(self): - return "PingStatus(status={})".format(self.status) - - def __eq__(self, other): - if self.status != other.status: - return False - return True - -class _UniffiConverterTypePingStatus(_UniffiConverterRustBuffer): - @staticmethod - def read(buf): - return PingStatus( - status=_UniffiConverterTypeStatus.read(buf), - ) - - @staticmethod - def check_lower(value): - _UniffiConverterTypeStatus.check_lower(value.status) - - @staticmethod - def write(value, buf): - _UniffiConverterTypeStatus.write(value.status, buf) - - -class QuorumConfig: - nodes: "typing.List[str]" - request_retries: "typing.Optional[int]" - request_timeout: "typing.Optional[int]" - retry_interval: "typing.Optional[int]" - @typing.no_type_check - def __init__(self, nodes: "typing.List[str]", request_retries: "typing.Optional[int]", request_timeout: "typing.Optional[int]", retry_interval: "typing.Optional[int]"): - self.nodes = nodes - self.request_retries = request_retries - self.request_timeout = request_timeout - self.retry_interval = retry_interval - - def __str__(self): - return "QuorumConfig(nodes={}, request_retries={}, request_timeout={}, retry_interval={})".format(self.nodes, self.request_retries, self.request_timeout, self.retry_interval) - - def __eq__(self, other): - if self.nodes != other.nodes: - return False - if self.request_retries != other.request_retries: - return False - if self.request_timeout != other.request_timeout: - return False - if self.retry_interval != other.retry_interval: - return False - return True - -class _UniffiConverterTypeQuorumConfig(_UniffiConverterRustBuffer): - @staticmethod - def read(buf): - return QuorumConfig( - nodes=_UniffiConverterSequenceString.read(buf), - request_retries=_UniffiConverterOptionalUInt8.read(buf), - request_timeout=_UniffiConverterOptionalUInt64.read(buf), - retry_interval=_UniffiConverterOptionalUInt64.read(buf), - ) - - @staticmethod - def check_lower(value): - _UniffiConverterSequenceString.check_lower(value.nodes) - _UniffiConverterOptionalUInt8.check_lower(value.request_retries) - _UniffiConverterOptionalUInt64.check_lower(value.request_timeout) - _UniffiConverterOptionalUInt64.check_lower(value.retry_interval) - - @staticmethod - def write(value, buf): - _UniffiConverterSequenceString.write(value.nodes, buf) - _UniffiConverterOptionalUInt8.write(value.request_retries, buf) - _UniffiConverterOptionalUInt64.write(value.request_timeout, buf) - _UniffiConverterOptionalUInt64.write(value.retry_interval, buf) - - -class SignatureData: - recovery_id: "int" - signature: "bytes" - @typing.no_type_check - def __init__(self, recovery_id: "int", signature: "bytes"): - self.recovery_id = recovery_id - self.signature = signature - - def __str__(self): - return "SignatureData(recovery_id={}, signature={})".format(self.recovery_id, self.signature) - - def __eq__(self, other): - if self.recovery_id != other.recovery_id: - return False - if self.signature != other.signature: - return False - return True - -class _UniffiConverterTypeSignatureData(_UniffiConverterRustBuffer): - @staticmethod - def read(buf): - return SignatureData( - recovery_id=_UniffiConverterUInt64.read(buf), - signature=_UniffiConverterBytes.read(buf), - ) - - @staticmethod - def check_lower(value): - _UniffiConverterUInt64.check_lower(value.recovery_id) - _UniffiConverterBytes.check_lower(value.signature) - - @staticmethod - def write(value, buf): - _UniffiConverterUInt64.write(value.recovery_id, buf) - _UniffiConverterBytes.write(value.signature, buf) - - -class TransactionSignature: - v: "int" - r: "bytes" - s: "bytes" - @typing.no_type_check - def __init__(self, v: "int", r: "bytes", s: "bytes"): - self.v = v - self.r = r - self.s = s - - def __str__(self): - return "TransactionSignature(v={}, r={}, s={})".format(self.v, self.r, self.s) - - def __eq__(self, other): - if self.v != other.v: - return False - if self.r != other.r: - return False - if self.s != other.s: - return False - return True - -class _UniffiConverterTypeTransactionSignature(_UniffiConverterRustBuffer): - @staticmethod - def read(buf): - return TransactionSignature( - v=_UniffiConverterUInt64.read(buf), - r=_UniffiConverterBytes.read(buf), - s=_UniffiConverterBytes.read(buf), - ) - - @staticmethod - def check_lower(value): - _UniffiConverterUInt64.check_lower(value.v) - _UniffiConverterBytes.check_lower(value.r) - _UniffiConverterBytes.check_lower(value.s) - - @staticmethod - def write(value, buf): - _UniffiConverterUInt64.write(value.v, buf) - _UniffiConverterBytes.write(value.r, buf) - _UniffiConverterBytes.write(value.s, buf) - - - - - -class Status: - def __init__(self): - raise RuntimeError("Status cannot be instantiated directly") - - # Each enum variant is a nested class of the enum itself. - class OK: - - @typing.no_type_check - def __init__(self,): - - pass - - - def __str__(self): - return "Status.OK()".format() - - def __eq__(self, other): - if not other.is_ok(): - return False - return True - class ERR: - msg: "str" - - @typing.no_type_check - def __init__(self,msg: "str"): - - self.msg = msg - - - def __str__(self): - return "Status.ERR(msg={})".format(self.msg) - - def __eq__(self, other): - if not other.is_err(): - return False - if self.msg != other.msg: - return False - return True - - - # For each variant, we have an `is_NAME` method for easily checking - # whether an instance is that variant. - def is_ok(self) -> bool: - return isinstance(self, Status.OK) - def is_err(self) -> bool: - return isinstance(self, Status.ERR) - - -# Now, a little trick - we make each nested variant class be a subclass of the main -# enum class, so that method calls and instance checks etc will work intuitively. -# We might be able to do this a little more neatly with a metaclass, but this'll do. -Status.OK = type("Status.OK", (Status.OK, Status,), {}) # type: ignore -Status.ERR = type("Status.ERR", (Status.ERR, Status,), {}) # type: ignore - - - - -class _UniffiConverterTypeStatus(_UniffiConverterRustBuffer): - @staticmethod - def read(buf): - variant = buf.read_i32() - if variant == 1: - return Status.OK( - ) - if variant == 2: - return Status.ERR( - _UniffiConverterString.read(buf), - ) - raise InternalError("Raw enum value doesn't match any cases") - - @staticmethod - def check_lower(value): - if value.is_ok(): - return - if value.is_err(): - _UniffiConverterString.check_lower(value.msg) - return - - @staticmethod - def write(value, buf): - if value.is_ok(): - buf.write_i32(1) - if value.is_err(): - buf.write_i32(2) - _UniffiConverterString.write(value.msg, buf) - - - - - - -class TransactionType(enum.Enum): - READ = 0 - - WRITE = 1 - - - -class _UniffiConverterTypeTransactionType(_UniffiConverterRustBuffer): - @staticmethod - def read(buf): - variant = buf.read_i32() - if variant == 1: - return TransactionType.READ - if variant == 2: - return TransactionType.WRITE - raise InternalError("Raw enum value doesn't match any cases") - - @staticmethod - def check_lower(value): - if value == TransactionType.READ: - return - if value == TransactionType.WRITE: - return - - @staticmethod - def write(value, buf): - if value == TransactionType.READ: - buf.write_i32(1) - if value == TransactionType.WRITE: - buf.write_i32(2) - - - -# VdrError -# We want to define each variant as a nested class that's also a subclass, -# which is tricky in Python. To accomplish this we're going to create each -# class separately, then manually add the child classes to the base class's -# __dict__. All of this happens in dummy class to avoid polluting the module -# namespace. -class VdrError(Exception): - pass - -_UniffiTempVdrError = VdrError - -class VdrError: # type: ignore - class ClientNodeUnreachable(_UniffiTempVdrError): - - def __init__(self): - pass - def __repr__(self): - return "VdrError.ClientNodeUnreachable({})".format(str(self)) - _UniffiTempVdrError.ClientNodeUnreachable = ClientNodeUnreachable # type: ignore - class ClientInvalidTransaction(_UniffiTempVdrError): - - def __init__(self, msg): - super().__init__(", ".join([ - "msg={!r}".format(msg), - ])) - self.msg = msg - def __repr__(self): - return "VdrError.ClientInvalidTransaction({})".format(str(self)) - _UniffiTempVdrError.ClientInvalidTransaction = ClientInvalidTransaction # type: ignore - class ClientInvalidResponse(_UniffiTempVdrError): - - def __init__(self, msg): - super().__init__(", ".join([ - "msg={!r}".format(msg), - ])) - self.msg = msg - def __repr__(self): - return "VdrError.ClientInvalidResponse({})".format(str(self)) - _UniffiTempVdrError.ClientInvalidResponse = ClientInvalidResponse # type: ignore - class ClientTransactionReverted(_UniffiTempVdrError): - - def __init__(self, msg): - super().__init__(", ".join([ - "msg={!r}".format(msg), - ])) - self.msg = msg - def __repr__(self): - return "VdrError.ClientTransactionReverted({})".format(str(self)) - _UniffiTempVdrError.ClientTransactionReverted = ClientTransactionReverted # type: ignore - class ClientUnexpectedError(_UniffiTempVdrError): - - def __init__(self, msg): - super().__init__(", ".join([ - "msg={!r}".format(msg), - ])) - self.msg = msg - def __repr__(self): - return "VdrError.ClientUnexpectedError({})".format(str(self)) - _UniffiTempVdrError.ClientUnexpectedError = ClientUnexpectedError # type: ignore - class ClientInvalidState(_UniffiTempVdrError): - - def __init__(self, msg): - super().__init__(", ".join([ - "msg={!r}".format(msg), - ])) - self.msg = msg - def __repr__(self): - return "VdrError.ClientInvalidState({})".format(str(self)) - _UniffiTempVdrError.ClientInvalidState = ClientInvalidState # type: ignore - class ContractInvalidName(_UniffiTempVdrError): - - def __init__(self, msg): - super().__init__(", ".join([ - "msg={!r}".format(msg), - ])) - self.msg = msg - def __repr__(self): - return "VdrError.ContractInvalidName({})".format(str(self)) - _UniffiTempVdrError.ContractInvalidName = ContractInvalidName # type: ignore - class ContractInvalidSpec(_UniffiTempVdrError): - - def __init__(self, msg): - super().__init__(", ".join([ - "msg={!r}".format(msg), - ])) - self.msg = msg - def __repr__(self): - return "VdrError.ContractInvalidSpec({})".format(str(self)) - _UniffiTempVdrError.ContractInvalidSpec = ContractInvalidSpec # type: ignore - class ContractInvalidInputData(_UniffiTempVdrError): - - def __init__(self): - pass - def __repr__(self): - return "VdrError.ContractInvalidInputData({})".format(str(self)) - _UniffiTempVdrError.ContractInvalidInputData = ContractInvalidInputData # type: ignore - class ContractInvalidResponseData(_UniffiTempVdrError): - - def __init__(self, msg): - super().__init__(", ".join([ - "msg={!r}".format(msg), - ])) - self.msg = msg - def __repr__(self): - return "VdrError.ContractInvalidResponseData({})".format(str(self)) - _UniffiTempVdrError.ContractInvalidResponseData = ContractInvalidResponseData # type: ignore - class SignerInvalidPrivateKey(_UniffiTempVdrError): - - def __init__(self): - pass - def __repr__(self): - return "VdrError.SignerInvalidPrivateKey({})".format(str(self)) - _UniffiTempVdrError.SignerInvalidPrivateKey = SignerInvalidPrivateKey # type: ignore - class SignerInvalidMessage(_UniffiTempVdrError): - - def __init__(self): - pass - def __repr__(self): - return "VdrError.SignerInvalidMessage({})".format(str(self)) - _UniffiTempVdrError.SignerInvalidMessage = SignerInvalidMessage # type: ignore - class SignerMissingKey(_UniffiTempVdrError): - - def __init__(self, msg): - super().__init__(", ".join([ - "msg={!r}".format(msg), - ])) - self.msg = msg - def __repr__(self): - return "VdrError.SignerMissingKey({})".format(str(self)) - _UniffiTempVdrError.SignerMissingKey = SignerMissingKey # type: ignore - class SignerUnexpectedError(_UniffiTempVdrError): - - def __init__(self, msg): - super().__init__(", ".join([ - "msg={!r}".format(msg), - ])) - self.msg = msg - def __repr__(self): - return "VdrError.SignerUnexpectedError({})".format(str(self)) - _UniffiTempVdrError.SignerUnexpectedError = SignerUnexpectedError # type: ignore - class CommonInvalidData(_UniffiTempVdrError): - - def __init__(self, msg): - super().__init__(", ".join([ - "msg={!r}".format(msg), - ])) - self.msg = msg - def __repr__(self): - return "VdrError.CommonInvalidData({})".format(str(self)) - _UniffiTempVdrError.CommonInvalidData = CommonInvalidData # type: ignore - class QuorumNotReached(_UniffiTempVdrError): - - def __init__(self, msg): - super().__init__(", ".join([ - "msg={!r}".format(msg), - ])) - self.msg = msg - def __repr__(self): - return "VdrError.QuorumNotReached({})".format(str(self)) - _UniffiTempVdrError.QuorumNotReached = QuorumNotReached # type: ignore - class GetTransactionError(_UniffiTempVdrError): - - def __init__(self, msg): - super().__init__(", ".join([ - "msg={!r}".format(msg), - ])) - self.msg = msg - def __repr__(self): - return "VdrError.GetTransactionError({})".format(str(self)) - _UniffiTempVdrError.GetTransactionError = GetTransactionError # type: ignore - -VdrError = _UniffiTempVdrError # type: ignore -del _UniffiTempVdrError - - -class _UniffiConverterTypeVdrError(_UniffiConverterRustBuffer): - @staticmethod - def read(buf): - variant = buf.read_i32() - if variant == 1: - return VdrError.ClientNodeUnreachable( - ) - if variant == 2: - return VdrError.ClientInvalidTransaction( - msg=_UniffiConverterString.read(buf), - ) - if variant == 3: - return VdrError.ClientInvalidResponse( - msg=_UniffiConverterString.read(buf), - ) - if variant == 4: - return VdrError.ClientTransactionReverted( - msg=_UniffiConverterString.read(buf), - ) - if variant == 5: - return VdrError.ClientUnexpectedError( - msg=_UniffiConverterString.read(buf), - ) - if variant == 6: - return VdrError.ClientInvalidState( - msg=_UniffiConverterString.read(buf), - ) - if variant == 7: - return VdrError.ContractInvalidName( - msg=_UniffiConverterString.read(buf), - ) - if variant == 8: - return VdrError.ContractInvalidSpec( - msg=_UniffiConverterString.read(buf), - ) - if variant == 9: - return VdrError.ContractInvalidInputData( - ) - if variant == 10: - return VdrError.ContractInvalidResponseData( - msg=_UniffiConverterString.read(buf), - ) - if variant == 11: - return VdrError.SignerInvalidPrivateKey( - ) - if variant == 12: - return VdrError.SignerInvalidMessage( - ) - if variant == 13: - return VdrError.SignerMissingKey( - msg=_UniffiConverterString.read(buf), - ) - if variant == 14: - return VdrError.SignerUnexpectedError( - msg=_UniffiConverterString.read(buf), - ) - if variant == 15: - return VdrError.CommonInvalidData( - msg=_UniffiConverterString.read(buf), - ) - if variant == 16: - return VdrError.QuorumNotReached( - msg=_UniffiConverterString.read(buf), - ) - if variant == 17: - return VdrError.GetTransactionError( - msg=_UniffiConverterString.read(buf), - ) - raise InternalError("Raw enum value doesn't match any cases") - - @staticmethod - def check_lower(value): - if isinstance(value, VdrError.ClientNodeUnreachable): - return - if isinstance(value, VdrError.ClientInvalidTransaction): - _UniffiConverterString.check_lower(value.msg) - return - if isinstance(value, VdrError.ClientInvalidResponse): - _UniffiConverterString.check_lower(value.msg) - return - if isinstance(value, VdrError.ClientTransactionReverted): - _UniffiConverterString.check_lower(value.msg) - return - if isinstance(value, VdrError.ClientUnexpectedError): - _UniffiConverterString.check_lower(value.msg) - return - if isinstance(value, VdrError.ClientInvalidState): - _UniffiConverterString.check_lower(value.msg) - return - if isinstance(value, VdrError.ContractInvalidName): - _UniffiConverterString.check_lower(value.msg) - return - if isinstance(value, VdrError.ContractInvalidSpec): - _UniffiConverterString.check_lower(value.msg) - return - if isinstance(value, VdrError.ContractInvalidInputData): - return - if isinstance(value, VdrError.ContractInvalidResponseData): - _UniffiConverterString.check_lower(value.msg) - return - if isinstance(value, VdrError.SignerInvalidPrivateKey): - return - if isinstance(value, VdrError.SignerInvalidMessage): - return - if isinstance(value, VdrError.SignerMissingKey): - _UniffiConverterString.check_lower(value.msg) - return - if isinstance(value, VdrError.SignerUnexpectedError): - _UniffiConverterString.check_lower(value.msg) - return - if isinstance(value, VdrError.CommonInvalidData): - _UniffiConverterString.check_lower(value.msg) - return - if isinstance(value, VdrError.QuorumNotReached): - _UniffiConverterString.check_lower(value.msg) - return - if isinstance(value, VdrError.GetTransactionError): - _UniffiConverterString.check_lower(value.msg) - return - - @staticmethod - def write(value, buf): - if isinstance(value, VdrError.ClientNodeUnreachable): - buf.write_i32(1) - if isinstance(value, VdrError.ClientInvalidTransaction): - buf.write_i32(2) - _UniffiConverterString.write(value.msg, buf) - if isinstance(value, VdrError.ClientInvalidResponse): - buf.write_i32(3) - _UniffiConverterString.write(value.msg, buf) - if isinstance(value, VdrError.ClientTransactionReverted): - buf.write_i32(4) - _UniffiConverterString.write(value.msg, buf) - if isinstance(value, VdrError.ClientUnexpectedError): - buf.write_i32(5) - _UniffiConverterString.write(value.msg, buf) - if isinstance(value, VdrError.ClientInvalidState): - buf.write_i32(6) - _UniffiConverterString.write(value.msg, buf) - if isinstance(value, VdrError.ContractInvalidName): - buf.write_i32(7) - _UniffiConverterString.write(value.msg, buf) - if isinstance(value, VdrError.ContractInvalidSpec): - buf.write_i32(8) - _UniffiConverterString.write(value.msg, buf) - if isinstance(value, VdrError.ContractInvalidInputData): - buf.write_i32(9) - if isinstance(value, VdrError.ContractInvalidResponseData): - buf.write_i32(10) - _UniffiConverterString.write(value.msg, buf) - if isinstance(value, VdrError.SignerInvalidPrivateKey): - buf.write_i32(11) - if isinstance(value, VdrError.SignerInvalidMessage): - buf.write_i32(12) - if isinstance(value, VdrError.SignerMissingKey): - buf.write_i32(13) - _UniffiConverterString.write(value.msg, buf) - if isinstance(value, VdrError.SignerUnexpectedError): - buf.write_i32(14) - _UniffiConverterString.write(value.msg, buf) - if isinstance(value, VdrError.CommonInvalidData): - buf.write_i32(15) - _UniffiConverterString.write(value.msg, buf) - if isinstance(value, VdrError.QuorumNotReached): - buf.write_i32(16) - _UniffiConverterString.write(value.msg, buf) - if isinstance(value, VdrError.GetTransactionError): - buf.write_i32(17) - _UniffiConverterString.write(value.msg, buf) - - - -class _UniffiConverterOptionalUInt8(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - if value is not None: - _UniffiConverterUInt8.check_lower(value) - - @classmethod - def write(cls, value, buf): - if value is None: - buf.write_u8(0) - return - - buf.write_u8(1) - _UniffiConverterUInt8.write(value, buf) - - @classmethod - def read(cls, buf): - flag = buf.read_u8() - if flag == 0: - return None - elif flag == 1: - return _UniffiConverterUInt8.read(buf) - else: - raise InternalError("Unexpected flag byte for optional type") - - - -class _UniffiConverterOptionalUInt64(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - if value is not None: - _UniffiConverterUInt64.check_lower(value) - - @classmethod - def write(cls, value, buf): - if value is None: - buf.write_u8(0) - return - - buf.write_u8(1) - _UniffiConverterUInt64.write(value, buf) - - @classmethod - def read(cls, buf): - flag = buf.read_u8() - if flag == 0: - return None - elif flag == 1: - return _UniffiConverterUInt64.read(buf) - else: - raise InternalError("Unexpected flag byte for optional type") - - - -class _UniffiConverterOptionalString(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - if value is not None: - _UniffiConverterString.check_lower(value) - - @classmethod - def write(cls, value, buf): - if value is None: - buf.write_u8(0) - return - - buf.write_u8(1) - _UniffiConverterString.write(value, buf) - - @classmethod - def read(cls, buf): - flag = buf.read_u8() - if flag == 0: - return None - elif flag == 1: - return _UniffiConverterString.read(buf) - else: - raise InternalError("Unexpected flag byte for optional type") - - - -class _UniffiConverterOptionalTypeContractSpec(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - if value is not None: - _UniffiConverterTypeContractSpec.check_lower(value) - - @classmethod - def write(cls, value, buf): - if value is None: - buf.write_u8(0) - return - - buf.write_u8(1) - _UniffiConverterTypeContractSpec.write(value, buf) - - @classmethod - def read(cls, buf): - flag = buf.read_u8() - if flag == 0: - return None - elif flag == 1: - return _UniffiConverterTypeContractSpec.read(buf) - else: - raise InternalError("Unexpected flag byte for optional type") - - - -class _UniffiConverterOptionalTypeQuorumConfig(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - if value is not None: - _UniffiConverterTypeQuorumConfig.check_lower(value) - - @classmethod - def write(cls, value, buf): - if value is None: - buf.write_u8(0) - return - - buf.write_u8(1) - _UniffiConverterTypeQuorumConfig.write(value, buf) - - @classmethod - def read(cls, buf): - flag = buf.read_u8() - if flag == 0: - return None - elif flag == 1: - return _UniffiConverterTypeQuorumConfig.read(buf) - else: - raise InternalError("Unexpected flag byte for optional type") - - - -class _UniffiConverterOptionalTypeTransactionSignature(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - if value is not None: - _UniffiConverterTypeTransactionSignature.check_lower(value) - - @classmethod - def write(cls, value, buf): - if value is None: - buf.write_u8(0) - return - - buf.write_u8(1) - _UniffiConverterTypeTransactionSignature.write(value, buf) - - @classmethod - def read(cls, buf): - flag = buf.read_u8() - if flag == 0: - return None - elif flag == 1: - return _UniffiConverterTypeTransactionSignature.read(buf) - else: - raise InternalError("Unexpected flag byte for optional type") - - - -class _UniffiConverterOptionalSequenceUInt64(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - if value is not None: - _UniffiConverterSequenceUInt64.check_lower(value) - - @classmethod - def write(cls, value, buf): - if value is None: - buf.write_u8(0) - return - - buf.write_u8(1) - _UniffiConverterSequenceUInt64.write(value, buf) - - @classmethod - def read(cls, buf): - flag = buf.read_u8() - if flag == 0: - return None - elif flag == 1: - return _UniffiConverterSequenceUInt64.read(buf) - else: - raise InternalError("Unexpected flag byte for optional type") - - - -class _UniffiConverterSequenceUInt64(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - for item in value: - _UniffiConverterUInt64.check_lower(item) - - @classmethod - def write(cls, value, buf): - items = len(value) - buf.write_i32(items) - for item in value: - _UniffiConverterUInt64.write(item, buf) - - @classmethod - def read(cls, buf): - count = buf.read_i32() - if count < 0: - raise InternalError("Unexpected negative sequence length") - - return [ - _UniffiConverterUInt64.read(buf) for i in range(count) - ] - - - -class _UniffiConverterSequenceString(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - for item in value: - _UniffiConverterString.check_lower(item) - - @classmethod - def write(cls, value, buf): - items = len(value) - buf.write_i32(items) - for item in value: - _UniffiConverterString.write(item, buf) - - @classmethod - def read(cls, buf): - count = buf.read_i32() - if count < 0: - raise InternalError("Unexpected negative sequence length") - - return [ - _UniffiConverterString.read(buf) for i in range(count) - ] - - - -class _UniffiConverterSequenceTypeContractConfig(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - for item in value: - _UniffiConverterTypeContractConfig.check_lower(item) - - @classmethod - def write(cls, value, buf): - items = len(value) - buf.write_i32(items) - for item in value: - _UniffiConverterTypeContractConfig.write(item, buf) - - @classmethod - def read(cls, buf): - count = buf.read_i32() - if count < 0: - raise InternalError("Unexpected negative sequence length") - - return [ - _UniffiConverterTypeContractConfig.read(buf) for i in range(count) - ] - - -# Type alias -JsonValue = str - -class _UniffiConverterTypeJsonValue: - @staticmethod - def write(value, buf): - _UniffiConverterString.write(value, buf) - - @staticmethod - def read(buf): - return _UniffiConverterString.read(buf) - - @staticmethod - def lift(value): - return _UniffiConverterString.lift(value) - - @staticmethod - def check_lower(value): - return _UniffiConverterString.check_lower(value) - - @staticmethod - def lower(value): - return _UniffiConverterString.lower(value) - -def build_add_validator_transaction(client: "LedgerClient",_from: "str",validator_address: "str"): - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterString.check_lower(_from) - - _UniffiConverterString.check_lower(validator_address) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_add_validator_transaction( - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterString.lower(_from), - _UniffiConverterString.lower(validator_address)), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer, - # lift function - _UniffiConverterTypeTransaction.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - -def build_assign_role_transaction(client: "LedgerClient",_from: "str",role: "int",account: "str"): - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterString.check_lower(_from) - - _UniffiConverterUInt8.check_lower(role) - - _UniffiConverterString.check_lower(account) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_assign_role_transaction( - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterString.lower(_from), - _UniffiConverterUInt8.lower(role), - _UniffiConverterString.lower(account)), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer, - # lift function - _UniffiConverterTypeTransaction.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - -def build_create_credential_definition_transaction(client: "LedgerClient",_from: "str",id: "str",credential_definition: "str"): - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterString.check_lower(_from) - - _UniffiConverterString.check_lower(id) - - _UniffiConverterString.check_lower(credential_definition) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_create_credential_definition_transaction( - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterString.lower(_from), - _UniffiConverterString.lower(id), - _UniffiConverterString.lower(credential_definition)), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer, - # lift function - _UniffiConverterTypeTransaction.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - -def build_create_did_transaction(client: "LedgerClient",_from: "str",identity: "str",did: "str",did_doc: "str"): - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterString.check_lower(_from) - - _UniffiConverterString.check_lower(identity) - - _UniffiConverterString.check_lower(did) - - _UniffiConverterString.check_lower(did_doc) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_create_did_transaction( - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterString.lower(_from), - _UniffiConverterString.lower(identity), - _UniffiConverterString.lower(did), - _UniffiConverterString.lower(did_doc)), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer, - # lift function - _UniffiConverterTypeTransaction.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - -def build_create_schema_transaction(client: "LedgerClient",_from: "str",id: "str",schema: "str"): - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterString.check_lower(_from) - - _UniffiConverterString.check_lower(id) - - _UniffiConverterString.check_lower(schema) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_create_schema_transaction( - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterString.lower(_from), - _UniffiConverterString.lower(id), - _UniffiConverterString.lower(schema)), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer, - # lift function - _UniffiConverterTypeTransaction.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - -def build_deactivate_did_transaction(client: "LedgerClient",_from: "str",did: "str"): - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterString.check_lower(_from) - - _UniffiConverterString.check_lower(did) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_deactivate_did_transaction( - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterString.lower(_from), - _UniffiConverterString.lower(did)), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer, - # lift function - _UniffiConverterTypeTransaction.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - -def build_get_role_transaction(client: "LedgerClient",account: "str"): - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterString.check_lower(account) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_get_role_transaction( - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterString.lower(account)), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer, - # lift function - _UniffiConverterTypeTransaction.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - -def build_get_validators_transaction(client: "LedgerClient"): - _UniffiConverterTypeLedgerClient.check_lower(client) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_get_validators_transaction( - _UniffiConverterTypeLedgerClient.lower(client)), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer, - # lift function - _UniffiConverterTypeTransaction.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - -def build_has_role_transaction(client: "LedgerClient",role: "int",account: "str"): - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterUInt8.check_lower(role) - - _UniffiConverterString.check_lower(account) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_has_role_transaction( - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterUInt8.lower(role), - _UniffiConverterString.lower(account)), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer, - # lift function - _UniffiConverterTypeTransaction.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - -def build_remove_validator_transaction(client: "LedgerClient",_from: "str",validator_address: "str"): - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterString.check_lower(_from) - - _UniffiConverterString.check_lower(validator_address) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_remove_validator_transaction( - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterString.lower(_from), - _UniffiConverterString.lower(validator_address)), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer, - # lift function - _UniffiConverterTypeTransaction.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - -def build_resolve_credential_definition_transaction(client: "LedgerClient",id: "str"): - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterString.check_lower(id) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_resolve_credential_definition_transaction( - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterString.lower(id)), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer, - # lift function - _UniffiConverterTypeTransaction.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - -def build_resolve_did_transaction(client: "LedgerClient",did: "str"): - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterString.check_lower(did) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_resolve_did_transaction( - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterString.lower(did)), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer, - # lift function - _UniffiConverterTypeTransaction.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - -def build_resolve_schema_transaction(client: "LedgerClient",id: "str"): - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterString.check_lower(id) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_resolve_schema_transaction( - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterString.lower(id)), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer, - # lift function - _UniffiConverterTypeTransaction.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - -def build_revoke_role_transaction(client: "LedgerClient",_from: "str",role: "int",account: "str"): - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterString.check_lower(_from) - - _UniffiConverterUInt8.check_lower(role) - - _UniffiConverterString.check_lower(account) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_revoke_role_transaction( - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterString.lower(_from), - _UniffiConverterUInt8.lower(role), - _UniffiConverterString.lower(account)), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer, - # lift function - _UniffiConverterTypeTransaction.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - -def build_update_did_transaction(client: "LedgerClient",_from: "str",did: "str",did_doc: "str"): - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterString.check_lower(_from) - - _UniffiConverterString.check_lower(did) - - _UniffiConverterString.check_lower(did_doc) - - return _uniffi_rust_call_async( - _UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_build_update_did_transaction( - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterString.lower(_from), - _UniffiConverterString.lower(did), - _UniffiConverterString.lower(did_doc)), - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_poll_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_complete_pointer, - _UniffiLib.ffi_indy2_vdr_uniffi_rust_future_free_pointer, - # lift function - _UniffiConverterTypeTransaction.lift, - # Error FFI converter - _UniffiConverterTypeVdrError, - ) - -def parse_get_role_result(client: "LedgerClient",bytes: "bytes") -> "int": - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterBytes.check_lower(bytes) - - return _UniffiConverterUInt8.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_get_role_result, - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterBytes.lower(bytes))) - - -def parse_get_validators_result(client: "LedgerClient",bytes: "bytes") -> "str": - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterBytes.check_lower(bytes) - - return _UniffiConverterString.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_get_validators_result, - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterBytes.lower(bytes))) - - -def parse_has_role_result(client: "LedgerClient",bytes: "bytes") -> "bool": - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterBytes.check_lower(bytes) - - return _UniffiConverterBool.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_has_role_result, - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterBytes.lower(bytes))) - - -def parse_resolve_credential_definition_result(client: "LedgerClient",bytes: "bytes") -> "str": - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterBytes.check_lower(bytes) - - return _UniffiConverterString.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_resolve_credential_definition_result, - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterBytes.lower(bytes))) - - -def parse_resolve_did_result(client: "LedgerClient",bytes: "bytes") -> "str": - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterBytes.check_lower(bytes) - - return _UniffiConverterString.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_resolve_did_result, - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterBytes.lower(bytes))) - - -def parse_resolve_schema_result(client: "LedgerClient",bytes: "bytes") -> "str": - _UniffiConverterTypeLedgerClient.check_lower(client) - - _UniffiConverterBytes.check_lower(bytes) - - return _UniffiConverterString.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy2_vdr_uniffi_fn_func_parse_resolve_schema_result, - _UniffiConverterTypeLedgerClient.lower(client), - _UniffiConverterBytes.lower(bytes))) - - -__all__ = [ - "InternalError", - "Status", - "TransactionType", - "VdrError", - "ContractConfig", - "ContractSpec", - "PingStatus", - "QuorumConfig", - "SignatureData", - "TransactionSignature", - "build_add_validator_transaction", - "build_assign_role_transaction", - "build_create_credential_definition_transaction", - "build_create_did_transaction", - "build_create_schema_transaction", - "build_deactivate_did_transaction", - "build_get_role_transaction", - "build_get_validators_transaction", - "build_has_role_transaction", - "build_remove_validator_transaction", - "build_resolve_credential_definition_transaction", - "build_resolve_did_transaction", - "build_resolve_schema_transaction", - "build_revoke_role_transaction", - "build_update_did_transaction", - "parse_get_role_result", - "parse_get_validators_result", - "parse_has_role_result", - "parse_resolve_credential_definition_result", - "parse_resolve_did_result", - "parse_resolve_schema_result", - "LedgerClient", - "Transaction", -] - diff --git a/vdr/wrappers/python/indy_besu_vdr/__init__.py b/vdr/wrappers/python/indy_besu_vdr/__init__.py new file mode 100644 index 00000000..5c18d229 --- /dev/null +++ b/vdr/wrappers/python/indy_besu_vdr/__init__.py @@ -0,0 +1,154 @@ +"""Indy2 VDR Python wrapper""" +from .indy_besu_vdr import ( + InternalError, + Status, + TransactionType, + VdrError, + ContractConfig, + ContractSpec, + PingStatus, + SignatureData, + LedgerClient, + Transaction, + TransactionEndorsingData, + DidAttributeChanged, + DidDelegateChanged, + DidOwnerChanged, + DidEvents, + DidAttributeChanged, + DidDelegateChanged, + DidOwnerChanged, + DidResolutionOptions, + EventQuery, + EventLog, + build_add_validator_transaction, + build_assign_role_transaction, + build_create_credential_definition_transaction, + build_did_change_owner_transaction, + build_did_change_owner_signed_transaction, + build_did_change_owner_endorsing_data, + build_did_add_delegate_transaction, + build_did_add_delegate_signed_transaction, + build_did_add_delegate_endorsing_data, + build_did_revoke_delegate_transaction, + build_did_revoke_delegate_signed_transaction, + build_did_revoke_delegate_endorsing_data, + build_did_set_attribute_transaction, + build_did_set_attribute_endorsing_data, + build_did_set_attribute_signed_transaction, + build_did_revoke_attribute_transaction, + build_did_revoke_attribute_endorsing_data, + build_did_revoke_attribute_signed_transaction, + build_get_did_owner_transaction, + build_get_did_changed_transaction, + build_get_identity_nonce_transaction, + build_get_did_events_query, + parse_did_changed_result, + parse_did_owner_result, + parse_did_attribute_changed_event_response, + parse_did_delegate_changed_event_response, + parse_did_owner_changed_event_response, + parse_did_event_response, + resolve_did, + build_create_schema_transaction, + build_create_schema_endorsing_data, + build_create_schema_signed_transaction, + build_get_schema_created_transaction, + build_get_schema_query, + parse_schema_created_result, + parse_schema_created_event, + resolve_schema, + build_create_credential_definition_transaction, + build_create_credential_definition_endorsing_data, + build_create_credential_definition_signed_transaction, + build_get_credential_definition_created_transaction, + build_get_credential_definition_query, + parse_credential_definition_created_result, + parse_credential_definition_created_event, + resolve_credential_definition, + build_get_role_transaction, + build_get_validators_transaction, + build_has_role_transaction, + build_remove_validator_transaction, + build_revoke_role_transaction, + parse_get_role_result, + parse_get_validators_result, + parse_has_role_result, +) + +__all__ = ( + "InternalError", + "Status", + "TransactionType", + "VdrError", + "ContractConfig", + "ContractSpec", + "PingStatus", + "SignatureData", + "LedgerClient", + "Transaction", + "TransactionEndorsingData", + "DidAttributeChanged", + "DidDelegateChanged", + "DidOwnerChanged", + "DidEvents", + "DidAttributeChanged", + "DidDelegateChanged", + "DidOwnerChanged", + "DidResolutionOptions", + "EventQuery", + "EventLog", + "build_add_validator_transaction", + "build_assign_role_transaction", + "build_create_credential_definition_transaction", + "build_did_change_owner_transaction", + "build_did_change_owner_signed_transaction", + "build_did_change_owner_endorsing_data", + "build_did_add_delegate_transaction", + "build_did_add_delegate_signed_transaction", + "build_did_add_delegate_endorsing_data", + "build_did_revoke_delegate_transaction", + "build_did_revoke_delegate_signed_transaction", + "build_did_revoke_delegate_endorsing_data", + "build_did_set_attribute_transaction", + "build_did_set_attribute_endorsing_data", + "build_did_set_attribute_signed_transaction", + "build_did_revoke_attribute_transaction", + "build_did_revoke_attribute_endorsing_data", + "build_did_revoke_attribute_signed_transaction", + "build_get_did_owner_transaction", + "build_get_did_changed_transaction", + "build_get_identity_nonce_transaction", + "build_get_did_events_query", + "parse_did_changed_result", + "parse_did_owner_result", + "parse_did_attribute_changed_event_response", + "parse_did_delegate_changed_event_response", + "parse_did_owner_changed_event_response", + "parse_did_event_response", + "resolve_did", + "build_create_schema_transaction", + "build_create_schema_endorsing_data", + "build_create_schema_signed_transaction", + "build_get_schema_created_transaction", + "build_get_schema_query", + "parse_schema_created_result", + "parse_schema_created_event", + "resolve_schema", + "build_create_credential_definition_transaction", + "build_create_credential_definition_endorsing_data", + "build_create_credential_definition_signed_transaction", + "build_get_credential_definition_created_transaction", + "build_get_credential_definition_query", + "parse_credential_definition_created_result", + "parse_credential_definition_created_event", + "resolve_credential_definition", + "build_get_role_transaction", + "build_get_validators_transaction", + "build_has_role_transaction", + "build_remove_validator_transaction", + "build_revoke_role_transaction", + "parse_get_role_result", + "parse_get_validators_result", + "parse_has_role_result", +) diff --git a/vdr/wrappers/python/indy_besu_vdr/indy_besu_vdr.py b/vdr/wrappers/python/indy_besu_vdr/indy_besu_vdr.py new file mode 100644 index 00000000..9679731a --- /dev/null +++ b/vdr/wrappers/python/indy_besu_vdr/indy_besu_vdr.py @@ -0,0 +1,4595 @@ + + +# This file was autogenerated by some hot garbage in the `uniffi` crate. +# Trust me, you don't want to mess with it! + +# Common helper code. +# +# Ideally this would live in a separate .py file where it can be unittested etc +# in isolation, and perhaps even published as a re-useable package. +# +# However, it's important that the details of how this helper code works (e.g. the +# way that different builtin types are passed across the FFI) exactly match what's +# expected by the rust code on the other side of the interface. In practice right +# now that means coming from the exact some version of `uniffi` that was used to +# compile the rust component. The easiest way to ensure this is to bundle the Python +# helpers directly inline like we're doing here. + +import os +import sys +import ctypes +import enum +import struct +import contextlib +import datetime +import typing +import asyncio +import platform + +# Used for default argument values +_DEFAULT = object() + + +class _UniffiRustBuffer(ctypes.Structure): + _fields_ = [ + ("capacity", ctypes.c_int32), + ("len", ctypes.c_int32), + ("data", ctypes.POINTER(ctypes.c_char)), + ] + + @staticmethod + def alloc(size): + return _rust_call(_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_alloc, size) + + @staticmethod + def reserve(rbuf, additional): + return _rust_call(_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_reserve, rbuf, additional) + + def free(self): + return _rust_call(_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_free, self) + + def __str__(self): + return "_UniffiRustBuffer(capacity={}, len={}, data={})".format( + self.capacity, + self.len, + self.data[0:self.len] + ) + + @contextlib.contextmanager + def alloc_with_builder(*args): + """Context-manger to allocate a buffer using a _UniffiRustBufferBuilder. + + The allocated buffer will be automatically freed if an error occurs, ensuring that + we don't accidentally leak it. + """ + builder = _UniffiRustBufferBuilder() + try: + yield builder + except: + builder.discard() + raise + + @contextlib.contextmanager + def consume_with_stream(self): + """Context-manager to consume a buffer using a _UniffiRustBufferStream. + + The _UniffiRustBuffer will be freed once the context-manager exits, ensuring that we don't + leak it even if an error occurs. + """ + try: + s = _UniffiRustBufferStream.from_rust_buffer(self) + yield s + if s.remaining() != 0: + raise RuntimeError("junk data left in buffer at end of consume_with_stream") + finally: + self.free() + + @contextlib.contextmanager + def read_with_stream(self): + """Context-manager to read a buffer using a _UniffiRustBufferStream. + + This is like consume_with_stream, but doesn't free the buffer afterwards. + It should only be used with borrowed `_UniffiRustBuffer` data. + """ + s = _UniffiRustBufferStream.from_rust_buffer(self) + yield s + if s.remaining() != 0: + raise RuntimeError("junk data left in buffer at end of read_with_stream") + +class _UniffiForeignBytes(ctypes.Structure): + _fields_ = [ + ("len", ctypes.c_int32), + ("data", ctypes.POINTER(ctypes.c_char)), + ] + + def __str__(self): + return "_UniffiForeignBytes(len={}, data={})".format(self.len, self.data[0:self.len]) + + +class _UniffiRustBufferStream: + """ + Helper for structured reading of bytes from a _UniffiRustBuffer + """ + + def __init__(self, data, len): + self.data = data + self.len = len + self.offset = 0 + + @classmethod + def from_rust_buffer(cls, buf): + return cls(buf.data, buf.len) + + def remaining(self): + return self.len - self.offset + + def _unpack_from(self, size, format): + if self.offset + size > self.len: + raise InternalError("read past end of rust buffer") + value = struct.unpack(format, self.data[self.offset:self.offset+size])[0] + self.offset += size + return value + + def read(self, size): + if self.offset + size > self.len: + raise InternalError("read past end of rust buffer") + data = self.data[self.offset:self.offset+size] + self.offset += size + return data + + def read_i8(self): + return self._unpack_from(1, ">b") + + def read_u8(self): + return self._unpack_from(1, ">B") + + def read_i16(self): + return self._unpack_from(2, ">h") + + def read_u16(self): + return self._unpack_from(2, ">H") + + def read_i32(self): + return self._unpack_from(4, ">i") + + def read_u32(self): + return self._unpack_from(4, ">I") + + def read_i64(self): + return self._unpack_from(8, ">q") + + def read_u64(self): + return self._unpack_from(8, ">Q") + + def read_float(self): + v = self._unpack_from(4, ">f") + return v + + def read_double(self): + return self._unpack_from(8, ">d") + + def read_c_size_t(self): + return self._unpack_from(ctypes.sizeof(ctypes.c_size_t) , "@N") + +class _UniffiRustBufferBuilder: + """ + Helper for structured writing of bytes into a _UniffiRustBuffer. + """ + + def __init__(self): + self.rbuf = _UniffiRustBuffer.alloc(16) + self.rbuf.len = 0 + + def finalize(self): + rbuf = self.rbuf + self.rbuf = None + return rbuf + + def discard(self): + if self.rbuf is not None: + rbuf = self.finalize() + rbuf.free() + + @contextlib.contextmanager + def _reserve(self, num_bytes): + if self.rbuf.len + num_bytes > self.rbuf.capacity: + self.rbuf = _UniffiRustBuffer.reserve(self.rbuf, num_bytes) + yield None + self.rbuf.len += num_bytes + + def _pack_into(self, size, format, value): + with self._reserve(size): + # XXX TODO: I feel like I should be able to use `struct.pack_into` here but can't figure it out. + for i, byte in enumerate(struct.pack(format, value)): + self.rbuf.data[self.rbuf.len + i] = byte + + def write(self, value): + with self._reserve(len(value)): + for i, byte in enumerate(value): + self.rbuf.data[self.rbuf.len + i] = byte + + def write_i8(self, v): + self._pack_into(1, ">b", v) + + def write_u8(self, v): + self._pack_into(1, ">B", v) + + def write_i16(self, v): + self._pack_into(2, ">h", v) + + def write_u16(self, v): + self._pack_into(2, ">H", v) + + def write_i32(self, v): + self._pack_into(4, ">i", v) + + def write_u32(self, v): + self._pack_into(4, ">I", v) + + def write_i64(self, v): + self._pack_into(8, ">q", v) + + def write_u64(self, v): + self._pack_into(8, ">Q", v) + + def write_float(self, v): + self._pack_into(4, ">f", v) + + def write_double(self, v): + self._pack_into(8, ">d", v) + + def write_c_size_t(self, v): + self._pack_into(ctypes.sizeof(ctypes.c_size_t) , "@N", v) +# A handful of classes and functions to support the generated data structures. +# This would be a good candidate for isolating in its own ffi-support lib. + +class InternalError(Exception): + pass + +class _UniffiRustCallStatus(ctypes.Structure): + """ + Error runtime. + """ + _fields_ = [ + ("code", ctypes.c_int8), + ("error_buf", _UniffiRustBuffer), + ] + + # These match the values from the uniffi::rustcalls module + CALL_SUCCESS = 0 + CALL_ERROR = 1 + CALL_UNEXPECTED_ERROR = 2 + + def __str__(self): + if self.code == _UniffiRustCallStatus.CALL_SUCCESS: + return "_UniffiRustCallStatus(CALL_SUCCESS)" + elif self.code == _UniffiRustCallStatus.CALL_ERROR: + return "_UniffiRustCallStatus(CALL_ERROR)" + elif self.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR: + return "_UniffiRustCallStatus(CALL_UNEXPECTED_ERROR)" + else: + return "_UniffiRustCallStatus()" + +def _rust_call(fn, *args): + # Call a rust function + return _rust_call_with_error(None, fn, *args) + +def _rust_call_with_error(error_ffi_converter, fn, *args): + # Call a rust function and handle any errors + # + # This function is used for rust calls that return Result<> and therefore can set the CALL_ERROR status code. + # error_ffi_converter must be set to the _UniffiConverter for the error class that corresponds to the result. + call_status = _UniffiRustCallStatus(code=_UniffiRustCallStatus.CALL_SUCCESS, error_buf=_UniffiRustBuffer(0, 0, None)) + + args_with_error = args + (ctypes.byref(call_status),) + result = fn(*args_with_error) + _uniffi_check_call_status(error_ffi_converter, call_status) + return result + +def _uniffi_check_call_status(error_ffi_converter, call_status): + if call_status.code == _UniffiRustCallStatus.CALL_SUCCESS: + pass + elif call_status.code == _UniffiRustCallStatus.CALL_ERROR: + if error_ffi_converter is None: + call_status.error_buf.free() + raise InternalError("_rust_call_with_error: CALL_ERROR, but error_ffi_converter is None") + else: + raise error_ffi_converter.lift(call_status.error_buf) + elif call_status.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR: + # When the rust code sees a panic, it tries to construct a _UniffiRustBuffer + # with the message. But if that code panics, then it just sends back + # an empty buffer. + if call_status.error_buf.len > 0: + msg = _UniffiConverterString.lift(call_status.error_buf) + else: + msg = "Unknown rust panic" + raise InternalError(msg) + else: + raise InternalError("Invalid _UniffiRustCallStatus code: {}".format( + call_status.code)) + +def _uniffi_trait_interface_call(call_status, make_call, write_return_value): + try: + return write_return_value(make_call()) + except Exception as e: + call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR + call_status.error_buf = _UniffiConverterString.lower(repr(e)) + +def _uniffi_trait_interface_call_with_error(call_status, make_call, write_return_value, error_type, lower_error): + try: + try: + return write_return_value(make_call()) + except error_type as e: + call_status.code = _UniffiRustCallStatus.CALL_ERROR + call_status.error_buf = lower_error(e) + except Exception as e: + call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR + call_status.error_buf = _UniffiConverterString.lower(repr(e)) +class _UniffiPointerManagerCPython: + """ + Manage giving out pointers to Python objects on CPython + + This class is used to generate opaque pointers that reference Python objects to pass to Rust. + It assumes a CPython platform. See _UniffiPointerManagerGeneral for the alternative. + """ + + def new_pointer(self, obj): + """ + Get a pointer for an object as a ctypes.c_size_t instance + + Each call to new_pointer() must be balanced with exactly one call to release_pointer() + + This returns a ctypes.c_size_t. This is always the same size as a pointer and can be + interchanged with pointers for FFI function arguments and return values. + """ + # IncRef the object since we're going to pass a pointer to Rust + ctypes.pythonapi.Py_IncRef(ctypes.py_object(obj)) + # id() is the object address on CPython + # (https://docs.python.org/3/library/functions.html#id) + return id(obj) + + def release_pointer(self, address): + py_obj = ctypes.cast(address, ctypes.py_object) + obj = py_obj.value + ctypes.pythonapi.Py_DecRef(py_obj) + return obj + + def lookup(self, address): + return ctypes.cast(address, ctypes.py_object).value + +class _UniffiPointerManagerGeneral: + """ + Manage giving out pointers to Python objects on non-CPython platforms + + This has the same API as _UniffiPointerManagerCPython, but doesn't assume we're running on + CPython and is slightly slower. + + Instead of using real pointers, it maps integer values to objects and returns the keys as + c_size_t values. + """ + + def __init__(self): + self._map = {} + self._lock = threading.Lock() + self._current_handle = 0 + + def new_pointer(self, obj): + with self._lock: + handle = self._current_handle + self._current_handle += 1 + self._map[handle] = obj + return handle + + def release_pointer(self, handle): + with self._lock: + return self._map.pop(handle) + + def lookup(self, handle): + with self._lock: + return self._map[handle] + +# Pick an pointer manager implementation based on the platform +if platform.python_implementation() == 'CPython': + _UniffiPointerManager = _UniffiPointerManagerCPython # type: ignore +else: + _UniffiPointerManager = _UniffiPointerManagerGeneral # type: ignore +# Types conforming to `_UniffiConverterPrimitive` pass themselves directly over the FFI. +class _UniffiConverterPrimitive: + @classmethod + def lift(cls, value): + return value + + @classmethod + def lower(cls, value): + return value + +class _UniffiConverterPrimitiveInt(_UniffiConverterPrimitive): + @classmethod + def check_lower(cls, value): + try: + value = value.__index__() + except Exception: + raise TypeError("'{}' object cannot be interpreted as an integer".format(type(value).__name__)) + if not isinstance(value, int): + raise TypeError("__index__ returned non-int (type {})".format(type(value).__name__)) + if not cls.VALUE_MIN <= value < cls.VALUE_MAX: + raise ValueError("{} requires {} <= value < {}".format(cls.CLASS_NAME, cls.VALUE_MIN, cls.VALUE_MAX)) + +class _UniffiConverterPrimitiveFloat(_UniffiConverterPrimitive): + @classmethod + def check_lower(cls, value): + try: + value = value.__float__() + except Exception: + raise TypeError("must be real number, not {}".format(type(value).__name__)) + if not isinstance(value, float): + raise TypeError("__float__ returned non-float (type {})".format(type(value).__name__)) + +# Helper class for wrapper types that will always go through a _UniffiRustBuffer. +# Classes should inherit from this and implement the `read` and `write` static methods. +class _UniffiConverterRustBuffer: + @classmethod + def lift(cls, rbuf): + with rbuf.consume_with_stream() as stream: + return cls.read(stream) + + @classmethod + def lower(cls, value): + with _UniffiRustBuffer.alloc_with_builder() as builder: + cls.write(value, builder) + return builder.finalize() + +# Contains loading, initialization code, and the FFI Function declarations. +# Define some ctypes FFI types that we use in the library + +""" +Function pointer for a Rust task, which a callback function that takes a opaque pointer +""" +_UNIFFI_RUST_TASK = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_int8) + +def _uniffi_future_callback_t(return_type): + """ + Factory function to create callback function types for async functions + """ + return ctypes.CFUNCTYPE(None, ctypes.c_size_t, return_type, _UniffiRustCallStatus) + +def _uniffi_load_indirect(): + """ + This is how we find and load the dynamic library provided by the component. + For now we just look it up by name. + """ + if sys.platform == "darwin": + libname = "lib{}.dylib" + elif sys.platform.startswith("win"): + # As of python3.8, ctypes does not seem to search $PATH when loading DLLs. + # We could use `os.add_dll_directory` to configure the search path, but + # it doesn't feel right to mess with application-wide settings. Let's + # assume that the `.dll` is next to the `.py` file and load by full path. + libname = os.path.join( + os.path.dirname(__file__), + "{}.dll", + ) + else: + # Anything else must be an ELF platform - Linux, *BSD, Solaris/illumos + libname = "lib{}.so" + + libname = libname.format("indy_besu_vdr_uniffi") + path = os.path.join(os.path.dirname(__file__), libname) + lib = ctypes.cdll.LoadLibrary(path) + return lib + +def _uniffi_check_contract_api_version(lib): + # Get the bindings contract version from our ComponentInterface + bindings_contract_version = 25 + # Get the scaffolding contract version by calling the into the dylib + scaffolding_contract_version = lib.ffi_indy_besu_vdr_uniffi_uniffi_contract_version() + if bindings_contract_version != scaffolding_contract_version: + raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project") + +def _uniffi_check_api_checksums(lib): + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_add_validator_transaction() != 2909: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_assign_role_transaction() != 13494: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_endorsing_data() != 59949: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_signed_transaction() != 6216: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_transaction() != 59923: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_endorsing_data() != 3325: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_signed_transaction() != 56271: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_transaction() != 6657: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_endorsing_data() != 21660: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_signed_transaction() != 6684: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_transaction() != 5942: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_endorsing_data() != 21431: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_signed_transaction() != 25381: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_transaction() != 41898: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_endorsing_data() != 24316: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_signed_transaction() != 59037: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_transaction() != 59289: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_endorsing_data() != 14031: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_signed_transaction() != 7578: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_transaction() != 55423: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_endorsing_data() != 8983: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_signed_transaction() != 64551: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_transaction() != 65451: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_credential_definition_created_transaction() != 55886: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_credential_definition_query() != 15375: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_changed_transaction() != 41555: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_events_query() != 35752: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_owner_transaction() != 29722: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_identity_nonce_transaction() != 21686: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_role_transaction() != 34920: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_schema_created_transaction() != 11928: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_schema_query() != 36622: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_validators_transaction() != 16117: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_has_role_transaction() != 35189: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_remove_validator_transaction() != 23482: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_revoke_role_transaction() != 41767: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_credential_definition_created_event() != 43712: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_credential_definition_created_result() != 43952: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_attribute_changed_event_response() != 27285: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_changed_result() != 11223: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_delegate_changed_event_response() != 48798: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_event_response() != 5583: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_owner_changed_event_response() != 45369: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_owner_result() != 11739: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_get_role_result() != 24565: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_get_validators_result() != 34604: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_has_role_result() != 16372: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_schema_created_event() != 39931: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_schema_created_result() != 64564: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_credential_definition() != 411: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_did() != 9418: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_schema() != 37103: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_get_receipt() != 56453: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_ping() != 64834: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_query_events() != 44751: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_submit_transaction() != 37630: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_method_transaction_get_signing_bytes() != 1239: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_method_transaction_set_signature() != 39952: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_method_transactionendorsingdata_get_signing_bytes() != 64283: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_eventquery_new() != 57276: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_ledgerclient_new() != 17350: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_transaction_new() != 38765: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + +# Define FFI callback types +UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK = ctypes.CFUNCTYPE(None,ctypes.c_size_t,ctypes.c_int8, +) +UNIFFI_CALLBACK_INTERFACE_FREE = ctypes.CFUNCTYPE(None,ctypes.c_uint64, +) + +# Define FFI structs + +# A ctypes library to expose the extern-C FFI definitions. +# This is an implementation detail which will be called internally by the public API. + +_UniffiLib = _uniffi_load_indirect() +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_eventquery.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_eventquery.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_eventquery.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_eventquery.restype = None +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_eventquery_new.argtypes = ( + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_eventquery_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_ledgerclient.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_ledgerclient.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_ledgerclient.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_ledgerclient.restype = None +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_ledgerclient_new.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_ledgerclient_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_get_receipt.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_get_receipt.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_ping.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_ping.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_query_events.argtypes = ( + ctypes.c_void_p, + ctypes.c_void_p, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_query_events.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_submit_transaction.argtypes = ( + ctypes.c_void_p, + ctypes.c_void_p, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_submit_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_transaction.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_transaction.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_transaction.restype = None +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_transaction_new.argtypes = ( + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_transaction_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transaction_get_signing_bytes.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transaction_get_signing_bytes.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transaction_set_signature.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transaction_set_signature.restype = None +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_transactionendorsingdata.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_transactionendorsingdata.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_transactionendorsingdata.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_transactionendorsingdata.restype = None +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transactionendorsingdata_get_signing_bytes.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transactionendorsingdata_get_signing_bytes.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_add_validator_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_add_validator_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_assign_role_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.c_uint8, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_assign_role_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_endorsing_data.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_endorsing_data.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_signed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_signed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_endorsing_data.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_endorsing_data.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_signed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_signed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_endorsing_data.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_endorsing_data.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_signed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_signed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_endorsing_data.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_endorsing_data.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_signed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_signed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_endorsing_data.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_endorsing_data.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_signed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_signed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_endorsing_data.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_endorsing_data.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_signed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_signed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_endorsing_data.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_endorsing_data.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_signed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_signed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_credential_definition_created_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_credential_definition_created_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_credential_definition_query.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_credential_definition_query.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_changed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_changed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_events_query.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_events_query.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_owner_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_owner_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_identity_nonce_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_identity_nonce_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_role_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_role_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_schema_created_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_schema_created_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_schema_query.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_schema_query.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_validators_transaction.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_validators_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_has_role_transaction.argtypes = ( + ctypes.c_void_p, + ctypes.c_uint8, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_has_role_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_remove_validator_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_remove_validator_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_revoke_role_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.c_uint8, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_revoke_role_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_credential_definition_created_event.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_credential_definition_created_event.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_credential_definition_created_result.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_credential_definition_created_result.restype = ctypes.c_uint64 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_attribute_changed_event_response.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_attribute_changed_event_response.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_changed_result.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_changed_result.restype = ctypes.c_uint64 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_delegate_changed_event_response.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_delegate_changed_event_response.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_event_response.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_event_response.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_owner_changed_event_response.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_owner_changed_event_response.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_owner_result.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_owner_result.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_get_role_result.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_get_role_result.restype = ctypes.c_uint8 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_get_validators_result.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_get_validators_result.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_has_role_result.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_has_role_result.restype = ctypes.c_int8 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_schema_created_event.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_schema_created_event.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_schema_created_result.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_schema_created_result.restype = ctypes.c_uint64 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_credential_definition.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_credential_definition.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_did.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_did.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_schema.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_schema.restype = ctypes.c_void_p +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_alloc.argtypes = ( + ctypes.c_int32, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_alloc.restype = _UniffiRustBuffer +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_from_bytes.argtypes = ( + _UniffiForeignBytes, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_from_bytes.restype = _UniffiRustBuffer +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_free.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_free.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_reserve.argtypes = ( + _UniffiRustBuffer, + ctypes.c_int32, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_reserve.restype = _UniffiRustBuffer +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u8.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u8.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u8.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u8.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u8.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u8.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u8.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u8.restype = ctypes.c_uint8 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i8.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i8.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i8.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i8.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i8.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i8.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i8.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i8.restype = ctypes.c_int8 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u16.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u16.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u16.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u16.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u16.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u16.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u16.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u16.restype = ctypes.c_uint16 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i16.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i16.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i16.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i16.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i16.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i16.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i16.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i16.restype = ctypes.c_int16 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u32.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u32.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u32.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u32.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u32.restype = ctypes.c_uint32 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i32.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i32.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i32.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i32.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i32.restype = ctypes.c_int32 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u64.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u64.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u64.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u64.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u64.restype = ctypes.c_uint64 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i64.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i64.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i64.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i64.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i64.restype = ctypes.c_int64 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_f32.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_f32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_f32.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_f32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_f32.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_f32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_f32.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_f32.restype = ctypes.c_float +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_f64.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_f64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_f64.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_f64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_f64.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_f64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_f64.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_f64.restype = ctypes.c_double +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_pointer.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_pointer.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer.restype = ctypes.c_void_p +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_rust_buffer.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_rust_buffer.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer.restype = _UniffiRustBuffer +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_void.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_void.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_void.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_void.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_void.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_void.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_void.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_void.restype = None +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_add_validator_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_add_validator_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_assign_role_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_assign_role_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_endorsing_data.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_endorsing_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_endorsing_data.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_endorsing_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_endorsing_data.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_endorsing_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_endorsing_data.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_endorsing_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_endorsing_data.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_endorsing_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_endorsing_data.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_endorsing_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_endorsing_data.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_endorsing_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_credential_definition_created_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_credential_definition_created_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_credential_definition_query.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_credential_definition_query.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_changed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_changed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_events_query.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_events_query.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_owner_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_owner_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_identity_nonce_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_identity_nonce_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_role_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_role_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_schema_created_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_schema_created_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_schema_query.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_schema_query.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_validators_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_validators_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_has_role_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_has_role_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_remove_validator_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_remove_validator_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_revoke_role_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_revoke_role_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_credential_definition_created_event.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_credential_definition_created_event.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_credential_definition_created_result.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_credential_definition_created_result.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_attribute_changed_event_response.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_attribute_changed_event_response.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_changed_result.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_changed_result.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_delegate_changed_event_response.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_delegate_changed_event_response.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_event_response.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_event_response.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_owner_changed_event_response.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_owner_changed_event_response.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_owner_result.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_owner_result.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_get_role_result.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_get_role_result.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_get_validators_result.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_get_validators_result.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_has_role_result.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_has_role_result.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_schema_created_event.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_schema_created_event.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_schema_created_result.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_schema_created_result.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_credential_definition.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_credential_definition.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_did.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_did.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_schema.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_schema.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_get_receipt.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_get_receipt.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_ping.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_ping.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_query_events.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_query_events.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_submit_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_submit_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_transaction_get_signing_bytes.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_transaction_get_signing_bytes.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_transaction_set_signature.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_transaction_set_signature.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_transactionendorsingdata_get_signing_bytes.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_transactionendorsingdata_get_signing_bytes.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_eventquery_new.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_eventquery_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_ledgerclient_new.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_ledgerclient_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_transaction_new.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_transaction_new.restype = ctypes.c_uint16 +_UniffiLib.ffi_indy_besu_vdr_uniffi_uniffi_contract_version.argtypes = ( +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_uniffi_contract_version.restype = ctypes.c_uint32 +_uniffi_check_contract_api_version(_UniffiLib) +_uniffi_check_api_checksums(_UniffiLib) + +# Async support# RustFuturePoll values +_UNIFFI_RUST_FUTURE_POLL_READY = 0 +_UNIFFI_RUST_FUTURE_POLL_MAYBE_READY = 1 + +# Stores futures for _uniffi_continuation_callback +_UniffiContinuationPointerManager = _UniffiPointerManager() + +# Continuation callback for async functions +# lift the return value or error and resolve the future, causing the async function to resume. +@UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK +def _uniffi_continuation_callback(future_ptr, poll_code): + (eventloop, future) = _UniffiContinuationPointerManager.release_pointer(future_ptr) + eventloop.call_soon_threadsafe(_uniffi_set_future_result, future, poll_code) + +def _uniffi_set_future_result(future, poll_code): + if not future.cancelled(): + future.set_result(poll_code) + +async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, lift_func, error_ffi_converter): + try: + eventloop = asyncio.get_running_loop() + + # Loop and poll until we see a _UNIFFI_RUST_FUTURE_POLL_READY value + while True: + future = eventloop.create_future() + ffi_poll( + rust_future, + _uniffi_continuation_callback, + _UniffiContinuationPointerManager.new_pointer((eventloop, future)), + ) + poll_code = await future + if poll_code == _UNIFFI_RUST_FUTURE_POLL_READY: + break + + return lift_func( + _rust_call_with_error(error_ffi_converter, ffi_complete, rust_future) + ) + finally: + ffi_free(rust_future) + +# Public interface members begin here. + + +class _UniffiConverterUInt8(_UniffiConverterPrimitiveInt): + CLASS_NAME = "u8" + VALUE_MIN = 0 + VALUE_MAX = 2**8 + + @staticmethod + def read(buf): + return buf.read_u8() + + @staticmethod + def write(value, buf): + buf.write_u8(value) + +class _UniffiConverterUInt64(_UniffiConverterPrimitiveInt): + CLASS_NAME = "u64" + VALUE_MIN = 0 + VALUE_MAX = 2**64 + + @staticmethod + def read(buf): + return buf.read_u64() + + @staticmethod + def write(value, buf): + buf.write_u64(value) + +class _UniffiConverterBool: + @classmethod + def check_lower(cls, value): + return not not value + + @classmethod + def lower(cls, value): + return 1 if value else 0 + + @staticmethod + def lift(value): + return value != 0 + + @classmethod + def read(cls, buf): + return cls.lift(buf.read_u8()) + + @classmethod + def write(cls, value, buf): + buf.write_u8(value) + +class _UniffiConverterString: + @staticmethod + def check_lower(value): + if not isinstance(value, str): + raise TypeError("argument must be str, not {}".format(type(value).__name__)) + return value + + @staticmethod + def read(buf): + size = buf.read_i32() + if size < 0: + raise InternalError("Unexpected negative string length") + utf8_bytes = buf.read(size) + return utf8_bytes.decode("utf-8") + + @staticmethod + def write(value, buf): + utf8_bytes = value.encode("utf-8") + buf.write_i32(len(utf8_bytes)) + buf.write(utf8_bytes) + + @staticmethod + def lift(buf): + with buf.consume_with_stream() as stream: + return stream.read(stream.remaining()).decode("utf-8") + + @staticmethod + def lower(value): + with _UniffiRustBuffer.alloc_with_builder() as builder: + builder.write(value.encode("utf-8")) + return builder.finalize() + +class _UniffiConverterBytes(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + size = buf.read_i32() + if size < 0: + raise InternalError("Unexpected negative byte string length") + return buf.read(size) + + @staticmethod + def check_lower(value): + try: + memoryview(value) + except TypeError: + raise TypeError("a bytes-like object is required, not {!r}".format(type(value).__name__)) + + @staticmethod + def write(value, buf): + buf.write_i32(len(value)) + buf.write(value) + + + +class EventQueryProtocol(typing.Protocol): + pass + +class EventQuery: + + _pointer: ctypes.c_void_p + def __init__(self, address: "str",from_block: "typing.Optional[int]",to_block: "typing.Optional[int]",event_signature: "typing.Optional[str]",event_filter: "typing.Optional[str]"): + _UniffiConverterString.check_lower(address) + + _UniffiConverterOptionalUInt64.check_lower(from_block) + + _UniffiConverterOptionalUInt64.check_lower(to_block) + + _UniffiConverterOptionalString.check_lower(event_signature) + + _UniffiConverterOptionalString.check_lower(event_filter) + + self._pointer = _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_eventquery_new, + _UniffiConverterString.lower(address), + _UniffiConverterOptionalUInt64.lower(from_block), + _UniffiConverterOptionalUInt64.lower(to_block), + _UniffiConverterOptionalString.lower(event_signature), + _UniffiConverterOptionalString.lower(event_filter)) + + def __del__(self): + # In case of partial initialization of instances. + pointer = getattr(self, "_pointer", None) + if pointer is not None: + _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_eventquery, pointer) + + def _uniffi_clone_pointer(self): + return _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_eventquery, self._pointer) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _make_instance_(cls, pointer): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required pointer. + inst = cls.__new__(cls) + inst._pointer = pointer + return inst + +class _UniffiConverterTypeEventQuery: + + @staticmethod + def lift(value: int): + return EventQuery._make_instance_(value) + + @staticmethod + def check_lower(value: EventQuery): + if not isinstance(value, EventQuery): + raise TypeError("Expected EventQuery instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: EventQueryProtocol): + if not isinstance(value, EventQuery): + raise TypeError("Expected EventQuery instance, {} found".format(type(value).__name__)) + return value._uniffi_clone_pointer() + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw pointer value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: EventQueryProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + + +class LedgerClientProtocol(typing.Protocol): + def get_receipt(self, hash: "bytes"): + raise NotImplementedError + def ping(self, ): + raise NotImplementedError + def query_events(self, query: "EventQuery"): + raise NotImplementedError + def submit_transaction(self, transaction: "Transaction"): + raise NotImplementedError + +class LedgerClient: + + _pointer: ctypes.c_void_p + def __init__(self, chain_id: "int",node_address: "str",contract_configs: "typing.List[ContractConfig]",quorum_config: "typing.Optional[QuorumConfig]"): + _UniffiConverterUInt64.check_lower(chain_id) + + _UniffiConverterString.check_lower(node_address) + + _UniffiConverterSequenceTypeContractConfig.check_lower(contract_configs) + + _UniffiConverterOptionalTypeQuorumConfig.check_lower(quorum_config) + + self._pointer = _rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_ledgerclient_new, + _UniffiConverterUInt64.lower(chain_id), + _UniffiConverterString.lower(node_address), + _UniffiConverterSequenceTypeContractConfig.lower(contract_configs), + _UniffiConverterOptionalTypeQuorumConfig.lower(quorum_config)) + + def __del__(self): + # In case of partial initialization of instances. + pointer = getattr(self, "_pointer", None) + if pointer is not None: + _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_ledgerclient, pointer) + + def _uniffi_clone_pointer(self): + return _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_ledgerclient, self._pointer) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _make_instance_(cls, pointer): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required pointer. + inst = cls.__new__(cls) + inst._pointer = pointer + return inst + + + def get_receipt(self, hash: "bytes"): + _UniffiConverterBytes.check_lower(hash) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_get_receipt( + self._uniffi_clone_pointer(), + _UniffiConverterBytes.lower(hash) + ), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer, + # lift function + _UniffiConverterString.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + + + + + + def ping(self, ): + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_ping( + self._uniffi_clone_pointer(), + ), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer, + # lift function + _UniffiConverterTypePingStatus.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + + + + + + def query_events(self, query: "EventQuery"): + _UniffiConverterTypeEventQuery.check_lower(query) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_query_events( + self._uniffi_clone_pointer(), + _UniffiConverterTypeEventQuery.lower(query) + ), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer, + # lift function + _UniffiConverterSequenceTypeEventLog.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + + + + + + def submit_transaction(self, transaction: "Transaction"): + _UniffiConverterTypeTransaction.check_lower(transaction) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_submit_transaction( + self._uniffi_clone_pointer(), + _UniffiConverterTypeTransaction.lower(transaction) + ), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer, + # lift function + _UniffiConverterBytes.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + + + + +class _UniffiConverterTypeLedgerClient: + + @staticmethod + def lift(value: int): + return LedgerClient._make_instance_(value) + + @staticmethod + def check_lower(value: LedgerClient): + if not isinstance(value, LedgerClient): + raise TypeError("Expected LedgerClient instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: LedgerClientProtocol): + if not isinstance(value, LedgerClient): + raise TypeError("Expected LedgerClient instance, {} found".format(type(value).__name__)) + return value._uniffi_clone_pointer() + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw pointer value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: LedgerClientProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + + +class TransactionProtocol(typing.Protocol): + def get_signing_bytes(self, ): + raise NotImplementedError + def set_signature(self, signature_data: "SignatureData"): + raise NotImplementedError + +class Transaction: + + _pointer: ctypes.c_void_p + def __init__(self, type: "TransactionType",_from: "typing.Optional[str]",to: "str",chain_id: "int",data: "bytes",nonce: "typing.Optional[int]",signature: "typing.Optional[TransactionSignature]"): + _UniffiConverterTypeTransactionType.check_lower(type) + + _UniffiConverterOptionalString.check_lower(_from) + + _UniffiConverterString.check_lower(to) + + _UniffiConverterUInt64.check_lower(chain_id) + + _UniffiConverterBytes.check_lower(data) + + _UniffiConverterOptionalUInt64.check_lower(nonce) + + _UniffiConverterOptionalTypeTransactionSignature.check_lower(signature) + + self._pointer = _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_transaction_new, + _UniffiConverterTypeTransactionType.lower(type), + _UniffiConverterOptionalString.lower(_from), + _UniffiConverterString.lower(to), + _UniffiConverterUInt64.lower(chain_id), + _UniffiConverterBytes.lower(data), + _UniffiConverterOptionalUInt64.lower(nonce), + _UniffiConverterOptionalTypeTransactionSignature.lower(signature)) + + def __del__(self): + # In case of partial initialization of instances. + pointer = getattr(self, "_pointer", None) + if pointer is not None: + _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_transaction, pointer) + + def _uniffi_clone_pointer(self): + return _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_transaction, self._pointer) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _make_instance_(cls, pointer): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required pointer. + inst = cls.__new__(cls) + inst._pointer = pointer + return inst + + + def get_signing_bytes(self, ) -> "bytes": + return _UniffiConverterBytes.lift( + _rust_call_with_error( + _UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transaction_get_signing_bytes,self._uniffi_clone_pointer(),) + ) + + + + + + + def set_signature(self, signature_data: "SignatureData"): + _UniffiConverterTypeSignatureData.check_lower(signature_data) + + _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transaction_set_signature,self._uniffi_clone_pointer(), + _UniffiConverterTypeSignatureData.lower(signature_data)) + + + + + + +class _UniffiConverterTypeTransaction: + + @staticmethod + def lift(value: int): + return Transaction._make_instance_(value) + + @staticmethod + def check_lower(value: Transaction): + if not isinstance(value, Transaction): + raise TypeError("Expected Transaction instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: TransactionProtocol): + if not isinstance(value, Transaction): + raise TypeError("Expected Transaction instance, {} found".format(type(value).__name__)) + return value._uniffi_clone_pointer() + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw pointer value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: TransactionProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + + +class TransactionEndorsingDataProtocol(typing.Protocol): + def get_signing_bytes(self, ): + raise NotImplementedError + +class TransactionEndorsingData: + + _pointer: ctypes.c_void_p + + def __del__(self): + # In case of partial initialization of instances. + pointer = getattr(self, "_pointer", None) + if pointer is not None: + _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_transactionendorsingdata, pointer) + + def _uniffi_clone_pointer(self): + return _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_transactionendorsingdata, self._pointer) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _make_instance_(cls, pointer): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required pointer. + inst = cls.__new__(cls) + inst._pointer = pointer + return inst + + + def get_signing_bytes(self, ) -> "bytes": + return _UniffiConverterBytes.lift( + _rust_call_with_error( + _UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transactionendorsingdata_get_signing_bytes,self._uniffi_clone_pointer(),) + ) + + + + + +class _UniffiConverterTypeTransactionEndorsingData: + + @staticmethod + def lift(value: int): + return TransactionEndorsingData._make_instance_(value) + + @staticmethod + def check_lower(value: TransactionEndorsingData): + if not isinstance(value, TransactionEndorsingData): + raise TypeError("Expected TransactionEndorsingData instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: TransactionEndorsingDataProtocol): + if not isinstance(value, TransactionEndorsingData): + raise TypeError("Expected TransactionEndorsingData instance, {} found".format(type(value).__name__)) + return value._uniffi_clone_pointer() + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw pointer value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: TransactionEndorsingDataProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + +class ContractConfig: + address: "str" + spec_path: "typing.Optional[str]" + spec: "typing.Optional[ContractSpec]" + @typing.no_type_check + def __init__(self, address: "str", spec_path: "typing.Optional[str]", spec: "typing.Optional[ContractSpec]"): + self.address = address + self.spec_path = spec_path + self.spec = spec + + def __str__(self): + return "ContractConfig(address={}, spec_path={}, spec={})".format(self.address, self.spec_path, self.spec) + + def __eq__(self, other): + if self.address != other.address: + return False + if self.spec_path != other.spec_path: + return False + if self.spec != other.spec: + return False + return True + +class _UniffiConverterTypeContractConfig(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ContractConfig( + address=_UniffiConverterString.read(buf), + spec_path=_UniffiConverterOptionalString.read(buf), + spec=_UniffiConverterOptionalTypeContractSpec.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.address) + _UniffiConverterOptionalString.check_lower(value.spec_path) + _UniffiConverterOptionalTypeContractSpec.check_lower(value.spec) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.address, buf) + _UniffiConverterOptionalString.write(value.spec_path, buf) + _UniffiConverterOptionalTypeContractSpec.write(value.spec, buf) + + +class ContractSpec: + name: "str" + abi: "JsonValue" + @typing.no_type_check + def __init__(self, name: "str", abi: "JsonValue"): + self.name = name + self.abi = abi + + def __str__(self): + return "ContractSpec(name={}, abi={})".format(self.name, self.abi) + + def __eq__(self, other): + if self.name != other.name: + return False + if self.abi != other.abi: + return False + return True + +class _UniffiConverterTypeContractSpec(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ContractSpec( + name=_UniffiConverterString.read(buf), + abi=_UniffiConverterTypeJsonValue.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.name) + _UniffiConverterTypeJsonValue.check_lower(value.abi) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.name, buf) + _UniffiConverterTypeJsonValue.write(value.abi, buf) + + +class DidAttributeChanged: + identity: "str" + name: "str" + value: "bytes" + valid_to: "int" + previous_change: "int" + @typing.no_type_check + def __init__(self, identity: "str", name: "str", value: "bytes", valid_to: "int", previous_change: "int"): + self.identity = identity + self.name = name + self.value = value + self.valid_to = valid_to + self.previous_change = previous_change + + def __str__(self): + return "DidAttributeChanged(identity={}, name={}, value={}, valid_to={}, previous_change={})".format(self.identity, self.name, self.value, self.valid_to, self.previous_change) + + def __eq__(self, other): + if self.identity != other.identity: + return False + if self.name != other.name: + return False + if self.value != other.value: + return False + if self.valid_to != other.valid_to: + return False + if self.previous_change != other.previous_change: + return False + return True + +class _UniffiConverterTypeDidAttributeChanged(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return DidAttributeChanged( + identity=_UniffiConverterString.read(buf), + name=_UniffiConverterString.read(buf), + value=_UniffiConverterBytes.read(buf), + valid_to=_UniffiConverterUInt64.read(buf), + previous_change=_UniffiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.identity) + _UniffiConverterString.check_lower(value.name) + _UniffiConverterBytes.check_lower(value.value) + _UniffiConverterUInt64.check_lower(value.valid_to) + _UniffiConverterUInt64.check_lower(value.previous_change) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.identity, buf) + _UniffiConverterString.write(value.name, buf) + _UniffiConverterBytes.write(value.value, buf) + _UniffiConverterUInt64.write(value.valid_to, buf) + _UniffiConverterUInt64.write(value.previous_change, buf) + + +class DidDelegateChanged: + identity: "str" + delegate: "str" + delegate_type: "bytes" + valid_to: "int" + previous_change: "int" + @typing.no_type_check + def __init__(self, identity: "str", delegate: "str", delegate_type: "bytes", valid_to: "int", previous_change: "int"): + self.identity = identity + self.delegate = delegate + self.delegate_type = delegate_type + self.valid_to = valid_to + self.previous_change = previous_change + + def __str__(self): + return "DidDelegateChanged(identity={}, delegate={}, delegate_type={}, valid_to={}, previous_change={})".format(self.identity, self.delegate, self.delegate_type, self.valid_to, self.previous_change) + + def __eq__(self, other): + if self.identity != other.identity: + return False + if self.delegate != other.delegate: + return False + if self.delegate_type != other.delegate_type: + return False + if self.valid_to != other.valid_to: + return False + if self.previous_change != other.previous_change: + return False + return True + +class _UniffiConverterTypeDidDelegateChanged(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return DidDelegateChanged( + identity=_UniffiConverterString.read(buf), + delegate=_UniffiConverterString.read(buf), + delegate_type=_UniffiConverterBytes.read(buf), + valid_to=_UniffiConverterUInt64.read(buf), + previous_change=_UniffiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.identity) + _UniffiConverterString.check_lower(value.delegate) + _UniffiConverterBytes.check_lower(value.delegate_type) + _UniffiConverterUInt64.check_lower(value.valid_to) + _UniffiConverterUInt64.check_lower(value.previous_change) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.identity, buf) + _UniffiConverterString.write(value.delegate, buf) + _UniffiConverterBytes.write(value.delegate_type, buf) + _UniffiConverterUInt64.write(value.valid_to, buf) + _UniffiConverterUInt64.write(value.previous_change, buf) + + +class DidOwnerChanged: + identity: "str" + owner: "str" + previous_change: "int" + @typing.no_type_check + def __init__(self, identity: "str", owner: "str", previous_change: "int"): + self.identity = identity + self.owner = owner + self.previous_change = previous_change + + def __str__(self): + return "DidOwnerChanged(identity={}, owner={}, previous_change={})".format(self.identity, self.owner, self.previous_change) + + def __eq__(self, other): + if self.identity != other.identity: + return False + if self.owner != other.owner: + return False + if self.previous_change != other.previous_change: + return False + return True + +class _UniffiConverterTypeDidOwnerChanged(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return DidOwnerChanged( + identity=_UniffiConverterString.read(buf), + owner=_UniffiConverterString.read(buf), + previous_change=_UniffiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.identity) + _UniffiConverterString.check_lower(value.owner) + _UniffiConverterUInt64.check_lower(value.previous_change) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.identity, buf) + _UniffiConverterString.write(value.owner, buf) + _UniffiConverterUInt64.write(value.previous_change, buf) + + +class DidResolutionOptions: + accept: "str" + block_tag: "typing.Optional[int]" + @typing.no_type_check + def __init__(self, accept: "str", block_tag: "typing.Optional[int]"): + self.accept = accept + self.block_tag = block_tag + + def __str__(self): + return "DidResolutionOptions(accept={}, block_tag={})".format(self.accept, self.block_tag) + + def __eq__(self, other): + if self.accept != other.accept: + return False + if self.block_tag != other.block_tag: + return False + return True + +class _UniffiConverterTypeDidResolutionOptions(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return DidResolutionOptions( + accept=_UniffiConverterString.read(buf), + block_tag=_UniffiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.accept) + _UniffiConverterOptionalUInt64.check_lower(value.block_tag) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.accept, buf) + _UniffiConverterOptionalUInt64.write(value.block_tag, buf) + + +class EventLog: + topics: "typing.List[bytes]" + data: "bytes" + block: "int" + @typing.no_type_check + def __init__(self, topics: "typing.List[bytes]", data: "bytes", block: "int"): + self.topics = topics + self.data = data + self.block = block + + def __str__(self): + return "EventLog(topics={}, data={}, block={})".format(self.topics, self.data, self.block) + + def __eq__(self, other): + if self.topics != other.topics: + return False + if self.data != other.data: + return False + if self.block != other.block: + return False + return True + +class _UniffiConverterTypeEventLog(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return EventLog( + topics=_UniffiConverterSequenceBytes.read(buf), + data=_UniffiConverterBytes.read(buf), + block=_UniffiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterSequenceBytes.check_lower(value.topics) + _UniffiConverterBytes.check_lower(value.data) + _UniffiConverterUInt64.check_lower(value.block) + + @staticmethod + def write(value, buf): + _UniffiConverterSequenceBytes.write(value.topics, buf) + _UniffiConverterBytes.write(value.data, buf) + _UniffiConverterUInt64.write(value.block, buf) + + +class PingStatus: + status: "Status" + @typing.no_type_check + def __init__(self, status: "Status"): + self.status = status + + def __str__(self): + return "PingStatus(status={})".format(self.status) + + def __eq__(self, other): + if self.status != other.status: + return False + return True + +class _UniffiConverterTypePingStatus(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return PingStatus( + status=_UniffiConverterTypeStatus.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterTypeStatus.check_lower(value.status) + + @staticmethod + def write(value, buf): + _UniffiConverterTypeStatus.write(value.status, buf) + + +class QuorumConfig: + nodes: "typing.List[str]" + request_retries: "typing.Optional[int]" + request_timeout: "typing.Optional[int]" + retry_interval: "typing.Optional[int]" + @typing.no_type_check + def __init__(self, nodes: "typing.List[str]", request_retries: "typing.Optional[int]", request_timeout: "typing.Optional[int]", retry_interval: "typing.Optional[int]"): + self.nodes = nodes + self.request_retries = request_retries + self.request_timeout = request_timeout + self.retry_interval = retry_interval + + def __str__(self): + return "QuorumConfig(nodes={}, request_retries={}, request_timeout={}, retry_interval={})".format(self.nodes, self.request_retries, self.request_timeout, self.retry_interval) + + def __eq__(self, other): + if self.nodes != other.nodes: + return False + if self.request_retries != other.request_retries: + return False + if self.request_timeout != other.request_timeout: + return False + if self.retry_interval != other.retry_interval: + return False + return True + +class _UniffiConverterTypeQuorumConfig(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return QuorumConfig( + nodes=_UniffiConverterSequenceString.read(buf), + request_retries=_UniffiConverterOptionalUInt8.read(buf), + request_timeout=_UniffiConverterOptionalUInt64.read(buf), + retry_interval=_UniffiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterSequenceString.check_lower(value.nodes) + _UniffiConverterOptionalUInt8.check_lower(value.request_retries) + _UniffiConverterOptionalUInt64.check_lower(value.request_timeout) + _UniffiConverterOptionalUInt64.check_lower(value.retry_interval) + + @staticmethod + def write(value, buf): + _UniffiConverterSequenceString.write(value.nodes, buf) + _UniffiConverterOptionalUInt8.write(value.request_retries, buf) + _UniffiConverterOptionalUInt64.write(value.request_timeout, buf) + _UniffiConverterOptionalUInt64.write(value.retry_interval, buf) + + +class SignatureData: + recovery_id: "int" + signature: "bytes" + @typing.no_type_check + def __init__(self, recovery_id: "int", signature: "bytes"): + self.recovery_id = recovery_id + self.signature = signature + + def __str__(self): + return "SignatureData(recovery_id={}, signature={})".format(self.recovery_id, self.signature) + + def __eq__(self, other): + if self.recovery_id != other.recovery_id: + return False + if self.signature != other.signature: + return False + return True + +class _UniffiConverterTypeSignatureData(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SignatureData( + recovery_id=_UniffiConverterUInt64.read(buf), + signature=_UniffiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterUInt64.check_lower(value.recovery_id) + _UniffiConverterBytes.check_lower(value.signature) + + @staticmethod + def write(value, buf): + _UniffiConverterUInt64.write(value.recovery_id, buf) + _UniffiConverterBytes.write(value.signature, buf) + + +class TransactionSignature: + v: "int" + r: "bytes" + s: "bytes" + @typing.no_type_check + def __init__(self, v: "int", r: "bytes", s: "bytes"): + self.v = v + self.r = r + self.s = s + + def __str__(self): + return "TransactionSignature(v={}, r={}, s={})".format(self.v, self.r, self.s) + + def __eq__(self, other): + if self.v != other.v: + return False + if self.r != other.r: + return False + if self.s != other.s: + return False + return True + +class _UniffiConverterTypeTransactionSignature(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TransactionSignature( + v=_UniffiConverterUInt64.read(buf), + r=_UniffiConverterBytes.read(buf), + s=_UniffiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterUInt64.check_lower(value.v) + _UniffiConverterBytes.check_lower(value.r) + _UniffiConverterBytes.check_lower(value.s) + + @staticmethod + def write(value, buf): + _UniffiConverterUInt64.write(value.v, buf) + _UniffiConverterBytes.write(value.r, buf) + _UniffiConverterBytes.write(value.s, buf) + + + + + +class DidEvents: + def __init__(self): + raise RuntimeError("DidEvents cannot be instantiated directly") + + # Each enum variant is a nested class of the enum itself. + class ATTRIBUTE_CHANGED_EVENT: + event: "DidAttributeChanged" + + @typing.no_type_check + def __init__(self,event: "DidAttributeChanged"): + + self.event = event + + + def __str__(self): + return "DidEvents.ATTRIBUTE_CHANGED_EVENT(event={})".format(self.event) + + def __eq__(self, other): + if not other.is_attribute_changed_event(): + return False + if self.event != other.event: + return False + return True + class DELEGATE_CHANGED: + event: "DidDelegateChanged" + + @typing.no_type_check + def __init__(self,event: "DidDelegateChanged"): + + self.event = event + + + def __str__(self): + return "DidEvents.DELEGATE_CHANGED(event={})".format(self.event) + + def __eq__(self, other): + if not other.is_delegate_changed(): + return False + if self.event != other.event: + return False + return True + class OWNER_CHANGED: + event: "DidOwnerChanged" + + @typing.no_type_check + def __init__(self,event: "DidOwnerChanged"): + + self.event = event + + + def __str__(self): + return "DidEvents.OWNER_CHANGED(event={})".format(self.event) + + def __eq__(self, other): + if not other.is_owner_changed(): + return False + if self.event != other.event: + return False + return True + + + # For each variant, we have an `is_NAME` method for easily checking + # whether an instance is that variant. + def is_attribute_changed_event(self) -> bool: + return isinstance(self, DidEvents.ATTRIBUTE_CHANGED_EVENT) + def is_delegate_changed(self) -> bool: + return isinstance(self, DidEvents.DELEGATE_CHANGED) + def is_owner_changed(self) -> bool: + return isinstance(self, DidEvents.OWNER_CHANGED) + + +# Now, a little trick - we make each nested variant class be a subclass of the main +# enum class, so that method calls and instance checks etc will work intuitively. +# We might be able to do this a little more neatly with a metaclass, but this'll do. +DidEvents.ATTRIBUTE_CHANGED_EVENT = type("DidEvents.ATTRIBUTE_CHANGED_EVENT", (DidEvents.ATTRIBUTE_CHANGED_EVENT, DidEvents,), {}) # type: ignore +DidEvents.DELEGATE_CHANGED = type("DidEvents.DELEGATE_CHANGED", (DidEvents.DELEGATE_CHANGED, DidEvents,), {}) # type: ignore +DidEvents.OWNER_CHANGED = type("DidEvents.OWNER_CHANGED", (DidEvents.OWNER_CHANGED, DidEvents,), {}) # type: ignore + + + + +class _UniffiConverterTypeDidEvents(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return DidEvents.ATTRIBUTE_CHANGED_EVENT( + _UniffiConverterTypeDidAttributeChanged.read(buf), + ) + if variant == 2: + return DidEvents.DELEGATE_CHANGED( + _UniffiConverterTypeDidDelegateChanged.read(buf), + ) + if variant == 3: + return DidEvents.OWNER_CHANGED( + _UniffiConverterTypeDidOwnerChanged.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value.is_attribute_changed_event(): + _UniffiConverterTypeDidAttributeChanged.check_lower(value.event) + return + if value.is_delegate_changed(): + _UniffiConverterTypeDidDelegateChanged.check_lower(value.event) + return + if value.is_owner_changed(): + _UniffiConverterTypeDidOwnerChanged.check_lower(value.event) + return + + @staticmethod + def write(value, buf): + if value.is_attribute_changed_event(): + buf.write_i32(1) + _UniffiConverterTypeDidAttributeChanged.write(value.event, buf) + if value.is_delegate_changed(): + buf.write_i32(2) + _UniffiConverterTypeDidDelegateChanged.write(value.event, buf) + if value.is_owner_changed(): + buf.write_i32(3) + _UniffiConverterTypeDidOwnerChanged.write(value.event, buf) + + + + + + + +class Status: + def __init__(self): + raise RuntimeError("Status cannot be instantiated directly") + + # Each enum variant is a nested class of the enum itself. + class OK: + block_number: "int" + block_timestamp: "int" + + @typing.no_type_check + def __init__(self,block_number: "int", block_timestamp: "int"): + + self.block_number = block_number + self.block_timestamp = block_timestamp + + + def __str__(self): + return "Status.OK(block_number={}, block_timestamp={})".format(self.block_number, self.block_timestamp) + + def __eq__(self, other): + if not other.is_ok(): + return False + if self.block_number != other.block_number: + return False + if self.block_timestamp != other.block_timestamp: + return False + return True + class ERR: + msg: "str" + + @typing.no_type_check + def __init__(self,msg: "str"): + + self.msg = msg + + + def __str__(self): + return "Status.ERR(msg={})".format(self.msg) + + def __eq__(self, other): + if not other.is_err(): + return False + if self.msg != other.msg: + return False + return True + + + # For each variant, we have an `is_NAME` method for easily checking + # whether an instance is that variant. + def is_ok(self) -> bool: + return isinstance(self, Status.OK) + def is_err(self) -> bool: + return isinstance(self, Status.ERR) + + +# Now, a little trick - we make each nested variant class be a subclass of the main +# enum class, so that method calls and instance checks etc will work intuitively. +# We might be able to do this a little more neatly with a metaclass, but this'll do. +Status.OK = type("Status.OK", (Status.OK, Status,), {}) # type: ignore +Status.ERR = type("Status.ERR", (Status.ERR, Status,), {}) # type: ignore + + + + +class _UniffiConverterTypeStatus(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return Status.OK( + _UniffiConverterUInt64.read(buf), + _UniffiConverterUInt64.read(buf), + ) + if variant == 2: + return Status.ERR( + _UniffiConverterString.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value.is_ok(): + _UniffiConverterUInt64.check_lower(value.block_number) + _UniffiConverterUInt64.check_lower(value.block_timestamp) + return + if value.is_err(): + _UniffiConverterString.check_lower(value.msg) + return + + @staticmethod + def write(value, buf): + if value.is_ok(): + buf.write_i32(1) + _UniffiConverterUInt64.write(value.block_number, buf) + _UniffiConverterUInt64.write(value.block_timestamp, buf) + if value.is_err(): + buf.write_i32(2) + _UniffiConverterString.write(value.msg, buf) + + + + + + + +class TransactionType(enum.Enum): + READ = 0 + + WRITE = 1 + + + +class _UniffiConverterTypeTransactionType(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return TransactionType.READ + if variant == 2: + return TransactionType.WRITE + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value == TransactionType.READ: + return + if value == TransactionType.WRITE: + return + + @staticmethod + def write(value, buf): + if value == TransactionType.READ: + buf.write_i32(1) + if value == TransactionType.WRITE: + buf.write_i32(2) + + + + +# VdrError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class VdrError(Exception): + pass + +_UniffiTempVdrError = VdrError + +class VdrError: # type: ignore + class ClientNodeUnreachable(_UniffiTempVdrError): + + def __init__(self): + pass + def __repr__(self): + return "VdrError.ClientNodeUnreachable({})".format(str(self)) + _UniffiTempVdrError.ClientNodeUnreachable = ClientNodeUnreachable # type: ignore + class ClientInvalidTransaction(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ClientInvalidTransaction({})".format(str(self)) + _UniffiTempVdrError.ClientInvalidTransaction = ClientInvalidTransaction # type: ignore + class ClientInvalidResponse(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ClientInvalidResponse({})".format(str(self)) + _UniffiTempVdrError.ClientInvalidResponse = ClientInvalidResponse # type: ignore + class ClientTransactionReverted(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ClientTransactionReverted({})".format(str(self)) + _UniffiTempVdrError.ClientTransactionReverted = ClientTransactionReverted # type: ignore + class ClientUnexpectedError(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ClientUnexpectedError({})".format(str(self)) + _UniffiTempVdrError.ClientUnexpectedError = ClientUnexpectedError # type: ignore + class ClientInvalidState(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ClientInvalidState({})".format(str(self)) + _UniffiTempVdrError.ClientInvalidState = ClientInvalidState # type: ignore + class ContractInvalidName(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ContractInvalidName({})".format(str(self)) + _UniffiTempVdrError.ContractInvalidName = ContractInvalidName # type: ignore + class ContractInvalidSpec(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ContractInvalidSpec({})".format(str(self)) + _UniffiTempVdrError.ContractInvalidSpec = ContractInvalidSpec # type: ignore + class ContractInvalidInputData(_UniffiTempVdrError): + + def __init__(self): + pass + def __repr__(self): + return "VdrError.ContractInvalidInputData({})".format(str(self)) + _UniffiTempVdrError.ContractInvalidInputData = ContractInvalidInputData # type: ignore + class ContractInvalidResponseData(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ContractInvalidResponseData({})".format(str(self)) + _UniffiTempVdrError.ContractInvalidResponseData = ContractInvalidResponseData # type: ignore + class SignerInvalidPrivateKey(_UniffiTempVdrError): + + def __init__(self): + pass + def __repr__(self): + return "VdrError.SignerInvalidPrivateKey({})".format(str(self)) + _UniffiTempVdrError.SignerInvalidPrivateKey = SignerInvalidPrivateKey # type: ignore + class SignerInvalidMessage(_UniffiTempVdrError): + + def __init__(self): + pass + def __repr__(self): + return "VdrError.SignerInvalidMessage({})".format(str(self)) + _UniffiTempVdrError.SignerInvalidMessage = SignerInvalidMessage # type: ignore + class SignerMissingKey(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.SignerMissingKey({})".format(str(self)) + _UniffiTempVdrError.SignerMissingKey = SignerMissingKey # type: ignore + class SignerUnexpectedError(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.SignerUnexpectedError({})".format(str(self)) + _UniffiTempVdrError.SignerUnexpectedError = SignerUnexpectedError # type: ignore + class CommonInvalidData(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.CommonInvalidData({})".format(str(self)) + _UniffiTempVdrError.CommonInvalidData = CommonInvalidData # type: ignore + class QuorumNotReached(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.QuorumNotReached({})".format(str(self)) + _UniffiTempVdrError.QuorumNotReached = QuorumNotReached # type: ignore + class GetTransactionError(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.GetTransactionError({})".format(str(self)) + _UniffiTempVdrError.GetTransactionError = GetTransactionError # type: ignore + +VdrError = _UniffiTempVdrError # type: ignore +del _UniffiTempVdrError + + +class _UniffiConverterTypeVdrError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return VdrError.ClientNodeUnreachable( + ) + if variant == 2: + return VdrError.ClientInvalidTransaction( + msg=_UniffiConverterString.read(buf), + ) + if variant == 3: + return VdrError.ClientInvalidResponse( + msg=_UniffiConverterString.read(buf), + ) + if variant == 4: + return VdrError.ClientTransactionReverted( + msg=_UniffiConverterString.read(buf), + ) + if variant == 5: + return VdrError.ClientUnexpectedError( + msg=_UniffiConverterString.read(buf), + ) + if variant == 6: + return VdrError.ClientInvalidState( + msg=_UniffiConverterString.read(buf), + ) + if variant == 7: + return VdrError.ContractInvalidName( + msg=_UniffiConverterString.read(buf), + ) + if variant == 8: + return VdrError.ContractInvalidSpec( + msg=_UniffiConverterString.read(buf), + ) + if variant == 9: + return VdrError.ContractInvalidInputData( + ) + if variant == 10: + return VdrError.ContractInvalidResponseData( + msg=_UniffiConverterString.read(buf), + ) + if variant == 11: + return VdrError.SignerInvalidPrivateKey( + ) + if variant == 12: + return VdrError.SignerInvalidMessage( + ) + if variant == 13: + return VdrError.SignerMissingKey( + msg=_UniffiConverterString.read(buf), + ) + if variant == 14: + return VdrError.SignerUnexpectedError( + msg=_UniffiConverterString.read(buf), + ) + if variant == 15: + return VdrError.CommonInvalidData( + msg=_UniffiConverterString.read(buf), + ) + if variant == 16: + return VdrError.QuorumNotReached( + msg=_UniffiConverterString.read(buf), + ) + if variant == 17: + return VdrError.GetTransactionError( + msg=_UniffiConverterString.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, VdrError.ClientNodeUnreachable): + return + if isinstance(value, VdrError.ClientInvalidTransaction): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.ClientInvalidResponse): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.ClientTransactionReverted): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.ClientUnexpectedError): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.ClientInvalidState): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.ContractInvalidName): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.ContractInvalidSpec): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.ContractInvalidInputData): + return + if isinstance(value, VdrError.ContractInvalidResponseData): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.SignerInvalidPrivateKey): + return + if isinstance(value, VdrError.SignerInvalidMessage): + return + if isinstance(value, VdrError.SignerMissingKey): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.SignerUnexpectedError): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.CommonInvalidData): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.QuorumNotReached): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.GetTransactionError): + _UniffiConverterString.check_lower(value.msg) + return + + @staticmethod + def write(value, buf): + if isinstance(value, VdrError.ClientNodeUnreachable): + buf.write_i32(1) + if isinstance(value, VdrError.ClientInvalidTransaction): + buf.write_i32(2) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.ClientInvalidResponse): + buf.write_i32(3) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.ClientTransactionReverted): + buf.write_i32(4) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.ClientUnexpectedError): + buf.write_i32(5) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.ClientInvalidState): + buf.write_i32(6) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.ContractInvalidName): + buf.write_i32(7) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.ContractInvalidSpec): + buf.write_i32(8) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.ContractInvalidInputData): + buf.write_i32(9) + if isinstance(value, VdrError.ContractInvalidResponseData): + buf.write_i32(10) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.SignerInvalidPrivateKey): + buf.write_i32(11) + if isinstance(value, VdrError.SignerInvalidMessage): + buf.write_i32(12) + if isinstance(value, VdrError.SignerMissingKey): + buf.write_i32(13) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.SignerUnexpectedError): + buf.write_i32(14) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.CommonInvalidData): + buf.write_i32(15) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.QuorumNotReached): + buf.write_i32(16) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.GetTransactionError): + buf.write_i32(17) + _UniffiConverterString.write(value.msg, buf) + + + +class _UniffiConverterOptionalUInt8(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterUInt8.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterUInt8.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterUInt8.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterOptionalUInt64(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterUInt64.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterUInt64.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterUInt64.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterOptionalString(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterString.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterString.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterString.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterOptionalTypeContractSpec(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeContractSpec.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeContractSpec.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeContractSpec.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterOptionalTypeDidResolutionOptions(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeDidResolutionOptions.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeDidResolutionOptions.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeDidResolutionOptions.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterOptionalTypeQuorumConfig(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeQuorumConfig.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeQuorumConfig.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeQuorumConfig.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterOptionalTypeTransactionSignature(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeTransactionSignature.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeTransactionSignature.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeTransactionSignature.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterSequenceString(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterString.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterString.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterString.read(buf) for i in range(count) + ] + + + +class _UniffiConverterSequenceBytes(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterBytes.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterBytes.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterBytes.read(buf) for i in range(count) + ] + + + +class _UniffiConverterSequenceTypeContractConfig(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeContractConfig.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeContractConfig.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeContractConfig.read(buf) for i in range(count) + ] + + + +class _UniffiConverterSequenceTypeEventLog(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeEventLog.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeEventLog.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeEventLog.read(buf) for i in range(count) + ] + + +# Type alias +JsonValue = str + +class _UniffiConverterTypeJsonValue: + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value, buf) + + @staticmethod + def read(buf): + return _UniffiConverterString.read(buf) + + @staticmethod + def lift(value): + return _UniffiConverterString.lift(value) + + @staticmethod + def check_lower(value): + return _UniffiConverterString.check_lower(value) + + @staticmethod + def lower(value): + return _UniffiConverterString.lower(value) + +def build_add_validator_transaction(client: "LedgerClient",_from: "str",validator_address: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(validator_address) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_add_validator_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(validator_address)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_assign_role_transaction(client: "LedgerClient",_from: "str",role: "int",account: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterUInt8.check_lower(role) + + _UniffiConverterString.check_lower(account) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_assign_role_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterUInt8.lower(role), + _UniffiConverterString.lower(account)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_create_credential_definition_endorsing_data(client: "LedgerClient",id: "str",credential_definition: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterString.check_lower(credential_definition) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_endorsing_data( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id), + _UniffiConverterString.lower(credential_definition)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransactionEndorsingData.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_create_credential_definition_signed_transaction(client: "LedgerClient",_from: "str",id: "str",credential_definition: "str",signature: "SignatureData"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterString.check_lower(credential_definition) + + _UniffiConverterTypeSignatureData.check_lower(signature) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_signed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(id), + _UniffiConverterString.lower(credential_definition), + _UniffiConverterTypeSignatureData.lower(signature)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_create_credential_definition_transaction(client: "LedgerClient",_from: "str",id: "str",credential_definition: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterString.check_lower(credential_definition) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(id), + _UniffiConverterString.lower(credential_definition)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_create_schema_endorsing_data(client: "LedgerClient",id: "str",schema: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterString.check_lower(schema) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_endorsing_data( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id), + _UniffiConverterString.lower(schema)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransactionEndorsingData.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_create_schema_signed_transaction(client: "LedgerClient",_from: "str",id: "str",schema: "str",signature: "SignatureData"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterString.check_lower(schema) + + _UniffiConverterTypeSignatureData.check_lower(signature) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_signed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(id), + _UniffiConverterString.lower(schema), + _UniffiConverterTypeSignatureData.lower(signature)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_create_schema_transaction(client: "LedgerClient",_from: "str",id: "str",schema: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterString.check_lower(schema) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(id), + _UniffiConverterString.lower(schema)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_add_delegate_endorsing_data(client: "LedgerClient",did: "str",delegate_type: "str",delegate: "str",validity: "int"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(delegate_type) + + _UniffiConverterString.check_lower(delegate) + + _UniffiConverterUInt64.check_lower(validity) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_endorsing_data( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(delegate_type), + _UniffiConverterString.lower(delegate), + _UniffiConverterUInt64.lower(validity)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransactionEndorsingData.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_add_delegate_signed_transaction(client: "LedgerClient",_from: "str",did: "str",delegate_type: "str",delegate: "str",validity: "int",signature: "SignatureData"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(delegate_type) + + _UniffiConverterString.check_lower(delegate) + + _UniffiConverterUInt64.check_lower(validity) + + _UniffiConverterTypeSignatureData.check_lower(signature) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_signed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(delegate_type), + _UniffiConverterString.lower(delegate), + _UniffiConverterUInt64.lower(validity), + _UniffiConverterTypeSignatureData.lower(signature)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_add_delegate_transaction(client: "LedgerClient",_from: "str",did: "str",delegate_type: "str",delegate: "str",validity: "int"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(delegate_type) + + _UniffiConverterString.check_lower(delegate) + + _UniffiConverterUInt64.check_lower(validity) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(delegate_type), + _UniffiConverterString.lower(delegate), + _UniffiConverterUInt64.lower(validity)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_change_owner_endorsing_data(client: "LedgerClient",did: "str",new_owner: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(new_owner) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_endorsing_data( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(new_owner)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransactionEndorsingData.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_change_owner_signed_transaction(client: "LedgerClient",_from: "str",did: "str",new_owner: "str",signature: "SignatureData"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(new_owner) + + _UniffiConverterTypeSignatureData.check_lower(signature) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_signed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(new_owner), + _UniffiConverterTypeSignatureData.lower(signature)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_change_owner_transaction(client: "LedgerClient",_from: "str",did: "str",new_owner: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(new_owner) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(new_owner)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_revoke_attribute_endorsing_data(client: "LedgerClient",did: "str",attribute: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(attribute) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_endorsing_data( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(attribute)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransactionEndorsingData.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_revoke_attribute_signed_transaction(client: "LedgerClient",_from: "str",did: "str",attribute: "str",signature: "SignatureData"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(attribute) + + _UniffiConverterTypeSignatureData.check_lower(signature) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_signed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(attribute), + _UniffiConverterTypeSignatureData.lower(signature)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_revoke_attribute_transaction(client: "LedgerClient",_from: "str",did: "str",attribute: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(attribute) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(attribute)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_revoke_delegate_endorsing_data(client: "LedgerClient",did: "str",delegate_type: "str",delegate: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(delegate_type) + + _UniffiConverterString.check_lower(delegate) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_endorsing_data( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(delegate_type), + _UniffiConverterString.lower(delegate)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransactionEndorsingData.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_revoke_delegate_signed_transaction(client: "LedgerClient",_from: "str",did: "str",delegate_type: "str",delegate: "str",signature: "SignatureData"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(delegate_type) + + _UniffiConverterString.check_lower(delegate) + + _UniffiConverterTypeSignatureData.check_lower(signature) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_signed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(delegate_type), + _UniffiConverterString.lower(delegate), + _UniffiConverterTypeSignatureData.lower(signature)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_revoke_delegate_transaction(client: "LedgerClient",_from: "str",did: "str",delegate_type: "str",delegate: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(delegate_type) + + _UniffiConverterString.check_lower(delegate) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(delegate_type), + _UniffiConverterString.lower(delegate)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_set_attribute_endorsing_data(client: "LedgerClient",did: "str",attribute: "str",validity: "int"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(attribute) + + _UniffiConverterUInt64.check_lower(validity) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_endorsing_data( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(attribute), + _UniffiConverterUInt64.lower(validity)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransactionEndorsingData.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_set_attribute_signed_transaction(client: "LedgerClient",_from: "str",did: "str",attribute: "str",validity: "int",signature: "SignatureData"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(attribute) + + _UniffiConverterUInt64.check_lower(validity) + + _UniffiConverterTypeSignatureData.check_lower(signature) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_signed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(attribute), + _UniffiConverterUInt64.lower(validity), + _UniffiConverterTypeSignatureData.lower(signature)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_set_attribute_transaction(client: "LedgerClient",_from: "str",did: "str",attribute: "str",validity: "int"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(attribute) + + _UniffiConverterUInt64.check_lower(validity) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(attribute), + _UniffiConverterUInt64.lower(validity)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_credential_definition_created_transaction(client: "LedgerClient",id: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_credential_definition_created_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_credential_definition_query(client: "LedgerClient",id: "str",from_block: "typing.Optional[int]",to_block: "typing.Optional[int]"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterOptionalUInt64.check_lower(from_block) + + _UniffiConverterOptionalUInt64.check_lower(to_block) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_credential_definition_query( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id), + _UniffiConverterOptionalUInt64.lower(from_block), + _UniffiConverterOptionalUInt64.lower(to_block)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeEventQuery.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_did_changed_transaction(client: "LedgerClient",did: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_changed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_did_events_query(client: "LedgerClient",did: "str",from_block: "typing.Optional[int]",to_block: "typing.Optional[int]"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterOptionalUInt64.check_lower(from_block) + + _UniffiConverterOptionalUInt64.check_lower(to_block) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_events_query( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did), + _UniffiConverterOptionalUInt64.lower(from_block), + _UniffiConverterOptionalUInt64.lower(to_block)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeEventQuery.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_did_owner_transaction(client: "LedgerClient",did: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_owner_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_identity_nonce_transaction(client: "LedgerClient",identity: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(identity) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_identity_nonce_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(identity)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_role_transaction(client: "LedgerClient",account: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(account) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_role_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(account)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_schema_created_transaction(client: "LedgerClient",id: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_schema_created_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_schema_query(client: "LedgerClient",id: "str",from_block: "typing.Optional[int]",to_block: "typing.Optional[int]"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterOptionalUInt64.check_lower(from_block) + + _UniffiConverterOptionalUInt64.check_lower(to_block) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_schema_query( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id), + _UniffiConverterOptionalUInt64.lower(from_block), + _UniffiConverterOptionalUInt64.lower(to_block)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeEventQuery.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_validators_transaction(client: "LedgerClient"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_validators_transaction( + _UniffiConverterTypeLedgerClient.lower(client)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_has_role_transaction(client: "LedgerClient",role: "int",account: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterUInt8.check_lower(role) + + _UniffiConverterString.check_lower(account) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_has_role_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterUInt8.lower(role), + _UniffiConverterString.lower(account)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_remove_validator_transaction(client: "LedgerClient",_from: "str",validator_address: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(validator_address) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_remove_validator_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(validator_address)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_revoke_role_transaction(client: "LedgerClient",_from: "str",role: "int",account: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterUInt8.check_lower(role) + + _UniffiConverterString.check_lower(account) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_revoke_role_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterUInt8.lower(role), + _UniffiConverterString.lower(account)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def parse_credential_definition_created_event(client: "LedgerClient",log: "EventLog") -> "str": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterTypeEventLog.check_lower(log) + + return _UniffiConverterString.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_credential_definition_created_event, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterTypeEventLog.lower(log))) + + +def parse_credential_definition_created_result(client: "LedgerClient",bytes: "bytes") -> "int": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterBytes.check_lower(bytes) + + return _UniffiConverterUInt64.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_credential_definition_created_result, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterBytes.lower(bytes))) + + +def parse_did_attribute_changed_event_response(client: "LedgerClient",log: "EventLog") -> "DidAttributeChanged": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterTypeEventLog.check_lower(log) + + return _UniffiConverterTypeDidAttributeChanged.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_attribute_changed_event_response, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterTypeEventLog.lower(log))) + + +def parse_did_changed_result(client: "LedgerClient",bytes: "bytes") -> "int": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterBytes.check_lower(bytes) + + return _UniffiConverterUInt64.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_changed_result, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterBytes.lower(bytes))) + + +def parse_did_delegate_changed_event_response(client: "LedgerClient",log: "EventLog") -> "DidDelegateChanged": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterTypeEventLog.check_lower(log) + + return _UniffiConverterTypeDidDelegateChanged.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_delegate_changed_event_response, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterTypeEventLog.lower(log))) + + +def parse_did_event_response(client: "LedgerClient",log: "EventLog") -> "DidEvents": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterTypeEventLog.check_lower(log) + + return _UniffiConverterTypeDidEvents.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_event_response, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterTypeEventLog.lower(log))) + + +def parse_did_owner_changed_event_response(client: "LedgerClient",log: "EventLog") -> "DidOwnerChanged": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterTypeEventLog.check_lower(log) + + return _UniffiConverterTypeDidOwnerChanged.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_owner_changed_event_response, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterTypeEventLog.lower(log))) + + +def parse_did_owner_result(client: "LedgerClient",bytes: "bytes") -> "str": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterBytes.check_lower(bytes) + + return _UniffiConverterString.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_owner_result, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterBytes.lower(bytes))) + + +def parse_get_role_result(client: "LedgerClient",bytes: "bytes") -> "int": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterBytes.check_lower(bytes) + + return _UniffiConverterUInt8.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_get_role_result, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterBytes.lower(bytes))) + + +def parse_get_validators_result(client: "LedgerClient",bytes: "bytes") -> "str": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterBytes.check_lower(bytes) + + return _UniffiConverterString.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_get_validators_result, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterBytes.lower(bytes))) + + +def parse_has_role_result(client: "LedgerClient",bytes: "bytes") -> "bool": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterBytes.check_lower(bytes) + + return _UniffiConverterBool.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_has_role_result, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterBytes.lower(bytes))) + + +def parse_schema_created_event(client: "LedgerClient",log: "EventLog") -> "str": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterTypeEventLog.check_lower(log) + + return _UniffiConverterString.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_schema_created_event, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterTypeEventLog.lower(log))) + + +def parse_schema_created_result(client: "LedgerClient",bytes: "bytes") -> "int": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterBytes.check_lower(bytes) + + return _UniffiConverterUInt64.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_schema_created_result, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterBytes.lower(bytes))) + + +def resolve_credential_definition(client: "LedgerClient",id: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_credential_definition( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer, + # lift function + _UniffiConverterString.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def resolve_did(client: "LedgerClient",did: "str",options: "typing.Optional[DidResolutionOptions]"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterOptionalTypeDidResolutionOptions.check_lower(options) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_did( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did), + _UniffiConverterOptionalTypeDidResolutionOptions.lower(options)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer, + # lift function + _UniffiConverterString.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def resolve_schema(client: "LedgerClient",id: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_schema( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer, + # lift function + _UniffiConverterString.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +__all__ = [ + "InternalError", + "DidEvents", + "Status", + "TransactionType", + "VdrError", + "ContractConfig", + "ContractSpec", + "DidAttributeChanged", + "DidDelegateChanged", + "DidOwnerChanged", + "DidResolutionOptions", + "EventLog", + "PingStatus", + "QuorumConfig", + "SignatureData", + "TransactionSignature", + "build_add_validator_transaction", + "build_assign_role_transaction", + "build_create_credential_definition_endorsing_data", + "build_create_credential_definition_signed_transaction", + "build_create_credential_definition_transaction", + "build_create_schema_endorsing_data", + "build_create_schema_signed_transaction", + "build_create_schema_transaction", + "build_did_add_delegate_endorsing_data", + "build_did_add_delegate_signed_transaction", + "build_did_add_delegate_transaction", + "build_did_change_owner_endorsing_data", + "build_did_change_owner_signed_transaction", + "build_did_change_owner_transaction", + "build_did_revoke_attribute_endorsing_data", + "build_did_revoke_attribute_signed_transaction", + "build_did_revoke_attribute_transaction", + "build_did_revoke_delegate_endorsing_data", + "build_did_revoke_delegate_signed_transaction", + "build_did_revoke_delegate_transaction", + "build_did_set_attribute_endorsing_data", + "build_did_set_attribute_signed_transaction", + "build_did_set_attribute_transaction", + "build_get_credential_definition_created_transaction", + "build_get_credential_definition_query", + "build_get_did_changed_transaction", + "build_get_did_events_query", + "build_get_did_owner_transaction", + "build_get_identity_nonce_transaction", + "build_get_role_transaction", + "build_get_schema_created_transaction", + "build_get_schema_query", + "build_get_validators_transaction", + "build_has_role_transaction", + "build_remove_validator_transaction", + "build_revoke_role_transaction", + "parse_credential_definition_created_event", + "parse_credential_definition_created_result", + "parse_did_attribute_changed_event_response", + "parse_did_changed_result", + "parse_did_delegate_changed_event_response", + "parse_did_event_response", + "parse_did_owner_changed_event_response", + "parse_did_owner_result", + "parse_get_role_result", + "parse_get_validators_result", + "parse_has_role_result", + "parse_schema_created_event", + "parse_schema_created_result", + "resolve_credential_definition", + "resolve_did", + "resolve_schema", + "EventQuery", + "LedgerClient", + "Transaction", + "TransactionEndorsingData", +] + diff --git a/vdr/wrappers/python/indy2_vdr/version.py b/vdr/wrappers/python/indy_besu_vdr/version.py similarity index 100% rename from vdr/wrappers/python/indy2_vdr/version.py rename to vdr/wrappers/python/indy_besu_vdr/version.py diff --git a/vdr/wrappers/python/setup.py b/vdr/wrappers/python/setup.py index a883aa60..c763f317 100644 --- a/vdr/wrappers/python/setup.py +++ b/vdr/wrappers/python/setup.py @@ -4,7 +4,7 @@ import runpy from setuptools import find_packages, setup -PACKAGE_NAME = "indy2_vdr" +PACKAGE_NAME = "indy_besu_vdr" version_meta = runpy.run_path("./{}/version.py".format(PACKAGE_NAME)) VERSION = version_meta["__version__"] @@ -23,9 +23,9 @@ include_package_data=True, package_data={ "": [ - "indy2_vdr_uniffi.dll", - "libindy2_vdr_uniffi.dylib", - "libindy2_vdr_uniffi.so", + "indy_besu_vdr_uniffi.dll", + "libindy_besu_vdr_uniffi.dylib", + "libindy_besu_vdr_uniffi.so", ] }, python_requires=">=3.6.3",