diff --git a/Cargo.lock b/Cargo.lock index c4b67b7..31e4abd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1693,7 +1693,7 @@ dependencies = [ [[package]] name = "drift-idl-gen" version = "0.2.0" -source = "git+https://github.com/drift-labs/drift-rs?rev=ab3fec7#ab3fec7a894eff048dff7bd7bcf3e24c9285cb91" +source = "git+https://github.com/drift-labs/drift-rs?rev=0618036#0618036d37d70d4a1ad0694eac75c5ae2036f937" dependencies = [ "proc-macro2", "quote", @@ -1706,7 +1706,7 @@ dependencies = [ [[package]] name = "drift-pubsub-client" version = "0.1.1" -source = "git+https://github.com/drift-labs/drift-rs?rev=ab3fec7#ab3fec7a894eff048dff7bd7bcf3e24c9285cb91" +source = "git+https://github.com/drift-labs/drift-rs?rev=0618036#0618036d37d70d4a1ad0694eac75c5ae2036f937" dependencies = [ "futures-util", "gjson", @@ -1726,7 +1726,7 @@ dependencies = [ [[package]] name = "drift-rs" version = "1.0.0-alpha.16" -source = "git+https://github.com/drift-labs/drift-rs?rev=ab3fec7#ab3fec7a894eff048dff7bd7bcf3e24c9285cb91" +source = "git+https://github.com/drift-labs/drift-rs?rev=0618036#0618036d37d70d4a1ad0694eac75c5ae2036f937" dependencies = [ "abi_stable", "ahash 0.8.12", @@ -2754,9 +2754,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.83" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" dependencies = [ "once_cell", "wasm-bindgen", @@ -2780,7 +2780,7 @@ dependencies = [ [[package]] name = "jupiter-swap-api-client" version = "0.2.0" -source = "git+https://github.com/drift-labs/jupiter-swap-api-client?branch=patch%2F2025-12-28#6b07ee58ff4c3c5e4f0b9b35d13d9d37e4069202" +source = "git+https://github.com/drift-labs/jupiter-swap-api-client?branch=patch%2F2025-12-28#8a03d2a8e1017de9c54ee2c12532083812c13cf2" dependencies = [ "anyhow", "base64 0.22.1", @@ -7258,9 +7258,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" dependencies = [ "cfg-if", "once_cell", @@ -7271,11 +7271,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.56" +version = "0.4.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" +checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" dependencies = [ "cfg-if", + "futures-util", "js-sys", "once_cell", "wasm-bindgen", @@ -7284,9 +7285,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7294,9 +7295,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" dependencies = [ "bumpalo", "proc-macro2", @@ -7307,18 +7308,18 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.83" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" +checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index d78f28c..01becbd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] actix-web = "*" argh = "*" -drift-rs = { git = "https://github.com/drift-labs/drift-rs", rev = "ab3fec7", features = ["titan"] } +drift-rs = { git = "https://github.com/drift-labs/drift-rs", rev = "0618036", features = ["titan"] } base64 = "0.22.1" env_logger = "*" faster-hex = "0.10.0" diff --git a/README.md b/README.md index 3cf75f6..8d63a00 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,8 @@ These runtime environment variables are required: | `GRPC_HOST` | endpoint for gRPC subscription mode | `https://grpc.example.com` | `GRPC_X_TOKEN` | authentication token for gRPC subscription mode | `aabbccddeeff112233` | `INIT_RPC_THROTTLE` | Adds a delay (seconds) between RPC bursts during gateway startup. Useful to avoid 429/rate-limit errors. Can be set to `0`, if RPC node is highspec | `1` | +| `JUPITER_API_KEY` | **Required for `/v2/swap`**. Jupiter API key for swap operations. Get a free key at [portal.jup.ag](https://portal.jup.ag). See [migration guide](https://dev.jup.ag/portal/migrate-from-lite-api) | `your-jupiter-api-key` | +| `JUPITER_API_URL` | (Optional) Override Jupiter API base URL | `https://api.jup.ag/swap/v1` | | `TITAN_AUTH_TOKEN` | **Required for `/v2/titan-swap`**. Authentication token for Titan API | `your-titan-auth-token` | | `TITAN_BASE_URL` | (Optional) Titan API base URL | `https://api.titan.exchange` | @@ -713,6 +715,8 @@ $ curl localhost:8080/v2/orders/cancelAndPlace -X POST -H 'content-type: applica Executes a spot token swap using Jupiter routing and liquidity aggregation. for more info see jup docs: https://dev.jup.ag/docs/api/swap-api/quote +⚠️ **Requires `JUPITER_API_KEY` environment variable to be set.** Get a free API key at [portal.jup.ag](https://portal.jup.ag). See [Jupiter API migration guide](https://dev.jup.ag/portal/migrate-from-lite-api) for details. + **Endpoint**: `POST /v2/swap` **Parameters**: @@ -729,7 +733,7 @@ Request body: "excludeDexes": bool, // comma separated list of dexes to exclude } ``` -dexes: https://lite-api.jup.ag/swap/v1/program-id-to-label +dexes: https://api.jup.ag/swap/v1/program-id-to-label **Response**: