Skip to content

feat: ultra exclude router param #668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions docs/101-ultra-api/2-execute-order.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,50 @@ To fully utilize the Ultra API, check out the [Ultra API Reference](/docs/api/ul

Using the Solana `web3.js` **v1** library, you can sign the transaction as follows:

<details>
<summary>
Set up imports and wallet for signing
</summary>

```bash
npm install @solana/web3.js@1 # Using v1 of web3.js instead of v2
npm install bs58
npm install dotenv # if required for wallet setup
```

:::note
- You can paste in your private key for testing purposes but this is not recommended for production applications.
- If you want to store your private key in the project directly, you can do it via a `.env` file.
:::

To set up a development wallet via `.env` file, you can use the following script.

```jsx
// index.js
import { Keypair } from '@solana/web3.js';
import dotenv from 'dotenv';
require('dotenv').config();

const wallet = Keypair.fromSecretKey(bs58.decode(process.env.PRIVATE_KEY || ''));
```

```bash
# .env
PRIVATE_KEY=""
```

To set up a development wallet via a wallet generated via [Solana CLI](https://solana.com/docs/intro/installation#solana-cli-basics), you can use the following script.

```jsx
import { Keypair } from '@solana/web3.js';
import fs from 'fs';

const privateKeyArray = JSON.parse(fs.readFileSync('/Path/To/.config/solana/id.json', 'utf8').trim());
const wallet = Keypair.fromSecretKey(new Uint8Array(privateKeyArray));
```

</details>

```jsx
// ... GET /order's response

Expand Down
4 changes: 2 additions & 2 deletions docs/api/ultra-api/order.api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: "Request for a base64-encoded unsigned swap transaction to be used
sidebar_label: "order"
hide_title: true
hide_table_of_contents: true
api: eJzVV0l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F8+XeMg8C91zo8S
sidebar_class_name: "get api-method"
info_path: docs/api/ultra-api/quickstart
custom_edit_url: null
Expand Down Expand Up @@ -52,7 +52,7 @@ Request for a base64-encoded unsigned swap transaction to be used in `POST /ultr
</Heading>

<ParamsDetails
parameters={[{"in":"query","name":"inputMint","schema":{"type":"string"},"required":true},{"in":"query","name":"outputMint","schema":{"type":"string"},"required":true},{"in":"query","name":"amount","schema":{"type":"string"},"required":true},{"in":"query","name":"taker","schema":{"type":"string"},"required":false},{"in":"query","name":"referralAccount","schema":{"type":"string"},"required":false},{"in":"query","name":"referralFee","schema":{"type":"number","minimum":50,"maximum":255},"required":false}]}
parameters={[{"in":"query","name":"inputMint","schema":{"type":"string"},"required":true},{"in":"query","name":"outputMint","schema":{"type":"string"},"required":true},{"in":"query","name":"amount","schema":{"type":"string"},"required":true},{"in":"query","name":"taker","schema":{"type":"string"},"required":false},{"in":"query","name":"referralAccount","schema":{"type":"string"},"required":false},{"in":"query","name":"referralFee","schema":{"type":"number","minimum":50,"maximum":255},"required":false},{"in":"query","name":"excludeRouters","schema":{"type":"string","enum":["metis","jupiterz","hashflow","dflow","pyth","okx"]},"required":false}]}
>

</ParamsDetails>
Expand Down
4 changes: 2 additions & 2 deletions docs/api/ultra-api/routers.api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: "Request for the list of routers available in the routing engine of
sidebar_label: "routers"
hide_title: true
hide_table_of_contents: true
api: eJzNVEtv2zAM/iuCdlmBJE53zK3A2m7dhnWvy9IcFJuJmcqSKlFpAzf/faTtrmmLAjsuF1N88+PHtLqCVEYMhN7pmf4ONxkSqZWPimpQFvnhVyr6TBCTMluD1iwtKHSdgxjQrRW4NToQ11+Wohmp2xrLWmFS84vs/OJtUfkyFYP7mw3rxhZvMlZIu3EffXTl9EhHSMG7BEnPWv1uOpXP0yZ/5LKElFbZqgdnjiu9I3Ak7iYEi6UR92KTJKbVqayhMSLRLgBnMTGaHcchQZMO9H65gZLYEKIP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hI3czhtMsbIITSUc8fzRY3AVSPmIUgeiSHg5Hw9GbUrbiG5o7sb01W5FlWSdMT4HERUT1ifaplYhcztBnCfCD3nfyCAUj/54/dOa9mMg6ZwPVKrGgI6B8Ht+LAtvntfgfdrunLMEj5U4rTM0kArQ9HacydRrfgb4jHlHF7UZT285VgGuvd7uo5nb8hvUsrpXHWHo88ZUVqHhJZPAdj3ksj/jFcGmgSjdp+18/EZEKfxfkdPKLF+oPbsvEkg==
sidebar_class_name: "get api-method"
info_path: docs/api/ultra-api/quickstart
custom_edit_url: null
Expand Down Expand Up @@ -55,7 +55,7 @@ Request for the list of routers available in the routing engine of Ultra, which
<StatusCodes
id={undefined}
label={undefined}
responses={{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","enum":["Metis","JupiterZ","Hashflow","DFlow"]},"icon":{"type":"string"}},"required":["id","name"]}}}}}}}
responses={{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","enum":["Metis v1.6","JupiterZ","Hashflow","DFlow","Pyth Express Relay","OKX DEX Router"]},"icon":{"type":"string"}},"required":["id","name"]}}}}}}}
>

</StatusCodes>
Expand Down
16 changes: 15 additions & 1 deletion openapi/ultra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,18 @@ paths:
minimum: 50
maximum: 255
required: false
- in: query
name: excludeRouters
schema:
type: string
enum:
- metis
- jupiterz
- hashflow
- dflow
- pyth
- okx
required: false
/execute:
post:
summary: execute
Expand Down Expand Up @@ -476,10 +488,12 @@ paths:
name:
type: string
enum:
- Metis
- Metis v1.6
- JupiterZ
- Hashflow
- DFlow
- Pyth Express Relay
- OKX DEX Router
icon:
type: string
required:
Expand Down