Skip to content

mkantautas/vue-metamask

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-metamask

vueMetaMask

Testing Metamask's status with Vue

NPM

Demo

vueMetaMask

MetaMask will introduce an optional “Privacy Mode”, which requires that dapps ask permission to view users’ accounts. Dapps should update their code to support this feature, which will be enabled by default in the future.
Reference link

NPM Install

npm i vue-metamask -S

And then import it:

<script>
    import VueMetamask from 'vue-metamask';
    export default {
        components: {
            VueMetamask,
        },
        data(){
            return {
                msg: "This is demo net work"
            }
        },
        methods:{
            onComplete(data){
                console.log('data:', data);
            }
        }
    }
</script>

Use

<template>
    <div id="demo">
        <vue-metamask 
            userMessage="msg" 
            @onComplete="onComplete"
        >
        </vue-metamask>
    </div>
</template>

Methods

data type value Functionality
userMessage ( Optional ) String Message return setting status message
onComplete Event Callback return current data


OnComplete return data

key type value Description
web3 Object function web3
metaMaskAddress String 0x09F38A7F... Metamask address
message String "message" User-defined message
type String "MAINNET" MAINNET
NO_INSTALL_METAMASK
NO_LOGIN
NETWORK_ERROR
USER_DENIED_ACCOUNT_AUTHORIZATION
netID String "1" User's current network id

License

MIT.

About

Testing Metamask's status with Vue

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 79.7%
  • JavaScript 20.3%