Add functionalities to multi-sig wallet (#3729)

* WIP Sending tokens in multi-sig wallet

* Working Token transfer for multi-sig wallet #3282

* Add operation hash to transfer modal

* Add existing wallet from address #3282

* Wallet delete redirect to Wallets/Accounts #3282

* Rightly check balance in Transfer // Get all accounts balances #3282

* Fix linting

* Better Header UI for Wallet

* Use the `~` webpack alias

* Use Webpack `~` alias
This commit is contained in:
Nicolas Gotchac
2016-12-07 12:47:44 +01:00
committed by Jaco Greeff
parent be90245ecb
commit 8dbd56888d
36 changed files with 857 additions and 322 deletions

View File

@@ -189,15 +189,21 @@ export default class Contract {
});
}
_encodeOptions (func, options, values) {
getCallData = (func, options, values) => {
let data = options.data;
const tokens = func ? this._abi.encodeTokens(func.inputParamTypes(), values) : null;
const call = tokens ? func.encodeCall(tokens) : null;
if (options.data && options.data.substr(0, 2) === '0x') {
options.data = options.data.substr(2);
if (data && data.substr(0, 2) === '0x') {
data = data.substr(2);
}
options.data = `0x${options.data || ''}${call || ''}`;
return `0x${data || ''}${call || ''}`;
}
_encodeOptions (func, options, values) {
options.data = this.getCallData(func, options, values);
return options;
}
@@ -209,10 +215,10 @@ export default class Contract {
_bindFunction = (func) => {
func.call = (options, values = []) => {
const callData = this._encodeOptions(func, this._addOptionsTo(options), values);
const callParams = this._encodeOptions(func, this._addOptionsTo(options), values);
return this._api.eth
.call(callData)
.call(callParams)
.then((encoded) => func.decodeOutput(encoded))
.then((tokens) => tokens.map((token) => token.value))
.then((returns) => returns.length === 1 ? returns[0] : returns);