import { DispatchInfo , ExistenceRequirement , WithdrawReasons } from "subsembly-core" ; import { AccountIdType , Balance , Weight } from "../../runtime/runtime" ; import { Balances } from "../balances/balances" ; description export class Payment { description param who param dispatchInfo param fee param tip static withdrawFee ( who , _dispatchInfo , fee , tip ) { if ( fee . eq ( instantiate < Balance > ( 0 ) ) ) { return ; } const withdrawReason = tip . eq ( instantiate < Balance > ( 0 ) ) ? WithdrawReasons . TRANSACTION_PAYMENT : WithdrawReasons . TRANSACTION_PAYMENT | WithdrawReasons . TIP ; Balances . _withdraw ( who , fee , withdrawReason , ExistenceRequirement . KeepAlive ) ; } }