Skip to main content

For .Net & Unity3d Devs

To get started integrating payments into LUNC/LUNA for your on-chain products, please use the following nuget package.

About the Library

Internally manages gas estimation required by the burn tax for successful transactions on the blockchain. Makes it easier for devs to get started with payments on the LUNC/LUNA Blockchains.

Features

  • Written in C#, with type definitions
  • Works with Xamarin, Unity, Asp, and all other frameworks in the .Net Ecosystems
  • Makes it easier to manage payments for anyone deploying to the Apple or Google app stores

Installation & Configuration

Grab the latest version off NuGet


_1
dotnet add package Terra.Net.OnChainPayments

Usage

This package can be used for Mobile & Web Developers, or SDK Developers looking to extend the Terra Platform

Manage Payments

Please note: PaymentsManager must be registered as a Singleton to prevent issues with the Connection Pool.


_13
void ProcessPaymentForTerra() {
_13
string businessWallet = "terra17lmam6zguazs5q5u6z5mmx76uj63gldnse2pdp"; // Wallet where customer payments will be transferred to
_13
string customerRecoveryWords = "notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius"; // Recovery Words of the Customer wallet that will be making the payment
_13
_13
// Configure your PaymentManager
_13
// Set Blockchain to target (in this case Classic)
_13
var paymentsManager = new PaymentsManager(TerraEnvironment.Classic)
_13
.ConfigureBusinessWallet(businessWallet) // Configure your Business Wallet
_13
.ConfigureCustomerWallet(customerRecoveryWords); // Configure the Customer Wallet
_13
_13
var simulation = await paymentsManager.ChargeCustomer(100);
_13
await DisplayAlert("Successful Transaction", $"Gas Wanted: {simulation.GasWanted}, \n Gas Used: {simulation.GasUsed}", "Ok");
_13
}

Terra.Net.OnChainPayments For Unity Developers

If you are using Terra.Net.OnChainPayments for Unity, please make sure to install the following asset in your project, and follow the installation instructions above