A proof of concept application to monitor and send transactions on the XRPL Testnet blockchain.
docker compose up
The monitor will start automatically and listen for transactions on the ledger that match wallet addresses from the addresses table. Port 3001 is then exposed as default and can be queried with any of the below endpoints.
This application uses NestJS and Postgresql.
The frontend is currently under development can be accessed at http://0.0.0.0:3000.
Endpoints can be queried with Postman here: https://www.postman.com/cloudy-meadow-777256/workspace/xrpl-bridge.
Requests and responses are detailed further below.
GET /wallet
- Get all wallets from wallets table.
GET /wallet/new
- Get a new wallet and fund from the Testnet faucet.
GET /tx
- Get all transactions that have been stored by the monitor.
POST /tx
- Create and submit a payment to the XRPL ledger.
GET /address
- Get all addresses from the addresses table.
POST /address
- Add a new address to the addresses table.
PATCH /address
- Update an existing address on the addresses table.
DELETE /address
- Delete an existing address from the addresses table.
If you need to start completely fresh, you can run:
make cbu
We can create a wallet, sent a transaction and store the monitors data:
- Query the GET /wallet/new endpoint and take note of the Seed.
- Query the same endpoint, this time taking note of the classicAddress. Both of these addresses will automatically added to the Wallets and Addresses tables. The monitor will immediately listen to transactions on the XRPL ledger with these account details.
- Query the POST /tx endpoint using the above details to make a transaction.
- Query the GET /tx endpoint to see history of transactions made in the ledger.
GET /wallet
:
Request: Empty
Response: (http: 200 OK)
[
{
"id": 1,
"publickey": "ED3949D822651DB05C34348A0B1FAE2289BB5448DDEDD5F3C3C0B0DF16AA9F4DC5",
"privatekey": "ED3FB668330B201EE7B7A833FC8F75B9A0732A945D5CAF053C17AE36678913679D",
"classicaddress": "rpDhtr9qTjMmKpxaBw8U8DAkzzTCF8ByYj",
"seed": "sEdVZeEt29QWA2QcruFgYuPtYBJ85gd"
},
{
"id": 2,
"publickey": "ED9AC6CDBAA2425311F6B80997BB5ABE8D2EBCFE00D99CBDC4644D6725D0E8A868",
"privatekey": "ED5074ADC8283FE616FD26F022E7657DFDA7542D808C7BBBC6E9BE7B080C09E589",
"classicaddress": "r3Ec4e3UTuAvKDU49drqMNshwrSRrFkbZo",
"seed": "sEdSkwNGCQiWmounCouDBmbuNKhobW9"
}
]
GET /wallet/new
:
Request: Empty
Response: (http: 200 OK)
{
"publicKey": "ED41EB23A9E1754FC035216C6D8602DD1F657A9F31948A91AFC36E5B66A95604C6",
"privateKey": "ED683532899D7BF95ED3CD09DAE32D567FF9A0A2A9F6BEF16530F4B45333D642D0",
"classicAddress": "rfg9nFBrqGdRQNEcxQAu2XRUEEcGyuYu7u",
"seed": "sEdSCengiJ18YBKFAJDAs11nFPVrHDp"
}
GET /tx
:
Request: Empty
Response: (http: 200 OK)
[
{
"id": 1,
"ledgerindex": 35353194,
"ledgerhash": "B94F60DAD16EE7118B5F9836D48624EFC62901F24DB77F8E35A60C4EBDBCF7C1",
"account": "rff5WQCE6LeqKUrcqaum6nK38XFHgvDu1n",
"destination": "rfg9nFBrqGdRQNEcxQAu2XRUEEcGyuYu7u",
"ammount": 100,
"fee": 12,
"txsig": "2B0740BF7498F44BC543F835419F00FA32C9BEA3D85D284F670134BA57D317AD00F28C066E66C0FCECF0774C170318A36A97DE9FB7975762A34A8669E72CB307"
}
]
POST /tx
:
Request:
{
"TransactionType": "Payment",
"Seed": "sEd7sRFNfHV5Eo7453EDncJCR3BFcnM",
"Amount": "100",
"Destination": "rfg9nFBrqGdRQNEcxQAu2XRUEEcGyuYu7u"
}
Response: (http: 200 OK)
[
{
"account": "rfg9nFBrqGdRQNEcxQAu2XRUEEcGyuYu7u",
"balances": [
{
"currency": "XRP",
"value": "0.0001"
}
]
},
{
"account": "rff5WQCE6LeqKUrcqaum6nK38XFHgvDu1n",
"balances": [
{
"currency": "XRP",
"value": "-0.000112"
}
]
}
]
GET /address
:
Request: Empty
Response: (http: 200 OK)
[
{
"id": 1,
"address": "rff5WQCE6LeqKUrcqaum6nK38XFHgvDu1n"
},
{
"id": 2,
"address": "rfg9nFBrqGdRQNEcxQAu2XRUEEcGyuYu7u"
},
]
POST /address
:
Request:
{
"address": "rff5WQCE6LeqKUrcqaum6nK38XFHgvDu1n"
}
Response: Empty (http 201: Created)
PATCH /address
:
Request:
{
"address": "rff5WQCE6LeqKUrcqaum6nK38XFHgvDu1n",
"newAddress": "rff5WQCE6LeqKUrcqaum6nK38XFHgvDu1"
}
Response: Empty (http 204: OK)
DELETE /address
:
Request:
{
"address": "rff5WQCE6LeqKUrcqaum6nK38XFHgvDu1n"
}
Response: Empty (http 204: OK)
You may start a Postgresql Docker container separately and develop the application using your editor with the following instructions: (Database connection will be automatically handled or can be manually configured in .env)
$ npm install
Start the PostgreSQL docker image manually.
$ npm run start:dev
- Author - George Gale