Skip to content

Examples

Using APIs that earn XRP

These examples have configured their earning currency to be XRP. We can create a new XRP-based API key using Dhali's pay terminal:

Pay Terminal

  • To access the XRPL Cluster API:

    PAYMENT_CLAIM=<USE THE PAYMENT TERMINAL>
    ENDPOINT='https://run.api.dhali.io/199fd80b-1776-4708-b1a1-4b2bb386435d/'
    curl -H "Payment-Claim: $PAYMENT_CLAIM" \
    -vv -X POST -d '{"method":"account_info","params":[{"account":"rL6rwNe6puyoN5X1BUy8pEQb6Un23m2f1m"}]}' \
    $ENDPOINT
    

  • To access the XRPL Services API:

    PAYMENT_CLAIM=<USE THE PAYMENT TERMINAL>
    ENDPOINT='https://run.api.dhali.io/d72283974-3929-4ed9-81f2-c837fd1e6cc5/xls20-nfts/all/issuers'
    curl -H "Payment-Claim: $PAYMENT_CLAIM" $ENDPOINT
    

  • To access Bithomp's API :
    PAYMENT_CLAIM=<USE THE PAYMENT TERMINAL>
    ENDPOINT='https://run.api.dhali.io/d995db530-7e57-46d1-ac8a-76324794e0c9/nft-count/xpunks?list=owners'
    curl -H "Payment-Claim: $PAYMENT_CLAIM" $ENDPOINT
    
  • To access Myrkle's API :
    PAYMENT_CLAIM=<USE THE PAYMENT TERMINAL>
    ENDPOINT='https://run.api.dhali.io/d2bb727c7-d44a-4ed3-a031-fd15b3903486/api/v1/object/account-checks/rL6rwNe6puyoN5X1BUy8pEQb6Un23m2f1m/'
    curl -H "Payment-Claim: $PAYMENT_CLAIM" $ENDPOINT
    
  • To access Indicator Success Rate :
    PAYMENT_CLAIM=<USE THE PAYMENT TERMINAL>
    ENDPOINT='https://run.api.dhali.io/39d1c91c-750b-4294-94fb-69e1b74c1162/ema-v2?symbol=BTC-USDT&interval=1day&limit=300'
    curl -H "Payment-Claim: $PAYMENT_CLAIM" $ENDPOINT
    

Customize the Payment Terminal

The payment terminal can be customized with parameters. This allows you to:

  • Provide users with clear instructions tailored to your API.
  • Control which payment networks (e.g., XRPL, Xahau, etc) users can use for payments based on your Dhali APIs (UUIDs).

Usage Examples

Description URL Behavior
Basic Usage https://pay.dhali.io - Defaults to XRPL.MAINNET.
- Shows default instructions for XRPL.MAINNET.
Specify UUIDs https://pay.dhali.io?uuids=uuid1,uuid2 - Displays payment networks for APIs uuid1 and uuid2.
- Shows custom instructions for each payment option, using a the API's base endpoint URL.