SafeSwap
Open SafeSwap
  • 👋Introduction to SafeSwap
  • Learn
    • 🤔How SafeSwap Works
    • 🪙SHA Token
    • ⛽Fee Structure
    • 💰Fee Distribution
    • 👑SafeNodes
    • 📚Glossary
  • User Guides
    • 🔄Swap Tokens
    • 📊Token Dashboard
  • Technical
    • ⚛️Cross-Chain Atomic Swaps
    • 🔐HTLC
    • 🛡️Security Measures
    • ⛓️Supported Blockchains
    • 👝Supported Wallets
    • 🕵️Audits
  • Builders
    • 🌍Hello World!
    • 🏗️Cross-Chain Use Cases
    • 🖥️Token Listing
    • 👨‍💻Whitelabel Integration
    • 📖API Integration Guide
      • Prerequisites
      • What is a Swap?
      • Perform a Swap
        • Initiate a Swap
        • Send Fees
        • Create the Swap in API
        • Wait/Poll for the Swap
        • Complete the Swap
        • Cancel/Refund
      • Smart Contract Details
      • Our Swap Addresses
      • API Details
  • About
    • Safe Haven
    • SafeTech
    • Support
Powered by GitBook
On this page
  • API Keys
  • Chain Options
  • API Endpoints
  1. Builders
  2. API Integration Guide

API Details

API Keys

All calls require an API Key. Contact us to get one. Include this API Key in the X-API-KEY header of all requests to our service.

Chain Options

For API calls that require a chain name, the available chain names are: ETHEREUM, VECHAIN, BSC, MATIC, BASE, OPTIMISM.

API Endpoints

  • GET /swaps: Returns swap details. Must contain a query string of ?swapId=345... or ?firstAddress=0x123...&firstChain=VECHAIN&secondAddress=0x234...&secondChain=ETHEREUM

  • POST /swaps: Create a Swap. Payload is

    SwapDetails {
      sourceChain: ChainName;
      sourceContractId: string; // prefixed with 0x
      sourceSender: string; // prefixed with 0x
      targetChain: ChainName;
      targetTokenAddress: string; // prefixed with 0x
      targetReceiver: string; // prefixed with 0x
      sourceFeeTx: string; // prefixed with 0x
      targetFeeTx: string; // prefixed with 0x
    }
  • GET /gas-estimates: Shows the required fees for a Swap. Requires query string of ?sourceChain=VECHAIN&targetChain=ETHEREUM

  • GET /tokens: Shows the available tokens for swapping.

PreviousOur Swap AddressesNextSafe Haven

Last updated 1 year ago

📖