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

greencryptopay-nodejs

v1.0.2

Published

Greencryptopay library for nodejs

Downloads

3

Readme

Greencryptopay library for Node.js

The Greencryptopay library for Node.js allows you to easily integrate the Greencryptopay payment system into your Node.js projects. This library provides convenient methods for interacting with the Greencryptopay API.

Installation

You can install this package using npm:

npm install greencryptopay-nodejs --save

Dependencies

This package depends on the "node-fetch" library version ^2.6. If it's not already installed, it will be automatically installed when you install this library.

Standard API

Getting Started:

import Api from 'greencryptopay-nodejs';

(async () => {
    
    // Standard API
    const standardApi = Api.make('standard');
    
    // Standard API testnet
    const standardApi = Api.make('standard', true);

    // Sign up
    if (!merchantId || !secretKey) {
        const data = await standardApi.merchant('percent', 'https://example.com/callback');
        merchantId = data['merchant_id'];
        secretKey = data['secret_key'];
    }

    standardApi.setMerchantId(merchantId);
    standardApi.setSecretKey(secretKey);
    
})()

Sign up:

| Name | Parameters | Validation | Description | | :---- | :---- | :---- |:---- | | merchant | string feeTypestring callbackUrl| Enum: [percent, fix]Max: 200 | Fee typeURL to send notifications about payments |

Operations:

| Name | Parameters | Validation | Description | | :---- | :---- | :---- |:---- | | paymentAddress | string currencystring callbackUrl string orderId string currencyFrom string amountFrom | Enum: [btc]Max: 200 Max: 50 Enum: [usd] | CurrencyURL to send notifications about payments Order identifier in your system Currency to convert from Amount to convert | | withdraw | string currency array recipients | Enum: [btc] | Currency Array structure: [['address' => 'Recipient address', 'amount' => 'Recipient's amount']] | | withdrawAll | string currency string recipientAddress | Enum: [btc] | Currency Recipient address |

Stats:

| Name | Parameters | Validation | Description | | :---- | :---- | :---- |:---- | | merchantState | string currency | Enum: [btc] | Currency | | merchantPaymentAddress | string currency string / null fromTimestamp string / null toTimestamp int / null limit int / null page string / null order| Enum: [btc] Timestamp in UTC Timestamp in UTC Min:1, Max:200 Min:1 Enum: [asc, desc] | Currency Address creation timestamp in UTC, from (inclusive, ex. "2035-12-31T15:30:59")Address creation timestamp in UTC, to (inclusive, ex. "2035-12-31T15:30:59") Number of records in the response Page number Records order ascending or descending | | merchantIncomingPayments | string currency string / null paymentAddress string / null txid string / null fromTimestamp string / null toTimestamp int / null limit int / null page string / null order | Enum: [btc] Timestamp in UTC Timestamp in UTC Min:1, Max:200 Min:1 Enum: [asc, desc] | Currency Show only payments to specific payment address Show only payments with specific transaction Payment timestamp in UTC, from (inclusive, ex. "2035-12-31T15:30:59") Payment timestamp in UTC, to (inclusive, ex. "2035-12-31T15:30:59") Number of records in the response Page number Records order ascending or descending | | merchantWithdrawals | string currency string / null fromTimestamp string / null toTimestamp int / null limit int / null page string / null order | Enum: [btc] Timestamp in UTC Timestamp in UTC Min:1, Max:200 Min:1 Enum: [asc, desc] | CurrencyWithdrawal timestamp in UTC, from (inclusive, ex. "2035-12-31T15:30:59") Withdrawal timestamp in UTC, to (inclusive, ex. "2035-12-31T15:30:59") Number of records in the response Page number Records order ascending or descending | | paymentAddressCallbacks | string currency string paymentAddress string / null txid string / null fromTimestamp string / null toTimestamp int / null limit int / null page string / null order | Enum: [btc] Timestamp in UTC Timestamp in UTC Min:1, Max:200 Min:1 Enum: [asc, desc] | Currency Payment address Show only payment callbacks with specific transaction Callback timestamp in UTC, from (inclusive, ex. "2035-12-31T15:30:59") Callback timestamp in UTC, to (inclusive, ex. "2035-12-31T15:30:59") Number of records in the response Page number Records order ascending or descending | | paymentAddressState | string currency string paymentAddress | Enum: [btc] | Currency Payment address |

Transfer API

Getting Started:

import Api from 'greencryptopay-nodejs';

(async () => {
    
    // Transfer API
    const transferApi = Api.make('transfer');

    // Transfer API testnet
    const transferApi = Api.make('transfer', true);

    // Sign up
    if (!merchantId) {
        const data = await transferApi.merchant();
        merchantId = data['merchant_id'];
    }

    transferApi.setMerchantId(merchantId);
    
})()

Sign up:

| Name | Parameters | Validation | Description | | :---- | :---- | :---- |:---- | | merchant | — | — | — |

Operations:

| Name | Parameters | Validation | Description | | :---- | :---- | :---- |:---- | | paymentAddress | string currency string recipientAddress string feeType string callbackUrl string orderId string currencyFrom string amountFrom | Enum: [btc] Enum: [percent, fix] Max:200 Max:50 Enum: [usd, rub, try, eur, zar, gbp, uah, aud, brl, pln] | Currency Recipient address Fee type URL to send notifications about payments Order identifier in your system Currency to convert from Amount to convert |

Stats:

| Name | Parameters | Validation | Description | | :---- | :---- | :---- |:---- | | paymentAddressState | string currency string paymentAddress | Enum: [btc] | Currency Show only payments to specific payment address | | paymentAddressPayments | string currency string paymentAddress string / null txid string / null fromTimestamp string / null toTimestamp int / null limit int / null page string / null order | Enum: [btc] Timestamp in UTC Timestamp in UTC Min:1, Max:200 Min:1 Enum: [asc, desc] | Currency Payment address Show only specific transaction payments Payment timestamp in UTC, from (inclusive, ex. "2035-12-31T15:30:59") Payment timestamp in UTC, to (inclusive, ex. "2035-12-31T15:30:59") Number of records in the response Page number Records order ascending or descending | | paymentAddressCallbacks | string currency string paymentAddress string / null txid string / null fromTimestamp string / null toTimestamp int / null limit int / null page string / null order | Enum: [btc] Timestamp in UTC Timestamp in UTC Min:1, Max:200 Min:1 Enum: [asc, desc] | Currency Payment address Show only payment callbacks with specific transaction Payment timestamp in UTC, from (inclusive, ex. "2035-12-31T15:30:59") Payment timestamp in UTC, to (inclusive, ex. "2035-12-31T15:30:59") Number of records in the response Page number Records order ascending or descending | | merchantState | string currency | Enum: [btc] | Currency | | merchantPaymentAddress | string currency string / null fromTimestamp string / null toTimestamp int / null limit int / null page string / null order| Enum: [btc] Timestamp in UTC Timestamp in UTC Min:1, Max:200 Min:1 Enum: [asc, desc] | Currency Address creation timestamp in UTC, from (inclusive, ex. "2035-12-31T15:30:59")Address creation timestamp in UTC, to (inclusive, ex. "2035-12-31T15:30:59") Number of records in the response Page number Records order ascending or descending | | merchantPayments | string currency string / null txid string / null fromTimestamp string / null toTimestamp int / null limit int / null page string / null order | Enum: [btc] Timestamp in UTC Timestamp in UTC Min:1, Max:200 Min:1 Enum: [asc, desc] | Currency Show only specific transaction payments Payment timestamp in UTC, from (inclusive, ex. "2035-12-31T15:30:59") Payment timestamp in UTC, to (inclusive, ex. "2035-12-31T15:30:59") Number of records in the response Page number Records order ascending or descending |