The Swapper
  • πŸ™ŒWelcome to Swapper API!
  • πŸ“„Privacy Policy
  • 🌐Official Links
  • Swap API
    • πŸš€Quick Start
      • βœ…Set Allowance
      • βœ…Send Transactions
  • πŸ”—API Reference
  • 🟒GET Price
  • 🟒GET Quote
  • $SWAP Token
    • πŸš€How Can You Buy $SWAP?
  • πŸͺ™Tokenomics $SWAP
  • πŸ—ΊοΈ$SWAP Roadmap
  • Swapper Market Makers
    • ⚑Swapper Market Maker
Powered by GitBook
On this page
  1. Swap API
  2. Quick Start

Set Allowance

Before the SWAP transaction, you need to get permission from the user for the amount of tokens equal to the transaction amount.

API Key: Ru31BKdr99rGlsyN69

import Swapper from "swapper"

const service = new Swapper({ apiKey: 'YOUR_API_KEY' });

service.setAllowance({
  ownerAddress: '0x123', // your web3 wallet address
  sellTokenAddress: '0x3019bf2a2ef8040c242c9a4c5c4bd4c81678b2a1', // token address to create allowance for
});
PreviousQuick StartNextSend Transactions

Last updated 2 years ago

πŸš€
βœ