import { PlatformAddress } from "codechain-primitives/lib" ; import { Transaction } from "../Transaction" ; import { NetworkId } from "../types" ; export interface CreateShardActionJSON { users : string [ ] ; } export class CreateShard extends Transaction { private readonly users : PlatformAddress [ ] ; public constructor ( params , networkId ) { throw Error ( "CreateShard is disabled" ) ; super ( networkId ) ; const { users } = params ; this . users = users ; } public type ( ) { return "createShard" ; } protected actionToEncodeObject ( ) { return [ 4 , this . users . map ( user => user . getAccountId ( ) . toEncodeObject ( ) ) ] ; } protected actionToJSON ( ) { const { users } = this ; return { users : users . map ( user => user . toString ( ) ) } ; } }