This script sends money between two wallet addresses, using the Open Payments client.
The script creates an incoming payment on the receiving wallet address, and a quote on the sending wallet address (after getting grants for both). It also creates an interactive outgoing payment grant, which will require user interaction.
The script then finalizes the grant (after it's accepted interactively via the browser), and creates the outgoing payment.
- Make sure you have NodeJS installed
- Run
npm install
- Get a private key, client wallet address and keyId from the test wallet, and add them in the script.
- Pick a receiving wallet address, and a sending wallet address.
- Run
node index.js
- Click on the outputted URL, to accept the outgoing payment grant.
- Return to the terminal, hit enter. After this, the script will create the outgoing payment and funds will move between the receiver and the sender!