This project facilitates making payments using the Stellar blockchain. It supports payments with both native and issued assets.
- Node.js (v18 or higher)
- NPM (v6 or higher)
- Stellar Account
.envfile 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
-
Clone this repository: git clone https://github.com/joelorzet/stellar-payments.git
-
Navigate to the project directory: cd stellar-payments
-
Install the dependencies: npm install
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
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.
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 payThis script will execute the code that handles making a payment with a specified issued asset.
The serverPayment script is used to process payments on a server.
To run the serverPayment script:
node src/serverPayment.jsThe lastPayments script retrieves the last payments made.
To run the lastPayments script:
node src/lastPayments.jsThis project is licensed under the ISC License - see the LICENSE file for details.