import { PlatformAddress , U64 } from "../classes" ; import { Transaction } from "../Transaction" ; import { NetworkId } from "../types" ; export interface PayActionJSON { receiver : string ; quantity : string ; } export class Pay extends Transaction { private readonly receiver : PlatformAddress ; private readonly quantity : U64 ; public constructor ( receiver , quantity , networkId ) { super ( networkId ) ; this . receiver = receiver ; this . quantity = quantity ; } public type ( ) { return "pay" ; } protected actionToEncodeObject ( ) { return [ 2 , this . receiver . getAccountId ( ) . toEncodeObject ( ) , this . quantity . toEncodeObject ( ) ] ; } protected actionToJSON ( ) { return { receiver : this . receiver . value , quantity : this . quantity . toJSON ( ) } ; } }