@renproject/ren
Version:
Official Ren JavaScript SDK for bridging crypto assets cross-chain.
44 lines • 1.86 kB
TypeScript
import { RenVMProvider } from "@renproject/provider";
import { Chain } from "@renproject/utils";
import BigNumber from "bignumber.js";
export declare const BIP_DENOMINATOR = 10000;
/**
* GatewayFees provides the details of the fees charged by RenVM for a
* particular gateway.
*/
export interface GatewayFees {
/**
* Locking or releasing on a deposit-based chain requires a fixed fee for
* transferring the deposited amount from the gateway address to RenVM's
* current MPC-shared key (for locks), or from this key to the recipient
* for releases.
* The fixed fee is zero when moving contract-based assets like ERC20s.
*/
fixedFee: BigNumber;
/**
* The variable fee is based on the amount being transferred, represented
* in basis points (BPS) - which is 1/100 of a percentage point.
* e.g. 15 BPS represents 0.15%, or 15/10000.
*/
variableFee: number;
/**
* The minimum amount to guarantee that RenVM will process the transaction.
* Currently, it's calculated so that the transferred amount after fees is
* greater than the dust amount for each chain, but in the future may
* increase to ensure that the transaction is profitable for RenVM to
* process.
*/
minimumAmount: BigNumber;
/**
* Calculate the expected amount a user will receive if they send the
* provided input amount, after subtracting both the fixed fee and the
* variable fee.
* If the input is smaller than the minimum-amount, `0` is returned.
*/
estimateOutput: (input: BigNumber | string | number | {
amount: string;
convertUnit?: boolean;
}) => BigNumber;
}
export declare const estimateTransactionFee: (renVM: RenVMProvider, asset: string, fromChain: Chain, toChain: Chain) => Promise<GatewayFees>;
//# sourceMappingURL=fees.d.ts.map