Layerswap API
API Explorer
  • Overview
  • Partner Setup
  • UI Integration
    • Layerswap-hosted page
    • Embedded form
    • Customization
      • Interactive Builder
  • API Integration
    • Quickstart
    • API Reference
    • Swap lifecycle
    • Webhooks
    • DEPRECATED - V1 API Reference
      • Get Available Networks
      • Get Available Routes
      • Get Swap Rate
      • Create Fast Swap
      • Create Swap
      • Prepare Source Transaction
      • Get Swap
  • Mixed Integration
    • Swap Link
  • Data
    • Object types
    • Supported Platforms
      • Supported Networks
      • Supported Fiat Providers
      • Supported CEXes
Powered by GitBook

Layerswap

  • App
  • Explorer
  • Twitter
  • Discord

© 2023 Bransfer, Inc. All rights reserved.

On this page

Was this helpful?

Export as PDF
  1. API Integration
  2. DEPRECATED - V1 API Reference

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

Name
Type
Description

id*

String

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

Query Parameters

Name
Type
Description

from_address

String

Address from which the transaction is going to be executed

Headers

Name
Type
Description

X-LS-APIKEY*

{
  "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 1 year ago

Was this helpful?

API Key retrieved from

Partner Setup