diff --git a/packages/did/src/DidDetails/FullDidDetails.ts b/packages/did/src/DidDetails/FullDidDetails.ts index b473a67c0..e16efd87f 100644 --- a/packages/did/src/DidDetails/FullDidDetails.ts +++ b/packages/did/src/DidDetails/FullDidDetails.ts @@ -40,6 +40,7 @@ const methodMapping: Record = { 'did.submitDidCall': undefined, didLookup: 'authentication', publicCredentials: 'assertionMethod', + dipProvider: 'authentication', web3Names: 'authentication', } diff --git a/packages/type-definitions/src/index.ts b/packages/type-definitions/src/index.ts index 481a07245..dc8d7f31b 100644 --- a/packages/type-definitions/src/index.ts +++ b/packages/type-definitions/src/index.ts @@ -26,12 +26,14 @@ import { types10410 } from './types_10410.js' import { types10720 } from './types_10720.js' import { types10800 } from './types_10800.js' import { types10900 } from './types_10900.js' +import { types11200 } from './types_11200.js' // Custom runtime calls import { calls as didCalls } from './runtime/did.js' import { calls as stakingCalls } from './runtime/staking.js' import { calls as publicCredentialsCalls } from './runtime/publicCredentials.js' +import { calls as dipProviderCalls } from './runtime/dipProvider.js' export { types8, @@ -50,12 +52,13 @@ export { types10720, types10800, types10900, - types10900 as types, + types11200 as types, } export { calls as didCalls } from './runtime/did.js' export { calls as stakingCalls } from './runtime/staking.js' export { calls as publicCredentialsCalls } from './runtime/publicCredentials.js' +export { calls as dipProviderCalls } from './runtime/dipProvider.js' const defaultTypesBundle: OverrideVersionedType[] = [ { @@ -119,9 +122,13 @@ const defaultTypesBundle: OverrideVersionedType[] = [ types: types10800, }, { - minmax: [10900, undefined], + minmax: [10900, 11199], types: types10900, }, + { + minmax: [11200, undefined], + types: types11200, + }, ] // Current runtime version: 10730 @@ -148,6 +155,7 @@ export const typesBundle: OverrideBundleType = { ...didCalls, ...stakingCalls, ...publicCredentialsCalls, + ...dipProviderCalls, }, types: defaultTypesBundle, }, @@ -156,6 +164,7 @@ export const typesBundle: OverrideBundleType = { ...didCalls, ...stakingCalls, ...publicCredentialsCalls, + ...dipProviderCalls, }, types: defaultTypesBundle, }, @@ -174,6 +183,13 @@ export const typesBundle: OverrideBundleType = { }, types: defaultTypesBundle, }, + 'DIP provider dev': { + runtime: { + ...didCalls, + ...dipProviderCalls, + }, + types: defaultTypesBundle, + }, Development: { runtime: { ...didCalls, diff --git a/packages/type-definitions/src/runtime/dipProvider.ts b/packages/type-definitions/src/runtime/dipProvider.ts new file mode 100644 index 000000000..b5cb5afc2 --- /dev/null +++ b/packages/type-definitions/src/runtime/dipProvider.ts @@ -0,0 +1,29 @@ +/** + * 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. + */ + +import type { DefinitionsCall } from '@polkadot/types/types' + +export const calls: DefinitionsCall = { + DipProvider: [ + { + methods: { + generate_proof: { + description: + 'Generate a Merkle proof for the DIP protocol for the specified request parameters.', + params: [ + { + name: 'request', + type: 'DipProofRequest', + }, + ], + type: 'Result', + }, + }, + version: 1, + }, + ], +} diff --git a/packages/type-definitions/src/types_11200.ts b/packages/type-definitions/src/types_11200.ts new file mode 100644 index 000000000..9cbcf7117 --- /dev/null +++ b/packages/type-definitions/src/types_11200.ts @@ -0,0 +1,84 @@ +/** + * 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. + */ + +import type { RegistryTypes } from '@polkadot/types/types' + +import { types10900 } from './types_10900.js' + +export const types11200: RegistryTypes = { + ...types10900, + IdentityCommitmentVersion: 'u16', + // DipProvider state_call + DipProofRequest: { + identifier: 'AccountId32', + version: 'IdentityCommitmentVersion', + keys: 'Vec', + accounts: 'Vec', + shouldIncludeWeb3Name: 'bool', + }, + CompleteMerkleProof: { + root: 'MerkleRoot', + proof: 'MerkleProof', + }, + MerkleRoot: 'Hash', + MerkleProof: { + blinded: 'BlindedLeaves', + revealed: 'RevealedLeaves', + }, + BlindedLeaves: 'Vec', + BlindedValue: 'Bytes', + RevealedLeaves: 'Vec', + RevealedLeaf: { + _enum: { + DidKey: '(DidKeyMerkleKey, DidKeyMerkleValue)', + Web3Name: '(Web3NameMerkleKey, Web3NameMerkleValue)', + LinkedAccount: '(LinkedAccountMerkleKey, LinkedAccountMerkleValue)', + }, + }, + DidKeyMerkleKey: '(KeyId, KeyRelationship)', + KeyId: 'Hash', + KeyRelationship: { + _enum: { + Encryption: 'Null', + Verification: 'VerificationRelationship', + }, + }, + VerificationRelationship: { + _enum: [ + 'Authentication', + 'CapabilityDelegation', + 'CapabilityInvocation', + 'AssertionMethod', + ], + }, + DidKeyMerkleValue: 'DidDidDetailsDidPublicKeyDetails', + Web3NameMerkleKey: 'Text', + Web3NameMerkleValue: 'BlockNumber', + LinkedAccountMerkleKey: 'PalletDidLookupLinkableAccountLinkableAccountId', + LinkedAccountMerkleValue: 'Null', + RuntimeApiDipProofError: { + _enum: { + IdentityProvider: 'LinkedDidIdentityProviderError', + MerkleProof: 'DidMerkleProofError', + }, + }, + LinkedDidIdentityProviderError: { + _enum: ['DidNotFound', 'DidDeleted', 'Internal'], + }, + DidIdentityProviderError: { + _enum: ['DidNotFound', 'Internal'], + }, + DidMerkleProofError: { + _enum: [ + 'UnsupportedVersion', + 'KeyNotFound', + 'LinkedAccountNotFound', + 'Web3NameNotFound', + 'Internal', + ], + }, +}