🇺🇲
Protocolink
  • 🔮Overview
  • 🌟Why Protocolink?
  • 💡Use Cases
    • Flash Loans
    • Permit2 Amplifier
    • Zap-in & Zap-out
    • Position Management
    • Multi-Action Bundling
  • 📋Networks & Protocols
  • 🛡️Security & Audits
  • 💎Fees
  • ❓FAQ
  • Protocolink API
    • 🔮Overview
      • Swap & Supply (Example)
    • 📗Swagger
      • Request Protocols
      • Request Tokens
      • Request Quote
      • Estimate Logics Result
      • Request Transaction Data
  • Protocolink SDK
    • 🔮Overview
    • 1️⃣Install SDK
    • 2️⃣Build Logics
    • 3️⃣Estimate Router Data
    • 4️⃣Send Router Transaction
    • ⚒️API SDK Interfaces
      • Global Types
      • FlashLoan Logic
      • Aave V2
      • Aave V3
      • Balancer V2
      • Compound V3
      • Iolend
      • Magicsea
      • Morphoblue
      • OpenOcean V2
      • ParaSwap V5
      • Permit2
      • Spark
      • Stargate
      • Stargate V2
      • SyncSwap
      • Uniswap V3
      • Utility
      • Wagmi
      • ZeroEx V4
    • ⚒️Common SDK Interfaces
      • Constants
      • Network
      • Token
      • Web3Toolkit
      • Utility Functions
  • Lending SDK
    • 🔮Overview
    • ✳️SDK
      • Open By Collateral
      • Open By Debt
      • Close
      • Leverage By Collateral
      • Leverage By Debt
      • Deleverage
      • Collateral swap
      • Debt swap
      • Zap supply
      • Zap withdraw
      • Zap repay
      • Zap borrow
  • Smart Contract
    • 🔮Overview
      • Router
      • Agent
      • Callback
      • Fees
      • Utility
      • Data Type
      • ERC721/ERC1155 Support
    • 📑Deployment Addresses
    • 🧑‍💻Security Review Details
  • COMPOUND KIT
    • 🔮Overview
    • ✳️SDK
      • Leverage
      • Deleverage
      • Collateral Swap
      • Zap Supply
      • Zap Withdraw
      • Zap Repay
      • Zap Borrow
    • 📗API
  • Video Tutorials
    • 1. Introducing Protocolink
    • 2. Lending SDK
    • 3. Protocolink Q&A
  • Social medias
    • Twitter
  • Support
Powered by GitBook
On this page
  1. Protocolink SDK
  2. Common SDK Interfaces

Web3Toolkit

The Web3Toolkit class is used to interact with RPC in order to simplify the development process. It has the following properties and methods.

  • Properties:

    • chainId: A readonly property that returns the current chain ID.

    • network: A readonly property that returns the Network object for the current chain.

    • provider: A readonly property that returns the web3 provider.

    • nativeToken: A readonly property that returns the Token class instance for the native token of the current chain.

    • wrappedNativeToken: A readonly property that returns the Token class instance for the wrapped native token of the current chain.

  • Constructor:

    • constructor(chainId, provider?): A constructor that initializes the Web3Toolkit object with a specified chainId and optional provider.

  • Instance methods:

    • getToken: A method that returns a Token class instance for the specified token or token address.

    • getTokens: A method that returns an array of Token class instances for the specified array of token addresses.

    • getBalance: A method that returns the balance of the specified account for the specified token or token address.

    • getAllowance: A method that returns the allowance of the specified account for the specified token or token address and spender.

    • getAllowances: A method that returns an array of allowances for the specified account, array of token addresses, and spender.

PreviousTokenNextUtility Functions

Last updated 1 year ago

⚒️