Skip to content

A basic example of an Ethereum wallet API to manage your crypto wallet

License

Notifications You must be signed in to change notification settings

wingleung/ethereum-wallet-api-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ethereum wallet API example

A basic example of an ethereum wallet API with endpoints:

  • /createWallet create an ethereum wallet
  • /getBalance checking wallet balance
  • /transaction making a transaction

Getting Started

# clone repo
git clone [email protected]:wingleung/ethereum-wallet-api-example.git
cd ethereum-wallet-api-example
# Install dependencies
npm install
# Start developing
npm run dev
# Start server
npm start

Config

{
  "port": 8080, // port to launch app to
  "bodyLimit": "1kb", // max size of request json object
  "ethereumNetwork": "" // url of your ethereum network
}

Endpoints

/createWallet

GET localhost:8080/createWallet
# response
{
  "address": CREATED_WALLET,
  "privateKey": PRIVATE_KEY
}

/getBalance/SOME_ETH_ADDRESS

GET localhost:8080/getBalance/SOME_ETH_ADDRESS
# response
{
  "ethAddress": SOME_ETH_ADDRESS,
  "balance": BALANCE
}

/transaction

POST to localhost:8080/transaction
BODY
{
	"privateKey": YOUR_PRIVATE_KEY,
	"amount": AMOUNT,
	"destination": DESTINATION_WALLET
}
# response
{
  "txHash": TRANSACTION_HASH
}

License

MIT

About

A basic example of an Ethereum wallet API to manage your crypto wallet

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published