Skip to content

Commit b8c4fe2

Browse files
authored
light style pass (#2551)
* light style pass & cleaning up commits * reverts cursor overreach
1 parent c5217b5 commit b8c4fe2

File tree

496 files changed

+783
-774
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

496 files changed

+783
-774
lines changed

embedded-wallets/connect-blockchain/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ image: 'img/metamaskog.jpg'
99
import EVMChains from './\_evm-chains.mdx'
1010
import OtherChains from './\_other-chains.mdx'
1111

12-
Embedded Wallets (formerly Web3Auth) is the frontend authentication system for your dApp. Once the user is authenticated, the SDK returns a way to interact with the blockchain. A provider is how libraries like web3.js & ethers.js talk to the blockchain by sending JSON-RPC requests and receiving responses.
12+
Embedded Wallets is the frontend authentication system for your dApp. Once the user is authenticated, the SDK returns a way to interact with the blockchain. A provider is how libraries like web3.js & ethers.js talk to the blockchain by sending JSON-RPC requests and receiving responses.
1313

1414
With Embedded Wallets, you can connect in two ways:
1515

@@ -22,7 +22,7 @@ The SDKs are now branded as MetaMask Embedded Wallet SDKs (formerly Web3Auth Plu
2222

2323
::::
2424

25-
## Dashboard Configuration
25+
## Dashboard configuration
2626

2727
The Embedded Wallets Web SDK (`@web3auth/modal`) from v10 onwards does not need any additional setup on the code side for blockchain connections. All of it is handled on the Dashboard. We can use any chain from the extensive list of predefined chains and add more if we need.
2828

embedded-wallets/connect-blockchain/_android-connect-blockchain/_evm-get-account.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Once user has successfully logged in, you can retrieve the user's private key using the `getPrivKey` method from the Embedded Wallets Android SDK (formerly Web3Auth). We'll use this private key to generate the Credentials for the user.
1+
Once user has successfully logged in, you can retrieve the user's private key using the `getPrivKey` method from the Embedded Wallets Android SDK. We'll use this private key to generate the Credentials for the user.
22

3-
This Credentials object has the user's key pair of private key and public key, and can be used to sign the transactions. Please note, that this assumes that the user has already logged in and the private key is available.
3+
This Credentials object has the user's keypair of private key and public key, and can be used to sign the transactions. Please note, that this assumes that the user has already logged in and the private key is available.
44

55
```kotlin
66
import org.web3j.crypto.Credentials
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
To retrieve the native balance of the user, you can use the `Web3j` instance we created earlier. It
2-
has `ethGetBalance` method which helps to fetch the user's native token balance.
2+
has `ethGetBalance` method which fetches the user's native token balance.
33

4-
The result we get from method is in wei, the smallest value. To convert the value to ether, you can
5-
divide it with 10^18, where 18 denotes the decimals for wei.
4+
The result we get from Web3Client is in wei, the smallest unit of ether. To convert wei to ether, divide by 10^18, where 18 denotes the decimals for wei.
65

76
```kotlin
87
import org.web3j.protocol.core.DefaultBlockParameterName
98

109
// Use the existing Web3j instance, and address from the previous step
1110
val balanceResponse = web3.ethGetBalance(address, DefaultBlockParameterName.LATEST).send()
1211

13-
// Convert the balance from Wei to Ether format
12+
// Convert the balance from wei to ether format
1413
val ethBalance = BigDecimal.valueOf(balanceResponse.balance.toDouble()).divide(BigDecimal.TEN.pow(18))
1514
```
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
We'll initialize the Web3j instance with the RPC URL of the network you want to connect to. This
2-
client allows us to interact with the blockchain. To get the public RPC URL, you can checkout
2+
client allows us to interact with the blockchain. To get the public RPC URL, see
33
[ChainList](https://chainlist.org/).
44

55
```kotlin
66
import org.web3j.protocol.Web3j
77
import org.web3j.protocol.http.HttpService
88

99
// Please avoid using public RPC URL in production, use services
10-
// like Infura, Quicknode, etc.
10+
// like Infura.
1111
val web3 = Web3j.build(HttpService("YOUR_RPC_URL"))
1212
```

embedded-wallets/connect-blockchain/_android-connect-blockchain/_evm-installation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
To interact with the Ethereum Compatible Blockchain in Android, you can use any [`EIP1193`](https://eips.ethereum.org/EIPS/eip-1193) compatible package available for Android. Here we're using [web3j](https://github.com/web3j/web3j) to demonstrate how to make blockchain calls using it with Embedded Wallets (formerly Web3Auth).
1+
To interact with Ethereum in Android, you can use any [`EIP1193`](https://eips.ethereum.org/EIPS/eip-1193)-compatible package available for Android. Here we're using [web3j](https://github.com/web3j/web3j) to demonstrate how to make blockchain calls using it with Embedded Wallets.
22

33
```groovy
44
dependencies {

embedded-wallets/connect-blockchain/_android-connect-blockchain/_evm-interaction.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ This doc assumes you have already setup your project in the Embedded Wallets Das
1717

1818
<InitialisationSnippet />
1919

20-
## Get Account
20+
## Get account
2121

2222
<GetAccountSnippet />
2323

24-
## Get Balance
24+
## Get balance
2525

2626
<GetBalanceSnippet />
2727

2828
## Sign a message
2929

3030
<SignMessageSnippet />
3131

32-
## Send Transaction
32+
## Send transaction
3333

3434
<SendTransactionSnippet />

embedded-wallets/connect-blockchain/_android-connect-blockchain/_evm-send-transaction.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
To send a transaction, you can use the `Web3j` instance we created earlier. It has
2-
`ethSendRawTransaction` method which helps to send the raw transaction to the network. To create a
3-
raw transaction, you need to retrieve nonce, gas price, gas limit, and the value of the transaction.
4-
The nonce is the number of transactions sent from the sender's address. The gas price is the price
5-
of the gas, which is the unit of account for the transaction. The gas limit is the maximum amount of
6-
gas that the sender is willing to pay for the transaction. The value is the amount of ether to send.
7-
8-
The default gas limit for a transfer ETH transaction is 21000, but you can also estimate the gas
9-
limit explicitly using `ethEstimateGas` method.
2+
`ethSendRawTransaction` method which sends the raw transaction to the network. To create a
3+
raw transaction, you need to retrieve nonce, gas price, gas limit, and the value of the transaction:
4+
5+
- nonce is the number of transactions sent from the sender's address
6+
- gas price is the unit of account for the transaction
7+
- gas limit is the maximum amount of gas that the sender is willing to pay for the transaction
8+
9+
The gas values are in ether. The default gas limit for a transfer ETH transaction is 21000, but you can
10+
also estimate the gas limit explicitly using `ethEstimateGas` method.
1011

1112
```kotlin
1213
import org.web3j.protocol.core.methods.response.EthGetTransactionCount

embedded-wallets/connect-blockchain/_android-connect-blockchain/_evm-sign-message.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
To sign the message, you need to use the `Sign.signPrefixedMessage` method. The method takes in the
2-
data of the message, ecKeyPair, and returns the Signature object which has r, s and v value of the
2+
data of the message, ecKeyPair, and returns the Signature object which has `r`, `s` and `v` value of the
33
signature.
44

5-
We can append the r, s, and v values to generate the signed hash. The r value is the first 32 bytes
6-
of the signature, s is the next 32 bytes, and v is the last 1 byte of the signature.
5+
We can append the `r`, `s`, and `v` values to generate the signed hash. The `r` value is the first 32 bytes
6+
of the signature, `s` is the next 32 bytes, and `v` is the last 1 byte of the signature.
77

88
```kotlin
99
import org.web3j.utils.Numeric

embedded-wallets/connect-blockchain/_flutter-connect-blockchain/_evm-deploy-contract.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Since web3dart package doesn't support deploying contracts directly, we'll use the precompiled smart
2-
contract byteCode to deploy the contract using `sendTransaction` method.
1+
Since the web3dart package doesn't support deploying contracts directly, we'll use the precompiled smart
2+
contract byteCode to deploy the contract using the `sendTransaction` method.
33

44
```dart
55
// Use the client, address, and credentials from previous code snippets

embedded-wallets/connect-blockchain/_flutter-connect-blockchain/_evm-get-account.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Once user has successfully logged in, you can retrieve the user's private key using the `getPrivKey` method from the Embedded Wallets Flutter SDK (formerly Web3Auth). We'll use this private key to generate the Credentials for the user.
1+
Once the user has successfully logged in, you can retrieve the user's private key using the `getPrivKey` method from the Embedded Wallets Flutter SDK. We'll use this private key to generate the Credentials for the user.
22

3-
This Credentials object has the user's key pair of private key and public key, and can be used to sign the transactions. Please note, that this assumes that the user has already logged in and the private key is available.
3+
This Credentials object has the user's keypair of private key and public key, and can be used to sign the transactions. Please note, that this assumes that the user has already logged in and the private key is available.
44

55
```dart
66
import 'package:web3dart/web3dart.dart';

0 commit comments

Comments
 (0)