-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Calculate withdrawal fees in SDK (#495)
Refs: #447 Depends on: #474 In this PR we implement withdrawal fee calculation in a way that matches the stBTC contract, where fee is calculated based on the total tBTC amount and rounded up.
- Loading branch information
Showing
16 changed files
with
584 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
import { ChainIdentifier } from "./chain-identifier" | ||
|
||
export type WithdrawalFees = { | ||
tbtc: { treasuryFee: bigint } | ||
} | ||
|
||
export interface BitcoinRedeemer { | ||
/** | ||
* @returns The chain-specific identifier of this contract. | ||
*/ | ||
getChainIdentifier(): ChainIdentifier | ||
|
||
/** | ||
* Calculates the withdrawal fee based on the provided amount. | ||
* @param amountToWithdraw Amount to withdraw in 1e18 token precision. | ||
* @returns Withdrawal fees grouped by tBTC and Acre protocols in 1e18 tBTC token | ||
* precision. | ||
*/ | ||
calculateWithdrawalFee(amountToWithdraw: bigint): Promise<WithdrawalFees> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.