->Transfer funds. ->Recieve funds. ->Wallet & user account creation. ->Import wallet (from private key). ->Send funds to another user (from username). ->Send funds to another wallet (from wallet address). ->Balance check.
->Web3.js ->Node.js ->Express.js
This app is runs on BSC testnet as default.You need to change it in main.js
Endpoint: /api/register username : users username who wants to register password: users password who wants to register pin : 4 digit pin to secure token transfer ( decided by user while registering.)
Example Call : http://localhost:3002/api/register?username=asdas123&password=423423&pin=1234
Responses:
status: "User Registered"
err: "invalid details."
err: "username already exists."
username : users username who wants to login password: users password who wants to login
Example Call : http://localhost:3002/api/login?username=asdas123&password=423423
Response :
If login succeed :
{ username: user.username, wallet: user.wallet, accessToken: user.accessToken }
If not :
err: "invalid details."
You will use this access token as auth key.To handle transactions etc.
This action is for users who they import their account while registering. Private is needs to start with 0x this is important.The other things are same as normal register.
Example Call http://localhost:3002/api/registerWithPrivate?username=asdddd&password=423423&pin=1234&private=0xPRIVATE
status: "User Registered"
err: "invalid details."
err: "username already exists."
This action is for getting user balances.You need to specify token contract address to check.
accessToken : This is the auth key you got while users logged in.
tokenAddress : This is the contract address of the token that you want to check users balance.(Not users address you don’t need to specify users wallet address)
Pin : 4 digit user need to specify it. Amount : as WEI (not 1 for 1 token).You need to check tokens decimals If the token have 18 decimals and you want to send 1 token you need to write 10^18 as amount.(18 decimals) Token address: token contract address that you want to send. Access Token : This is the auth key you got while users logged in
Reponse : If it succeeds it will return the TX.
err: "incorrect pin"
err: "user not found."
All things are same as the previous one except you need to specify username not wallet. Username : The username that you want to send tokens.
Reponse : If it succeeds it will return the TX.
err: "incorrect pin"
err: "user not found."