All Projects → nebulasio → Webextensionwallet

nebulasio / Webextensionwallet

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Webextensionwallet

Desktop
The official Musicoin Desktop Wallet Application
Stars: ✭ 112 (-34.12%)
Mutual labels:  blockchain, wallet
Atomicdex Desktop
atomicDEX Desktop app - project codename "Dextop"
Stars: ✭ 126 (-25.88%)
Mutual labels:  blockchain, wallet
Vessel
Desktop wallet for the Hive blockchain
Stars: ✭ 116 (-31.76%)
Mutual labels:  blockchain, wallet
Verge
Official Verge Core Source Code Repository 💪
Stars: ✭ 1,311 (+671.18%)
Mutual labels:  blockchain, wallet
Arcbit Ios
arcbit - iOS bitcoin wallet http://arcbit.io
Stars: ✭ 142 (-16.47%)
Mutual labels:  blockchain, wallet
Etherwalletkit
Ethereum Wallet Toolkit for iOS - You can implement an Ethereum wallet without a server and blockchain knowledge.
Stars: ✭ 96 (-43.53%)
Mutual labels:  blockchain, wallet
Libra Wallet Poc
💰POC Libra wallet
Stars: ✭ 122 (-28.24%)
Mutual labels:  blockchain, wallet
Crypto Dht
Blockchain over DHT in GO
Stars: ✭ 38 (-77.65%)
Mutual labels:  blockchain, wallet
Peatiocryptoexchange
An open-source Crypto-Currency exchange. Peatio v3.0 Coming Soon !
Stars: ✭ 141 (-17.06%)
Mutual labels:  blockchain, wallet
Alpha Wallet Ios
An advanced Ethereum mobile wallet
Stars: ✭ 140 (-17.65%)
Mutual labels:  blockchain, wallet
Trust Wallet Ios
📱 Trust - Ethereum Wallet and Web3 DApp Browser for iOS
Stars: ✭ 1,228 (+622.35%)
Mutual labels:  blockchain, wallet
Unstoppable Wallet Android
A secure and decentralized Bitcoin and other cryptocurrency wallet for Android phones. Supports Bitcoin, Ethereum, EOS, Binance Chain, Bitcoin Cash, DASH, ...
Stars: ✭ 165 (-2.94%)
Mutual labels:  blockchain, wallet
Savjeecoin
A simple blockchain in Javascript. For educational purposes only.
Stars: ✭ 1,097 (+545.29%)
Mutual labels:  blockchain, wallet
Esteem Surfer
Ecency desktop formerly known as Esteem Surfer - reimagined desktop social wallet, contribute and get rewarded (for Windows, Mac, Linux)
Stars: ✭ 100 (-41.18%)
Mutual labels:  blockchain, wallet
Coinonline
A Cryptocurrency/Blockchain wallet app based on React Native
Stars: ✭ 59 (-65.29%)
Mutual labels:  blockchain, wallet
Ddn
DDN, Data Delivery Network, a next generation blockchain system
Stars: ✭ 118 (-30.59%)
Mutual labels:  blockchain, wallet
Tiny.scatter
Scatter compatible eos injection library
Stars: ✭ 31 (-81.76%)
Mutual labels:  blockchain, wallet
Arcbit Android
arcbit - Android bitcoin wallet http://arcbit.io
Stars: ✭ 34 (-80%)
Mutual labels:  blockchain, wallet
Alpha Wallet Android
An advanced Ethereum mobile wallet
Stars: ✭ 133 (-21.76%)
Mutual labels:  blockchain, wallet
Simpleos
EOSIO Blockchain Interface & Wallet
Stars: ✭ 157 (-7.65%)
Mutual labels:  blockchain, wallet

WebExtensionWallet

1. Install

This extension is now published on Chrome web store. Wellcome to install and take a try!

We will keep improving this extension, and any suggestions are welcome!

Note: If you need to test local html files, you need to turn on the "Allow access to file URLs" option at extension management page:

2. Brief introduction of using our ExtensionWallet

(1) In tab `New-Wallet`, you can create your own wallet, and download the keystore files.
(2) In tab `Send-TX`, you can import your keystore file, and then your account will be stored within the extension.
(3) After your account keyfile is imported, you can send NAS to other account address.
(4) After a transaction is sent, you got the transaction hash shown at the bottom of extension page.
(5) Click the transaction hash in tab `Send-TX` to check transaction status
(6) Another way to check your transaction status is to copy your transaction hash to `check-TX` to view the result.

3. Instructions on how to use NasExtWallet in your webapp

Now NasExtWallet supports two different ways to communicate with Dapp page.

3.1 Using NebPay SDK

Please refer to Dapp Example SuperDictionary to learn how to use this extension.

When developing your Dapp page, you can use NebPay SDK to communicate with ExtensionWallet. Just as the example below.

To call a SmartContract through extensionWallet, you should use nebpay.call or nebpay.simulateCall to send a transaction as below:

nebPay.call(to, value, callFunction, callArgs, {
    qrcode: {
        showQRCode: true
    },
    listener: cbCallDapp //specify a listener to handle the transaction result
});

function cbCallDapp(resp){
    console.log("response: " + JSON.stringify(resp))
}
    

3.2 Using postMessage

When developing your Dapp page, you can use postMessage API to communicate with ExtensionWallet, and use window.addEventListener to listen the message answer. Just as the example below.

To call a smart contract function with extensionWallet, you should use postMessage to send a message as below:

window.postMessage({
    "target": "contentscript",
    "data":{
        "to": to,
        "value": "0",
        "contract":{  //"contract" is a parameter used to deploy a contract or call a smart contract function
            "function": func,
            "args": para
        }
    },
    "method": "neb_sendTransaction",
}, "*");

And then you need to add an eventlistener to listen the returned message.

window.addEventListener('message', function(e) {
     console.log("message received, msg.data: " + JSON.stringify(e.data));
     if(!!e.data.data.txhash){
         console.log("Transaction hash:\n" + JSON.stringify(e.data.data.txhash, null, '\t'));
     }
})

4 how to get account address

It is useful for Dapp to get the current account address in the extension. Here is the explanation on how to achieve this.

Method 1:

var userAddress;

function getUserAddress() {
    console.log("********* get account ************")
    window.postMessage({
        "target": "contentscript",
        "data":{
        },
        "method": "getAccount",
    }, "*");
}
// listen message from contentscript
window.addEventListener('message', function(e) {
    // e.detail contains the transferred data (can
    console.log("received by page:" + e + ", e.data:" + JSON.stringify(e.data));
    if (!!e.data.data && !!e.data.data.account) {
        userAddrerss = e.data.data.account;
    }
})

Method 2:

A module NasExtWallet is injected to your page if NasExtWallet is installed, then you can use the code below to get user account:

var userAddress;

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

example page

And you can use example/TestPage.html to take a test.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].