Skip to content

Commit

Permalink
address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickkuo committed Dec 15, 2022
1 parent bda0c6a commit 6013e6f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
6 changes: 3 additions & 3 deletions crates/sui-json-rpc/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub trait RpcReadApi {
parent_object_id: ObjectID,
/// Optional paging cursor
cursor: Option<ObjectID>,
/// Maximum item returned per page
/// Maximum item returned per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified.
limit: Option<usize>,
) -> RpcResult<DynamicFieldPage>;

Expand Down Expand Up @@ -215,7 +215,7 @@ pub trait RpcFullNodeReadApi {
query: TransactionQuery,
/// Optional paging cursor
cursor: Option<TransactionDigest>,
/// Maximum item returned per page
/// Maximum item returned per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified.
limit: Option<usize>,
/// query result ordering, default to false (ascending order), oldest record first.
descending_order: Option<bool>,
Expand Down Expand Up @@ -494,7 +494,7 @@ pub trait EventReadApi {
query: EventQuery,
/// optional paging cursor
cursor: Option<EventID>,
/// maximum number of items per page
/// maximum number of items per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified.
limit: Option<usize>,
/// query result ordering, default to false (ascending order), oldest record first.
descending_order: Option<bool>,
Expand Down
6 changes: 3 additions & 3 deletions crates/sui-open-rpc/spec/openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@
},
{
"name": "limit",
"description": "Maximum item returned per page",
"description": "Maximum item returned per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified.",
"schema": {
"type": "integer",
"format": "uint",
Expand Down Expand Up @@ -759,7 +759,7 @@
},
{
"name": "limit",
"description": "maximum number of items per page",
"description": "maximum number of items per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified.",
"schema": {
"type": "integer",
"format": "uint",
Expand Down Expand Up @@ -1606,7 +1606,7 @@
},
{
"name": "limit",
"description": "Maximum item returned per page",
"description": "Maximum item returned per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified.",
"schema": {
"type": "integer",
"format": "uint",
Expand Down
21 changes: 17 additions & 4 deletions crates/sui-sdk/src/apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ use std::collections::BTreeMap;
use std::sync::Arc;
use std::time::{Duration, Instant};
use sui_json_rpc_types::{
Balance, Coin, CoinPage, EventPage, GetObjectDataResponse, GetPastObjectDataResponse,
GetRawObjectDataResponse, SuiCoinMetadata, SuiEventEnvelope, SuiEventFilter,
SuiExecuteTransactionResponse, SuiMoveNormalizedModule, SuiObjectInfo, SuiTransactionResponse,
TransactionsPage,
Balance, Coin, CoinPage, DynamicFieldPage, EventPage, GetObjectDataResponse,
GetPastObjectDataResponse, GetRawObjectDataResponse, SuiCoinMetadata, SuiEventEnvelope,
SuiEventFilter, SuiExecuteTransactionResponse, SuiMoveNormalizedModule, SuiObjectInfo,
SuiTransactionResponse, TransactionsPage,
};
use sui_types::balance::Supply;
use sui_types::base_types::{ObjectID, SequenceNumber, SuiAddress, TransactionDigest};
Expand Down Expand Up @@ -56,6 +56,19 @@ impl ReadApi {
Ok(self.api.http.get_objects_owned_by_object(object_id).await?)
}

pub async fn get_dynamic_fields(
&self,
object_id: ObjectID,
cursor: Option<ObjectID>,
limit: Option<usize>,
) -> SuiRpcResult<DynamicFieldPage> {
Ok(self
.api
.http
.get_dynamic_fields(object_id, cursor, limit)
.await?)
}

pub async fn get_parsed_object(
&self,
object_id: ObjectID,
Expand Down
6 changes: 1 addition & 5 deletions crates/sui-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ pub use sui_json as json;

use crate::apis::{CoinReadApi, EventApi, QuorumDriver, ReadApi};
pub use sui_json_rpc_types as rpc_types;
use sui_json_rpc_types::{
DynamicFieldPage, EventPage, GetObjectDataResponse, GetRawObjectDataResponse, SuiEventEnvelope,
SuiEventFilter, SuiMoveNormalizedModule, SuiObjectInfo, SuiTransactionResponse,
TransactionsPage,
};
use sui_json_rpc_types::{GetRawObjectDataResponse, SuiObjectInfo};
use sui_transaction_builder::{DataReader, TransactionBuilder};
pub use sui_types as types;
use sui_types::base_types::{ObjectID, SuiAddress, TransactionDigest};
Expand Down
2 changes: 0 additions & 2 deletions crates/sui-types/src/base_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ use crate::error::SuiError;
use crate::gas_coin::GasCoin;
use crate::object::{Object, Owner};
use crate::sui_serde::Readable;
use crate::waypoint::IntoPoint;
use crate::SUI_FRAMEWORK_ADDRESS;
use fastcrypto::encoding::{Base58, Base64, Encoding, Hex};
use fastcrypto::hash::{HashFunction, Sha3_256};

Expand Down

0 comments on commit 6013e6f

Please sign in to comment.