Skip to content

Commit

Permalink
re-order jobs and fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DaughterOfMars committed Jan 7, 2025
1 parent 69bd765 commit 828adfc
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ jobs:
- name: Install latest nightly
run: rustup toolchain install nightly --component rustfmt --allow-downgrade

- name: feature compatibility
run: make check-features

- name: rustfmt
run: make check-fmt

Expand All @@ -56,6 +53,9 @@ jobs:
- name: rustdoc
run: make doc

- name: feature compatibility
run: make check-features

wasm:
runs-on: ubuntu-latest

Expand Down
4 changes: 2 additions & 2 deletions crates/iota-graphql-client-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ iota-graphql-client-build = { git = "https://github.com/iotaledger/sui-rust-sdk"
```

4. If using `cynic`, use the cynic generator to generate the Rust types from the GraphQL schema.\
Go to https://generator.cynic-rs.dev/ and paste the URL to the GraphQL service or manually copy paste the schema.\
Go to <https://generator.cynic-rs.dev/> and paste the URL to the GraphQL service or manually copy paste the schema.\
Then you can select the fields in the query you want to have, and the generator will generate the Rust types for you.

5. In your Rust code, you can now use the custom query types generated by `cynic`.
Expand All @@ -62,6 +62,6 @@ async fn main() {
}
```

6. For `UInt53`, you can use `u64` type directly as the `iota-graphql-client`'s schema implements the `impl_scalar`. Similarly for other types (Base64, DateTime). See more available types here: https://github.com/iotaledger/sui-rust-sdk/blob/02639f6b09375fe03fa2243868be17bec1dfa33c/crates/iota-graphql-client/src/query_types/mod.rs?plain=1#L124-L126
6. For `UInt53`, you can use `u64` type directly as the `iota-graphql-client`'s schema implements the `impl_scalar`. Similarly for other types (Base64, DateTime). See more available types here: <https://github.com/iotaledger/sui-rust-sdk/blob/02639f6b09375fe03fa2243868be17bec1dfa33c/crates/iota-graphql-client/src/query_types/mod.rs?plain=1#L124-L126>

7. Read the `cynic` [documentation](https://cynic-rs.dev/) to learn how to work with it, particularly when it comes to passing arguments to the query.
2 changes: 1 addition & 1 deletion crates/iota-graphql-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async fn main() -> Result<()> {

### Example for custom faucet service.

Note that this [`FaucetClient`] is explicitly designed to work with two endpoints: `v1/gas`, and `v1/status`. When passing in the custom faucet URL, skip the final endpoint and only pass in the top-level url (e.g., `https://faucet.devnet.iota.io`).
Note that this `FaucetClient` is explicitly designed to work with two endpoints: `v1/gas`, and `v1/status`. When passing in the custom faucet URL, skip the final endpoint and only pass in the top-level url (e.g., `https://faucet.devnet.iota.io`).

```rust, no_run
use iota_graphql_client::faucet::FaucetClient;
Expand Down
5 changes: 3 additions & 2 deletions crates/iota-graphql-client/src/streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ where

/// Creates a new `PageStream` for a paginated query.
///
/// Examples
/// ## Example
///
/// ```rust,ignore
/// use futures::StreamExt;
/// use iota_graphql_client::streams::stream_paginated_query;
Expand All @@ -161,7 +162,7 @@ where
///
/// let client = Client::new_testnet();
/// let stream = stream_paginated_query(|pagination_filter, Direction::Forward| {
/// client.coins(owner, coin_type, pagination_filter })
/// client.coins(owner, coin_type, pagination_filter)
/// });
/// while let Some(result) = stream.next().await {
/// match result {
Expand Down
22 changes: 13 additions & 9 deletions crates/iota-transaction-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ mod error;
pub mod unresolved;

use base64ct::Encoding;
use error::Error;
pub use error::Error;
use iota_types::{
Address, Argument, Command, GasPayment, Identifier, Input, MakeMoveVector, MergeCoins,
MoveCall, ObjectId, ObjectReference, Publish, SplitCoins, Transaction, TransactionExpiration,
TransferObjects, TypeTag, Upgrade,
};
use serde::Serialize;

/// A builder for creating transactions. Use [`resolve`] to finalize the
/// transaction data.
/// A builder for creating transactions. Use [`finish`](Self::finish) to
/// finalize the transaction data.
#[derive(Clone, Default, Debug)]
pub struct TransactionBuilder {
/// The inputs to the transaction.
Expand All @@ -25,7 +25,8 @@ pub struct TransactionBuilder {
commands: Vec<Command>,
/// The gas objects that will be used to pay for the transaction. The most
/// common way is to use [`unresolved::Input::owned`] function to create
/// a gas object and use the [`add_gas`] method to set the gas objects.
/// a gas object and use the [`add_gas_objects`](Self::add_gas_objects)
/// method to set the gas objects.
gas: Vec<unresolved::Input>,
/// The gas budget for the transaction.
gas_budget: Option<u64>,
Expand Down Expand Up @@ -86,8 +87,9 @@ impl TransactionBuilder {
/// Add one or more gas objects to use to pay for the transaction.
///
/// Most commonly the gas can be passed as a reference to an owned/immutable
/// [`Object`], or can created using one of the of the constructors of
/// the [`unresolved::Input`] enum, e.g., [`unresolved::Input::owned`].
/// [`Object`](iota_types::Object), or can created using one of the of
/// the constructors of the [`unresolved::Input`] enum, e.g.,
/// [`unresolved::Input::owned`].
pub fn add_gas_objects<O, I>(&mut self, gas: I)
where
O: Into<unresolved::Input>,
Expand Down Expand Up @@ -213,6 +215,7 @@ impl TransactionBuilder {
///
/// Examples:
/// ### Upgrade a package with some pre-known data.
///
/// ```rust,ignore
/// use iota_graphql_client::Client;
/// use iota_sdk_types::unresolved;
Expand All @@ -222,13 +225,14 @@ impl TransactionBuilder {
/// let mut tx = TransactionBuilder::new();
/// let package_id = "0x...".parse().unwrap();
/// let upgrade_cap =
/// tx.input(unresolved::Input::by_id("0x...".parse().unwrap());
/// tx.input(unresolved::Input::by_id("0x...".parse().unwrap()));
/// let upgrade_policy = tx.input(Serialized(&0u8));
/// // the digest of the new package that was compiled
/// let package_digest: &[u8] = &[
/// 68, 89, 156, 51, 190, 35, 155, 216, 248, 49, 135, 170, 106, 42,
/// 190, 4, 208, 59, 155, 89, 74, 63, 70, 95, 207, 78, 227, 22,
/// 136, 146, 57, 79, ];
/// 190, 4, 208, 59, 155, 89, 74, 63, 70, 95, 207, 78, 227, 22,
/// 136, 146, 57, 79
/// ];
/// let digest_arg = tx.input(Serialized(&package_digest));
///
/// // we need this ticket to authorize the upgrade
Expand Down

0 comments on commit 828adfc

Please sign in to comment.