Transaction API

1. Get the current server time

  • Path: /account/time

  • Method: GET

  • Response:

Parameter

Type

Example

Description

data

number

1730975545000

timestamp

  • Response example:

{
    "code": 0,
    "msg": "ok",
    "data": 1730975545000
}

2. Gmail login

  • Path:/account/socialLogin

  • Method: POST

  • Request body:

Parameter

isRequired

Type

Example

Description

social

true

string

google

social(google,telegram,twitter)

code

true

string

4vy...

auth code

  • Currently only Google auth

  • Response:

Parameter

Type

Example

Description

token

string

0529a86ed1f54d1b551b2d37e52aba64279fe70

api-key

email

string

google email

address

string

DVcxFHjnDJKrej8eAouYWLkkiqf9aAwu5Z3PRpJuDyg2

generate wallet address

  • Response example:

{
    "code": 0,
    "msg": "ok",
    "data": {
        "token": "0529a86ed1f54d1b551b2d37e52aba64279fe70",
        "email": "123@gmail.com",
        "address": "DVcxFHjnDJKrej8eAouYWLkkiqf9aAwu5Z3PRpJuDyg2"
    }
}

3. Wallet login

  • Path:/account/walletLogin

  • Method: POST

  • Request body:

Parameter

isRequired

Type

Example

Description

address

true

string

DVcxFH...

wallet address

signature

true

string

0xbabe03...

signature

timestamp

true

number

1730975545000

timestamp

Wallet sign message:

action:OpenOcean Authentication  
onlySignOn:https://openocean.finance
timestamp:1730975545000
  • Response:

Parameter

Type

Example

Description

token

string

0529a86ed1f54d1b551b2d37e52aba64279fe70

api-key

wallet

string

7mwQLwDJpxCJ2qRLH288yWUq8f7RLRcXw6jBi1VCjXXV

user wallet address

address

string

DVcxFHjnDJKrej8eAouYWLkkiqf9aAwu5Z3PRpJuDyg2

wallet address

  • Response example:

{
    "code": 0,
    "msg": "ok",
    "data": {
        "token": "0529a86ed1f54d1b551b2d37e52aba64279fe70",
        "wallet": "7mwQLwDJpxCJ2qRLH288yWUq8f7RLRcXw6jBi1VCjXXV",
        "address": "DVcxFHjnDJKrej8eAouYWLkkiqf9aAwu5Z3PRpJuDyg2"
    }
}

4. Withdraw

  • Path:/account/withdraw

  • Method:POST

  • Request headers:

Parameter

isRequired

Type

Example

Description

api-key

true

string

0529a86...

api-key

timestamp

true

number

1730975545000

timestamp

  • Request body:

parameter

isRequired

type

example

description

address

true

string

0xECb87...

destination address

token

true

string

0xbabe03...

token address

amount

true

number

100000000000

amount(with decimals)

  • Response:

parameter

type

example

description

data

string

qyMtnbbSiMbw3e9.....

signature hash

  • Response example:

{
    "code": 0,
    "msg": "ok",
    "data": "qyMtnbbSiMbw3e9j2Xe6MWBfiuqhy6BNtMsHoEfoU4GPBwAduZNd7N6WHwkdrxwTLQZchnXKbqxfGF9kjtiRqcq"
}

5. Quote before launch

  • Path: /account/calc

  • Method: POST

  • Request body:

Parameter

isRequired

Type

Example

Description

source

true

string

pump

pump/moonshot

type

true

string

buy

buy/sell

data

true

object

{}

trade data

  • Pump coinData:

Parameter

isRequired

Type

Example

Description

virtual_sol_reserves

true

number

110364752010

curve virtual_sol_reserves

virtual_token_reserves

true

number

291669210039976

curve virtual_token_reserves

  • Moonshot coinData: { moonshot: { curvePosition: 110364752010 }}

Parameter

isRequired

Type

Example

Description

curvePosition

true

number

110364752010

moonshot curvePosition

  • Trade data:

Parameter

isRequired

Type

Example

Description

mintAddress

true

string

AY7TrgZ...

token address

tokenAmount

true

number

25124

meme amount(without decimals)

baseAmount

true

number

0

SOL amount(without decimals)

quoteAsset

true

object

{}

quote asset

baseAsset

true

object

{}

base asset

slippageDecimal

true

number

0.02

slippage 2%

buyType

true

string

base

buy baseAsset / buy quoteAsset

coinData

true

object

{}

pump coinData / moonshot coinData

  • Pump coinData:

 {
    "virtual_sol_reserves": 30000000011,
    "virtual_token_reserves": 1072999999766229
}
  • Moonshot coinData:

{
    "moonshot": {
        "curvePosition": 737892960959399
    }
}
  • Request body example:

{
    "source": "pump",
    "type": "buy",
    "data": {
        "mintAddress": "AY7TrgZuX3KFut3qYKtrcyx4SgBR7766y25LRrDrpump",
        "tokenAmount": 327647,
        "baseAmount": 0,
        "buyType": "base",
        "slippageDecimal": 0.02,
        "coinData": {
            "virtual_sol_reserves": 30000000011,
            "virtual_token_reserves": 1072999999766229
        },
        "quoteAsset": {
            "symbol": "Crypto",
            "address": "AY7TrgZuX3KFut3qYKtrcyx4SgBR7766y25LRrDrpump",
            "decimals": 6,
            "icon": "https://ipfs.io/ipfs/QmWqQo9rAayaXdmjddiptchchyY1wvsg1dSpVFkkXM49pw"
        },
        "baseAsset": {
            "symbol": "SOL",
            "address": "So11111111111111111111111111111111111111112",
            "decimals": 9,
            "icon": "https://s3.openocean.finance/token_logos/logos/solana/So11111111111111111111111111111111111111112.png"
        }
    }
}
  • Response:

Parameter

Type

Example

Description

data

number

125.232545

out amount(without decimals)

  • Response json:

{
    "code": 0,
    "msg": "ok",
    "data": 125.232545
}

6. Buying and selling before launch

  • Path:/account/trade

  • Method:POST

  • Request headers:

Parameter

isRequired

Type

Example

Description

api-key

true

string

0529a86...

api-key

timestamp

true

number

1730975545000

timestamp

  • Request body:

Parameter

isRequired

Type

Example

Description

source

true

string

pump

pump/moonshot

type

true

string

buy

buy/sell

data

true

object

{}

trade data

  • Pump coinData:

Parameter

isRequired

Type

Example

Description

virtual_sol_reserves

true

number

110364752010

curve virtual_sol_reserves

virtual_token_reserves

true

number

291669210039976

curve virtual_token_reserves

bonding_curve

true

string

Csv3AVwj...

bonding_curve address

associated_bonding_curve

true

string

Cnb5Ev7...

associated_bonding_curve address

  • Trade data:

Parameter

isRequired

Type

Example

Description

mintAddress

true

string

AY7TrgZ...

token address

tokenAmount

true

number

0.1

meme amount(without decimals)

baseAmount

true

number

0.1

SOL amount(without decimals)

priorityFeeInSol

true

number

0.0001

ComputeBudgetProgram.setComputeUnitPrice

slippageDecimal

true

number

0.02

slippage 2%

quoteAsset

true

object

{}

quote asset

baseAsset

true

object

{}

base asset

coinData

false

object

{}

pump meme curve data (only pump)

  • Request body example:

{
    "source": "pump",
    "type": "buy",
    "data": {
        "mintAddress": "Ah97HXgucHpWtmqVBgYKe3Vq52WSdqbDsDwoXm5Wpump",
        "baseAmount": 0.0001,
        "tokenAmount": 34717.097414,
        "priorityFeeInSol": 0.0001,
        "slippageDecimal": 0.02,
        "quoteAsset": {
            "symbol": "HAWK",
            "address": "Ah97HXgucHpWtmqVBgYKe3Vq52WSdqbDsDwoXm5Wpump",
            "decimals": 6,
            "icon": "https://ipfs.io/ipfs/QmPhT6c62hy6Kiu12ZpLf4ViRsMkTBt8Xo8ctfj21jXfJS",
        },
        "baseAsset": {
            "symbol": "SOL",
            "address": "So11111111111111111111111111111111111111112",
            "decimals": 9,
            "icon": "https://s3.openocean.finance/token_logos/logos/solana/So11111111111111111111111111111111111111112.png",
        },
        "coinData": {
            "virtual_sol_reserves": 110364752010,
            "virtual_token_reserves": 291669210039976,
            "bonding_curve": "Csv3AVwjFXqnBEGRaSjQrzwNJb7BJnX11wjXQf1AVqo5",
            "associated_bonding_curve": "Cnb5Ev7cvspBHqHM8JnhLujxC7Ps7Brs7i6LeXHQNRvn"
        }
    }
}
  • Response:

Parameter

Type

Example

Description

data

string

qyMtnbbSiMbw3e9.....

signature hash

  • Response example:

{
    "code": 0,
    "msg": "ok",
    "data": "qyMtnbbSiMbw3e9j2Xe6MWBfiuqhy6BNtMsHoEfoU4GPBwAduZNd7N6WHwkdrxwTLQZchnXKbqxfGF9kjtiRqcq"
}

7. Quote after launch (buying and selling)

  • Path:/account/quote

  • Method:POST

  • Request headers:

Parameter

isRequired

Type

Example

Description

api-key

true

string

0529a86...

api-key

timestamp

true

number

1730975545000

timestamp

  • Request body:

Parameter

isRequired

Type

Example

Description

inTokenSymbol

true

string

SOL

inTokenSymbol

inTokenAddress

true

string

So111111111...

inTokenAddress

outTokenSymbol

true

string

FUNGY

outTokenSymbol

outTokenAddress

true

string

J74ufcR....

outTokenAddress

amount

true

number

1000000

in token amount(with decimals)

slippage

true

number

100

slippage 1%

  • Response:

Parameter

Type

Example

Description

data

number

124522000

out amount(with decimals)

  • Response example:

{
    "code": 0,
    "msg": "ok",
    "data": 124522000
}

8. Swap after launch (buying and selling)

  • Path:/account/swap

  • Method:POST

  • Request headers:

Parameter

isRequired

Type

Example

Description

api-key

true

string

0529a86...

api-key

timestamp

true

number

1730975545000

timestamp

  • Request body:

Parameter

isRequired

Type

Example

Description

inTokenSymbol

true

string

SOL

inTokenSymbol

inTokenAddress

true

string

So111111111...

inTokenAddress

outTokenSymbol

true

string

FUNGY

outTokenSymbol

outTokenAddress

true

string

J74ufcR....

outTokenAddress

amount

true

number

1000000

amount(with decimals)

slippage

true

number

100

slippage

  • Response:

Parameter

Type

Example

Description

data

string

qyMtnbbSiMbw3e9.....

signature hash

  • Response example:

{
    "code": 0,
    "msg": "ok",
    "data": "qyMtnbbSiMbw3e9j2Xe6MWBfiuqhy6BNtMsHoEfoU4GPBwAduZNd7N6WHwkdrxwTLQZchnXKbqxfGF9kjtiRqcq"
}

9. Get balances

  • Path:/account/tokenList

  • Method:GET

  • Request headers:

Parameter

isRequired

Type

Example

Description

api-key

true

string

0529a86...

api-key

timestamp

true

number

1730975545000

timestamp

  • Response:

Parameter

Type

Example

Description

mint

string

So111111111...

mint

name

string

SOL

name

symbol

string

SOL

symbol

decimals

string

9

decimals

image

string

https://...

image

price

number

234

price

balance

number

0.01

balance

  • Response example:

{
    "code": 0,
    "msg": "ok",
    "data": [
        {
            "mint": "So11111111111111111111111111111111111111112",
            "name": "Wrapped SOL",
            "symbol": "SOL",
            "decimals": 9,
            "image": "https://s3.openocean.finance/token_logos/logos/solana/So11111111111111111111111111111111111111112.png"
            "price": 234,
            "balance": 0.01
        }
    ]
}

10. Get trade list

  • Path:/account/tradeList

  • Method:GET

  • Request headers:

Parameter

isRequired

Type

Example

Description

api-key

true

string

0529a86...

api-key

timestamp

true

number

1730975545000

timestamp

  • Request parameter:

Parameter

isRequired

Type

Example

Description

page

false

number

1

page

limit

false

number

30

limit

  • Response:

Parameter

Type

Example

Description

id

number

1

id

address

string

J74ufcR...

wallet address

mint

string

So111111111...

mint

type

string

sell

buy/sell

source

string

pump

pump/moonshot

token

object

{}

token json

sol

object

{}

sol json

tokenAmount

number

15932.852594000

tokenAmount(without decimals)

solAmount

number

0.001

solAmount(without decimals)

hash

string

J74ufcR...

hash

create_at

string

2024-11-19 11:26:40

create_at

  • Response example:

{
    "code": 0,
    "msg": "ok",
    "count": 4, // total count
    "data": [
        {
            "id": 9,
            "address": "So11111111111111111111111111111111111111112",
            "type": "buy",
            "source": "",
            "hash": "2Ahvu9M1WBJXyY2DbfmtsHDUaqC8NbMhiVcy2VDX3tKxpJq7kzNvfHAaY4uLNTzUC48wG43iXG7htGmAQ91GAUZe",
            "create_at": "2024-11-27T12:43:52.000Z",
            "token": {
                "address": "5w5LhXQSTPv3XUfc2Fn3tz5F1KyvQrRNuctz36UCpump",
                "source": "pump",
                "name": "Fractal Bitcoin Mascot",
                "symbol": "Potato",
                "decimals": 6,
                "icon": "https://ipfs.io/ipfs/QmRnJUWVbJYJePB32Zzc7tkSdJ9RXPHwFpgrmeNu1Dswvu",
                "price": 0.000014574446389479
            },
            "sol": {
                "address": "So11111111111111111111111111111111111111112",
                "source": "",
                "name": "Wrapped SOL",
                "symbol": "SOL",
                "decimals": 9,
                "icon": "https://s3.openocean.finance/token_logos/logos/solana/So11111111111111111111111111111111111111112.png",
                "price": "233.27"
            },
            "tokenAmount": "15932.852594000",
            "solAmount": "0.001"
        }
    ]
}
  • Path:/account/referral/link

  • Method:GET

  • Request headers:

Parameter

isRequired

Type

Example

Description

api-key

true

string

0529a86...

api-key

timestamp

true

number

1730975545000

timestamp

  • Request parameter:

Parameter

isRequired

Type

Example

Description

account

true

string

EBWJd8BW6X7u6VYdybNtry4T8ZdLMQW69h7ryW3DXtNE

wallet address

  • Request example:

{
    "code": 0,
    "msg": "ok",
    "data": {
        "url": "https://openocean.finance/invite/ref/mi1TRHD8Xvih"
    }
}

12. Store invitation relationship

  • Path:/account/referral/invest

  • method:GET

  • Request headers:

Parameter

isRequired

Type

Example

Description

api-key

true

string

0529a86...

api-key

timestamp

true

number

1730975545000

timestamp

  • Request parameter:

Parameter

isRequired

Type

Example

Description

code

true

string

mi1TRHD8Xvih

get from url

investor

true

string

EBWJd8BW6X7u6VYdybNtry4T8ZdLMQW69h7ryW3DXtNE

wallet address

signature

true

string

0fc06ffe083be27c92576fff97de8987ae73e9cd302f01e34709de15c4322e872f93feb7922744ba6598a63f393eedc9

AES-256 signature

  • Request example:

{
    "code": 0,
    "msg": "ok"
}

13. Get reward information

  • Path:/account/referral/reward

  • Method:GET

  • Request headers:

Parameter

isRequired

Type

Example

Description

api-key

true

string

0529a86...

api-key

timestamp

true

number

1730975545000

timestamp

  • Request parameter:

Parameter

isRequired

Type

Example

Description

account

true

string

EBWJd8BW6X7u6VYdybNtry4T8ZdLMQW69h7ryW3DXtNE

wallet address

  • Response example:

{
    "code": 0,
    "msg": "ok",
    "data": {
        "total_sol": 0,
        "claimed_sol": 0,
        "available_sol": 0
    }
}

14. Claim

  • Path:/account/referral/claim

  • Method:GET

  • Request headers:

Parameter

isRequired

Type

Example

Description

api-key

true

string

0529a86...

api-key

timestamp

true

number

1730975545000

timestamp

  • Request parameter:

Parameter

isRequired

Type

Example

Description

account

true

string

EBWJd8BW6X7u6VYdybNtry4T8ZdLMQW69h7ryW3DXtNE

wallet address

  • Response example:

{
    "code": 0,
    "msg": "ok",
    "data": {
        "signature": '0x00'
    }

Last updated