Make a ETH payment

Discover how to pay 0.001 ETH on chain between two wallets and how to add a payment flow on chain within your app.

What you will learn

In this tutorial, we will run through how to pay 0.001 ETH on chain between two wallets using the Ethereum Sepolia testnet. We will also cover how to add a payment flow on chain within your app.

This tutorial enables you to move money near-instantly using the Ethereum Sepolia testnet:

  • This guide's API calls and transactions occur within the testnet environment. No funds with financial value will be transferred
  • You can adapt the sample code in this tutorial to serve as a framework for your development and create transactions that transfer financial value.

Prerequisites

  • Select a destination address ( i.e. payee) to receive the payment of 0.001 ETH
  • Obtain an authorization token
    You must obtain an authorisation token to interact with Overledger's API and call any endpoint. This token will authenticate your requests and grant you access to the necessary endpoints. Please follow the authentication process provided by Overledger to get your authorisation token.

Prepare a 0.001 ETH payment transaction payload

The first step of submitting a transaction to Overledger requires a request toprepare the transaction for signing. This step transforms a standardised transaction request (for any DLT) into a payload that can be signed and executed on the specific DLT network requested. In Overledger's response, there will be a request ID used to sign and execute the transaction.

πŸ“˜

If you wish to change the blockchain in the request, please see the list of supported networks.

POST
https://api.sandbox.overledger.io/v2/preparation/transaction
{
    "location": {
        "technology": "Ethereum",
        "network": "ethereum sepolia Testnet"
    },
    "type": "PAYMENT",
    "urgency": "normal",
    "requestDetails": {
        "message": "sample Message",
        "overledgerSigningType": "overledger-javascript-library",
        "origin": [
            {
                "originId": "0x4f84ac29b182e0e474Ea3fc17950200BB4765F31"
            }
        ],
        "destination": [
            {
                "destinationId": "0x03B651d2251eA03cf3ceD600E3B4948303A94BE6",
                "payment": {
                    "amount": "0.001",
                    "unit": "ETH"
                }
            }
        ]
    }
}
{
    "requestId": "1b7f8167-fca3-409c-b5a5-1f130be5d7c6",
    "gatewayFee": {
        "amount": "0",
        "unit": "QNT"
    },
    "dltFee": {
        "amount": "0.00077973438036255",
        "unit": "ETH"
    },
    "nativeData": {
        "nonce": 0,
        "chainId": 11155111,
        "chain": "testnet",
        "hardfork": "london",
        "to": "0x03B651d2251eA03cf3ceD600E3B4948303A94BE6",
        "gas": "21414",
        "maxFeePerGas": "36412364825",
        "maxPriorityFeePerGas": "1000000000",
        "value": "1000000000000000",
        "data": "00000000000073616d706c65204d657373616765"
    }
}

Sign 0.001 ETH payment transaction payload

The second step takes the payload from the prepare step response and signs the transaction using the transaction signing key id as the keyId.

POST
https://api.sandbox.overledger.io/api/transaction-signing-sandbox
{
    "transactionSigningResponderName": "CTA",
    "keyId": "0x4f84ac29b182e0e474Ea3fc17950200BB4765F31",
    "requestId": "1b7f8167-fca3-409c-b5a5-1f130be5d7c6",
    "gatewayFee": {
        "amount": "0",
        "unit": "QNT"
    },
    "dltFee": {
        "amount": "0.00077973438036255",
        "unit": "ETH"
    },
    "nativeData": {
        "nonce": 0,
        "chainId": 11155111,
        "chain": "testnet",
        "hardfork": "london",
        "to": "0x03B651d2251eA03cf3ceD600E3B4948303A94BE6",
        "gas": "21414",
        "maxFeePerGas": "36412364825",
        "maxPriorityFeePerGas": "1000000000",
        "value": "1000000000000000",
        "data": "00000000000073616d706c65204d657373616765"
    }
}
{
    "requestId": "1b7f8167-fca3-409c-b5a5-1f130be5d7c6",
    "signed": "0x02f88983aa36a780843b9aca0085087a5898198253a69403b651d2251ea03cf3ced600e3b4948303a94be687038d7ea4c680009400000000000073616d706c65204d657373616765c080a06376463d26b298e659e5f64c151841bb4431d859db90fbf2946c033b1b544032a068f65dcc5e79d851a3eb5a7f765117314201d55187a82b061b64552cdea71b85"
}

Execute 0.001 ETH payment transaction on Sepolia testnet

The third step submits the signed payload to the blockchain using the requestId returned in the prepare step.

The body of the execute request is the response to the signing transaction request.

POST
https://api.sandbox.overledger.io/v2/execution/transaction
{
    "requestId": "1b7f8167-fca3-409c-b5a5-1f130be5d7c6",
    "signed": "0x02f88983aa36a780843b9aca0085087a5898198253a69403b651d2251ea03cf3ced600e3b4948303a94be687038d7ea4c680009400000000000073616d706c65204d657373616765c080a06376463d26b298e659e5f64c151841bb4431d859db90fbf2946c033b1b544032a068f65dcc5e79d851a3eb5a7f765117314201d55187a82b061b64552cdea71b85"
}
{
    "requestId": "1b7f8167-fca3-409c-b5a5-1f130be5d7c6",
    "overledgerTransactionId": "5d5e429f-9f88-415e-8e0b-c6729d55307d",
    "transactionId": "0x1191e515119bb3ba085a28d98215b40c54b161f22305e0fa038959448d424ce9",
    "type": "payment",
    "location": {
        "technology": "ethereum",
        "network": "ethereum sepolia testnet"
    },
    "urgency": "normal",
    "status": {
        "value": "PENDING",
        "code": "TXN1002",
        "description": "The transaction has been successfully broadcasted to the network. The status will next be updated after a sufficient block number has been reached. At this point we can be confident that the transaction will be successful or will have failed.",
        "message": "Transaction is pending.",
        "timestamp": "1710259789"
    }
}

Your transaction is then submitted to the blockchain.

The response will indicate that it is successfully submitted to the blockchain but has yet to be added to the blockchain. This is why the status is labeled as pending in the response.

πŸ‘

To verify if your payment was successful, you can check on the Sepolia Etherscan

Sepolia Etherscan of 0.001 ETH Payments

Sepolia Etherscan of 0.001 ETH Payments