You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/derivatives_trading_portfolio_margin_pro/rest_api/account_api/change_auto_repay_futures_status.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ async fn main() -> Result<()> {
23
23
let rest_client = DerivativesTradingPortfolioMarginProRestApi::production(rest_conf);
24
24
25
25
// Setup the API parameters
26
-
let params = ChangeAutoRepayFuturesStatusParams::builder(String::new()).build()?;
26
+
let params = ChangeAutoRepayFuturesStatusParams::builder("true".to_string()).build()?;
Copy file name to clipboardExpand all lines: src/derivatives_trading_portfolio_margin_pro/rest_api/apis/account_api.rs
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1580,7 +1580,7 @@ mod tests {
1580
1580
);
1581
1581
}
1582
1582
1583
-
let resp_json:Value = serde_json::from_str(r#"{"fromAsset":"USDT","targetAsset":"BFUSD","fromAssetQty":10,"targetAssetQty":9.998,"rate":0.9998}"#).unwrap();
1583
+
let resp_json:Value = serde_json::from_str(r#"{"fromAsset":"USDT","targetAsset":"BFUSD","fromAssetQty":10,"targetAssetQty":9.998,"mintRate":0.9998}"#).unwrap();
1584
1584
let dummy_response: models::MintBfusdForPortfolioMarginResponse =
1585
1585
serde_json::from_value(resp_json.clone())
1586
1586
.expect("should parse into models::MintBfusdForPortfolioMarginResponse");
@@ -1714,7 +1714,7 @@ mod tests {
1714
1714
);
1715
1715
}
1716
1716
1717
-
let resp_json:Value = serde_json::from_str(r#"{"fromAsset":"BFUSD","targetAsset":"USDT","fromAssetQty":9.99800001,"targetAssetQty":9.996000409998,"rate":0.9998}"#).unwrap();
1717
+
let resp_json:Value = serde_json::from_str(r#"{"fromAsset":"BFUSD","targetAsset":"USDT","fromAssetQty":9.99800001,"targetAssetQty":9.996000409998,"redeemRate":0.9998}"#).unwrap();
1718
1718
let dummy_response: models::RedeemBfusdForPortfolioMarginResponse =
1719
1719
serde_json::from_value(resp_json.clone())
1720
1720
.expect("should parse into models::RedeemBfusdForPortfolioMarginResponse");
@@ -1853,7 +1853,7 @@ mod tests {
1853
1853
TOKIO_SHARED_RT.block_on(async{
1854
1854
let client = MockAccountApiClient{force_error:false};
1855
1855
1856
-
let params = ChangeAutoRepayFuturesStatusParams::builder(String::new())
1856
+
let params = ChangeAutoRepayFuturesStatusParams::builder("true".to_string())
1857
1857
.build()
1858
1858
.unwrap();
1859
1859
@@ -1877,7 +1877,7 @@ mod tests {
1877
1877
TOKIO_SHARED_RT.block_on(async{
1878
1878
let client = MockAccountApiClient{force_error:false};
1879
1879
1880
-
let params = ChangeAutoRepayFuturesStatusParams::builder(String::new())
1880
+
let params = ChangeAutoRepayFuturesStatusParams::builder("true".to_string())
1881
1881
.recv_window(5000)
1882
1882
.build()
1883
1883
.unwrap();
@@ -1902,7 +1902,7 @@ mod tests {
1902
1902
TOKIO_SHARED_RT.block_on(async{
1903
1903
let client = MockAccountApiClient{force_error:true};
1904
1904
1905
-
let params = ChangeAutoRepayFuturesStatusParams::builder(String::new())
1905
+
let params = ChangeAutoRepayFuturesStatusParams::builder("true".to_string())
1906
1906
.build()
1907
1907
.unwrap();
1908
1908
@@ -2335,7 +2335,7 @@ mod tests {
2335
2335
2336
2336
let params = MintBfusdForPortfolioMarginParams::builder("from_asset_example".to_string(),"target_asset_example".to_string(),dec!(1.0),).build().unwrap();
2337
2337
2338
-
let resp_json:Value = serde_json::from_str(r#"{"fromAsset":"USDT","targetAsset":"BFUSD","fromAssetQty":10,"targetAssetQty":9.998,"rate":0.9998}"#).unwrap();
2338
+
let resp_json:Value = serde_json::from_str(r#"{"fromAsset":"USDT","targetAsset":"BFUSD","fromAssetQty":10,"targetAssetQty":9.998,"mintRate":0.9998}"#).unwrap();
2339
2339
let expected_response : models::MintBfusdForPortfolioMarginResponse = serde_json::from_value(resp_json.clone()).expect("should parse into models::MintBfusdForPortfolioMarginResponse");
2340
2340
2341
2341
let resp = client.mint_bfusd_for_portfolio_margin(params).await.expect("Expected a response");
@@ -2352,7 +2352,7 @@ mod tests {
2352
2352
2353
2353
let params = MintBfusdForPortfolioMarginParams::builder("from_asset_example".to_string(),"target_asset_example".to_string(),dec!(1.0),).recv_window(5000).build().unwrap();
2354
2354
2355
-
let resp_json:Value = serde_json::from_str(r#"{"fromAsset":"USDT","targetAsset":"BFUSD","fromAssetQty":10,"targetAssetQty":9.998,"rate":0.9998}"#).unwrap();
2355
+
let resp_json:Value = serde_json::from_str(r#"{"fromAsset":"USDT","targetAsset":"BFUSD","fromAssetQty":10,"targetAssetQty":9.998,"mintRate":0.9998}"#).unwrap();
2356
2356
let expected_response : models::MintBfusdForPortfolioMarginResponse = serde_json::from_value(resp_json.clone()).expect("should parse into models::MintBfusdForPortfolioMarginResponse");
2357
2357
2358
2358
let resp = client.mint_bfusd_for_portfolio_margin(params).await.expect("Expected a response");
@@ -2648,7 +2648,7 @@ mod tests {
2648
2648
2649
2649
let params = RedeemBfusdForPortfolioMarginParams::builder("from_asset_example".to_string(),"target_asset_example".to_string(),dec!(1.0),).build().unwrap();
2650
2650
2651
-
let resp_json:Value = serde_json::from_str(r#"{"fromAsset":"BFUSD","targetAsset":"USDT","fromAssetQty":9.99800001,"targetAssetQty":9.996000409998,"rate":0.9998}"#).unwrap();
2651
+
let resp_json:Value = serde_json::from_str(r#"{"fromAsset":"BFUSD","targetAsset":"USDT","fromAssetQty":9.99800001,"targetAssetQty":9.996000409998,"redeemRate":0.9998}"#).unwrap();
2652
2652
let expected_response : models::RedeemBfusdForPortfolioMarginResponse = serde_json::from_value(resp_json.clone()).expect("should parse into models::RedeemBfusdForPortfolioMarginResponse");
2653
2653
2654
2654
let resp = client.redeem_bfusd_for_portfolio_margin(params).await.expect("Expected a response");
@@ -2665,7 +2665,7 @@ mod tests {
2665
2665
2666
2666
let params = RedeemBfusdForPortfolioMarginParams::builder("from_asset_example".to_string(),"target_asset_example".to_string(),dec!(1.0),).recv_window(5000).build().unwrap();
2667
2667
2668
-
let resp_json:Value = serde_json::from_str(r#"{"fromAsset":"BFUSD","targetAsset":"USDT","fromAssetQty":9.99800001,"targetAssetQty":9.996000409998,"rate":0.9998}"#).unwrap();
2668
+
let resp_json:Value = serde_json::from_str(r#"{"fromAsset":"BFUSD","targetAsset":"USDT","fromAssetQty":9.99800001,"targetAssetQty":9.996000409998,"redeemRate":0.9998}"#).unwrap();
2669
2669
let expected_response : models::RedeemBfusdForPortfolioMarginResponse = serde_json::from_value(resp_json.clone()).expect("should parse into models::RedeemBfusdForPortfolioMarginResponse");
2670
2670
2671
2671
let resp = client.redeem_bfusd_for_portfolio_margin(params).await.expect("Expected a response");
Copy file name to clipboardExpand all lines: src/derivatives_trading_portfolio_margin_pro/rest_api/models/redeem_bfusd_for_portfolio_margin_response.rs
0 commit comments