πŸ”‘ Keagate is an open-source, high-performance alternative to popular cryptocurrency payment gateways such as Coinbase Commerce, CoinGate, BitPay, NOWPayments, CoinRemitter, CoinsPaid and more.

Overview

⛩️ Keagate – A High-Performance Cryptocurrency Payment Gateway

🚧 This project is actively in development 🚧


Table of Contents

About The Project

Keagate is a self-hosted, high-performance cryptocurrency payment gateway. Payments can administer via the API or with the built-in invoicing client (image below).

Currently support currencies: Solana, Cardano, Litecoin, and Dash. (Bitcoin, Ripple coming next)

Todo: all trezor compatible chains falls to coinlib, others are built custom here.

Invoice Preview

Purpose

  • No KYC
  • No fees (besides network) or middleman
  • Private
  • Self-hosted
  • Easily extensible for new currencies
  • Highly performant
  • No IP Blocking

Funds go directly to your wallet via the one-time addresses that are created for each payment.

Getting Started

Prerequisites

Installation

TODO Create Dockerfile (Nginx, Mongo no external, Node, Npm)

API Providers

In order to check wallet balances and broadcast transactions, Keagate needs to interact with particular blockchain APIs. There's a variety of providers out there that support different sets of blockchains. This packages bundles up connectors to popular providers with a simple, unified API.

Existing connectors can be seen in the packages/api-providers folder. All of the one available in this package provide generous free tiers. Simply pass your API keys with the configuration below.

Currently available API providers:

Name Available chains
NowNodes dash, ltc, btc
Tatum ltc, btc, ada, and xrp

It's very easy to add a provider, see TatumProvider.ts as an example.

Make sure that one of the available API providers cover each currency you plan on using.

Usage

Keagate requires some configuration. Create a file called local.json in /config, next to default.json, to edit of the parameters below. Use the provided default.json file as a reference (your local.json will override these).

To configure a single currency, add an object with the key of the currencies ticker with the following attributes:

Key Description Required Default
ADMIN_PUBLIC_KEY Public key (address) of Litecoin admin wallet Yes null (string)
ADMIN_PRIVATE_KEY Private key of Litecoin admin wallet. Used for programmatically sending transactions from admin No null (string)
PROVIDER The id of a provider in packages/api-providers. Yes except SOL null (AvailableProvider)
PROVIDER_PARAMS Parameters for a particular provider's constructor. Could be [API_KEY, REGION] like Tatum No null (string[])

Other root configuration options:

Key Description Required Default
KEAGATE_API_KEY Custom key that will be required in the administrative requests keagate-api-key requests to Keagate No null (string)
IP_WHITELIST List of IP address ["1.1.1.1" , "2.2.2.2",...] to be whitelisted for administrative requests No [] (string[])
TRANSACTION_TIMEOUT Milliseconds for which a transaction will be valid for No 1200000 [20 Minutes] (number)
TRANSACTION_REFRESH_TIME Milliseconds for which each active transaction will be re-scanned No 10000 [10 Seconds] (number)
TRANSACTION_SLIPPAGE_TOLERANCE Percentage of a payment that discounted as from a total payment.

Example: a TRANSACTION_SLIPPAGE_TOLERANCE of 0.02 for a 100 SOL payment will be fulfilled at 98 SOL.
No 0.02 (number)
MONGO_CONNECTION_STRING Connection string for mongodb instance, which is installed automatically with docker No mongodb://localhost:27017 (string)
MONGO_KEAGATE_DB Mongo database to use for storing/managing payments No keagate (string)
USE_SO_CHAIN SoChain is a free blockchain infrastructure API for that allows for 300 requests/minute free-of-charge.

Setting this to true will utilize SoChain for part of the btc, dash, and ltc payment process. Recommended
No true (boolean)
TESTNETS For development only. Turn on testnets for given currencies No false (boolean)

Your config/local.json could look something like:

{
  "dash": {
    "ADMIN_PUBLIC_KEY": "MY_WALLET_ADDRESS",
    "ADMIN_PRIVATE_KEY": "MY_PRIVATE_KEY",
    "PROVIDER": "NowNodes",
    "PROVIDER_PARAMS": ["MY_API_KEY"]
  },

  "KEAGATE_API_KEY": "abcd123",
  "IP_WHITELIST": ["1.1.1.1","2.2.2.2"]
  // ...
}

Development

Development experience and extensibility are a high priority for this package.

  1. Git clone this package.
  2. cd Keagate && npm i
  3. Add a mongoDB connection to the MONGO_CONNECTION_STRING attribute in config/local.json along with some admin wallet credentials. For development, the Mongo Atlas free tier works great.
  4. npm run dev to start the invoice client and backend.
    • Any changes in packages/invoice-client/src will be automatically reflected on refresh.
    • Any changes to the source of packages/backend/src will be reflected automatically via ts-node-dev.

Adding a currency

There's four steps in adding a currency to this package.

  1. Add the ticker, along with some metadata, to the currencies type in packages/common/src/currencies.ts.
  2. Create the admin wallet. This is where payments are finally sent to and presumably the real wallet of the client. Note that the admin wallet can also be used to programmatically send transactions as well.
    • Start by taking a look at Solana's admin wallet and note that you only need to implement two functions: getBalance and sendTransaction. The class that admin wallets inherit from, GenericAdminWallet, handles class inheritance.
  3. Create the transactional wallet. This class can be thought of a payment, since a new transactional wallet is created for every payment, along with a new Public Key and Private Key. Transactional wallets, and their associated payment data, are stored in Mongo.
    1. Start by taking a look at Solana's transactional wallet and note that you only need to implement three functions: fromNew, getBalance and _cashOut. The class that transactional wallets inherit from, GenericTransactionalWallet, handles the rest.
  4. Add both the transactional and admin wallet classes to packages/backend/src/currenciesToWallets.ts so it can be referred to by ticker across the project

And that's it! Start the dev environment and create a new payment of any amount with your new ticker.

Adding an API route

Customizing the invoice interface

The invoice client is a statically built React package (via Vite). This static build is served in backend. This functionality can be seen here.

Editing the react package will automatically build to dist, so just refresh the page to see the changes.

The source code in invoice client is pretty straight-forward, so anyone familiar with React (& TailwindCSS) should have an easy time making their desired alterations.

Adding a blockchain API provider

The invoice client is a statically built React package (via Vite). This static build is served in backend. This functionality can be seen here.

Editing the react package will automatically build to dist, so just refresh the page to see the changes.

The source code in invoice client is pretty straight-forward, so anyone familiar with React (& TailwindCSS) should have an easy time making their desired alterations.

You might also like...

AppRun is a JavaScript library for developing high-performance and reliable web applications using the elm inspired architecture, events and components.

AppRun is a JavaScript library for developing high-performance and reliable web applications using the elm inspired architecture, events and components.

AppRun AppRun is a JavaScript library for building reliable, high-performance web applications using the Elm-inspired architecture, events, and compon

Dec 20, 2022

🟒 Music player app with a modern homepage, fully-fledged music player, search, lyrics, song exploration features, search, popular music around you, worldwide top charts, and much more.

🟒 Music player app with a modern homepage, fully-fledged music player, search, lyrics, song exploration features, search, popular music around you, worldwide top charts, and much more.

Music-player-app see the project here. 1. Key Features 2. Technologies I've used Key Features: 🟒 Fully responsive clean UI. 🟒 Entirely mobile respo

Nov 16, 2022

An ultra-high performance stream reader for browser and Node.js

QuickReader An ultra-high performance stream reader for browser and Node.js, easy-to-use, zero dependency. Install npm i quickreader Demo import {Quic

Nov 28, 2022

πŸ‘‘ A tiny yet powerful tool for high-performance color manipulations and conversions

πŸ‘‘ A tiny yet powerful tool for high-performance color manipulations and conversions

Colord is a tiny yet powerful tool for high-performance color manipulations and conversions. Features πŸ“¦ Small: Just 1.7 KB gzipped (3x+ lighter than

Jan 3, 2023

A scalable, high-performance feature management and progressive experimentation platform

Introduction & Our Philosophy FeatBit is a scalable, high-performance Feature Management and Progressive Experimentation platform. Feature Management

Jan 1, 2023

High performance personalization & a/b testing example using Next.js, Edge Middleware, and Builder.io

High performance personalization & a/b testing example using Next.js, Edge Middleware, and Builder.io

Next.js + Builder.io Personalization & A/B Testing with Edge Middleware This is a fork of Next.js Commerce with Builder.io integrated and using Edge M

Sep 6, 2022

High performance JSX web views for S.js applications

High performance JSX web views for S.js applications

Surplus const name = S.data("world"), view = h1Hello {name()}!/h1; document.body.appendChild(view); Surplus is a compiler and runtime to all

Dec 30, 2022

Crawler Crypto using NodeJS for performance with Elasticsearch DB for high efficiency.

Coin crawler - Coingecko version Crawler using NodeJS for performance with Elasticsearch DB for high efficiency. Requirements For development, you wil

Jan 20, 2022

High performance (de)compression in an 8kB package

fflate High performance (de)compression in an 8kB package Why fflate? fflate (short for fast flate) is the fastest, smallest, and most versatile pure

Dec 28, 2022
Comments
  • 503 Error

    503 Error

    Hello,

    I get an error when I try to validate a litecoin transaction

    This is the error: error.log

    I tried to do local transactions with the same configuration and everything works fine

    System informations

    EC2 instance with no particular specifications

    opened by xPiston 6
Owner
MERN
null
JIT Compiler is a open source online code compiler. You can run more than 40+ most popular programming languages in your browser just-in-time using jitcompiler.

JIT Compiler is a open source online code compiler. You can run more than 40+ most popular programming languages in your browser just-in-time using jitcompiler.

Rajkumar Dusad 36 Jan 5, 2023
πŸͺ The IPFS gateway for NFT.Storage is not "another gateway", but a caching layer for NFTs that sits on top of existing IPFS public gateways.

nftstorage.link The IPFS gateway for nft.storage is not "another gateway", but a caching layer for NFT’s that sits on top of existing IPFS public gate

NFT.Storage 37 Dec 19, 2022
High performance and SEO friendly lazy loader for images (responsive and normal), iframes and more, that detects any visibility changes triggered through user interaction, CSS or JavaScript without configuration.

lazysizes lazysizes is a fast (jank-free), SEO-friendly and self-initializing lazyloader for images (including responsive images picture/srcset), ifra

Alexander Farkas 16.6k Jan 1, 2023
The world of cryptocurrencies is diverse and becoming more and more popular

We are providing an user with a simple learning resource for an intro into the CryptoCurrency World. Along with a community grown message board to assist with further learning.

null 3 Jun 20, 2022
An all new Titanfall VPK unpacker. Over 2x faster than the most popular alternative!

Harmony VPK Tool An electron-based app for unpacking Respawn VPK files. Super-fast and made with β™₯ Why use Harmony VPK Tool over cra0's VPKTool? It's

Harmony 16 Dec 19, 2022
Shikhar 4 Oct 9, 2022
A dashboard for managing orders and inventory for a wordpress e-commerce site which has woo commerce plugin installed

WordPressWooCommerceDashboard - A dashboard for managing orders and inventory for a wordpress e-commerce site which has woo commerce plugin installed. This program provides shipping tracking for Delhivery.

Vikrama Reddy 1 Jan 3, 2022
The open ransomware payment tracker

ransomwhere The open ransomware payment tracker Setup Install development dependencies in backend by running npm install. Development Open index.html

Jack Cable 68 Dec 13, 2022
The high-impact (popular) packages of npm

npm-high-impact The high-impact (popular) packages of npm. Contents What is this? When should I use this? Install Use API npmHighImpact npmTopDependen

Titus 26 Dec 21, 2022
πŸ’°The Shopify-like Digital Commerce engine provides an Open-Source πŸ†“ and Headless/Modular Architecture ⚑

?? The Shopify-like Digital Commerce ⚑ ?? The Shopify-like Digital Commerce engine provides an Open-Source ?? and Serverless Architecture ⚑ ?? The Sho

OceanSoft 7 Nov 7, 2022