import { protoW } from "../TransactionHelper"; import { Coin } from "./Coin"; export class Fee{ amount: Coin[]; gas_limit: number; constructor(amount: Coin[], gas_limit: number){ this.amount = amount; this.gas_limit = gas_limit; } encode = (encoder) => { if(!encoder){ encoder = protoW.create(); } for (let i = 0; i < this.amount.length; ++i) { this.amount[i].encode(encoder.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim() } encoder.uint32(/* id 2, wireType 0 =*/16).uint64(this.gas_limit); return encoder; } }