Skip to content

Example scripts on how to use the API to create various orders.

Notifications You must be signed in to change notification settings

debridge-finance/api-integrator-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Integrator Example

This repository contains examples of various scripts, covering the basic integration scenarios. The goal is to provide hands-on examples that can be further extended for the intended use-cases.

These examples will consume some of your funds if not changed.

The code is provided as-is, without any guarantees that it will work. We are not responsible for any damages incurred by running it.

Prerequisites

The prerequisites for running it are:

  • NodeJS 18+
  • installing dependencies
  • A .env file in the project root

Environment Variables

There are several environment variables you need to set in the .env. file:

SIGNER_PK="0x......"
SOL_PK="..."
POLYGON_RPC_URL="https://polygon-mainnet.g.alchemy.com/v2/<api_key>"
BNB_RPC_URL="https://bnb-mainnet.g.alchemy.com/v2/<api_key>"
ARB_RPC_URL="https://arb-mainnet.g.alchemy.com/v2/<api_key>"
SOL_RPC_URL="https://solana-mainnet.g.alchemy.com/v2/<api_key>"

Installing Dependencies

To quickly switch to a supported node version:

nvm use

To install the dependencies, run:

npm install

Running The Scripts

One of the ways of running the scripts is:

npx tsx ./src/scripts/orders/example-swap.ts

About

Example scripts on how to use the API to create various orders.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •