44 TxOutputDestinationType ,
55 AddressType ,
66 TxAuxiliaryDataType , // CHECK THIS
7+ StakeCredentialParamsType ,
78} from '@cardano-foundation/ledgerjs-hw-app-cardano' ;
89import { encode } from 'borc' ;
910import blakejs from 'blakejs' ;
@@ -252,7 +253,10 @@ export const prepareLedgerCertificate = (cert: CoinSelectionCertificate) => {
252253 return {
253254 type : CERTIFICATE_TYPE [ cert . certificateType ] ,
254255 params : {
255- path : derivationPathToLedgerPath ( cert . rewardAccountPath ) ,
256+ stakeCredential : {
257+ type : StakeCredentialParamsType . KEY_PATH ,
258+ keyPath : derivationPathToLedgerPath ( cert . rewardAccountPath ) ,
259+ } ,
256260 poolKeyHashHex : cert . pool
257261 ? utils . buf_to_hex ( utils . bech32_decodeAddress ( cert . pool ) )
258262 : null ,
@@ -264,7 +268,10 @@ export const prepareLedgerWithdrawal = (
264268 withdrawal : CoinSelectionWithdrawal
265269) => {
266270 return {
267- path : derivationPathToLedgerPath ( withdrawal . derivationPath ) ,
271+ stakeCredential : {
272+ type : StakeCredentialParamsType . KEY_PATH ,
273+ keyPath : derivationPathToLedgerPath ( withdrawal . derivationPath ) ,
274+ } ,
268275 amount : withdrawal . amount . quantity . toString ( ) ,
269276 } ;
270277} ;
@@ -442,7 +449,7 @@ export const prepareLedgerOutput = (
442449 destination : {
443450 type : TxOutputDestinationType . DEVICE_OWNED ,
444451 params : {
445- type : AddressType . BASE ,
452+ type : AddressType . BASE_PAYMENT_KEY_STAKE_KEY ,
446453 params : {
447454 spendingPath : derivationPathToLedgerPath ( output . derivationPath ) ,
448455 stakingPath : utils . str_to_path ( "1852'/1815'/0'/2/0" ) ,
@@ -479,7 +486,7 @@ export const prepareLedgerAuxiliaryData = (
479486 votingPublicKeyHex : votingPubKey ,
480487 stakingPath : rewardDestinationAddress . stakingPath ,
481488 rewardsDestination : {
482- type : AddressType . REWARD ,
489+ type : AddressType . REWARD_KEY ,
483490 params : {
484491 stakingPath : rewardDestinationAddress . stakingPath ,
485492 } ,
0 commit comments