app/scripts/createStandardProvider.js
/**
 * Converts a legacy provider into an EIP-1193-compliant standard provider
 * @param {Object} provider - Legacy provider to convert
 * @returns {Object} Standard provider
 */
Converts a legacy provider into an EIP-1193-compliant standard provider
@param {Object} provider - Legacy provider to convert
@returns {Object} Standard provider
Converts a legacy provider into an EIP - 1193 - compliant standard provider @param { Object } provider - Legacy provider to convert @returns { Object } Standard provider
function createStandardProvider (provider) {
  const standardProvider = new StandardProvider(provider)
  const sendLegacy = provider.send
  provider.send = (methodOrPayload, callbackOrArgs) => {
    if (typeof methodOrPayload === 'string' && !callbackOrArgs || Array.isArray(callbackOrArgs)) {
      return standardProvider.send(methodOrPayload, callbackOrArgs)
    }
    return sendLegacy.call(provider, methodOrPayload, callbackOrArgs)
  }
  return provider
}
function createStandardProvider ( provider ) { const standardProvider = new StandardProvider ( provider ) const sendLegacy = provider . send provider . send = ( methodOrPayload , callbackOrArgs ) => { if ( typeof methodOrPayload === 'string' && ! callbackOrArgs || Array . isArray ( callbackOrArgs ) ) { return standardProvider . send ( methodOrPayload , callbackOrArgs ) } return sendLegacy . call ( provider , methodOrPayload , callbackOrArgs ) } return provider }
Converts a legacy provider into an EIP-1193-compliant standard provider
 @param {Object} provider - Legacy provider to convert
 @returns {Object} Standard provider
Converts a legacy provider into an EIP - 1193 - compliant standard provider @param { Object } provider - Legacy provider to convert @returns { Object } Standard provider