Bit Capital

The Bit Capital Developer Hub

Welcome to the Bit Capital developer hub. You'll find comprehensive guides and documentation to help you start working with Bit Capital as quickly as possible, as well as support if you get stuck. Let's jump right in!

Guides    API Reference

P2P Payments

Peer to Peer Payments are a fast and reliable way to transfer Assets between Wallets.

P2P works by creating Transactions, that each may contain multiple Payments. Payments from the same Transaction may even handle different Assets, but only if all Assets are from the same provider.

Transactions are embed on the Stellar blockchain and are immutable after processing. You can't edit a Transaction after it's ready - you will need to create a new one to revert any mistakes.

When creating multiple payments at once, you may choose between Split Payments and Bulk Payments.

Split Payments are faster to process and access, as they generate a single Transaction. As a drawback, all payments in a Split Payment have the same source, and all Assets must belong to the same provider.

This is the default approach, event for a single payment. You may pass an array with a single recipient.

const source = '9b1d1baa-a7a6-4cd9-ac40-616514d548b7';

// Pay 100 BRLD to Bob
const bob = {
  asset: 'root', // 'root' for BRLD, or the asset code
  amount: '10.00000', // number string with at most 6 decimal places
  destination: '82b24cfc-8421-419c-9ff8-333d0e91cdaa', // Bob Wallet ID
};

// Pay 35 BRLD to Josh
const josh = {
  asset: 'root', // 'root' for BRLD, or the asset code
  amount: '35',
  destination: '2d008a35-69b5-4f45-9ba2-bff7e0650097', // Josh  Wallet ID
};

// Perform P2P transaction
const transaction = await bitcapital.payments().pay({
  source,
  recipients: [bob, josh],
  // Optional scheduling
  scheduleFor: new Date(Date.now() + 60 * 1000),
});

Bulk Payments

Bulk Payments creates multiple transactions at once, and enables you to specify different sources to different payments. Creating additional Transactions that may slow the processing queue and occur in additional costs.

Bulk Payments

Sending payments in bulks under development and is not currently available in production environments.

A bulk payment with multiple sources and assets may be created with:

// Source Wallet ID
const alan = '75baeaf6-925e-49ec-afd3-593a8a73e155';
const paul = 'f4b58152-14b1-4690-bb62-2b32bb656cc6';

// Alan pays 100 BRLD to bob
const bob = {
  source: alan,
  recipients: [{
    asset: 'root', // 'root' for BRLD, or the asset code
    amount: '100',
    destination: '82b24cfc-8421-419c-9ff8-333d0e91cdaa', // Bob Wallet ID
  }],
};

// Paul pays 0.035 BTC to josh
const josh = {
  source: paul,
  recipients: [{
    asset: 'btc', // 'root' for BRLD, or the asset code
    amount: '0.035',
    destination: '2d008a35-69b5-4f45-9ba2-bff7e0650097', // Josh Wallet ID
  }],
};

const transaction = await bitcapital.payments().pay([bob, josh]);

Updated about a month ago


P2P Payments


Peer to Peer Payments are a fast and reliable way to transfer Assets between Wallets.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.