Copy contract ABI

This commit is contained in:
Victor Baranov 2018-12-21 00:22:50 +03:00
parent afa4bce5c8
commit 43cb6a2762
1 changed files with 14 additions and 0 deletions

View File

@ -287,6 +287,19 @@ class AccountDropdowns extends Component {
},
'Copy address to clipboard',
),
ifContractAcc(keyring) ? h(
DropdownMenuItem,
{
closeMenu: () => {},
onClick: async () => {
const { selected } = this.props
const contractProps = await this.props.actions.getContract(selected)
const abi = contractProps && contractProps.abi
copyToClipboard(JSON.stringify(abi))
},
},
'Copy ABI to clipboard',
) : null,
(!this.ifHardwareAcc(selected) && !(ifContractAcc(keyring))) ? h(
DropdownMenuItem,
{
@ -390,6 +403,7 @@ const mapDispatchToProps = (dispatch) => {
showConnectHWWalletPage: () => dispatch(actions.showConnectHWWalletPage()),
showQrView: (selected, identity) => dispatch(actions.showQrView(selected, identity)),
showDeleteImportedAccount: (identity) => dispatch(actions.showDeleteImportedAccount(identity)),
getContract: (addr) => dispatch(actions.getContract(addr)),
},
}
}