From 565dbb9ef3f73b36e7a8e0ab56ce4ae2765a2f01 Mon Sep 17 00:00:00 2001
From: 0xFirekeeper <43042585+0xFirekeeper@users.noreply.github.com>
Date: Mon, 18 Nov 2024 19:10:52 +0000
Subject: [PATCH] [Docs] .NET & Unity as of 2.9/5.10 (#5445)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
## 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}`
---
.../app/dotnet/contracts/extensions/page.mdx | 2 +-
apps/portal/src/app/dotnet/sidebar.tsx | 20 +++---
.../generateexternalloginlink/page.mdx | 28 +++++++++
.../actions/getecosystemdetails/page.mdx | 24 +++++++
.../dotnet/wallets/actions/getemail/page.mdx | 24 -------
.../wallets/actions/getphonenumber/page.mdx | 24 -------
.../wallets/actions/getuserdetails/page.mdx | 24 +++++++
.../dotnet/wallets/actions/transfer/page.mdx | 12 +++-
.../src/app/unity/v5/thirdwebmanager/page.mdx | 62 +++++++++----------
9 files changed, 127 insertions(+), 93 deletions(-)
create mode 100644 apps/portal/src/app/dotnet/wallets/actions/generateexternalloginlink/page.mdx
create mode 100644 apps/portal/src/app/dotnet/wallets/actions/getecosystemdetails/page.mdx
delete mode 100644 apps/portal/src/app/dotnet/wallets/actions/getemail/page.mdx
delete mode 100644 apps/portal/src/app/dotnet/wallets/actions/getphonenumber/page.mdx
create mode 100644 apps/portal/src/app/dotnet/wallets/actions/getuserdetails/page.mdx
diff --git a/apps/portal/src/app/dotnet/contracts/extensions/page.mdx b/apps/portal/src/app/dotnet/contracts/extensions/page.mdx
index 30445354e41..053b2a42468 100644
--- a/apps/portal/src/app/dotnet/contracts/extensions/page.mdx
+++ b/apps/portal/src/app/dotnet/contracts/extensions/page.mdx
@@ -30,6 +30,6 @@ var balance = await contract.ERC20_BalanceOf("0xOwnerAddress");
## Available Contract Extensions
-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.
+Please refer to the `ThirdwebExtensions` [full reference](https://thirdweb-dev.github.io/dotnet/index.html) for a complete list of available contract extensions.
diff --git a/apps/portal/src/app/dotnet/sidebar.tsx b/apps/portal/src/app/dotnet/sidebar.tsx
index fd3e324b95c..7eacede8b33 100644
--- a/apps/portal/src/app/dotnet/sidebar.tsx
+++ b/apps/portal/src/app/dotnet/sidebar.tsx
@@ -68,6 +68,10 @@ const walletActions: SidebarLink = (() => {
name: "ExecuteTransaction",
href: `${parentSlug}/executetransaction`,
},
+ {
+ name: "Transfer",
+ href: `${parentSlug}/transfer`,
+ },
],
},
{
@@ -75,12 +79,16 @@ const walletActions: SidebarLink = (() => {
isCollapsible: false,
links: [
{
- name: "GetEmail",
- href: `${parentSlug}/getemail`,
+ name: "GetUserDetails",
+ href: `${parentSlug}/getuserdetails`,
+ },
+ {
+ name: "GetEcosystemDetails",
+ href: `${parentSlug}/getecosystemdetails`,
},
{
- name: "GetPhoneNumber",
- href: `${parentSlug}/getphonenumber`,
+ name: "GenerateExternalLoginLink",
+ href: `${parentSlug}/generateexternalloginlink`,
},
],
},
@@ -124,10 +132,6 @@ const walletActions: SidebarLink = (() => {
name: "GetTransactionCount",
href: `${parentSlug}/gettransactioncount`,
},
- {
- name: "Transfer",
- href: `${parentSlug}/transfer`,
- },
],
},
],
diff --git a/apps/portal/src/app/dotnet/wallets/actions/generateexternalloginlink/page.mdx b/apps/portal/src/app/dotnet/wallets/actions/generateexternalloginlink/page.mdx
new file mode 100644
index 00000000000..5596432db69
--- /dev/null
+++ b/apps/portal/src/app/dotnet/wallets/actions/generateexternalloginlink/page.mdx
@@ -0,0 +1,28 @@
+import { Details, createMetadata } from "@doc";
+
+export const metadata = createMetadata({
+ title: "EcosystemWallet.GenerateExternalLoginLink | Thirdweb .NET SDK",
+ description: "Method to forward the logged-in session of In-App or Ecosystem Wallets from .NET to React apps built using thirdweb.",
+});
+
+# EcosystemWallet.GenerateExternalLoginLink
+
+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.
+
+Configure your React website to use thirdweb Connect, open the link generated by this method and your users will be autoconnected.
+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.
+Make sure you're using the same api key on both ends.
+
+## Usage
+
+```csharp
+var url = await ecosystemWallet.GenerateExternalLoginLink();
+```
+
+
+
+### string
+
+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.
+
+
diff --git a/apps/portal/src/app/dotnet/wallets/actions/getecosystemdetails/page.mdx b/apps/portal/src/app/dotnet/wallets/actions/getecosystemdetails/page.mdx
new file mode 100644
index 00000000000..e7233b207dc
--- /dev/null
+++ b/apps/portal/src/app/dotnet/wallets/actions/getecosystemdetails/page.mdx
@@ -0,0 +1,24 @@
+import { Details, createMetadata } from "@doc";
+
+export const metadata = createMetadata({
+ title: "EcosystemWallet.GetEcosystemDetails | Thirdweb .NET SDK",
+ description: "Retrieve information about the Ecosystem the wallet is part of.",
+});
+
+# EcosystemWallet.GetEcosystemDetails
+
+This method returns information about the Ecosystem the wallet is part of.
+
+## Usage
+
+```csharp
+var result = await ecosystemWallet.GetEcosystemDetails();
+```
+
+
+
+### EcosystemDetails
+
+The Ecosystem details, such as the Ecosystem name, slug, image URL and more.
+
+
diff --git a/apps/portal/src/app/dotnet/wallets/actions/getemail/page.mdx b/apps/portal/src/app/dotnet/wallets/actions/getemail/page.mdx
deleted file mode 100644
index 6efa6d10ac0..00000000000
--- a/apps/portal/src/app/dotnet/wallets/actions/getemail/page.mdx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Details, createMetadata } from "@doc";
-
-export const metadata = createMetadata({
- title: "InAppWallet.GetEmail | Thirdweb .NET SDK",
- description: "Retrieve the email associated with a logged in InAppWallet.",
-});
-
-# InAppWallet.GetEmail
-
-This method retrieves the email associated with a connected `InAppWallet`.
-
-## Usage
-
-```csharp
-string email = await inAppWallet.GetEmail();
-```
-
-
-
-### string
-
-The user's email as a `string`.
-
-
diff --git a/apps/portal/src/app/dotnet/wallets/actions/getphonenumber/page.mdx b/apps/portal/src/app/dotnet/wallets/actions/getphonenumber/page.mdx
deleted file mode 100644
index 65eb5f01fae..00000000000
--- a/apps/portal/src/app/dotnet/wallets/actions/getphonenumber/page.mdx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Details, createMetadata } from "@doc";
-
-export const metadata = createMetadata({
- title: "InAppWallet.GetPhoneNumber | Thirdweb .NET SDK",
- description: "Retrieve the email associated with a logged in InAppWallet.",
-});
-
-# InAppWallet.GetPhoneNumber
-
-This method retrieves the email associated with a connected `InAppWallet`.
-
-## Usage
-
-```csharp
-string phoneNumber = await inAppWallet.GetPhoneNumber();
-```
-
-
-
-### string
-
-The user's phone number as a `string`.
-
-
diff --git a/apps/portal/src/app/dotnet/wallets/actions/getuserdetails/page.mdx b/apps/portal/src/app/dotnet/wallets/actions/getuserdetails/page.mdx
new file mode 100644
index 00000000000..799aa8cca17
--- /dev/null
+++ b/apps/portal/src/app/dotnet/wallets/actions/getuserdetails/page.mdx
@@ -0,0 +1,24 @@
+import { Details, createMetadata } from "@doc";
+
+export const metadata = createMetadata({
+ title: "EcosystemWallet.GetUserDetails | Thirdweb .NET SDK",
+ description: "Retrieve information about the connected user wallet and its linked accounts.",
+});
+
+# EcosystemWallet.GetUserDetails
+
+This method returns information about the connected user wallet and its linked accounts.
+
+## Usage
+
+```csharp
+var result = await ecosystemWallet.GetUserDetails();
+```
+
+
+
+### UserStatusResponse
+
+The user and linked accounts information, such as the user's address, email and more.
+
+
diff --git a/apps/portal/src/app/dotnet/wallets/actions/transfer/page.mdx b/apps/portal/src/app/dotnet/wallets/actions/transfer/page.mdx
index e22aee67c77..fe09a80b6a5 100644
--- a/apps/portal/src/app/dotnet/wallets/actions/transfer/page.mdx
+++ b/apps/portal/src/app/dotnet/wallets/actions/transfer/page.mdx
@@ -3,18 +3,20 @@ import { Details, createMetadata } from "@doc";
export const metadata = createMetadata({
title: "IThirdwebWallet.Transfer | Thirdweb .NET SDK",
- description: "Method to transfer the specified amount of Wei to a given address.",
+ description: "Method to transfer the specified amount of native tokens or ERC20 tokens to a given address.",
});
# IThirdwebWallet.Transfer
-This method transfers a specified amount of Wei (smallest denomination of Ether) to a specified wallet address on a given chain.
+This method transfers a specified amount of Wei (smallest denomination of Ether) or ERC20s to a specified wallet address on a given chain.
## Usage
```csharp
// Transfer Wei
-ThirdwebTransactionReceipt receipt = await wallet.Transfer(chainId, toAddress, weiAmount);
+var receipt = await wallet.Transfer(chainId, toAddress, weiAmount);
+// Transfer ERC20
+var receipt = await wallet.Transfer(chainId, toAddress, weiAmount, erc20ContractAddress);
```
@@ -35,6 +37,10 @@ The address to which the Wei will be transferred.
The amount of Wei to transfer. It must be 0 or greater.
+### erc20ContractAddress (optional)
+
+The contract address of the ERC20 token to transfer. If not provided, the transfer will be in native tokens.
+
diff --git a/apps/portal/src/app/unity/v5/thirdwebmanager/page.mdx b/apps/portal/src/app/unity/v5/thirdwebmanager/page.mdx
index c739dbb7b7f..cabc75cb217 100644
--- a/apps/portal/src/app/unity/v5/thirdwebmanager/page.mdx
+++ b/apps/portal/src/app/unity/v5/thirdwebmanager/page.mdx
@@ -85,83 +85,79 @@ var result = await contract.Read("name");
Returns a [ThirdwebContract](/dotnet/contracts/create) instance that can be used to interact with a smart contract.
-### GetActiveWallet
+### ConnectWallet
```csharp
-var wallet = ThirdwebManager.Instance.GetActiveWallet();
+var walletOptions = new WalletOptions(WalletProvider.PrivateKeyWallet, 421614);
+var wallet = await ThirdwebManager.Instance.ConnectWallet(walletOptions);
+var address = await wallet.GetAddress();
```
-Returns the currently active wallet as an `IThirdwebWallet`.
+Connects a wallet based on the specified `WalletOptions` and returns an `IThirdwebWallet` instance that can be used to interact with the blockchain.
-### SetActiveWallet
+### UpgradeToSmartWallet
```csharp
-ThirdwebManager.Instance.SetActiveWallet(wallet);
+var smartWallet = await ThirdwebManager.Instance.UpgradeToSmartWallet(wallet, chainId, smartWalletOptions);
```
-Sets the specified wallet as the active wallet.
+Upgrades the specified wallet to a `SmartWallet`, returning a `SmartWallet` instance.
-### GetWallet
+### LinkAccount
```csharp
-var wallet = ThirdwebManager.Instance.GetWallet("wallet-address");
+var linkedAccounts = await ThirdwebManager.Instance.LinkAccount(mainWallet, walletToLink, otp, chainId, jwtOrPayload);
```
-Returns a wallet from the manager's wallet mapping by its address.
+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.
-### AddWallet
+### GetActiveWallet
```csharp
-var wallet = await ThirdwebManager.Instance.AddWallet(wallet);
+var wallet = ThirdwebManager.Instance.GetActiveWallet();
```
-Adds a wallet to the manager's wallet mapping and returns the added wallet.
+Returns the currently active wallet as an `IThirdwebWallet`.
-### RemoveWallet
+### SetActiveWallet
```csharp
-ThirdwebManager.Instance.RemoveWallet("wallet-address");
+ThirdwebManager.Instance.SetActiveWallet(wallet);
```
-Removes a wallet from the manager's wallet mapping by its address.
+Sets the specified wallet as the active wallet.
-### ConnectWallet
+### GetWallet
```csharp
-var walletOptions = new WalletOptions(WalletProvider.PrivateKeyWallet, 421614);
-var wallet = await ThirdwebManager.Instance.ConnectWallet(walletOptions);
-var address = await wallet.GetAddress();
+var wallet = ThirdwebManager.Instance.GetWallet("wallet-address");
```
-Connects a wallet based on the specified `WalletOptions` and returns an `IThirdwebWallet` instance that can be used to interact with the blockchain.
+Returns a wallet from the manager's wallet mapping by its address.
-### UpgradeToSmartWallet
+### AddWallet
```csharp
-var smartWallet = await ThirdwebManager.Instance.UpgradeToSmartWallet(wallet, chainId, smartWalletOptions);
+var wallet = await ThirdwebManager.Instance.AddWallet(wallet);
```
-Upgrades the specified wallet to a `SmartWallet`, returning a `SmartWallet` instance.
+Adds a wallet to the manager's wallet mapping and returns the added wallet.
-### LinkAccount
+### RemoveWallet
```csharp
-var linkedAccounts = await ThirdwebManager.Instance.LinkAccount(mainWallet, walletToLink, otp, chainId, jwtOrPayload);
+ThirdwebManager.Instance.RemoveWallet("wallet-address");
```
-Links another `InAppWallet` account to the main wallet and returns a list of linked accounts, allowing you to login with either authentication method later.
+Removes a wallet from the manager's wallet mapping by its address.
## Child Prefabs
-### InAppWalletModal
-
-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.
-
-It will be automatically activated when connecting to an `InAppWallet` provider.
+### DefaultOTPModal
-### EcosystemWalletModal
+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.
-Similar use case as `InAppWalletModal`, but for `EcosystemWallet` providers.
+It can be replaced with a custom modal that extends `AbstractOTPVerifyModal` to customize the OTP verification process.
### WalletConnectModal