Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style changes #160

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ AppKit
auth
abi-to-csharp-converter
AUTH
B3
backend
BalanceOf
behaviour
Expand Down Expand Up @@ -270,6 +271,7 @@ sampleLogin
sign-through-web3auth
SHA-3
setting-up-an-rpc-node
TabItem
tokenIds
tokenId
transfer-erc-20-token-through-web3auth
Expand Down
40 changes: 19 additions & 21 deletions docs/1_chainsafe-gaming.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,34 +55,32 @@ public class ExampleClass : MonoBehaviour

Web3.Unity should work with any EVM based network on the blockchain. Below you'll find a list of tested and approved networks, however you can find a wider range of supported networks on [Chainlist](https://chainlist.org/):

| Network Name | Type of Chain | Chain ID |
| ------------ | ------------- | ----------- |
| ETH Mainnet | Mainnet | 1 |
| Sepolia | Testnet | 11155111 |
| Polygon | Mainnet | 137 |
| Amoy | Testnet | 80002 |
| BSC | Mainnet | 56 |
| BSC | Testnet | 97 |
| Avalanche | Mainnet | 43114 |
| Avalanche | Testnet | 43113 |
| Base | Mainnet | 8453 |
| Cronos | Mainnet | 25 |
| Cronos | Testnet | 338 |
| Moonbeam | Mainnet | 1284 |
| SKALE Nebula | Mainnet | 1482601649 |
| SKALE Nebula | Testnet | 503129905 |
| SKALE Chaos | Testnet | 1351057110 |
| Network Name | Type of Chain | Chain ID |
| ------------ | ------------- | ----------- |
| ETH Mainnet | Mainnet | 1 |
| Sepolia | Testnet | 11155111 |
| Polygon | Mainnet | 137 |
| Amoy | Testnet | 80002 |
| B3 | Testnet | 8333 |
| B3 Sepolia | Testnet | 1993 |
| BSC | Mainnet | 56 |
| BSC | Testnet | 97 |
| Avalanche | Mainnet | 43114 |
| Fuji Avalanche | Testnet | 43113 |
| Base | Mainnet | 8453 |
| Base Sepolia | Testnet | 8453 |
| SKALE Nebula | Mainnet | 1482601649 |
| SKALE Nebula | Testnet | 503129905 |
| SKALE Chaos | Testnet | 1351057110 |

## Additional Resources

If you are new to web3.unity and blockchain-enabled gaming, we recommend that you read over these docs carefully, starting with [Current SDK Builds (v2.x)](#current-sdk-builds-v2x). If you are new to building with the Unity game engine, the [Unity3D manual](https://docs.unity3d.com/Manual/index.html) is a great place to start as well as [learn Unity](https://learn.unity.com/).
If you are new to web3.unity and blockchain-enabled gaming, we recommend that you read over these docs carefully. If you are new to building with the Unity game engine, the [Unity3D manual](https://docs.unity3d.com/Manual/index.html) is a great place to start as well as [learn Unity](https://learn.unity.com/).

* Our [Discord](https://discord.gg/zxHUgGGTGk) is an active community of game devs sharing tips and tricks with each other
* Hop into our [office hours](https://discord.gg/GTK89A72?event=1242583988623769611) every Wednesday at 9 am EST to get help with your code, brainstorm ideas, or provide feedback to the team.
* Our [Twitter](https://twitter.com/chainsafegaming) periodically provides news and updates, and shares our community's work
* Our [YouTube](https://youtube.com/chainsafe-systems) provides a set of video tutorials and how-to guides on using web3.unity:
* [Installing web3.unity](https://www.youtube.com/playlist?list=PLPn3rQCo3XrMkgAqFRtih9xGIKciD0b0N)
* [Web3.unity Documentation Videos](https://www.youtube.com/playlist?list=PLPn3rQCo3XrP6kFaurgMfMQBsyppYBhqW)
* [Web3.Unity SDK 3.0 Tutorials](https://www.youtube.com/playlist?list=PLPn3rQCo3XrOOklu69R-G2DJypaXFmR_z)

## Contribute

Expand Down
9 changes: 5 additions & 4 deletions docs/v2.6/19_abi-to-csharp-converter.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ sidebar_label: Contract ABI To C# Generator
---

# Contract ABI To C# Generator
In version 3.0, we've made it super easy for you to communicate with the blockchain by introducing the ABI to C# converter. Besides encapsulating all of your contract ABI into more user-friendly, statically typed methods, this utility also allows you to easily subscribe to and unsubscribe from the events happening on the blockchain.

You can access it by clicking on the top menu: Chainsafe SDK > Contract ABI To C# Generator.
In version 3.0, we've made it super easy for you to communicate with the blockchain by introducing the ABI to C# converter. Besides encapsulating all of your contract ABI into more user-friendly, statically typed methods, this utility also allows you to easily subscribe and unsubscribe to events happening on the blockchain.

You can access it by clicking on the top menu: Chainsafe SDK → Contract ABI To C# Generator.

![Contract ABI TO C# converter](assets/abi-csharp-contract/abi-csharp-overview.png)

Expand All @@ -16,7 +17,7 @@ Once there, you need to fill out the name of your contract and the folder where

![Contract ABI TO C# converter](assets/abi-csharp-contract/abi-csharp-filled.png)

If the data you provided is correct, you can click on Generate. After a few seconds, and once Unity reloads the domain, you should see a newly created C# class inside of your project.
If the data you provided is correct, you can click on Convert. After a few seconds, and once Unity reloads the domain, you should see a newly created C# class inside of your project.

Now, to actually interact with both the events and methods from the contract, the only remaining information needed is the contract address.

Expand Down Expand Up @@ -61,4 +62,4 @@ public class CustomContractSample : MonoBehaviour
}
```

Since we subscribe to blockchain events from the ABI during the contract building process behind the scenes, we need to manually dispose of the contract in a method like OnDestroy, which will handle unsubscribing from those events.
Since we subscribe to blockchain events from the ABI during the contract building process, we need to manually dispose of the contract in a method like OnDestroy, which will handle unsubscribing from events.
60 changes: 47 additions & 13 deletions docs/v2.6/1_getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,58 @@ On the top bar in unity, navigate to Window → Package Manager → Press the pl

Our packages are modular so your project wont bloat out with SDK files and you can have a lean development environment. The first piece you will need to begin your development journey is the core SDK package. This package contains everything you need for standard chain interactions. Simply enter this url into the add path field of the package manager.

Core SDK:
`https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity`
### Packages

**Core SDK**
```js
https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity
```

If you prefer to download packages trough openUPM you can do it trough the following link:
`https://openupm.com/packages/io.chainsafe.web3-unity/?subPage=readme`
```js
https://openupm.com/packages/io.chainsafe.web3-unity/?subPage=readme
```

### Extensions
Other modules that depend on the core SDK and can be downloaded through git or openUPM:

Other modules that depend on the core SDK and can be downloaded trough git or openUPM:
#### Web3Auth Login Provider ####
```js
https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity.web3auth
```

#### Hyperplay Login Provider ####
```js
https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity.hyperplay
```

Web3Auth Login Provider: `https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity.web3auth`
Hyperplay Login Provider: `https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity.hyperplay`
#### Lootboxes ####
```js
https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity.lootboxes
```

#### Marketplace ####
```js
https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity.marketplace
```

#### MUD ####
```js
https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity.mud
```

Lootboxes: `https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity.lootboxes`
Marketplace: `https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity.marketplace`
MUD: `https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity.mud`
Fiat On/Off Ramp support: `https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity.ramp`
#### Fiat On/Off Ramp support ####
```js
https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity.ramp
```



Please note that each package has samples that can be installed, these samples are built to give you a working example on the packages calls. You will also need the CORE SDK samples package if you want to work with the sample scripts seen [here](/current/sample-scripts)
:::note
Each package has samples that can be installed, these samples are built to give you a working example on the packages calls. You will also need the CORE SDK samples package if you want to work with the sample scripts seen [here](/current/sample-scripts)

![](assets/getting-started/import-samples.png)
:::

### Updating via The Package Manager

Expand All @@ -59,14 +87,20 @@ As the package is installed, you'll be prompted with the ChainSafe server settin

![](assets/getting-started/project-settings.png)

### Set Chain

After you've completed the registration process, copy your Project ID into the project settings window. You should see a message in the console saying your project id is valid.
Next up, you need to set up the list of chains you want to interact with inside of your project:

![](assets/getting-started/chain-settings.png)

You need a minimum of 1 chain for the SDK to work normally.

Small note: All of our samples are made on the Ethereum Sepolia network. If you run the samples whilst you are on another chain, you will get an exception.
:::info
All of our samples are made on the Ethereum Sepolia network. If you run the samples whilst you are on another chain, you will get an exception.
:::

### Accessing Server Settings

If you need to refer to the ChainSafe server settings area again, you can find it on the top navigation bar. Simply select it and press server settings to view the menu.

Expand All @@ -77,4 +111,4 @@ Right-click inside the Hierarchy view and select **Web3/Web3 Client**. This will

![](assets/getting-started/create-web3-client-menu.png)

Now after you've done this, you need to choose your wallet provider. Check it out in the "Choose Your Wallet" section.
Now after you've done this, you need to choose your wallet provider.
9 changes: 6 additions & 3 deletions docs/v2.6/20_chain-switching.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ sidebar_label: Chain Switching
---

# Chain Switching
In version 3.0, we've added the most requested feature from the community—chain switching.

Chain switching allows you to seamlessly switch between chains if you need to interact with smart contracts that are deployed on a different chain.
In version 3.0, we've added the most requested feature from the community — chain switching.

Chain switching allows you to seamlessly switch between chains if you need to interact with smart contracts that are deployed on a different chains.

![](assets/chain-switching/chain-settings.png)
In the Chain Settings inside the ChainSafe SDK > Project Settings, you can add as many chains as you'd like.

In the Chain Settings inside the ChainSafe SDK → Project Settings, you can add as many chains as you'd like.

The first chain in the list will always be the initial one that Web3Unity connects to.

Expand Down
5 changes: 1 addition & 4 deletions docs/v2.6/21_blockchain-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
slug: /current/blockchain-events
sidebar_position: 21
sidebar_label: Listening to Blockchain Events
---
Here’s the corrected version of your content with improved grammar:

---

# Listening to Blockchain Events
Often, you will want to react to certain events happening on the blockchain. For example, you might want to know when a transfer of funds occurs on a specific smart contract.

## Prerequisite
Fill in the WebSocket URL for the chains in the ChainSafe SDK > Project Settings.
Fill in the WebSocket URL for the chains in the ChainSafe SDK Project Settings.

To subscribe to the events happening on the blockchain, you need to add the Events Service Adapter to your Web3Unity Prefab.
There, you will find a serialized field called the polling interval. For platforms other than WebGL, any changes made to that number won't take effect, as for WebGL, we use event polling (essentially pinging the RPC every `pollingInterval` seconds to check for new events from a specific address), due to the limitations of the WebGL platform. If you are not building for WebGL (this includes the Editor), you'll use the WebSocket URL provided in your chain configuration.
Expand Down
10 changes: 2 additions & 8 deletions docs/v2.6/2_choose-your-wallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ import Link from '@docusaurus/Link';

# Choose Your Wallet Provider

:::info

This page will walk you through your options for wallet providers.

:::

Players will use wallets to manage their assets and interact with your games. The Web3 Unity SDK offers four wallet providers to choose from. The following table details the platforms they can be deployed on.

<table className="transparent-table">
Expand Down Expand Up @@ -87,8 +81,8 @@ Adding wallet providers to your games is simpler than ever. Inside the Web3Unity

If you've only installed our core package, the two available providers will be WalletConnect (which will be renamed to Reown in future versions) and MetaMask. You can add these as providers by clicking the Add Provider button. This will create new configuration file(s) inside your Resources folder.

To add support for social login (Google, Facebook, X), you need to install the web3auth package.
To add support for social login (Google, Facebook, X), you need to install the [web3auth package](/current/getting-started#web3auth-login-provider).

If your game is ready to be published on the Hyperplay launcher, you need to install the Hyperplay package.
If your game is ready to be published on the Hyperplay launcher, you need to install the [Hyperplay package](/current/getting-started#hyperplay-login-provider).


6 changes: 3 additions & 3 deletions docs/v2.6/3_metamask.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ sidebar_label: Metamask

## What is Metamask?

MetaMask is a digital wallet and browser extension that allows users to securely interact with EVM-based games. It acts as a bridge between your browser and the EVM chains, making it easy to send, receive, and swap digital assets.
MetaMask is a digital wallet and browser extension that allows users to securely interact with EVM-based games. It acts as a bridge between your browser and the EVM chains, making it easy to send, receive, and swap digital assets. You can learn more about MetaMask [here](https://metamask.io/).

:::info
:::note

Please note that MetaMask will only work with WebGL builds that are built out locally or published in the browser. You can use Reown to login and scan the QR code on your device to connect with MetaMask if needed for desktop builds.
MetaMask will only work with WebGL builds that are built out locally or published in the browser. You can use Reown to login and scan the QR code on your device to connect with MetaMask if needed for desktop builds.

:::

Expand Down
8 changes: 7 additions & 1 deletion docs/v2.6/4_reown.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ sidebar_label: Reown (Wallet Connect)

Reown is an open protocol that allows users to connect their crypto wallets to games through a QR code or deep link. It enables secure interactions between mobile wallets and Web3 games, making it easy to authorize transactions and access blockchain features from any device.

:::note

You must create an account and project in the Reown (Wallet Connect) dashboard to use this feature.

:::

## Custom Reown (Wallet Connect) Endpoint

We've already given you some default values for the Reown (Wallet Connect) configuration so if you're fine with using the same endpoint as everyone else just leave it as is. Otherwise head on over to the dashboard at [Reown (Wallet Connect)](https://cloud.walletconnect.com/sign-in) to sign up and get your own details.
Head on over to the dashboard at [Reown (Wallet Connect)](https://cloud.walletconnect.com/sign-in) to sign up and get your details.

![](assets/wallets/reown/reown-dash.png)

Expand Down
4 changes: 1 addition & 3 deletions docs/v2.6/6_hyperplay.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ sidebar_label: Hyperplay

# Hyperplay

![](assets/wallets/hyperplay/hyperplay-title.png)

## What is HyperPlay?

HyperPlay is a wallet solution that runs in a desktop client, it uses web requests to communicate with the wallet with the client and makes connecting to games easy and simple.
HyperPlay is a wallet solution that runs in a desktop client. It uses web requests to communicate with the wallet and the client and makes connecting to games easy and simple.

## HyperPlay Desktop App

Expand Down
24 changes: 19 additions & 5 deletions docs/v2.6/7_setting-up-an-rpc-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ sidebar_position: 7
sidebar_label: Setting Up An RPC Node
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Setting Up An RPC Node For web3.unity

:::info
Expand All @@ -12,12 +15,17 @@ This section walks through the process of setting up an RPC node to be used with

:::

<Tabs className="unique-tabs">
<TabItem value="Chainstack">

# Chainstack

# Prerequisites
:::note
Prerequisites

- A Chainstack account (sign up at [Chainstack](https://console.chainstack.com/user/account/create?utm_campaign=Referrals&utm_source=chainsafe&utm_medium=referrals) if you don't have one)
- Familiarity with the web3.unity SDK
:::

# Creating a project in Chainstack

Expand Down Expand Up @@ -52,9 +60,7 @@ This section walks through the process of setting up an RPC node to be used with
![](assets/setting-up-an-rpc-node/chainstack-node-deployment.png)

:::info

Note that Chainstack’s Developer plan provides 3 million free API requests per month. This should be enough for most testing and app development purposes. If your game requires more calls per month, we would suggest [upgrading your plan](https://console.chainstack.com/user/account/create?utm_campaign=Referrals&utm_source=chainsafe&utm_medium=referrals).

:::

4. Review the details under the “Summary” step and then click “Join network”.
Expand All @@ -74,12 +80,17 @@ Note that Chainstack’s Developer plan provides 3 million free API requests per

![](assets/setting-up-an-rpc-node/chainstack-https-endpoints.png)

</TabItem>
<TabItem value="QuickNode">

# QuickNode

# Prerequisites
:::note
Prerequisites

- A QuickNode account (sign up at [QuickNode](https://dashboard.quicknode.com/?prompt=signup) if you don't have one)
- Familiarity with the web3.unity SDK
:::

# Creating a project in QuickNode

Expand Down Expand Up @@ -107,4 +118,7 @@ Note that Chainstack’s Developer plan provides 3 million free API requests per

Note that the free plan QuickNode offers provides 10 million API requests per month. This should be enough for most testing and app development purposes. If your game requires more calls per month, we would suggest [upgrading your plan](https://dashboard.quicknode.com/select-plan).

:::
:::

</TabItem>
</Tabs>
2 changes: 1 addition & 1 deletion docs/v2.6/9_sample-scripts-and-chain-interactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_label: Sample Scripts & Chain Interactions
# Sample Scripts & Chain Interactions

## Reading and writing to the blockchain
The fastest and most convenient way to do any blockchain interaction would be to first generate the C# class from the contracts ABI, which is described in the section above.
The fastest and most convenient way to do any blockchain interaction would be to first generate the [C# class from the contracts ABI](/current/abi-to-csharp-converter).

```csharp
public class CustomContractSample : MonoBehaviour
Expand Down
Loading