Limits & Stops SDK

Autonomy Limit Order / Stop Loss SDK interface

Installation:

To install the Limit/Stop interface you can use yarn or npm in your project.

yarn add -D @autonomylabs/limit-orders-react

or

npm install --save-dev @autonomylabs/limit-orders-react

Getting Started:

To start using the limit order and stop loss interface we have created an AutonomyProvider. You can easily wrap your app with the provider and pass the autonomy reducers into your redux store.

import { configureStore } from "@reduxjs/toolkit";
import { save, load } from "redux-localstorage-simple";
import { autonomyReducers } from "@autonomylabs/limit-orders-react";

const PERSISTED_KEYS: string[] = ["your_keys"];
const store = configureStore({
  reducer: {
    ...your_reducers,
    // Pass the autonomy reducers
    ...autonomyReducers,
  },
  middleware: [save({ states: PERSISTED_KEYS, debounce: 1000 })],
  preloadedState: load({ states: PERSISTED_KEYS }),
});
export default store;

You can then go to your main file and wrap your app with the AutonomyProvider.

Add the Limits Orders and Stops Losses:

You can easily then pass the order type (Limit or StopLoss) to our order components, AutonomyOrderPanel and AutonomyOrderHistoryPanel.

Autonomy Limit Order / Stop Loss SDK orders

Place limit & stoploss orders on any EVM chain.

Installation:

yarn add -D @autonomylabs/limit-stop-orders

or

npm install --save-dev @autonomylabs/limit-stop-orders

Initialize the SDK:

Approve Tokens:

To create limit orders and stop losses you must first approve the tokens on the Autonomy router.

Submit an Order:

Cancel an Order:

Order History:

Get all Orders:

Get open Orders:

Get executed Orders:

Get cancelled Orders:

Get Orders by type:

Reference integrations

Coming soon

Last updated

Was this helpful?