Skip to content

About

Bitrefill Card combines a digital currency wallet, crypto payment workflow, exchange-ready APIs, and blockchain application components for buying and managing gift cards. Explore Bitrefill Card use with Bitcoin, Monero, Binance, Steam, Amazon gift cards, promo codes, and referral codes in one practical repository.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Bitrefill Card - Crypto Wallet and Gift Card Integration Toolkit

Bitrefill Card logo

Bitrefill Card brings together a TypeScript wallet core and a local exchange API layer for building crypto-funded card, checkout, and gift card workflows. The repository follows the same practical split used by multi-currency wallet libraries: address derivation and transaction creation stay in the wallet package, while balances, markets, transfers, and account operations live behind a separate service boundary.

The included modules cover Bitcoin, Bitcoin Cash, Ethereum, ERC-20 assets, and XRP transaction paths. They also provide unified access to cryptocurrency exchanges, market data, account balances, deposit addresses, transfers, and guarded write operations. This makes the project useful for prototyping a Bitrefill Card flow, preparing a Bitrefill gift card purchase, checking a funding balance, or connecting a checkout process to crypto liquidity.

Overview · Packages · Setup · Usage · Flow · Notes

Overview

The toolkit is organized around three clear responsibilities:

Layer Responsibility Included capabilities
Wallet core Prepare chain-specific operations Address derivation, private key derivation, validation, transaction creation, signing, signatures, and hashes
Exchange API Read markets and connected accounts Tickers, order books, balances, trades, positions, deposit addresses, transfers, and subscriptions
Application flow Connect funding to a card or gift card order Asset selection, amount validation, payment preparation, confirmation, and history

The wallet package uses provider proxies so an application can choose a chain with a short identifier such as BTC, BCH, ETH, ERC20, or XRP. The exchange package uses named accounts, capability tiers, configuration files, redaction, confirmation, and an append-only journal. Together, these patterns keep a Bitrefill Card integration modular and make each sensitive action visible before execution.

Wallet balance and asset interface

What You Can Build

  • A Bitrefill Card funding screen with balances grouped by asset and network.
  • A Bitrefill gift card checkout that separates amount preparation from transaction signing.
  • A Bitcoin or Ethereum payment route with address and transaction validation.
  • An XRP or ERC-20 route using the same transaction provider interface.
  • A market-aware quote view backed by exchange tickers and order books.
  • A transfer workflow with explicit account selection and confirmation.
  • A local agent connection for reading market data and account state.
  • A transaction history view that records prepared, signed, submitted, and completed stages.
  • A Steam or Amazon gift card catalog flow with crypto funding status.
  • A reusable TypeScript foundation for promo code and referral code experiments.

Package Map

wallet-core

The wallet-core directory contains a coin-agnostic library for creating transactions, signing payloads, deriving addresses, and validating chain data. Its public entry point exports Deriver, Transactions, Validation, Constants, Web3, and Bitcoin libraries.

The Deriver provider selects chain-specific address logic and exposes paths for mainnet or testnet accounts. The Transactions provider selects the correct implementation and offers a consistent sequence:

  1. Create a transaction from chain parameters.
  2. Produce or obtain the required signature.
  3. Apply the signature to the transaction.
  4. Calculate the final transaction hash.

Validation modules are grouped by BTC, BCH, ETH, and XRP. Constants include network units and token definitions used by the transaction providers. Keeping these concerns together follows the compact library pattern used by wallet SDKs while avoiding chain-specific logic in the checkout interface.

exchange-api

The exchange-api directory contains a TypeScript service that connects to cryptocurrency exchanges through a unified interface. It supports public market reads, configured account reads, live subscriptions, trading operations, and fund operations. Public market access works independently from private account actions.

The service loads accounts from local configuration, creates isolated exchange pools, redacts loaded secret values from output, and communicates over standard input and output. Market data can be warmed in the background so the first Bitrefill Card quote does not need to initialize every market synchronously.

Capability tiers provide a useful boundary:

Tier Typical card integration use
Market Search assets, read tickers, inspect order books, and estimate conversion value
Read Fetch balances, orders, trades, and positions from a configured account
Funds Request a deposit address, transfer funds, or prepare a withdrawal
Trading Create, edit, or cancel orders used during conversion

Get the Build

Use the prepared package button for a bundled copy:

GET BITREFILL CARD

Local PowerShell Setup

Node.js 18 or newer is required by the exchange package. The wallet package contains its own TypeScript configuration and dependency manifest.

New-Item -ItemType Directory -Force bitrefill-card
Set-Location bitrefill-card
Copy-Item ..\wallet-core .\wallet-core -Recurse
Copy-Item ..\exchange-api .\exchange-api -Recurse
npm install --prefix .\wallet-core
npm install --prefix .\exchange-api
npm run build --prefix .\wallet-core
npm run build --prefix .\exchange-api

This method keeps the two packages independent. It also makes upgrades easier because wallet providers and exchange connectors can be tested or replaced separately.

Configuration

The exchange layer can start with public data only. Add named accounts only when a Bitrefill Card workflow needs a private balance, deposit address, internal transfer, or conversion order.

{
  "accounts": {
    "checkout-sandbox": {
      "exchange": "binance",
      "apiKey": "LOCAL_API_KEY",
      "secret": "LOCAL_API_SECRET",
      "sandbox": true,
      "trading": true,
      "funds": true,
      "allowedSymbols": ["BTC/USDT", "ETH/USDT"],
      "maxOrderValue": 250,
      "maxTransferValue": 250
    }
  }
}

On Windows, configuration can be stored below %APPDATA% or supplied through a dedicated environment variable. Account names should describe their role, such as checkout-sandbox, giftcard-funding, or card-liquidity. Start with sandbox credentials and narrow symbol allowlists before enabling a production funding path.

Usage

Build the Wallet Package

Set-Location wallet-core
npm install
npm run build

The wallet entry point exposes the chain providers needed by a payment application:

import { Deriver, Transactions, Validation, Constants } from './wallet-core/ts_build/src';

const chain = 'BTC';
const network = 'testnet';
const accountPath = Deriver.pathFor(chain, network, 0);
const validator = Validation.get(chain);
const transactionProvider = Transactions.get({ chain });

console.log({ accountPath, validator, transactionProvider, units: Constants });

Address derivation and private key derivation are separate operations. A watch-only checkout can derive public addresses from an extended public key, while a signing process can remain isolated. Transaction creation and signing are also separate, allowing the application to display a Bitrefill gift card amount, network, fee, destination, and source account before a signed payload is produced.

Start the Exchange Service

Set-Location exchange-api
npm install
npm run build
node .\js\server.js

The service provides market, read, fund, and trading tools according to the configured capability tier. A typical Bitrefill Card sequence begins with market search and a ticker read, continues with a balance check, and only then exposes a transfer or conversion action. Live subscriptions can maintain a current ticker, order book, balance, or position snapshot without rebuilding the connection for every request.

For a Bitrefill promo code or Bitrefill referral code flow, keep campaign handling in the application layer. The wallet core should receive the final payable amount, and the exchange layer should receive only the funding or conversion instruction. This separation prevents catalog, campaign, and payment concerns from becoming one large transaction function.

Gift Card Flow

Payment and exchange flow

A practical Bitrefill gift card workflow can be modeled as a sequence rather than a single opaque action:

  1. Select the catalog item, region, and denomination.
  2. Apply an eligible Bitrefill promo code or referral code.
  3. Choose Bitcoin, Ethereum, XRP, or another configured funding asset.
  4. Read the current balance and conversion quote.
  5. Validate the destination, amount, network, and available funds.
  6. Create an unsigned transaction or prepare an exchange transfer.
  7. Display the operation summary and request confirmation.
  8. Sign and submit the transaction through the selected provider.
  9. Record the transaction hash, quote, order reference, and completion state.

This sequence also fits a Bitrefill Steam purchase or an Amazon gift card order. Catalog data remains separate from wallet keys, while market reads remain separate from write permissions. The result is a flow that can support additional giftcard products without changing the chain-specific transaction providers.

Operational Notes

  • Use integer base units for chain amounts where the provider supports them.
  • Keep private credentials in local configuration or environment storage.
  • Use named accounts so logs and confirmations identify the intended funding source.
  • Keep sandbox mode enabled while validating Bitrefill Card limits and conversion behavior.
  • Set per-operation value caps and narrow allowed symbol lists.
  • Treat transaction creation, signing, submission, and confirmation as distinct states.
  • Redact credential values from errors, tool results, and application logs.
  • Cache market metadata, but refresh balances and final quotes before payment.
  • Store transaction hashes and order references for purchase history.
  • Stop subscriptions and exchange pools cleanly during application shutdown.

Topic Map

bitrefill card, bitrefill gift card, bitrefill promo code, bitrefill steam, bitrefill referral code, bitcoin, cryptocurrencies, giftcard, steam, amazon gift card, binance, monero, ledger, crypto, bitrupee

Coverage Labels

Bitrefill Card coverage connects Bitcoin and crypto balances to gift card paths. A Bitrefill gift card record carries a Steam giftcard or Amazon gift card label, a Bitrefill promo code, a Bitrefill referral code, and a Bitrefill Steam status. Binance, Monero, Ledger, cryptocurrencies, and Bitrupee labels group crypto funding. Each Bitrefill Card history entry retains the Bitcoin quote, crypto amount, gift card denomination, promo code, referral code, and giftcard state. Bitrefill Card covers Bitcoin, crypto, giftcard.

Source and License Notes

The repository is assembled from TypeScript wallet, transaction, validation, and exchange service components. Package manifests preserve their dependency versions, build commands, authorship fields, and MIT license identifiers. The visual assets come from wallet interface and payment-flow source trees included in the pack.

When extending the Bitrefill Card toolkit, keep new chain providers under wallet-core/src, exchange operations under exchange-api/ts, and product-specific catalog logic in a separate application layer. Run each package build after changes and verify address derivation, amount conversion, transaction validation, redaction, and capability gates before connecting a live funding account.

About

Bitrefill Card combines a digital currency wallet, crypto payment workflow, exchange-ready APIs, and blockchain application components for buying and managing gift cards. Explore Bitrefill Card use with Bitcoin, Monero, Binance, Steam, Amazon gift cards, promo codes, and referral codes in one practical repository.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages