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
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>tocreate_invoice()—pay()accepts any listed token, converting it to the invoice base token via DEX before crediting.Technical Context
Involves
types.rs(addaccepted_tokens: Vec<Address>) andlib.rs. Addpay_with_token(env, payer, invoice_id, source_token, amount). Assertsource_tokenis inaccepted_tokens. Ifsource_token != invoice.token, invoke DEX swap. Credit converted amount toinvoice.funded.Acceptance Criteria
create_invoice()acceptsaccepted_tokenslistpay_with_token()accepts any token in the list"token not accepted"cargo clippypasses with zero warnings