@@ -80,6 +80,31 @@ export function parseGetSchemaResponse(response: LedgerResponse): Promise<[Schem
80
80
export function buildCredDefRequest ( submitterDid : Did , credDef : CredDef ) : Promise < LedgerRequest > ;
81
81
export function buildGetCredDefRequest ( submitterDid : Did | null , credDefId : CredDefId ) : Promise < LedgerRequest > ;
82
82
export function parseGetCredDefResponse ( response : LedgerResponse ) : Promise < [ CredDefId , CredDef ] > ;
83
+
84
+ // Revocation Ledger methods
85
+ export function buildRevocRegDefRequest ( submitterDid : Did , data : RevocRegDef ) : Promise < LedgerRequest > ;
86
+ export function buildGetRevocRegDefRequest ( submitterDid : Did | null , revRegId : RevRegId ) : Promise < LedgerRequest > ;
87
+ export function parseGetRevocRegDefResponse ( response : LedgerResponse ) : Promise < [ RevRegId , RevocRegDef ] > ;
88
+ export function buildRevocRegEntryRequest (
89
+ submitterDid : Did ,
90
+ revRegId : RevRegId ,
91
+ revDefType : 'CL_ACCUM' ,
92
+ value : RevocRegDelta ,
93
+ ) : Promise < LedgerRequest > ;
94
+ export function buildGetRevocRegRequest (
95
+ submitterDid : Did | null ,
96
+ revRegId : RevRegId ,
97
+ timestamp : number ,
98
+ ) : Promise < LedgerRequest > ;
99
+ export function parseGetRevocRegResponse ( response : LedgerResponse ) : Promise < [ RevRegId , RevocReg , number ] > ;
100
+ export function buildGetRevocRegDeltaRequest (
101
+ submitterDid : Did | null ,
102
+ revRegId : RevRegId ,
103
+ from : number | null ,
104
+ to : number ,
105
+ ) : Promise < LedgerRequest > ;
106
+ export function parseGetRevocRegDeltaResponse ( response : LedgerResponse ) : Promise < [ RevRegId , RevocRegDelta , number ] > ;
107
+
83
108
export function signRequest ( wh : WalletHandle , submitterDid : Did , request : LedgerRequest ) : Promise < SignedLedgerRequest > ;
84
109
export function signAndSubmitRequest (
85
110
poolHandle : PoolHandle ,
@@ -123,7 +148,19 @@ export function issuerCreateAndStoreCredentialDef(
123
148
) : Promise < [ CredDefId , CredDef ] > ;
124
149
// TODO: issuerRotateCredentialDefStart
125
150
// TODO: issuerRotateCredentialDefApply
126
- // TODO: issuerCreateAndStoreRevocReg
151
+ export function issuerCreateAndStoreRevocReg (
152
+ wh : WalletHandle ,
153
+ issuerDid : Did ,
154
+ revocDefType : 'CL_ACCUM' | null ,
155
+ tag : string ,
156
+ credDefId : CredDefId ,
157
+ config : {
158
+ issuance_type ?: 'ISSUANCE_BY_DEFAULT' | 'ISSUANCE_ON_DEMAND' ;
159
+ max_cred_num ?: number ;
160
+ } ,
161
+ tailsWriterHandle : BlobWriterHandle ,
162
+ ) : Promise < [ RevRegId , RevocRegDef , RevocRegDelta ] > ;
163
+
127
164
export function issuerCreateCredentialOffer ( wh : WalletHandle , credDefId : CredDefId ) : Promise < CredOffer > ;
128
165
export function issuerCreateCredential (
129
166
wh : WalletHandle ,
@@ -133,8 +170,17 @@ export function issuerCreateCredential(
133
170
revRegId : RevRegId | null ,
134
171
blobStorageReaderHandle : BlobStorageReaderHandle | 0 ,
135
172
) : Promise < [ Cred , CredRevocId , RevocRegDelta ] > ;
136
- // TODO: issuerRevokeCredential
137
- // TODO: issuerMergeRevocationRegistryDeltas
173
+
174
+ export function issuerRevokeCredential (
175
+ wh : WalletHandle ,
176
+ blobStorageReaderHandle : BlobStorageReaderHandle ,
177
+ revRegId : RevRegId ,
178
+ credRevocId : CredRevocId ,
179
+ ) : Promise < RevocRegDelta > ;
180
+ export function issuerMergeRevocationRegistryDeltas (
181
+ revRegDelta : RevocRegDelta ,
182
+ otherRevRegDelta : RevocRegDelta ,
183
+ ) : Promise < RevocRegDelta > ;
138
184
139
185
// ---- PROVER ---- //
140
186
export function proverCreateMasterSecret ( wh : WalletHandle , masterSecretId : string ) : Promise < string > ;
@@ -357,6 +403,21 @@ export interface CredDefConfig {
357
403
support_revocation ?: boolean ;
358
404
}
359
405
406
+ export interface RevocRegDef {
407
+ id : RevRegId ;
408
+ revocDefType : 'CL_ACCUM' ;
409
+ tag : string ;
410
+ credDefId : CredDefId ;
411
+ value : {
412
+ issuanceType : 'ISSUANCE_BY_DEFAULT' | 'ISSUANCE_ON_DEMAND' ;
413
+ maxCredNum : number ;
414
+ tailsHash : string ;
415
+ tailsLocation : string ;
416
+ publicKeys : string [ ] ;
417
+ } ;
418
+ ver : string ;
419
+ }
420
+
360
421
export interface CredOffer {
361
422
schema_id : SchemaId ;
362
423
cred_def_id : CredDefId ;
@@ -520,7 +581,22 @@ export interface Cred {
520
581
}
521
582
522
583
export type CredRevocId = string ;
523
- export type RevocRegDelta = Record < string , unknown > ;
584
+ export interface RevocRegDelta {
585
+ value : {
586
+ prevAccum : string ;
587
+ accum : string ;
588
+ issued : number [ ] ;
589
+ revoked : number [ ] ;
590
+ } ;
591
+ ver : string ;
592
+ }
593
+
594
+ export interface RevocReg {
595
+ value : {
596
+ accum : string ;
597
+ } ;
598
+ ver : string ;
599
+ }
524
600
525
601
export interface KeyConfig {
526
602
seed ?: string ;
0 commit comments