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

reblocks

v0.7.0

Published

[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-56b3b4.svg)](https://github.com/prettier/prettier) [![npm version](https://img.shields.io/npm/v/reblocks.svg)](https://www.npmjs.org/package/reblocks) [![CircleCI](https://circleci

Downloads

15

Readme

Reblocks - React Nano Cryptocurrency Payments and other Components

styled with prettier npm version CircleCI semantic-release

Various React components for the Nano Cryptocurrency including a wrapper around the Brainblocks payment button that makes it simple to start taking Nano payments in React projects.

Demo: goldcaddy77.github.io/reblocks

Table of Contents

Install

yarn add reblocks

Usage

import { ReblocksPayment } from 'reblocks';

const onSuccess = (data: PaymentResponse) => {
  console.log('Got transaction token', data.token);
};

const Button = (
  <ReblocksPayment
    accountId="xrb_3ritoyx4zcixshfbezg4aycb49xbupw9ggink1rfm43tm6uh87t4ifuxg5dm"
    amount={200000}
    onPaymentSuccess={onSuccess}
  />
);

Note: this package is built with TypeScript and already contains the relevant TypeScript type definitions.

API

ReblocksPayment

To initiate a payment, use the ReblocksPayment component. The ReblocksPayment takes in the following props:

  • accountId {string} account to send funds to
  • amount {string} ammount of xrb to send (Note: 1 xrb = 1/1,000,000 XRB)
  • onPaymentSuccess {function} function to run on successful payment. This is passed { token: 'TOKEN'}

Link to demo

ReblocksFiatConversion

To display the current value of XRB in a fiat currency, use the ReblocksFiatConversion component. The ReblocksFiatConversion takes in the following props:

  • currency {currency} 3 digit fiat currency you want to display the current value of 1 XRB

Link to demo

ReblocksQRCode

To create a QR code for payments, use the ReblocksQRCode component. The ReblocksQRCode component takes in the following props:

You can also style the QR Code itself using the params we pass into qrcode.react:

  • size {number - optional} Size
  • bgColor {string (CSS color) - optional} Background color
  • fgColor {string (CSS color) - optional} Foreground color

         

Link to demo

Donate

If you like this project and want to help support future development, test it out by buying me a 🍺: xrb_3ritoyx4zcixshfbezg4aycb49xbupw9ggink1rfm43tm6uh87t4ifuxg5dm

Contribute

PRs accepted. Note that this library uses a bunch of linters/code formatters to keep things consistent:

To get the project running locally, run yarn to install dependencies, and then run:

yarn run storybook

This will build the project and run storybook on localhost:6006. Storybook is also what drives the demo page. You can test out your changes by editing the *.story.ts files. These are what generate the stories on the left navigation.

License

MIT © Dan Caddigan