import { BinaryReader , createSerializeWire , IOHelper , Nep17TransferKeyModel } from '@neo-one/client-common' ; import { DeserializeWireBaseOptions , DeserializeWireOptions } from './Serializable' ; import { utils } from './utils' ; export class Nep17TransferKey extends Nep17TransferKeyModel { public static deserializeWireBase ( options ) { const { reader } = options ; const userScriptHash = reader . readUInt160 ( ) ; const timestampMS = reader . readUInt64LE ( ) ; const assetScriptHash = reader . readUInt160 ( ) ; const blockTransferNotificationIndex = reader . readUInt16LE ( ) ; return new this ( { userScriptHash , timestampMS , assetScriptHash , blockTransferNotificationIndex } ) ; } public static deserializeWire ( options ) { return this . deserializeWireBase ( { context : options . context , reader : new BinaryReader ( options . buffer ) } ) ; } public readonly serializeWire = createSerializeWire ( this . serializeWireBase . bind ( this ) ) ; private readonly sizeInternal = utils . lazy ( ( ) => IOHelper . sizeOfUInt160 + IOHelper . sizeOfUInt64LE + IOHelper . sizeOfUInt64LE + IOHelper . sizeOfUInt16LE ) ; public get size ( ) { return this . sizeInternal ( ) ; } public clone ( ) { return new Nep17TransferKey ( { userScriptHash : this . userScriptHash , timestampMS : this . timestampMS , assetScriptHash : this . assetScriptHash , blockTransferNotificationIndex : this . blockTransferNotificationIndex } ) ; } }