Skip to content

Commit adbeaee

Browse files
author
github-actions
committed
Release v17.0.0
**Staking** ### Added (3) - `get_soft_staking_product_list()` (`GET /sapi/v1/soft-staking/list`) - `get_soft_staking_rewards_history()` (`GET /sapi/v1/soft-staking/history/rewardsRecord`) - `set_soft_staking()` (`GET /sapi/v1/soft-staking/set`) **Wallet** ### Changed (1) - Modified response for `all_coins_information()` (`GET /sapi/v1/capital/config/getall`): - `networkList`: item property `withdrawTag` added
1 parent 71bdc4c commit adbeaee

17 files changed

+1078
-7
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## 17.0.0 - 2025-09-09
4+
5+
**Staking**
6+
7+
### Added (3)
8+
9+
- `get_soft_staking_product_list()` (`GET /sapi/v1/soft-staking/list`)
10+
- `get_soft_staking_rewards_history()` (`GET /sapi/v1/soft-staking/history/rewardsRecord`)
11+
- `set_soft_staking()` (`GET /sapi/v1/soft-staking/set`)
12+
13+
**Wallet**
14+
15+
### Changed (1)
16+
17+
- Modified response for `all_coins_information()` (`GET /sapi/v1/capital/config/getall`):
18+
- `networkList`: item property `withdrawTag` added
19+
320
## 16.0.0 - 2025-09-05
421

522
**Simple Earn**

Cargo.toml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "binance-sdk"
3-
version = "16.0.0"
3+
version = "17.0.0"
44
authors = [ "Binance" ]
55
edition = "2024"
66
resolver = "3"
@@ -3614,6 +3614,21 @@ name = "staking_rest_api_on_chain_yields_api_subscribe_on_chain_yields_locked_pr
36143614
path = "examples/staking/rest_api/on_chain_yields_api/subscribe_on_chain_yields_locked_product.rs"
36153615
required-features = [ "staking" ]
36163616

3617+
[[example]]
3618+
name = "staking_rest_api_soft_staking_api_get_soft_staking_product_list"
3619+
path = "examples/staking/rest_api/soft_staking_api/get_soft_staking_product_list.rs"
3620+
required-features = [ "staking" ]
3621+
3622+
[[example]]
3623+
name = "staking_rest_api_soft_staking_api_get_soft_staking_rewards_history"
3624+
path = "examples/staking/rest_api/soft_staking_api/get_soft_staking_rewards_history.rs"
3625+
required-features = [ "staking" ]
3626+
3627+
[[example]]
3628+
name = "staking_rest_api_soft_staking_api_set_soft_staking"
3629+
path = "examples/staking/rest_api/soft_staking_api/set_soft_staking.rs"
3630+
required-features = [ "staking" ]
3631+
36173632
[[example]]
36183633
name = "staking_rest_api_sol_staking_api_claim_boost_rewards"
36193634
path = "examples/staking/rest_api/sol_staking_api/claim_boost_rewards.rs"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
use anyhow::{Context, Result};
2+
use std::env;
3+
use tracing::info;
4+
5+
use binance_sdk::config::ConfigurationRestApi;
6+
use binance_sdk::staking::{StakingRestApi, rest_api::GetSoftStakingProductListParams};
7+
8+
#[tokio::main]
9+
async fn main() -> Result<()> {
10+
// Load credentials from env
11+
let api_key = env::var("API_KEY").context("API_KEY must be set")?;
12+
let api_secret = env::var("API_SECRET").context("API_SECRET must be set")?;
13+
14+
// Build REST config
15+
let rest_conf = ConfigurationRestApi::builder()
16+
.api_key(api_key)
17+
.api_secret(api_secret)
18+
.build()?;
19+
20+
// Create the Staking REST API client
21+
let rest_client = StakingRestApi::production(rest_conf);
22+
23+
// Setup the API parameters
24+
let params = GetSoftStakingProductListParams::default();
25+
26+
// Make the API call
27+
let response = rest_client
28+
.get_soft_staking_product_list(params)
29+
.await
30+
.context("get_soft_staking_product_list request failed")?;
31+
32+
info!(?response.rate_limits, "get_soft_staking_product_list rate limits");
33+
let data = response.data().await?;
34+
info!(?data, "get_soft_staking_product_list data");
35+
36+
Ok(())
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
use anyhow::{Context, Result};
2+
use std::env;
3+
use tracing::info;
4+
5+
use binance_sdk::config::ConfigurationRestApi;
6+
use binance_sdk::staking::{StakingRestApi, rest_api::GetSoftStakingRewardsHistoryParams};
7+
8+
#[tokio::main]
9+
async fn main() -> Result<()> {
10+
// Load credentials from env
11+
let api_key = env::var("API_KEY").context("API_KEY must be set")?;
12+
let api_secret = env::var("API_SECRET").context("API_SECRET must be set")?;
13+
14+
// Build REST config
15+
let rest_conf = ConfigurationRestApi::builder()
16+
.api_key(api_key)
17+
.api_secret(api_secret)
18+
.build()?;
19+
20+
// Create the Staking REST API client
21+
let rest_client = StakingRestApi::production(rest_conf);
22+
23+
// Setup the API parameters
24+
let params = GetSoftStakingRewardsHistoryParams::default();
25+
26+
// Make the API call
27+
let response = rest_client
28+
.get_soft_staking_rewards_history(params)
29+
.await
30+
.context("get_soft_staking_rewards_history request failed")?;
31+
32+
info!(?response.rate_limits, "get_soft_staking_rewards_history rate limits");
33+
let data = response.data().await?;
34+
info!(?data, "get_soft_staking_rewards_history data");
35+
36+
Ok(())
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
use anyhow::{Context, Result};
2+
use std::env;
3+
use tracing::info;
4+
5+
use binance_sdk::config::ConfigurationRestApi;
6+
use binance_sdk::staking::{StakingRestApi, rest_api::SetSoftStakingParams};
7+
8+
#[tokio::main]
9+
async fn main() -> Result<()> {
10+
// Load credentials from env
11+
let api_key = env::var("API_KEY").context("API_KEY must be set")?;
12+
let api_secret = env::var("API_SECRET").context("API_SECRET must be set")?;
13+
14+
// Build REST config
15+
let rest_conf = ConfigurationRestApi::builder()
16+
.api_key(api_key)
17+
.api_secret(api_secret)
18+
.build()?;
19+
20+
// Create the Staking REST API client
21+
let rest_client = StakingRestApi::production(rest_conf);
22+
23+
// Setup the API parameters
24+
let params = SetSoftStakingParams::builder(true).build()?;
25+
26+
// Make the API call
27+
let response = rest_client
28+
.set_soft_staking(params)
29+
.await
30+
.context("set_soft_staking request failed")?;
31+
32+
info!(?response.rate_limits, "set_soft_staking rate limits");
33+
let data = response.data().await?;
34+
info!(?data, "set_soft_staking data");
35+
36+
Ok(())
37+
}

src/staking/rest_api/apis/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ pub mod eth_staking_api;
1515
pub use eth_staking_api::*;
1616
pub mod on_chain_yields_api;
1717
pub use on_chain_yields_api::*;
18+
pub mod soft_staking_api;
19+
pub use soft_staking_api::*;
1820
pub mod sol_staking_api;
1921
pub use sol_staking_api::*;

0 commit comments

Comments
 (0)