Skip to content

feat: implement buildPaymentOp() transaction helper — closes #112#134

Open
spiffamani wants to merge 1 commit into
amina69:mainfrom
spiffamani:feat/build-payment-op-112
Open

feat: implement buildPaymentOp() transaction helper — closes #112#134
spiffamani wants to merge 1 commit into
amina69:mainfrom
spiffamani:feat/build-payment-op-112

Conversation

@spiffamani

Copy link
Copy Markdown

Summary

Implements buildPaymentOp() helper for building XLM payment operations, closing #112.

Changes

  • src/transactions/index.ts — Added buildPaymentOp()
  • src/index.ts — Exported buildPaymentOp from public surface
  • tests/unit/transactions/buildPaymentOp.test.ts — 9 unit tests

Usage

import { buildPaymentOp } from '@petad/stellar-sdk';

const op = buildPaymentOp({
  destination: 'GBBD...LA5',
  amount: '10.5',
});

Tasks Completed

  • Accepts destination, amount, asset (default native XLM)
  • Validates destination with isValidPublicKey()
  • Validates amount with isValidAmount()
  • Returns Stellar SDK Payment operation object
  • Throws ValidationError for invalid inputs
  • Unit tests: valid payment op, invalid destination throws, zero amount throws

Test Results

Tests: 87 passed, 87 total
Test Suites: 10 passed, 10 total

Checklist

  • npm test passes
  • No new runtime dependencies
  • Narrowly scoped to described behavior

- Accept destination, amount, asset (default native XLM)
- Validate destination with isValidPublicKey()
- Validate amount with isValidAmount()
- Return Stellar SDK Payment operation object
- Throw ValidationError for invalid inputs
- Export buildPaymentOp from public index
- Add 9 unit tests covering valid op, invalid destination, zero amount
@drips-wave

drips-wave Bot commented Mar 28, 2026

Copy link
Copy Markdown

@spiffamani Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@amina69

amina69 commented Mar 30, 2026

Copy link
Copy Markdown
Owner

@spiffamani you are making pr to the wrong branch, read the conributing.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants