buildWalletFromHdWallet method
Implementation
@SquadronMethod()
@walletMarshaler
Future<CardanoWallet> buildWalletFromHdWallet(
@hdWalletMarshaler HdWallet hdWallet,
@networkIdMarshaler NetworkId networkId,
) async {
final firstAddressKeyPair = hdWallet.deriveAddressKeys(role: Bip32KeyRole.payment, index: 0);
final firstAddress = hdWallet.toBaseAddress(spendVerifyKey: firstAddressKeyPair.verifyKey, networkId: networkId);
final stakeAddress = hdWallet.toRewardAddress(networkId: networkId);
return CardanoWalletImpl(firstAddress: firstAddress, stakeAddress: stakeAddress, hdWallet: hdWallet);
}