import { StackItemType , toStackItemTypeJSON } from '@neo-one/client-common' ; import { BN } from 'bn.js' ; import { ContractParameter } from '../contractParameter' ; export interface StackItemAdd { readonly isNull : boolean ; readonly type : StackItemType ; } export abstract class StackItemBase { public readonly isNull : boolean ; public readonly type : StackItemType ; public constructor ( { isNull , type } ) { this . isNull = isNull ; this . type = type ; } public getBoolean ( ) { throw new Error ( `getBoolean method not implemented for ${ toStackItemTypeJSON ( this . type ) } stack item` ) ; } public getInteger ( ) { throw new Error ( `getInteger method not implemented for ${ toStackItemTypeJSON ( this . type ) } stack item` ) ; } public getInterface < T > ( _isFunc ? ) { throw new Error ( `getInterface method not implemented for ${ toStackItemTypeJSON ( this . type ) } stack item` ) ; } public getBuffer ( ) { throw new Error ( `getBuffer method not implemented for ${ toStackItemTypeJSON ( this . type ) } stack item` ) ; } public getString ( ) { return this . getBuffer ( ) . toString ( 'utf-8' ) ; } public toContractParameter ( ) { throw new Error ( `toContractParameter method not implemented for ${ toStackItemTypeJSON ( this . type ) } stack item` ) ; } }