Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ac34c5a
feat(sui-sdk-types): Object::as_struct getter
unmaykr-aftermath Jan 10, 2025
bc85693
makefile: enable --all-features when testing docs
bmwill Jan 20, 2025
c31d801
sui-sdk-types: rename to_address to derive_address for all authentica…
bmwill Jan 21, 2025
8a24f7f
sui-sdk-types: enforce iss to be less than 255 bytes in length
bmwill Jan 21, 2025
89e8a45
sui-sdk-types: provide an iterator for the valid zklogin addrsses
bmwill Jan 21, 2025
b826008
rustdoc: enforce rustdocs to build without warnings in ci
bmwill Jan 22, 2025
74c75b6
sui-sdk-types: add doc comments for the top-level and Address
bmwill Jan 21, 2025
178f92f
sui-graphql-client: use `owner` instead of `object` in gql `DynamicOb…
pyncz Jan 24, 2025
d0efd20
sui-sdk-types: add some docs on objects (#94)
stefan-mysten Jan 24, 2025
e20f4b9
sui-sdk-types: add some digest doc comments (#93)
stefan-mysten Jan 24, 2025
aadc2f4
sui-sdk-types: add gas summary docs (#92)
stefan-mysten Jan 24, 2025
c484e00
chore: update winnow to v0.7 (#95)
bmwill Jan 30, 2025
9eb32af
sui-sdk-types: documentation pass (#96)
bmwill Jan 30, 2025
2b48784
sui-sdk-types: add documentation to transaction types (#97)
bmwill Jan 31, 2025
443bcf0
sui-sdk-types: expose ConsensusCommitPrologueV4 and fix ZkLoginClaim …
bmwill Feb 27, 2025
3f9a7d6
sui-graphql-client: update GraphQL schema and make appropriate change…
stefan-mysten Mar 10, 2025
8e72a97
sui-graphql-client: add transaction_data_effects API (#88)
stefan-mysten Mar 10, 2025
c39f016
sui-graphql-client: mark some functions as pub (#101)
stefan-mysten Mar 18, 2025
2160906
sui-grphql-client: expose Epoch querying methods (#89)
stefan-mysten Mar 20, 2025
4bea3a1
release 0.0.3
bmwill Mar 20, 2025
60f036d
sui-sdk-types: add EndOfEpochTransactionKind::StoreExecutionTimeObser…
unmaykr-aftermath Mar 31, 2025
251eeac
sui-sdk-types: make ExecutionTimeObservation types public
bmwill Mar 31, 2025
30b1082
chore: Fix a missed rename
DaughterOfMars Jun 5, 2025
69d74a6
chore: Remove signature scheme for ed25519 addresses
DaughterOfMars Jun 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ clippy: ## Run Clippy linter
.PHONY: test
test: ## Run unit tests
cargo nextest run --all-features -p iota-sdk-types -p iota-crypto
cargo test --doc
cargo test --all-features --doc

package_%.json: crates/iota-transaction-builder/tests/%/Move.toml crates/iota-transaction-builder/tests/%/sources/*.move ## Generate JSON files for tests
cd crates/iota-transaction-builder/tests/$(*F) && iota move build --ignore-chain --dump-bytecode-as-base64 > ../../$@
Expand All @@ -38,7 +38,7 @@ wasm: ## Build WASM modules

.PHONY: doc
doc: ## Generate documentation
RUSTDOCFLAGS="--cfg=doc_cfg -Zunstable-options --generate-link-to-definition" RUSTC_BOOTSTRAP=1 cargo doc --all-features --no-deps
RUSTDOCFLAGS="-Dwarnings --cfg=doc_cfg -Zunstable-options --generate-link-to-definition" RUSTC_BOOTSTRAP=1 cargo doc --all-features --no-deps

.PHONY: doc-open
doc-open: ## Generate and open documentation
Expand Down
4 changes: 2 additions & 2 deletions crates/iota-crypto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "iota-crypto"
version = "0.0.0"
version = "0.0.1"
authors = ["IOTA Foundation <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down Expand Up @@ -54,7 +54,7 @@ pem = [
]

[dependencies]
iota-sdk-types = { version = "0.0.0", path = "../iota-sdk-types", default-features = false, features = ["hash", "serde"] }
iota-sdk-types = { version = "0.0.1", path = "../iota-sdk-types", default-features = false, features = ["hash", "serde"] }
signature = "2.2"

# RNG support
Expand Down
11 changes: 8 additions & 3 deletions crates/iota-crypto/src/zklogin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

use std::collections::HashMap;

use iota_sdk_types::{Claim, Jwk, JwkId, UserSignature, ZkLoginAuthenticator, ZkLoginInputs};
use iota_sdk_types::{
Jwk, JwkId, UserSignature, ZkLoginAuthenticator, ZkLoginClaim, ZkLoginInputs,
};
use poseidon::POSEIDON;
use signature::Verifier;

Expand Down Expand Up @@ -138,7 +140,10 @@ impl JwtHeader {

/// Parse the extended claim json value to its claim value, using the expected
/// claim key.
fn verify_extended_claim(claim: &Claim, expected_key: &str) -> Result<String, SignatureError> {
fn verify_extended_claim(
claim: &ZkLoginClaim,
expected_key: &str,
) -> Result<String, SignatureError> {
/// Map a base64 string to a bit array by taking each char's index and
/// convert it to binary form with one bit per u8 element in the output.
/// Returns SignatureError if one of the characters is not in the base64
Expand All @@ -155,7 +160,7 @@ fn verify_extended_claim(claim: &Claim, expected_key: &str) -> Result<String, Si
BASE64_URL_CHARSET
.find(c)
.map(|index| index as u8)
.map(|index| (0..6).rev().map(move |i| index >> i & 1))
.map(|index| (0..6).rev().map(move |i| (index >> i) & 1))
.ok_or_else(|| SignatureError::from_source("base64_to_bitarry invalid input"))
})
.flatten_ok()
Expand Down
8 changes: 6 additions & 2 deletions crates/iota-graphql-client-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
[package]
name = "iota-graphql-client-build"
version = "0.0.0"
version = "0.0.1"
authors = ["IOTA Foundation <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/iotaledger/iota-rust-sdk/"
description = "GraphQL RPC Client for the IOTA Blockchain"

[dependencies]
cynic-codegen = "3.8.0"
cynic-codegen = "3.7.3"
23 changes: 17 additions & 6 deletions crates/iota-graphql-client-build/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ type EndOfEpochTransaction {
transactions(first: Int, before: String, last: Int, after: String): EndOfEpochTransactionKindConnection!
}

union EndOfEpochTransactionKind = ChangeEpochTransaction | AuthenticatorStateCreateTransaction | AuthenticatorStateExpireTransaction | RandomnessStateCreateTransaction | CoinDenyListStateCreateTransaction | BridgeStateCreateTransaction | BridgeCommitteeInitTransaction
union EndOfEpochTransactionKind = ChangeEpochTransaction | AuthenticatorStateCreateTransaction | AuthenticatorStateExpireTransaction | RandomnessStateCreateTransaction | CoinDenyListStateCreateTransaction | BridgeStateCreateTransaction | BridgeCommitteeInitTransaction | StoreExecutionTimeObservationsTransaction

type EndOfEpochTransactionKindConnection {
"""
Expand Down Expand Up @@ -2879,7 +2879,7 @@ objects are ones whose

- Type matches the `type` filter,
- AND, whose owner matches the `owner` filter,
- AND, whose ID is in `objectIds` OR whose ID and version is in `objectKeys`.
- AND, whose ID is in `objectIds`.
"""
input ObjectFilter {
"""
Expand All @@ -2898,10 +2898,6 @@ input ObjectFilter {
Filter for live objects by their IDs.
"""
objectIds: [IotaAddress!]
"""
Filter for live or potentially historical objects by their ID and version.
"""
objectKeys: [ObjectKey!]
}

input ObjectKey {
Expand Down Expand Up @@ -3325,6 +3321,10 @@ type Query {
"""
transactionBlock(digest: String!): TransactionBlock
"""
Fetch a list of objects by their IDs and versions.
"""
multiGetObjects(keys: [ObjectKey!]!): [Object]!
"""
The coin objects that exist in the network.

The type field is a string of the inner type of the coin by which to filter (e.g.
Expand Down Expand Up @@ -3599,6 +3599,10 @@ type ServiceConfig {
"""
maxTransactionIds: Int!
"""
Maximum number of keys that can be passed to a `multiGetObjects` query.
"""
maxMultiGetObjectsKeys: Int!
"""
Maximum number of candidates to scan when gathering a page of results.
"""
maxScanLimit: Int!
Expand Down Expand Up @@ -3970,6 +3974,13 @@ type StorageFund {
nonRefundableBalance: BigInt
}

type StoreExecutionTimeObservationsTransaction {
"""
A workaround to define an empty variant of a GraphQL union.
"""
_: Boolean
}


"""
String containing 32B hex-encoded address, with a leading "0x". Leading zeroes can be omitted on input but will always appear in outputs (IotaAddress in output is guaranteed to be 66 characters long).
Expand Down
10 changes: 5 additions & 5 deletions crates/iota-graphql-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "iota-graphql-client"
version = "0.0.0"
version = "0.0.1"
authors = ["IOTA Foundation <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
publish = false
readme = "README.md"
repository = "https://github.com/iotaledger/iota-rust-sdk/"
description = "GraphQL RPC Client for the IOTA Blockchain"

[dependencies]
Expand All @@ -17,7 +17,7 @@ bcs = "0.1.4"
chrono = "0.4.26"
cynic = "3.7.3"
futures = "0.3.29"
iota-types = { package = "iota-sdk-types", path = "../iota-sdk-types", features = ["serde"] }
iota-types = { package = "iota-sdk-types", version = "0.0.1", path = "../iota-sdk-types", features = ["serde"] }
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "json"] }
serde = { version = "1.0.144" }
serde_json = { version = "1.0.95" }
Expand All @@ -26,9 +26,9 @@ tracing = "0.1.37"
url = "2.5.3"

[dev-dependencies]
iota-types = { package = "iota-sdk-types", path = "../iota-sdk-types", features = ["serde", "rand", "hash"] }
iota-types = { package = "iota-sdk-types", version = "0.0.1", path = "../iota-sdk-types", features = ["serde", "rand", "hash"] }
rand = "0.8.5"
tokio = { version = "1.40.0", features = ["full"] }

[build-dependencies]
iota_graphql_client_build = { package = "iota-graphql-client-build", path = "../iota-graphql-client-build" }
iota-graphql-client-build = { version = "0.0.1", path = "../iota-graphql-client-build" }
6 changes: 3 additions & 3 deletions crates/iota-graphql-client/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Error {
// Private constructors

/// Convert the given error into a generic error.
pub(crate) fn from_error<E: Into<BoxError>>(kind: Kind, error: E) -> Self {
pub fn from_error<E: Into<BoxError>>(kind: Kind, error: E) -> Self {
Self {
inner: Box::new(InnerError {
kind,
Expand All @@ -74,7 +74,7 @@ impl Error {

/// Special constructor for queries that expect to return data but it's
/// none.
pub(crate) fn empty_response_error() -> Self {
pub fn empty_response_error() -> Self {
Self {
inner: Box::new(InnerError {
kind: Kind::Query,
Expand All @@ -85,7 +85,7 @@ impl Error {
}

/// Create a Query kind of error with the original graphql errors.
pub(crate) fn graphql_error(errors: Vec<GraphQlError>) -> Self {
pub fn graphql_error(errors: Vec<GraphQlError>) -> Self {
Self {
inner: Box::new(InnerError {
kind: Kind::Query,
Expand Down
Loading
Loading