Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SAC Transfer Functionality #27

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ShantelPeters
Copy link

This PR implements the functionality to enable interactions with Stellar Asset Contracts (SACs) in the Basic Payment App.

Changes Made
  • Implemented createContractTransferTransaction function in src/lib/stellar/transactions.js
  • Function handles both regular payments and SAC transfers
  • Detects contract addresses using StrKey.isValidContract()
  • Uses Contract.call() for SAC transfers
  • Maintains existing functionality for regular payments
Addressing Previous Comments
  • Moved the SAC transfer logic from walletStore.sign() to a separate function in transactions.js
  • Transaction is now built before being presented to the user for signing
  • The function checks whether the recipient address is a contract or a regular address
  • Consistent with other transaction-creating functions in the module

TODO

  • Update previewPaymentTransaction in +page.svelte to use the new createContractTransferTransaction function
  • Implement RPC server simulation for contract interactions (if required)

Testing

  • Tested with both regular Stellar accounts and contract addresses
  • Verified correct handling of different asset types

Please review the changes and let me know if any further modifications are needed.

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