Skip to content

Commit 565dbb9

Browse files
committed
[Docs] .NET & Unity as of 2.9/5.10 (#5445)
<!-- start pr-codex --> ## PR-Codex overview This PR focuses on updating the documentation for the `Thirdweb .NET SDK`, adding new methods, modifying existing ones, and improving sidebar navigation. It also removes outdated pages and refines descriptions for better clarity. ### Detailed summary - Deleted `getemail` and `getphonenumber` action pages. - Updated the reference link for `ThirdwebExtensions`. - Added documentation for `EcosystemWallet.GetEcosystemDetails` and `EcosystemWallet.GetUserDetails`. - Modified sidebar links, replacing `GetEmail` and `GetPhoneNumber` with `GetUserDetails` and `GenerateExternalLoginLink`. - Added documentation for `EcosystemWallet.GenerateExternalLoginLink`. - Updated `IThirdwebWallet.Transfer` method description and usage examples. - Revised wallet connection methods in `ThirdwebManager`, updating method names and descriptions. - Improved `Child Prefabs` section, renaming and clarifying modal usage. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent f01de73 commit 565dbb9

File tree

9 files changed

+127
-93
lines changed

9 files changed

+127
-93
lines changed

apps/portal/src/app/dotnet/contracts/extensions/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ var balance = await contract.ERC20_BalanceOf("0xOwnerAddress");
3030

3131
## Available Contract Extensions
3232

33-
Please refer to the `ThirdwebExtensions` [full reference](https://thirdweb-dev.github.io/thirdweb-dotnet/docs/Thirdweb.ThirdwebExtensions.html) for a complete list of available contract extensions.
33+
Please refer to the `ThirdwebExtensions` [full reference](https://thirdweb-dev.github.io/dotnet/index.html) for a complete list of available contract extensions.
3434

3535

apps/portal/src/app/dotnet/sidebar.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,27 @@ const walletActions: SidebarLink = (() => {
6868
name: "ExecuteTransaction",
6969
href: `${parentSlug}/executetransaction`,
7070
},
71+
{
72+
name: "Transfer",
73+
href: `${parentSlug}/transfer`,
74+
},
7175
],
7276
},
7377
{
7478
name: "InAppWallet & EcosystemWallet",
7579
isCollapsible: false,
7680
links: [
7781
{
78-
name: "GetEmail",
79-
href: `${parentSlug}/getemail`,
82+
name: "GetUserDetails",
83+
href: `${parentSlug}/getuserdetails`,
84+
},
85+
{
86+
name: "GetEcosystemDetails",
87+
href: `${parentSlug}/getecosystemdetails`,
8088
},
8189
{
82-
name: "GetPhoneNumber",
83-
href: `${parentSlug}/getphonenumber`,
90+
name: "GenerateExternalLoginLink",
91+
href: `${parentSlug}/generateexternalloginlink`,
8492
},
8593
],
8694
},
@@ -124,10 +132,6 @@ const walletActions: SidebarLink = (() => {
124132
name: "GetTransactionCount",
125133
href: `${parentSlug}/gettransactioncount`,
126134
},
127-
{
128-
name: "Transfer",
129-
href: `${parentSlug}/transfer`,
130-
},
131135
],
132136
},
133137
],
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { Details, createMetadata } from "@doc";
2+
3+
export const metadata = createMetadata({
4+
title: "EcosystemWallet.GenerateExternalLoginLink | Thirdweb .NET SDK",
5+
description: "Method to forward the logged-in session of In-App or Ecosystem Wallets from .NET to React apps built using thirdweb.",
6+
});
7+
8+
# EcosystemWallet.GenerateExternalLoginLink
9+
10+
This method returns a URL that can be used to forward the logged-in session of In-App or Ecosystem Wallets from .NET to React apps built using thirdweb.
11+
12+
Configure your React website to use thirdweb Connect, open the link generated by this method and your users will be autoconnected.
13+
If using Ecosystem Wallets, make sure to create the ecosystem wallet with the same ecosystem id and partner id (if any) and include it as one of your wallets in, for example, your ConnectButton's wallets prop.
14+
Make sure you're using the same api key on both ends.
15+
16+
## Usage
17+
18+
```csharp
19+
var url = await ecosystemWallet.GenerateExternalLoginLink();
20+
```
21+
22+
<Details summary="Return Value">
23+
24+
### string
25+
26+
The URL that can be used to forward the logged-in session of In-App or Ecosystem Wallets from .NET to React apps built using thirdweb.
27+
28+
</Details>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Details, createMetadata } from "@doc";
2+
3+
export const metadata = createMetadata({
4+
title: "EcosystemWallet.GetEcosystemDetails | Thirdweb .NET SDK",
5+
description: "Retrieve information about the Ecosystem the wallet is part of.",
6+
});
7+
8+
# EcosystemWallet.GetEcosystemDetails
9+
10+
This method returns information about the Ecosystem the wallet is part of.
11+
12+
## Usage
13+
14+
```csharp
15+
var result = await ecosystemWallet.GetEcosystemDetails();
16+
```
17+
18+
<Details summary="Return Value">
19+
20+
### EcosystemDetails
21+
22+
The Ecosystem details, such as the Ecosystem name, slug, image URL and more.
23+
24+
</Details>

apps/portal/src/app/dotnet/wallets/actions/getemail/page.mdx

Lines changed: 0 additions & 24 deletions
This file was deleted.

apps/portal/src/app/dotnet/wallets/actions/getphonenumber/page.mdx

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Details, createMetadata } from "@doc";
2+
3+
export const metadata = createMetadata({
4+
title: "EcosystemWallet.GetUserDetails | Thirdweb .NET SDK",
5+
description: "Retrieve information about the connected user wallet and its linked accounts.",
6+
});
7+
8+
# EcosystemWallet.GetUserDetails
9+
10+
This method returns information about the connected user wallet and its linked accounts.
11+
12+
## Usage
13+
14+
```csharp
15+
var result = await ecosystemWallet.GetUserDetails();
16+
```
17+
18+
<Details summary="Return Value">
19+
20+
### UserStatusResponse
21+
22+
The user and linked accounts information, such as the user's address, email and more.
23+
24+
</Details>

apps/portal/src/app/dotnet/wallets/actions/transfer/page.mdx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@ import { Details, createMetadata } from "@doc";
33

44
export const metadata = createMetadata({
55
title: "IThirdwebWallet.Transfer | Thirdweb .NET SDK",
6-
description: "Method to transfer the specified amount of Wei to a given address.",
6+
description: "Method to transfer the specified amount of native tokens or ERC20 tokens to a given address.",
77
});
88

99
# IThirdwebWallet.Transfer
1010

11-
This method transfers a specified amount of Wei (smallest denomination of Ether) to a specified wallet address on a given chain.
11+
This method transfers a specified amount of Wei (smallest denomination of Ether) or ERC20s to a specified wallet address on a given chain.
1212

1313
## Usage
1414

1515
```csharp
1616
// Transfer Wei
17-
ThirdwebTransactionReceipt receipt = await wallet.Transfer(chainId, toAddress, weiAmount);
17+
var receipt = await wallet.Transfer(chainId, toAddress, weiAmount);
18+
// Transfer ERC20
19+
var receipt = await wallet.Transfer(chainId, toAddress, weiAmount, erc20ContractAddress);
1820
```
1921

2022
<Details summary="Parameters">
@@ -35,6 +37,10 @@ The address to which the Wei will be transferred.
3537

3638
The amount of Wei to transfer. It must be 0 or greater.
3739

40+
### erc20ContractAddress (optional)
41+
42+
The contract address of the ERC20 token to transfer. If not provided, the transfer will be in native tokens.
43+
3844
</Details>
3945

4046
<Details summary="Return Value">

apps/portal/src/app/unity/v5/thirdwebmanager/page.mdx

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -85,83 +85,79 @@ var result = await contract.Read<string>("name");
8585

8686
Returns a [ThirdwebContract](/dotnet/contracts/create) instance that can be used to interact with a smart contract.
8787

88-
### GetActiveWallet
88+
### ConnectWallet
8989

9090
```csharp
91-
var wallet = ThirdwebManager.Instance.GetActiveWallet();
91+
var walletOptions = new WalletOptions(WalletProvider.PrivateKeyWallet, 421614);
92+
var wallet = await ThirdwebManager.Instance.ConnectWallet(walletOptions);
93+
var address = await wallet.GetAddress();
9294
```
9395

94-
Returns the currently active wallet as an `IThirdwebWallet`.
96+
Connects a wallet based on the specified `WalletOptions` and returns an `IThirdwebWallet` instance that can be used to interact with the blockchain.
9597

96-
### SetActiveWallet
98+
### UpgradeToSmartWallet
9799

98100
```csharp
99-
ThirdwebManager.Instance.SetActiveWallet(wallet);
101+
var smartWallet = await ThirdwebManager.Instance.UpgradeToSmartWallet(wallet, chainId, smartWalletOptions);
100102
```
101103

102-
Sets the specified wallet as the active wallet.
104+
Upgrades the specified wallet to a `SmartWallet`, returning a `SmartWallet` instance.
103105

104-
### GetWallet
106+
### LinkAccount
105107

106108
```csharp
107-
var wallet = ThirdwebManager.Instance.GetWallet("wallet-address");
109+
var linkedAccounts = await ThirdwebManager.Instance.LinkAccount(mainWallet, walletToLink, otp, chainId, jwtOrPayload);
108110
```
109111

110-
Returns a wallet from the manager's wallet mapping by its address.
112+
Links another `InAppWallet` or `EcosystemWallet` account to the main wallet and returns a list of linked accounts, allowing you to login with either authentication method later.
111113

112-
### AddWallet
114+
### GetActiveWallet
113115

114116
```csharp
115-
var wallet = await ThirdwebManager.Instance.AddWallet(wallet);
117+
var wallet = ThirdwebManager.Instance.GetActiveWallet();
116118
```
117119

118-
Adds a wallet to the manager's wallet mapping and returns the added wallet.
120+
Returns the currently active wallet as an `IThirdwebWallet`.
119121

120-
### RemoveWallet
122+
### SetActiveWallet
121123

122124
```csharp
123-
ThirdwebManager.Instance.RemoveWallet("wallet-address");
125+
ThirdwebManager.Instance.SetActiveWallet(wallet);
124126
```
125127

126-
Removes a wallet from the manager's wallet mapping by its address.
128+
Sets the specified wallet as the active wallet.
127129

128-
### ConnectWallet
130+
### GetWallet
129131

130132
```csharp
131-
var walletOptions = new WalletOptions(WalletProvider.PrivateKeyWallet, 421614);
132-
var wallet = await ThirdwebManager.Instance.ConnectWallet(walletOptions);
133-
var address = await wallet.GetAddress();
133+
var wallet = ThirdwebManager.Instance.GetWallet("wallet-address");
134134
```
135135

136-
Connects a wallet based on the specified `WalletOptions` and returns an `IThirdwebWallet` instance that can be used to interact with the blockchain.
136+
Returns a wallet from the manager's wallet mapping by its address.
137137

138-
### UpgradeToSmartWallet
138+
### AddWallet
139139

140140
```csharp
141-
var smartWallet = await ThirdwebManager.Instance.UpgradeToSmartWallet(wallet, chainId, smartWalletOptions);
141+
var wallet = await ThirdwebManager.Instance.AddWallet(wallet);
142142
```
143143

144-
Upgrades the specified wallet to a `SmartWallet`, returning a `SmartWallet` instance.
144+
Adds a wallet to the manager's wallet mapping and returns the added wallet.
145145

146-
### LinkAccount
146+
### RemoveWallet
147147

148148
```csharp
149-
var linkedAccounts = await ThirdwebManager.Instance.LinkAccount(mainWallet, walletToLink, otp, chainId, jwtOrPayload);
149+
ThirdwebManager.Instance.RemoveWallet("wallet-address");
150150
```
151151

152-
Links another `InAppWallet` account to the main wallet and returns a list of linked accounts, allowing you to login with either authentication method later.
152+
Removes a wallet from the manager's wallet mapping by its address.
153153

154154
## Child Prefabs
155155

156-
### InAppWalletModal
157-
158-
The `InAppWalletModal` prefab is a simple and customizable OTP verification modal for `InAppWallet` providers. It is used to verify and finalize the user's wallet connection.
159-
160-
It will be automatically activated when connecting to an `InAppWallet` provider.
156+
### DefaultOTPModal
161157

162-
### EcosystemWalletModal
158+
The helper modal that is displayed when using the `ThirdwebManager`'s `ConnectWallet` function with an auth method that requires an OTP, such as Email or Phone login.
163159

164-
Similar use case as `InAppWalletModal`, but for `EcosystemWallet` providers.
160+
It can be replaced with a custom modal that extends `AbstractOTPVerifyModal` to customize the OTP verification process.
165161

166162
### WalletConnectModal
167163

0 commit comments

Comments
 (0)