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

Commit f53efca

Browse files
authored
Uniity 4.15.0 Docs (#451)
* pay updates * blocks updates * zksync note * rename
1 parent c657ef7 commit f53efca

File tree

15 files changed

+25
-19
lines changed

15 files changed

+25
-19
lines changed

src/app/unity/blocks/getblock/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ Get block data by block number.
1313

1414
```csharp
1515
BigInteger blockNumber = 1234567;
16-
var block = await Blocks.GetBlock(blockNumber);
16+
var block = await ThirdwebManager.Instance.SDK.Blocks.GetBlock(blockNumber);
1717
```

src/app/unity/blocks/getblockwithtransactions/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ Get block data by block number, including transaction data.
1313

1414
```csharp
1515
BigInteger blockNumber = 1234567;
16-
var blockWithTransactions = await Blocks.GetBlockWithTransactions(blockNumber);
16+
var blockWithTransactions = await ThirdwebManager.Instance.SDK.Blocks.GetBlockWithTransactions(blockNumber);
1717
```

src/app/unity/blocks/getlatestblocknumber/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ Get the latest block number.
1212
## Usage
1313

1414
```csharp
15-
BigInteger blockNumber = await Blocks.GetLatestBlockNumber();
15+
BigInteger blockNumber = await ThirdwebManager.Instance.SDK.Blocks.GetLatestBlockNumber();
1616
```

src/app/unity/blocks/getlatestblocktimestamp/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ Get the latest block timestamp.
1212
## Usage
1313

1414
```csharp
15-
BigInteger blocktimestamp = await Blocks.GetLatestBlockTimestamp();
15+
BigInteger blocktimestamp = await ThirdwebManager.Instance.SDK.Blocks.GetLatestBlockTimestamp();
1616
```

src/app/unity/pay/buywithcrypto/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ using Thirdweb.Pay;
1616

1717
public async void Buy()
1818
{
19-
string txHash = await ThirdwebPay.BuyWithCrypto(_quote);
19+
string txHash = await ThirdwebManager.Instance.SDK.Pay.BuyWithCrypto(_quote);
2020
ThirdwebDebug.Log($"Transaction hash: {txHash}");
2121
}
2222
```

src/app/unity/pay/buywithfiat/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ using Thirdweb.Pay;
1616

1717
public async void Buy()
1818
{
19-
string intentId = await ThirdwebPay.BuyWithFiat(_quote);
19+
string intentId = await ThirdwebManager.Instance.SDK.Pay.BuyWithFiat(_quote);
2020
ThirdwebDebug.Log($"Intent ID: {intentId}");
2121
}
2222
```

src/app/unity/pay/getbuyhistory/page.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ public async void GetBuyHistory()
1818
{
1919
string connectedAddress = await ThirdwebManager.Instance.SDK.Wallet.GetAddress();
2020

21-
BuyHistoryResult history = await ThirdwebPay.GetBuyHistory(walletAddress: connectedAddress, start: 0, count: 1);
21+
BuyHistoryResult history = await ThirdwebManager.Instance.SDK.Pay.GetBuyHistory(walletAddress: connectedAddress, start: 0, count: 1);
2222
ThirdwebDebug.Log($"History: {JsonConvert.SerializeObject(history, Formatting.Indented)}");
2323

24-
BuyHistoryResult historyNext = await ThirdwebPay.GetBuyHistory(walletAddress: connectedAddress, start: 1, count: 10, cursor: history.NextCursor, pageSize: null);
24+
BuyHistoryResult historyNext = await ThirdwebManager.Instance.SDK.Pay.GetBuyHistory(walletAddress: connectedAddress, start: 1, count: 10, cursor: history.NextCursor, pageSize: null);
2525
ThirdwebDebug.Log($"History Next: {JsonConvert.SerializeObject(historyNext, Formatting.Indented)}");
2626
}
2727
```

src/app/unity/pay/getbuywithcryptoquote/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public async void GetQuote()
2727
toAmount: "2" // I want to buy 2 WMATIC
2828
);
2929

30-
BuyWithCryptoQuoteResult quote = await ThirdwebPay.GetBuyWithCryptoQuote(swapQuoteParams);
30+
BuyWithCryptoQuoteResult quote = await ThirdwebManager.Instance.SDK.Pay.GetBuyWithCryptoQuote(swapQuoteParams);
3131
ThirdwebDebug.Log($"Quote: {JsonConvert.SerializeObject(quote, Formatting.Indented)}");
3232
}
3333
```

src/app/unity/pay/getbuywithcryptostatus/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ using Thirdweb.Pay;
1616

1717
public async void GetStatus()
1818
{
19-
BuyWithCryptoStatusResult status = await ThirdwebPay.GetBuyWithCryptoStatus(_txHash);
19+
BuyWithCryptoStatusResult status = await ThirdwebManager.Instance.SDK.Pay.GetBuyWithCryptoStatus(_txHash);
2020
if (status.Status == SwapStatus.FAILED.ToString())
2121
ThirdwebDebug.LogWarning($"Failed! Reason: {status.FailureMessage}");
2222

src/app/unity/pay/getbuywithfiatcurrencies/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ using Thirdweb.Pay;
1717
[ContextMenu("Get Supported Currencies")]
1818
public async void GetSupportedCurrencies()
1919
{
20-
List<string> currencies = await ThirdwebPay.GetBuyWithFiatCurrencies();
20+
List<string> currencies = await ThirdwebManager.Instance.SDK.Pay.GetBuyWithFiatCurrencies();
2121
ThirdwebDebug.Log($"Supported Currencies: {JsonConvert.SerializeObject(currencies, Formatting.Indented)}");
2222
}
2323
```

src/app/unity/pay/getbuywithfiatquote/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public async void GetQuote()
2626
toAmount: "20" // I want to buy 20 MATIC
2727
);
2828

29-
BuyWithFiatQuoteResult quote = await ThirdwebPay.GetBuyWithFiatQuote(fiatQuoteParams);
29+
BuyWithFiatQuoteResult quote = await ThirdwebManager.Instance.SDK.Pay.GetBuyWithFiatQuote(fiatQuoteParams);
3030
ThirdwebDebug.Log($"Quote: {JsonConvert.SerializeObject(quote, Formatting.Indented)}");
3131
}
3232
```

src/app/unity/pay/getbuywithfiatstatus/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ using Thirdweb.Pay;
1616

1717
public async void GetStatus()
1818
{
19-
var status = await ThirdwebPay.GetBuyWithFiatStatus(_intentId);
19+
var status = await ThirdwebManager.Instance.SDK.Pay.GetBuyWithFiatStatus(_intentId);
2020
if (status.Status == OnRampStatus.PAYMENT_FAILED.ToString() || status.Status == OnRampStatus.ON_RAMP_TRANSFER_FAILED.ToString())
2121
ThirdwebDebug.LogWarning($"Failed! Reason: {status.FailureMessage}");
2222

src/app/unity/wallets/prefab/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ From the `Inspector` window, you can configure the options for the `ConnectWalle
3535
The list of wallets you want to support.
3636
Each wallet you provide appears as a button in the dropdown.
3737

38-
Supports `EmbeddedWallet`, `MetaMask`, `Coinbase`, `WalletConnect`, `LocalWallet`, `HyperPlay`, `Injected` (window.ethereum).
38+
Supports `InAppWallet`, `MetaMask`, `Coinbase`, `WalletConnect`, `LocalWallet`, `HyperPlay`, `Injected` (window.ethereum).
3939

4040
Some wallet providers may not be supported on some native platforms.
4141

src/app/unity/wallets/providers/account-abstraction/page.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ var connection = new WalletConnection(
104104
var address = await sdk.Wallet.Connect(connection);
105105
```
106106

107+
## ZkSync Support
108+
109+
ZkSync chains make use of native account abstraction, whereby the user's EOA is the smart account. We support this as well.
110+
111+
The only difference is that no account factory or additional parameters are needed, simply set gasless to true, connect to ZkSync with a SmartWallet provider, and you're good to go.
112+
107113
## Additional Options
108114

109115
Smart accounts, through paymasters, can be seen as a "plugin" to your user wallets, whereby all gas fees can be sponsored onchain.

src/app/unity/wallets/providers/in-app-wallet/page.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var sdk = ThirdwebManager.Instance.SDK;
2222

2323
// Configure the connection
2424
var connection = new WalletConnection(
25-
provider: WalletProvider.EmbeddedWallet,
25+
provider: WalletProvider.InAppWallet,
2626
chainId: 1,
2727
2828
);
@@ -41,7 +41,7 @@ var sdk = ThirdwebManager.Instance.SDK;
4141

4242
// Configure the connection
4343
var connection = new WalletConnection(
44-
provider: WalletProvider.EmbeddedWallet,
44+
provider: WalletProvider.InAppWallet,
4545
chainId: 1,
4646
phoneNumber: "+1234567890",
4747
authOptions: new AuthOptions(
@@ -67,7 +67,7 @@ var sdk = ThirdwebManager.Instance.SDK;
6767

6868
// Configure the connection
6969
var connection = new WalletConnection(
70-
provider: WalletProvider.EmbeddedWallet,
70+
provider: WalletProvider.InAppWallet,
7171
chainId: 1,
7272
authOptions: new AuthOptions(
7373
authProvider: AuthProvider.Google,
@@ -94,7 +94,7 @@ var sdk = ThirdwebManager.Instance.SDK;
9494

9595
// Configure the connection
9696
var connection = new WalletConnection(
97-
provider: WalletProvider.EmbeddedWallet,
97+
provider: WalletProvider.InAppWallet,
9898
chainId: 1,
9999
authOptions: new AuthOptions(
100100
authProvider: AuthProvider.JWT,
@@ -141,4 +141,4 @@ If using Custom Auth flow, attempts to connect directly after verifying the auth
141141

142142
## Miscellaneous
143143

144-
You may modify the `WalletProvider_EmbeddedWallet` prefab to fit your app's design, it is primarily used during the Email OTP process.
144+
You may modify the `WalletProvider_InAppWallet` prefab to fit your app's design, it is primarily used during the Email OTP process.

0 commit comments

Comments
 (0)