packageDocumentation module hidden import { AbiItemModel } from './types' ; export class AbiModel { abi : any ; constructor ( mappedAbi ) { this . abi = mappedAbi ; } getMethod ( name ) { if ( this . hasMethod ( name ) ) { return this . abi . methods [ name ] ; } return false ; } getMethods ( ) { return this . abi . methods ; } getEvent ( name ) { if ( this . hasEvent ( name ) ) { return this . abi . events [ name ] ; } return false ; } getFallback ( ) { if ( this . hasFallback ( ) ) { return this . abi . fallback ; } return false ; } getReceive ( ) { if ( this . hasReceive ( ) ) { return this . abi . receive ; } return false ; } getEvents ( ) { return this . abi . events ; } getEventBySignature ( signature ) { let event ; Object . keys ( this . abi . events ) . forEach ( ( key ) => { if ( this . abi . events [ key ] . signature === signature ) { event = this . abi . events [ key ] ; } } ) ; return event ; } hasMethod ( name ) { return typeof this . abi . methods [ name ] !== 'undefined' ; } hasFallback ( ) { return typeof this . abi . fallback !== 'undefined' ; } hasReceive ( ) { return typeof this . abi . receive !== 'undefined' ; } hasEvent ( name ) { return typeof this . abi . events [ name ] !== 'undefined' ; } }