Skip to content

bigger-tech/stellar-payments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stellar Payments

This project facilitates making payments using the Stellar blockchain. It supports payments with both native and issued assets.

Prerequisites

  • Node.js (v18 or higher)
  • NPM (v6 or higher)
  • Stellar Account
  • .env file with the following variables: SERVER_URL=https://horizon-testnet.stellar.org USER_ACCOUNT_SECRET=your_stellar_account_secret_key DESTINATION_ACCOUNT=destination_stellar_account_public_key

Installation

  1. Clone this repository: git clone https://github.com/joelorzet/stellar-payments.git

  2. Navigate to the project directory: cd stellar-payments

  3. Install the dependencies: npm install

Configuration

Add a .env file to the root of the project and include the following environment variables:

SERVER_URL=https://horizon-testnet.stellar.org
USER_ACCOUNT_SECRET=your_stellar_account_secret_key
DESTINATION_ACCOUNT=destination_stellar_account_public_key

Usage

Making a Payment with Native Asset

By default, the project is set up to make a payment with the native Stellar asset (XLM).

To run the payment with native asset script: npm run pay

This script will execute the code that handles making a payment with XLM.

Making a Payment with Issued Asset

To make a payment with an issued asset, you need to modify the index.js file to import from the issued asset script instead of the native asset script.

Update index.js:

import { main } from "./src/paymentWithIssuedAsset.js";

main();

Then, run the payment script:

npm run pay

This script will execute the code that handles making a payment with a specified issued asset.

Running Other Scripts

Running serverPayment

The serverPayment script is used to process payments on a server.

To run the serverPayment script:

node src/serverPayment.js

Running lastPayments

The lastPayments script retrieves the last payments made.

To run the lastPayments script:

node src/lastPayments.js

License

This project is licensed under the ISC License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published