44 AddressType ,
55 TxAuxiliaryDataType , // CHECK THIS
66 StakeCredentialParamsType ,
7- GovernanceVotingRegistrationFormat ,
7+ CIP36VoteRegistrationFormat ,
88} from '@cardano-foundation/ledgerjs-hw-app-cardano' ;
99import { encode } from 'borc' ;
1010import blakejs from 'blakejs' ;
@@ -31,6 +31,8 @@ import type {
3131} from '../../../common/types/hardware-wallets.types' ;
3232import type { AddressStyle } from '../api/addresses/types' ;
3333
34+ const bs58 = require ( 'bs58' ) ;
35+
3436export const CATALYST_VOTING_REGISTRATION_TYPE = 'CATALYST_VOTING' ;
3537export type ShelleyTxInputType = {
3638 coins : number ;
@@ -175,7 +177,7 @@ export function ShelleyTxOutput(
175177 const addressBuff =
176178 addressStyle === AddressStyles . ADDRESS_SHELLEY
177179 ? utils . bech32_decodeAddress ( address )
178- : utils . base58_decode ( address ) ;
180+ : bs58 . decode ( address ) ;
179181 return encoder . pushAny ( [ addressBuff , coins ] ) ;
180182 }
181183
@@ -399,6 +401,7 @@ export const CachedDeriveXpubFactory = (
399401 const parentXpub = await deriveXpub ( derivationPath . slice ( 0 , - 1 ) , null ) ;
400402
401403 try {
404+ // @ts -ignore
402405 const parentXpubHex = utils . buf_to_hex ( parentXpub ) ;
403406 const derivedXpub = await deriveXpubChannel . request ( {
404407 parentXpubHex,
@@ -460,7 +463,7 @@ export const prepareLedgerOutput = (
460463 addressHex :
461464 addressStyle === AddressStyles . ADDRESS_SHELLEY
462465 ? utils . buf_to_hex ( utils . bech32_decodeAddress ( output . address ) )
463- : utils . buf_to_hex ( utils . base58_decode ( output . address ) ) ,
466+ : utils . buf_to_hex ( bs58 . decode ( output . address ) ) ,
464467 } ,
465468 } ,
466469 amount : output . amount . quantity . toString ( ) ,
@@ -474,9 +477,9 @@ export const prepareLedgerAuxiliaryData = (
474477
475478 if ( type === CATALYST_VOTING_REGISTRATION_TYPE ) {
476479 return {
477- type : TxAuxiliaryDataType . GOVERNANCE_VOTING_REGISTRATION ,
480+ type : TxAuxiliaryDataType . CIP36_REGISTRATION ,
478481 params : {
479- format : GovernanceVotingRegistrationFormat . CIP_15 ,
482+ format : CIP36VoteRegistrationFormat . CIP_15 ,
480483 votingPublicKeyHex : votingPubKey ,
481484 stakingPath : rewardDestinationAddress . stakingPath ,
482485 rewardsDestination : {
0 commit comments