🔧 Before You Start
To get started, here are some details you should consider while reading the documentation.
Kaia Gas Fee
Kaia has a fixed gas fee, so make sure to do the following steps to setting up your Metamask:
- Click on Turn on Enhanced Gas Fee UI in Settings to set gas fee
- Set the Enable Enhanced Gas Fee UI toggle to ON and exit Settings.
Click here for more details.
Kaia RPC URL and Chain ID
Kaia mainnet: RPC URL = https://public-en.node.kaia.io Chain ID = 8217
Kaia testnet: RPC URL = https://public-en-kairos.node.kaia.io Chain ID = 1001
ABI formatting
The ABI has a special formatting. Replace the " with " , otherwise it will not be recognise by the SDK.
Example:
string abi = "[ { \"inputs\": [ { \"internalType\": \"uint8\", \"name\": \"_myArg\", \"type\": \"uint8\" } ], \"name\": \"addTotal\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"myTotal\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" } ]";
Solving Win32Exception
You may encounter this error: System.ComponentModel.Win32Exception (2): No such file or directory while building the project if you are using macOS. If it's the case, follow these steps:
- Install python 2.7
- Activate it in your project environment by running pyenv global 2.7.18 (to make it the default version everywhere) or pyenv local 2.7.18 (to make only the current directory use this version)
- Create a folder called Editor under Assets under Project window. Inside Editor, create a C# file called PreBuildProcessing and use the code below
- Restart and build your project
Please refer to this link for more details:
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;
public class PreBuildProcessing : IPreprocessBuildWithReport
{
public int callbackOrder => 1;
public void OnPreprocessBuild(BuildReport report)
{
System.Environment.SetEnvironmentVariable("EMSDK_PYTHON", "/Library/Frameworks/Python.framework/Versions/2.7/bin/python");
}
}
Solving the Newtonsoft Error
Install JSON.NET to fix: The type or namespace name 'Newtonsoft' could not be found error. After downloading the package you will need to import it into your project.
The steps for importing this package are as follows: Window -> Package Manager -> My Assets -> JSON.NET For Unity -> Import
If you have any questions, please join our Discord server, or send us an email at developers@kaia.io