API

API Reference

Create limit order

create the limit order

POST https://open-api.openocean.finance/v1/:chainId/limit-order

Path Parameters

Name
Type
Description

chainId*

Number

1, 56, 137, 250, 43114, 42161, 10, 128, 1285, 100, 66, 25, 324, 59144, 8453, 1666600000

Request Body

Name
Type
Description

getTakerAmount*

String

from data

predicate*

String

from data

getMakerAmount*

String

from data

interaction

String

default: '0x'

allowedSender

String

default: '0x0000000000000000000000000000000000000000'

receiver

String

default: orderMaker

takerAsset*

String

from data, token address

makerAsset*

String

from data, token address

salt*

String

from data

data*

Object

from sdk

amountRate*

Number

makerAmount / takerAmount

expireTime*

String

limit order expire time

isActive*

boolean

true or false

remainingMakerAmount*

String

same with makerAmount

orderMaker*

String

wallet address

orderHash*

String

from sdk

signature*

String

from sdk

takerAmount*

String

amount with decimals

makerAmount*

String

amount with decimals

{
"code": 200,
}

Cancel limit order

cancel limit order

POST https://open-api.openocean.finance/v1/:chainId/limit-order/cancelLimitOrder

Path Parameters

Name
Type
Description

chainId*

number

1, 56, 137, 250, 43114

Request Body

Name
Type
Description

orderHash*

String

from dsk

{
"code": 200
}

get limit order

get limit order

GET https://open-api.openocean.finance/v1/:chainId/limit-order/all

Query Parameters

Name
Type
Description

chainId*

number

1, 56, 137, 250, 43114

statuses

String

eg: [1,2,3], 1-unfill, 2-fail, 3-cancel, 4-filled, 5-pending, 6- hash not exist, 7-expire

limit

number

limit count

{
    "code": 200,
    "data": [
        {
            "makerAmount": "500000000000000000000",
            "takerAmount": "2702702702702",
            "signature": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000041661329add47ed0f9433375d8be1e1f4ec1ade1d39a77f88d92ccbed712e88c0b64f7f0bbcfd42e4eb62642351c5cb19599e0517d73e4dfb2850241e3d5e3be741c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000",
            "orderHash": "0x3340338ac83a194cd6d2e7093d4e33c52357fc63cd52405cb0c6d9e512a508a5",
            "createDateTime": "2022-10-18T14:21:35.000Z",
            "orderMaker": "0x0000000000000000000000000000000000000001",
            "remainingMakerAmount": "500000000000000000000",
            "makerBalance": null,
            "makerAllowance": null,
            "expireTime": "2022-10-19T14:21:36.000Z",
            "statuses": 1,
            "data": {
                "makerAsset": "0xe9e7cea3dedca5984780bafc599bd69add087d56",
                "makerAssetSymbol": "BUSD",
                "makerAssetDecimals": 18,
                "makerAssetIcon": "https://ethapi.openocean.finance/logos/bsc/0xe9e7cea3dedca5984780bafc599bd69add087d56.png",
                "takerAsset": "0x156ab3346823b651294766e23e6cf87254d68962",
                "takerAssetSymbol": "LUNA",
                "takerAssetDecimals": 6,
                "takerAssetIcon": "https://ethapi.openocean.finance/logos/bsc/0x9029fdfae9a03135846381c7ce16595c3554e10a1.png",
                "getMakerAmount": "0xf4a215c300000000000000000000000000000000000000000000001b1ae4d6e2ef5000000000000000000000000000000000000000000000000000000000027545a2706e",
                "getTakerAmount": "0x296637bf00000000000000000000000000000000000000000000001b1ae4d6e2ef5000000000000000000000000000000000000000000000000000000000027545a2706e",
                "makerAssetData": "0x",
                "takerAssetData": "0x",
                "salt": "762950589674",
                "permit": "0x",
                "predicate": "0x961d5b1e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a8a0213bb2ce671e457ec14d08eb9d40e6333e2d00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002463592c2b00000000000000000000000000000000000000000000000000000000635007eb00000000000000000000000000000000000000000000000000000000",
                "interaction": "0x",
                "makingAmount": "500000000000000000000",
                "takingAmount": "2702702702702",
                "maker": "0x0000000000000000000000000000000000000001",
                "receiver": "0x0000000000000000000000000000000000000000",
                "allowedSender": "0x0000000000000000000000000000000000000000"
            },
            "makerRate": null,
            "takerRate": null
        }
    ]
}

get limit order by address

get limit order by address

GET https://open-api.openocean.finance/v1/:chainId/limit-order/address/:address

Query Parameters

Name
Type
Description

chainId*

number

1, 56, 137, 250, 43114

statuses

String

eg: [1,2,3], 1-unfill, 2-fail, 3-cancel, 4-filled, 5-pending, 6- hash not exist, 7-expire

limit

number

limit count

address*

String

user's wallet address

{
    "code": 200,
    "data": [
        {
            "makerAmount": "500000000000000000000",
            "takerAmount": "2702702702702",
            "signature": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000041661329add47ed0f9433375d8be1e1f4ec1ade1d39a77f88d92ccbed712e88c0b64f7f0bbcfd42e4eb62642351c5cb19599e0517d73e4dfb2850241e3d5e3be741c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000",
            "orderHash": "0x3340338ac83a194cd6d2e7093d4e33c52357fc63cd52405cb0c6d9e512a508a5",
            "createDateTime": "2022-10-18T14:21:35.000Z",
            "orderMaker": "0x0000000000000000000000000000000000000001",
            "remainingMakerAmount": "500000000000000000000",
            "makerBalance": null,
            "makerAllowance": null,
            "expireTime": "2022-10-19T14:21:36.000Z",
            "statuses": 1,
            "data": {
                "makerAsset": "0xe9e7cea3dedca5984780bafc599bd69add087d56",
                "makerAssetSymbol": "BUSD",
                "makerAssetDecimals": 18,
                "makerAssetIcon": "https://ethapi.openocean.finance/logos/bsc/0xe9e7cea3dedca5984780bafc599bd69add087d56.png",
                "takerAsset": "0x156ab3346823b651294766e23e6cf87254d68962",
                "takerAssetSymbol": "LUNA",
                "takerAssetDecimals": 6,
                "takerAssetIcon": "https://ethapi.openocean.finance/logos/bsc/0x9029fdfae9a03135846381c7ce16595c3554e10a1.png",
                "getMakerAmount": "0xf4a215c300000000000000000000000000000000000000000000001b1ae4d6e2ef5000000000000000000000000000000000000000000000000000000000027545a2706e",
                "getTakerAmount": "0x296637bf00000000000000000000000000000000000000000000001b1ae4d6e2ef5000000000000000000000000000000000000000000000000000000000027545a2706e",
                "makerAssetData": "0x",
                "takerAssetData": "0x",
                "salt": "762950589674",
                "permit": "0x",
                "predicate": "0x961d5b1e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a8a0213bb2ce671e457ec14d08eb9d40e6333e2d00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002463592c2b00000000000000000000000000000000000000000000000000000000635007eb00000000000000000000000000000000000000000000000000000000",
                "interaction": "0x",
                "makingAmount": "500000000000000000000",
                "takingAmount": "2702702702702",
                "maker": "0x0000000000000000000000000000000000000001",
                "receiver": "0x0000000000000000000000000000000000000000",
                "allowedSender": "0x0000000000000000000000000000000000000000"
            },
            "makerRate": null,
            "takerRate": null
        }
    ]
}

Last updated