add renderInstanceFromABI

pull/1/head
yann300 7 years ago
parent 187145ea25
commit 53d897f99b
  1. 12
      src/universal-dapp.js

@ -277,7 +277,7 @@ UniversalDApp.prototype.getBalance = function (address, cb) {
}
UniversalDApp.prototype.renderInstance = function (contract, address, contractName) {
var abi = txHelper.sortAbiFunction(contract.abi)
var abi = txHelper.sortAbiFunction(contract)
return this.renderInstanceFromABI(abi, address, contractName)
}
@ -309,22 +309,20 @@ UniversalDApp.prototype.renderInstanceFromABI = function (contractABI, address,
$(instance).toggleClass(`${css.hidesub}`)
}
var abi = txHelper.sortAbiFunction(contractABI)
instance.appendChild(title)
// Add the fallback function
var fallback = txHelper.getFallbackInterface(abi)
var fallback = txHelper.getFallbackInterface(contractABI)
if (fallback) {
instance.appendChild(this.getCallButton({
funABI: fallback,
address: address,
contractAbi: abi,
contractAbi: contractABI,
contractName: contractName
}))
}
$.each(abi, (i, funABI) => {
$.each(contractABI, (i, funABI) => {
if (funABI.type !== 'function') {
return
}
@ -332,7 +330,7 @@ UniversalDApp.prototype.renderInstanceFromABI = function (contractABI, address,
instance.appendChild(this.getCallButton({
funABI: funABI,
address: address,
contractAbi: abi,
contractAbi: contractABI,
contractName: contractName
}))
})

Loading…
Cancel
Save