diff --git a/apps/wallet/src/ui/app/accounts-finder/accounts-finder.test.ts b/apps/wallet/src/ui/app/accounts-finder/accounts-finder.test.ts index b9bbfdfd4a3..f9cba5ad5f9 100644 --- a/apps/wallet/src/ui/app/accounts-finder/accounts-finder.test.ts +++ b/apps/wallet/src/ui/app/accounts-finder/accounts-finder.test.ts @@ -22,7 +22,6 @@ const findBalanceFactory = ( totalBalance: '100', coinObjectCount: 2, coinType: '0x2::iota::IOTA', - lockedBalance: {}, }, }); } @@ -33,7 +32,6 @@ const findBalanceFactory = ( totalBalance: '0', coinObjectCount: 0, coinType: '0x2::iota::IOTA', - lockedBalance: {}, }, }); }; diff --git a/apps/wallet/src/ui/app/accounts-finder/helpers.ts b/apps/wallet/src/ui/app/accounts-finder/helpers.ts index 0d07c2b5302..cd4938edb28 100644 --- a/apps/wallet/src/ui/app/accounts-finder/helpers.ts +++ b/apps/wallet/src/ui/app/accounts-finder/helpers.ts @@ -7,5 +7,4 @@ export const getEmptyBalance = (coinType: string): CoinBalance => ({ coinType: coinType, coinObjectCount: 0, totalBalance: '0', - lockedBalance: {}, }); diff --git a/crates/iota-cluster-test/src/test_case/coin_index_test.rs b/crates/iota-cluster-test/src/test_case/coin_index_test.rs index 20feac1a0f0..ff15cc79681 100644 --- a/crates/iota-cluster-test/src/test_case/coin_index_test.rs +++ b/crates/iota-cluster-test/src/test_case/coin_index_test.rs @@ -2,8 +2,6 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use std::collections::HashMap; - use async_trait::async_trait; use iota_core::test_utils::compile_managed_coin_package; use iota_json::IotaJsonValue; @@ -226,13 +224,11 @@ impl TestCaseImpl for CoinIndexTest { coin_type: iota_type_str.into(), coin_object_count: old_coin_object_count, total_balance, - locked_balance: HashMap::new(), }, Balance { coin_type: coin_type_str.clone(), coin_object_count: 1, total_balance: 10000, - locked_balance: HashMap::new(), }, ]; // Comes with asc order. diff --git a/crates/iota-indexer/src/models/objects.rs b/crates/iota-indexer/src/models/objects.rs index 6d3aff6e7f9..1d90151de86 100644 --- a/crates/iota-indexer/src/models/objects.rs +++ b/crates/iota-indexer/src/models/objects.rs @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use std::{collections::HashMap, sync::Arc}; +use std::sync::Arc; use diesel::prelude::*; use iota_json_rpc::coin_api::parse_to_struct_tag; @@ -541,7 +541,6 @@ impl TryFrom for Balance { coin_object_count: c.coin_num as usize, // TODO: deal with overflow total_balance: c.coin_balance as u128, - locked_balance: HashMap::default(), }) } } diff --git a/crates/iota-json-rpc-types/src/iota_coin.rs b/crates/iota-json-rpc-types/src/iota_coin.rs index 216038e9c22..ecfc7cddb39 100644 --- a/crates/iota-json-rpc-types/src/iota_coin.rs +++ b/crates/iota-json-rpc-types/src/iota_coin.rs @@ -2,10 +2,8 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use std::collections::HashMap; - use iota_types::{ - base_types::{EpochId, ObjectDigest, ObjectID, ObjectRef, SequenceNumber, TransactionDigest}, + base_types::{ObjectDigest, ObjectID, ObjectRef, SequenceNumber, TransactionDigest}, coin::CoinMetadata, error::IotaError, iota_serde::{BigInt, SequenceNumber as AsSequenceNumber}, @@ -28,10 +26,6 @@ pub struct Balance { #[schemars(with = "BigInt")] #[serde_as(as = "BigInt")] pub total_balance: u128, - // TODO: This should be removed - #[schemars(with = "HashMap, BigInt>")] - #[serde_as(as = "HashMap, BigInt>")] - pub locked_balance: HashMap, } impl Balance { @@ -40,7 +34,6 @@ impl Balance { coin_type, coin_object_count: 0, total_balance: 0, - locked_balance: HashMap::new(), } } } diff --git a/crates/iota-json-rpc/src/coin_api.rs b/crates/iota-json-rpc/src/coin_api.rs index c28e89c67e8..0acf253cbd1 100644 --- a/crates/iota-json-rpc/src/coin_api.rs +++ b/crates/iota-json-rpc/src/coin_api.rs @@ -176,8 +176,6 @@ impl CoinReadApiServer for CoinReadApi { coin_type: coin_type_tag.to_string(), coin_object_count: balance.num_coins as usize, total_balance: balance.balance as u128, - // note: LockedCoin is deprecated - locked_balance: Default::default(), }) } .trace() @@ -192,14 +190,10 @@ impl CoinReadApiServer for CoinReadApi { })?; Ok(all_balance .iter() - .map(|(coin_type, balance)| { - Balance { - coin_type: coin_type.to_string(), - coin_object_count: balance.num_coins as usize, - total_balance: balance.balance as u128, - // note: LockedCoin is deprecated - locked_balance: Default::default(), - } + .map(|(coin_type, balance)| Balance { + coin_type: coin_type.to_string(), + coin_object_count: balance.num_coins as usize, + total_balance: balance.balance as u128, }) .collect()) } @@ -961,7 +955,6 @@ mod tests { coin_type: gas_coin.coin_type, coin_object_count: 9, total_balance: 7, - locked_balance: Default::default() }); } @@ -994,7 +987,6 @@ mod tests { coin_type: coin.coin_type, coin_object_count: 11, total_balance: 10, - locked_balance: Default::default() }); } @@ -1108,13 +1100,11 @@ mod tests { coin_type: gas_coin.coin_type, coin_object_count: 9, total_balance: 7, - locked_balance: Default::default(), }, Balance { coin_type: usdc_coin.coin_type, coin_object_count: 11, total_balance: 10, - locked_balance: Default::default(), }, ]; // This is because the underlying result is a hashmap, so order is not diff --git a/crates/iota-open-rpc/spec/openrpc.json b/crates/iota-open-rpc/spec/openrpc.json index 83f799bc5cb..ce6dbe1b26f 100644 --- a/crates/iota-open-rpc/spec/openrpc.json +++ b/crates/iota-open-rpc/spec/openrpc.json @@ -3192,8 +3192,7 @@ { "coinType": "0x2::iota::IOTA", "coinObjectCount": 15, - "totalBalance": "3000000000", - "lockedBalance": {} + "totalBalance": "3000000000" } ] } @@ -3370,8 +3369,7 @@ "value": { "coinType": "0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC", "coinObjectCount": 15, - "totalBalance": "15", - "lockedBalance": {} + "totalBalance": "15" } } } @@ -5739,7 +5737,6 @@ "required": [ "coinObjectCount", "coinType", - "lockedBalance", "totalBalance" ], "properties": { @@ -5751,12 +5748,6 @@ "coinType": { "type": "string" }, - "lockedBalance": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/BigInt_for_uint128" - } - }, "totalBalance": { "$ref": "#/components/schemas/BigInt_for_uint128" } diff --git a/crates/iota-open-rpc/src/examples.rs b/crates/iota-open-rpc/src/examples.rs index bf9c3b4eef9..82dec134b65 100644 --- a/crates/iota-open-rpc/src/examples.rs +++ b/crates/iota-open-rpc/src/examples.rs @@ -2,11 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use std::{ - collections::{BTreeMap, HashMap}, - ops::Range, - str::FromStr, -}; +use std::{collections::BTreeMap, ops::Range, str::FromStr}; use fastcrypto::traits::EncodeDecodeBase64; use iota_json::IotaJsonValue; @@ -785,7 +781,6 @@ impl RpcExampleProvider { coin_type: "0x2::iota::IOTA".to_string(), coin_object_count: 15, total_balance: 3000000000, - locked_balance: HashMap::new(), }; Examples::new("iotax_getAllBalances", vec![ExamplePairing::new( "Gets all balances for the address in the request.", @@ -834,7 +829,6 @@ impl RpcExampleProvider { coin_type: coin_type.clone(), coin_object_count: 15, total_balance: 15, - locked_balance: HashMap::new(), }; Examples::new("iotax_getBalance", vec![ExamplePairing::new( diff --git a/docs/content/developer/exchange-integration/exchange-integration.mdx b/docs/content/developer/exchange-integration/exchange-integration.mdx index 8868e5a0691..720136c343d 100644 --- a/docs/content/developer/exchange-integration/exchange-integration.mdx +++ b/docs/content/developer/exchange-integration/exchange-integration.mdx @@ -115,8 +115,7 @@ The response is a JSON object that includes the `totalBalance` for the address: "result":{ "coinType":"0x2::iota::IOTA", "coinObjectCount":40, - "totalBalance":10000000000, - "lockedBalance":{} + "totalBalance":10000000000 }, "id":1 } diff --git a/docs/content/references/exchange-integration-guide.mdx b/docs/content/references/exchange-integration-guide.mdx index e31df681f9f..8e49be0a241 100644 --- a/docs/content/references/exchange-integration-guide.mdx +++ b/docs/content/references/exchange-integration-guide.mdx @@ -131,8 +131,7 @@ The response is a JSON object that includes the totalBalance for the address: "result": { "coinType": "0x2::iota::IOTA", "coinObjectCount": 40, - "totalBalance": 10000000000, - "lockedBalance": {} + "totalBalance": 10000000000 }, "id": 1 } @@ -292,21 +291,6 @@ public fun request_add_stake_mul_coin( } ``` -- `request_add_stake_with_locked_coin` - Add user stake to a validator's staking pool using a locked IOTA coin. - -```move -public fun request_add_stake_with_locked_coin( - self: &mut IOTASystemState, - stake: LockedCoin, - validator_address: address, - ctx: &mut TxContext, -) { - let (balance, lock) = locked_coin::into_balance(stake); - validator_set::request_add_stake(&mut self.validators, validator_address, balance, option::some(lock), ctx); -} -``` - - `request_withdraw_stake` Withdraw some portion of a user stake from a validator's staking pool. diff --git a/sdk/dapp-kit/test/hooks/useIotaClientQueries.test.tsx b/sdk/dapp-kit/test/hooks/useIotaClientQueries.test.tsx index e20cd82b62a..65f355e3a7b 100644 --- a/sdk/dapp-kit/test/hooks/useIotaClientQueries.test.tsx +++ b/sdk/dapp-kit/test/hooks/useIotaClientQueries.test.tsx @@ -12,7 +12,6 @@ const MOCK_GET_All_BALANCE_RESULT_DATA = [ coinType: '0x2::iota::IOTA', coinObjectCount: 1, totalBalance: '100000', - lockedBalance: {}, }, ]; const MOCK_QUERY_TRANSACTION_BLOCK_RESULT_DATA = { diff --git a/sdk/graphql-transport/src/methods.ts b/sdk/graphql-transport/src/methods.ts index 4ec6566bdad..14178cfce6e 100644 --- a/sdk/graphql-transport/src/methods.ts +++ b/sdk/graphql-transport/src/methods.ts @@ -187,7 +187,6 @@ export const RPC_METHODS: { coinType: toShortTypeString(balance.coinType?.repr!), coinObjectCount: balance.coinObjectCount!, totalBalance: balance.totalBalance, - lockedBalance: {}, }; }, @@ -206,7 +205,6 @@ export const RPC_METHODS: { coinType: toShortTypeString(balance.coinType?.repr!), coinObjectCount: balance.coinObjectCount!, totalBalance: balance.totalBalance, - lockedBalance: {}, })); }, async getCoinMetadata(transport, inputs) { diff --git a/sdk/typescript/src/client/types/coins.ts b/sdk/typescript/src/client/types/coins.ts index ba523fc4170..7045ba73f67 100644 --- a/sdk/typescript/src/client/types/coins.ts +++ b/sdk/typescript/src/client/types/coins.ts @@ -6,5 +6,4 @@ export type CoinBalance = { coinType: string; coinObjectCount: number; totalBalance: string; - lockedBalance: Record; }; diff --git a/sdk/typescript/src/client/types/generated.ts b/sdk/typescript/src/client/types/generated.ts index 30bcba8d817..7595279efaf 100644 --- a/sdk/typescript/src/client/types/generated.ts +++ b/sdk/typescript/src/client/types/generated.ts @@ -29,9 +29,6 @@ export interface AddressMetrics { export interface Balance { coinObjectCount: number; coinType: string; - lockedBalance: { - [key: string]: string; - }; totalBalance: string; } export interface BalanceChange {