diff --git a/.github/workflows/devpackpublish.yml b/.github/workflows/devpackpublish.yml index a976dc9cc..775829df7 100644 --- a/.github/workflows/devpackpublish.yml +++ b/.github/workflows/devpackpublish.yml @@ -23,7 +23,7 @@ jobs: token: ${{ secrets.REPO_ACCESS_TOKEN }} - uses: actions/setup-node@v3 with: - node-version: 14 + node-version-file: '.nvmrc' cache: 'yarn' - name: Install dependencies run: yarn install --immutable diff --git a/.github/workflows/npmpublish-rc.yml b/.github/workflows/npmpublish-rc.yml index c53519c74..32757d77c 100644 --- a/.github/workflows/npmpublish-rc.yml +++ b/.github/workflows/npmpublish-rc.yml @@ -9,7 +9,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 14 + node-version-file: '.nvmrc' cache: 'yarn' - run: yarn install --immutable - run: yarn build @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 14 + node-version-file: '.nvmrc' cache: 'yarn' - name: Install dependencies run: yarn install --immutable diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 7f3123b81..69f679d51 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -9,7 +9,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 14 + node-version-file: '.nvmrc' cache: 'yarn' - run: yarn install --immutable - run: yarn build @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 14 + node-version-file: '.nvmrc' cache: 'yarn' - name: Install dependencies run: yarn install --immutable diff --git a/.github/workflows/test-node-candidate.yml b/.github/workflows/test-node-candidate.yml index 6276ffd4c..8e933834f 100644 --- a/.github/workflows/test-node-candidate.yml +++ b/.github/workflows/test-node-candidate.yml @@ -21,7 +21,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: 14 + node-version-file: '.nvmrc' cache: 'yarn' - name: yarn install run: yarn install --immutable @@ -51,17 +51,17 @@ jobs: needs: cache_imgs steps: - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 14 - - name: Log out node version - run: node --version - uses: actions/download-artifact@v3 with: name: build - name: unzip run: unzip build.zip -d . + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + - name: Log out node version + run: node --version - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 @@ -97,15 +97,15 @@ jobs: needs: build steps: - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 14 - uses: actions/download-artifact@v3 with: name: build - name: unzip run: unzip build.zip -d . + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' - name: yarn bundle run: yarn bundle - name: upload bundle artifact @@ -120,9 +120,6 @@ jobs: needs: [cache_imgs, bundle_cache] steps: - - uses: actions/setup-node@v3 - with: - node-version: '16.x' - uses: actions/download-artifact@v3 with: name: build @@ -132,6 +129,9 @@ jobs: with: name: checked-nonmin-bundle path: packages/sdk-js/dist + - uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' - run: basename /packages/sdk-js/dist/ - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 diff --git a/.github/workflows/tests-polkadot-deps.yml b/.github/workflows/tests-polkadot-deps.yml index b83dd2869..ced20feba 100644 --- a/.github/workflows/tests-polkadot-deps.yml +++ b/.github/workflows/tests-polkadot-deps.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - node-version: [14.x, 16.x] + node-version: [16.x, 18.x, 20.x] steps: - uses: actions/checkout@v3 @@ -58,10 +58,10 @@ jobs: strategy: matrix: - node-version: [14.x] + node-version: [16.x, 18.x] required: ['required'] include: - - node-version: 16.x + - node-version: 20.x required: 'optional' continue-on-error: ${{ matrix.required == 'optional' }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3b83fb704..626adea2b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,7 +41,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: 14 + node-version-file: '.nvmrc' cache: 'yarn' - name: yarn install run: yarn install --immutable @@ -60,15 +60,15 @@ jobs: needs: build steps: - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 14 - uses: actions/download-artifact@v3 with: name: build - name: unzip run: unzip build.zip -d . + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' - name: lint run: yarn lint - name: check dependency duplication @@ -80,10 +80,10 @@ jobs: strategy: matrix: - node-version: [14, 16] + node-version: [16, 18] required: ['required'] include: - - node-version: 18 + - node-version: 20 required: 'optional' continue-on-error: ${{ matrix.required == 'optional' }} @@ -124,17 +124,17 @@ jobs: continue-on-error: ${{ matrix.required == 'optional' }} steps: - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 14 - - name: Log out node version - run: node --version - uses: actions/download-artifact@v3 with: name: build - name: unzip run: unzip build.zip -d . + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + - name: Log out node version + run: node --version - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 @@ -170,15 +170,15 @@ jobs: needs: build steps: - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 14 - uses: actions/download-artifact@v3 with: name: build - name: unzip run: unzip build.zip -d . + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' - name: yarn bundle run: yarn bundle - name: upload bundle artifact @@ -201,9 +201,6 @@ jobs: continue-on-error: ${{ matrix.required == 'optional' }} steps: - - uses: actions/setup-node@v3 - with: - node-version: '16.x' - uses: actions/download-artifact@v3 with: name: build @@ -214,6 +211,10 @@ jobs: name: checked-nonmin-bundle path: packages/sdk-js/dist + - uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 with: diff --git a/.nvmrc b/.nvmrc index b009dfb9d..27cb0ee2c 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts/* +lts/Gallium diff --git a/package.json b/package.json index 5ea910099..3be995212 100644 --- a/package.json +++ b/package.json @@ -17,10 +17,11 @@ "publish": "yarn workspaces foreach -pt --no-private npm publish", "lint": "eslint packages --format=codeframe", "lint:fix": "yarn lint --fix", - "set:version": "yarn workspaces foreach -p exec npm version --no-git-tag-version", + "set:version": "npm version --no-git-tag-version --no-workspaces-update --workspaces --include-workspace-root", "style": "prettier -l packages", "style:fix": "yarn style --write", "test": "jest --coverage --group=unit", + "test:breaking": "jest --group=breaking", "test:ci": "yarn test --ci --forceExit", "test:integration": "jest --group=integration -w 3 --testTimeout=30000", "test:integration:ci": "jest --group=integration -b -w 3 --testTimeout=60000", @@ -69,6 +70,6 @@ "typedoc": "^0.22.15", "typescript": "^4.8.3" }, - "version": "0.32.1", + "version": "0.33.0", "packageManager": "yarn@3.3.1" } diff --git a/packages/asset-did/package.json b/packages/asset-did/package.json index 5b0b01ee6..d45398aaa 100644 --- a/packages/asset-did/package.json +++ b/packages/asset-did/package.json @@ -1,6 +1,6 @@ { "name": "@kiltprotocol/asset-did", - "version": "0.32.1", + "version": "0.33.0", "description": "", "main": "./lib/cjs/index.js", "module": "./lib/esm/index.js", @@ -23,7 +23,7 @@ }, "repository": "github:kiltprotocol/sdk-js", "engines": { - "node": ">=14.0" + "node": ">=16.0" }, "author": "", "license": "BSD-4-Clause", diff --git a/packages/augment-api/extraDefs/package.json b/packages/augment-api/extraDefs/package.json new file mode 100644 index 000000000..fdcd276d0 --- /dev/null +++ b/packages/augment-api/extraDefs/package.json @@ -0,0 +1,7 @@ +{ + "types": "../lib/interfaces/extraDefs/index.d.ts", + "//": [ + "This is a fallback to support the extraDefs subpath export for module systems that do not support the package.json exports field.", + "Inspired by https://github.com/andrewbranch/example-subpath-exports-ts-compat/blob/1ffe3425b0a7ad8ecdf3c373f76f431ee341366b/examples/node_modules/package-json-redirects/." + ] +} diff --git a/packages/augment-api/index.cjs b/packages/augment-api/index.cjs new file mode 100644 index 000000000..4356e3d34 --- /dev/null +++ b/packages/augment-api/index.cjs @@ -0,0 +1,10 @@ +/** + * Copyright (c) 2018-2023, BOTLabs GmbH. + * + * This source code is licensed under the BSD 4-Clause "Original" license + * found in the LICENSE file in the root directory of this source tree. + */ + +// This package does not contain executable code. Index files are included only to allow api augmentation using `require('@kiltprotocol/augment-api')`. + +module.exports = {} diff --git a/packages/augment-api/index.mjs b/packages/augment-api/index.mjs new file mode 100644 index 000000000..1a8271966 --- /dev/null +++ b/packages/augment-api/index.mjs @@ -0,0 +1,10 @@ +/** + * Copyright (c) 2018-2023, BOTLabs GmbH. + * + * This source code is licensed under the BSD 4-Clause "Original" license + * found in the LICENSE file in the root directory of this source tree. + */ + +// This package does not contain executable code. Index files are included only to allow api augmentation using `import '@kiltprotocol/augment-api'`. + +export {} diff --git a/packages/augment-api/package.json b/packages/augment-api/package.json index 95737b1eb..5d780a331 100644 --- a/packages/augment-api/package.json +++ b/packages/augment-api/package.json @@ -1,49 +1,51 @@ { "name": "@kiltprotocol/augment-api", - "version": "0.32.1", + "version": "0.33.0", "description": "", - "main": "./lib/cjs/index.js", - "module": "./lib/esm/index.js", - "types": "./lib/cjs/index.d.ts", + "types": "./lib/index.d.ts", + "type": "module", + "main": "./index.cjs", "exports": { ".": { - "types": "./lib/cjs/index.d.ts", - "import": "./lib/esm/index.js", - "require": "./lib/cjs/index.js" + "types": "./lib/index.d.ts", + "import": "./index.mjs", + "require": "./index.cjs" + }, + "./extraDefs": { + "types": "./lib/interfaces/extraDefs/index.d.ts" } }, "files": [ - "lib/**/*" + "lib/**/*", + "index.mjs", + "index.cjs", + "extraDefs/*" ], "scripts": { "clean": "rimraf ./lib", "build": "yarn clean && yarn build:ts", "build:types": "yarn generate:defs && yarn generate:meta && yarn build:fixes", "build:fixes": "node scripts/fixTypes.mjs", - "build:ts": "yarn build:cjs && yarn build:esm", - "build:cjs": "tsc --declaration -p tsconfig.build.json && echo '{\"type\":\"commonjs\"}' > ./lib/cjs/package.json", - "build:esm": "tsc --declaration -p tsconfig.esm.json && echo '{\"type\":\"module\"}' > ./lib/esm/package.json", - "generate:defs": "ts-node --skip-project ../../node_modules/.bin/polkadot-types-from-defs --package @kiltprotocol/augment-api --input ./src/interfaces --endpoint ./metadata/spiritnet.json", - "generate:meta": "ts-node --skip-project ../../node_modules/.bin/polkadot-types-from-chain --package @kiltprotocol/augment-api --endpoint ./metadata/spiritnet.json --output ./src/interfaces --strict", - "update-metadata": "node ./scripts/fetchMetadata.js -o './metadata/spiritnet.json' -e 'wss://spiritnet.kilt.io/'" + "build:ts": "tsc -p tsconfig.build.json", + "generate:defs": "ts-node --esm -P tsconfig.build.json ../../node_modules/.bin/polkadot-types-from-defs --package @kiltprotocol/augment-api --input ./src/interfaces --endpoint ./metadata/spiritnet.json", + "generate:meta": "ts-node --esm -P tsconfig.build.json ../../node_modules/.bin/polkadot-types-from-chain --package @kiltprotocol/augment-api --endpoint ./metadata/spiritnet.json --output ./src/interfaces --strict", + "update-metadata": "node ./scripts/fetchMetadata.cjs -o './metadata/spiritnet.json' -e 'wss://spiritnet.kilt.io/'" }, "repository": "github:kiltprotocol/sdk-js", "engines": { - "node": ">=14.0" + "node": ">=16.0" }, "author": "", "license": "BSD-4-Clause", "bugs": "https://github.com/KILTprotocol/sdk-js/issues", "homepage": "https://github.com/KILTprotocol/sdk-js#readme", "devDependencies": { - "@polkadot/api": "^9.10.2", - "@polkadot/typegen": "^9.10.2", - "@types/websocket": "^1.0.5", + "@polkadot/api": "^10.4.0", + "@polkadot/typegen": "^10.4.0", "glob": "^7.1.1", "rimraf": "^3.0.2", "ts-node": "^10.4.0", "typescript": "^4.8.3", - "websocket": "^1.0.34", "yargs": "^16.2.0" }, "dependencies": { diff --git a/packages/augment-api/scripts/fetchMetadata.js b/packages/augment-api/scripts/fetchMetadata.cjs similarity index 100% rename from packages/augment-api/scripts/fetchMetadata.js rename to packages/augment-api/scripts/fetchMetadata.cjs diff --git a/packages/augment-api/src/interfaces/augment-api-query.ts b/packages/augment-api/src/interfaces/augment-api-query.ts index dd5e9f356..0c6ed3456 100644 --- a/packages/augment-api/src/interfaces/augment-api-query.ts +++ b/packages/augment-api/src/interfaces/augment-api-query.ts @@ -9,7 +9,7 @@ import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/ import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, Call, H256 } from '@polkadot/types/interfaces/runtime'; -import type { AttestationAttestationsAttestationDetails, CtypeCtypeEntry, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, DelegationDelegationHierarchyDelegationHierarchyDetails, DelegationDelegationHierarchyDelegationNode, DidDidDetails, DidServiceEndpointsDidEndpoint, FrameSupportDispatchPerDispatchClassWeight, FrameSupportPreimagesBounded, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KiltAssetDidsV1AssetDid, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReserveData, PalletCollectiveVotes, PalletDemocracyReferendumInfo, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletDidLookupConnectionRecord, PalletDidLookupLinkableAccountLinkableAccountId, PalletDidLookupMigrationState, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerScheduled, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletWeb3NamesWeb3NameWeb3NameOwnership, ParachainStakingCandidate, ParachainStakingDelegationCounter, ParachainStakingInflationInflationInfo, ParachainStakingRoundInfo, ParachainStakingStake, ParachainStakingTotalStake, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, PublicCredentialsCredentialsCredentialEntry, RuntimeCommonAssetsAssetDid, RuntimeCommonAuthorizationAuthorizationId, SpConsensusAuraSr25519AppSr25519Public, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpTrieStorageProof, SpWeightsWeightV2Weight, SpiritnetRuntimeSessionKeys } from '@polkadot/types/lookup'; +import type { AttestationAttestationsAttestationDetails, CtypeCtypeEntry, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, DelegationDelegationHierarchyDelegationHierarchyDetails, DelegationDelegationHierarchyDelegationNode, DidDidDetails, DidServiceEndpointsDidEndpoint, FrameSupportDispatchPerDispatchClassWeight, FrameSupportPreimagesBounded, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReserveData, PalletCollectiveVotes, PalletDemocracyReferendumInfo, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletDidLookupConnectionRecord, PalletDidLookupLinkableAccountLinkableAccountId, PalletDidLookupMigrationState, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerScheduled, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletWeb3NamesWeb3NameWeb3NameOwnership, ParachainStakingCandidate, ParachainStakingDelegationCounter, ParachainStakingInflationInflationInfo, ParachainStakingRoundInfo, ParachainStakingStake, ParachainStakingTotalStake, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, PublicCredentialsCredentialsCredentialEntry, RuntimeCommonAssetsAssetDid, RuntimeCommonAuthorizationAuthorizationId, SpConsensusAuraSr25519AppSr25519Public, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpTrieStorageProof, SpWeightsWeightV2Weight, SpiritnetRuntimeSessionKeys } from '@polkadot/types/lookup'; import type { Observable } from '@polkadot/types/types'; export type __AugmentedQuery = AugmentedQuery unknown>; @@ -557,7 +557,7 @@ declare module '@polkadot/api-base/types/storage' { * * It it used to perform efficient lookup of credentials given their ID. **/ - credentialSubjects: AugmentedQuery Observable>, [H256]>; + credentialSubjects: AugmentedQuery Observable>, [H256]>; }; randomnessCollectiveFlip: { /** diff --git a/packages/augment-api/src/interfaces/augment-api-rpc.ts b/packages/augment-api/src/interfaces/augment-api-rpc.ts index b763fa845..bd142eb07 100644 --- a/packages/augment-api/src/interfaces/augment-api-rpc.ts +++ b/packages/augment-api/src/interfaces/augment-api-rpc.ts @@ -21,7 +21,7 @@ import type { CreatedBlock } from '@polkadot/types/interfaces/engine'; import type { EthAccount, EthCallRequest, EthFeeHistory, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth'; import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics'; import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa'; -import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr'; +import type { MmrHash, MmrLeafBatchProof } from '@polkadot/types/interfaces/mmr'; import type { StorageKind } from '@polkadot/types/interfaces/offchain'; import type { FeeDetails, RuntimeDispatchInfoV1 } from '@polkadot/types/interfaces/payment'; import type { RpcMethods } from '@polkadot/types/interfaces/rpc'; @@ -275,7 +275,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Returns the number of transactions sent from given address at given time (block number). **/ - getTransactionCount: AugmentedRpc<(hash: H256 | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable>; + getTransactionCount: AugmentedRpc<(address: H160 | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable>; /** * Returns transaction receipt by transaction hash. **/ @@ -373,13 +373,21 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { }; mmr: { /** - * Generate MMR proof for the given leaf indices. + * Generate MMR proof for the given block numbers. **/ - generateBatchProof: AugmentedRpc<(leafIndices: Vec | (u64 | AnyNumber | Uint8Array)[], at?: BlockHash | string | Uint8Array) => Observable>; + generateProof: AugmentedRpc<(blockNumbers: Vec | (u64 | AnyNumber | Uint8Array)[], bestKnownBlockNumber?: u64 | AnyNumber | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable>; /** - * Generate MMR proof for given leaf index. + * Get the MMR root hash for the current best block. **/ - generateProof: AugmentedRpc<(leafIndex: u64 | AnyNumber | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable>; + root: AugmentedRpc<(at?: BlockHash | string | Uint8Array) => Observable>; + /** + * Verify an MMR proof + **/ + verifyProof: AugmentedRpc<(proof: MmrLeafBatchProof | { blockHash?: any; leaves?: any; proof?: any } | string | Uint8Array) => Observable>; + /** + * Verify an MMR proof statelessly given an mmr_root + **/ + verifyProofStateless: AugmentedRpc<(root: MmrHash | string | Uint8Array, proof: MmrLeafBatchProof | { blockHash?: any; leaves?: any; proof?: any } | string | Uint8Array) => Observable>; }; net: { /** diff --git a/packages/augment-api/src/interfaces/augment-api-runtime.ts b/packages/augment-api/src/interfaces/augment-api-runtime.ts index 083ee0388..8dd92c730 100644 --- a/packages/augment-api/src/interfaces/augment-api-runtime.ts +++ b/packages/augment-api/src/interfaces/augment-api-runtime.ts @@ -5,19 +5,18 @@ // this is required to allow for ambient/previous definitions import '@polkadot/api-base/types/calls'; -// FIXME: Error when using the autogenerated "from '@kiltprotocol/augment-api/extraDefs'" -import type { DidApiAccountId, PublicCredentialError, PublicCredentialFilter, RawDidLinkedInfo, StakingRates } from './extraDefs/index.js'; - +import type { DidApiAccountId, PublicCredentialError, PublicCredentialFilter, RawDidLinkedInfo, StakingRates } from '@kiltprotocol/augment-api/extraDefs'; import type { ApiTypes, AugmentedCall, DecoratedCallBase } from '@polkadot/api-base/types'; -import type { Bytes, Null, Option, Result, Text, Vec } from '@polkadot/types-codec'; -import type { ITuple } from '@polkadot/types-codec/types'; +import type { Bytes, Null, Option, Result, Text, Vec, u32 } from '@polkadot/types-codec'; +import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types'; import type { CheckInherentsResult, InherentData } from '@polkadot/types/interfaces/blockbuilder'; import type { BlockHash } from '@polkadot/types/interfaces/chain'; import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; import type { CollationInfo } from '@polkadot/types/interfaces/cumulus'; import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics'; import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata'; -import type { AccountId, AccountId32, Balance, Block, Hash, Header, Index, KeyTypeId, SlotDuration } from '@polkadot/types/interfaces/runtime'; +import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; +import type { AccountId, AccountId32, Balance, Block, Call, Hash, Header, Index, KeyTypeId, SlotDuration, Weight } from '@polkadot/types/interfaces/runtime'; import type { RuntimeVersion } from '@polkadot/types/interfaces/state'; import type { ApplyExtrinsicResult } from '@polkadot/types/interfaces/system'; import type { TransactionSource, TransactionValidity } from '@polkadot/types/interfaces/txqueue'; @@ -159,5 +158,43 @@ declare module '@polkadot/api-base/types/calls' { **/ validateTransaction: AugmentedCall Observable>; }; + /** 0x37c8bb1350a9a2a8/3 */ + transactionPaymentApi: { + /** + * The transaction fee details + **/ + queryFeeDetails: AugmentedCall Observable>; + /** + * The transaction info + **/ + queryInfo: AugmentedCall Observable>; + /** + * Query the output of the current LengthToFee given some input + **/ + queryLengthToFee: AugmentedCall Observable>; + /** + * Query the output of the current WeightToFee given some input + **/ + queryWeightToFee: AugmentedCall Observable>; + }; + /** 0xf3ff14d5ab527059/3 */ + transactionPaymentCallApi: { + /** + * The call fee details + **/ + queryCallFeeDetails: AugmentedCall Observable>; + /** + * The call info + **/ + queryCallInfo: AugmentedCall Observable>; + /** + * Query the output of the current LengthToFee given some input + **/ + queryLengthToFee: AugmentedCall Observable>; + /** + * Query the output of the current WeightToFee given some input + **/ + queryWeightToFee: AugmentedCall Observable>; + }; } // AugmentedCalls } // declare module diff --git a/packages/augment-api/src/interfaces/augment-types.ts b/packages/augment-api/src/interfaces/augment-types.ts index 96d6c7fb6..85bb41fe3 100644 --- a/packages/augment-api/src/interfaces/augment-types.ts +++ b/packages/augment-api/src/interfaces/augment-types.ts @@ -5,11 +5,9 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -// FIXME: Error when using the autogenerated "from '@kiltprotocol/augment-api/extraDefs'" -import type { DidApiAccountId, PublicCredentialError, PublicCredentialFilter, RawDidLinkedInfo, StakingRates } from './extraDefs/index.js'; - +import type { DidApiAccountId, PublicCredentialError, PublicCredentialFilter, RawDidLinkedInfo, StakingRates } from '@kiltprotocol/augment-api/extraDefs'; import type { Data, StorageKey } from '@polkadot/types'; -import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; +import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, ISize, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, isize, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations'; import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura'; @@ -17,7 +15,7 @@ import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interface import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeGenesisConfiguration, BabeGenesisConfigurationV1, BabeWeight, Epoch, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, OpaqueKeyOwnershipProof, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe'; import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, ReserveData, ReserveIdentifier, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances'; -import type { BeefyAuthoritySet, BeefyCommitment, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefyPayloadId, BeefySignedCommitment, MmrRootHash, ValidatorSet, ValidatorSetId } from '@polkadot/types/interfaces/beefy'; +import type { BeefyAuthoritySet, BeefyCommitment, BeefyEquivocationProof, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefyPayloadId, BeefySignedCommitment, BeefyVoteMessage, MmrRootHash, ValidatorSet, ValidatorSetId } from '@polkadot/types/interfaces/beefy'; import type { BenchmarkBatch, BenchmarkConfig, BenchmarkList, BenchmarkMetadata, BenchmarkParameter, BenchmarkResult } from '@polkadot/types/interfaces/benchmark'; import type { CheckInherentsResult, InherentData, InherentIdentifier } from '@polkadot/types/interfaces/blockbuilder'; import type { BridgeMessageId, BridgedBlockHash, BridgedBlockNumber, BridgedHeader, CallOrigin, ChainId, DeliveredMessages, DispatchFeePayment, InboundLaneData, InboundRelayer, InitializationData, LaneId, MessageData, MessageKey, MessageNonce, MessagesDeliveryProofOf, MessagesProofOf, OperatingMode, OutboundLaneData, OutboundMessageFee, OutboundPayload, Parameter, RelayerId, UnrewardedRelayer, UnrewardedRelayersState } from '@polkadot/types/interfaces/bridges'; @@ -37,25 +35,27 @@ import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engin import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFeeHistory, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthReceiptV0, EthReceiptV3, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth'; import type { EvmAccount, EvmCallInfo, EvmCreateInfo, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm'; import type { AnySignature, EcdsaSignature, Ed25519Signature, Era, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics'; +import type { FungiblesAccessError } from '@polkadot/types/interfaces/fungibles'; import type { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset'; import type { ActiveGilt, ActiveGiltsTotal, ActiveIndex, GiltBid } from '@polkadot/types/interfaces/gilt'; import type { AuthorityIndex, AuthorityList, AuthoritySet, AuthoritySetChange, AuthoritySetChanges, AuthorityWeight, DelayKind, DelayKindBest, EncodedFinalityProofs, ForkTreePendingChange, ForkTreePendingChangeNode, GrandpaCommit, GrandpaEquivocation, GrandpaEquivocationProof, GrandpaEquivocationValue, GrandpaJustification, GrandpaPrecommit, GrandpaPrevote, GrandpaSignedPrecommit, JustificationNotification, KeyOwnerProof, NextAuthority, PendingChange, PendingPause, PendingResume, Precommits, Prevotes, ReportedRoundStates, RoundState, SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa'; import type { IdentityFields, IdentityInfo, IdentityInfoAdditional, IdentityInfoTo198, IdentityJudgement, RegistrarIndex, RegistrarInfo, Registration, RegistrationJudgement, RegistrationTo198 } from '@polkadot/types/interfaces/identity'; import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline'; import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery'; -import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, OpaqueMetadata, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; -import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafBatchProof, MmrLeafIndex, MmrLeafProof, MmrNodeIndex, MmrProof } from '@polkadot/types/interfaces/mmr'; -import type { NpApiError } from '@polkadot/types/interfaces/nompools'; +import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV15, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, OpaqueMetadata, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletMetadataV15, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, RuntimeApiMetadataLatest, RuntimeApiMetadataV15, RuntimeApiMethodMetadataV15, RuntimeApiMethodParamMetadataV15, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; +import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrHash, MmrLeafBatchProof, MmrLeafIndex, MmrLeafProof, MmrNodeIndex, MmrProof } from '@polkadot/types/interfaces/mmr'; +import type { NftCollectionId, NftItemId } from '@polkadot/types/interfaces/nfts'; +import type { NpApiError, NpPoolId } from '@polkadot/types/interfaces/nompools'; import type { StorageKind } from '@polkadot/types/interfaces/offchain'; import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences'; -import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateEvent, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, CoreState, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, GroupRotationInfo, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OccupiedCore, OccupiedCoreAssumption, OldV1SessionInfo, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, PvfCheckStatement, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, ScheduledCore, Scheduling, ScrapedOnChainVotes, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; +import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateEvent, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, CoreState, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExecutorParam, ExecutorParams, ExecutorParamsHash, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, GroupRotationInfo, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OccupiedCore, OccupiedCoreAssumption, OldV1SessionInfo, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, PvfCheckStatement, PvfExecTimeoutKind, PvfPrepTimeoutKind, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, ScheduledCore, Scheduling, ScrapedOnChainVotes, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; import type { FeeDetails, InclusionFee, RuntimeDispatchInfo, RuntimeDispatchInfoV1, RuntimeDispatchInfoV2 } from '@polkadot/types/interfaces/payment'; import type { Approvals } from '@polkadot/types/interfaces/poll'; import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy'; import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase'; import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery'; import type { RpcMethods } from '@polkadot/types/interfaces/rpc'; -import type { AccountId, AccountId20, AccountId32, AccountId33, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, SlotDuration, StorageData, StorageInfo, StorageProof, TransactionInfo, TransactionLongevity, TransactionPriority, TransactionStorageProof, TransactionTag, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier, WeightV1, WeightV2 } from '@polkadot/types/interfaces/runtime'; +import type { AccountId, AccountId20, AccountId32, AccountId33, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeCall, RuntimeDbWeight, RuntimeEvent, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, SlotDuration, StorageData, StorageInfo, StorageProof, TransactionInfo, TransactionLongevity, TransactionPriority, TransactionStorageProof, TransactionTag, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier, WeightV0, WeightV1, WeightV2 } from '@polkadot/types/interfaces/runtime'; import type { Si0Field, Si0LookupTypeId, Si0Path, Si0Type, Si0TypeDef, Si0TypeDefArray, Si0TypeDefBitSequence, Si0TypeDefCompact, Si0TypeDefComposite, Si0TypeDefPhantom, Si0TypeDefPrimitive, Si0TypeDefSequence, Si0TypeDefTuple, Si0TypeDefVariant, Si0TypeParameter, Si0Variant, Si1Field, Si1LookupTypeId, Si1Path, Si1Type, Si1TypeDef, Si1TypeDefArray, Si1TypeDefBitSequence, Si1TypeDefCompact, Si1TypeDefComposite, Si1TypeDefPrimitive, Si1TypeDefSequence, Si1TypeDefTuple, Si1TypeDefVariant, Si1TypeParameter, Si1Variant, SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefBitSequence, SiTypeDefCompact, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiTypeParameter, SiVariant } from '@polkadot/types/interfaces/scaleInfo'; import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler'; import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session'; @@ -153,12 +153,14 @@ declare module '@polkadot/types/types/registry' { BalanceStatus: BalanceStatus; BeefyAuthoritySet: BeefyAuthoritySet; BeefyCommitment: BeefyCommitment; + BeefyEquivocationProof: BeefyEquivocationProof; BeefyId: BeefyId; BeefyKey: BeefyKey; BeefyNextAuthoritySet: BeefyNextAuthoritySet; BeefyPayload: BeefyPayload; BeefyPayloadId: BeefyPayloadId; BeefySignedCommitment: BeefySignedCommitment; + BeefyVoteMessage: BeefyVoteMessage; BenchmarkBatch: BenchmarkBatch; BenchmarkConfig: BenchmarkConfig; BenchmarkList: BenchmarkList; @@ -442,6 +444,9 @@ declare module '@polkadot/types/types/registry' { EvmLog: EvmLog; EvmVicinity: EvmVicinity; ExecReturnValue: ExecReturnValue; + ExecutorParam: ExecutorParam; + ExecutorParams: ExecutorParams; + ExecutorParamsHash: ExecutorParamsHash; ExitError: ExitError; ExitFatal: ExitFatal; ExitReason: ExitReason; @@ -502,6 +507,7 @@ declare module '@polkadot/types/types/registry' { FungibilityV0: FungibilityV0; FungibilityV1: FungibilityV1; FungibilityV2: FungibilityV2; + FungiblesAccessError: FungiblesAccessError; Gas: Gas; GiltBid: GiltBid; GlobalValidationData: GlobalValidationData; @@ -589,6 +595,8 @@ declare module '@polkadot/types/types/registry' { InteriorMultiLocation: InteriorMultiLocation; InvalidDisputeStatementKind: InvalidDisputeStatementKind; InvalidTransaction: InvalidTransaction; + isize: isize; + ISize: ISize; Json: Json; Junction: Junction; Junctions: Junctions; @@ -642,11 +650,13 @@ declare module '@polkadot/types/types/registry' { MetadataV12: MetadataV12; MetadataV13: MetadataV13; MetadataV14: MetadataV14; + MetadataV15: MetadataV15; MetadataV9: MetadataV9; MigrationStatusResult: MigrationStatusResult; MmrBatchProof: MmrBatchProof; MmrEncodableOpaqueLeaf: MmrEncodableOpaqueLeaf; MmrError: MmrError; + MmrHash: MmrHash; MmrLeafBatchProof: MmrLeafBatchProof; MmrLeafIndex: MmrLeafIndex; MmrLeafProof: MmrLeafProof; @@ -696,12 +706,15 @@ declare module '@polkadot/types/types/registry' { NextAuthority: NextAuthority; NextConfigDescriptor: NextConfigDescriptor; NextConfigDescriptorV1: NextConfigDescriptorV1; + NftCollectionId: NftCollectionId; + NftItemId: NftItemId; NodeRole: NodeRole; Nominations: Nominations; NominatorIndex: NominatorIndex; NominatorIndexCompact: NominatorIndexCompact; NotConnectedPeer: NotConnectedPeer; NpApiError: NpApiError; + NpPoolId: NpPoolId; Null: Null; OccupiedCore: OccupiedCore; OccupiedCoreAssumption: OccupiedCoreAssumption; @@ -749,6 +762,7 @@ declare module '@polkadot/types/types/registry' { PalletId: PalletId; PalletMetadataLatest: PalletMetadataLatest; PalletMetadataV14: PalletMetadataV14; + PalletMetadataV15: PalletMetadataV15; PalletsOrigin: PalletsOrigin; PalletStorageMetadataLatest: PalletStorageMetadataLatest; PalletStorageMetadataV14: PalletStorageMetadataV14; @@ -816,6 +830,8 @@ declare module '@polkadot/types/types/registry' { PublicCredentialError: PublicCredentialError; PublicCredentialFilter: PublicCredentialFilter; PvfCheckStatement: PvfCheckStatement; + PvfExecTimeoutKind: PvfExecTimeoutKind; + PvfPrepTimeoutKind: PvfPrepTimeoutKind; QueryId: QueryId; QueryStatus: QueryStatus; QueueConfigData: QueueConfigData; @@ -882,10 +898,16 @@ declare module '@polkadot/types/types/registry' { RoundSnapshot: RoundSnapshot; RoundState: RoundState; RpcMethods: RpcMethods; + RuntimeApiMetadataLatest: RuntimeApiMetadataLatest; + RuntimeApiMetadataV15: RuntimeApiMetadataV15; + RuntimeApiMethodMetadataV15: RuntimeApiMethodMetadataV15; + RuntimeApiMethodParamMetadataV15: RuntimeApiMethodParamMetadataV15; + RuntimeCall: RuntimeCall; RuntimeDbWeight: RuntimeDbWeight; RuntimeDispatchInfo: RuntimeDispatchInfo; RuntimeDispatchInfoV1: RuntimeDispatchInfoV1; RuntimeDispatchInfoV2: RuntimeDispatchInfoV2; + RuntimeEvent: RuntimeEvent; RuntimeVersion: RuntimeVersion; RuntimeVersionApi: RuntimeVersionApi; RuntimeVersionPartial: RuntimeVersionPartial; @@ -1161,6 +1183,7 @@ declare module '@polkadot/types/types/registry' { WeightMultiplier: WeightMultiplier; WeightPerClass: WeightPerClass; WeightToFeeCoefficient: WeightToFeeCoefficient; + WeightV0: WeightV0; WeightV1: WeightV1; WeightV2: WeightV2; WildFungibility: WildFungibility; diff --git a/packages/augment-api/src/interfaces/definitions.ts b/packages/augment-api/src/interfaces/definitions.ts index 25530a322..54565e8ce 100644 --- a/packages/augment-api/src/interfaces/definitions.ts +++ b/packages/augment-api/src/interfaces/definitions.ts @@ -1,3 +1,3 @@ /* eslint-disable */ -export { default as extraDefs } from './extraDefs/definitions' +export { default as extraDefs } from './extraDefs/definitions.js' diff --git a/packages/augment-api/tsconfig.build.json b/packages/augment-api/tsconfig.build.json index 46233a664..4ea5cbbd1 100644 --- a/packages/augment-api/tsconfig.build.json +++ b/packages/augment-api/tsconfig.build.json @@ -1,13 +1,15 @@ { "extends": "../../tsconfig.build.json", "compilerOptions": { - "module": "CommonJS", - "outDir": "./lib/cjs", + "module": "ES6", + "outDir": "./lib", + "declaration": true, + "emitDeclarationOnly": true, "skipLibCheck": true, "noUnusedLocals": false, "paths": { - "@kiltprotocol/augment-api/*": [ - "./src/*" + "@kiltprotocol/augment-api/extraDefs": [ + "./src/interfaces/extraDefs/index.ts" ], "@polkadot/api/augment": [ "./src/interfaces/augment-api.ts" diff --git a/packages/augment-api/tsconfig.esm.json b/packages/augment-api/tsconfig.esm.json deleted file mode 100644 index e1f3b73b6..000000000 --- a/packages/augment-api/tsconfig.esm.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.build.json", - "compilerOptions": { - "module": "ES6", - "outDir": "./lib/esm" - } -} diff --git a/packages/chain-helpers/package.json b/packages/chain-helpers/package.json index 7d239771b..8c7d4a5ca 100644 --- a/packages/chain-helpers/package.json +++ b/packages/chain-helpers/package.json @@ -1,6 +1,6 @@ { "name": "@kiltprotocol/chain-helpers", - "version": "0.32.1", + "version": "0.33.0", "description": "", "main": "./lib/cjs/index.js", "module": "./lib/esm/index.js", @@ -23,7 +23,7 @@ }, "repository": "github:kiltprotocol/sdk-js", "engines": { - "node": ">=14.0" + "node": ">=16.0" }, "author": "", "license": "BSD-4-Clause", @@ -31,7 +31,7 @@ "homepage": "https://github.com/KILTprotocol/sdk-js#readme", "devDependencies": { "@kiltprotocol/testing": "workspace:*", - "@polkadot/keyring": "^10.2.1", + "@polkadot/keyring": "^12.0.0", "rimraf": "^3.0.2", "typescript": "^4.8.3" }, @@ -39,7 +39,7 @@ "@kiltprotocol/config": "workspace:*", "@kiltprotocol/types": "workspace:*", "@kiltprotocol/utils": "workspace:*", - "@polkadot/api": "^9.10.2", - "@polkadot/types": "^9.10.2" + "@polkadot/api": "^10.4.0", + "@polkadot/types": "^10.4.0" } } diff --git a/packages/config/package.json b/packages/config/package.json index 0e2f8dbf3..802d6ae5e 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@kiltprotocol/config", - "version": "0.32.1", + "version": "0.33.0", "description": "", "type": "commonjs", "main": "./lib/index.js", @@ -25,7 +25,7 @@ }, "repository": "github:kiltprotocol/sdk-js", "engines": { - "node": ">=14.0" + "node": ">=16.0" }, "author": "", "license": "BSD-4-Clause", @@ -37,8 +37,7 @@ }, "dependencies": { "@kiltprotocol/types": "workspace:*", - "@kiltprotocol/utils": "workspace:*", - "@polkadot/api": "^9.10.2", + "@polkadot/api": "^10.4.0", "typescript-logging": "^1.0.0" } } diff --git a/packages/config/src/ConfigService.spec.ts b/packages/config/src/ConfigService.spec.ts index ad30eeaad..f5069556b 100644 --- a/packages/config/src/ConfigService.spec.ts +++ b/packages/config/src/ConfigService.spec.ts @@ -13,8 +13,6 @@ import { ApiPromise, WsProvider } from '@polkadot/api' import { LogLevel, Logger } from 'typescript-logging' -import { SDKErrors } from '@kiltprotocol/utils' - import * as ConfigService from './ConfigService' describe('Log Configuration', () => { @@ -47,8 +45,8 @@ describe('Log Configuration', () => { describe('Configuration Service', () => { it('has configuration Object with default values', () => { expect(ConfigService.get('logLevel')).toEqual(LogLevel.Error) - expect(() => ConfigService.get('api')).toThrowError( - SDKErrors.BlockchainApiMissingError + expect(() => ConfigService.get('api')).toThrowErrorMatchingInlineSnapshot( + `"The blockchain API is not set. Did you forget to call \`Kilt.connect(…)\` or \`Kilt.init(…)\`?"` ) }) describe('set function for api instance, logLevel and any custom configuration prop', () => { @@ -70,8 +68,8 @@ describe('Configuration Service', () => { describe('get function for api instance, logLevel and any other injected configuration prop', () => { it('throws if api not set', () => { ConfigService.unset('api') - expect(() => ConfigService.get('api')).toThrowError( - SDKErrors.BlockchainApiMissingError + expect(() => ConfigService.get('api')).toThrowErrorMatchingInlineSnapshot( + `"The blockchain API is not set. Did you forget to call \`Kilt.connect(…)\` or \`Kilt.init(…)\`?"` ) }) it('returns logLevel property', () => { diff --git a/packages/config/src/ConfigService.ts b/packages/config/src/ConfigService.ts index c2244d431..d9e68b4a8 100644 --- a/packages/config/src/ConfigService.ts +++ b/packages/config/src/ConfigService.ts @@ -22,8 +22,7 @@ import { getLogControl, LogGroupControlSettings, } from 'typescript-logging' -import { SDKErrors } from '@kiltprotocol/utils' -import { SubscriptionPromise } from '@kiltprotocol/types' +import type { SubscriptionPromise } from '@kiltprotocol/types' const DEFAULT_DEBUG_LEVEL = typeof process !== 'undefined' && @@ -72,7 +71,9 @@ export function get(configOpt: K): configOpts[K] { if (typeof configuration[configOpt] === 'undefined') { switch (configOpt) { case 'api': - throw new SDKErrors.BlockchainApiMissingError() + throw new Error( + 'The blockchain API is not set. Did you forget to call `Kilt.connect(…)` or `Kilt.init(…)`?' + ) default: throw new Error(`GENERIC NOT CONFIGURED ERROR FOR KEY: "${configOpt}"`) } diff --git a/packages/core/package.json b/packages/core/package.json index df6fc7af5..f5138906c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@kiltprotocol/core", - "version": "0.32.1", + "version": "0.33.0", "description": "", "main": "./lib/cjs/index.js", "module": "./lib/esm/index.js", @@ -23,7 +23,7 @@ }, "repository": "github:kiltprotocol/sdk-js", "engines": { - "node": ">=14.0" + "node": ">=16.0" }, "author": "", "license": "BSD-4-Clause", @@ -45,11 +45,11 @@ "@kiltprotocol/type-definitions": "workspace:*", "@kiltprotocol/types": "workspace:*", "@kiltprotocol/utils": "workspace:*", - "@polkadot/api": "^9.10.2", - "@polkadot/keyring": "^10.2.1", - "@polkadot/types": "^9.10.2", - "@polkadot/util": "^10.2.1", - "@polkadot/util-crypto": "^10.2.1", - "cbor": "^8.1.0" + "@polkadot/api": "^10.4.0", + "@polkadot/keyring": "^12.0.0", + "@polkadot/types": "^10.4.0", + "@polkadot/util": "^12.0.0", + "@polkadot/util-crypto": "^12.0.0", + "cbor-web": "^8.0.0" } } diff --git a/packages/core/src/__integrationtests__/Attestation.spec.ts b/packages/core/src/__integrationtests__/Attestation.spec.ts index 206fa3884..46883e811 100644 --- a/packages/core/src/__integrationtests__/Attestation.spec.ts +++ b/packages/core/src/__integrationtests__/Attestation.spec.ts @@ -158,7 +158,7 @@ describe('When there is an attester, claimer and ctype drivers license', () => { await expect( Credential.verifySignature(presentation) ).resolves.not.toThrow() - await Credential.verifyPresentation(presentation) + Credential.verifyWellFormed(presentation, { ctype: driversLicenseCType }) const attestation = Attestation.fromCredentialAndDid( presentation, @@ -183,6 +183,10 @@ describe('When there is an attester, claimer and ctype drivers license', () => { expect(storedAttestation).not.toBeNull() expect(storedAttestation?.revoked).toBe(false) + await expect( + Credential.verifyPresentation(presentation) + ).resolves.toMatchObject({ attester: attester.uri, revoked: false }) + // Claim the deposit back by submitting the reclaimDeposit extrinsic with the deposit payer's account. const reclaimTx = api.tx.attestation.reclaimDeposit(attestation.claimHash) await submitTx(reclaimTx, tokenHolder) @@ -191,6 +195,10 @@ describe('When there is an attester, claimer and ctype drivers license', () => { expect( (await api.query.attestation.attestations(attestation.claimHash)).isNone ).toBe(true) + + await expect( + Credential.verifyPresentation(presentation) + ).rejects.toThrowErrorMatchingInlineSnapshot(`"Attestation not found"`) }, 60_000) it('should not be possible to attest a claim without enough tokens', async () => { @@ -405,6 +413,10 @@ describe('When there is an attester, claimer and ctype drivers license', () => { ) expect(storedAttestationAfter).not.toBeNull() expect(storedAttestationAfter?.revoked).toBe(true) + + await expect( + Credential.verifyCredential(credential) + ).resolves.toMatchObject({ attester: attester.uri, revoked: true }) }, 40_000) it('should be possible for the deposit payer to remove an attestation', async () => { diff --git a/packages/core/src/__integrationtests__/Delegation.spec.ts b/packages/core/src/__integrationtests__/Delegation.spec.ts index 340e1463c..b2d56a31a 100644 --- a/packages/core/src/__integrationtests__/Delegation.spec.ts +++ b/packages/core/src/__integrationtests__/Delegation.spec.ts @@ -195,7 +195,7 @@ describe('and attestation rights have been delegated', () => { await expect( Credential.verifySignature(presentation) ).resolves.not.toThrow() - await Credential.verifyPresentation(presentation) + Credential.verifyWellFormed(presentation, { ctype: driversLicenseCType }) const attestation = Attestation.fromCredentialAndDid( credential, diff --git a/packages/core/src/attestation/Attestation.ts b/packages/core/src/attestation/Attestation.ts index aceb40d81..8e6ddb4f4 100644 --- a/packages/core/src/attestation/Attestation.ts +++ b/packages/core/src/attestation/Attestation.ts @@ -136,12 +136,22 @@ export function verifyAgainstCredential( attestation: IAttestation, credential: ICredential ): void { - if ( - credential.claim.cTypeHash !== attestation.cTypeHash || - credential.rootHash !== attestation.claimHash - ) { + const credentialMismatch = + credential.claim.cTypeHash !== attestation.cTypeHash + const ctypeMismatch = credential.rootHash !== attestation.claimHash + const delegationMismatch = + credential.delegationId !== attestation.delegationId + if (credentialMismatch || ctypeMismatch || delegationMismatch) { throw new SDKErrors.CredentialUnverifiableError( - 'Attestation does not match credential' + `Some attributes of the on-chain attestation diverge from the credential: ${[ + 'cTypeHash', + 'delegationId', + 'claimHash', + ] + .filter( + (_, i) => [ctypeMismatch, delegationMismatch, credentialMismatch][i] + ) + .join(', ')}` ) } Credential.verifyDataIntegrity(credential) diff --git a/packages/core/src/cbor-web.d.ts b/packages/core/src/cbor-web.d.ts new file mode 100644 index 000000000..4def7650e --- /dev/null +++ b/packages/core/src/cbor-web.d.ts @@ -0,0 +1 @@ +declare module 'cbor-web' diff --git a/packages/core/src/credential/Credential.spec.ts b/packages/core/src/credential/Credential.spec.ts index de70653a0..2d303ce80 100644 --- a/packages/core/src/credential/Credential.spec.ts +++ b/packages/core/src/credential/Credential.spec.ts @@ -28,17 +28,23 @@ import type { import { Crypto, SDKErrors, UUID } from '@kiltprotocol/utils' import * as Did from '@kiltprotocol/did' import { + ApiMocks, createLocalDemoFullDidFromKeypair, KeyTool, makeSigningKeyTool, } from '@kiltprotocol/testing' +import { ConfigService } from '@kiltprotocol/config' +import { randomAsHex } from '@polkadot/util-crypto' import * as Attestation from '../attestation' import * as Claim from '../claim' import * as CType from '../ctype' import * as Credential from './Credential' +import { init } from '../kilt' -const testCType = CType.fromProperties('raw ctype', { - name: { type: 'string' }, +const testCType = CType.fromProperties('Credential', { + a: { type: 'string' }, + b: { type: 'string' }, + c: { type: 'string' }, }) function buildCredential( @@ -60,6 +66,20 @@ function buildCredential( return credential } +beforeAll(async () => { + const api = ApiMocks.createAugmentedApi() + api.query.attestation = { + attestations: jest.fn().mockResolvedValue( + ApiMocks.mockChainQueryReturn('attestation', 'attestations', { + revoked: false, + attester: '4s5d7QHWSX9xx4DLafDtnTHK87n5e9G3UoKRrCDQ2gnrzYmZ', + ctypeHash: CType.idToHash(testCType.$id), + } as any) + ), + } as any + await init({ api }) +}) + describe('Credential', () => { const identityAlice = 'did:kilt:4nv4phaKc4EcwENdRERuMF79ZSSB5xvnAk3zNySSbVbXhSwS' @@ -83,9 +103,11 @@ describe('Credential', () => { ) // check proof on complete data expect(() => Credential.verifyDataIntegrity(credential)).not.toThrow() - await Credential.verifyCredential(credential, { - ctype: testCType, - }) + await expect( + Credential.verifyCredential(credential, { + ctype: testCType, + }) + ).resolves.toMatchObject({ revoked: false, attester: identityBob }) // just deleting a field will result in a wrong proof delete credential.claimNonceMap[Object.keys(credential.claimNonceMap)[0]] @@ -285,16 +307,131 @@ describe('Credential', () => { [] ) expect(() => - Credential.verifyAgainstCType(builtCredential, testCType) + Credential.verifyWellFormed(builtCredential, { ctype: testCType }) ).not.toThrow() - builtCredential.claim.contents.name = 123 + const builtCredentialWrong = buildCredential( + identityBob, + { + a: 'a', + b: 'b', + c: 1, + }, + [] + ) expect(() => - Credential.verifyAgainstCType(builtCredential, testCType) + Credential.verifyWellFormed(builtCredentialWrong, { ctype: testCType }) ).toThrow() }) + + it('two Credentials on an empty ctype will have different root hashes', async () => { + const ctype = CType.fromProperties('CType', {}) + const claimA1 = Claim.fromCTypeAndClaimContents(ctype, {}, identityAlice) + const claimA2 = Claim.fromCTypeAndClaimContents(ctype, {}, identityAlice) + + expect(Credential.fromClaim(claimA1).rootHash).not.toEqual( + Credential.fromClaim(claimA2).rootHash + ) + }) + + it('re-checks attestation status', async () => { + const api = ConfigService.get('api') + const credential = buildCredential( + identityBob, + { + a: 'a', + b: 'b', + c: 'c', + }, + [] + ) + + const { attester, revoked } = await Credential.verifyAttested(credential) + expect(revoked).toBe(false) + await expect( + Credential.refreshRevocationStatus({ ...credential, revoked, attester }) + ).resolves.toMatchObject({ revoked, attester }) + + jest.mocked(api.query.attestation.attestations).mockResolvedValueOnce( + ApiMocks.mockChainQueryReturn('attestation', 'attestations', { + revoked: true, + attester: Did.toChain(attester), + ctypeHash: credential.claim.cTypeHash, + } as any) as any + ) + await expect( + Credential.refreshRevocationStatus({ ...credential, revoked, attester }) + ).resolves.toMatchObject({ revoked: true, attester }) + + await expect( + Credential.refreshRevocationStatus(credential as any) + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"This function expects a VerifiedCredential with properties \`revoked\` (boolean) and \`attester\` (string)"` + ) + + jest + .mocked(api.query.attestation.attestations) + .mockResolvedValueOnce( + ApiMocks.mockChainQueryReturn('attestation', 'attestations') as any + ) + await expect( + Credential.refreshRevocationStatus({ ...credential, revoked, attester }) + ).rejects.toThrowErrorMatchingInlineSnapshot(`"Attestation not found"`) + + jest.mocked(api.query.attestation.attestations).mockResolvedValueOnce( + ApiMocks.mockChainQueryReturn( + 'attestation', + 'attestations', + ApiMocks.mockChainQueryReturn('attestation', 'attestations', { + revoked: false, + attester: Did.toChain(identityAlice), + ctypeHash: credential.claim.cTypeHash, + } as any) as any + ) as any + ) + await expect( + Credential.refreshRevocationStatus({ ...credential, revoked, attester }) + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Attester has changed since first verification"` + ) + + jest.mocked(api.query.attestation.attestations).mockResolvedValueOnce( + ApiMocks.mockChainQueryReturn( + 'attestation', + 'attestations', + ApiMocks.mockChainQueryReturn('attestation', 'attestations', { + revoked: true, + attester: Did.toChain(attester), + ctypeHash: randomAsHex(), + } as any) as any + ) as any + ) + await expect( + Credential.refreshRevocationStatus({ ...credential, revoked, attester }) + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Some attributes of the on-chain attestation diverge from the credential: claimHash"` + ) + + jest.mocked(api.query.attestation.attestations).mockResolvedValueOnce( + ApiMocks.mockChainQueryReturn( + 'attestation', + 'attestations', + ApiMocks.mockChainQueryReturn('attestation', 'attestations', { + revoked: true, + attester: Did.toChain(attester), + ctypeHash: credential.claim.cTypeHash, + authorizationId: { Delegation: randomAsHex() }, + } as any) as any + ) as any + ) + await expect( + Credential.refreshRevocationStatus({ ...credential, revoked, attester }) + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Some attributes of the on-chain attestation diverge from the credential: delegationId"` + ) + }) }) -describe('Credential', () => { +describe('Presentations', () => { let keyAlice: KeyTool let keyCharlie: KeyTool let identityAlice: DidDocument @@ -327,12 +464,11 @@ describe('Credential', () => { sign: SignCallback ): Promise<[ICredentialPresentation, IAttestation]> { // create claim - - const ctype = CType.fromProperties('Credential', { - name: { type: 'string' }, - }) - - const claim = Claim.fromCTypeAndClaimContents(ctype, contents, claimer.uri) + const claim = Claim.fromCTypeAndClaimContents( + testCType, + contents, + claimer.uri + ) // build credential with legitimations const credential = Credential.fromClaim(claim, { legitimations, @@ -367,6 +503,16 @@ describe('Credential', () => { [], keyAlice.getSignCallback(identityAlice) ) + + jest + .mocked(ConfigService.get('api').query.attestation.attestations) + .mockResolvedValue( + ApiMocks.mockChainQueryReturn('attestation', 'attestations', { + revoked: false, + attester: Did.toChain(identityBob.uri), + ctypeHash: CType.idToHash(testCType.$id), + } as any) as any + ) }) it('verify credentials signed by a full DID', async () => { @@ -384,9 +530,11 @@ describe('Credential', () => { // check proof on complete data expect(() => Credential.verifyDataIntegrity(presentation)).not.toThrow() - await Credential.verifyPresentation(presentation, { - didResolveKey, - }) + await expect( + Credential.verifyPresentation(presentation, { + didResolveKey, + }) + ).resolves.toMatchObject({ revoked: false, attester: identityBob.uri }) }) it('verify credentials signed by a light DID', async () => { const { getSignCallback, authentication } = makeSigningKeyTool('ed25519') @@ -408,9 +556,11 @@ describe('Credential', () => { // check proof on complete data expect(() => Credential.verifyDataIntegrity(presentation)).not.toThrow() - await Credential.verifyPresentation(presentation, { - didResolveKey, - }) + await expect( + Credential.verifyPresentation(presentation, { + didResolveKey, + }) + ).resolves.toMatchObject({ revoked: false, attester: identityBob.uri }) }) it('throws if signature is missing on credential presentation', async () => { @@ -576,7 +726,10 @@ describe('create presentation', () => { let attester: DidDocument let credential: ICredential - const ctype = CType.fromProperties(testCType.title, testCType.properties) + const ctype = CType.fromProperties('otherCType', { + name: { type: 'string' }, + age: { type: 'number' }, + }) // Returns a full DID that has the same subject of the first light DID, but the same key authentication key as the second one, if provided, or as the first one otherwise. function createMinimalFullDidFromLightDid( @@ -644,6 +797,16 @@ describe('create presentation', () => { migratedClaimerFullDid.uri ) ) + + jest + .mocked(ConfigService.get('api').query.attestation.attestations) + .mockResolvedValue( + ApiMocks.mockChainQueryReturn('attestation', 'attestations', { + revoked: false, + attester: Did.toChain(attester.uri), + ctypeHash: CType.idToHash(ctype.$id), + } as any) as any + ) }) it('should create presentation and exclude specific attributes using a full DID', async () => { @@ -656,9 +819,11 @@ describe('create presentation', () => { ), challenge, }) - await Credential.verifyPresentation(presentation, { - didResolveKey, - }) + await expect( + Credential.verifyPresentation(presentation, { + didResolveKey, + }) + ).resolves.toMatchObject({ revoked: false, attester: attester.uri }) expect(presentation.claimerSignature?.challenge).toEqual(challenge) }) it('should create presentation and exclude specific attributes using a light DID', async () => { @@ -683,9 +848,11 @@ describe('create presentation', () => { ), challenge, }) - await Credential.verifyPresentation(presentation, { - didResolveKey, - }) + await expect( + Credential.verifyPresentation(presentation, { + didResolveKey, + }) + ).resolves.toMatchObject({ revoked: false, attester: attester.uri }) expect(presentation.claimerSignature?.challenge).toEqual(challenge) }) it('should create presentation and exclude specific attributes using a migrated DID', async () => { @@ -712,9 +879,11 @@ describe('create presentation', () => { ), challenge, }) - await Credential.verifyPresentation(presentation, { - didResolveKey, - }) + await expect( + Credential.verifyPresentation(presentation, { + didResolveKey, + }) + ).resolves.toMatchObject({ revoked: false, attester: attester.uri }) expect(presentation.claimerSignature?.challenge).toEqual(challenge) }) @@ -781,9 +950,13 @@ describe('create presentation', () => { }) it('should verify the credential claims structure against the ctype', () => { - expect(() => Credential.verifyAgainstCType(credential, ctype)).not.toThrow() + expect(() => + CType.verifyClaimAgainstSchema(credential.claim.contents, ctype) + ).not.toThrow() credential.claim.contents.name = 123 - expect(() => Credential.verifyAgainstCType(credential, ctype)).toThrow() + expect(() => + CType.verifyClaimAgainstSchema(credential.claim.contents, ctype) + ).toThrow() }) }) diff --git a/packages/core/src/credential/Credential.ts b/packages/core/src/credential/Credential.ts index 45a08a574..ca24f967f 100644 --- a/packages/core/src/credential/Credential.ts +++ b/packages/core/src/credential/Credential.ts @@ -17,6 +17,7 @@ * @packageDocumentation */ +import { ConfigService } from '@kiltprotocol/config' import { isDidSignature, verifyDidSignature, @@ -26,6 +27,7 @@ import { } from '@kiltprotocol/did' import type { DidResolveKey, + DidUri, Hash, IAttestation, IClaim, @@ -36,6 +38,7 @@ import type { SignCallback, } from '@kiltprotocol/types' import { Crypto, DataUtils, SDKErrors } from '@kiltprotocol/utils' +import * as Attestation from '../attestation/index.js' import * as Claim from '../claim/index.js' import { hashClaimContents } from '../claim/index.js' import { verifyClaimAgainstSchema } from '../ctype/index.js' @@ -128,8 +131,9 @@ export function makeSigningData( * @param input - The credential to check. */ export function verifyRootHash(input: ICredential): void { - if (input.rootHash !== calculateRootHash(input)) + if (input.rootHash !== calculateRootHash(input)) { throw new SDKErrors.RootHashUnverifiableError() + } } /** @@ -175,12 +179,14 @@ export function verifyDataStructure(input: ICredential): void { if (!('claimNonceMap' in input)) { throw new SDKErrors.ClaimNonceMapMissingError() } - if (typeof input.claimNonceMap !== 'object') + if (typeof input.claimNonceMap !== 'object') { throw new SDKErrors.ClaimNonceMapMalformedError() + } Object.entries(input.claimNonceMap).forEach(([digest, nonce]) => { DataUtils.verifyIsHex(digest, 256) - if (!digest || typeof nonce !== 'string' || !nonce) + if (!digest || typeof nonce !== 'string' || !nonce) { throw new SDKErrors.ClaimNonceMapMalformedError() + } }) if (!('claimHashes' in input)) { @@ -192,20 +198,6 @@ export function verifyDataStructure(input: ICredential): void { } } -/** - * Checks the [[Credential]] with a given [[CType]] to check if the included claim meets the [[ICType.$schema]] structure. - * - * @param credential A [[Credential]] for the attester. - * @param ctype A [[CType]] to verify the [[Claim]] structure. - */ -export function verifyAgainstCType( - credential: ICredential, - ctype: ICType -): void { - verifyDataStructure(credential) - verifyClaimAgainstSchema(credential.claim.contents, ctype) -} - /** * Verifies the signature of the [[ICredentialPresentation]]. * It supports migrated DIDs, meaning that if the original claim within the [[ICredential]] included a light DID that was afterwards upgraded, @@ -228,11 +220,11 @@ export async function verifySignature( } = {} ): Promise { const { claimerSignature } = input - if (challenge && challenge !== claimerSignature.challenge) + if (challenge && challenge !== claimerSignature.challenge) { throw new SDKErrors.SignatureUnverifiableError( 'Challenge differs from expected' ) - + } const signingData = makeSigningData(input, claimerSignature.challenge) await verifyDidSignature({ ...signatureFromJson(claimerSignature), @@ -293,43 +285,133 @@ type VerifyOptions = { /** * Verifies data structure & data integrity of a credential object. + * This combines all offline sanity checks that can be performed on an ICredential object. + * A credential is valid only if it is well formed AND there is an on-chain attestation record referencing its root hash. + * To check the latter condition as well, you need to call [[verifyCredential]] or [[verifyPresentation]]. * * @param credential - The object to check. * @param options - Additional parameter for more verification steps. * @param options.ctype - CType which the included claim should be checked against. */ -export async function verifyCredential( +export function verifyWellFormed( credential: ICredential, { ctype }: VerifyOptions = {} -): Promise { +): void { verifyDataStructure(credential) verifyDataIntegrity(credential) if (ctype) { - verifyAgainstCType(credential, ctype) + verifyClaimAgainstSchema(credential.claim.contents, ctype) } } /** - * Verifies data structure, data integrity and the claimer's signature of a credential presentation. + * Queries the attestation record for a credential and matches their data. Fails if no attestation exists, if it is revoked, or if the attestation data does not match the credential. * - * Upon presentation of a credential, a verifier would call this function. + * @param credential The [[ICredential]] whose attestation status should be checked. + * @returns An object containing the `attester` DID and `revoked` status of the on-chain attestation. + */ +export async function verifyAttested(credential: ICredential): Promise<{ + attester: DidUri + revoked: boolean +}> { + const api = ConfigService.get('api') + const { rootHash } = credential + const maybeAttestation = await api.query.attestation.attestations(rootHash) + if (maybeAttestation.isNone) { + throw new SDKErrors.CredentialUnverifiableError('Attestation not found') + } + const attestation = Attestation.fromChain( + maybeAttestation, + credential.rootHash + ) + Attestation.verifyAgainstCredential(attestation, credential) + const { owner: attester, revoked } = attestation + return { attester, revoked } +} + +export interface VerifiedCredential extends ICredential { + revoked: boolean + attester: DidUri +} + +/** + * Updates the revocation status of a previously verified credential to allow checking if it is still valid. + * + * @param verifiedCredential The output of [[verifyCredential]] or [[verifyPresentation]], which adds a `revoked` and `attester` property. + * @returns A promise of resolving to the same object but with the `revoked` property updated. + * The promise rejects if the attestation has been deleted or its data changed since verification. + */ +export async function refreshRevocationStatus( + verifiedCredential: VerifiedCredential +): Promise { + if ( + typeof verifiedCredential.attester !== 'string' || + typeof verifiedCredential.revoked !== 'boolean' + ) { + throw new TypeError( + 'This function expects a VerifiedCredential with properties `revoked` (boolean) and `attester` (string)' + ) + } + const { revoked, attester } = await verifyAttested(verifiedCredential) + if (attester !== verifiedCredential.attester) { + throw new SDKErrors.CredentialUnverifiableError( + 'Attester has changed since first verification' + ) + } + return { ...verifiedCredential, revoked } +} + +/** + * Performs all steps to verify a credential (unsigned), which includes verifying data structure, data integrity, and looking up its attestation on the KILT blockchain. + * In most cases, credentials submitted by a third party would be expected to be signed (a 'presentation'). + * To verify the additional signature as well, use `verifyPresentation`. + * + * @param credential - The object to check. + * @param options - Additional parameter for more verification steps. + * @param options.ctype - CType which the included claim should be checked against. + * @returns A [[VerifiedCredential]] object, which is the orignal credential with two additional properties: a boolean `revoked` status flag and the `attester` DID. + */ +export async function verifyCredential( + credential: ICredential, + { ctype }: VerifyOptions = {} +): Promise { + verifyWellFormed(credential, { ctype }) + const { revoked, attester } = await verifyAttested(credential) + return { + ...credential, + revoked, + attester, + } +} + +/** + * Performs all steps to verify a credential presentation (signed). + * In addition to verifying data structure, data integrity, and looking up the attestation record on the KILT blockchain, + * this involves verifying the claimer's signature over the credential. + * + * This is the function verifiers would typically call upon receiving a credential presentation from a third party. + * The attester's identity and the credential revocation status returned by this function would then be either displayed to an end user + * or processed in application logic deciding whether to accept or reject a credential submission + * (e.g., by matching the attester DID against an allow-list of trusted attesters). * * @param presentation - The object to check. * @param options - Additional parameter for more verification steps. * @param options.ctype - CType which the included claim should be checked against. * @param options.challenge - The expected value of the challenge. Verification will fail in case of a mismatch. * @param options.didResolveKey - The function used to resolve the claimer's key. Defaults to [[resolveKey]]. + * @returns A [[VerifiedCredential]] object, which is the orignal credential presentation with two additional properties: + * a boolean `revoked` status flag and the `attester` DID. */ export async function verifyPresentation( presentation: ICredentialPresentation, { ctype, challenge, didResolveKey = resolveKey }: VerifyOptions = {} -): Promise { - await verifyCredential(presentation, { ctype }) +): Promise { await verifySignature(presentation, { challenge, didResolveKey, }) + return verifyCredential(presentation, { ctype }) } /** diff --git a/packages/core/src/ctype/CType.schemas.ts b/packages/core/src/ctype/CType.schemas.ts index ce63b0ddf..0ee74c940 100644 --- a/packages/core/src/ctype/CType.schemas.ts +++ b/packages/core/src/ctype/CType.schemas.ts @@ -7,9 +7,137 @@ import { JsonSchema } from '@kiltprotocol/utils' -export const CTypeModel: JsonSchema.Schema = { +export const CTypeModelV1: JsonSchema.Schema & { $id: string } = { + // $id is not contained in schema when fetched from ipfs bc that is impossible with a content-addressed system + $id: 'ipfs://bafybeiah66wbkhqbqn7idkostj2iqyan2tstc4tpqt65udlhimd7hcxjyq/', + $schema: 'http://json-schema.org/draft-07/schema#', + title: 'CType Metaschema (V1)', + description: + 'Describes a CType, which is a JSON schema for validating KILT claim types.', + type: 'object', + properties: { + $id: { pattern: '^kilt:ctype:0x[0-9a-f]+$', type: 'string' }, + $schema: { + type: 'string', + // can't use a const referencing schema id for a content-addressed schema + }, + title: { type: 'string' }, + type: { const: 'object', type: 'string' }, + properties: { + patternProperties: { + '^.+$': { + oneOf: [ + { $ref: '#/definitions/string' }, + { $ref: '#/definitions/number' }, + { $ref: '#/definitions/boolean' }, + { $ref: '#/definitions/cTypeReference' }, + { $ref: '#/definitions/array' }, + ], + type: 'object', + }, + }, + type: 'object', + }, + additionalProperties: { const: false, type: 'boolean' }, + }, + additionalProperties: false, + required: [ + '$id', + '$schema', + 'additionalProperties', + 'properties', + 'title', + 'type', + ], + definitions: { + cTypeReference: { + additionalProperties: false, + properties: { + $ref: { + pattern: '^kilt:ctype:0x[0-9a-f]+(#/properties/.+)?$', + format: 'uri', + type: 'string', + }, + }, + required: ['$ref'], + }, + string: { + additionalProperties: false, + properties: { + type: { + const: 'string', + }, + format: { enum: ['date', 'time', 'uri'] }, + enum: { + type: 'array', + items: { type: 'string' }, + }, + minLength: { + type: 'number', + }, + maxLength: { + type: 'number', + }, + }, + required: ['type'], + }, + boolean: { + additionalProperties: false, + properties: { + type: { + const: 'boolean', + }, + }, + required: ['type'], + }, + number: { + additionalProperties: false, + properties: { + type: { + enum: ['integer', 'number'], + }, + enum: { + type: 'array', + items: { type: 'number' }, + }, + minimum: { + type: 'number', + }, + maximum: { + type: 'number', + }, + }, + required: ['type'], + }, + array: { + additionalProperties: false, + properties: { + type: { const: 'array' }, + items: { + oneOf: [ + { $ref: '#/definitions/string' }, + { $ref: '#/definitions/number' }, + { $ref: '#/definitions/boolean' }, + { $ref: '#/definitions/cTypeReference' }, + ], + }, + minItems: { + type: 'number', + }, + maxItems: { + type: 'number', + }, + }, + required: ['type', 'items'], + }, + }, +} + +export const CTypeModelDraft01: JsonSchema.Schema & { $id: string } = { $id: 'http://kilt-protocol.org/draft-01/ctype#', $schema: 'http://json-schema.org/draft-07/schema#', + title: 'CType Metaschema (draft-01)', + description: `Describes a CType, which is a JSON schema for validating KILT claim types. This version has known issues, the use of schema ${CTypeModelV1.$id} is recommended instead.`, type: 'object', properties: { $id: { @@ -65,7 +193,44 @@ export const CTypeModel: JsonSchema.Schema = { required: ['$id', 'title', '$schema', 'properties', 'type'], } -export const MetadataModel = { +/** + * Schema describing any currently known CType; this means it either conforms to V1 or draft-01 of the CType schema. + * Using this schema allows CType validation to be agnostic to which version is used. + */ +export const CTypeModel: JsonSchema.Schema = { + $schema: 'http://json-schema.org/draft-07/schema', + oneOf: [ + // Option A): conforms to draft-01 of the CType meta sschema, which defines that the CType's $schema property must be equal to the CType meta schema's $id. + { $ref: CTypeModelDraft01.$id }, + // Option B): The CType's $schema property references V1 of the CType meta schema, in which case this meta schema must apply. + // The structure is different because V1 does not define the exact value of the $schema property because its $id is derived from the hash of its contents. + { + allOf: [ + // verifies that both of two (sub-)schemas validate against CType object. + { + // subschema 1: $schema is equal to CType meta schema V1's $id. + properties: { + $schema: { + type: 'string', + const: CTypeModelV1.$id, + }, + }, + }, + { + // subschema 2: CType meta schema V1. + $ref: CTypeModelV1.$id, + }, + ], + }, + ], + // CType meta schemas are embedded here, so that the references ($ref) can be resolved without having to load them first. + definitions: { + [CTypeModelDraft01.$id]: CTypeModelDraft01, + [CTypeModelV1.$id]: CTypeModelV1, + }, +} + +export const MetadataModel: JsonSchema.Schema = { $id: 'http://kilt-protocol.org/draft-01/ctype-metadata', $schema: 'http://json-schema.org/draft-07/schema#', type: 'object', @@ -103,7 +268,6 @@ export const MetadataModel = { }, properties: { type: 'object', - properties: {}, patternProperties: { '^.*$': { type: 'object', diff --git a/packages/core/src/ctype/CType.spec.ts b/packages/core/src/ctype/CType.spec.ts index 9a3451ad9..9c4eb4e6f 100644 --- a/packages/core/src/ctype/CType.spec.ts +++ b/packages/core/src/ctype/CType.spec.ts @@ -12,11 +12,10 @@ import { SDKErrors } from '@kiltprotocol/utils' import { ConfigService } from '@kiltprotocol/config' import { ApiMocks } from '@kiltprotocol/testing' -import type { ICType, IClaim } from '@kiltprotocol/types' +import type { ICType } from '@kiltprotocol/types' import * as Claim from '../claim' -import * as Credential from '../credential' import * as CType from './CType.js' -import { CTypeModel } from './CType.schemas' +import { CTypeModel, CTypeModelDraft01 } from './CType.schemas' const mockedApi: any = ApiMocks.getMockedApi() ConfigService.set({ api: mockedApi }) @@ -28,76 +27,285 @@ const encodedAliceDid = ApiMocks.mockChainQueryReturn( ) const didAlice = 'did:kilt:4p6K4tpdZtY3rNqM2uorQmsS6d3woxtnWMHjtzGftHmDb41N' -describe('CType', () => { - let claimCtype: ICType - let claimContents: any - let claim: IClaim - beforeAll(async () => { - claimCtype = CType.fromProperties('CtypeModel 2', { - name: { type: 'string' }, - }) - - claimContents = { - name: 'Bob', - } - - claim = Claim.fromCTypeAndClaimContents(claimCtype, claimContents, didAlice) +it('consistent CType id generation', () => { + const ctypeV1 = CType.fromProperties('CtypeModel 1', { + 'first-property': { type: 'integer' }, + 'second-property': { type: 'string' }, }) - it('makes ctype object from schema without id', () => { - const ctype = CType.fromProperties('CtypeModel 1', { + expect(ctypeV1.$id).toMatchInlineSnapshot( + `"kilt:ctype:0xc4145b9c5c7ae10f60c6a707b9dabf704ab65d7802a839854643a579c9bc80a5"` + ) + + const ctypeV0 = CType.fromProperties( + 'CtypeModel 1', + { 'first-property': { type: 'integer' }, 'second-property': { type: 'string' }, + }, + 'draft-01' + ) + + expect(ctypeV0.$id).toMatchInlineSnapshot( + `"kilt:ctype:0xba15bf4960766b0a6ad7613aa3338edce95df6b22ed29dd72f6e72d740829b84"` + ) +}) + +describe('value constraints', () => { + let cTypeWithConstraints: ICType + beforeAll(() => { + cTypeWithConstraints = CType.fromProperties('ConstraintsCtype', { + labels: { + type: 'array', + items: { + type: 'string', + enum: ['important', 'vital', 'critical', 'essential'], + }, + minItems: 1, + maxItems: 3, + }, + w3n: { + type: 'string', + minLength: 3, + maxLength: 10, + }, + date: { + type: 'string', + format: 'date', + }, + age: { + type: 'integer', + minimum: 0, + maximum: 999, + }, + multiplier: { + type: 'number', + enum: [0.2, 0.6, 1.2, 2.4], + }, }) + }) - expect(ctype.$id).toBe( - 'kilt:ctype:0xba15bf4960766b0a6ad7613aa3338edce95df6b22ed29dd72f6e72d740829b84' - ) + it('constrains array length', () => { + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + labels: ['critical'], + }, + didAlice + ) + ).not.toThrow() + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + labels: ['important', 'critical'], + }, + didAlice + ) + ).not.toThrow() + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + labels: ['important', 'critical', 'essential'], + }, + didAlice + ) + ).not.toThrow() + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + labels: [], + }, + didAlice + ) + ).toThrow() + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + labels: ['important', 'vital', 'critical', 'essential'], + }, + didAlice + ) + ).toThrow() }) - it('verifies the claim structure', () => { + it('constrains array contents via enum', () => { expect(() => - CType.verifyClaimAgainstSchema(claim.contents, claimCtype) + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + labels: ['important', 'critical', 'essential'], + }, + didAlice + ) ).not.toThrow() - claim.contents.name = 123 expect(() => - CType.verifyClaimAgainstSchema(claim.contents, claimCtype) + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + labels: ['niceToHave'], + }, + didAlice + ) + ).toThrow() + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + labels: [12], + }, + didAlice + ) ).toThrow() }) - it('throws error on faulty input', () => { - const wrongHashCtype: ICType = { - ...claimCtype, - $id: 'kilt:ctype:0x1234', - } - const faultySchemaCtype: ICType = { - ...claimCtype, - properties: null as unknown as ICType['properties'], - } + it('constrains string length', () => { + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + w3n: 'juergen', + }, + didAlice + ) + ).not.toThrow() + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + w3n: 'jo', + }, + didAlice + ) + ).toThrow() + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + w3n: 'Peter der Große, Zar von Russland', + }, + didAlice + ) + ).toThrow() + }) - const wrongSchemaIdCType: ICType = { - ...claimCtype, - $id: claimCtype.$id.replace('1', '2') as ICType['$id'], - } - expect(() => CType.verifyDataStructure(wrongHashCtype)).toThrowError( - SDKErrors.CTypeIdMismatchError - ) - expect(() => CType.verifyDataStructure(faultySchemaCtype)).toThrowError( - SDKErrors.ObjectUnverifiableError - ) - expect(() => - CType.verifyDataStructure(wrongSchemaIdCType) - ).toThrowErrorMatchingInlineSnapshot( - `"Provided $id \\"kilt:ctype:0xd5302762c62114f6455e0b373cccce20631c2a717004a98f8953e738e17c5d3c\\" does not match schema $id \\"kilt:ctype:0xd5301762c62114f6455e0b373cccce20631c2a717004a98f8953e738e17c5d3c\\""` - ) + it('constrains numeric range', () => { + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + age: 22, + }, + didAlice + ) + ).not.toThrow() + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + age: -12, + }, + didAlice + ) + ).toThrow() + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + age: 1000, + }, + didAlice + ) + ).toThrow() }) - it('verifies whether a ctype is registered on chain ', async () => { - await expect(CType.verifyStored(claimCtype)).rejects.toThrow() + it('constrains to numbers in enum', () => { + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + multiplier: 1.2, + }, + didAlice + ) + ).not.toThrow() + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + multiplier: 1, + }, + didAlice + ) + ).toThrow() + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + multiplier: 0.14, + }, + didAlice + ) + ).toThrow() + }) - mockedApi.query.ctype.ctypes.mockResolvedValueOnce(encodedAliceDid) - await expect(CType.verifyStored(claimCtype)).resolves.not.toThrow() + it('constrains string to date format', () => { + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + date: '2022-01-22', + }, + didAlice + ) + ).not.toThrow() + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + date: '11:30', + }, + didAlice + ) + ).toThrow() + expect(() => + Claim.fromCTypeAndClaimContents( + cTypeWithConstraints, + { + date: 'fried fish', + }, + didAlice + ) + ).toThrow() + }) +}) + +it('e2e', () => { + const claimCtype = CType.fromProperties('CtypeModel 2', { + name: { type: 'string' }, }) + + const claimContents = { + name: 'Bob', + } + + const claim = Claim.fromCTypeAndClaimContents( + claimCtype, + claimContents, + didAlice + ) + + expect(() => + CType.verifyClaimAgainstSchema(claim.contents, claimCtype) + ).not.toThrow() + claim.contents.name = 123 + expect(() => + CType.verifyClaimAgainstSchema(claim.contents, claimCtype) + ).toThrow() }) describe('blank ctypes', () => { @@ -109,83 +317,128 @@ describe('blank ctypes', () => { ctype2 = CType.fromProperties('claimedSomething', {}) }) - it('two ctypes with no properties have different hashes if id is different', () => { + it('two ctypes with no properties have different hashes if name is different', () => { expect(ctype1.$schema).toEqual(ctype2.$schema) expect(ctype1.properties).toEqual(ctype2.properties) expect(ctype1.title).not.toEqual(ctype2.title) expect(ctype1.$id).not.toEqual(ctype2.$id) }) - it('two claims on an empty ctypes will have different root hash', async () => { - const claimA1 = Claim.fromCTypeAndClaimContents(ctype1, {}, didAlice) - const claimA2 = Claim.fromCTypeAndClaimContents(ctype2, {}, didAlice) - - expect(Credential.fromClaim(claimA1).rootHash).not.toEqual( - Credential.fromClaim(claimA2).rootHash - ) - }) it('typeguard returns true or false for complete or incomplete CTypes', () => { expect(CType.isICType(ctype1)).toBe(true) expect(CType.isICType({ ...ctype2, owner: '' })).toBe(false) }) }) -describe('CType verification', () => { - const ctypeInput = { - $id: 'kilt:ctype:0x1', - $schema: 'http://kilt-protocol.org/draft-01/ctype-input#', - title: 'Ctype Title', - properties: [ - { - $id: 'kilt:ctype:0xfirst-property', - $ref: 'First Property', - type: 'integer', - }, - { - $id: 'kilt:ctype:0xsecond-property', - $ref: 'Second Property', - type: 'string', - }, - ], - type: 'object', - required: ['first-property', 'second-property'], - } as unknown as ICType - - const ctypeWrapperModel: ICType = CType.fromProperties('name', { +const cTypeDraft01: ICType = CType.fromProperties( + 'name', + { 'first-property': { type: 'integer' }, 'second-property': { type: 'string' }, - }) + }, + 'draft-01' +) + +const cTypeV1: ICType = CType.fromProperties('name', { + 'first-property': { type: 'integer' }, + 'second-property': { type: 'string' }, +}) - const goodClaim = { - 'first-property': 10, - 'second-property': '12', +describe.each([[cTypeDraft01], [cTypeV1]])( + 'Claim verification with CType of schema version %#', + (cType) => { + const goodClaim = { + 'first-property': 10, + 'second-property': '12', + } + const partialClaim = { + 'first-property': 10, + } + const badClaim = { + ...goodClaim, + 'first-property': '1', + } + const unexpectedPropsClaim = { + ...goodClaim, + 'third-property': true, + } + + it('accepts good CType', () => { + expect(() => CType.verifyDataStructure(cType)).not.toThrow() + expect(() => + CType.verifyObjectAgainstSchema(cType, CTypeModel) + ).not.toThrow() + }) + + it('accepts correct & partial claims', () => { + expect(() => + CType.verifyClaimAgainstSchema(goodClaim, cType) + ).not.toThrow() + expect(() => + CType.verifyClaimAgainstSchema(partialClaim, cType) + ).not.toThrow() + expect(() => CType.verifyClaimAgainstSchema({}, cType)).not.toThrow() + }) + it('rejects incorrect claims', () => { + expect(() => CType.verifyClaimAgainstSchema(badClaim, cType)).toThrow( + SDKErrors.ObjectUnverifiableError + ) + // only the CTypes following the newer model protect against additional properties + if (cType.$schema === CTypeModelDraft01.$id) { + expect(() => + CType.verifyClaimAgainstSchema(unexpectedPropsClaim, cType) + ).not.toThrow() + } else { + expect(() => + CType.verifyClaimAgainstSchema(unexpectedPropsClaim, cType) + ).toThrow(SDKErrors.ObjectUnverifiableError) + } + }) } +) + +describe.each([[cTypeDraft01], [cTypeV1]])( + 'CType verification with schema version %#', + (cType) => { + it('id verification', () => { + const wrongIdCtype: ICType = { + ...cType, + $id: cType.$id.substring(11) as ICType['$id'], + } + const wrongHashCType: ICType = { + ...cType, + $id: cType.$id.replace(/[1-9]/, (i) => + String(Number(i) - 1) + ) as ICType['$id'], + } + expect(() => CType.verifyDataStructure(wrongIdCtype)).toThrowError( + SDKErrors.ObjectUnverifiableError + ) + expect(() => CType.verifyDataStructure(wrongHashCType)).toThrowError( + SDKErrors.CTypeIdMismatchError + ) + }) + it('throws error on faulty input', () => { + const faultySchemaCtype: ICType = { + ...cType, + properties: null as unknown as ICType['properties'], + } + const wrongSchemaIdCType: ICType = { + ...cType, + $schema: cType.$schema.replace(/[1-9]/, (i) => + String(Number(i) - 1) + ) as ICType['$id'], + } - const badClaim = { - 'first-property': '1', - 'second-property': '12', - 'third-property': true, + expect(() => CType.verifyDataStructure(faultySchemaCtype)).toThrowError( + SDKErrors.ObjectUnverifiableError + ) + expect(() => CType.verifyDataStructure(wrongSchemaIdCType)).toThrowError( + SDKErrors.ObjectUnverifiableError + ) + }) } - it('verifies claims', () => { - expect(() => - CType.verifyClaimAgainstSchema(goodClaim, ctypeWrapperModel) - ).not.toThrow() - expect(() => - CType.verifyClaimAgainstSchema(badClaim, ctypeWrapperModel) - ).toThrow() - expect(() => - CType.verifyObjectAgainstSchema(badClaim, CTypeModel, []) - ).toThrow() - expect(() => { - CType.verifyClaimAgainstSchema(badClaim, ctypeInput) - }).toThrow(SDKErrors.ObjectUnverifiableError) - }) - it('verifies ctypes', () => { - expect(() => - CType.verifyObjectAgainstSchema(ctypeWrapperModel, CTypeModel) - ).not.toThrow() - }) -}) +) describe('CType registration verification', () => { const ctype = CType.fromProperties('CtypeModel 2', { diff --git a/packages/core/src/ctype/CType.ts b/packages/core/src/ctype/CType.ts index ec928a388..6c061809d 100644 --- a/packages/core/src/ctype/CType.ts +++ b/packages/core/src/ctype/CType.ts @@ -23,7 +23,12 @@ import type { } from '@kiltprotocol/types' import { Crypto, SDKErrors, JsonSchema, jsonabc } from '@kiltprotocol/utils' import { ConfigService } from '@kiltprotocol/config' -import { CTypeModel, MetadataModel } from './CType.schemas.js' +import { + CTypeModel, + MetadataModel, + CTypeModelDraft01, + CTypeModelV1, +} from './CType.schemas.js' /** * Utility for (re)creating CType hashes. Sorts the schema and strips the $id property (which contains the CType hash) before stringifying. @@ -93,15 +98,17 @@ export function getIdForSchema( * @param object Data to be verified against schema. * @param schema Schema to verify against. * @param messages Optional empty array. If passed, this receives all verification errors. + * @param referencedSchemas If schema contains references ($ref) to other schemas, their definitions must be added here in form of an array. */ export function verifyObjectAgainstSchema( object: Record, - schema: Record, - messages?: string[] + schema: JsonSchema.Schema, + messages?: string[], + referencedSchemas?: JsonSchema.Schema[] ): void { const validator = new JsonSchema.Validator(schema, '7', false) - if (schema.$id !== CTypeModel.$id) { - validator.addSchema(CTypeModel) + if (referencedSchemas) { + referencedSchemas.forEach((i) => validator.addSchema(i)) } const { valid, errors } = validator.validate(object) if (valid === true) return @@ -128,7 +135,7 @@ export function verifyClaimAgainstSchema( schema: ICType, messages?: string[] ): void { - verifyObjectAgainstSchema(schema, CTypeModel) + verifyObjectAgainstSchema(schema, CTypeModel, messages) verifyObjectAgainstSchema(claimContents, schema, messages) } @@ -175,21 +182,8 @@ export function verifyClaimAgainstNestedSchemas( claimContents: Record, messages?: string[] ): void { - const validator = new JsonSchema.Validator(cType, '7', false) - nestedCTypes.forEach((ctype) => { - validator.addSchema(ctype) - }) - validator.addSchema(CTypeModel) - const { valid, errors } = validator.validate(claimContents) - if (valid === true) return - if (messages) { - errors.forEach((error) => { - messages.push(error.error) - }) - } - throw new SDKErrors.NestedClaimUnverifiableError(undefined, { - cause: errors, - }) + verifyObjectAgainstSchema(cType, CTypeModel, messages) + verifyObjectAgainstSchema(claimContents, cType, messages, nestedCTypes) } /** @@ -201,24 +195,34 @@ export function verifyCTypeMetadata(metadata: ICTypeMetadata): void { verifyObjectAgainstSchema(metadata, MetadataModel) } +const cTypeVersionToSchemaId = { + 'draft-01': CTypeModelDraft01.$id, + V1: CTypeModelV1.$id, +} + /** * Creates a new [[ICType]] object from a set of atomic claims and a title. * The CType id will be automatically generated. * * @param title The new CType's title as a string. * @param properties Key-value pairs describing the admissible atomic claims for a credential with this CType. The value of each property is a json-schema (for example `{ "type": "number" }`) used to validate that property. - * @returns A ctype object, including cTypeId, $schema, and type. + * @param version Use 'V1' to create a CType according to the latest metaschema version (default) and 'draft-01' to produce a legacy CType. Included for backwards-compatibility. + * @returns A complete JSON schema (CType) with an $id derived from the hashed schema. Each CType references a meta schema that applies to it via the $schema property; its value depends on the `version` parameter. */ export function fromProperties( title: ICType['title'], - properties: ICType['properties'] + properties: ICType['properties'], + version: 'draft-01' | 'V1' = 'V1' ): ICType { const schema: Omit = { properties, title, - $schema: 'http://kilt-protocol.org/draft-01/ctype#', + $schema: cTypeVersionToSchemaId[version], type: 'object', } + if (version === 'V1') { + schema.additionalProperties = false + } const ctype = jsonabc.sortObj({ ...schema, $id: getIdForSchema(schema) }) verifyDataStructure(ctype) return ctype diff --git a/packages/core/src/ctype/Ctype.nested.spec.ts b/packages/core/src/ctype/Ctype.nested.spec.ts index 4c813daae..27639e9ef 100644 --- a/packages/core/src/ctype/Ctype.nested.spec.ts +++ b/packages/core/src/ctype/Ctype.nested.spec.ts @@ -134,7 +134,7 @@ describe('Nested CTypes', () => { claimContents, didAlice ) - ).toThrowError(SDKErrors.NestedClaimUnverifiableError) + ).toThrowError(SDKErrors.ObjectUnverifiableError) expect(() => CType.verifyClaimAgainstNestedSchemas( deeplyNestedCType, @@ -142,7 +142,7 @@ describe('Nested CTypes', () => { claimDeepContents ) ).not.toThrow() - ;(claimDeepContents.passport as Record).fullName = {} + ;(claimDeepContents.passport as any).fullName = {} expect(() => CType.verifyClaimAgainstNestedSchemas( deeplyNestedCType, @@ -164,6 +164,6 @@ describe('Nested CTypes', () => { claimDeepContents, didAlice ) - ).toThrowError(SDKErrors.NestedClaimUnverifiableError) + ).toThrowError(SDKErrors.ObjectUnverifiableError) }) }) diff --git a/packages/core/src/delegation/DelegationNode.ts b/packages/core/src/delegation/DelegationNode.ts index 106c54190..60d50a96d 100644 --- a/packages/core/src/delegation/DelegationNode.ts +++ b/packages/core/src/delegation/DelegationNode.ts @@ -341,14 +341,15 @@ export class DelegationNode implements IDelegationNode { /** * Checks on chain whether an identity with the given DID is delegating to the current node. * - * @param did The DID to search for. + * @param dids A DID or an array of DIDs to search for. * * @returns An object containing a `node` owned by the identity if it is delegating, plus the number of `steps` traversed. `steps` is 0 if the DID is owner of the current node. */ public async findAncestorOwnedBy( - did: DidUri + dids: DidUri | DidUri[] ): Promise<{ steps: number; node: DelegationNode | null }> { - if (this.account === did) { + const acceptedDids = Array.isArray(dids) ? dids : [dids] + if (acceptedDids.includes(this.account)) { return { steps: 0, node: this, @@ -362,7 +363,7 @@ export class DelegationNode implements IDelegationNode { } try { const parent = await fetch(this.parentId) - const result = await parent.findAncestorOwnedBy(did) + const result = await parent.findAncestorOwnedBy(acceptedDids) result.steps += 1 return result } catch { diff --git a/packages/core/src/publicCredential/PublicCredential.chain.ts b/packages/core/src/publicCredential/PublicCredential.chain.ts index 2c3b1604e..6ef1bb3e0 100644 --- a/packages/core/src/publicCredential/PublicCredential.chain.ts +++ b/packages/core/src/publicCredential/PublicCredential.chain.ts @@ -22,7 +22,7 @@ import type { PublicCredentialsCredentialsCredentialEntry, } from '@kiltprotocol/augment-api' -import { encode as cborEncode, decode as cborDecode } from 'cbor' +import { encode as cborEncode, decode as cborDecode } from 'cbor-web' import { HexString } from '@polkadot/util/types' import { ConfigService } from '@kiltprotocol/config' diff --git a/packages/did/package.json b/packages/did/package.json index cb96f731d..7d23d0438 100644 --- a/packages/did/package.json +++ b/packages/did/package.json @@ -1,6 +1,6 @@ { "name": "@kiltprotocol/did", - "version": "0.32.1", + "version": "0.33.0", "description": "", "main": "./lib/cjs/index.js", "module": "./lib/esm/index.js", @@ -23,7 +23,7 @@ }, "repository": "github:kiltprotocol/sdk-js", "engines": { - "node": ">=14.0" + "node": ">=16.0" }, "author": "", "license": "BSD-4-Clause", @@ -39,12 +39,12 @@ "@kiltprotocol/config": "workspace:*", "@kiltprotocol/types": "workspace:*", "@kiltprotocol/utils": "workspace:*", - "@polkadot/api": "^9.10.2", - "@polkadot/keyring": "^10.2.1", - "@polkadot/types": "^9.10.2", - "@polkadot/types-codec": "^9.10.2", - "@polkadot/util": "^10.2.1", - "@polkadot/util-crypto": "^10.2.1", - "cbor": "^8.1.0" + "@polkadot/api": "^10.4.0", + "@polkadot/keyring": "^12.0.0", + "@polkadot/types": "^10.4.0", + "@polkadot/types-codec": "^10.4.0", + "@polkadot/util": "^12.0.0", + "@polkadot/util-crypto": "^12.0.0", + "cbor-web": "^8.0.0" } } diff --git a/packages/did/src/DidDetails/LightDidDetails.ts b/packages/did/src/DidDetails/LightDidDetails.ts index 62331329b..6adcbc177 100644 --- a/packages/did/src/DidDetails/LightDidDetails.ts +++ b/packages/did/src/DidDetails/LightDidDetails.ts @@ -5,7 +5,7 @@ * found in the LICENSE file in the root directory of this source tree. */ -import { decode as cborDecode, encode as cborEncode } from 'cbor' +import { decode as cborDecode, encode as cborEncode } from 'cbor-web' import { base58Decode, base58Encode, diff --git a/packages/did/src/cbor-web.d.ts b/packages/did/src/cbor-web.d.ts new file mode 100644 index 000000000..4def7650e --- /dev/null +++ b/packages/did/src/cbor-web.d.ts @@ -0,0 +1 @@ +declare module 'cbor-web' diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 2d448fa53..ea74c3e65 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -1,6 +1,6 @@ { "name": "@kiltprotocol/messaging", - "version": "0.32.1", + "version": "0.33.0", "description": "", "main": "./lib/cjs/index.js", "module": "./lib/esm/index.js", @@ -23,7 +23,7 @@ }, "repository": "github:kiltprotocol/sdk-js", "engines": { - "node": ">=14.0" + "node": ">=16.0" }, "author": "", "license": "BSD-4-Clause", @@ -39,6 +39,6 @@ "@kiltprotocol/did": "workspace:*", "@kiltprotocol/types": "workspace:*", "@kiltprotocol/utils": "workspace:*", - "@polkadot/util": "^10.2.1" + "@polkadot/util": "^12.0.0" } } diff --git a/packages/sdk-js/package.json b/packages/sdk-js/package.json index fdd55cdc9..59a4ca4b1 100644 --- a/packages/sdk-js/package.json +++ b/packages/sdk-js/package.json @@ -1,6 +1,6 @@ { "name": "@kiltprotocol/sdk-js", - "version": "0.32.1", + "version": "0.33.0", "description": "", "main": "./lib/cjs/index.js", "module": "./lib/esm/index.js", @@ -25,22 +25,16 @@ }, "repository": "github:kiltprotocol/sdk-js", "engines": { - "node": ">=14.0" + "node": ">=16.0" }, "author": "", "license": "BSD-4-Clause", "bugs": "https://github.com/KILTprotocol/sdk-js/issues", "homepage": "https://github.com/KILTprotocol/sdk-js#readme", "devDependencies": { - "buffer": "^6.0.3", - "crypto-browserify": "^3.12.0", - "process": "^0.11.10", "rimraf": "^3.0.2", - "stream-browserify": "^3.0.0", "terser-webpack-plugin": "^5.1.1", "typescript": "^4.8.3", - "url": "^0.11.0", - "util": "^0.12.4", "webpack": "^5.70.0", "webpack-cli": "^4.9.2" }, diff --git a/packages/sdk-js/webpack.config.js b/packages/sdk-js/webpack.config.js index f62477877..6fc6cd1bb 100644 --- a/packages/sdk-js/webpack.config.js +++ b/packages/sdk-js/webpack.config.js @@ -8,7 +8,6 @@ /* eslint-disable @typescript-eslint/no-var-requires */ const path = require('path') const TerserPlugin = require('terser-webpack-plugin') -const webpack = require('webpack') module.exports = { mode: 'production', @@ -27,14 +26,6 @@ module.exports = { resolve: { extensions: ['.ts', '.js', '.d.ts', '.mjs', '.json'], symlinks: false, - // Explicit fallbacks to include these in bundle - fallback: { - buffer: require.resolve('buffer'), - crypto: require.resolve('crypto-browserify'), - stream: require.resolve('stream-browserify'), - url: require.resolve('url'), - util: require.resolve('util'), - }, }, stats: { errorDetails: true, @@ -44,10 +35,4 @@ module.exports = { // only minimize the *.min* bundle output minimizer: [new TerserPlugin({ include: /\.min\.umd\.js$/ })], }, - plugins: [ - new webpack.ProvidePlugin({ - process: 'process/browser', - Buffer: ['buffer', 'Buffer'], - }), - ], } diff --git a/packages/testing/package.json b/packages/testing/package.json index f139f0c09..d36e7e687 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,7 +1,7 @@ { "name": "@kiltprotocol/testing", "private": true, - "version": "0.32.1", + "version": "0.33.0", "description": "", "main": "./lib/cjs/index.js", "module": "./lib/esm/index.js", @@ -24,7 +24,7 @@ }, "repository": "github:kiltprotocol/sdk-js", "engines": { - "node": ">=14.0" + "node": ">=16.0" }, "author": "", "license": "BSD-4-Clause", @@ -34,14 +34,17 @@ "@kiltprotocol/chain-helpers": "workspace:*", "@kiltprotocol/config": "workspace:*", "@kiltprotocol/did": "workspace:*", + "@kiltprotocol/sdk-js": "workspace:*", "@kiltprotocol/type-definitions": "workspace:*", "@kiltprotocol/types": "workspace:*", "@kiltprotocol/utils": "workspace:*", - "@polkadot/api": "^9.10.2", - "@polkadot/keyring": "^10.2.1", - "@polkadot/types": "^9.10.2", - "@polkadot/util": "^10.2.1", - "@polkadot/util-crypto": "^10.2.1" + "@polkadot/api": "^10.4.0", + "@polkadot/keyring": "^12.0.0", + "@polkadot/types": "^10.4.0", + "@polkadot/util": "^12.0.0", + "@polkadot/util-crypto": "^12.0.0", + "tweetnacl": "^1.0.3", + "uuid": "^9.0.0" }, "devDependencies": { "rimraf": "^3.0.2", diff --git a/packages/testing/src/BreakingChanges.spec.ts b/packages/testing/src/BreakingChanges.spec.ts new file mode 100644 index 000000000..6890ec11a --- /dev/null +++ b/packages/testing/src/BreakingChanges.spec.ts @@ -0,0 +1,236 @@ +/** + * Copyright (c) 2018-2023, BOTLabs GmbH. + * + * This source code is licensed under the BSD 4-Clause "Original" license + * found in the LICENSE file in the root directory of this source tree. + */ + +/** + * @group breaking + */ + +import { + Attestation, + Claim, + Credential, + CType, + Did, + DidDocument, + DidKey, + DidResourceUri, + ICType, + Message, + MessageBody, + ResolvedDidKey, + Utils, +} from '@kiltprotocol/sdk-js' +import nacl from 'tweetnacl' +import { v4 } from 'uuid' +import { makeEncryptionKeyTool } from './TestUtils' + +jest.mock('uuid') +jest.mocked(v4).mockReturnValue('1ee1307c-9e65-475d-9061-0b5bfd86d2f7') + +// Mock nacl randombytes, so that the nonce and ciphertext stay the same between runs +jest.spyOn(nacl, 'randomBytes').mockReturnValue(new Uint8Array(24).fill(42)) + +function makeLightDidFromSeed(seed: string) { + const keypair = Utils.Crypto.makeKeypairFromUri(seed, 'sr25519') + const { keyAgreement, encrypt, decrypt } = makeEncryptionKeyTool(seed) + + const did = Did.createLightDidDocument({ + authentication: [keypair], + keyAgreement, + service: [ + { + id: '#1234', + type: ['KiltPublishedCredentialCollectionV1'], + serviceEndpoint: [ + 'https://ipfs.io/ipfs/QmNUAwg7JPK9nnuZiUri5nDaqLHqUFtNoZYtfD22Q6w3c8', + ], + }, + ], + }) + + return { did, encrypt, decrypt } +} + +function makeResolveKey(document: DidDocument) { + return async function resolveKey( + keyUri: DidResourceUri + ): Promise { + const { fragment } = Did.parse(keyUri) + const key = Did.getKey(document, fragment!) as DidKey + return { + controller: document!.uri, + id: keyUri!, + publicKey: key.publicKey, + type: key.type, + } + } +} + +describe('Breaking Changes', () => { + describe('Light DID', () => { + it('does not break the light did uri generation', () => { + const { did } = makeLightDidFromSeed( + '0x127f2375faf3472c2f94ffcdd5424590b27294631f2cb8041407e501bc97c44c' + ) + + expect(did.uri).toMatchInlineSnapshot( + `"did:kilt:light:004quk8nu1MLvzdoT4fE6SJsLS4fFpyvuGz7sQpMF7ZAWTDoF5:z1msTRicERqs59nwMvp3yzMRBhUYGmkum7ehY7rtKQc8HzfEx4b4eyRhrc37ZShT3oG7E89x89vaG9W4hRxPS23EAFnCSeVbVRrKGJmFQvYhjgKSMmrGC7gSxgHe1a3g41uamhD49AEi13YVMkgeHpyEQJBy7N7gGyW7jTWFcwzAnws4wSazBVG1qHmVJrhmusoJoTfKTPKXkExKyur8Z341EkcRkHteY8dV3VjLXHnfhRW2yU9oM2cRm5ozgaufxrXsQBx33ygTW2wvrfzzXsYw4Bs6Vf2tC3ipBTDcKyCk6G88LYnzBosRM15W3KmDRciJ2iPjqiQkhYm77EQyaw"` + ) + + expect( + Did.parseDocumentFromLightDid( + 'did:kilt:light:004quk8nu1MLvzdoT4fE6SJsLS4fFpyvuGz7sQpMF7ZAWTDoF5:z1msTRicERqs59nwMvp3yzMRBhUYGmkum7ehY7rtKQc8HzfEx4b4eyRhrc37ZShT3oG7E89x89vaG9W4hRxPS23EAFnCSeVbVRrKGJmFQvYhjgKSMmrGC7gSxgHe1a3g41uamhD49AEi13YVMkgeHpyEQJBy7N7gGyW7jTWFcwzAnws4wSazBVG1qHmVJrhmusoJoTfKTPKXkExKyur8Z341EkcRkHteY8dV3VjLXHnfhRW2yU9oM2cRm5ozgaufxrXsQBx33ygTW2wvrfzzXsYw4Bs6Vf2tC3ipBTDcKyCk6G88LYnzBosRM15W3KmDRciJ2iPjqiQkhYm77EQyaw' + ) + ).toMatchSnapshot() + }) + }) + describe('Messages', () => { + it('does not break Message & EncryptedMessage structure', async () => { + const { did: aliceDid, encrypt } = makeLightDidFromSeed( + '0xdc6f4d21a91848eeeac1811c73a2323060ef2d8d4a07ece2f216d5b8f977520b' + ) + const { did: bobDid, decrypt } = makeLightDidFromSeed( + '0xa748f38e896ddc52b6e5cc5baa754f7f841381ef32bf1d86d51026857c6c05dc' + ) + + // Mock Date object for message.createdAt property + jest.useFakeTimers().setSystemTime(1657727664899) + + const message = Message.fromBody( + { + type: 'request-terms', + content: { + cTypeHash: '0x1234', + }, + }, + aliceDid.uri, + bobDid.uri + ) + + expect(message).toMatchSnapshot() + + const encrypted = await Message.encrypt( + message, + encrypt(aliceDid), + `${bobDid.uri}#encryption`, + { + resolveKey: makeResolveKey(bobDid), + } + ) + + expect(encrypted).toMatchSnapshot() + + const decrypted = await Message.decrypt(encrypted, decrypt, { + resolveKey: makeResolveKey(aliceDid), + }) + + expect(decrypted).toMatchObject(message) + }) + + it('does not break for attestation flow', async () => { + // attestation flow + + const attester = makeLightDidFromSeed( + '0xdc6f4d21a91848eeeac1811c73a2323060ef2d8d4a07ece2f216d5b8f977520b' + ) + const user = makeLightDidFromSeed( + '0xa748f38e896ddc52b6e5cc5baa754f7f841381ef32bf1d86d51026857c6c05dc' + ) + + const cType: ICType = { + $id: 'kilt:ctype:0xd5301762c62114f6455e0b373cccce20631c2a717004a98f8953e738e17c5d3c', + $schema: 'http://kilt-protocol.org/draft-01/ctype#', + title: 'CtypeModel 2', + properties: { + name: { type: 'string' }, + }, + type: 'object', + } + + const requestTerms: MessageBody = { + type: 'request-terms', + content: { + cTypeHash: CType.idToHash(cType.$id), + }, + } + expect(requestTerms).toMatchSnapshot('request-terms') + + const claim = Claim.fromCTypeAndClaimContents( + cType, + { name: 'Bob' }, + attester.did.uri + ) + expect(claim).toMatchSnapshot('claim') + + const submitTerms: MessageBody = { + type: 'submit-terms', + content: { + claim, + legitimations: [], + }, + } + expect(submitTerms).toMatchSnapshot('submit-terms') + + claim.owner = user.did.uri + const credential = Credential.fromClaim(claim, { legitimations: [] }) + expect(credential).toMatchSnapshot('credential') + + const requestAttestation: MessageBody = { + type: 'request-attestation', + content: { credential }, + } + expect(requestAttestation).toMatchSnapshot('request-attestation') + + const attestation = Attestation.fromCredentialAndDid( + credential, + attester.did.uri + ) + expect(attestation).toMatchSnapshot('attestation') + + const submitAttestation: MessageBody = { + type: 'submit-attestation', + content: { attestation }, + } + expect(submitAttestation).toMatchSnapshot('submit-attestation') + + // verification flow + + const challenge = '0xCAFE' + const requestCredential: MessageBody = { + type: 'request-credential', + content: { + cTypes: [ + { + cTypeHash: CType.idToHash(cType.$id), + requiredProperties: ['name'], + trustedAttesters: [attester.did.uri], + }, + ], + challenge, + }, + } + expect(requestCredential).toMatchSnapshot('request-credential') + + const presentation = await Credential.createPresentation({ + credential, + challenge, + signCallback: async () => ({ + signature: new Uint8Array(32).fill(0), + keyUri: `${user.did.uri}${user.did.authentication[0].id}`, + keyType: user.did.authentication[0].type, + }), + }) + expect(presentation).toMatchSnapshot('presentation') + + const submitCredential: MessageBody = { + type: 'submit-credential', + content: [presentation], + } + expect(submitCredential).toMatchSnapshot('submit-credential') + }) + }) +}) diff --git a/packages/testing/src/__snapshots__/BreakingChanges.spec.ts.snap b/packages/testing/src/__snapshots__/BreakingChanges.spec.ts.snap new file mode 100644 index 000000000..4fbd05fa3 --- /dev/null +++ b/packages/testing/src/__snapshots__/BreakingChanges.spec.ts.snap @@ -0,0 +1,315 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Breaking Changes Light DID does not break the light did uri generation 2`] = ` +Object { + "authentication": Array [ + Object { + "id": "#authentication", + "publicKey": Uint8Array [ + 132, + 117, + 202, + 107, + 32, + 117, + 65, + 75, + 144, + 208, + 20, + 4, + 48, + 45, + 244, + 241, + 128, + 233, + 2, + 34, + 245, + 207, + 151, + 130, + 136, + 196, + 221, + 171, + 217, + 138, + 223, + 87, + ], + "type": "sr25519", + }, + ], + "keyAgreement": Array [ + Object { + "id": "#encryption", + "publicKey": Uint8Array [ + 179, + 105, + 8, + 2, + 142, + 166, + 2, + 93, + 171, + 137, + 241, + 223, + 93, + 81, + 205, + 56, + 196, + 187, + 68, + 98, + 208, + 96, + 61, + 232, + 107, + 199, + 25, + 48, + 0, + 117, + 210, + 19, + ], + "type": "x25519", + }, + ], + "service": Array [ + Object { + "id": "#1234", + "serviceEndpoint": Array [ + "https://ipfs.io/ipfs/QmNUAwg7JPK9nnuZiUri5nDaqLHqUFtNoZYtfD22Q6w3c8", + ], + "type": Array [ + "KiltPublishedCredentialCollectionV1", + ], + }, + ], + "uri": "did:kilt:light:004quk8nu1MLvzdoT4fE6SJsLS4fFpyvuGz7sQpMF7ZAWTDoF5:z1msTRicERqs59nwMvp3yzMRBhUYGmkum7ehY7rtKQc8HzfEx4b4eyRhrc37ZShT3oG7E89x89vaG9W4hRxPS23EAFnCSeVbVRrKGJmFQvYhjgKSMmrGC7gSxgHe1a3g41uamhD49AEi13YVMkgeHpyEQJBy7N7gGyW7jTWFcwzAnws4wSazBVG1qHmVJrhmusoJoTfKTPKXkExKyur8Z341EkcRkHteY8dV3VjLXHnfhRW2yU9oM2cRm5ozgaufxrXsQBx33ygTW2wvrfzzXsYw4Bs6Vf2tC3ipBTDcKyCk6G88LYnzBosRM15W3KmDRciJ2iPjqiQkhYm77EQyaw", +} +`; + +exports[`Breaking Changes Messages does not break Message & EncryptedMessage structure 1`] = ` +Object { + "body": Object { + "content": Object { + "cTypeHash": "0x1234", + }, + "type": "request-terms", + }, + "createdAt": 1657727664899, + "messageId": "0xa3970143a4d6796c764c4fb49cecfb55229429f6fb8d7748969bf1f3679db22a", + "receiver": "did:kilt:light:004rzcHqKvv6TbsA46VpG53JrvdzRr6ccyboUNeCGTvDw2AozU:z1msTRicERqs59nwMvp3yzMRBhQhYShb1vEhbpWo5ZbqVAgi2UFELJk7MbUSeEfBdAVsJhdqcEAhXxH4YrV5nwgTYjFYszWKLFnYvSUhgZ7teDiLt1FbAo484ihnagUKQkE46o3fqSv52WgM6VatrEqetD3ekokxFtz4yn2vFYPdDMPmKE3cVxdKqPMa3Ewh6k46SENeEDZFLg1L8Yi73ZVEA9AwDg2RDuBDnpjetxBC6U5qMKVfqbh1rjgxpubpSj6sppHDq8xZ4LDU2bs1a9g6qcWJjkrtS69t3PTFZv5Ey84epnvbXEm8hsVnzTKsY6LbQmCiVqwKWUPUwXpj83", + "sender": "did:kilt:light:004rn1Xps9QSMiAb2aMoKQbAred94wh1iLjGmNBYy1FVCS81ry:z1msTRicERqs59nwMvp3yzMRBhRatQoZZaiSZfyN7TzqeEs1bHHTCH3RURC6zWk5B8HXGZThZos9PJFJrkiYchNGbAGQRKSKucBVDVoXBLDyEm4P1dsco9wyoaWa5kkFw6DZgnKrTJg8Y8iCy7k2yo8GeMXAuR8qoBFFXj7Up7DxKJrMoQudvFHTy2uk2HPNfqkzJX17Wqsny1MKHD82eC3TcjrGCkhMZy3NmzkySmLsDmmHnG2csZ5vvefFRFZ1hSKfUtcV8EnLd3zozsiZByaLrED2XVbuHqPVzqcnrCJF8fSm49NcGDgsQkwnQwbuKfMkov9WwJoxhDSYG6e7WP", +} +`; + +exports[`Breaking Changes Messages does not break Message & EncryptedMessage structure 2`] = ` +Object { + "ciphertext": "0x8edac73d2230d66ba1a177db550773afa4f2d914786050424594c89f07ccbc2f643df95ba030281079a92215c66d76a74b39e6013cb8a5e1459a6853fdbfb522bff1295cbf9e5e2d6947de5974dafe6de32e6d42e2c349f07b5bb934a504d0a227d502e920cadfae44869ed041d86916cee71e0619650f15a1a04f27751f0839e8f3c629d626a54f489c4170b3ffefe118039925124acba91c097bf4d8c582f26c8a3b0f1dba93bf8da6b8f2a2a4303ac529c7028aec026f6baeb1ae95d90884f12890f4bc2d535247a170dd68a6828573e36502ef0d99fb4cdb0750b84902876009cca8662f952746cad88c9a8285b8be42ad349c67de540fb92e122d52c2ffa4c8e229076990ce60b13b64ddb6d769017262597bb33085cb8e09d5189f2077e48ece3c0100a1aa11935237a1ee3ef80200c4ccf92bb41d75c83238ac18360c6ce81df45ade968a59aff9fddf6a475fd976f581c267ddc377a1a239997ccdfd92f0e8d3a6b1b76f520e1c25ea7e3954ed555eb4ac02d68562cd1f031b724a063606c95d528c91b80ea49786303d0a6e7201e16f3e0d5571f205069da31874ed8e6c5d380cce070b2cb96961d2f594cc4a5dffc94e3782bf6a1da3bbc1af2f773e79250e09c3206b0e0c7a08a001393526220831f3735c07bf68c8ccca07260b8cb1acbb66163c73af0d783eb035a99add5d604f10916432846279524e8741b57961d52583ced5b79943c986a9f28d99be029b00e5688afcb3731152861a37ddf5e70c95dd64e2d765a4d0a662f93d16a3650c505dc2e4a048b0d585fadc8c4efa23360e81292c2ae88027068deed4ff3cd97d961b58afd95728aa4ce03340ebf13a4bc7d4b6f8b5e69a7a3ecb18c79a06946466d0b29ca0bd00c47d1256fe564b48eac37b389c246d9b556dc67921e27fb6a8aeb93953c1947834432e5ade8117bcad7173f9d8b43ebf4cce89789744d55215a8bbdfd9a7222cafccc02a3c62e5a26794ef21d1bba441f0aa9ca3e077f32e06daa22264345b66dbf34dbb9219434ad7c21b386de7587c3612fc36b63bdf650206a191fea82855a5181942c151c8a90741c8a930c570350f863ca448d908f7f1a098b0521a14c9c49bf99bd1715ebed5a93b3bc7e04fcd845efcc564448d0426e21496ca124ca8c96a1a598e90529d65fc33d64b937b16a077eaa052b10d34ef91a321a2c0476601318a7eaecc8308d618d82db10f8978c4310e1384bfb043d0a12c20325c4ceef36e144a9f2fb94d0dc546b5b4cbce162569e8e40454d219750eb85758555547c0900874bd2ca7c561aeab4e2b5e26130d91e22196fd138e8e73f6414c50c08a6f981e8a1ed244c2ee2f5c4d446d793e0039b5f75ea40215ebb2e2bcf8fae608173a00ccc24e016176417bbac0ce5682932341fc3a2a106a4f6d83dbf17a81fc7d0e5cbe52c92ece5789e8e8b3", + "nonce": "0x2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a", + "receivedAt": undefined, + "receiverKeyUri": "did:kilt:light:004rzcHqKvv6TbsA46VpG53JrvdzRr6ccyboUNeCGTvDw2AozU:z1msTRicERqs59nwMvp3yzMRBhQhYShb1vEhbpWo5ZbqVAgi2UFELJk7MbUSeEfBdAVsJhdqcEAhXxH4YrV5nwgTYjFYszWKLFnYvSUhgZ7teDiLt1FbAo484ihnagUKQkE46o3fqSv52WgM6VatrEqetD3ekokxFtz4yn2vFYPdDMPmKE3cVxdKqPMa3Ewh6k46SENeEDZFLg1L8Yi73ZVEA9AwDg2RDuBDnpjetxBC6U5qMKVfqbh1rjgxpubpSj6sppHDq8xZ4LDU2bs1a9g6qcWJjkrtS69t3PTFZv5Ey84epnvbXEm8hsVnzTKsY6LbQmCiVqwKWUPUwXpj83#encryption", + "senderKeyUri": "did:kilt:light:004rn1Xps9QSMiAb2aMoKQbAred94wh1iLjGmNBYy1FVCS81ry:z1msTRicERqs59nwMvp3yzMRBhRatQoZZaiSZfyN7TzqeEs1bHHTCH3RURC6zWk5B8HXGZThZos9PJFJrkiYchNGbAGQRKSKucBVDVoXBLDyEm4P1dsco9wyoaWa5kkFw6DZgnKrTJg8Y8iCy7k2yo8GeMXAuR8qoBFFXj7Up7DxKJrMoQudvFHTy2uk2HPNfqkzJX17Wqsny1MKHD82eC3TcjrGCkhMZy3NmzkySmLsDmmHnG2csZ5vvefFRFZ1hSKfUtcV8EnLd3zozsiZByaLrED2XVbuHqPVzqcnrCJF8fSm49NcGDgsQkwnQwbuKfMkov9WwJoxhDSYG6e7WP#encryption", +} +`; + +exports[`Breaking Changes Messages does not break for attestation flow: attestation 1`] = ` +Object { + "cTypeHash": "0xd5301762c62114f6455e0b373cccce20631c2a717004a98f8953e738e17c5d3c", + "claimHash": "0x453559279a1816c20673194e21eb72f121e7b31f5b33ea3a8d3264d6f4d319ac", + "delegationId": null, + "owner": "did:kilt:light:004rn1Xps9QSMiAb2aMoKQbAred94wh1iLjGmNBYy1FVCS81ry:z1msTRicERqs59nwMvp3yzMRBhRatQoZZaiSZfyN7TzqeEs1bHHTCH3RURC6zWk5B8HXGZThZos9PJFJrkiYchNGbAGQRKSKucBVDVoXBLDyEm4P1dsco9wyoaWa5kkFw6DZgnKrTJg8Y8iCy7k2yo8GeMXAuR8qoBFFXj7Up7DxKJrMoQudvFHTy2uk2HPNfqkzJX17Wqsny1MKHD82eC3TcjrGCkhMZy3NmzkySmLsDmmHnG2csZ5vvefFRFZ1hSKfUtcV8EnLd3zozsiZByaLrED2XVbuHqPVzqcnrCJF8fSm49NcGDgsQkwnQwbuKfMkov9WwJoxhDSYG6e7WP", + "revoked": false, +} +`; + +exports[`Breaking Changes Messages does not break for attestation flow: claim 1`] = ` +Object { + "cTypeHash": "0xd5301762c62114f6455e0b373cccce20631c2a717004a98f8953e738e17c5d3c", + "contents": Object { + "name": "Bob", + }, + "owner": "did:kilt:light:004rn1Xps9QSMiAb2aMoKQbAred94wh1iLjGmNBYy1FVCS81ry:z1msTRicERqs59nwMvp3yzMRBhRatQoZZaiSZfyN7TzqeEs1bHHTCH3RURC6zWk5B8HXGZThZos9PJFJrkiYchNGbAGQRKSKucBVDVoXBLDyEm4P1dsco9wyoaWa5kkFw6DZgnKrTJg8Y8iCy7k2yo8GeMXAuR8qoBFFXj7Up7DxKJrMoQudvFHTy2uk2HPNfqkzJX17Wqsny1MKHD82eC3TcjrGCkhMZy3NmzkySmLsDmmHnG2csZ5vvefFRFZ1hSKfUtcV8EnLd3zozsiZByaLrED2XVbuHqPVzqcnrCJF8fSm49NcGDgsQkwnQwbuKfMkov9WwJoxhDSYG6e7WP", +} +`; + +exports[`Breaking Changes Messages does not break for attestation flow: credential 1`] = ` +Object { + "claim": Object { + "cTypeHash": "0xd5301762c62114f6455e0b373cccce20631c2a717004a98f8953e738e17c5d3c", + "contents": Object { + "name": "Bob", + }, + "owner": "did:kilt:light:004rzcHqKvv6TbsA46VpG53JrvdzRr6ccyboUNeCGTvDw2AozU:z1msTRicERqs59nwMvp3yzMRBhQhYShb1vEhbpWo5ZbqVAgi2UFELJk7MbUSeEfBdAVsJhdqcEAhXxH4YrV5nwgTYjFYszWKLFnYvSUhgZ7teDiLt1FbAo484ihnagUKQkE46o3fqSv52WgM6VatrEqetD3ekokxFtz4yn2vFYPdDMPmKE3cVxdKqPMa3Ewh6k46SENeEDZFLg1L8Yi73ZVEA9AwDg2RDuBDnpjetxBC6U5qMKVfqbh1rjgxpubpSj6sppHDq8xZ4LDU2bs1a9g6qcWJjkrtS69t3PTFZv5Ey84epnvbXEm8hsVnzTKsY6LbQmCiVqwKWUPUwXpj83", + }, + "claimHashes": Array [ + "0x901805bb5659ecf21cc79d50a98021d49eb83ee136a2609d4377dd615a271a78", + "0xdaff2311c04ea4d2c16e9bd3dc4debba9822e5c4cfb53e36b48f090036169575", + ], + "claimNonceMap": Object { + "0x499856031d06ddecbda0c1e0f1c0de4f53f614732f205190d81d0c76e793bdf0": "1ee1307c-9e65-475d-9061-0b5bfd86d2f7", + "0x721cf4dd222afba0b79565332ac711cb634762052c3c2d45434f53f465d030f7": "1ee1307c-9e65-475d-9061-0b5bfd86d2f7", + }, + "delegationId": null, + "legitimations": Array [], + "rootHash": "0x453559279a1816c20673194e21eb72f121e7b31f5b33ea3a8d3264d6f4d319ac", +} +`; + +exports[`Breaking Changes Messages does not break for attestation flow: presentation 1`] = ` +Object { + "claim": Object { + "cTypeHash": "0xd5301762c62114f6455e0b373cccce20631c2a717004a98f8953e738e17c5d3c", + "contents": Object { + "name": "Bob", + }, + "owner": "did:kilt:light:004rzcHqKvv6TbsA46VpG53JrvdzRr6ccyboUNeCGTvDw2AozU:z1msTRicERqs59nwMvp3yzMRBhQhYShb1vEhbpWo5ZbqVAgi2UFELJk7MbUSeEfBdAVsJhdqcEAhXxH4YrV5nwgTYjFYszWKLFnYvSUhgZ7teDiLt1FbAo484ihnagUKQkE46o3fqSv52WgM6VatrEqetD3ekokxFtz4yn2vFYPdDMPmKE3cVxdKqPMa3Ewh6k46SENeEDZFLg1L8Yi73ZVEA9AwDg2RDuBDnpjetxBC6U5qMKVfqbh1rjgxpubpSj6sppHDq8xZ4LDU2bs1a9g6qcWJjkrtS69t3PTFZv5Ey84epnvbXEm8hsVnzTKsY6LbQmCiVqwKWUPUwXpj83", + }, + "claimHashes": Array [ + "0x901805bb5659ecf21cc79d50a98021d49eb83ee136a2609d4377dd615a271a78", + "0xdaff2311c04ea4d2c16e9bd3dc4debba9822e5c4cfb53e36b48f090036169575", + ], + "claimNonceMap": Object { + "0x499856031d06ddecbda0c1e0f1c0de4f53f614732f205190d81d0c76e793bdf0": "1ee1307c-9e65-475d-9061-0b5bfd86d2f7", + "0x721cf4dd222afba0b79565332ac711cb634762052c3c2d45434f53f465d030f7": "1ee1307c-9e65-475d-9061-0b5bfd86d2f7", + }, + "claimerSignature": Object { + "challenge": "0xCAFE", + "keyUri": "did:kilt:light:004rzcHqKvv6TbsA46VpG53JrvdzRr6ccyboUNeCGTvDw2AozU:z1msTRicERqs59nwMvp3yzMRBhQhYShb1vEhbpWo5ZbqVAgi2UFELJk7MbUSeEfBdAVsJhdqcEAhXxH4YrV5nwgTYjFYszWKLFnYvSUhgZ7teDiLt1FbAo484ihnagUKQkE46o3fqSv52WgM6VatrEqetD3ekokxFtz4yn2vFYPdDMPmKE3cVxdKqPMa3Ewh6k46SENeEDZFLg1L8Yi73ZVEA9AwDg2RDuBDnpjetxBC6U5qMKVfqbh1rjgxpubpSj6sppHDq8xZ4LDU2bs1a9g6qcWJjkrtS69t3PTFZv5Ey84epnvbXEm8hsVnzTKsY6LbQmCiVqwKWUPUwXpj83#authentication", + "signature": "0x0000000000000000000000000000000000000000000000000000000000000000", + }, + "delegationId": null, + "legitimations": Array [], + "rootHash": "0x453559279a1816c20673194e21eb72f121e7b31f5b33ea3a8d3264d6f4d319ac", +} +`; + +exports[`Breaking Changes Messages does not break for attestation flow: request-attestation 1`] = ` +Object { + "content": Object { + "credential": Object { + "claim": Object { + "cTypeHash": "0xd5301762c62114f6455e0b373cccce20631c2a717004a98f8953e738e17c5d3c", + "contents": Object { + "name": "Bob", + }, + "owner": "did:kilt:light:004rzcHqKvv6TbsA46VpG53JrvdzRr6ccyboUNeCGTvDw2AozU:z1msTRicERqs59nwMvp3yzMRBhQhYShb1vEhbpWo5ZbqVAgi2UFELJk7MbUSeEfBdAVsJhdqcEAhXxH4YrV5nwgTYjFYszWKLFnYvSUhgZ7teDiLt1FbAo484ihnagUKQkE46o3fqSv52WgM6VatrEqetD3ekokxFtz4yn2vFYPdDMPmKE3cVxdKqPMa3Ewh6k46SENeEDZFLg1L8Yi73ZVEA9AwDg2RDuBDnpjetxBC6U5qMKVfqbh1rjgxpubpSj6sppHDq8xZ4LDU2bs1a9g6qcWJjkrtS69t3PTFZv5Ey84epnvbXEm8hsVnzTKsY6LbQmCiVqwKWUPUwXpj83", + }, + "claimHashes": Array [ + "0x901805bb5659ecf21cc79d50a98021d49eb83ee136a2609d4377dd615a271a78", + "0xdaff2311c04ea4d2c16e9bd3dc4debba9822e5c4cfb53e36b48f090036169575", + ], + "claimNonceMap": Object { + "0x499856031d06ddecbda0c1e0f1c0de4f53f614732f205190d81d0c76e793bdf0": "1ee1307c-9e65-475d-9061-0b5bfd86d2f7", + "0x721cf4dd222afba0b79565332ac711cb634762052c3c2d45434f53f465d030f7": "1ee1307c-9e65-475d-9061-0b5bfd86d2f7", + }, + "delegationId": null, + "legitimations": Array [], + "rootHash": "0x453559279a1816c20673194e21eb72f121e7b31f5b33ea3a8d3264d6f4d319ac", + }, + }, + "type": "request-attestation", +} +`; + +exports[`Breaking Changes Messages does not break for attestation flow: request-credential 1`] = ` +Object { + "content": Object { + "cTypes": Array [ + Object { + "cTypeHash": "0xd5301762c62114f6455e0b373cccce20631c2a717004a98f8953e738e17c5d3c", + "requiredProperties": Array [ + "name", + ], + "trustedAttesters": Array [ + "did:kilt:light:004rn1Xps9QSMiAb2aMoKQbAred94wh1iLjGmNBYy1FVCS81ry:z1msTRicERqs59nwMvp3yzMRBhRatQoZZaiSZfyN7TzqeEs1bHHTCH3RURC6zWk5B8HXGZThZos9PJFJrkiYchNGbAGQRKSKucBVDVoXBLDyEm4P1dsco9wyoaWa5kkFw6DZgnKrTJg8Y8iCy7k2yo8GeMXAuR8qoBFFXj7Up7DxKJrMoQudvFHTy2uk2HPNfqkzJX17Wqsny1MKHD82eC3TcjrGCkhMZy3NmzkySmLsDmmHnG2csZ5vvefFRFZ1hSKfUtcV8EnLd3zozsiZByaLrED2XVbuHqPVzqcnrCJF8fSm49NcGDgsQkwnQwbuKfMkov9WwJoxhDSYG6e7WP", + ], + }, + ], + "challenge": "0xCAFE", + }, + "type": "request-credential", +} +`; + +exports[`Breaking Changes Messages does not break for attestation flow: request-terms 1`] = ` +Object { + "content": Object { + "cTypeHash": "0xd5301762c62114f6455e0b373cccce20631c2a717004a98f8953e738e17c5d3c", + }, + "type": "request-terms", +} +`; + +exports[`Breaking Changes Messages does not break for attestation flow: submit-attestation 1`] = ` +Object { + "content": Object { + "attestation": Object { + "cTypeHash": "0xd5301762c62114f6455e0b373cccce20631c2a717004a98f8953e738e17c5d3c", + "claimHash": "0x453559279a1816c20673194e21eb72f121e7b31f5b33ea3a8d3264d6f4d319ac", + "delegationId": null, + "owner": "did:kilt:light:004rn1Xps9QSMiAb2aMoKQbAred94wh1iLjGmNBYy1FVCS81ry:z1msTRicERqs59nwMvp3yzMRBhRatQoZZaiSZfyN7TzqeEs1bHHTCH3RURC6zWk5B8HXGZThZos9PJFJrkiYchNGbAGQRKSKucBVDVoXBLDyEm4P1dsco9wyoaWa5kkFw6DZgnKrTJg8Y8iCy7k2yo8GeMXAuR8qoBFFXj7Up7DxKJrMoQudvFHTy2uk2HPNfqkzJX17Wqsny1MKHD82eC3TcjrGCkhMZy3NmzkySmLsDmmHnG2csZ5vvefFRFZ1hSKfUtcV8EnLd3zozsiZByaLrED2XVbuHqPVzqcnrCJF8fSm49NcGDgsQkwnQwbuKfMkov9WwJoxhDSYG6e7WP", + "revoked": false, + }, + }, + "type": "submit-attestation", +} +`; + +exports[`Breaking Changes Messages does not break for attestation flow: submit-credential 1`] = ` +Object { + "content": Array [ + Object { + "claim": Object { + "cTypeHash": "0xd5301762c62114f6455e0b373cccce20631c2a717004a98f8953e738e17c5d3c", + "contents": Object { + "name": "Bob", + }, + "owner": "did:kilt:light:004rzcHqKvv6TbsA46VpG53JrvdzRr6ccyboUNeCGTvDw2AozU:z1msTRicERqs59nwMvp3yzMRBhQhYShb1vEhbpWo5ZbqVAgi2UFELJk7MbUSeEfBdAVsJhdqcEAhXxH4YrV5nwgTYjFYszWKLFnYvSUhgZ7teDiLt1FbAo484ihnagUKQkE46o3fqSv52WgM6VatrEqetD3ekokxFtz4yn2vFYPdDMPmKE3cVxdKqPMa3Ewh6k46SENeEDZFLg1L8Yi73ZVEA9AwDg2RDuBDnpjetxBC6U5qMKVfqbh1rjgxpubpSj6sppHDq8xZ4LDU2bs1a9g6qcWJjkrtS69t3PTFZv5Ey84epnvbXEm8hsVnzTKsY6LbQmCiVqwKWUPUwXpj83", + }, + "claimHashes": Array [ + "0x901805bb5659ecf21cc79d50a98021d49eb83ee136a2609d4377dd615a271a78", + "0xdaff2311c04ea4d2c16e9bd3dc4debba9822e5c4cfb53e36b48f090036169575", + ], + "claimNonceMap": Object { + "0x499856031d06ddecbda0c1e0f1c0de4f53f614732f205190d81d0c76e793bdf0": "1ee1307c-9e65-475d-9061-0b5bfd86d2f7", + "0x721cf4dd222afba0b79565332ac711cb634762052c3c2d45434f53f465d030f7": "1ee1307c-9e65-475d-9061-0b5bfd86d2f7", + }, + "claimerSignature": Object { + "challenge": "0xCAFE", + "keyUri": "did:kilt:light:004rzcHqKvv6TbsA46VpG53JrvdzRr6ccyboUNeCGTvDw2AozU:z1msTRicERqs59nwMvp3yzMRBhQhYShb1vEhbpWo5ZbqVAgi2UFELJk7MbUSeEfBdAVsJhdqcEAhXxH4YrV5nwgTYjFYszWKLFnYvSUhgZ7teDiLt1FbAo484ihnagUKQkE46o3fqSv52WgM6VatrEqetD3ekokxFtz4yn2vFYPdDMPmKE3cVxdKqPMa3Ewh6k46SENeEDZFLg1L8Yi73ZVEA9AwDg2RDuBDnpjetxBC6U5qMKVfqbh1rjgxpubpSj6sppHDq8xZ4LDU2bs1a9g6qcWJjkrtS69t3PTFZv5Ey84epnvbXEm8hsVnzTKsY6LbQmCiVqwKWUPUwXpj83#authentication", + "signature": "0x0000000000000000000000000000000000000000000000000000000000000000", + }, + "delegationId": null, + "legitimations": Array [], + "rootHash": "0x453559279a1816c20673194e21eb72f121e7b31f5b33ea3a8d3264d6f4d319ac", + }, + ], + "type": "submit-credential", +} +`; + +exports[`Breaking Changes Messages does not break for attestation flow: submit-terms 1`] = ` +Object { + "content": Object { + "claim": Object { + "cTypeHash": "0xd5301762c62114f6455e0b373cccce20631c2a717004a98f8953e738e17c5d3c", + "contents": Object { + "name": "Bob", + }, + "owner": "did:kilt:light:004rn1Xps9QSMiAb2aMoKQbAred94wh1iLjGmNBYy1FVCS81ry:z1msTRicERqs59nwMvp3yzMRBhRatQoZZaiSZfyN7TzqeEs1bHHTCH3RURC6zWk5B8HXGZThZos9PJFJrkiYchNGbAGQRKSKucBVDVoXBLDyEm4P1dsco9wyoaWa5kkFw6DZgnKrTJg8Y8iCy7k2yo8GeMXAuR8qoBFFXj7Up7DxKJrMoQudvFHTy2uk2HPNfqkzJX17Wqsny1MKHD82eC3TcjrGCkhMZy3NmzkySmLsDmmHnG2csZ5vvefFRFZ1hSKfUtcV8EnLd3zozsiZByaLrED2XVbuHqPVzqcnrCJF8fSm49NcGDgsQkwnQwbuKfMkov9WwJoxhDSYG6e7WP", + }, + "legitimations": Array [], + }, + "type": "submit-terms", +} +`; diff --git a/packages/type-definitions/package.json b/packages/type-definitions/package.json index 10a997515..d39869564 100644 --- a/packages/type-definitions/package.json +++ b/packages/type-definitions/package.json @@ -1,6 +1,6 @@ { "name": "@kiltprotocol/type-definitions", - "version": "0.32.1", + "version": "0.33.0", "description": "", "main": "./lib/cjs/index.js", "module": "./lib/esm/index.js", @@ -23,7 +23,7 @@ }, "repository": "github:kiltprotocol/sdk-js", "engines": { - "node": ">=14.0" + "node": ">=16.0" }, "author": "", "license": "BSD-4-Clause", diff --git a/packages/types/package.json b/packages/types/package.json index 14a555dfd..e7a609abd 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@kiltprotocol/types", - "version": "0.32.1", + "version": "0.33.0", "description": "", "main": "./lib/cjs/index.js", "module": "./lib/esm/index.js", @@ -23,18 +23,18 @@ }, "repository": "github:kiltprotocol/sdk-js", "engines": { - "node": ">=14.0" + "node": ">=16.0" }, "author": "", "license": "BSD-4-Clause", "bugs": "https://github.com/KILTprotocol/sdk-js/issues", "homepage": "https://github.com/KILTprotocol/sdk-js#readme", "dependencies": { - "@polkadot/api": "^9.10.2", - "@polkadot/keyring": "^10.2.1", - "@polkadot/types": "^9.10.2", - "@polkadot/util": "^10.2.1", - "@polkadot/util-crypto": "^10.2.1" + "@polkadot/api": "^10.4.0", + "@polkadot/keyring": "^12.0.0", + "@polkadot/types": "^10.4.0", + "@polkadot/util": "^12.0.0", + "@polkadot/util-crypto": "^12.0.0" }, "devDependencies": { "rimraf": "^3.0.2", diff --git a/packages/types/src/CType.ts b/packages/types/src/CType.ts index 45bfc673c..c0737de15 100644 --- a/packages/types/src/CType.ts +++ b/packages/types/src/CType.ts @@ -7,23 +7,56 @@ import type { HexString } from '@polkadot/util/types' -export type InstanceType = - | 'array' - | 'boolean' - | 'integer' - | 'null' - | 'number' - | 'object' - | 'string' +export type InstanceType = 'boolean' | 'integer' | 'number' | 'string' | 'array' export type CTypeHash = HexString +interface TypePattern { + type: InstanceType +} + +interface StringPattern extends TypePattern { + type: 'string' + format?: 'date' | 'time' | 'uri' + enum?: string[] + minLength?: number + maxLength?: number +} + +interface NumberPattern extends TypePattern { + type: 'integer' | 'number' + enum?: number[] + minimum?: number + maximum?: number +} + +interface BooleanPattern extends TypePattern { + type: 'boolean' +} + +interface RefPattern { + $ref: string +} + +interface ArrayPattern extends TypePattern { + type: 'array' + items: BooleanPattern | NumberPattern | StringPattern | RefPattern + minItems?: number + maxItems?: number +} + export interface ICType { $id: `kilt:ctype:${CTypeHash}` $schema: string title: string properties: { - [key: string]: { $ref?: string; type?: InstanceType; format?: string } + [key: string]: + | BooleanPattern + | NumberPattern + | StringPattern + | ArrayPattern + | RefPattern } type: 'object' + additionalProperties?: false } diff --git a/packages/types/src/Claim.ts b/packages/types/src/Claim.ts index 42f448fdb..5e8691644 100644 --- a/packages/types/src/Claim.ts +++ b/packages/types/src/Claim.ts @@ -8,10 +8,15 @@ import type { CTypeHash } from './CType' import type { DidUri } from './DidDocument' -export type IClaimContents = Record< - string, - Record | string | number | boolean -> +type ClaimPrimitives = string | number | boolean + +export interface IClaimContents { + [key: string]: + | ClaimPrimitives + | IClaimContents + | Array +} + export interface IClaim { cTypeHash: CTypeHash contents: IClaimContents diff --git a/packages/utils/package.json b/packages/utils/package.json index 2bd4280f9..39111a069 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@kiltprotocol/utils", - "version": "0.32.1", + "version": "0.33.0", "description": "", "main": "./lib/cjs/index.js", "module": "./lib/esm/index.js", @@ -23,7 +23,7 @@ }, "repository": "github:kiltprotocol/sdk-js", "engines": { - "node": ">=14.0" + "node": ">=16.0" }, "author": "", "license": "BSD-4-Clause", @@ -35,10 +35,10 @@ }, "dependencies": { "@kiltprotocol/types": "workspace:*", - "@polkadot/api": "^9.10.2", - "@polkadot/keyring": "^10.2.1", - "@polkadot/util": "^10.2.1", - "@polkadot/util-crypto": "^10.2.1", + "@polkadot/api": "^10.4.0", + "@polkadot/keyring": "^12.0.0", + "@polkadot/util": "^12.0.0", + "@polkadot/util-crypto": "^12.0.0", "tweetnacl": "^1.0.3", "uuid": "^9.0.0" } diff --git a/packages/utils/src/Crypto.ts b/packages/utils/src/Crypto.ts index 434acb11d..7c5a7b65c 100644 --- a/packages/utils/src/Crypto.ts +++ b/packages/utils/src/Crypto.ts @@ -30,7 +30,6 @@ import { import { blake2AsHex, blake2AsU8a, - naclBoxPairFromSecret, randomAsU8a, signatureVerify, } from '@polkadot/util-crypto' @@ -42,14 +41,20 @@ import jsonabc from './jsonabc.js' import * as SDKErrors from './SDKErrors.js' import { ss58Format } from './ss58Format.js' -export { - naclBoxPairFromSecret, - mnemonicGenerate, - mnemonicToMiniSecret, -} from '@polkadot/util-crypto' +export { mnemonicGenerate, mnemonicToMiniSecret } from '@polkadot/util-crypto' export { encodeAddress, decodeAddress, u8aToHex, u8aConcat } +/** + * Creates a new public/secret box keypair from a secret. + * + * @param secret The secret. + * @returns An object containing a box `publicKey` & `secretKey` generated from the supplied secret. + */ +export function naclBoxPairFromSecret(secret: Uint8Array): nacl.BoxKeyPair { + return nacl.box.keyPair.fromSecretKey(secret) +} + /** * Types accepted by hashing and crypto functions. */ diff --git a/packages/utils/src/SDKErrors.ts b/packages/utils/src/SDKErrors.ts index e13e13b67..32dcb7814 100644 --- a/packages/utils/src/SDKErrors.ts +++ b/packages/utils/src/SDKErrors.ts @@ -159,8 +159,6 @@ export class CredentialUnverifiableError extends SDKError {} export class ClaimUnverifiableError extends SDKError {} -export class NestedClaimUnverifiableError extends SDKError {} - export class IdentityMismatchError extends SDKError { constructor(context?: string, type?: string) { if (type && context) { @@ -173,15 +171,6 @@ export class IdentityMismatchError extends SDKError { } } -export class BlockchainApiMissingError extends SDKError { - constructor(options?: ErrorOptions) { - super( - 'The blockchain API is not set. Did you forget to call `Kilt.connect(…)` or `Kilt.init(…)`?', - options - ) - } -} - export class SubscriptionsNotSupportedError extends SDKError { constructor(options?: ErrorOptions) { super( diff --git a/packages/vc-export/package.json b/packages/vc-export/package.json index 4060727bc..09e58b59a 100644 --- a/packages/vc-export/package.json +++ b/packages/vc-export/package.json @@ -1,6 +1,6 @@ { "name": "@kiltprotocol/vc-export", - "version": "0.32.1", + "version": "0.33.0", "description": "", "main": "./lib/cjs/index.js", "module": "./lib/esm/index.js", @@ -23,7 +23,7 @@ }, "repository": "github:kiltprotocol/sdk-js", "engines": { - "node": ">=14.0" + "node": ">=16.0" }, "author": "", "license": "BSD-4-Clause", @@ -41,10 +41,10 @@ "@kiltprotocol/did": "workspace:*", "@kiltprotocol/types": "workspace:*", "@kiltprotocol/utils": "workspace:*", - "@polkadot/api": "^9.10.2", - "@polkadot/types": "^9.10.2", - "@polkadot/util": "^10.2.1", - "@polkadot/util-crypto": "^10.2.1", + "@polkadot/api": "^10.4.0", + "@polkadot/types": "^10.4.0", + "@polkadot/util": "^12.0.0", + "@polkadot/util-crypto": "^12.0.0", "jsonld": "^2.0.2", "jsonld-signatures": "^5.0.0", "vc-js": "^0.6.4" diff --git a/packages/vc-export/src/exportToVerifiableCredential.spec.ts b/packages/vc-export/src/exportToVerifiableCredential.spec.ts index 391ee338d..ba815b371 100644 --- a/packages/vc-export/src/exportToVerifiableCredential.spec.ts +++ b/packages/vc-export/src/exportToVerifiableCredential.spec.ts @@ -33,6 +33,11 @@ import { KILT_VERIFIABLECREDENTIAL_TYPE, } from './constants' +jest.mock('@kiltprotocol/core', () => ({ + ...jest.requireActual('@kiltprotocol/core'), + Attestation: { fromChain: jest.fn() }, +})) + const mockedApi: any = ApiMocks.getMockedApi() const ctype: ICType = { @@ -327,7 +332,7 @@ describe('proofs', () => { mockedApi.query.attestation.attestations.mockResolvedValueOnce( encodedAttestation ) - jest.spyOn(Attestation, 'fromChain').mockReturnValue(attestation) + jest.mocked(Attestation.fromChain).mockReturnValue(attestation) const result = await verificationUtils.verifyAttestedProof( VC, diff --git a/packages/vc-export/src/vc-js/suites/KiltAttestedSuite.spec.ts b/packages/vc-export/src/vc-js/suites/KiltAttestedSuite.spec.ts index de3ac0162..b5a76b6f8 100644 --- a/packages/vc-export/src/vc-js/suites/KiltAttestedSuite.spec.ts +++ b/packages/vc-export/src/vc-js/suites/KiltAttestedSuite.spec.ts @@ -46,7 +46,11 @@ const encodedAttestation = ApiMocks.mockChainQueryReturn( ) mockedApi.query.attestation.attestations.mockResolvedValue(encodedAttestation) -const spy = jest.spyOn(Attestation, 'fromChain').mockReturnValue(attestation) +jest.mock('@kiltprotocol/core', () => ({ + ...jest.requireActual('@kiltprotocol/core'), + Attestation: { fromChain: jest.fn() }, +})) +const spy = jest.mocked(Attestation.fromChain).mockReturnValue(attestation) let suite: AttestationSuite let purpose: jsigs.purposes.ProofPurpose diff --git a/tests/cbor-web.d.ts b/tests/cbor-web.d.ts new file mode 100644 index 000000000..4def7650e --- /dev/null +++ b/tests/cbor-web.d.ts @@ -0,0 +1 @@ +declare module 'cbor-web' diff --git a/tests/tsconfig.json b/tests/tsconfig.json index ba717355b..073b69d65 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../tsconfig.json", - "include": ["bundle-test.ts", "types.d.ts"], + "include": ["bundle-test.ts", "types.d.ts", "cbor-web.d.ts"], "compilerOptions": { "module": "None", "resolveJsonModule": false, diff --git a/tsconfig.json b/tsconfig.json index 61386ace1..cf928ba32 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,6 +18,7 @@ "@kiltprotocol/docs": ["docs/src"], "@kiltprotocol/testing": ["testing/src"], "@kiltprotocol/augment-api": ["augment-api/src"], + "@kiltprotocol/augment-api/extraDefs": ["augment-api/src/interfaces/extraDefs"], "@kiltprotocol/type-definitions": ["type-definitions/src"], } }, diff --git a/yarn.lock b/yarn.lock index 1b56c7a24..9ae7a4c95 100644 --- a/yarn.lock +++ b/yarn.lock @@ -39,7 +39,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.1.0, @babel/core@npm:^7.12.3, @babel/core@npm:^7.20.5, @babel/core@npm:^7.7.2, @babel/core@npm:^7.8.0": +"@babel/core@npm:^7.1.0, @babel/core@npm:^7.12.3, @babel/core@npm:^7.7.2, @babel/core@npm:^7.8.0": version: 7.20.5 resolution: "@babel/core@npm:7.20.5" dependencies: @@ -1243,22 +1243,7 @@ __metadata: languageName: node linkType: hard -"@babel/register@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/register@npm:7.18.9" - dependencies: - clone-deep: ^4.0.1 - find-cache-dir: ^2.0.0 - make-dir: ^2.1.0 - pirates: ^4.0.5 - source-map-support: ^0.5.16 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 4aeaff97e061a397f632659082ba86c539ef8194697b236d991c10d1c2ea8f73213d3b5b3b2c24625951a1ef726b7a7d2e70f70ffcb37f79ef0c1a745eebef21 - languageName: node - linkType: hard - -"@babel/runtime@npm:^7.20.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.9.6": +"@babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.9.6": version: 7.20.6 resolution: "@babel/runtime@npm:7.20.6" dependencies: @@ -1857,14 +1842,12 @@ __metadata: resolution: "@kiltprotocol/augment-api@workspace:packages/augment-api" dependencies: "@kiltprotocol/type-definitions": "workspace:*" - "@polkadot/api": ^9.10.2 - "@polkadot/typegen": ^9.10.2 - "@types/websocket": ^1.0.5 + "@polkadot/api": ^10.4.0 + "@polkadot/typegen": ^10.4.0 glob: ^7.1.1 rimraf: ^3.0.2 ts-node: ^10.4.0 typescript: ^4.8.3 - websocket: ^1.0.34 yargs: ^16.2.0 languageName: unknown linkType: soft @@ -1877,9 +1860,9 @@ __metadata: "@kiltprotocol/testing": "workspace:*" "@kiltprotocol/types": "workspace:*" "@kiltprotocol/utils": "workspace:*" - "@polkadot/api": ^9.10.2 - "@polkadot/keyring": ^10.2.1 - "@polkadot/types": ^9.10.2 + "@polkadot/api": ^10.4.0 + "@polkadot/keyring": ^12.0.0 + "@polkadot/types": ^10.4.0 rimraf: ^3.0.2 typescript: ^4.8.3 languageName: unknown @@ -1890,8 +1873,7 @@ __metadata: resolution: "@kiltprotocol/config@workspace:packages/config" dependencies: "@kiltprotocol/types": "workspace:*" - "@kiltprotocol/utils": "workspace:*" - "@polkadot/api": ^9.10.2 + "@polkadot/api": ^10.4.0 rimraf: ^3.0.2 typescript: ^4.8.3 typescript-logging: ^1.0.0 @@ -1911,13 +1893,13 @@ __metadata: "@kiltprotocol/type-definitions": "workspace:*" "@kiltprotocol/types": "workspace:*" "@kiltprotocol/utils": "workspace:*" - "@polkadot/api": ^9.10.2 - "@polkadot/keyring": ^10.2.1 - "@polkadot/types": ^9.10.2 - "@polkadot/util": ^10.2.1 - "@polkadot/util-crypto": ^10.2.1 + "@polkadot/api": ^10.4.0 + "@polkadot/keyring": ^12.0.0 + "@polkadot/types": ^10.4.0 + "@polkadot/util": ^12.0.0 + "@polkadot/util-crypto": ^12.0.0 "@types/uuid": ^8.0.0 - cbor: ^8.1.0 + cbor-web: ^8.0.0 rimraf: ^3.0.2 testcontainers: ^9.0.0 typescript: ^4.8.3 @@ -1933,13 +1915,13 @@ __metadata: "@kiltprotocol/testing": "workspace:*" "@kiltprotocol/types": "workspace:*" "@kiltprotocol/utils": "workspace:*" - "@polkadot/api": ^9.10.2 - "@polkadot/keyring": ^10.2.1 - "@polkadot/types": ^9.10.2 - "@polkadot/types-codec": ^9.10.2 - "@polkadot/util": ^10.2.1 - "@polkadot/util-crypto": ^10.2.1 - cbor: ^8.1.0 + "@polkadot/api": ^10.4.0 + "@polkadot/keyring": ^12.0.0 + "@polkadot/types": ^10.4.0 + "@polkadot/types-codec": ^10.4.0 + "@polkadot/util": ^12.0.0 + "@polkadot/util-crypto": ^12.0.0 + cbor-web: ^8.0.0 rimraf: ^3.0.2 typescript: ^4.8.3 languageName: unknown @@ -1954,13 +1936,13 @@ __metadata: "@kiltprotocol/testing": "workspace:*" "@kiltprotocol/types": "workspace:*" "@kiltprotocol/utils": "workspace:*" - "@polkadot/util": ^10.2.1 + "@polkadot/util": ^12.0.0 rimraf: ^3.0.2 typescript: ^4.8.3 languageName: unknown linkType: soft -"@kiltprotocol/sdk-js@workspace:packages/sdk-js": +"@kiltprotocol/sdk-js@workspace:*, @kiltprotocol/sdk-js@workspace:packages/sdk-js": version: 0.0.0-use.local resolution: "@kiltprotocol/sdk-js@workspace:packages/sdk-js" dependencies: @@ -1971,15 +1953,9 @@ __metadata: "@kiltprotocol/messaging": "workspace:*" "@kiltprotocol/types": "workspace:*" "@kiltprotocol/utils": "workspace:*" - buffer: ^6.0.3 - crypto-browserify: ^3.12.0 - process: ^0.11.10 rimraf: ^3.0.2 - stream-browserify: ^3.0.0 terser-webpack-plugin: ^5.1.1 typescript: ^4.8.3 - url: ^0.11.0 - util: ^0.12.4 webpack: ^5.70.0 webpack-cli: ^4.9.2 languageName: unknown @@ -1992,16 +1968,19 @@ __metadata: "@kiltprotocol/chain-helpers": "workspace:*" "@kiltprotocol/config": "workspace:*" "@kiltprotocol/did": "workspace:*" + "@kiltprotocol/sdk-js": "workspace:*" "@kiltprotocol/type-definitions": "workspace:*" "@kiltprotocol/types": "workspace:*" "@kiltprotocol/utils": "workspace:*" - "@polkadot/api": ^9.10.2 - "@polkadot/keyring": ^10.2.1 - "@polkadot/types": ^9.10.2 - "@polkadot/util": ^10.2.1 - "@polkadot/util-crypto": ^10.2.1 + "@polkadot/api": ^10.4.0 + "@polkadot/keyring": ^12.0.0 + "@polkadot/types": ^10.4.0 + "@polkadot/util": ^12.0.0 + "@polkadot/util-crypto": ^12.0.0 rimraf: ^3.0.2 + tweetnacl: ^1.0.3 typescript: ^4.8.3 + uuid: ^9.0.0 languageName: unknown linkType: soft @@ -2018,11 +1997,11 @@ __metadata: version: 0.0.0-use.local resolution: "@kiltprotocol/types@workspace:packages/types" dependencies: - "@polkadot/api": ^9.10.2 - "@polkadot/keyring": ^10.2.1 - "@polkadot/types": ^9.10.2 - "@polkadot/util": ^10.2.1 - "@polkadot/util-crypto": ^10.2.1 + "@polkadot/api": ^10.4.0 + "@polkadot/keyring": ^12.0.0 + "@polkadot/types": ^10.4.0 + "@polkadot/util": ^12.0.0 + "@polkadot/util-crypto": ^12.0.0 rimraf: ^3.0.2 typescript: ^4.8.3 languageName: unknown @@ -2033,10 +2012,10 @@ __metadata: resolution: "@kiltprotocol/utils@workspace:packages/utils" dependencies: "@kiltprotocol/types": "workspace:*" - "@polkadot/api": ^9.10.2 - "@polkadot/keyring": ^10.2.1 - "@polkadot/util": ^10.2.1 - "@polkadot/util-crypto": ^10.2.1 + "@polkadot/api": ^10.4.0 + "@polkadot/keyring": ^12.0.0 + "@polkadot/util": ^12.0.0 + "@polkadot/util-crypto": ^12.0.0 rimraf: ^3.0.2 tweetnacl: ^1.0.3 typescript: ^4.8.3 @@ -2054,10 +2033,10 @@ __metadata: "@kiltprotocol/testing": "workspace:*" "@kiltprotocol/types": "workspace:*" "@kiltprotocol/utils": "workspace:*" - "@polkadot/api": ^9.10.2 - "@polkadot/types": ^9.10.2 - "@polkadot/util": ^10.2.1 - "@polkadot/util-crypto": ^10.2.1 + "@polkadot/api": ^10.4.0 + "@polkadot/types": ^10.4.0 + "@polkadot/util": ^12.0.0 + "@polkadot/util-crypto": ^12.0.0 "@types/jsonld": 1.5.1 jsonld: ^2.0.2 jsonld-signatures: ^5.0.0 @@ -2067,17 +2046,19 @@ __metadata: languageName: unknown linkType: soft -"@noble/hashes@npm:1.1.3": - version: 1.1.3 - resolution: "@noble/hashes@npm:1.1.3" - checksum: a6f9783d2a33fc528c8709532b1c26cc3f5866f79c66256e881b28c61a1585be3899b008aa4e5e2b4e01b95c713722f52591cbb18ec51aa0ec63e7eaece1b89c +"@noble/curves@npm:1.0.0": + version: 1.0.0 + resolution: "@noble/curves@npm:1.0.0" + dependencies: + "@noble/hashes": 1.3.0 + checksum: 6bcef44d626c640dc8961819d68dd67dffb907e3b973b7c27efe0ecdd9a5c6ce62c7b9e3dfc930c66605dced7f1ec0514d191c09a2ce98d6d52b66e3315ffa79 languageName: node linkType: hard -"@noble/secp256k1@npm:1.7.0": - version: 1.7.0 - resolution: "@noble/secp256k1@npm:1.7.0" - checksum: 540a2b8e527ee1e5522af1c430e54945ad373883cac983b115136cd0950efa1f2c473ee6a36d8e69b6809b3ee586276de62f5fa705c77a9425721e81bada8116 +"@noble/hashes@npm:1.3.0": + version: 1.3.0 + resolution: "@noble/hashes@npm:1.3.0" + checksum: d7ddb6d7c60f1ce1f87facbbef5b724cdea536fc9e7f59ae96e0fc9de96c8f1a2ae2bdedbce10f7dcc621338dfef8533daa73c873f2b5c87fa1a4e05a95c2e2e languageName: node linkType: hard @@ -2140,440 +2121,442 @@ __metadata: languageName: node linkType: hard -"@polkadot/api-augment@npm:9.10.2": - version: 9.10.2 - resolution: "@polkadot/api-augment@npm:9.10.2" - dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/api-base": 9.10.2 - "@polkadot/rpc-augment": 9.10.2 - "@polkadot/types": 9.10.2 - "@polkadot/types-augment": 9.10.2 - "@polkadot/types-codec": 9.10.2 - "@polkadot/util": ^10.2.1 - checksum: 79b2162195b63933aae4be1452f07c00ce78f7d08e927f6c832942a2609438ebd32a4ec6103b779e36a0dad53a0e622416b36a3d67a91232219f3d7b4244fae3 - languageName: node - linkType: hard - -"@polkadot/api-base@npm:9.10.2": - version: 9.10.2 - resolution: "@polkadot/api-base@npm:9.10.2" - dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/rpc-core": 9.10.2 - "@polkadot/types": 9.10.2 - "@polkadot/util": ^10.2.1 - rxjs: ^7.6.0 - checksum: 648616b77e11adc3dfd09a1d5d5128c5ba6510f23d5a6b16599fce3c31e19d4d2b69367ae9b0891839f17f618e054b2dbc01f7322900a32c97e740a07080dada - languageName: node - linkType: hard - -"@polkadot/api-derive@npm:9.10.2": - version: 9.10.2 - resolution: "@polkadot/api-derive@npm:9.10.2" - dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/api": 9.10.2 - "@polkadot/api-augment": 9.10.2 - "@polkadot/api-base": 9.10.2 - "@polkadot/rpc-core": 9.10.2 - "@polkadot/types": 9.10.2 - "@polkadot/types-codec": 9.10.2 - "@polkadot/util": ^10.2.1 - "@polkadot/util-crypto": ^10.2.1 - rxjs: ^7.6.0 - checksum: 4cd5f26baaea161908b942ffff68d5311b139c70bee4067718757e02bce1d38ec0e02c2d8658b7f14794f86e139283f1db51f2294a57f865d5ce8326b39eb1b5 - languageName: node - linkType: hard - -"@polkadot/api@npm:9.10.2, @polkadot/api@npm:^9.10.2": - version: 9.10.2 - resolution: "@polkadot/api@npm:9.10.2" - dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/api-augment": 9.10.2 - "@polkadot/api-base": 9.10.2 - "@polkadot/api-derive": 9.10.2 - "@polkadot/keyring": ^10.2.1 - "@polkadot/rpc-augment": 9.10.2 - "@polkadot/rpc-core": 9.10.2 - "@polkadot/rpc-provider": 9.10.2 - "@polkadot/types": 9.10.2 - "@polkadot/types-augment": 9.10.2 - "@polkadot/types-codec": 9.10.2 - "@polkadot/types-create": 9.10.2 - "@polkadot/types-known": 9.10.2 - "@polkadot/util": ^10.2.1 - "@polkadot/util-crypto": ^10.2.1 - eventemitter3: ^4.0.7 - rxjs: ^7.6.0 - checksum: dc912213e567cfdb262ccfdfae71bb03da5172760f452968173c371015130bad48a9cb65335fe94acda5dd39a1c8f1a0820f9a885150c9f325c53e1578002e25 +"@polkadot/api-augment@npm:10.7.3": + version: 10.7.3 + resolution: "@polkadot/api-augment@npm:10.7.3" + dependencies: + "@polkadot/api-base": 10.7.3 + "@polkadot/rpc-augment": 10.7.3 + "@polkadot/types": 10.7.3 + "@polkadot/types-augment": 10.7.3 + "@polkadot/types-codec": 10.7.3 + "@polkadot/util": ^12.2.1 + tslib: ^2.5.2 + checksum: f723f033a00b5635d94ceec20f8ba299c0bfa92132142392b686c58c50e44e6082e4946681035c727feb25ea8210ccd953aa5b8420af51d27a42a0ed134c4117 + languageName: node + linkType: hard + +"@polkadot/api-base@npm:10.7.3": + version: 10.7.3 + resolution: "@polkadot/api-base@npm:10.7.3" + dependencies: + "@polkadot/rpc-core": 10.7.3 + "@polkadot/types": 10.7.3 + "@polkadot/util": ^12.2.1 + rxjs: ^7.8.1 + tslib: ^2.5.2 + checksum: f618fcb5d2b3aa20e9e3c13e081e464efc433ee12bda77c16b45899bcb496615e4e8d0ab651ed17f078d10d31f3bfee83225131f55a714a961f45d91208a3cda languageName: node linkType: hard -"@polkadot/keyring@npm:^10.2.1": - version: 10.2.1 - resolution: "@polkadot/keyring@npm:10.2.1" +"@polkadot/api-derive@npm:10.7.3": + version: 10.7.3 + resolution: "@polkadot/api-derive@npm:10.7.3" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/util": 10.2.1 - "@polkadot/util-crypto": 10.2.1 + "@polkadot/api": 10.7.3 + "@polkadot/api-augment": 10.7.3 + "@polkadot/api-base": 10.7.3 + "@polkadot/rpc-core": 10.7.3 + "@polkadot/types": 10.7.3 + "@polkadot/types-codec": 10.7.3 + "@polkadot/util": ^12.2.1 + "@polkadot/util-crypto": ^12.2.1 + rxjs: ^7.8.1 + tslib: ^2.5.2 + checksum: 61f0f6d85a4deb744747d7f2a0ae5e4a69ef29e823ae6819f1afb3e8ff2a7f93a40afec085531cda98039310fdfab24529408dcd04c3706e778c6a977ec84d74 + languageName: node + linkType: hard + +"@polkadot/api@npm:10.7.3, @polkadot/api@npm:^10.4.0": + version: 10.7.3 + resolution: "@polkadot/api@npm:10.7.3" + dependencies: + "@polkadot/api-augment": 10.7.3 + "@polkadot/api-base": 10.7.3 + "@polkadot/api-derive": 10.7.3 + "@polkadot/keyring": ^12.2.1 + "@polkadot/rpc-augment": 10.7.3 + "@polkadot/rpc-core": 10.7.3 + "@polkadot/rpc-provider": 10.7.3 + "@polkadot/types": 10.7.3 + "@polkadot/types-augment": 10.7.3 + "@polkadot/types-codec": 10.7.3 + "@polkadot/types-create": 10.7.3 + "@polkadot/types-known": 10.7.3 + "@polkadot/util": ^12.2.1 + "@polkadot/util-crypto": ^12.2.1 + eventemitter3: ^5.0.1 + rxjs: ^7.8.1 + tslib: ^2.5.2 + checksum: f1080ceec0ea5ac91cf32972e15e3c91be348b603fbc6ce8ec58a145fd65efa183090e792c4e4def406704afa55992b86ee4ad9a41a238ae69d7e3dd7db4f08e + languageName: node + linkType: hard + +"@polkadot/keyring@npm:^12.0.0, @polkadot/keyring@npm:^12.2.1": + version: 12.2.1 + resolution: "@polkadot/keyring@npm:12.2.1" + dependencies: + "@polkadot/util": 12.2.1 + "@polkadot/util-crypto": 12.2.1 + tslib: ^2.5.0 peerDependencies: - "@polkadot/util": 10.2.1 - "@polkadot/util-crypto": 10.2.1 - checksum: 7a7fa99c92d6381a706cd763c56b3ef53798b005e9abd1d4d15aaf5088b0bd1f2fc3152b6acc140c851bc8c8c3236bf4a6bc47b64da2cb1af94b442df24cdbff + "@polkadot/util": 12.2.1 + "@polkadot/util-crypto": 12.2.1 + checksum: 8f637cdec89ee66964f0017c26330dac734779b0eb60611ee01d292d99fb6de7b31c7c1054e1214c27c7f2edb65d5b17fcdb36348e556282efa33445630a77a7 languageName: node linkType: hard -"@polkadot/networks@npm:10.2.1, @polkadot/networks@npm:^10.2.1": - version: 10.2.1 - resolution: "@polkadot/networks@npm:10.2.1" +"@polkadot/networks@npm:12.2.1, @polkadot/networks@npm:^12.2.1": + version: 12.2.1 + resolution: "@polkadot/networks@npm:12.2.1" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/util": 10.2.1 - "@substrate/ss58-registry": ^1.35.0 - checksum: e0c741731facc15edbe62b8dc84844cae651d27020af3586a0bc29307e3b9b21b4394d70f170826d69531b58ab45a86857b655f0e9bb7e29161aed1d0f624170 + "@polkadot/util": 12.2.1 + "@substrate/ss58-registry": ^1.40.0 + tslib: ^2.5.0 + checksum: e3005a5c5045633784ffcf0dda91eb4aeab92dba30a255315743b2d49145c5b5c30edd1e997ecdb0c096d2423e1665fe44ad2c79be054b371a89bafdf2247950 languageName: node linkType: hard -"@polkadot/rpc-augment@npm:9.10.2": - version: 9.10.2 - resolution: "@polkadot/rpc-augment@npm:9.10.2" +"@polkadot/rpc-augment@npm:10.7.3": + version: 10.7.3 + resolution: "@polkadot/rpc-augment@npm:10.7.3" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/rpc-core": 9.10.2 - "@polkadot/types": 9.10.2 - "@polkadot/types-codec": 9.10.2 - "@polkadot/util": ^10.2.1 - checksum: 8221e8bd746da9b258920c94a5d813e45d8f52e7e26e0116890752561a1b16a386468218237b1c2275906768bb01a495827c082e1b0e642ab35169517e54be15 + "@polkadot/rpc-core": 10.7.3 + "@polkadot/types": 10.7.3 + "@polkadot/types-codec": 10.7.3 + "@polkadot/util": ^12.2.1 + tslib: ^2.5.2 + checksum: cfd96ab3823197cb1f0dba5da767683114b300fd5b2bfe6c2b10245ba8fe0616f42795a4fa524c9de990d23e65b82207b7c7ecf7cb99208802c675deb676f35d languageName: node linkType: hard -"@polkadot/rpc-core@npm:9.10.2": - version: 9.10.2 - resolution: "@polkadot/rpc-core@npm:9.10.2" +"@polkadot/rpc-core@npm:10.7.3": + version: 10.7.3 + resolution: "@polkadot/rpc-core@npm:10.7.3" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/rpc-augment": 9.10.2 - "@polkadot/rpc-provider": 9.10.2 - "@polkadot/types": 9.10.2 - "@polkadot/util": ^10.2.1 - rxjs: ^7.6.0 - checksum: 1b87438a59bc6c65568517df3cddbd43b34df5af01a83831c17987f4e1e37b8a5e1d80eabb98741bc547b72cd65a4b5e48b414463c79c56c187af141cab7f711 + "@polkadot/rpc-augment": 10.7.3 + "@polkadot/rpc-provider": 10.7.3 + "@polkadot/types": 10.7.3 + "@polkadot/util": ^12.2.1 + rxjs: ^7.8.1 + tslib: ^2.5.2 + checksum: 1dfc37686070372a132a6651b44d5dc031de51370f68db5ddcd256c346e5e8d718a89ba67e53d490a50aa8f00daf8098a7db714bed13d3dfba0c7868c8544aa9 languageName: node linkType: hard -"@polkadot/rpc-provider@npm:9.10.2": - version: 9.10.2 - resolution: "@polkadot/rpc-provider@npm:9.10.2" +"@polkadot/rpc-provider@npm:10.7.3": + version: 10.7.3 + resolution: "@polkadot/rpc-provider@npm:10.7.3" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/keyring": ^10.2.1 - "@polkadot/types": 9.10.2 - "@polkadot/types-support": 9.10.2 - "@polkadot/util": ^10.2.1 - "@polkadot/util-crypto": ^10.2.1 - "@polkadot/x-fetch": ^10.2.1 - "@polkadot/x-global": ^10.2.1 - "@polkadot/x-ws": ^10.2.1 - "@substrate/connect": 0.7.17 - eventemitter3: ^4.0.7 - mock-socket: ^9.1.5 - nock: ^13.2.9 - checksum: b3fdc1fdcde27d57af542fad30af441328fc8270f9bef7e5537dc253c96b660894e20c109b177b7ba2d82e050c5ae5ff2929a9c6fb985de7a0b90f5bb6e3f867 - languageName: node - linkType: hard - -"@polkadot/typegen@npm:^9.10.2": - version: 9.10.2 - resolution: "@polkadot/typegen@npm:9.10.2" - dependencies: - "@babel/core": ^7.20.5 - "@babel/register": ^7.18.9 - "@babel/runtime": ^7.20.6 - "@polkadot/api": 9.10.2 - "@polkadot/api-augment": 9.10.2 - "@polkadot/rpc-augment": 9.10.2 - "@polkadot/rpc-provider": 9.10.2 - "@polkadot/types": 9.10.2 - "@polkadot/types-augment": 9.10.2 - "@polkadot/types-codec": 9.10.2 - "@polkadot/types-create": 9.10.2 - "@polkadot/types-support": 9.10.2 - "@polkadot/util": ^10.2.1 - "@polkadot/util-crypto": ^10.2.1 - "@polkadot/x-ws": ^10.2.1 + "@polkadot/keyring": ^12.2.1 + "@polkadot/types": 10.7.3 + "@polkadot/types-support": 10.7.3 + "@polkadot/util": ^12.2.1 + "@polkadot/util-crypto": ^12.2.1 + "@polkadot/x-fetch": ^12.2.1 + "@polkadot/x-global": ^12.2.1 + "@polkadot/x-ws": ^12.2.1 + "@substrate/connect": 0.7.26 + eventemitter3: ^5.0.1 + mock-socket: ^9.2.1 + nock: ^13.3.1 + tslib: ^2.5.2 + dependenciesMeta: + "@substrate/connect": + optional: true + checksum: e4c2987bab30a3f5693f6a3381e45dc13c638d438a38bf9b098cb7cf879f279ca8a0f5f070faf59472d00fda3d72470a6abaddf855fb60b221f77dc775a13505 + languageName: node + linkType: hard + +"@polkadot/typegen@npm:^10.4.0": + version: 10.7.3 + resolution: "@polkadot/typegen@npm:10.7.3" + dependencies: + "@polkadot/api": 10.7.3 + "@polkadot/api-augment": 10.7.3 + "@polkadot/rpc-augment": 10.7.3 + "@polkadot/rpc-provider": 10.7.3 + "@polkadot/types": 10.7.3 + "@polkadot/types-augment": 10.7.3 + "@polkadot/types-codec": 10.7.3 + "@polkadot/types-create": 10.7.3 + "@polkadot/types-support": 10.7.3 + "@polkadot/util": ^12.2.1 + "@polkadot/util-crypto": ^12.2.1 + "@polkadot/x-ws": ^12.2.1 handlebars: ^4.7.7 - websocket: ^1.0.34 - yargs: ^17.6.2 + tslib: ^2.5.2 + yargs: ^17.7.2 bin: - polkadot-types-chain-info: scripts/polkadot-types-chain-info.cjs - polkadot-types-from-chain: scripts/polkadot-types-from-chain.cjs - polkadot-types-from-defs: scripts/polkadot-types-from-defs.cjs - polkadot-types-internal-interfaces: scripts/polkadot-types-internal-interfaces.cjs - polkadot-types-internal-metadata: scripts/polkadot-types-internal-metadata.cjs - checksum: c2ecdb251cfb4021f0fddc2eebe6605db6d921d12d86a6298517b71056cfa0d0350d4fbf86e43c358792786540558a66b8b30da50c12281591f8fa716ba1dd19 + polkadot-types-chain-info: scripts/polkadot-types-chain-info.mjs + polkadot-types-from-chain: scripts/polkadot-types-from-chain.mjs + polkadot-types-from-defs: scripts/polkadot-types-from-defs.mjs + polkadot-types-internal-interfaces: scripts/polkadot-types-internal-interfaces.mjs + polkadot-types-internal-metadata: scripts/polkadot-types-internal-metadata.mjs + checksum: 12179641d4e68d1918e9accf1f7fb2bf08eed617722456cf6c3c246711e389db4909a91783f9a9440d2887594b7e637cb0ee712e5ad715430c33adbcd57d6ae6 languageName: node linkType: hard -"@polkadot/types-augment@npm:9.10.2": - version: 9.10.2 - resolution: "@polkadot/types-augment@npm:9.10.2" +"@polkadot/types-augment@npm:10.7.3": + version: 10.7.3 + resolution: "@polkadot/types-augment@npm:10.7.3" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/types": 9.10.2 - "@polkadot/types-codec": 9.10.2 - "@polkadot/util": ^10.2.1 - checksum: 6d6671726a5e025a16d5386db9039a06e864a7a52c70d301de07ba4884d2d2735e5c6a26029fb4b7db02d67a30d26d2e6891d5eff6085530daf8c048bf9ca240 + "@polkadot/types": 10.7.3 + "@polkadot/types-codec": 10.7.3 + "@polkadot/util": ^12.2.1 + tslib: ^2.5.2 + checksum: 183323bc82d169a2de094039d498044fd6cfb66ad222f149d68d9ff45491c73954dc790fccb154f2820dfab8df685681d0f6116a6daaa2d4d947e0bce9dee821 languageName: node linkType: hard -"@polkadot/types-codec@npm:9.10.2, @polkadot/types-codec@npm:^9.10.2": - version: 9.10.2 - resolution: "@polkadot/types-codec@npm:9.10.2" +"@polkadot/types-codec@npm:10.7.3, @polkadot/types-codec@npm:^10.4.0": + version: 10.7.3 + resolution: "@polkadot/types-codec@npm:10.7.3" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/util": ^10.2.1 - "@polkadot/x-bigint": ^10.2.1 - checksum: 69366a7975f2ccf02b91a087579185e9580d7448e1aab96519ceb4e76d3b5d8e6a90337fc51789c7e6fec649067e7f05467bd8ff5e44d985a72068ae2e256603 + "@polkadot/util": ^12.2.1 + "@polkadot/x-bigint": ^12.2.1 + tslib: ^2.5.2 + checksum: 4656e5a8104ea49276803f67f5687deb115e9880732dee00f470d54964a9de2a1c651c76363032db909cf559f3c32488e6cdd2f7a5eeb473896a68c0d45bc4f4 languageName: node linkType: hard -"@polkadot/types-create@npm:9.10.2": - version: 9.10.2 - resolution: "@polkadot/types-create@npm:9.10.2" +"@polkadot/types-create@npm:10.7.3": + version: 10.7.3 + resolution: "@polkadot/types-create@npm:10.7.3" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/types-codec": 9.10.2 - "@polkadot/util": ^10.2.1 - checksum: c32a07924512d3698fcbdc38da9490ee5ce91910533d7756fbab9a8455b8010bc8bba33b727869299aae0acfeaaa49b661364593b49b0ee7df6882cad30e7e4a + "@polkadot/types-codec": 10.7.3 + "@polkadot/util": ^12.2.1 + tslib: ^2.5.2 + checksum: 231c70e410fadfd264c03d03a5e4f9921b616796f7b8bffcbc18076bf1c818539f65cf307a4ad715b8e33c54a4838ecef268052460f9c3672dfe9ddcb76e8f10 languageName: node linkType: hard -"@polkadot/types-known@npm:9.10.2": - version: 9.10.2 - resolution: "@polkadot/types-known@npm:9.10.2" +"@polkadot/types-known@npm:10.7.3": + version: 10.7.3 + resolution: "@polkadot/types-known@npm:10.7.3" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/networks": ^10.2.1 - "@polkadot/types": 9.10.2 - "@polkadot/types-codec": 9.10.2 - "@polkadot/types-create": 9.10.2 - "@polkadot/util": ^10.2.1 - checksum: 9e0fb68bf5136f752955564b8691fc218f0f41415d791d93171d22c83bc88f524dbc3b6e49c17b9621aee80ba8953022c5b25d0da71256214331215121f82d19 + "@polkadot/networks": ^12.2.1 + "@polkadot/types": 10.7.3 + "@polkadot/types-codec": 10.7.3 + "@polkadot/types-create": 10.7.3 + "@polkadot/util": ^12.2.1 + tslib: ^2.5.2 + checksum: 86e05b5d6407f76db27e2d2756225eb7ffc45ce3dc2fc2bdf16c33e88488ccabc282b45583a4d797ca20e6e412f81f82697960fe3249d1faa4001c5925ef0a9a languageName: node linkType: hard -"@polkadot/types-support@npm:9.10.2": - version: 9.10.2 - resolution: "@polkadot/types-support@npm:9.10.2" +"@polkadot/types-support@npm:10.7.3": + version: 10.7.3 + resolution: "@polkadot/types-support@npm:10.7.3" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/util": ^10.2.1 - checksum: 8e00f42211a7d8155a36ab8662b3ddf5b6b849e4e16a36213b12d6cb2030b47664fc7433d29a7bab61808142e9c03e68ddfe30d33fa70dee5d10333a37faaf5d + "@polkadot/util": ^12.2.1 + tslib: ^2.5.2 + checksum: 2ad88346a5c38479cdda318950be3f1f559060df23786c4f93048d4935586bfe7e96faea36b3f40168eb7380d78c4c96a7a08ff450b60bfe1146f4bcd26af531 languageName: node linkType: hard -"@polkadot/types@npm:9.10.2, @polkadot/types@npm:^9.10.2": - version: 9.10.2 - resolution: "@polkadot/types@npm:9.10.2" +"@polkadot/types@npm:10.7.3, @polkadot/types@npm:^10.4.0": + version: 10.7.3 + resolution: "@polkadot/types@npm:10.7.3" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/keyring": ^10.2.1 - "@polkadot/types-augment": 9.10.2 - "@polkadot/types-codec": 9.10.2 - "@polkadot/types-create": 9.10.2 - "@polkadot/util": ^10.2.1 - "@polkadot/util-crypto": ^10.2.1 - rxjs: ^7.6.0 - checksum: f2973ec02b086d3df395151170c7dba5b33791a40e5ce9f40f8bbb475c53c7097d1305aa9be64097c9642b2e7334e97bc0c93aebc15c07a59633e81b3d2a8975 + "@polkadot/keyring": ^12.2.1 + "@polkadot/types-augment": 10.7.3 + "@polkadot/types-codec": 10.7.3 + "@polkadot/types-create": 10.7.3 + "@polkadot/util": ^12.2.1 + "@polkadot/util-crypto": ^12.2.1 + rxjs: ^7.8.1 + tslib: ^2.5.2 + checksum: 6ab5393ce7998de88c2206f01ebed7bb28f2ff08bf1eea6ff3d8dc04f1c8ba6f0a68cef10bc39fb8a76cc444f8bb9e5bfe61b63225e3bd9693785c8222f294cc languageName: node linkType: hard -"@polkadot/util-crypto@npm:10.2.1, @polkadot/util-crypto@npm:^10.2.1": - version: 10.2.1 - resolution: "@polkadot/util-crypto@npm:10.2.1" +"@polkadot/util-crypto@npm:12.2.1, @polkadot/util-crypto@npm:^12.0.0, @polkadot/util-crypto@npm:^12.2.1": + version: 12.2.1 + resolution: "@polkadot/util-crypto@npm:12.2.1" dependencies: - "@babel/runtime": ^7.20.6 - "@noble/hashes": 1.1.3 - "@noble/secp256k1": 1.7.0 - "@polkadot/networks": 10.2.1 - "@polkadot/util": 10.2.1 - "@polkadot/wasm-crypto": ^6.4.1 - "@polkadot/x-bigint": 10.2.1 - "@polkadot/x-randomvalues": 10.2.1 + "@noble/curves": 1.0.0 + "@noble/hashes": 1.3.0 + "@polkadot/networks": 12.2.1 + "@polkadot/util": 12.2.1 + "@polkadot/wasm-crypto": ^7.2.1 + "@polkadot/wasm-util": ^7.2.1 + "@polkadot/x-bigint": 12.2.1 + "@polkadot/x-randomvalues": 12.2.1 "@scure/base": 1.1.1 - ed2curve: ^0.3.0 - tweetnacl: ^1.0.3 + tslib: ^2.5.0 peerDependencies: - "@polkadot/util": 10.2.1 - checksum: 159860330435550eb3266c87a36d8076a602adb82724aa8109e32028f1148abbf2082f8eb89ebdbabb708e7190a746c328750b192b8e990d6bd06d1e3f7bf582 + "@polkadot/util": 12.2.1 + checksum: d999d791b8b4d5834dec6de6a1e957482211d11753a27b112eaeb0a59a4502fcd85ad8fbcc46e55609d6d797de6cec78af0f90983b33898b63506ff2f9167f90 languageName: node linkType: hard -"@polkadot/util@npm:10.2.1, @polkadot/util@npm:^10.2.1": - version: 10.2.1 - resolution: "@polkadot/util@npm:10.2.1" +"@polkadot/util@npm:12.2.1, @polkadot/util@npm:^12.0.0, @polkadot/util@npm:^12.2.1": + version: 12.2.1 + resolution: "@polkadot/util@npm:12.2.1" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/x-bigint": 10.2.1 - "@polkadot/x-global": 10.2.1 - "@polkadot/x-textdecoder": 10.2.1 - "@polkadot/x-textencoder": 10.2.1 + "@polkadot/x-bigint": 12.2.1 + "@polkadot/x-global": 12.2.1 + "@polkadot/x-textdecoder": 12.2.1 + "@polkadot/x-textencoder": 12.2.1 "@types/bn.js": ^5.1.1 bn.js: ^5.2.1 - checksum: e4ee46762e36410f8fd3cfd61b340030a72081387acae5cf4fdb14de4bb57fde81c2df02e78d8dc9f1df88ca3a606de1e85945d735ac0ac7996740fbb7970c0f + tslib: ^2.5.0 + checksum: 850f0c82ee9a76f2b3da78cd5d37568a045ee0b5da25f491f275290843b460eb383dc3c9058918522bf09f0c0e1acca67445ee49615c557e94f14c392048be40 languageName: node linkType: hard -"@polkadot/wasm-bridge@npm:6.4.1": - version: 6.4.1 - resolution: "@polkadot/wasm-bridge@npm:6.4.1" +"@polkadot/wasm-bridge@npm:7.2.1": + version: 7.2.1 + resolution: "@polkadot/wasm-bridge@npm:7.2.1" dependencies: - "@babel/runtime": ^7.20.6 + "@polkadot/wasm-util": 7.2.1 + tslib: ^2.5.0 peerDependencies: "@polkadot/util": "*" "@polkadot/x-randomvalues": "*" - checksum: 02d9cd1b5c2f6d0261004229751137ef829b38c12e0e844548ef356f9b65dc9a82ec4dcad32f4a156e3c8666b21ef4a8e0c2e5e0e1c51a51a2d7d00373f6f65e + checksum: 6f4d255665f6c1552df9abcf8e99ee36b220c446c74e4da7ac21f3c578c3736695db41e816ef83226d98231c535df8daea6d2266c3090bdd8e7609fa87447de9 languageName: node linkType: hard -"@polkadot/wasm-crypto-asmjs@npm:6.4.1": - version: 6.4.1 - resolution: "@polkadot/wasm-crypto-asmjs@npm:6.4.1" +"@polkadot/wasm-crypto-asmjs@npm:7.2.1": + version: 7.2.1 + resolution: "@polkadot/wasm-crypto-asmjs@npm:7.2.1" dependencies: - "@babel/runtime": ^7.20.6 + tslib: ^2.5.0 peerDependencies: "@polkadot/util": "*" - checksum: 6c2bba5014c373dfc18ec82bb7779141bfaea7d90e3e198fee0bc8ba3078238fee9bf1bb7138a3cbb8b5ad01ade603c44ce838e17940a610fbeec6341a17a0f3 + checksum: 9d7f2ac6f73cc2ed390941a35426763c73e6f20374eb11ed60b880a6f716c2773cb1fe1cddb9416ab669c75b25b7d99be25c8c91886bb676d6faf9b4658f8fd7 languageName: node linkType: hard -"@polkadot/wasm-crypto-init@npm:6.4.1": - version: 6.4.1 - resolution: "@polkadot/wasm-crypto-init@npm:6.4.1" +"@polkadot/wasm-crypto-init@npm:7.2.1": + version: 7.2.1 + resolution: "@polkadot/wasm-crypto-init@npm:7.2.1" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/wasm-bridge": 6.4.1 - "@polkadot/wasm-crypto-asmjs": 6.4.1 - "@polkadot/wasm-crypto-wasm": 6.4.1 + "@polkadot/wasm-bridge": 7.2.1 + "@polkadot/wasm-crypto-asmjs": 7.2.1 + "@polkadot/wasm-crypto-wasm": 7.2.1 + "@polkadot/wasm-util": 7.2.1 + tslib: ^2.5.0 peerDependencies: "@polkadot/util": "*" "@polkadot/x-randomvalues": "*" - checksum: e1d30cae9588607cbbe35f539df2cb3fca6b69d65ab7907ca24183931953de0e8d7e61be4af7c30a05295a16a1a9255256a6420a049ddf38c155400f91187956 + checksum: 97105a9e846e97d9d678526e5dd1b491cd71e705c759a8ace9e0e9a54aa045b2b512bdcdd524ea6684963b6cb0fc0a44043d2198bc680c893e1feaaf4d860e76 languageName: node linkType: hard -"@polkadot/wasm-crypto-wasm@npm:6.4.1": - version: 6.4.1 - resolution: "@polkadot/wasm-crypto-wasm@npm:6.4.1" +"@polkadot/wasm-crypto-wasm@npm:7.2.1": + version: 7.2.1 + resolution: "@polkadot/wasm-crypto-wasm@npm:7.2.1" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/wasm-util": 6.4.1 + "@polkadot/wasm-util": 7.2.1 + tslib: ^2.5.0 peerDependencies: "@polkadot/util": "*" - checksum: 21c72028d2e4333b54fb212980e3dc51827ffaf90364df1932205162859eab9b1be3a7767e1c3c5e8cfcf6ad2bc8cb9dafd3be59ada250b77679fa7ade67c646 + checksum: f000fab2fc682a4d4d2029b483701a64091b9be0d75df82f3337a48d65ffdac8d76c828f46810cb5aae6b9ec77bdf3963ae8b8668106ea9e5c0c19f57637655d languageName: node linkType: hard -"@polkadot/wasm-crypto@npm:^6.4.1": - version: 6.4.1 - resolution: "@polkadot/wasm-crypto@npm:6.4.1" +"@polkadot/wasm-crypto@npm:^7.2.1": + version: 7.2.1 + resolution: "@polkadot/wasm-crypto@npm:7.2.1" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/wasm-bridge": 6.4.1 - "@polkadot/wasm-crypto-asmjs": 6.4.1 - "@polkadot/wasm-crypto-init": 6.4.1 - "@polkadot/wasm-crypto-wasm": 6.4.1 - "@polkadot/wasm-util": 6.4.1 + "@polkadot/wasm-bridge": 7.2.1 + "@polkadot/wasm-crypto-asmjs": 7.2.1 + "@polkadot/wasm-crypto-init": 7.2.1 + "@polkadot/wasm-crypto-wasm": 7.2.1 + "@polkadot/wasm-util": 7.2.1 + tslib: ^2.5.0 peerDependencies: "@polkadot/util": "*" "@polkadot/x-randomvalues": "*" - checksum: 2892834aa2357e5974257810be625b0f08a35a3ba1def4a87e4989636dc7a43691357fdbfbeab4595eb47cd90177dba3c0ce95e593219db7c488fdf450d86357 + checksum: f42f2bc34cf76d1438893f72a233080196c9a95dd3c53444f582150c7f56b75c80b8b8b9b4a3d9015438a6f7438c6e40def46b1fe7ce3a367bcd280f2bf29c98 languageName: node linkType: hard -"@polkadot/wasm-util@npm:6.4.1": - version: 6.4.1 - resolution: "@polkadot/wasm-util@npm:6.4.1" +"@polkadot/wasm-util@npm:7.2.1, @polkadot/wasm-util@npm:^7.2.1": + version: 7.2.1 + resolution: "@polkadot/wasm-util@npm:7.2.1" dependencies: - "@babel/runtime": ^7.20.6 + tslib: ^2.5.0 peerDependencies: "@polkadot/util": "*" - checksum: 6d5ef0aa9af7ca9fe23149793bd1fa9f864b41695b49ab5ae5c23b3ac761c310edf382fe0d0a0d812dc07b10a2d0b056de5750947867a94ab87ab51e176d94b3 + checksum: 8df30296664807c27b01d37a3e9f124fdc22aef61e633b1a538a7c533f485a2aa756c43e67aac8d0c8383273432783b78e5528c5bc1ffcf508e7faaa5009e618 languageName: node linkType: hard -"@polkadot/x-bigint@npm:10.2.1, @polkadot/x-bigint@npm:^10.2.1": - version: 10.2.1 - resolution: "@polkadot/x-bigint@npm:10.2.1" +"@polkadot/x-bigint@npm:12.2.1, @polkadot/x-bigint@npm:^12.2.1": + version: 12.2.1 + resolution: "@polkadot/x-bigint@npm:12.2.1" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/x-global": 10.2.1 - checksum: 46e104ed1d3dc30fa4eda10e128e465a04a9a5dfced4e203dd16f50840ce8af44e60a351844afc26005c7c803a244d8101bd26a7d85c0df5efede3d9c823a752 + "@polkadot/x-global": 12.2.1 + tslib: ^2.5.0 + checksum: 2e1603f576654876e38e84bbea16d6206cfad58b58de0ab70bd9a5e86a20e903cae3e271f4b247f3d9fbecbe8475f40866c0bbacb7700c01be732f9b85ec6d81 languageName: node linkType: hard -"@polkadot/x-fetch@npm:^10.2.1": - version: 10.2.1 - resolution: "@polkadot/x-fetch@npm:10.2.1" +"@polkadot/x-fetch@npm:^12.2.1": + version: 12.2.1 + resolution: "@polkadot/x-fetch@npm:12.2.1" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/x-global": 10.2.1 - "@types/node-fetch": ^2.6.2 - node-fetch: ^3.3.0 - checksum: db4f0a933cf3318d8d8002ec017773d64b1076eb265fb5f05de252e3a34fe1784805854e6dd480e53a5c9f5bf6a1b4cddfae75f385b679a1b15c25968eae19c3 + "@polkadot/x-global": 12.2.1 + node-fetch: ^3.3.1 + tslib: ^2.5.0 + checksum: 55650b38ff9a119dbcc22e9c040376859e1716b9e9d955501feeee9e16f5814467a5bfeb5f34c0d3a62d39a36d51aa65defaa7e0401c36c440adacbf2302fd10 languageName: node linkType: hard -"@polkadot/x-global@npm:10.2.1, @polkadot/x-global@npm:^10.2.1": - version: 10.2.1 - resolution: "@polkadot/x-global@npm:10.2.1" +"@polkadot/x-global@npm:12.2.1, @polkadot/x-global@npm:^12.2.1": + version: 12.2.1 + resolution: "@polkadot/x-global@npm:12.2.1" dependencies: - "@babel/runtime": ^7.20.6 - checksum: 7032f7677916b402ff6bc0ee438ae18aa860909310aec7de535ddd45c40a4b46b26f2ddf78f2178a9a978f97ab8110b9e5fbce3701ea36183eb122cb4136c366 + tslib: ^2.5.0 + checksum: 49b784d20014b86616ff6ad02bd8680b685d1a004ad91476cc4c3cd08ecdc4d50d98bc141a6dfc80411301147aac68a36a09ae338002772afa3a6a8fdcb8e672 languageName: node linkType: hard -"@polkadot/x-randomvalues@npm:10.2.1": - version: 10.2.1 - resolution: "@polkadot/x-randomvalues@npm:10.2.1" +"@polkadot/x-randomvalues@npm:12.2.1": + version: 12.2.1 + resolution: "@polkadot/x-randomvalues@npm:12.2.1" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/x-global": 10.2.1 - checksum: e7f32d7f432fb0fdc9386eb379012edb0f6836135222d4750a2858845c4f8188c297070fa79d947bf3b199e57b20aa23f1dc1cd318ff371f42ae929c90f2c151 + "@polkadot/x-global": 12.2.1 + tslib: ^2.5.0 + peerDependencies: + "@polkadot/util": 12.2.1 + "@polkadot/wasm-util": "*" + checksum: c4d2dd9ed672221e58fc08a18a5876b4c680c6355297582851a41164d8fcfdedec88fabe16e23e62612e50963fef7e3cf4c250233487422d2c647b66547cfa5a languageName: node linkType: hard -"@polkadot/x-textdecoder@npm:10.2.1": - version: 10.2.1 - resolution: "@polkadot/x-textdecoder@npm:10.2.1" +"@polkadot/x-textdecoder@npm:12.2.1": + version: 12.2.1 + resolution: "@polkadot/x-textdecoder@npm:12.2.1" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/x-global": 10.2.1 - checksum: e7edcb4f0321bf474ce47c71c89fa2b4685e3fa2b77c17bc346a9034d204a48a4855ff8c882fb1047531bd1e0893fd9367085ea223c555ea51fe509a44347826 + "@polkadot/x-global": 12.2.1 + tslib: ^2.5.0 + checksum: 0e20a59e9bc7738c7ad8f5be082bd1e26269e9f5128868df86f13e7eee93e488eff642868009501b242fceed397ad577e42e6ab07caef3c813f930a60ad422a2 languageName: node linkType: hard -"@polkadot/x-textencoder@npm:10.2.1": - version: 10.2.1 - resolution: "@polkadot/x-textencoder@npm:10.2.1" +"@polkadot/x-textencoder@npm:12.2.1": + version: 12.2.1 + resolution: "@polkadot/x-textencoder@npm:12.2.1" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/x-global": 10.2.1 - checksum: 758daf0f192e88ceeb331e82a97fc2a06db9cb88fcbefb906cf7bda1b5be988ec9c3ca0ffe599852e1b167cd3b95309c16d3fa09cb9279b0f2d8eb2b017edda7 + "@polkadot/x-global": 12.2.1 + tslib: ^2.5.0 + checksum: 61d14f5c998baf2e896487a89b0eb4dd884bc88a05aa7a716cfd872029883c26cd3b790c920061d7b190e9a13a2a4b2a9c5b19de516ef4d0c369e119f9da445d languageName: node linkType: hard -"@polkadot/x-ws@npm:^10.2.1": - version: 10.2.1 - resolution: "@polkadot/x-ws@npm:10.2.1" +"@polkadot/x-ws@npm:^12.2.1": + version: 12.2.1 + resolution: "@polkadot/x-ws@npm:12.2.1" dependencies: - "@babel/runtime": ^7.20.6 - "@polkadot/x-global": 10.2.1 - "@types/websocket": ^1.0.5 - websocket: ^1.0.34 - checksum: 888426bf894f5f1be041cd8f26c7ad665dec3631be19e31938291714dee92a4be940b03d2969f2ccafe38c371900e04fc0758bbe0e81afea81769353d473e3b6 + "@polkadot/x-global": 12.2.1 + tslib: ^2.5.0 + ws: ^8.13.0 + checksum: 9fb10693ee7317a3c34b0c66f7c9c5f24bb595818473686d9bf6ece0b8bb7ee11047585482ecdaa52770e52a53f2e306d1f6e769f68b3d9b65793aed72b34058 languageName: node linkType: hard @@ -2609,31 +2592,21 @@ __metadata: languageName: node linkType: hard -"@substrate/connect@npm:0.7.17": - version: 0.7.17 - resolution: "@substrate/connect@npm:0.7.17" +"@substrate/connect@npm:0.7.26": + version: 0.7.26 + resolution: "@substrate/connect@npm:0.7.26" dependencies: "@substrate/connect-extension-protocol": ^1.0.1 - "@substrate/smoldot-light": 0.7.7 eventemitter3: ^4.0.7 - checksum: 902e89d28da9034e11abc33b47f850f01e5bd247ff291fac415366b27c363306738f1f60d8758fb949db4360018292474e2a835145b94dfa0d9fc12651bf94fe - languageName: node - linkType: hard - -"@substrate/smoldot-light@npm:0.7.7": - version: 0.7.7 - resolution: "@substrate/smoldot-light@npm:0.7.7" - dependencies: - pako: ^2.0.4 - ws: ^8.8.1 - checksum: 56870615f295619a7ad6d323eae8fccd6935f845592089bdcc4c43feef4fb1897b84bc907368d02fcf3bbe6dda19707c5fe88034337fd6d99bbf9e2b79d1e357 + smoldot: 1.0.4 + checksum: 3179d241f073318d5973deb61c9c8d9b89ae28909a594b6b9fbcdfffd030a70ba58e8428eaa9d72484810bad10c93de1ad9c440b878d0fcfaaf4559d2e6f4502 languageName: node linkType: hard -"@substrate/ss58-registry@npm:^1.35.0": - version: 1.36.0 - resolution: "@substrate/ss58-registry@npm:1.36.0" - checksum: 4a804142d8f8cc693c2816e3eb4b5b195cc1d612f0f935b51ed9c77f980064b56b8001aae4aab7ec04d13f9ff7cde8346ac4d5e69ebabe52309713257dafb216 +"@substrate/ss58-registry@npm:^1.40.0": + version: 1.40.0 + resolution: "@substrate/ss58-registry@npm:1.40.0" + checksum: 474cb16b350e95fa7ca1020b70c6885c5c3d739472f506d175f24e9fd5a6d337d3c7e7a7fa44962199ed03fffb5d3b44b8af79a9811cb55ec34b3b75bb8e7f97 languageName: node linkType: hard @@ -2874,16 +2847,6 @@ __metadata: languageName: node linkType: hard -"@types/node-fetch@npm:^2.6.2": - version: 2.6.2 - resolution: "@types/node-fetch@npm:2.6.2" - dependencies: - "@types/node": "*" - form-data: ^3.0.0 - checksum: 6f73b1470000d303d25a6fb92875ea837a216656cb7474f66cdd67bb014aa81a5a11e7ac9c21fe19bee9ecb2ef87c1962bceeaec31386119d1ac86e4c30ad7a6 - languageName: node - linkType: hard - "@types/node@npm:*": version: 17.0.22 resolution: "@types/node@npm:17.0.22" @@ -2945,15 +2908,6 @@ __metadata: languageName: node linkType: hard -"@types/websocket@npm:^1.0.5": - version: 1.0.5 - resolution: "@types/websocket@npm:1.0.5" - dependencies: - "@types/node": "*" - checksum: 41c7a620f877a0165ff36e713455d888b7f5df9c51e71b5d0f47994f98cf22ccd339b8c6cfdc6bb417e950d40f405693974d393bd916971490553cc5e9e67a9d - languageName: node - linkType: hard - "@types/yargs-parser@npm:*": version: 21.0.0 resolution: "@types/yargs-parser@npm:21.0.0" @@ -3603,18 +3557,6 @@ __metadata: languageName: node linkType: hard -"asn1.js@npm:^5.2.0": - version: 5.4.1 - resolution: "asn1.js@npm:5.4.1" - dependencies: - bn.js: ^4.0.0 - inherits: ^2.0.1 - minimalistic-assert: ^1.0.0 - safer-buffer: ^2.1.0 - checksum: 3786a101ac6f304bd4e9a7df79549a7561950a13d4bcaec0c7790d44c80d147c1a94ba3d4e663673406064642a40b23fcd6c82a9952468e386c1a1376d747f9a - languageName: node - linkType: hard - "asn1@npm:^0.2.4, asn1@npm:~0.2.3": version: 0.2.6 resolution: "asn1@npm:0.2.6" @@ -3659,13 +3601,6 @@ __metadata: languageName: node linkType: hard -"available-typed-arrays@npm:^1.0.5": - version: 1.0.5 - resolution: "available-typed-arrays@npm:1.0.5" - checksum: 20eb47b3cefd7db027b9bbb993c658abd36d4edd3fe1060e83699a03ee275b0c9b216cc076ff3f2db29073225fb70e7613987af14269ac1fe2a19803ccc97f1a - languageName: node - linkType: hard - "aws-sign2@npm:~0.7.0": version: 0.7.0 resolution: "aws-sign2@npm:0.7.0" @@ -3674,9 +3609,9 @@ __metadata: linkType: hard "aws4@npm:^1.8.0": - version: 1.11.0 - resolution: "aws4@npm:1.11.0" - checksum: 5a00d045fd0385926d20ebebcfba5ec79d4482fe706f63c27b324d489a04c68edb0db99ed991e19eda09cb8c97dc2452059a34d97545cebf591d7a2b5a10999f + version: 1.12.0 + resolution: "aws4@npm:1.12.0" + checksum: 68f79708ac7c335992730bf638286a3ee0a645cf12575d557860100767c500c08b30e24726b9f03265d74116417f628af78509e1333575e9f8d52a80edfe8cbc languageName: node linkType: hard @@ -3852,14 +3787,7 @@ __metadata: languageName: node linkType: hard -"bn.js@npm:^4.0.0, bn.js@npm:^4.1.0, bn.js@npm:^4.11.9": - version: 4.12.0 - resolution: "bn.js@npm:4.12.0" - checksum: 39afb4f15f4ea537b55eaf1446c896af28ac948fdcf47171961475724d1bb65118cca49fa6e3d67706e4790955ec0e74de584e45c8f1ef89f46c812bee5b5a12 - languageName: node - linkType: hard - -"bn.js@npm:^5.0.0, bn.js@npm:^5.1.1, bn.js@npm:^5.2.1": +"bn.js@npm:^5.2.1": version: 5.2.1 resolution: "bn.js@npm:5.2.1" checksum: 3dd8c8d38055fedfa95c1d5fc3c99f8dd547b36287b37768db0abab3c239711f88ff58d18d155dd8ad902b0b0cee973747b7ae20ea12a09473272b0201c9edd3 @@ -3894,13 +3822,6 @@ __metadata: languageName: node linkType: hard -"brorand@npm:^1.0.1, brorand@npm:^1.1.0": - version: 1.1.0 - resolution: "brorand@npm:1.1.0" - checksum: 8a05c9f3c4b46572dec6ef71012b1946db6cae8c7bb60ccd4b7dd5a84655db49fe043ecc6272e7ef1f69dc53d6730b9e2a3a03a8310509a3d797a618cbee52be - languageName: node - linkType: hard - "browser-process-hrtime@npm:^1.0.0": version: 1.0.0 resolution: "browser-process-hrtime@npm:1.0.0" @@ -3908,70 +3829,6 @@ __metadata: languageName: node linkType: hard -"browserify-aes@npm:^1.0.0, browserify-aes@npm:^1.0.4": - version: 1.2.0 - resolution: "browserify-aes@npm:1.2.0" - 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 - checksum: 4a17c3eb55a2aa61c934c286f34921933086bf6d67f02d4adb09fcc6f2fc93977b47d9d884c25619144fccd47b3b3a399e1ad8b3ff5a346be47270114bcf7104 - languageName: node - linkType: hard - -"browserify-cipher@npm:^1.0.0": - version: 1.0.1 - resolution: "browserify-cipher@npm:1.0.1" - dependencies: - browserify-aes: ^1.0.4 - browserify-des: ^1.0.0 - evp_bytestokey: ^1.0.0 - checksum: 2d8500acf1ee535e6bebe808f7a20e4c3a9e2ed1a6885fff1facbfd201ac013ef030422bec65ca9ece8ffe82b03ca580421463f9c45af6c8415fd629f4118c13 - languageName: node - linkType: hard - -"browserify-des@npm:^1.0.0": - version: 1.0.2 - resolution: "browserify-des@npm:1.0.2" - dependencies: - cipher-base: ^1.0.1 - des.js: ^1.0.0 - inherits: ^2.0.1 - safe-buffer: ^5.1.2 - checksum: b15a3e358a1d78a3b62ddc06c845d02afde6fc826dab23f1b9c016e643e7b1fda41de628d2110b712f6a44fb10cbc1800bc6872a03ddd363fb50768e010395b7 - languageName: node - linkType: hard - -"browserify-rsa@npm:^4.0.0, browserify-rsa@npm:^4.0.1": - version: 4.1.0 - resolution: "browserify-rsa@npm:4.1.0" - dependencies: - bn.js: ^5.0.0 - randombytes: ^2.0.1 - checksum: 155f0c135873efc85620571a33d884aa8810e40176125ad424ec9d85016ff105a07f6231650914a760cca66f29af0494087947b7be34880dd4599a0cd3c38e54 - languageName: node - linkType: hard - -"browserify-sign@npm:^4.0.0": - version: 4.2.1 - resolution: "browserify-sign@npm:4.2.1" - dependencies: - bn.js: ^5.1.1 - browserify-rsa: ^4.0.1 - create-hash: ^1.2.0 - create-hmac: ^1.1.7 - elliptic: ^6.5.3 - inherits: ^2.0.4 - parse-asn1: ^5.1.5 - readable-stream: ^3.6.0 - safe-buffer: ^5.2.0 - checksum: 0221f190e3f5b2d40183fa51621be7e838d9caa329fe1ba773406b7637855f37b30f5d83e52ff8f244ed12ffe6278dd9983638609ed88c841ce547e603855707 - languageName: node - linkType: hard - "browserslist@npm:^4.14.5, browserslist@npm:^4.21.3, browserslist@npm:^4.21.4": version: 4.21.4 resolution: "browserslist@npm:4.21.4" @@ -4027,13 +3884,6 @@ __metadata: languageName: node linkType: hard -"buffer-xor@npm:^1.0.3": - version: 1.0.3 - resolution: "buffer-xor@npm:1.0.3" - checksum: 10c520df29d62fa6e785e2800e586a20fc4f6dfad84bcdbd12e1e8a83856de1cb75c7ebd7abe6d036bbfab738a6cf18a3ae9c8e5a2e2eb3167ca7399ce65373a - languageName: node - linkType: hard - "buffer@npm:^5.5.0": version: 5.7.1 resolution: "buffer@npm:5.7.1" @@ -4044,26 +3894,6 @@ __metadata: languageName: node linkType: hard -"buffer@npm:^6.0.3": - version: 6.0.3 - resolution: "buffer@npm:6.0.3" - dependencies: - base64-js: ^1.3.1 - ieee754: ^1.2.1 - checksum: 5ad23293d9a731e4318e420025800b42bf0d264004c0286c8cc010af7a270c7a0f6522e84f54b9ad65cbd6db20b8badbfd8d2ebf4f80fa03dab093b89e68c3f9 - languageName: node - linkType: hard - -"bufferutil@npm:^4.0.1": - version: 4.0.6 - resolution: "bufferutil@npm:4.0.6" - dependencies: - node-gyp: latest - node-gyp-build: ^4.3.0 - checksum: dd107560947445280af7820c3d0534127b911577d85d537e1d7e0aa30fd634853cef8a994d6e8aed3d81388ab1a20257de776164afe6a6af8e78f5f17968ebd6 - languageName: node - linkType: hard - "buildcheck@npm:0.0.3": version: 0.0.3 resolution: "buildcheck@npm:0.0.3" @@ -4167,12 +3997,10 @@ __metadata: languageName: node linkType: hard -"cbor@npm:^8.1.0": +"cbor-web@npm:^8.0.0": version: 8.1.0 - resolution: "cbor@npm:8.1.0" - dependencies: - nofilter: ^3.1.0 - checksum: a90338435dc7b45cc01461af979e3bb6ddd4f2a08584c437586039cd5f2235014c06e49d664295debbfb3514d87b2f06728092ab6aa6175e2e85e9cd7dc0c1fd + resolution: "cbor-web@npm:8.1.0" + checksum: 7898694ae4959a306f6e7dd2d042be8dab060a312d78dc8a2131d8ca641d5bcbcfe7e0691f1b6f0f95e5402b14ebf0ad797be14546712ab4682720b459c4836c languageName: node linkType: hard @@ -4249,16 +4077,6 @@ __metadata: languageName: node linkType: hard -"cipher-base@npm:^1.0.0, cipher-base@npm:^1.0.1, cipher-base@npm:^1.0.3": - version: 1.0.4 - resolution: "cipher-base@npm:1.0.4" - dependencies: - inherits: ^2.0.1 - safe-buffer: ^5.0.1 - checksum: 47d3568dbc17431a339bad1fe7dff83ac0891be8206911ace3d3b818fc695f376df809bea406e759cdea07fff4b454fa25f1013e648851bec790c1d75763032e - languageName: node - linkType: hard - "cjs-module-lexer@npm:^1.0.0": version: 1.2.2 resolution: "cjs-module-lexer@npm:1.2.2" @@ -4409,13 +4227,6 @@ __metadata: languageName: node linkType: hard -"commondir@npm:^1.0.1": - version: 1.0.1 - resolution: "commondir@npm:1.0.1" - checksum: 59715f2fc456a73f68826285718503340b9f0dd89bfffc42749906c5cf3d4277ef11ef1cca0350d0e79204f00f1f6d83851ececc9095dc88512a697ac0b9bdcb - languageName: node - linkType: hard - "compare-func@npm:^1.3.1": version: 1.3.4 resolution: "compare-func@npm:1.3.4" @@ -4608,43 +4419,6 @@ __metadata: languageName: node linkType: hard -"create-ecdh@npm:^4.0.0": - version: 4.0.4 - resolution: "create-ecdh@npm:4.0.4" - dependencies: - bn.js: ^4.1.0 - elliptic: ^6.5.3 - checksum: 0dd7fca9711d09e152375b79acf1e3f306d1a25ba87b8ff14c2fd8e68b83aafe0a7dd6c4e540c9ffbdd227a5fa1ad9b81eca1f233c38bb47770597ba247e614b - languageName: node - linkType: hard - -"create-hash@npm:^1.1.0, create-hash@npm:^1.1.2, create-hash@npm:^1.2.0": - version: 1.2.0 - resolution: "create-hash@npm:1.2.0" - dependencies: - cipher-base: ^1.0.1 - inherits: ^2.0.1 - md5.js: ^1.3.4 - ripemd160: ^2.0.1 - sha.js: ^2.4.0 - checksum: 02a6ae3bb9cd4afee3fabd846c1d8426a0e6b495560a977ba46120c473cb283be6aa1cace76b5f927cf4e499c6146fb798253e48e83d522feba807d6b722eaa9 - languageName: node - linkType: hard - -"create-hmac@npm:^1.1.0, create-hmac@npm:^1.1.4, create-hmac@npm:^1.1.7": - version: 1.1.7 - resolution: "create-hmac@npm:1.1.7" - 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 - checksum: ba12bb2257b585a0396108c72830e85f882ab659c3320c83584b1037f8ab72415095167ced80dc4ce8e446a8ecc4b2acf36d87befe0707d73b26cf9dc77440ed - languageName: node - linkType: hard - "create-require@npm:^1.1.0": version: 1.1.1 resolution: "create-require@npm:1.1.1" @@ -4670,25 +4444,6 @@ __metadata: languageName: node linkType: hard -"crypto-browserify@npm:^3.12.0": - version: 3.12.0 - resolution: "crypto-browserify@npm:3.12.0" - dependencies: - browserify-cipher: ^1.0.0 - browserify-sign: ^4.0.0 - create-ecdh: ^4.0.0 - create-hash: ^1.1.0 - create-hmac: ^1.1.0 - diffie-hellman: ^5.0.0 - inherits: ^2.0.1 - pbkdf2: ^3.0.3 - public-encrypt: ^4.0.0 - randombytes: ^2.0.0 - randomfill: ^1.0.3 - checksum: c1609af82605474262f3eaa07daa0b2140026bd264ab316d4bf1170272570dbe02f0c49e29407fe0d3634f96c507c27a19a6765fb856fed854a625f9d15618e2 - languageName: node - linkType: hard - "crypto-ld@npm:^3.7.0": version: 3.9.0 resolution: "crypto-ld@npm:3.9.0" @@ -4728,16 +4483,6 @@ __metadata: languageName: node linkType: hard -"d@npm:1, d@npm:^1.0.1": - version: 1.0.1 - resolution: "d@npm:1.0.1" - dependencies: - es5-ext: ^0.10.50 - type: ^1.0.1 - checksum: 49ca0639c7b822db670de93d4fbce44b4aa072cd848c76292c9978a8cd0fff1028763020ff4b0f147bd77bfe29b4c7f82e0f71ade76b2a06100543cdfd948d19 - languageName: node - linkType: hard - "dargs@npm:^7.0.0": version: 7.0.0 resolution: "dargs@npm:7.0.0" @@ -4784,7 +4529,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:^2.2.0, debug@npm:^2.6.9": +"debug@npm:^2.6.9": version: 2.6.9 resolution: "debug@npm:2.6.9" dependencies: @@ -4877,16 +4622,6 @@ __metadata: languageName: node linkType: hard -"des.js@npm:^1.0.0": - version: 1.0.1 - resolution: "des.js@npm:1.0.1" - dependencies: - inherits: ^2.0.1 - minimalistic-assert: ^1.0.0 - checksum: 1ec2eedd7ed6bd61dd5e0519fd4c96124e93bb22de8a9d211b02d63e5dd152824853d919bb2090f965cc0e3eb9c515950a9836b332020d810f9c71feb0fd7df4 - languageName: node - linkType: hard - "detect-newline@npm:^3.0.0": version: 3.1.0 resolution: "detect-newline@npm:3.1.0" @@ -4908,17 +4643,6 @@ __metadata: languageName: node linkType: hard -"diffie-hellman@npm:^5.0.0": - version: 5.0.3 - resolution: "diffie-hellman@npm:5.0.3" - dependencies: - bn.js: ^4.1.0 - miller-rabin: ^4.0.0 - randombytes: ^2.0.0 - checksum: 0e620f322170c41076e70181dd1c24e23b08b47dbb92a22a644f3b89b6d3834b0f8ee19e37916164e5eb1ee26d2aa836d6129f92723995267250a0b541811065 - languageName: node - linkType: hard - "dir-glob@npm:^3.0.1": version: 3.0.1 resolution: "dir-glob@npm:3.0.1" @@ -5015,15 +4739,6 @@ __metadata: languageName: node linkType: hard -"ed2curve@npm:^0.3.0": - version: 0.3.0 - resolution: "ed2curve@npm:0.3.0" - dependencies: - tweetnacl: 1.x.x - checksum: 6dfbe2310aa5a47372c9dd2fd920be140c8d52aea5793d716a3e3865d2ceaeaf639a7653e5492dfe3b4910eaf65c09a1d5132580afe2fdca18a75ebb428a52f2 - languageName: node - linkType: hard - "electron-to-chromium@npm:^1.4.251": version: 1.4.255 resolution: "electron-to-chromium@npm:1.4.255" @@ -5031,21 +4746,6 @@ __metadata: languageName: node linkType: hard -"elliptic@npm:^6.5.3": - version: 6.5.4 - resolution: "elliptic@npm:6.5.4" - 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 - checksum: d56d21fd04e97869f7ffcc92e18903b9f67f2d4637a23c860492fbbff5a3155fd9ca0184ce0c865dd6eb2487d234ce9551335c021c376cd2d3b7cb749c7d10f4 - languageName: node - linkType: hard - "emittery@npm:^0.8.1": version: 0.8.1 resolution: "emittery@npm:0.8.1" @@ -5138,7 +4838,7 @@ __metadata: languageName: node linkType: hard -"es-abstract@npm:^1.18.5, es-abstract@npm:^1.19.0, es-abstract@npm:^1.19.1": +"es-abstract@npm:^1.19.0, es-abstract@npm:^1.19.1": version: 1.19.1 resolution: "es-abstract@npm:1.19.1" dependencies: @@ -5184,38 +4884,6 @@ __metadata: languageName: node linkType: hard -"es5-ext@npm:^0.10.35, es5-ext@npm:^0.10.50": - version: 0.10.59 - resolution: "es5-ext@npm:0.10.59" - dependencies: - es6-iterator: ^2.0.3 - es6-symbol: ^3.1.3 - next-tick: ^1.1.0 - checksum: 3b931910d90eec2c5266f714fdef2e71b58ba3e9139d054ac0cb1c90db5b4a41989dd490885e037665450f1a4fb778b2ee8daccb6e1a5d9a07f853fd92018da6 - languageName: node - linkType: hard - -"es6-iterator@npm:^2.0.3": - version: 2.0.3 - resolution: "es6-iterator@npm:2.0.3" - dependencies: - d: 1 - es5-ext: ^0.10.35 - es6-symbol: ^3.1.1 - checksum: 6e48b1c2d962c21dee604b3d9f0bc3889f11ed5a8b33689155a2065d20e3107e2a69cc63a71bd125aeee3a589182f8bbcb5c8a05b6a8f38fa4205671b6d09697 - languageName: node - linkType: hard - -"es6-symbol@npm:^3.1.1, es6-symbol@npm:^3.1.3": - version: 3.1.3 - resolution: "es6-symbol@npm:3.1.3" - dependencies: - d: ^1.0.1 - ext: ^1.1.2 - checksum: cd49722c2a70f011eb02143ef1c8c70658d2660dead6641e160b94619f408b9cf66425515787ffe338affdf0285ad54f4eae30ea5bd510e33f8659ec53bcaa70 - languageName: node - linkType: hard - "escalade@npm:^3.1.1": version: 3.1.1 resolution: "escalade@npm:3.1.1" @@ -5543,6 +5211,13 @@ __metadata: languageName: node linkType: hard +"eventemitter3@npm:^5.0.1": + version: 5.0.1 + resolution: "eventemitter3@npm:5.0.1" + checksum: 543d6c858ab699303c3c32e0f0f47fc64d360bf73c3daf0ac0b5079710e340d6fe9f15487f94e66c629f5f82cd1a8678d692f3dbb6f6fcd1190e1b97fcad36f8 + languageName: node + linkType: hard + "events@npm:^3.2.0": version: 3.3.0 resolution: "events@npm:3.3.0" @@ -5550,17 +5225,6 @@ __metadata: languageName: node linkType: hard -"evp_bytestokey@npm:^1.0.0, evp_bytestokey@npm:^1.0.3": - version: 1.0.3 - resolution: "evp_bytestokey@npm:1.0.3" - dependencies: - md5.js: ^1.3.4 - node-gyp: latest - safe-buffer: ^5.1.1 - checksum: ad4e1577f1a6b721c7800dcc7c733fe01f6c310732bb5bf2240245c2a5b45a38518b91d8be2c610611623160b9d1c0e91f1ce96d639f8b53e8894625cf20fa45 - languageName: node - linkType: hard - "execa@npm:^5.0.0": version: 5.1.1 resolution: "execa@npm:5.1.1" @@ -5597,15 +5261,6 @@ __metadata: languageName: node linkType: hard -"ext@npm:^1.1.2": - version: 1.6.0 - resolution: "ext@npm:1.6.0" - dependencies: - type: ^2.5.0 - checksum: ca3ef4619e838f441a92238a98b77ac873da2175ace746c64303ffe2c3208e79a3acf3bf7004e40b720f3c2a83bf0143e6dd4a7cdfae6e73f54a3bfc7a14b5c2 - languageName: node - linkType: hard - "extend@npm:~3.0.2": version: 3.0.2 resolution: "extend@npm:3.0.2" @@ -5721,17 +5376,6 @@ __metadata: languageName: node linkType: hard -"find-cache-dir@npm:^2.0.0": - version: 2.1.0 - resolution: "find-cache-dir@npm:2.1.0" - dependencies: - commondir: ^1.0.1 - make-dir: ^2.0.0 - pkg-dir: ^3.0.0 - checksum: 60ad475a6da9f257df4e81900f78986ab367d4f65d33cf802c5b91e969c28a8762f098693d7a571b6e4dd4c15166c2da32ae2d18b6766a18e2071079448fdce4 - languageName: node - linkType: hard - "find-up@npm:^2.1.0": version: 2.1.0 resolution: "find-up@npm:2.1.0" @@ -5741,15 +5385,6 @@ __metadata: languageName: node linkType: hard -"find-up@npm:^3.0.0": - version: 3.0.0 - resolution: "find-up@npm:3.0.0" - dependencies: - locate-path: ^3.0.0 - checksum: 38eba3fe7a66e4bc7f0f5a1366dc25508b7cfc349f852640e3678d26ad9a6d7e2c43eff0a472287de4a9753ef58f066a0ea892a256fa3636ad51b3fe1e17fae9 - languageName: node - linkType: hard - "find-up@npm:^4.0.0, find-up@npm:^4.1.0": version: 4.1.0 resolution: "find-up@npm:4.1.0" @@ -5796,13 +5431,6 @@ __metadata: languageName: node linkType: hard -"foreach@npm:^2.0.5": - version: 2.0.5 - resolution: "foreach@npm:2.0.5" - checksum: dab4fbfef0b40b69ee5eab81bcb9626b8fa8b3469c8cfa26480f3e5e1ee08c40eae07048c9a967c65aeda26e774511ccc70b3f10a604c01753c6ef24361f0fc8 - languageName: node - linkType: hard - "forever-agent@npm:~0.6.1": version: 0.6.1 resolution: "forever-agent@npm:0.6.1" @@ -6189,38 +5817,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"hash-base@npm:^3.0.0": - version: 3.1.0 - resolution: "hash-base@npm:3.1.0" - dependencies: - inherits: ^2.0.4 - readable-stream: ^3.6.0 - safe-buffer: ^5.2.0 - checksum: 26b7e97ac3de13cb23fc3145e7e3450b0530274a9562144fc2bf5c1e2983afd0e09ed7cc3b20974ba66039fad316db463da80eb452e7373e780cbee9a0d2f2dc - languageName: node - linkType: hard - -"hash.js@npm:^1.0.0, hash.js@npm:^1.0.3": - version: 1.1.7 - resolution: "hash.js@npm:1.1.7" - dependencies: - inherits: ^2.0.3 - minimalistic-assert: ^1.0.1 - checksum: e350096e659c62422b85fa508e4b3669017311aa4c49b74f19f8e1bc7f3a54a584fdfd45326d4964d6011f2b2d882e38bea775a96046f2a61b7779a979629d8f - languageName: node - linkType: hard - -"hmac-drbg@npm:^1.0.1": - version: 1.0.1 - resolution: "hmac-drbg@npm:1.0.1" - dependencies: - hash.js: ^1.0.3 - minimalistic-assert: ^1.0.0 - minimalistic-crypto-utils: ^1.0.1 - checksum: bd30b6a68d7f22d63f10e1888aee497d7c2c5c0bb469e66bbdac99f143904d1dfe95f8131f95b3e86c86dd239963c9d972fcbe147e7cffa00e55d18585c43fe0 - languageName: node - linkType: hard - "hosted-git-info@npm:^2.1.4": version: 2.8.9 resolution: "hosted-git-info@npm:2.8.9" @@ -6358,7 +5954,7 @@ fsevents@^2.3.2: languageName: node linkType: hard -"ieee754@npm:^1.1.13, ieee754@npm:^1.2.1": +"ieee754@npm:^1.1.13": version: 1.2.1 resolution: "ieee754@npm:1.2.1" checksum: 5144c0c9815e54ada181d80a0b810221a253562422e7c6c3a60b1901154184f49326ec239d618c416c1c5945a2e197107aee8d986a3dd836b53dffefd99b5e7e @@ -6432,7 +6028,7 @@ fsevents@^2.3.2: languageName: node linkType: hard -"inherits@npm:2, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:^2.0.4, inherits@npm:~2.0.3, inherits@npm:~2.0.4": +"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:^2.0.4, inherits@npm:~2.0.3": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 @@ -6471,16 +6067,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"is-arguments@npm:^1.0.4": - version: 1.1.1 - resolution: "is-arguments@npm:1.1.1" - dependencies: - call-bind: ^1.0.2 - has-tostringtag: ^1.0.0 - checksum: 7f02700ec2171b691ef3e4d0e3e6c0ba408e8434368504bb593d0d7c891c0dbfda6d19d30808b904a6cb1929bca648c061ba438c39f296c2a8ca083229c49f27 - languageName: node - linkType: hard - "is-arrayish@npm:^0.2.1": version: 0.2.1 resolution: "is-arrayish@npm:0.2.1" @@ -6553,15 +6139,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"is-generator-function@npm:^1.0.7": - version: 1.0.10 - resolution: "is-generator-function@npm:1.0.10" - dependencies: - has-tostringtag: ^1.0.0 - checksum: d54644e7dbaccef15ceb1e5d91d680eb5068c9ee9f9eb0a9e04173eb5542c9b51b5ab52c5537f5703e48d5fddfd376817c1ca07a84a407b7115b769d4bdde72b - languageName: node - linkType: hard - "is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3": version: 4.0.3 resolution: "is-glob@npm:4.0.3" @@ -6689,19 +6266,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"is-typed-array@npm:^1.1.3, is-typed-array@npm:^1.1.7": - version: 1.1.8 - resolution: "is-typed-array@npm:1.1.8" - dependencies: - available-typed-arrays: ^1.0.5 - call-bind: ^1.0.2 - es-abstract: ^1.18.5 - foreach: ^2.0.5 - has-tostringtag: ^1.0.0 - checksum: aa0f9f0716e19e2fb8aef69e69e4205479d25ace778e2339fc910948115cde4b0d9aff9d5d1e8b80f09a5664998278e05e54ad3dc9cb12cefcf86db71084ed00 - languageName: node - linkType: hard - "is-typedarray@npm:^1.0.0, is-typedarray@npm:~1.0.0": version: 1.0.0 resolution: "is-typedarray@npm:1.0.0" @@ -7597,16 +7161,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"locate-path@npm:^3.0.0": - version: 3.0.0 - resolution: "locate-path@npm:3.0.0" - dependencies: - p-locate: ^3.0.0 - path-exists: ^3.0.0 - checksum: 53db3996672f21f8b0bf2a2c645ae2c13ffdae1eeecfcd399a583bce8516c0b88dcb4222ca6efbbbeb6949df7e46860895be2c02e8d3219abd373ace3bfb4e11 - languageName: node - linkType: hard - "locate-path@npm:^5.0.0": version: 5.0.0 resolution: "locate-path@npm:5.0.0" @@ -7727,16 +7281,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"make-dir@npm:^2.0.0, make-dir@npm:^2.1.0": - version: 2.1.0 - resolution: "make-dir@npm:2.1.0" - dependencies: - pify: ^4.0.1 - semver: ^5.6.0 - checksum: 043548886bfaf1820323c6a2997e6d2fa51ccc2586ac14e6f14634f7458b4db2daf15f8c310e2a0abd3e0cddc64df1890d8fc7263033602c47bb12cbfcf86aab - languageName: node - linkType: hard - "make-dir@npm:^3.0.0": version: 3.1.0 resolution: "make-dir@npm:3.1.0" @@ -7809,17 +7353,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"md5.js@npm:^1.3.4": - version: 1.3.5 - resolution: "md5.js@npm:1.3.5" - dependencies: - hash-base: ^3.0.0 - inherits: ^2.0.1 - safe-buffer: ^5.1.2 - checksum: 098494d885684bcc4f92294b18ba61b7bd353c23147fbc4688c75b45cb8590f5a95fd4584d742415dcc52487f7a1ef6ea611cfa1543b0dc4492fe026357f3f0c - languageName: node - linkType: hard - "meow@npm:^8.0.0": version: 8.1.2 resolution: "meow@npm:8.1.2" @@ -7863,18 +7396,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"miller-rabin@npm:^4.0.0": - version: 4.0.1 - resolution: "miller-rabin@npm:4.0.1" - dependencies: - bn.js: ^4.0.0 - brorand: ^1.0.1 - bin: - miller-rabin: bin/miller-rabin - checksum: 00cd1ab838ac49b03f236cc32a14d29d7d28637a53096bf5c6246a032a37749c9bd9ce7360cbf55b41b89b7d649824949ff12bc8eee29ac77c6b38eada619ece - languageName: node - linkType: hard - "mime-db@npm:1.52.0": version: 1.52.0 resolution: "mime-db@npm:1.52.0" @@ -7905,20 +7426,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"minimalistic-assert@npm:^1.0.0, minimalistic-assert@npm:^1.0.1": - version: 1.0.1 - resolution: "minimalistic-assert@npm:1.0.1" - checksum: cc7974a9268fbf130fb055aff76700d7e2d8be5f761fb5c60318d0ed010d839ab3661a533ad29a5d37653133385204c503bfac995aaa4236f4e847461ea32ba7 - languageName: node - linkType: hard - -"minimalistic-crypto-utils@npm:^1.0.1": - version: 1.0.1 - resolution: "minimalistic-crypto-utils@npm:1.0.1" - checksum: 6e8a0422b30039406efd4c440829ea8f988845db02a3299f372fceba56ffa94994a9c0f2fd70c17f9969eedfbd72f34b5070ead9656a34d3f71c0bd72583a0ed - languageName: node - linkType: hard - "minimatch@npm:^3.0.4": version: 3.1.2 resolution: "minimatch@npm:3.1.2" @@ -8041,10 +7548,10 @@ fsevents@^2.3.2: languageName: node linkType: hard -"mock-socket@npm:^9.1.5": - version: 9.1.5 - resolution: "mock-socket@npm:9.1.5" - checksum: a01586bc2850eb5809eda6de0c7ab19255c1e0eb217a805f86ba662bb4aab00b919032d67e7c826c6c12bcfb2fbe19cecbacf0ab6184936487edc4ba37d3ba53 +"mock-socket@npm:^9.2.1": + version: 9.2.1 + resolution: "mock-socket@npm:9.2.1" + checksum: daf07689563163dbcefbefe23b2a9784a75d0af31706f23ad535c6ab2abbcdefa2e91acddeb50a3c39009139e47a8f909cbb38e8137452193ccb9331637fee3e languageName: node linkType: hard @@ -8099,22 +7606,15 @@ fsevents@^2.3.2: languageName: node linkType: hard -"next-tick@npm:^1.1.0": - version: 1.1.0 - resolution: "next-tick@npm:1.1.0" - checksum: 83b5cf36027a53ee6d8b7f9c0782f2ba87f4858d977342bfc3c20c21629290a2111f8374d13a81221179603ffc4364f38374b5655d17b6a8f8a8c77bdea4fe8b - languageName: node - linkType: hard - -"nock@npm:^13.2.9": - version: 13.2.9 - resolution: "nock@npm:13.2.9" +"nock@npm:^13.3.1": + version: 13.3.1 + resolution: "nock@npm:13.3.1" dependencies: debug: ^4.1.0 json-stringify-safe: ^5.0.1 lodash: ^4.17.21 propagate: ^2.0.0 - checksum: 04a2dc60b4b55fd1240f28fe34865bbc744088a4570db3781fcf66021644cc3cc9178fd86a0cb0c1f28ea77b83e8f1c9288535f6b39a6d07100059f156ccc23b + checksum: 0f2a73e8432f6b5650656c53eef99f9e5bbde3df538dc2f07057edc4438cfc61a394c9d06dd82e60f6e86d42433f20f3c04364a1f088beee7bf03a24e3f0fdd0 languageName: node linkType: hard @@ -8139,14 +7639,14 @@ fsevents@^2.3.2: languageName: node linkType: hard -"node-fetch@npm:^3.3.0": - version: 3.3.0 - resolution: "node-fetch@npm:3.3.0" +"node-fetch@npm:^3.3.1": + version: 3.3.1 + resolution: "node-fetch@npm:3.3.1" dependencies: data-uri-to-buffer: ^4.0.0 fetch-blob: ^3.1.4 formdata-polyfill: ^4.0.10 - checksum: e9936908d2783d3c48a038e187f8062de294d75ef43ec8ab812d7cbd682be2b67605868758d2e9cad6103706dcfe4a9d21d78f6df984e8edf10e7a5ce2e665f8 + checksum: 62145fd3ba4770a76110bc31fdc0054ab2f5442b5ce96e9c4b39fc9e94a3d305560eec76e1165d9259eab866e02a8eecf9301062bb5dfc9f08a4d08b69d223dd languageName: node linkType: hard @@ -8202,13 +7702,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"nofilter@npm:^3.1.0": - version: 3.1.0 - resolution: "nofilter@npm:3.1.0" - checksum: 58aa85a5b4b35cbb6e42de8a8591c5e338061edc9f3e7286f2c335e9e9b9b8fa7c335ae45daa8a1f3433164dc0b9a3d187fa96f9516e04a17a1f9ce722becc4f - languageName: node - linkType: hard - "nopt@npm:^5.0.0": version: 5.0.0 resolution: "nopt@npm:5.0.0" @@ -8398,7 +7891,7 @@ fsevents@^2.3.2: languageName: node linkType: hard -"p-limit@npm:^2.0.0, p-limit@npm:^2.2.0": +"p-limit@npm:^2.2.0": version: 2.3.0 resolution: "p-limit@npm:2.3.0" dependencies: @@ -8425,15 +7918,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"p-locate@npm:^3.0.0": - version: 3.0.0 - resolution: "p-locate@npm:3.0.0" - dependencies: - p-limit: ^2.0.0 - checksum: 83991734a9854a05fe9dbb29f707ea8a0599391f52daac32b86f08e21415e857ffa60f0e120bfe7ce0cc4faf9274a50239c7895fc0d0579d08411e513b83a4ae - languageName: node - linkType: hard - "p-locate@npm:^4.1.0": version: 4.1.0 resolution: "p-locate@npm:4.1.0" @@ -8491,19 +7975,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"parse-asn1@npm:^5.0.0, parse-asn1@npm:^5.1.5": - version: 5.1.6 - resolution: "parse-asn1@npm:5.1.6" - dependencies: - asn1.js: ^5.2.0 - browserify-aes: ^1.0.0 - evp_bytestokey: ^1.0.0 - pbkdf2: ^3.0.3 - safe-buffer: ^5.1.1 - checksum: 9243311d1f88089bc9f2158972aa38d1abd5452f7b7cabf84954ed766048fe574d434d82c6f5a39b988683e96fb84cd933071dda38927e03469dc8c8d14463c7 - languageName: node - linkType: hard - "parse-json@npm:^5.0.0, parse-json@npm:^5.2.0": version: 5.2.0 resolution: "parse-json@npm:5.2.0" @@ -8565,19 +8036,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"pbkdf2@npm:^3.0.3": - version: 3.1.2 - resolution: "pbkdf2@npm:3.1.2" - 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 - checksum: 2c950a100b1da72123449208e231afc188d980177d021d7121e96a2de7f2abbc96ead2b87d03d8fe5c318face097f203270d7e27908af9f471c165a4e8e69c92 - languageName: node - linkType: hard - "performance-now@npm:^2.1.0": version: 2.1.0 resolution: "performance-now@npm:2.1.0" @@ -8599,29 +8057,13 @@ fsevents@^2.3.2: languageName: node linkType: hard -"pify@npm:^4.0.1": - version: 4.0.1 - resolution: "pify@npm:4.0.1" - checksum: 9c4e34278cb09987685fa5ef81499c82546c033713518f6441778fbec623fc708777fe8ac633097c72d88470d5963094076c7305cafc7ad340aae27cfacd856b - languageName: node - linkType: hard - -"pirates@npm:^4.0.4, pirates@npm:^4.0.5": +"pirates@npm:^4.0.4": version: 4.0.5 resolution: "pirates@npm:4.0.5" checksum: c9994e61b85260bec6c4fc0307016340d9b0c4f4b6550a957afaaff0c9b1ad58fbbea5cfcf083860a25cb27a375442e2b0edf52e2e1e40e69934e08dcc52d227 languageName: node linkType: hard -"pkg-dir@npm:^3.0.0": - version: 3.0.0 - resolution: "pkg-dir@npm:3.0.0" - dependencies: - find-up: ^3.0.0 - checksum: 70c9476ffefc77552cc6b1880176b71ad70bfac4f367604b2b04efd19337309a4eec985e94823271c7c0e83946fa5aeb18cd360d15d10a5d7533e19344bfa808 - languageName: node - linkType: hard - "pkg-dir@npm:^4.2.0": version: 4.2.0 resolution: "pkg-dir@npm:4.2.0" @@ -8708,13 +8150,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"process@npm:^0.11.10": - version: 0.11.10 - resolution: "process@npm:0.11.10" - checksum: bfcce49814f7d172a6e6a14d5fa3ac92cc3d0c3b9feb1279774708a719e19acd673995226351a082a9ae99978254e320ccda4240ddc474ba31a76c79491ca7c3 - languageName: node - linkType: hard - "progress@npm:^2.0.0": version: 2.0.3 resolution: "progress@npm:2.0.3" @@ -8766,23 +8201,9 @@ fsevents@^2.3.2: linkType: hard "psl@npm:^1.1.28, psl@npm:^1.1.33": - version: 1.8.0 - resolution: "psl@npm:1.8.0" - checksum: 6150048ed2da3f919478bee8a82f3828303bc0fc730fb015a48f83c9977682c7b28c60ab01425a72d82a2891a1681627aa530a991d50c086b48a3be27744bde7 - languageName: node - linkType: hard - -"public-encrypt@npm:^4.0.0": - version: 4.0.3 - resolution: "public-encrypt@npm:4.0.3" - dependencies: - bn.js: ^4.1.0 - browserify-rsa: ^4.0.0 - create-hash: ^1.1.0 - parse-asn1: ^5.0.0 - randombytes: ^2.0.1 - safe-buffer: ^5.1.2 - checksum: 215d446e43cef021a20b67c1df455e5eea134af0b1f9b8a35f9e850abf32991b0c307327bc5b9bc07162c288d5cdb3d4a783ea6c6640979ed7b5017e3e0c9935 + version: 1.9.0 + resolution: "psl@npm:1.9.0" + checksum: 20c4277f640c93d393130673f392618e9a8044c6c7bf61c53917a0fddb4952790f5f362c6c730a9c32b124813e173733f9895add8d26f566ed0ea0654b2e711d languageName: node linkType: hard @@ -8796,13 +8217,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"punycode@npm:1.3.2": - version: 1.3.2 - resolution: "punycode@npm:1.3.2" - checksum: b8807fd594b1db33335692d1f03e8beeddde6fda7fbb4a2e32925d88d20a3aa4cd8dcc0c109ccaccbd2ba761c208dfaaada83007087ea8bfb0129c9ef1b99ed6 - languageName: node - linkType: hard - "punycode@npm:^2.1.0, punycode@npm:^2.1.1": version: 2.1.1 resolution: "punycode@npm:2.1.1" @@ -8824,13 +8238,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"querystring@npm:0.2.0": - version: 0.2.0 - resolution: "querystring@npm:0.2.0" - checksum: 8258d6734f19be27e93f601758858c299bdebe71147909e367101ba459b95446fbe5b975bf9beb76390156a592b6f4ac3a68b6087cea165c259705b8b4e56a69 - languageName: node - linkType: hard - "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -8845,7 +8252,7 @@ fsevents@^2.3.2: languageName: node linkType: hard -"randombytes@npm:^2.0.0, randombytes@npm:^2.0.1, randombytes@npm:^2.0.5, randombytes@npm:^2.1.0": +"randombytes@npm:^2.1.0": version: 2.1.0 resolution: "randombytes@npm:2.1.0" dependencies: @@ -8854,16 +8261,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"randomfill@npm:^1.0.3": - version: 1.0.4 - resolution: "randomfill@npm:1.0.4" - dependencies: - randombytes: ^2.0.5 - safe-buffer: ^5.1.0 - checksum: 33734bb578a868d29ee1b8555e21a36711db084065d94e019a6d03caa67debef8d6a1bfd06a2b597e32901ddc761ab483a85393f0d9a75838f1912461d4dbfc7 - languageName: node - linkType: hard - "rdf-canonize@npm:^1.0.2": version: 1.2.0 resolution: "rdf-canonize@npm:1.2.0" @@ -9182,16 +8579,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"ripemd160@npm:^2.0.0, ripemd160@npm:^2.0.1": - version: 2.0.2 - resolution: "ripemd160@npm:2.0.2" - dependencies: - hash-base: ^3.0.0 - inherits: ^2.0.1 - checksum: 006accc40578ee2beae382757c4ce2908a826b27e2b079efdcd2959ee544ddf210b7b5d7d5e80467807604244e7388427330f5c6d4cd61e6edaddc5773ccc393 - languageName: node - linkType: hard - "root-workspace-0b6124@workspace:.": version: 0.0.0-use.local resolution: "root-workspace-0b6124@workspace:." @@ -9234,16 +8621,16 @@ fsevents@^2.3.2: languageName: node linkType: hard -"rxjs@npm:^7.6.0": - version: 7.6.0 - resolution: "rxjs@npm:7.6.0" +"rxjs@npm:^7.8.1": + version: 7.8.1 + resolution: "rxjs@npm:7.8.1" dependencies: tslib: ^2.1.0 - checksum: b3abbbfe1ddfd06fca9314b83cbd13bcddc3320429218136f75c79a4802ac430dd13873364aac1ded54fd457f8c77df332d205a92d8a1c61656565bb718c50af + checksum: de4b53db1063e618ec2eca0f7965d9137cabe98cf6be9272efe6c86b47c17b987383df8574861bcced18ebd590764125a901d5506082be84a8b8e364bf05f119 languageName: node linkType: hard -"safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.1, safe-buffer@npm:^5.1.2, safe-buffer@npm:^5.2.0, safe-buffer@npm:~5.2.0": +"safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.2, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 @@ -9305,7 +8692,7 @@ fsevents@^2.3.2: languageName: node linkType: hard -"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.6.0": +"semver@npm:2 || 3 || 4 || 5": version: 5.7.1 resolution: "semver@npm:5.7.1" bin: @@ -9368,18 +8755,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"sha.js@npm:^2.4.0, sha.js@npm:^2.4.8": - version: 2.4.11 - resolution: "sha.js@npm:2.4.11" - dependencies: - inherits: ^2.0.1 - safe-buffer: ^5.0.1 - bin: - sha.js: ./bin.js - checksum: ebd3f59d4b799000699097dadb831c8e3da3eb579144fd7eb7a19484cbcbb7aca3c68ba2bb362242eb09e33217de3b4ea56e4678184c334323eca24a58e3ad07 - languageName: node - linkType: hard - "shallow-clone@npm:^3.0.0": version: 3.0.1 resolution: "shallow-clone@npm:3.0.1" @@ -9466,6 +8841,16 @@ fsevents@^2.3.2: languageName: node linkType: hard +"smoldot@npm:1.0.4": + version: 1.0.4 + resolution: "smoldot@npm:1.0.4" + dependencies: + pako: ^2.0.4 + ws: ^8.8.1 + checksum: 81ecc38b98f7ac4dd093753e85956262608dca3c8a288c20a25fe1762a6afcdbe6f3622ea30a346df3f4145e0900ef0595e56e96e9e0de83c59f0649d1ab4786 + languageName: node + linkType: hard + "socks-proxy-agent@npm:^6.1.1": version: 6.1.1 resolution: "socks-proxy-agent@npm:6.1.1" @@ -9488,16 +8873,16 @@ fsevents@^2.3.2: linkType: hard "sodium-native@npm:^3.2.0": - version: 3.3.0 - resolution: "sodium-native@npm:3.3.0" + version: 3.4.1 + resolution: "sodium-native@npm:3.4.1" dependencies: node-gyp: latest node-gyp-build: ^4.3.0 - checksum: 4412bc90155261e2006c979788d3b33e3bdba1c41669c7054a876b8731a68886e1450b356791abd2c4e7b217d21f50adfdc1e194d8909dd003223195bd8ddc0a + checksum: 88f2f8c9ecb3c7952098b667ee3803f24253d72a3b3874b126e0e36b2ac20432e12ad44bde3664024e6d0ae1bc6d24fdebc81273af161e735f2eec22f10d26dd languageName: node linkType: hard -"source-map-support@npm:^0.5.16, source-map-support@npm:^0.5.6, source-map-support@npm:~0.5.20": +"source-map-support@npm:^0.5.6, source-map-support@npm:~0.5.20": version: 0.5.21 resolution: "source-map-support@npm:0.5.21" dependencies: @@ -9695,16 +9080,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"stream-browserify@npm:^3.0.0": - version: 3.0.0 - resolution: "stream-browserify@npm:3.0.0" - dependencies: - inherits: ~2.0.4 - readable-stream: ^3.5.0 - checksum: 4c47ef64d6f03815a9ca3874e2319805e8e8a85f3550776c47ce523b6f4c6cd57f40e46ec6a9ab8ad260fde61863c2718f250d3bedb3fe9052444eb9abfd9921 - languageName: node - linkType: hard - "string-length@npm:^4.0.1": version: 4.0.2 resolution: "string-length@npm:4.0.2" @@ -10215,10 +9590,10 @@ fsevents@^2.3.2: languageName: node linkType: hard -"tslib@npm:^2.1.0": - version: 2.3.1 - resolution: "tslib@npm:2.3.1" - checksum: de17a98d4614481f7fcb5cd53ffc1aaf8654313be0291e1bfaee4b4bb31a20494b7d218ff2e15017883e8ea9626599b3b0e0229c18383ba9dce89da2adf15cb9 +"tslib@npm:^2.1.0, tslib@npm:^2.5.0, tslib@npm:^2.5.2": + version: 2.5.2 + resolution: "tslib@npm:2.5.2" + checksum: 4d3c1e238b94127ed0e88aa0380db3c2ddae581dc0f4bae5a982345e9f50ee5eda90835b8bfba99b02df10a5734470be197158c36f9129ac49fdc14a6a9da222 languageName: node linkType: hard @@ -10242,13 +9617,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"tweetnacl@npm:1.x.x, tweetnacl@npm:^1.0.3": - version: 1.0.3 - resolution: "tweetnacl@npm:1.0.3" - checksum: e4a57cac188f0c53f24c7a33279e223618a2bfb5fea426231991652a13247bea06b081fd745d71291fcae0f4428d29beba1b984b1f1ce6f66b06a6d1ab90645c - languageName: node - linkType: hard - "tweetnacl@npm:^0.14.3, tweetnacl@npm:~0.14.0": version: 0.14.5 resolution: "tweetnacl@npm:0.14.5" @@ -10256,6 +9624,13 @@ fsevents@^2.3.2: languageName: node linkType: hard +"tweetnacl@npm:^1.0.3": + version: 1.0.3 + resolution: "tweetnacl@npm:1.0.3" + checksum: e4a57cac188f0c53f24c7a33279e223618a2bfb5fea426231991652a13247bea06b081fd745d71291fcae0f4428d29beba1b984b1f1ce6f66b06a6d1ab90645c + languageName: node + linkType: hard + "type-check@npm:^0.4.0, type-check@npm:~0.4.0": version: 0.4.0 resolution: "type-check@npm:0.4.0" @@ -10316,20 +9691,6 @@ fsevents@^2.3.2: languageName: node linkType: hard -"type@npm:^1.0.1": - version: 1.2.0 - resolution: "type@npm:1.2.0" - checksum: dae8c64f82c648b985caf321e9dd6e8b7f4f2e2d4f846fc6fd2c8e9dc7769382d8a52369ddbaccd59aeeceb0df7f52fb339c465be5f2e543e81e810e413451ee - languageName: node - linkType: hard - -"type@npm:^2.5.0": - version: 2.6.0 - resolution: "type@npm:2.6.0" - checksum: 80da01fcc0f6ed5a253dc326530e134000a8f66ea44b6d9687cde2f894f0d0b2486595b0cd040a64f7f79dc3120784236f8c9ef667a8aef03984e049b447cfb4 - languageName: node - linkType: hard - "typedarray-to-buffer@npm:^3.1.5": version: 3.1.5 resolution: "typedarray-to-buffer@npm:3.1.5" @@ -10485,26 +9846,6 @@ typescript@^4.8.3: languageName: node linkType: hard -"url@npm:^0.11.0": - version: 0.11.0 - resolution: "url@npm:0.11.0" - dependencies: - punycode: 1.3.2 - querystring: 0.2.0 - checksum: 50d100d3dd2d98b9fe3ada48cadb0b08aa6be6d3ac64112b867b56b19be4bfcba03c2a9a0d7922bfd7ac17d4834e88537749fe182430dfd9b68e520175900d90 - languageName: node - linkType: hard - -"utf-8-validate@npm:^5.0.2": - version: 5.0.9 - resolution: "utf-8-validate@npm:5.0.9" - dependencies: - node-gyp: latest - node-gyp-build: ^4.3.0 - checksum: 90117f1b65e0a1256c83dfad529983617263b622f2379745311d0438c7ea31db0d134ebd0dca84c3f5847a3560a3d249644e478a9109c616f63c7ea19cac53dc - languageName: node - linkType: hard - "util-deprecate@npm:^1.0.1, util-deprecate@npm:~1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" @@ -10512,20 +9853,6 @@ typescript@^4.8.3: languageName: node linkType: hard -"util@npm:^0.12.4": - version: 0.12.4 - resolution: "util@npm:0.12.4" - dependencies: - inherits: ^2.0.3 - is-arguments: ^1.0.4 - is-generator-function: ^1.0.7 - is-typed-array: ^1.1.3 - safe-buffer: ^5.1.2 - which-typed-array: ^1.1.2 - checksum: 8eac7a6e6b341c0f1b3eb73bbe5dfcae31a7e9699c8fc3266789f3e95f7637946a7700dcf1904dbd3749a58a36760ebf7acf4bb5b717f7468532a8a79f44eff0 - languageName: node - linkType: hard - "uuid@npm:^3.3.2": version: 3.4.0 resolution: "uuid@npm:3.4.0" @@ -10774,20 +10101,6 @@ typescript@^4.8.3: languageName: node linkType: hard -"websocket@npm:^1.0.34": - version: 1.0.34 - resolution: "websocket@npm:1.0.34" - 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 - checksum: 8a0ce6d79cc1334bb6ea0d607f0092f3d32700b4dd19e4d5540f2a85f3b50e1f8110da0e4716737056584dde70bbebcb40bbd94bbb437d7468c71abfbfa077d8 - languageName: node - linkType: hard - "whatwg-encoding@npm:^1.0.5": version: 1.0.5 resolution: "whatwg-encoding@npm:1.0.5" @@ -10852,20 +10165,6 @@ typescript@^4.8.3: languageName: node linkType: hard -"which-typed-array@npm:^1.1.2": - version: 1.1.7 - resolution: "which-typed-array@npm:1.1.7" - dependencies: - available-typed-arrays: ^1.0.5 - call-bind: ^1.0.2 - es-abstract: ^1.18.5 - foreach: ^2.0.5 - has-tostringtag: ^1.0.0 - is-typed-array: ^1.1.7 - checksum: 147837cf5866e36b6b2e427731709e02f79f1578477cbde68ed773a5307520a6cb6836c73c79c30690a473266ee59010b83b6d9b25d8d677a40ff77fb37a8a84 - languageName: node - linkType: hard - "which@npm:^2.0.1, which@npm:^2.0.2": version: 2.0.2 resolution: "which@npm:2.0.2" @@ -10963,18 +10262,18 @@ typescript@^4.8.3: languageName: node linkType: hard -"ws@npm:^8.8.1": - version: 8.8.1 - resolution: "ws@npm:8.8.1" +"ws@npm:^8.13.0, ws@npm:^8.8.1": + version: 8.13.0 + resolution: "ws@npm:8.13.0" peerDependencies: bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 + utf-8-validate: ">=5.0.2" peerDependenciesMeta: bufferutil: optional: true utf-8-validate: optional: true - checksum: 2152cf862cae0693f3775bc688a6afb2e989d19d626d215e70f5fcd8eb55b1c3b0d3a6a4052905ec320e2d7734e20aeedbf9744496d62f15a26ad79cf4cf7dae + checksum: 53e991bbf928faf5dc6efac9b8eb9ab6497c69feeb94f963d648b7a3530a720b19ec2e0ec037344257e05a4f35bd9ad04d9de6f289615ffb133282031b18c61c languageName: node linkType: hard @@ -11013,13 +10312,6 @@ typescript@^4.8.3: languageName: node linkType: hard -"yaeti@npm:^0.0.6": - version: 0.0.6 - resolution: "yaeti@npm:0.0.6" - checksum: 6db12c152f7c363b80071086a3ebf5032e03332604eeda988872be50d6c8469e1f13316175544fa320f72edad696c2d83843ad0ff370659045c1a68bcecfcfea - languageName: node - linkType: hard - "yallist@npm:^3.0.2": version: 3.1.1 resolution: "yallist@npm:3.1.1" @@ -11099,9 +10391,9 @@ typescript@^4.8.3: languageName: node linkType: hard -"yargs@npm:^17.6.2": - version: 17.6.2 - resolution: "yargs@npm:17.6.2" +"yargs@npm:^17.7.2": + version: 17.7.2 + resolution: "yargs@npm:17.7.2" dependencies: cliui: ^8.0.1 escalade: ^3.1.1 @@ -11110,7 +10402,7 @@ typescript@^4.8.3: string-width: ^4.2.3 y18n: ^5.0.5 yargs-parser: ^21.1.1 - checksum: 47da1b0d854fa16d45a3ded57b716b013b2179022352a5f7467409da5a04a1eef5b3b3d97a2dfc13e8bbe5f2ffc0afe3bc6a4a72f8254e60f5a4bd7947138643 + checksum: 73b572e863aa4a8cbef323dd911d79d193b772defd5a51aab0aca2d446655216f5002c42c5306033968193bdbf892a7a4c110b0d77954a7fdf563e653967b56a languageName: node linkType: hard