Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from parameter should accept a wallet #2825

Closed
sshelton76 opened this issue May 18, 2019 · 2 comments
Closed

from parameter should accept a wallet #2825

sshelton76 opened this issue May 18, 2019 · 2 comments
Labels
2.x 2.0 related issues Feature Request Stale Has not received enough activity

Comments

@sshelton76
Copy link

sshelton76 commented May 18, 2019

This is a feature request. Anytime we accept an address as a "from" parameter, it would be handy if we could pass it a wallet object instead of just an address. I realize the from address is used as a lookup into a currently decrypted wallet. But the place to decrypt should be during whatever procedure we're trying to pass in the address. Otherwise we have to decrypt the wallet before calling the function and this is putting it back into the global space again.

The below is a really bad idea, but is presently the only way to handle it.

let result;
        if(window.confirm(`Would you like to send ${amount} ${symbol} to ${dest}?`)){
            try{
                let ctr = await this.XTokens[symbol];
                let fin = (await ctr.displayToRaw(amount)).toString();
                let wallet = await this.pinPrompt();
                let params = {
                    from : wallet[0].address
                }
                params.gas = await ctr.methods.transfer(dest,fin).estimateGas(params);
                console.debug("params: ",params);
                result = await ctr.methods.transfer(dest,fin).send(params);
                console.debug("result: ",result);
                window.alert(`Successfully sent ${amount} ${symbol} to ${dest}! Transaction Hash is ${result.transactionHash}`);
            }catch(err){
                window.alert(err);
            }
        }

FYI the "this.pinPrompt" prompts a user for a password, decrypts the wallet and hands back the decrypted wallet.
It would be far better if I could just hand in "wallet" and perhaps the password.

@nivida
Copy link
Contributor

nivida commented May 18, 2019

Thanks for proposing this feature.
This request will extend the already existing feature request from issue #2739.

@github-actions
Copy link

github-actions bot commented Jul 3, 2020

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment, otherwise this issue will be closed in 7 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x 2.0 related issues Feature Request Stale Has not received enough activity
Projects
None yet
Development

No branches or pull requests

2 participants