The Payment DApp is an easy to use application designed to mirror the Soroban payment flow currently found in Freighter.
You can explore this dapp at https://scaffold-soroban.stellar.org/ by choosing payment from the "select demo" dropdown.
The Payment DApp relies on the following dependencies:
-
Node (>=16.14.0 <=18.0.0): https://nodejs.org/en/download/
-
Yarn (v1.22.5 or newer): https://classic.yarnpkg.com/en/docs/install
-
Freighter wallet(v5.0 or newer): https://www.freighter.app/
The Payment DApp offers the following features:
-
Freighter Wallet Integration: The Payment DApp seamlessly integrates with Freighter/Albedo/XBull, allowing users to connect their wallet to access Soroban token balances and utilize their signing capabilities for secure and integrity-checked transactions.
-
Transaction Construction: Leveraging the Soroban token's contract interface, the DApp constructs transactions that invoke the
transfer
method of the token interface. This method facilitates the transfer of Soroban tokens from one address to another.
To use the Payment DApp, follow these steps:
- Install and set up one of the supported wallets.
-
Clone and navigate into the Payment DApp repository by running the following:
git clone https://github.com/stellar/soroban-react-payment.git cd soroban-react-payment
-
Install the dependencies by running the following:
yarn
-
If you are using the Freighter wallet, ensure that experimental mode is enabled. You can find this setting in Freighter wallet at:
Settings(⚙️)>Preferences>ENABLE EXPERIMENTAL MODE
.
-
Enable and add Soroban Tokens in Freighter.
-
Select the account that will be used to send Soroban tokens.
- Provide the required transaction parameters, such as the token to send,amount of tokens to transfer and the destination address.
- Review the transaction details to ensure accuracy and then click the "Sign with Freighter" once . Freighter will prompt you to sign the transaction with your wallet's private key.
- Once signed, the click the "Submit payment" button and the transaction will be submitted to the network.
- The Payment DApp will show a confirmation message once the transaction has been successfully submitted.
yarn && yarn build
yarn && yarn start
Contributions to the Payment DApp are welcome. If you encounter any issues, have suggestions for improvements, or would like to contribute to the codebase, please submit an issue, pull request, or reach out to us on Discord.