Prepare a Transaction

In this guide, we will explain how to prepare a transaction, which is the first step of Overledger's prep-sign-execute process in order to submit transactions to the blockchain.

Prerequisites

Call the endpoint

🚧

Currently you can call this endpoint only with the address 8pouQXqfCkLnuoUoENTTTMvonweP5naNctDWHqLi7zfy and nonce account HT2THDwaenfU1kjbYDjLi3dmG8LwGSHTYuSFxdRLWM8a. Overledger Beta's wallet will soon be upgraded in order to allow any address to be used.

For example, to transfer 10 SOL to EaFn1yFWKEDTgk9LYCDia91txBaY6uL1Cmj7TJyFHDq8.

curl --request POST \
     --url https://hook.eu2.make.com/xmzuobdy8q07uqus4z3dmzrwkh9phpeu \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "location": {
    "technology": "solana",
    "network": "solana testnet"
  },
  "type": "Payment",
  "urgency": "Normal",
  "requestDetails": {
    "destination": [
      {
        "payment": {
          "amount": "10",
          "unit": "SOL"
        },
        "destinationId": "EaFn1yFWKEDTgk9LYCDia91txBaY6uL1Cmj7TJyFHDq8"
      }
    ],
    "message": "OVL Transaction Message",
    "overledgerSigningType": "overledger-javascript-library",
    "origin": [
      {
        "originId": "8pouQXqfCkLnuoUoENTTTMvonweP5naNctDWHqLi7zfy",
        "nonceAccountId": "HT2THDwaenfU1kjbYDjLi3dmG8LwGSHTYuSFxdRLWM8a"
      }
    ]
  }
}
'

If the request is successful, you would receive a response containing the payload, which you need to sign the transaction:

{
  "payload": "AQADBugIL2flJv0I6SG9F1cW/ntauqeP08wzESVIHN/wW04S5TKChH33KIpwWrq81Gr7Dm75JCHSzSeOb3NYbPqDNKIN0m4KWSjxkJ4rBZ52/9LwUoPVlviPRKbo+2wEi/AIegAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABUpTWpkpIQZNJOhxYNo4fHw1td28kruB5B+oQEEFRI0Gp9UXGSxWjuCKhF9z0peIzwNcMUWyGrNE2AYuqUAAAPyl5OyKwISNr/ELf2PAcYKrs49jbSUogPALouWOqbKrAwMDAQUABAQAAAAEAQAFc29sdHIDAgACDAIAAADoAwAAAAAAAA==",
  "signingAccountId": "8pouQXqfCkLnuoUoENTTTMvonweP5naNctDWHqLi7zfy"
}