es/contract/aci.js
function prepareArgsForEncode (aci, params) {
  if (!aci) return params
  // Validation
  const validation = aci.arguments
    .map(
      ({ type }, i) =>
        validate(type, params[i])
          ? `Argument index: ${i}, value: [${params[i]}] must be of type [${type}]`
          : false
    ).filter(e => e)
  if (validation.length) throw new Error('Validation error: ' + JSON.stringify(validation))

  return aci.arguments.map(({ type }, i) => transform(type, params[i]))
}
function prepareArgsForEncode (aci, params) {
  if (!aci) return params
  // Validation
  const validation = aci.arguments
    .map(
      ({ type }, i) =>
        validate(type, params[i])
          ? `Argument index: ${i}, value: [${params[i]}] must be of type [${type}]`
          : false
    ).filter(e => e)
  if (validation.length) throw new Error('Validation error: ' + JSON.stringify(validation))

  return aci.arguments.map(({ type }, i) => transform(type, params[i]))
}
function prepareArgsForEncode ( aci , params ) { if ( ! aci ) return params // Validation const validation = aci . arguments . map ( ( { type } , i ) => validate ( type , params [ i ] ) ? ` ${ i } ${ params [ i ] } ${ type } ` : false ) . filter ( e => e ) if ( validation . length ) throw new Error ( 'Validation error: ' + JSON . stringify ( validation ) ) return aci . arguments . map ( ( { type } , i ) => transform ( type , params [ i ] ) ) }
Validated contract call arguments using contract ACI
@function validateCallParams
@rtype (aci: Object, params: Array) => Object
@param {Object} aci Contract ACI
@param {Array} params Contract call arguments
@return {Array} Object with validation errors
Validated contract call arguments using contract ACI