API Testing Script
This document will suggest different scenarios that you can test once the integration of an API is completed. The tests outlined below are meant to be performed in the testing environment
API-specific tests
Be aware!
Make sure to use a customerToken for txValide or the widget
txValidate/widget Tests
Test V1 - test beneficiary VASP resolution using blockchain analytics
Call txValidate by using the following destination address that should be resolved with the correspondent VASP
Asset | destination | expected VASP |
---|---|---|
ETH | 0xf35A6bD6E0459A4B53A27862c51A2A7292b383d1 | Binance |
BTC | 34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo | Binance |
ETH | 0x876EabF441B2EE5B5b0554Fd502a8E0600950cFa | Bitfinex |
BTC | bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97 | Bitfinex |
ETH | 0xAf1931c20ee0c11BEA17A41BfBbAd299B2763bc0 | Luno |
BTC | 3BMEXqGpG4FxBA1KWhRFufXfSTRgzfDBhJ | BitMEX |
ETH | 0xA9D1e08C7793af67e9d92fe308d5697FB81d3E43 | Coinbase |
Expected result: the widget or txValidate should respond something like the below:
{
"isValid": true,
"type": "TRAVELRULE",
"beneficiaryAddressType": "HOSTED",
"addressSource": "{{yourAlockchainAnalytics}}",
"beneficiaryVASPname": "{{beneficiaryVASP}}",
"warnings": [
"optional-beneficiaryAccountNumber",
"optional-beneficiaryGeographicAddress",
"optional-beneficiaryCountryOfResidence"
]
}
Test V2 - test the discovery of an addres saved in your address graph
- First complete test T1 ;
- Query txValidate or use the widget and make sure to provide the following:
Destination address: 0x71C76B6EC7ab8defB751B7401THISISATEST8976F
- Expected result: you should get a response containing the following line:
{
"isValid": true,
"type": "TRAVELRULE",
"beneficiaryAddressType": "HOSTED",
"addressSource": "ADDRESS_GRAPH",
"beneficiaryVASPname": "Notabene RoboVASP ACCEPT",
"warnings": [
"optional-beneficiaryAccountNumber",
"optional-beneficiaryGeographicAddress",
"optional-beneficiaryCountryOfResidence"
]
}
txCreate Tests
Test C1 - successful transfer
Test a successful travel rule transfer by rending a TR transfer to RoboVASP ACCEPT with Destination address: 0x71C76B6EC7ab8defB751B7401THISISATEST8976F
Expected result: Transaction Accepted
Test C2 - Test a declined travel rule transfer by rending a TR transfer to RoboVASP DECLINE
Expected result: Transaction Declined
Test C3 - Test Not ready response by rending a TR transfer to RoboVASP NOT READY
Expected result: Transaction in NOT READY status
Test C4 - Test the creation of a TR transfer directed to a non-custodial wallet
Expected result: Transaction in SAVED stauts
end2end withdrawal flow tests
This flow is meant to replicate the actual flow starting from the originatorVASP withdrawal screen. It comes in two flavors, with automatic identification of the beneficiaryVASP and without.
T1 - without automatic discovery of beneficiaryVASP
- Go to the withdrawal screen of your application;
- create a transfer from your withdrawal screen with the following data:
"transactionAsset": "ETH", "transactionAmount": "10000000000000000", "originatorVASPdid": "{{originatorVASPdid}}", "beneficiaryVASPdid": "did:ethr:0x5cb7821acae54a5a94939fd35db91f4b11d8cd85", "transactionBlockchainInfo": { "txHash": "", "origin": "", "destination": "0x71C76B6EC7ab8defB751B7401THISISATEST8976F" },
- Manually approve the created TR transfer in your VASP transaction dashboard
Expected result:
You should see the transaction in ACCEPTED status in the dashboard and should have received 4 notifications via the notification webhook
T2 - with automatic discovery based on the address book
Be aware!
To successfully perform this test make sure to have completed T1 before;
- Go to the withdrawal screen of your application;
- Create a transfer from your withdrawal screen with the following data:
Asset: ETH
Destination address: 0x71C76B6EC7ab8defB751B7401THISISATEST8976F
Amount: 10 - Manually approve the created TR transfer in your VASP transaction dashboard
Expected result:
You should see the transaction in ACCEPTED status in the dashboard and should have received four notifications via the notification webhook
T3 - with automatic discovery based on the blockchain analytics
- Go to the withdrawal screen of your application;
- Create a transfer from your withdrawal screen to one of the destination address outlined in this chart.
Expected results: you should see the transaction appearing in the dashboard directed to the VASP that is related to the destination address you used in the chart
end2end deposit tests
Deposit tests
D1 - test the deposit confirmation
- Create a deposit transaction from your Account Setup VASP to your primaryVASP;
- make sure the beneficiary address is an address that belong to the _primaryVASP
Expected result: the transactions should be automatically confirmed unig one of the address confirmations flows
D2 - test txNotify and add data with txUpdate
- Simulate the receive of a blockchain transaction or manually trigger txNotify, make sure the transaction hash does not match any TR transfer you already have in your transaction log;
- If you use an originator address, that can be resolved by the address graph or the blockchain analytics, you should expect the originator VASP to be automatically identified;
- Expected result: an incomplete incoming transaction should be displayed in your dashboard;
- Collect the missing data using the post transaction widget or other means, and use txUpdate to provide the missing information to the TR transfer.
- Expected result: the transaction should be in SENT or any subsequent status.
Updated about 2 months ago