import { isStackItemType , StackItemType } from '@neo-one/client-common' ; import { AnyContractParameter , ContractParameter } from '../contractParameter' ; import { InvalidStackItemCastError } from '../errors' ; import { StackItemBase } from './StackItemBase' ; import { StackItem } from './StackItems' ; export class NullStackItem extends StackItemBase { public constructor ( ) { super ( { type : StackItemType . Any , isNull : true } ) ; } public convertTo ( type ) { if ( type === StackItemType . Any || ! isStackItemType ( type ) ) { throw new InvalidStackItemCastError ( ) ; } return this ; } public equals ( other ) { return other . isNull ; } public getBoolean ( ) { return false ; } public getInterface < T > ( ) { return undefined ; } public getString ( ) { return '' ; } public toContractParameter ( _seen = new Set ( ) ) { return new AnyContractParameter ( ) ; } }