A lightweight payment management library for terra ecosystem. Supports payments for both LUNC & LUNA Blockchains

GitHub GitHub GitHub

Explore the Docs »

Example App · API Reference · Pub Package · GitHub

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 Dart, with type definitions
  • Works with the Flutter & Dart Ecosystems, in the browser, and Mobile solutions for anyone building on the Terra Ecosystem
  • Makes it easier to manage payments for anyone deploying to the app store

Installation & Configuration

Grab the latest version off Pub

dart pub add terra_dart_onchain_payments

Usage

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

Manage Payments


void verifyCustomerBalance() {
     // Recovery Words of the Customer wallet that will be making the payment
     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";

     // Configure your PaymentManager
     // Set Blockchain to target (in this case Classic)
     var paymentsManager = PaymentsManager()
          .configureBlockchain(env: TerraEnvironment.classic)
          .configureBusinessWallet(
              businessWallet) // Configure your Business Wallet
          .configureCustomerWallet(
              customerRecoveryWords); // Configure the Customer Wallet

     var simulation = await paymentsManager.getTotalFundsInCustomerWallet();
  }
void processPaymentForTerra() {
     // Wallet where customer payments will be transferred to
     String businessWallet = "terra17lmam6zguazs5q5u6z5mmx76uj63gldnse2pdp";

     // Recovery Words of the Customer wallet that will be making the payment
     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";

     // Configure your PaymentManager
     // Set Blockchain to target (in this case Classic)
     var paymentsManager = PaymentsManager()
          .configureBlockchain(env: TerraEnvironment.classic)
          .configureBusinessWallet(
              businessWallet) // Configure your Business Wallet
          .configureCustomerWallet(
              customerRecoveryWords); // Configure the Customer Wallet

     // Customer is charged 100 LUNC
     var transaction = await paymentsManager.chargeCustomer(100);
}

License

This software is licensed under the MIT license. See LICENSE for full disclosure.

© 2022 TerraMystics.

Libraries

paymentsManager
terra_onchain_payments
Support for doing something awesome.