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

trtl-apps

v0.11.2

Published

a node-js package for interacting with turtle apps

Downloads

11

Readme

trtl-apps

a node-js package for interacting with turtle apps.

Full API Documentation can be found here

Quickstart

Create an app using the TRTL apps console

Install the package

npm install trtl-apps --save

Initialize your app

import { TrtlApp } from 'trtl-apps';

TrtlApp.initialize('YOUR_APP_ID', 'YOUR_APP_SECRET');

Create accounts

const [alice, error]  = await TrtlApp.createAccount();
const [bob, error]    = await TrtlApp.createAccount();

console.log(`alice deposit address: ${alice.depositAddress}`);

Transfer from one account to another

const [transfer, error] = await TrtlApp.transfer(alice.id, bob.id, 120);

if (transfer) {
    console.log(`transfer succeeded, transfer id: ${transfer.id}`);
}

Account preview withdrawal

const accountId = '8RgwiWmgiYKQlUHWGaTW';
const amount = 2100;
const address = 'TRTLv2fdtVVDjWKueQ1aAETchiGVWkDvi1ATNgqZ3nKc7biCLm7KzLYeCzfS46mWYNRe8JaMPcTGWAR874kkN2zQ7Mt16J1vzcA';

const [preview, error] = await TrtlApp.withdrawalPreview(accountId, amount, address);

if (preview) {
 console.log(`Withdrawal preview created successfully, id: ${preview.id}, fee: ${preview.fee}`);
}

Account withdraw

const [withdrawal, error] = await TrtlApp.withdraw(preview.id);

if (withdrawal) {
 console.log(`Withdrawal request created successfully and is beeing processed, paymentId: ${withdrawal.paymentId}`);
}

CI/CD

This project uses Github actions to automatically build and publish the node package to NPM when a new release tag is created. For this to work correctly the following secret must be added to Github at settings -> secrets:

secret name: NPM_TOKEN secret value: YOUR NPM TOKEN

Contributing

Documentation

Compile the javascript

tsc

Generate documentation website. The copyfiles package must be installed globally

npm i copyfiles -g

Use the following command to generate the static documentation site.

npm run docs

Documentation is automatically hosted using github pages with each commit to the master branch