-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the Chia-Client-API wiki!
The chia client Api aims to provide an interface for .NET projects to the chia Client
For now, the Client Api is static so you do ot need to create a new instance.
It assumes that the Chia Wallet is running on the local host with the default installation directory.
In case, you want to provide custom values, you can do so:
Chia_Client_API.GlobalVar.API_TargetIP = "192.168.1.11";
Chia_Client_API.GlobalVar.API_CertificateFolder = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
@".testnet\ssl\");As of right now, only the default Ports are supported.
In case the specific function you are looking for is not yet supported, you can send a custom message to the endpoints:
Chia_Client_API.Clients_NS.Wallet_RPC_Client.SendCustomMessage_Sync("get_logged_in_fingerprint", "{ }");
await Chia_Client_API.Clients_NS.Wallet_RPC_Client.SendCustomMessage_Async("get_logged_in_fingerprint", "{ }");The function will retun the plain json string response of the endpoint which can be processed further.
Currently Supported (as of 27.02.2023):
- wallet Node
- Full Node
In general, the client is to be used in combination with the Chia RPC Library which is a dependency of this project. The idea is that you create an RPC first and then execute the apropriate function which consumes the rpc and returns a .net object modeled specifically for the response.
Example:
AddKey_RPC addKey = new AddKey_RPC { mnemonic = generatedWallet.mnemonic };
LogIn_Response response = WalletApi.AddKey_Async(addKey).Result;
ulong fingerprint = response.fingerprint;
The above example loads the 24 word mnemonic passphrase into an RPC and adds it to the chia client. The wallet node responds with a success message. In this case you could take the resulting fingerprint from the response.
This Library is modeled after the official Documentation. Please refer to https://docs.chia.net/full-node-rpc for full explanations of the endpoints and possible RPC's