This repository was archived by the owner on Oct 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add did rpc decorations #32
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
a0c7c71
feat: add did rpc decorations
weichweich fa994c6
chore: cleanup old types and update spec version
ntn-x2 559b4b2
Revert "chore: cleanup old types and update spec version"
ntn-x2 f77b8a6
fix typos
ntn-x2 210107d
Add runtime calls definitions
ntn-x2 d47aade
Fix types and add runtime API definitions
ntn-x2 09e0001
update @polkadot/types dependency
ntn-x2 19fdbca
improve description of state_calls
ntn-x2 781bac2
add public credentials definition (#33)
ntn-x2 06538df
Update RPC descriptions
ntn-x2 0964001
Fix type for attester in PublicCredentialFilter
ntn-x2 11eb4f8
feat: add definitions for DID RPC
ntn-x2 658ff46
remove support for public credentials from
ntn-x2 63a5584
Add trailing new line
ntn-x2 640feba
chore: remove support for Ethereum account linking
ntn-x2 85d98d1
chore: adjust runtime version to match new types
ntn-x2 df9ff64
Update @polkadot dependencies to 0.9.3 to support new AccountId33 type
ntn-x2 526f627
Replace Text with AccountId3{2,3} for DidVerificationKey type
ntn-x2 85d1f8c
Rename RPC types to avoid type conflict issues
ntn-x2 0c595bd
Change encryption key type to also be base58-encoded
ntn-x2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,23 @@ | ||
| { | ||
| "name": "@kiltprotocol/type-definitions", | ||
| "repository": "https://github.com/kiltprotocol/type-definitions", | ||
| "description": "polkadot js type definitions for kilt", | ||
| "description": "Type decorations for the KILT blockchain.", | ||
| "main": "./lib/index.js", | ||
| "files": [ | ||
| "/lib" | ||
| ], | ||
| "license": "BSD-4-Clause", | ||
| "scripts": { | ||
| "build": "tsc", | ||
| "generate-types": "ts-node scripts/generate-types.ts" | ||
| "build": "tsc" | ||
| }, | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "bugs": "https://github.com/KILTprotocol/type-definitions/issues", | ||
| "homepage": "https://github.com/KILTprotocol/type-definitions#readme", | ||
| "devDependencies": { | ||
| "@polkadot/types": "^5.3.1", | ||
| "ts-node": "^10.2.1", | ||
| "@polkadot/types": "^9.1.1", | ||
| "typescript": "^4.3.5" | ||
| }, | ||
| "version": "0.1.23" | ||
| "version": "0.2.0" | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import type { | ||
| DefinitionRpc, DefinitionRpcSub | ||
| } from "@polkadot/types/types" | ||
|
|
||
| const rpc: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>> = { | ||
| did: { | ||
| query: { | ||
| description: "Return the DID information linked to the provided DID identifier, if found.", | ||
| params: [ | ||
| { | ||
| name: "did", | ||
| type: "AccountId32", | ||
| }, | ||
| { | ||
| name: "at", | ||
| type: "Hash", | ||
| isOptional: true, | ||
| }, | ||
| ], | ||
| type: "Option<DidLinkedInfo>" | ||
| }, | ||
| queryByWeb3Name: { | ||
| description: "Return the DID information linked to the provided web3name, if found.", | ||
| params: [ | ||
| { | ||
| name: "name", | ||
| type: "String", | ||
| }, | ||
| { | ||
| name: "at", | ||
| type: "Hash", | ||
| isOptional: true, | ||
| }, | ||
| ], | ||
| type: "Option<DidLinkedInfo>" | ||
| }, | ||
| queryByAccount: { | ||
| description: "Return the DID information linked to the provided account, if found.", | ||
| params: [ | ||
| { | ||
| name: "account", | ||
| type: "AccountId32", | ||
| }, | ||
| { | ||
| name: "at", | ||
| type: "Hash", | ||
| isOptional: true, | ||
| }, | ||
| ], | ||
| type: "Option<DidLinkedInfo>" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| export default rpc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import type { | ||
| DefinitionsCall, | ||
| } from "@polkadot/types/types" | ||
|
|
||
| const runtime: DefinitionsCall = { | ||
| DidApi: [ | ||
| { | ||
| methods: { | ||
| query_did_by_w3n: { | ||
| description: "Return the information relative to the owner of the provided web3name, if any.", | ||
| params: [ | ||
| { | ||
| name: "name", | ||
| type: "Text", | ||
| }, | ||
| ], | ||
| type: "Option<RawDidLinkedInfo<AccountId32, AccountId32, AccountId32, Balance, Key, BlockNumber>>" | ||
| }, | ||
| query_did_by_account_id: { | ||
| description: "Return the information relative to the DID to which the provided account is linked, if any.", | ||
| params: [ | ||
| { | ||
| name: "account", | ||
| type: "AccountId32" | ||
| } | ||
| ], | ||
| type: "Option<RawDidLinkedInfo<AccountId32, AccountId32, AccountId32, Balance, Key, BlockNumber>>" | ||
| }, | ||
| query_did: { | ||
| description: "Return the information relative to the owner of the provided DID, if present.", | ||
| params: [ | ||
| { | ||
| name: "did", | ||
| type: "AccountId32" | ||
| } | ||
| ], | ||
| type: "Option<RawDidLinkedInfo<AccountId32, AccountId32, AccountId32, Balance, Key, BlockNumber>>" | ||
| } | ||
| }, | ||
| version: 1 | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| export default runtime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| import type { | ||
| RegistryTypes, | ||
| } from "@polkadot/types/types" | ||
|
|
||
| export const types10720: RegistryTypes = { | ||
| // DID state_call | ||
| RawDidLinkedInfo: { | ||
| identifier: "AccountId32", | ||
| accounts: "Vec<AccountId32>", | ||
| w3n: "Option<Text>", | ||
| serviceEndpoints: "Vec<RawServiceEndpoints>", | ||
| details: "RawDidDetails", | ||
| }, | ||
| RawServiceEndpoints: { | ||
| id: "Text", | ||
| serviceTypes: "Vec<Text>", | ||
| urls: "Vec<Text>" | ||
| }, | ||
| RawDidDetails: { | ||
| authenticationKey: "Hash", | ||
| keyAgreementKeys: "BTreeSet<Hash>", | ||
| delegationKey: "Option<Hash>", | ||
| attestationKey: "Option<Hash>", | ||
| publicKeys: "BTreeMap<Hash, DidDidDetailsDidPublicKeyDetails<BlockNumber>>", | ||
| lastTxCounter: "BlockNumber", | ||
| deposit: "KiltSupportDeposit<AccountId32, Balance>" | ||
| }, | ||
|
|
||
| // DID RPC | ||
| DidLinkedInfo: { | ||
| identifier: "AccountId32", | ||
| accounts: "Vec<AccountId32>", | ||
| w3n: "Option<String>", | ||
| serviceEndpoints: "Vec<RpcServiceEndpoint>", | ||
| details: "RpcDidDetails" | ||
| }, | ||
| RpcServiceEndpoint: { | ||
| id: "String", | ||
| serviceTypes: "Vec<String>", | ||
| urls: "Vec<String>" | ||
| }, | ||
| RpcDidDetails: { | ||
| authenticationKey: "Hash", | ||
| keyAgreementKeys: "BTreeSet<Hash>", | ||
| delegationKey: "Option<Hash>", | ||
| attestationKey: "Option<Hash>", | ||
| publicKeys: "BTreeMap<Hash, RpcPublicKeyDetails>", | ||
| lastTxCounter: "BlockNumber", | ||
| deposit: "KiltSupportDeposit<AccountId32, Balance>" | ||
| }, | ||
| RpcPublicKeyDetails: { | ||
| key: "RpcDidPublicKey", | ||
| blockNumber: "BlockNumber" | ||
| }, | ||
| RpcDidPublicKey: { | ||
| _enum: { | ||
| PublicVerificationKey: "RpcDidVerificationKey", | ||
| PublicEncryptionKey: "RpcDidEncryptionKey", | ||
| }, | ||
| }, | ||
| // Base58-encoded public verification key | ||
| RpcDidVerificationKey: { | ||
| _enum: { | ||
| Ed25519: "AccountId32", | ||
| Sr25519: "AccountId32", | ||
| Ecdsa: "AccountId33", | ||
| }, | ||
| }, | ||
| // Base58-encoded public encryption key | ||
| RpcDidEncryptionKey: { | ||
| _enum: { | ||
| X25519: "AccountId32", | ||
| }, | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.