-
Notifications
You must be signed in to change notification settings - Fork 25
feat: DIP provider type definitions #743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0e2d1f9
703e087
404b68d
647a3c3
b847fb1
afd01a9
0735b8c
1973617
03e28c1
48ea1a2
0bd87b4
a76fdfb
44c92ba
b85cfb4
cd81126
6f6c964
b3b183c
207ffa9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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, | ||
| }, | ||
|
Comment on lines
+128
to
+131
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we know for sure this is going to be the runtime version with which this is released?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, we don't. The current release of KILT won't have the provider pallet deployed. The provider template runtime does. Maybe I should move these definitions to the new repo, and add it here only when it's going to be included? Otherwise it's really difficult to test this.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mhh yeah maybe this is the way then.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Metadata V15 is not out yet. V14 only exposes stuff that is directly used by the runtime. The only way to make it work would be to expose a config pallet which exposes to metadata whatever stuff it is passed to its |
||
| ] | ||
|
|
||
| // 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, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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<CompleteMerkleProof, RuntimeApiDipProofError>', | ||
| }, | ||
| }, | ||
| version: 1, | ||
| }, | ||
| ], | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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<Hash>', | ||
| accounts: 'Vec<PalletDidLookupLinkableAccountLinkableAccountId>', | ||
| shouldIncludeWeb3Name: 'bool', | ||
| }, | ||
| CompleteMerkleProof: { | ||
| root: 'MerkleRoot', | ||
| proof: 'MerkleProof', | ||
| }, | ||
| MerkleRoot: 'Hash', | ||
| MerkleProof: { | ||
| blinded: 'BlindedLeaves', | ||
| revealed: 'RevealedLeaves', | ||
| }, | ||
| BlindedLeaves: 'Vec<BlindedValue>', | ||
| BlindedValue: 'Bytes', | ||
| RevealedLeaves: 'Vec<RevealedLeaf>', | ||
| 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', | ||
| ], | ||
| }, | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.