NasaTeam / Nasa.js

星云链 DApp 客户端开发框架,轻量,易用 | Lightweight and friendly util library for DApp development on Nebulas Blockchain.
GNU Lesser General Public License v3.0
121 stars 8 forks source link

记录一下钱包扩展近期的更新 #17

Closed cssmagic closed 6 years ago

cssmagic commented 6 years ago

chrome-extension://gehjkhmhclgnkkhpfamakecfgakkfkco/html/welcome.html

Release Notes of NasExtWallet

0.1.4

Add feedback message for posting serialNumber to server. If serialNumber is failed to be posted to server, you should not use queryPayInfo(serialNumber) to query transaction results, please use neb.api.getTransactionReceipt instead.

After a transaction is send, there should be an feedback that if the serialNumber is posted to server successfully. Hence an attribute serialNumber_status is added to the return value for listener(serialNumber, result). the result is:

{
    "txhash": "ae41d5459fc8db5ffaee5416585e0874d2324d258258b8c59cda789a04934e1a",
    "contract_address": "",
    "error": "{\"timestamp\":1531231627789,\"status\":400,\"error\":\"Bad Request\",\"exception\":\"org.springframework.web.bind.MissingServletRequestParameterException\",\"message\":\"Required String parameter 'payId' is not present\",\"path\":\"/api/pay\"}"
}

If the error is not empty, it means that the serialNumber is not posted to the server, then you should not use nebpay.queryPayInfo.

0.1.3

Update get account address api: NasExtWallet.getUserAddress. Now you can easily get the user address.

    var userAddress;
    NasExtWallet.getUserAddress(function(addr){
        userAddress = addr;
        console.log("user address is : " + addr)
    })

Notice: How to debug with local html file

Please note that chrome extension installed from Google Web Store cannot interact with local page files by default.

If you need to test your local page files with this extension, please check the options "Allow access to file URLs" at extension setting, just copy this link to chrome address bar: chrome://extensions/?id=gehjkhmhclgnkkhpfamakecfgakkfkco