@@ -231,25 +231,15 @@ export const mapCertificate = (
231
231
: Cardano . CertificateType . Unregistration ,
232
232
cert_index : certModel . cert_index ,
233
233
deposit : BigInt ( certModel . deposit ) ,
234
- stakeCredential : {
235
- hash : Cardano . RewardAccount . toHash (
236
- Cardano . RewardAccount ( certModel . address )
237
- ) as unknown as Crypto . Hash28ByteBase16 ,
238
- type : Cardano . CredentialType . KeyHash
239
- }
234
+ stakeCredential : Cardano . Address . fromBech32 ( certModel . address ) . asReward ( ) ! . getPaymentCredential ( )
240
235
} as WithCertIndex < Cardano . NewStakeAddressCertificate > ;
241
236
242
237
if ( isDelegationCertModel ( certModel ) )
243
238
return {
244
239
__typename : Cardano . CertificateType . StakeDelegation ,
245
240
cert_index : certModel . cert_index ,
246
241
poolId : certModel . pool_id as unknown as Cardano . PoolId ,
247
- stakeCredential : {
248
- hash : Cardano . RewardAccount . toHash (
249
- Cardano . RewardAccount ( certModel . address )
250
- ) as unknown as Crypto . Hash28ByteBase16 ,
251
- type : Cardano . CredentialType . KeyHash
252
- }
242
+ stakeCredential : Cardano . Address . fromBech32 ( certModel . address ) . asReward ( ) ! . getPaymentCredential ( )
253
243
} as WithCertIndex < Cardano . StakeDelegationCertificate > ;
254
244
255
245
if ( isDrepRegistrationCertModel ( certModel ) )
@@ -292,12 +282,7 @@ export const mapCertificate = (
292
282
__typename : Cardano . CertificateType . VoteDelegation ,
293
283
cert_index : certModel . cert_index ,
294
284
dRep : mapDrepDelegation ( certModel ) ,
295
- stakeCredential : {
296
- hash : Cardano . RewardAccount . toHash (
297
- Cardano . RewardAccount ( certModel . address )
298
- ) as unknown as Crypto . Hash28ByteBase16 ,
299
- type : Cardano . CredentialType . KeyHash
300
- }
285
+ stakeCredential : Cardano . Address . fromBech32 ( certModel . address ) . asReward ( ) ! . getPaymentCredential ( )
301
286
} ;
302
287
303
288
if ( isVoteRegistrationDelegationCertModel ( certModel ) )
@@ -306,12 +291,7 @@ export const mapCertificate = (
306
291
cert_index : certModel . cert_index ,
307
292
dRep : mapDrepDelegation ( certModel ) ,
308
293
deposit : BigInt ( certModel . deposit ) ,
309
- stakeCredential : {
310
- hash : Cardano . RewardAccount . toHash (
311
- Cardano . RewardAccount ( certModel . address )
312
- ) as unknown as Crypto . Hash28ByteBase16 ,
313
- type : Cardano . CredentialType . KeyHash
314
- }
294
+ stakeCredential : Cardano . Address . fromBech32 ( certModel . address ) . asReward ( ) ! . getPaymentCredential ( )
315
295
} ;
316
296
317
297
if ( isStakeVoteDelegationCertModel ( certModel ) )
@@ -320,12 +300,7 @@ export const mapCertificate = (
320
300
cert_index : certModel . cert_index ,
321
301
dRep : mapDrepDelegation ( certModel ) ,
322
302
poolId : certModel . pool_id as unknown as Cardano . PoolId ,
323
- stakeCredential : {
324
- hash : Cardano . RewardAccount . toHash (
325
- Cardano . RewardAccount ( certModel . address )
326
- ) as unknown as Crypto . Hash28ByteBase16 ,
327
- type : Cardano . CredentialType . KeyHash
328
- }
303
+ stakeCredential : Cardano . Address . fromBech32 ( certModel . address ) . asReward ( ) ! . getPaymentCredential ( )
329
304
} ;
330
305
331
306
if ( isStakeRegistrationDelegationCertModel ( certModel ) )
@@ -334,12 +309,7 @@ export const mapCertificate = (
334
309
cert_index : certModel . cert_index ,
335
310
deposit : BigInt ( certModel . deposit ) ,
336
311
poolId : certModel . pool_id as unknown as Cardano . PoolId ,
337
- stakeCredential : {
338
- hash : Cardano . RewardAccount . toHash (
339
- Cardano . RewardAccount ( certModel . address )
340
- ) as unknown as Crypto . Hash28ByteBase16 ,
341
- type : Cardano . CredentialType . KeyHash
342
- }
312
+ stakeCredential : Cardano . Address . fromBech32 ( certModel . address ) . asReward ( ) ! . getPaymentCredential ( )
343
313
} ;
344
314
345
315
if ( isStakeVoteRegistrationDelegationCertModel ( certModel ) )
@@ -349,12 +319,7 @@ export const mapCertificate = (
349
319
dRep : mapDrepDelegation ( certModel ) ,
350
320
deposit : BigInt ( certModel . deposit ) ,
351
321
poolId : certModel . pool_id as unknown as Cardano . PoolId ,
352
- stakeCredential : {
353
- hash : Cardano . RewardAccount . toHash (
354
- Cardano . RewardAccount ( certModel . address )
355
- ) as unknown as Crypto . Hash28ByteBase16 ,
356
- type : Cardano . CredentialType . KeyHash
357
- }
322
+ stakeCredential : Cardano . Address . fromBech32 ( certModel . address ) . asReward ( ) ! . getPaymentCredential ( )
358
323
} ;
359
324
360
325
if ( isAuthorizeCommitteeHotCertModel ( certModel ) )
0 commit comments