import { protoW } from "../TransactionHelper"; import { Coin } from "./Coin"; export class MsgSend{ from_address: string; to_address: string; amount: Coin[]; constructor(from_address: string, to_address: string, amount: Coin[]){ this.from_address = from_address; this.to_address = to_address; this.amount = amount; } encode = (encoder) => { if(!encoder){ encoder = protoW.create(); } encoder.uint32(/* id 1, wireType 2 =*/10).string(this.from_address); encoder.uint32(/* id 2, wireType 2 =*/18).string(this.to_address); for (let i = 0; i < this.amount.length; ++i) { this.amount[i].encode(encoder.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim() } return encoder; } }