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

Assetdestinationexpected VASP
ETH0xf35A6bD6E0459A4B53A27862c51A2A7292b383d1Binance
BTC34xp4vRoCGJym3xR7yCVPFHoCNxv4TwseoBinance
ETH0x876EabF441B2EE5B5b0554Fd502a8E0600950cFaBitfinex
BTCbc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97Bitfinex
ETH0xAf1931c20ee0c11BEA17A41BfBbAd299B2763bc0Luno
BTC3BMEXqGpG4FxBA1KWhRFufXfSTRgzfDBhJBitMEX
ETH0xA9D1e08C7793af67e9d92fe308d5697FB81d3E43Coinbase

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

  1. First complete test T1 ;
  2. Query txValidate or use the widget and make sure to provide the following: Destination address: 0x71C76B6EC7ab8defB751B7401THISISATEST8976F
  3. 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

  1. Go to the withdrawal screen of your application;
  2. 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"
        },
    
  1. 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;

  1. Go to the withdrawal screen of your application;
  2. Create a transfer from your withdrawal screen with the following data:
    Asset: ETH
    Destination address: 0x71C76B6EC7ab8defB751B7401THISISATEST8976F
    Amount: 10
  3. 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

  1. Go to the withdrawal screen of your application;
  2. 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

  1. Create a deposit transaction from your Account Setup VASP to your primaryVASP;
  2. 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

  1. 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;
    1. 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;
  2. Expected result: an incomplete incoming transaction should be displayed in your dashboard;
  3. Collect the missing data using the post transaction widget or other means, and use txUpdate to provide the missing information to the TR transfer.
  4. Expected result: the transaction should be in SENT or any subsequent status.