Skip to content

Conversation

@jshiohaha
Copy link
Contributor

@jshiohaha jshiohaha commented Oct 1, 2025

Description

  • Update rust-sdk client to accommodate contract upgrade to Anchor 0.31 and Solana 2.1.0. In Solana, solana-sdk was broken out into separate crates, so we only have to pull in what we actually use
  • As the directory implies, all rust-sdk/client/src/generated/* files were automatically generated via codama. The main changes I made are in rust-sdk/client/src/state/*. The previous version of Anchor's IDL did not have discriminators, so the auto-generated files didn't either. In 0.31.0, the autogenerated (and exported) vars conflict with the ones we manually defined. I removed those in favor of the auto-generated values.
    -📓 There are some warnings I did not address but can if preferred
client % yarn build
   Compiling orca_whirlpools_core v2.0.0 (/Users/jacobshiohira/projects/solana/orca/whirlpools/rust-sdk/core)
warning: method `get_next_adaptive_fee_info` is never used
   --> /Users/jacobshiohira/projects/solana/orca/whirlpools/rust-sdk/core/src/math/adaptive_fee.rs:348:12
    |
40  | impl FeeRateManager {
    | ------------------- method in this implementation
...
348 |     pub fn get_next_adaptive_fee_info(&self) -> Option<AdaptiveFeeInfo> {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

   Compiling orca_whirlpools_client v5.0.0 (/Users/jacobshiohira/projects/solana/orca/whirlpools/rust-sdk/client)
warning: `orca_whirlpools_core` (lib) generated 1 warning
warning: unused import: `programs::*`
  --> src/generated/mod.rs:15:18
   |
15 |   pub(crate) use programs::*;
   |                  ^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: unused import: `dynamic_tick_array::*`
 --> src/state/mod.rs:4:9
  |
4 | pub use dynamic_tick_array::*;
  |         ^^^^^^^^^^^^^^^^^^^^^

warning: `orca_whirlpools_client` (lib) generated 2 warnings (run `cargo fix --lib -p orca_whirlpools_client` to apply 2 suggestions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.36s

🔗 for reference, the related PRs:

Test

✅ Generate and build client: yarn build
✅ Run unit tests: cargo test --lib (output 👇🏻)

running 13 tests
test core_types::tick_array::tests::test_dynamic_tick_array_to_facade ... ok
test core_types::tick_array::tests::test_fixed_tick_array_to_facade ... ok
test pda::position_bundle::tests::test_get_bundled_position_address ... ok
test pda::oracle::tests::test_get_oracle_address ... ok
test pda::position::tests::test_get_position_address ... ok
test pda::fee_tier::tests::test_get_fee_tier_address ... ok
test pda::lock_config::tests::test_get_lock_config_address ... ok
test pda::token_badge::tests::test_get_token_badge_address ... ok
test pda::whirlpool::tests::test_get_whirlpool_address ... ok
test state::tick_array::from_fixed_tick_array_test::test_from_fixed_tick_array ... ok
test pda::tick_array::tests::test_get_tick_array_address ... ok
test pda::whirlpools_config_extension::tests::test_get_whirlpools_config_extension_address ... ok
test pda::position_bundle::tests::test_get_position_bundle_address ... ok

@@ -0,0 +1,5 @@
---
"@orca-so/whirlpools-rust-client": major
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LMK if this should be a different semvar update

@@ -0,0 +1,77 @@
#!/usr/bin/env bash
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in main. I think I need to rebase my branches for this to show up properly.

Copy link
Member

@wjthieme wjthieme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comment but LGTM

Base automatically changed from TKN-700/contract to TKN-700/base October 19, 2025 21:37
@jshiohaha jshiohaha merged commit d213b16 into TKN-700/base Oct 19, 2025
@jshiohaha jshiohaha deleted the TKN-700/rust-sdk branch October 19, 2025 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants