Comments (6)
Connect with the user's Metamask
Metamask official reference
https://docs.metamask.io/guide/ethereum-provider.html#ethereum-request-args
Wallet connection request
ethereum.request({ method: 'eth_requestAccounts' })
非推奨: ethereum.enable()
STEP
- We need to create a function to see if the MetaMask Chrome extension is installed
- If MetaMask is not installed we:
- Change our connectButton to Click here to install MetaMask
- When clicking that button it should take us to a page that will allow us to install the extension
- Disable the button
- If MetaMask is installed we:
- Change our connectButton to Connect
- When clicking that button it should allow us to connect to our MetaMask wallet
- Disable the button
from community.
Get a list of authors from GraphQL
Devprotocol does not provide an interface to get a list of authors.
It is prepared in GraphQL below, so use this
https://explorer.graphql.devprotocol.xyz/
And, additional information (icons, etc.) is prepared below, so use it.
https://github.com/dev-protocol/dev-for-apps
from community.
Get a list of author properties
Process on the front side to minimize contract processing
It is prepared in GraphQL below, so use this
https://explorer.graphql.devprotocol.xyz/
from community.
Calculate the staking amount per property
Process on the front side to minimize contract processing
Staking Price / Total properties of designated Author = Staking amount per property
Give the remainder to the first property
from community.
Send to smart contract
The parameters to be sent are as follows
- User's address
- Array of "address of property to be given and staking amount of it"
from community.
Tell the front side the completion
Use it because you can notify the completion after the block is imported by dev-kit-js
.
- Regardless of contract
You can find out dev-kit-js
from the contract.ts below.
https://github.com/dev-protocol/dev-kit-js/blob/main/lib/contract.ts
from community.
Related Issues (20)
- Please invite me to the community HOT 2
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
- Please invite me to the community HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from community.