Prepare Source Transaction

This endpoint return all the neccessary information to execute source transaction.

GET https://api.layerswap.io/api/swaps/{id}/prepare_src_transaction

Prepare swap deposit for execution

Path Parameters

NameTypeDescription

id*

String

The Swap response data.id received in the create swap endpoint

Query Parameters

NameTypeDescription

from_address

String

Address from which the transaction is going to be executed

Headers

NameTypeDescription

X-LS-APIKEY*

API Key retrieved from Partner Setup

{
  "data": {
    "to_address": "0x5dA5C2a98e26FD28914b91212b1232D58eb9bbab",
    "data": "0xba2",
    "value": 0.009,
    "base_units": "9000000000000000",
    "chain_id": "5",
    "network": "ETHEREUM_GOERLI"
  },
  "error": null
}

Raw Request

curl -X 'GET' \
  'https://api.layerswap.io/api/swaps/{ID}/prepare_src_transaction?from_address=0xBaF6dC2E647aeb6F510f9e318856A1BCd66C5e19' \
  -H 'X-LS-APIKEY: {YOUR_APP_APIKEY}'

Raw Response

{
  "data": {
    "to_address": "0x5dA5C2a98e26FD28914b91212b1232D58eb9bbab",
    "data": "0xba2",
    "value": 0.009,
    "base_units": "9000000000000000",
    "chain_id": "5",
    "network": "ETHEREUM_GOERLI"
  },
  "error": null
}

Note that you should execute this transaction manually. You should compose it based on the response and send to your wallet for execution. (Ex. User's Metamask, wallet managed by Fireblocks)

Last updated

© 2023 Bransfer, Inc. All rights reserved.