Integrate Embedded Wallets with the Hedera Blockchain in Android
While using the Web3Auth Android SDK, you get the private key within the user scope after successful authorization. This private key can be used to retrieve the user's address, and interact with Hedera to make any blockchain calls. We have highlighted a few here for getting you started quickly on that.
Chain details for Hedera
- Mainnet
- Testnet
- Previewnet
- Chain ID: 0x127
- Public RPC URL: https://mainnet.hashio.io/api
- Display Name: Hedera Mainnet
- Block Explorer Link: https://hashscan.io/mainnet
- Ticker: HBAR
- Ticker Name: Hedera
- Chain ID: 0x128
- Public RPC URL: https://testnet.hashio.io/api
- Display Name: Hedera Testnet
- Block Explorer Link: https://hashscan.io/testnet
- Ticker: HBAR
- Ticker Name: Hedera
- Chain ID: 0x129
- Public RPC URL: https://previewnet.hashio.io/api
- Display Name: Hedera Previewnet
- Block Explorer Link: https://hashscan.io/previewnet
- Ticker: HBAR
- Ticker Name: Hedera
Prerequisites
This doc assumes you have already setup your project in the Embedded Wallets Dashboard (formerly Web3Auth), and have integrated Embedded Wallets in your Android app. If you haven't done that yet, you can learn how to integrate Embedded Wallets in your Android app.
Installation
To interact with Ethereum in Android, you can use any EIP1193-compatible package available for Android. Here we're using web3j to demonstrate how to make blockchain calls using it with Embedded Wallets.
dependencies {
// ...
implementation 'org.web3j:core:4.8.7-android'
}