es/contract/aci.js
function validate (type, value) {
  const { t } = readType(type)
  if (value === undefined || value === null) return { require: true }

  switch (t) {
    case SOPHIA_TYPES.int:
      return isNaN(value) || ['boolean'].includes(typeof value)
    case SOPHIA_TYPES.bool:
      return typeof value !== 'boolean'
    case SOPHIA_TYPES.address:
      return !(value[2] === '_' && ['ak', 'ct'].includes(value.slice(0, 2)))
    default:
      return false
  }
}
function validate (type, value) {
  const { t } = readType(type)
  if (value === undefined || value === null) return { require: true }

  switch (t) {
    case SOPHIA_TYPES.int:
      return isNaN(value) || ['boolean'].includes(typeof value)
    case SOPHIA_TYPES.bool:
      return typeof value !== 'boolean'
    case SOPHIA_TYPES.address:
      return !(value[2] === '_' && ['ak', 'ct'].includes(value.slice(0, 2)))
    default:
      return false
  }
}
function validate ( type , value ) { const { t } = readType ( type ) if ( value === undefined || value === null ) return { require : true } switch ( t ) { case SOPHIA_TYPES . int : return isNaN ( value ) || [ 'boolean' ] . includes ( typeof value ) case SOPHIA_TYPES . bool : return typeof value !== 'boolean' case SOPHIA_TYPES . address : return ! ( value [ 2 ] === '_' && [ 'ak' , 'ct' ] . includes ( value . slice ( 0 , 2 ) ) ) default : return false } }
Validate argument sophia-type
@param type
@param value
@return {*}
Validate argument sophia - type