Skip to content

Build invoice multi-currency support #120

@Kingsman-99

Description

@Kingsman-99

Label: complexity: high
Points: 200

Description

Global teams need to pay invoices in their local Stellar assets (XLM, USDC, EURC) without manual conversion. This issue adds accepted_tokens: Vec<Address> to create_invoice()pay() accepts any listed token, converting it to the invoice base token via DEX before crediting.

Technical Context

Involves types.rs (add accepted_tokens: Vec<Address>) and lib.rs. Add pay_with_token(env, payer, invoice_id, source_token, amount). Assert source_token is in accepted_tokens. If source_token != invoice.token, invoke DEX swap. Credit converted amount to invoice.funded.

Acceptance Criteria

  • create_invoice() accepts accepted_tokens list
  • pay_with_token() accepts any token in the list
  • Non-listed token panics with "token not accepted"
  • Accepted non-base token swapped to base token before crediting
  • Test pays with alternate token and verifies correct USDC amount credited
  • All existing cargo tests pass
  • cargo clippy passes with zero warnings

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 pts

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions