WebExtensionWallet icon indicating copy to clipboard operation
WebExtensionWallet copied to clipboard

how to get user's wallet address?

Open qazujmko opened this issue 7 years ago • 3 comments

qazujmko avatar May 08 '18 14:05 qazujmko

there is two methods for the present: 1 Set a input box on your page, and let user paste their wallet address. 2 You can get user wallet address by posting a message to webExtensionWallet. This feature is supported at the very beginning, and still reserved for now. You can learn how to use this feature from the example/example_old.html (We are planning to discard this feature and only NebPay API will be supported.)

yupnano avatar May 08 '18 14:05 yupnano

可以在自己的合约中定义函数

function whoami(){
    return Blockchain.transaction.from;
}

然后发起交易调用这个函数,即可获取自己的钱包地址。


于是,情况就变成,WebExtensionWallet明知道我的钱包地址,却不告诉我,导致我只好给服务器发交易。 所以,我认为,没必要阻止用户在本地获取自己的钱包地址,免得白白给服务器增加负担。

ladyrick avatar Jun 16 '18 09:06 ladyrick