feat: connect example

This commit is contained in:
Nik Dement'ev 2020-11-06 18:35:44 +03:00
parent 92032962fc
commit d1aeff786f
No known key found for this signature in database
GPG Key ID: 769B05D57CF16FE2
2 changed files with 21 additions and 4 deletions

View File

@ -11,7 +11,8 @@
"dependencies": { "dependencies": {
"@nuxtjs/provider": "https://github.com/tornadocash/provider.git", "@nuxtjs/provider": "https://github.com/tornadocash/provider.git",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"nuxt": "^2.14.6" "nuxt": "^2.14.6",
"vuex": "^3.5.1"
}, },
"devDependencies": {} "devDependencies": {}
} }

View File

@ -3,14 +3,30 @@
<div> <div>
<Logo /> <Logo />
<h1 class="title"> <h1 class="title">
Example address: {{ getAddress }}
<br>
network: {{ getNetwork }}
</h1> </h1>
<button @click="handleConnectProvider">Connect</button>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default {} import { mapActions, mapGetters } from 'vuex'
export default {
computed: {
...mapGetters('provider', ['getAddress', 'getNetwork']),
},
methods: {
...mapActions('provider', ['initProvider']),
handleConnectProvider() {
this.initProvider({ name: 'metamask', network: 'mainnet' })
}
}
}
</script> </script>
<style> <style>
@ -36,7 +52,7 @@ export default {}
sans-serif; sans-serif;
display: block; display: block;
font-weight: 300; font-weight: 300;
font-size: 100px; font-size: 32px;
color: #35495e; color: #35495e;
letter-spacing: 1px; letter-spacing: 1px;
} }