Polygon FastLane
  • What is Polygon FastLane?
    • Overview
    • Design Principles
    • Components
    • Component Diagram
  • Getting Started as a Validator
    • Getting Started as a Validator
    • Connecting to a FastLane Sentry Node
      • Finding Your Enode Address & Peer ID
      • Adding FastLane as a Static Peer
    • Patching Your Sentry Nodes With The FastLane Patch
      • Installing from source
        • Patch Download
        • Patch Installation
      • Installing from packages
  • Withdrawing Validator Revenue
    • Validator Vault
      • Connect an Eligible Wallet
      • Revenue Redemption (withdrawal)
  • Searcher Guides
    • Getting Started as a Searcher
      • Solver Call Data
      • Submission Methods
      • Migration Guide for Searchers
    • Bundles (Backruns)
      • Bundle Format
      • Bid Submission
      • Bundle Requirements
      • Full Example
      • Subscribe Events
    • 4337 Bundles Integration Guide
      • Overview
      • How it works
      • RPC Reference
      • Examples
    • Searcher Contract Integration
      • Safety Considerations
      • atlasSolverCall
      • Direct Implementation
      • Proxy Implementation
      • Solver Concepts
      • Altas Bonding Concept
      • Bond atlETH
      • Estimating Solver Gas Charges
    • Addresses & Endpoints
    • Helpers
    • Common Mistakes
    • Atlas SDK's
  • Tools and Analytics
    • FastLane Bundle Explorer
      • Features Overview
      • Key Components
      • Usage Example
      • Error Codes & Troubleshooting
  • Key Concepts
    • Transaction Encoding
  • INFRASTRUCTURE
    • Health Status Endpoint
  • Reference
    • Relay JSON-RPC API
    • Relay REST API
    • Glossary of Terms
Powered by GitBook
On this page
  • Available SDKs​
  • Typescript
  1. Searcher Guides

Atlas SDK's

Atlas developer SDK integration

PreviousCommon MistakesNextFastLane Bundle Explorer

Last updated 6 months ago

Welcome to the Atlas SDK documentation. Our SDKs are designed to simplify the integration of Atlas Protocol into your applications, providing powerful tools for creating, managing, and executing operations within the Atlas ecosystem.

Available SDKs

Atlas offers two primary SDKs:

Both SDK provide helper functionality for encoding solver Operation. For Typescript particular helpful is the OperationsBuilder

Typescript

Installation

npm install @fastlane-labs/atlas-sdk

Or

yarn add @fastlane-labs/atlas-sdk

Creating a SolverOperation

You can then simply create a OperationBuilder to create a solver Operation


import { OperationBuilder, SolverOperation } from "@fastlane-labs/atlas-sdk";

const solverOp = OperationBuilder.newSolverOperation({
        from: solverSigner.address, // solver address
        to: atlasAddr, // atlasAddr address
        value: BigInt(0), // 0 value
        gas: BigInt(500000), // 500,000 gasLimit
        maxFeePerGas: maxFeePerGas,
        deadline: BigInt(0), // 0 deadline
        solver: solverSigner.address, // dAppOpSigner address
        control: dappControlAddr, // dappControl address
        userOpHash: userOpHash, 
        bidToken: "0x0000000000000000000000000000000000000000", // POL
        bidAmount: bidAmount,
        data: solverCallData,
        signature: "0x" // empty signature
    });
 

// Generate the solver signature
const solverSignature = await generateSolverSignature(solverOp);

// Set the solver signature
solverOp.setField("signature", solverSignature);
 

Encoding SolverOperation

SolverOperation class provides a helper function toStruct() which takes care of serialising and hex encode the SolverOperation.

//to Submit the data we need to JSON.stringify the struct
const generatePflBundle = (solverOp: SolverOperation, opportunityRawTx: string, bundleId: number): PflBundle => {
    return {
        id: bundleId,
        jsonrpc: "2.0",
        method: "pfl_addSearcherBundle",
        params: [`${opportunityRawTx}`, `${JSON.stringify(solverOp.toStruct())}`]
    }
}
​
TypeScript SDK
Golang SDK