import { PlatformAddress } from "../classes" ; import { Transaction } from "../Transaction" ; import { NetworkId } from "../types" ; export interface SetShardUsersActionJSON { shardId : number ; users : string [ ] ; } export class SetShardUsers extends Transaction { private readonly shardId : number ; private readonly users : PlatformAddress [ ] ; public constructor ( params , networkId ) { super ( networkId ) ; this . shardId = params . shardId ; this . users = params . users ; } public type ( ) { return "setShardUsers" ; } protected actionToEncodeObject ( ) { const { shardId , users } = this ; return [ 6 , shardId , users . map ( user => user . getAccountId ( ) . toEncodeObject ( ) ) ] ; } protected actionToJSON ( ) { const { shardId , users } = this ; return { shardId , users : users . map ( user => user . toString ( ) ) } ; } }