API

Api V2 document

Endpoint: https://api.1sol.io

GET /2/101/token-list

**

Request:

  • Headers: No specific headers needed.
  • Url Params: No specific query parameters needed.
  • Body: No specific body attributes needed.

Response:

  • Status: 200
  • Body:
1
{
2
"name": "1Sol Token List",
3
"logoURI": "https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/4ThReWAbAVZjNVgs5Ui9Pk3cZ5TYaD9u6Y89fp6EFzoF/logo.png",
4
"tokens": [
5
{
6
"chainId": 101,
7
"address": "4ThReWAbAVZjNVgs5Ui9Pk3cZ5TYaD9u6Y89fp6EFzoF",
8
"symbol": "1SOL",
9
"name": "1sol.io Token",
10
"logoURI": "https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/4ThReWAbAVZjNVgs5Ui9Pk3cZ5TYaD9u6Y89fp6EFzoF/logo.png",
11
"decimals": 8,
12
"feeAccount": "2h2Z8YkECHyDKamQt6B7hTqX6m8ANV3pwSa2CjYsss5x",
13
"tags": [],
14
"extensions": {
15
"coingeckoId": "1sol",
16
"coingeckoName": "1Sol"
17
}
18
}
19
]
20
}
Copied!

POST /2/101/routes

**

Request:

  • Headers: No specific headers needed.
  • Url Params: No specific query parameters needed.
  • Body:
1
{
2
"amountIn": 100000,
3
"sourceTokenMintKey": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
4
"destinationTokenMintKey": "4ThReWAbAVZjNVgs5Ui9Pk3cZ5TYaD9u6Y89fp6EFzoF",
5
"programs": [
6
"SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8",
7
"SSwpkEEcbUqx4vtoEByFjSkhKdCT862DNVb52nZg1UZ",
8
"9W959DqEETiGZocYWCQPaJ6sBmUzgfxXfqGeTEdp3aQP",
9
"9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
10
"DESVgJVGajEgKGXhb6XmqDHGz3VjdgP7rEVESBgxmroY",
11
"675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8",
12
"1MooN32fuBBgApc8ujknKJw5sef3BVwPGgz3pto1BAh"
13
],
14
"size": 4,
15
"onlyDirect": false,
16
"experiment": false,
17
"bridgeMints": []
18
}
Copied!

Description:

  • If the length of response.distributions.routes is 1, it's a direct exchange.
  • If the length of response.distributions.routes is 2, it's exchanged with a bridge token.

Response:

  • Type: Direct
  • Body:
1
{
2
"amountIn": 100000,
3
"chainId": 101,
4
"sourceTokenMint": {
5
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
6
"decimals": 6
7
},
8
"destinationTokenMint": {
9
"address": "4ThReWAbAVZjNVgs5Ui9Pk3cZ5TYaD9u6Y89fp6EFzoF",
10
"decimals": 8
11
},
12
"distributions": [
13
{
14
"routeType": "Direct",
15
"sourceTokenMint": {
16
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
17
"decimals": 6
18
},
19
"destinationTokenMint": {
20
"address": "4ThReWAbAVZjNVgs5Ui9Pk3cZ5TYaD9u6Y89fp6EFzoF",
21
"decimals": 8
22
},
23
"amountIn": 100000,
24
"amountOut": 15122510,
25
"routes": [
26
[
27
{
28
"exchangerFlag": "OneMoon",
29
"pubkey": "6XXjau4dgEw6mJ9xjy6QWkzTiQYDn3FgWRfYXpANku4G",
30
"extPubkeys": [],
31
"programId": "1MooN32fuBBgApc8ujknKJw5sef3BVwPGgz3pto1BAh",
32
"sourceTokenMint": {
33
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
34
"decimals": 6
35
},
36
"destinationTokenMint": {
37
"address": "4ThReWAbAVZjNVgs5Ui9Pk3cZ5TYaD9u6Y89fp6EFzoF",
38
"decimals": 8
39
},
40
"amountIn": 100000,
41
"amountOut": 15122510
42
}
43
]
44
]
45
}
46
]
47
}
Copied!

Response:

  • Type: WithBridgeMint
  • Body:
1
{
2
"amount_in": 1000000000,
3
"chain_id": 101,
4
"source_token_mint": {
5
"pubkey": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
6
"decimals": 6
7
},
8
"destination_token_mint": {
9
"pubkey": "So11111111111111111111111111111111111111112",
10
"decimals": 9
11
},
12
"distributions": [
13
{
14
"source_token_mint": {
15
"pubkey": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
16
"decimals": 6
17
},
18
"destination_token_mint": {
19
"pubkey": "So11111111111111111111111111111111111111112",
20
"decimals": 9
21
},
22
"amount_in": 1000000000,
23
"amount_out": 8676914691,
24
"routes": [
25
[
26
{
27
"exchanger_flag": "SerumDex",
28
"pubkey": "6oGsL2puUgySccKzn9XA9afqF217LfxP5ocq4B3LWsjy",
29
"program_id": "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
30
"ext_pubkeys": [],
31
"source_token_mint": {
32
"pubkey": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
33
"decimals": 6
34
},
35
"destination_token_mint": {
36
"pubkey": "mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So",
37
"decimals": 9
38
},
39
"amount_in": 999948424,
40
"amount_out": 8438000000
41
}
42
],
43
[
44
{
45
"exchanger_flag": "SaberStableSwap",
46
"pubkey": "Lee1XZJfJ9Hm2K1qTyeCz1LXNc1YBZaKZszvNY4KCDw",
47
"program_id": "SSwpkEEcbUqx4vtoEByFjSkhKdCT862DNVb52nZg1UZ",
48
"ext_pubkeys": [],
49
"source_token_mint": {
50
"pubkey": "mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So",
51
"decimals": 9
52
},
53
"destination_token_mint": {
54
"pubkey": "So11111111111111111111111111111111111111112",
55
"decimals": 9
56
},
57
"amount_in": 8438000000,
58
"amount_out": 8676914691
59
}
60
]
61
],
62
}
63
]
64
}
Copied!

POST /2/101/transactions

**

Request:

  • Headers: No specific headers needed.
  • Url Params: No specific query parameters needed.
  • Body:
1
{
2
"route": {
3
"sourceTokenMint": {
4
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
5
},
6
"destinationTokenMint": {
7
"address": "So11111111111111111111111111111111111111112"
8
},
9
"amountIn": 1000000000,
10
"amountOut": 8674918662,
11
"routes": [
12
[
13
{
14
"pubkey": "58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2",
15
"programId": "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8",
16
"extPubkeys": [
17
"9wFFyRfZBsuAha4YcuxcXLKwMxJR43S7fPfQLusDBzvT"
18
],
19
"sourceTokenMint": {
20
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
21
},
22
"destinationTokenMint": {
23
"address": "So11111111111111111111111111111111111111112"
24
},
25
"amountIn": 1000000000,
26
"amountOut": 8674918662
27
}
28
]
29
]
30
},
31
"minimumAmountOut": 8674910000,
32
"wallet": "DTc6DFAH2Jf349NcPLxYCspQcCM44EwByTFrFrQVFeLs",
33
"protocolSwapInfo": null,
34
"sourceTokenAccount": null,
35
"destinationTokenAccount": null,
36
"bridgeTokenAccount": null,
37
"openOrders": {}
38
}
Copied!

Response:

  • Status: 200
  • Body:
1
{
2
"transactions": [
3
"base64_string_1",
4
"base64_string_2",
5
"base64_string_3",
6
],
7
}
Copied!
Last modified 2mo ago