For Flutter & Dart Devs
To get started integrating payments into LUNC/LUNA for your on-chain products, please use the following pub 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 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
_1dart 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
_16_16void verifyCustomerBalance() {_16 // Recovery Words of the Customer wallet that will be making the payment_16 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";_16_16 // Configure your PaymentManager_16 // Set Blockchain to target (in this case Classic)_16 var paymentsManager = PaymentsManager()_16 .configureBlockchain(env: TerraEnvironment.classic)_16 .configureBusinessWallet(_16 businessWallet) // Configure your Business Wallet_16 .configureCustomerWallet(_16 customerRecoveryWords); // Configure the Customer Wallet_16_16 var simulation = await paymentsManager.getTotalFundsInCustomerWallet();_16 }
_19void processPaymentForTerra() {_19 // Wallet where customer payments will be transferred to_19 String businessWallet = "terra17lmam6zguazs5q5u6z5mmx76uj63gldnse2pdp";_19_19 // Recovery Words of the Customer wallet that will be making the payment_19 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";_19_19 // Configure your PaymentManager_19 // Set Blockchain to target (in this case Classic)_19 var paymentsManager = PaymentsManager()_19 .configureBlockchain(env: TerraEnvironment.classic)_19 .configureBusinessWallet(_19 businessWallet) // Configure your Business Wallet_19 .configureCustomerWallet(_19 customerRecoveryWords); // Configure the Customer Wallet_19_19 // Customer is charged 100 LUNC_19 var transaction = await paymentsManager.chargeCustomer(100);_19}