npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

terra.onchainpayments

v1.4.4

Published

A lightweight payment management library for the Terra ecosystem. Internally manages gas estimation required by the burn tax for successful transactions on the LUNC blockchain. Makes it easier for devs to get started with payments on the LUNC/LUNA Blockch

Downloads

98

Readme

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 Typescript, with type definitions
  • Works with React Native, Typescript Ecosystems, in the browser, and Mobile solutions for anyone building on the Terra Ecosystem
  • Makes it easier to manage payments with very simple abstractions

Installation & Configuration

Next, grab the latest version of the payment library off of Npm

For npm

npm i terra.onchainpayments

For Yarn

yarn add terra.onchainpayments

Usage

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

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

Manage Payments

First, get some testnet tokens for terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v, or use LocalTerra.

// Customer wallets are the ones that make the payment, and pay for the Burn Tax
function ChargeCustomerWithLUNC() {
  let businessWallet = "terra17lmam6zguazs5q5u6z5mmx76uj63gldnse2pdp";
  let customerKeys =
    "notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius";

  let customerAddress = "terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v";

  var manager = new PaymentsManager({ env: Environments.ClassicTestNet })
    .configureBusinessWallet(businessWallet)
    .configureCustomerKeys(customerKeys, customerAddress);

  // Charge the customer a payment of 200,000 LUNC
  var tx = await manager.ChargeCustomer(200000);
  console.debug(`TX: ${tx.TxFinderHashUrl}`); // Track the Tx Url on Terra.Finder
}

function ChargeCustomerWithLUNA2() {
  let businessWallet = "terra17lmam6zguazs5q5u6z5mmx76uj63gldnse2pdp";
  let customerKeys =
    "notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius";

  let customerAddress = "terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v";

  var manager = new PaymentsManager({ env: Environments.Luna2TestNet })
    .configureBusinessWallet(businessWallet)
    .configureCustomerKeys(customerKeys, customerAddress);

  // Charge the customer a payment of 200 LUNA
  var tx = await manager.ChargeCustomer(200);
  console.debug(`TX: ${tx.TxFinderHashUrl}`); // Track the Tx Url on Terra.Finder
}