Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
[Unity] Update wallet docs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xFirekeeper committed Nov 21, 2023
1 parent 1fe8c37 commit 1925eb3
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
Binary file modified docs/unity/assets/connectwallet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/unity/connecting-to-wallets/EmbeddedWallet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var connection = new WalletConnection(
string address = await sdk.wallet.Connect(connection);
```

### Login with OAuth2 (Google, etc.)
### Login with OAuth2 (Google, Apple, Facebook, etc.)

This method initiates an OAuth2 login process and redirects back to the app upon successful authentication.

Expand Down
26 changes: 26 additions & 0 deletions docs/unity/connecting-to-wallets/SmartWallet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,32 @@ They also work with any wallet provider as the EOA, but it is recommended to use

You would then be able to login to the exact same persistent EOA and smart wallet address across your apps, and even across different platforms.

You can also create session keys, allowing new signers to interact with the smart wallet without being the admin.
You may also add/remove admins.

```csharp
using Thirdweb;

// Reference to your Thirdweb SDK
var sdk = ThirdwebManager.Instance.SDK;

// Create a session key to add a temporary signer
var createSessionResult = await sdk.wallet.CreateSessionKey("0xSignerAddress", ...options);

// Alternatively, you can add an admin
var addAdminResult = await sdk.wallet.AddAdmin("0xSignerAddress");

// Or remove an admin
var removeAdminResult = await sdk.wallet.RemoveAdmin("0xSignerAddress");

// This pairs well with the `smartWalletAccountOverride` option to connect to a specific smart wallet
var connection = new WalletConnection(
...options,
smartWalletAccountOverride: "0xSmartWalletAddress"
);
var address = await sdk.wallet.Connect(connection);
```

## Additional Options

Smart wallets, through paymasters, can be seen as a "plugin" to your user wallets, whereby all gas fees can be sponsored onchain.
Expand Down
6 changes: 6 additions & 0 deletions docs/unity/connecting-to-wallets/wallet-actions/Connect.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ Admin signer to use with [Smart Wallet](/unity/wallet/smartwallet) as your main

Must be a `WalletProvider`.

### smartWalletAccountOverride

Optionally choose to connect to a smart account the personal wallet is not an admin of. Useful for advanced session key use cases.

Must be a `string`.

#### authOptions

[Embedded Wallet](/unity/wallet/embeddedwallet) Authentication Options.
Expand Down

0 comments on commit 1925eb3

Please sign in to comment.