You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -12,163 +12,95 @@ import TabItem from '@theme/TabItem'
12
12
13
13
## Overview
14
14
15
-
While using the Web3Auth Web SDK, you get an EIP1193-compatible provider, similar to the MetaMask provider. This provider can be used with libraries like TronWeb to make blockchain calls such as getting the user's account, fetching balances, signing transactions, sending transactions, etc. We have highlighted a few examples to get you started quickly.
16
-
17
-
---
15
+
Tron uses a secp256k1 private key derived from the Embedded Wallets EVM provider. After sign-in,
16
+
request the raw key with `connection.ethereumProvider.request({ method: 'private_key' })`, then pass
17
+
it to [TronWeb](https://github.com/tronprotocol/tronweb) for account, balance, signing, and
18
+
transaction calls.
18
19
19
20
## Installation
20
21
21
-
To interact with the Tron blockchain, you can use the Web3Auth provider and TronWeb.
const result =awaittronWeb.trx.sendRawTransaction(signedTransaction)
93
+
console.log('Transaction result:', result)
168
94
```
169
95
170
-
This will return the signature of the message.
96
+
## React integration
97
+
98
+
In React, extract the private key once from `useWeb3Auth().connection?.ethereumProvider` in a
99
+
`useEffect`, store it in state, and pass the string to the TronWeb helpers above. See the
100
+
[Tron integration example on GitHub](https://github.com/Web3Auth/web3auth-examples/tree/main/other/tron-example) for a
101
+
full `App.tsx` flow with `useWeb3AuthConnect` and `useWeb3AuthUser`.
171
102
172
-
## Conclusion
103
+
## Next steps
173
104
174
-
With Web3Auth, you can easily integrate Tron blockchain capabilities into your application. By using the TronWeb library, you can perform various blockchain operations such as fetching accounts, sending transactions, signing messages, and interacting with smart contracts.
105
+
-[JavaScript SDK get started](/embedded-wallets/sdk/js/)
106
+
-[Connect any blockchain](/embedded-wallets/connect-blockchain/)
Copy file name to clipboardExpand all lines: embedded-wallets/connect-blockchain/other/algorand.mdx
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,9 +22,13 @@ The SDKs are now branded as MetaMask Embedded Wallet SDKs (formerly Web3Auth Plu
22
22
## Installation
23
23
24
24
```bash npm2yarn
25
-
npm install --save algosdk
25
+
npm install --save @web3auth/modal algosdk
26
26
```
27
27
28
+
## Initialize Embedded Wallets
29
+
30
+
<InitializeWeb3Auth />
31
+
28
32
## Initializing provider
29
33
30
34
### Getting the `chainConfig`
@@ -74,7 +78,7 @@ Using the function, `web3auth.connection?.ethereumProvider?.request({ method: 'p
74
78
Under the hood, it uses the `algosdk.secretKeyToMnemonic()` function, where we need to pass the `Buffer.from(privateKey, "hex")`, that is, the hexadecimal to Uint8Array converted private key. We get a mnemonic seed phrase that can be used to derive the key pair using the `algosdk.mnemonicToSecretKey()`, this returns a key pair. We can use the returned private key pair from this and use it on Algorand transactions.
0 commit comments