Skip to content

wingleung/ethereum-wallet-api-example

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