🇺🇲
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
  • Logic
  • RouterData
  1. Protocolink SDK
  2. API SDK Interfaces

Global Types

Logic

interface Logic<TFields = any> {
  rid: string;
  fields: TFields;
}

The Logic<TFields = any> interface includes the following properties:

  • rid: An identity composed of the protocol and logicId.

  • fields: Information about the fields required for this Logic.

Note that TFields is a generic type parameter that can be replaced with any type.

RouterData

interface RouterData {
  chainId: number;
  account: string;
  logics: Logic[];
  permitData?: PermitSingleData | PermitBatchData;
  permitSig?: string;
  referral?: string;
  referrals?: { collector: string; rate: number }[];
}

The RouterData interface represents the data required to execute a router transaction. It includes the following properties:

  • chainId: The chain ID of the blockchain network.

  • account: The address of the user's wallet account.

  • logics: The Logics data.

  • permitData(optional): The permit data required for the transaction.

  • permitSig(optional): The signature of the permit data.

  • referral(optional): This property represents the address to which fees are sent when conducting on-chain fee-sharing.

  • referrals(optional): This property is used when you want to distribute fees to multiple addresses. It is an array of objects, where each object has two attributes:

    • collector: This is the address where a portion of the proceeds will be sent.

    • rate: The rate parameter represents the percentage allocation of fees to a particular collector. It is an integer value ranging from 1 to 10,000, where 1 represents 0.01%, and 10,000 represents 100%. The sum of all rate values within the referrals array should equal 10,000 to ensure that the entire fee amount is correctly distributed among the specified collectors.

PreviousAPI SDK InterfacesNextFlashLoan Logic

Last updated 1 year ago

⚒️