This repository was archived by the owner on Oct 10, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +86
-1
lines changed
Expand file tree Collapse file tree 4 files changed +86
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { types2700 } from "./types_2700"
1515import { types10700 } from "./types_10700"
1616
1717import runtime from "./runtime"
18+ import rpc from "./rpc"
1819
1920// Export type definitions
2021export {
@@ -37,6 +38,9 @@ export {
3738// Export runtime APIs definitions
3839export { runtime }
3940
41+ // Export custom RPC definitions
42+ export { rpc }
43+
4044// Export complete package
4145export const typeBundleForPolkadot : OverrideBundleDefinition = {
4246 types : [
@@ -93,5 +97,6 @@ export const typeBundleForPolkadot: OverrideBundleDefinition = {
9397 types : types10700 ,
9498 } ,
9599 ] ,
96- runtime : runtime
100+ runtime : runtime ,
101+ rpc : rpc
97102}
Original file line number Diff line number Diff line change 1+ import type {
2+ DefinitionRpc , DefinitionRpcSub
3+ } from "@polkadot/types/types"
4+
5+ const rpc : Record < string , Record < string , DefinitionRpc | DefinitionRpcSub > > = {
6+ credentials : {
7+ getCredential : {
8+ description : "Test" ,
9+ params : [
10+ {
11+ name : "credential_id" ,
12+ type : "Hash" ,
13+ } ,
14+ {
15+ name : "at" ,
16+ type : "Hash" ,
17+ isOptional : true ,
18+ } ,
19+ ] ,
20+ type : "Option<PublicCredentialsCredentialsCredentialEntry>"
21+ } ,
22+ getCredentials : {
23+ description : "Return all the credentials issued to the provided subject, optionally filtering with the provided logic." ,
24+ params : [
25+ {
26+ name : "subject" ,
27+ type : "String" ,
28+ } ,
29+ {
30+ name : "filter" ,
31+ type : "PublicCredentialFilter" ,
32+ isOptional : true ,
33+ } ,
34+ {
35+ name : "at" ,
36+ type : "Hash" ,
37+ isOptional : true ,
38+ } ,
39+ ] ,
40+ type : "Vec<(Hash, PublicCredentialsCredentialsCredentialEntry)>"
41+ }
42+ }
43+ }
44+
45+ export default rpc
Original file line number Diff line number Diff line change @@ -40,6 +40,33 @@ const runtime: DefinitionsCall = {
4040 version : 1
4141 }
4242 ] ,
43+ PublicCredentialsApi : [
44+ {
45+ methods : {
46+ get_credential : {
47+ description : "Test" ,
48+ params : [
49+ {
50+ name : "credentialId" ,
51+ type : "Hash" ,
52+ } ,
53+ ] ,
54+ type : "Option<PublicCredentialsCredentialsCredentialEntry>"
55+ } ,
56+ get_credentials : {
57+ description : "Test" ,
58+ params : [
59+ {
60+ name : "subject" ,
61+ type : "RuntimeCommonAssetsAssetDid" ,
62+ } ,
63+ ] ,
64+ type : "Vec<(Hash, PublicCredentialsCredentialsCredentialEntry)>"
65+ } ,
66+ } ,
67+ version : 1
68+ }
69+ ] ,
4370}
4471
4572export default runtime
Original file line number Diff line number Diff line change @@ -25,4 +25,12 @@ export const types10700: RegistryTypes = {
2525 lastTxCounter : "BlockNumber" ,
2626 deposit : "KiltSupportDeposit<AccountId32, Balance>"
2727 } ,
28+
29+ // Public credentials RPC
30+ PublicCredentialFilter : {
31+ _enum : {
32+ ctypeHash : "Hash" ,
33+ attester : "DidIdentifier" ,
34+ }
35+ }
2836}
You can’t perform that action at this time.
0 commit comments