Skip to content

Getter for repayment amount #78

@bonomat

Description

@bonomat

When displaying the loan details in the UI we want to show how much the user has to pay when repaying the loan.
At the moment we can only access the collateral amount but not the repayment amount.

I guess the function repayment_amount on CollateralContrtact just needs to be public for that.

baru/src/loan.rs

Lines 418 to 427 in 87b7677

fn repayment_amount<C>(&self, secp: &Secp256k1<C>) -> Result<Amount>
where
C: Verification,
{
let TxOutSecrets { value, .. } = self
.repayment_principal_output
.unblind(secp, self.repayment_principal_output_blinder)?;
Ok(Amount::from_sat(value))
}

This functionality is needed in :

comit-network/waves#242

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions