Skip to content

Commit a7dc471

Browse files
committed
docs(sdk/eip1193): recommend named imports
1 parent ed14777 commit a7dc471

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

packages/thirdweb/src/adapters/eip1193/from-eip1193.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,33 @@ export type FromEip1193AdapterOptions = {
2121

2222
/**
2323
* Creates a Thirdweb wallet from an EIP-1193 compatible provider.
24-
*
24+
*
2525
* This adapter allows you to use any EIP-1193 provider (like MetaMask, WalletConnect, etc.) as a Thirdweb wallet.
2626
* It handles all the necessary conversions between the EIP-1193 interface and Thirdweb's wallet interface.
27-
*
27+
*
2828
* @param options - Configuration options for creating the wallet adapter
2929
* @param options.provider - An EIP-1193 compatible provider or a function that returns one
3030
* @param options.walletId - Optional custom wallet ID to identify this provider (defaults to "adapter")
3131
* @returns A Thirdweb wallet instance that wraps the EIP-1193 provider
32-
*
32+
*
3333
* @example
3434
* ```ts
35-
* import { fromProvider } from "thirdweb/adapters/eip1193";
36-
*
35+
* import { EIP1193 } from "thirdweb/wallets";
36+
*
3737
* // Create a Thirdweb wallet from MetaMask's provider
38-
* const wallet = fromProvider({
38+
* const wallet = EIP1193.fromProvider({
3939
* provider: window.ethereum,
4040
* walletId: "io.metamask"
4141
* });
42-
*
42+
*
4343
* // Use like any other Thirdweb wallet
4444
* const account = await wallet.connect({
4545
* client: createThirdwebClient({ clientId: "..." })
4646
* });
47-
*
47+
*
4848
* // Sign messages
4949
* await account.signMessage({ message: "Hello World" });
50-
*
50+
*
5151
* // Send transactions
5252
* await account.sendTransaction({
5353
* to: "0x...",

packages/thirdweb/src/adapters/eip1193/to-eip1193.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,33 @@ export type ToEip1193ProviderOptions = {
1818

1919
/**
2020
* Converts a Thirdweb wallet into an EIP-1193 compatible provider.
21-
*
21+
*
2222
* This adapter allows you to use a Thirdweb wallet with any library or dApp that expects an EIP-1193 provider.
2323
* The provider implements the standard EIP-1193 interface including request handling and event subscription.
24-
*
24+
*
2525
* @param options - Configuration options for creating the provider
2626
* @param options.wallet - The Thirdweb wallet to adapt into a provider
2727
* @param options.chain - The blockchain chain to connect to
2828
* @param options.client - The Thirdweb client instance
2929
* @param options.connectOverride - Optional custom connect handler to override default connection behavior
3030
* @returns An EIP-1193 compatible provider that wraps the Thirdweb wallet
31-
*
31+
*
3232
* @example
3333
* ```ts
34-
* import { toProvider } from "thirdweb/adapters/eip1193";
35-
*
34+
* import { EIP1193 } from "thirdweb/wallets";
35+
*
3636
* // Create an EIP-1193 provider from a Thirdweb wallet
37-
* const provider = toProvider({
37+
* const provider = EIP1193.toProvider({
3838
* wallet,
3939
* chain: ethereum,
4040
* client: createThirdwebClient({ clientId: "..." })
4141
* });
42-
*
42+
*
4343
* // Use with any EIP-1193 compatible library
44-
* const accounts = await provider.request({
45-
* method: "eth_requestAccounts"
44+
* const accounts = await provider.request({
45+
* method: "eth_requestAccounts"
4646
* });
47-
*
47+
*
4848
* // Listen for events
4949
* provider.on("accountsChanged", (accounts) => {
5050
* console.log("Active accounts:", accounts);

0 commit comments

Comments
 (0)