Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Pull Upstream Changes but keep schemars #26

Closed
wants to merge 119 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
59ba52a
type_tag: include source string in parse error
bmwill Aug 21, 2024
2b80475
sui-graphql-client: introduce initial implementation a sui GraphQL cl…
stefan-mysten Sep 16, 2024
516028a
graphql: update to latest graphql schema (#7)
stefan-mysten Sep 19, 2024
308347f
graphql: add a few tests (#8)
stefan-mysten Sep 23, 2024
b6d1873
coin: use Cow for coin_type
bmwill Sep 25, 2024
58e5068
signature: add bytes and base64 to/from methods for UserSignature
bmwill Sep 20, 2024
a94f1d4
types: introduce Intent types
bmwill Sep 20, 2024
9e851f4
types: introduce PersonalMessage
bmwill Sep 20, 2024
92c06bc
hash: add methods for getting the signing digest
bmwill Sep 20, 2024
489ed2f
crypto: remove unused private key types
bmwill Sep 20, 2024
8b868c4
sui-sdk-crypto: introduce crate to handle signing and verifying
bmwill Sep 20, 2024
2c8f5a5
crypto: introduce secp256r1 support
bmwill Sep 20, 2024
5050f93
crypto: tweak dependencies and default features
bmwill Sep 20, 2024
3fcbb7e
crypto: introduce secp256k1 support
bmwill Sep 20, 2024
646aee1
crypto: use wasm compatible k256 library for secp256k1 support
bmwill Sep 20, 2024
cc2c6bc
crypto: introduce zklogin verifier support
bmwill Sep 22, 2024
263e90a
chore: rename sui-sdk to sui-sdk-types
bmwill Sep 25, 2024
198a68c
chore: rename sui-sdk-crypto to sui-crypto
bmwill Sep 25, 2024
7d2f81b
sui-graphql-client: ignore test_object_query test
bmwill Sep 25, 2024
7b64009
fix doc link in readme
bmwill Sep 25, 2024
18bae13
prepare sui-sdk-types-0.0.1 and sui-crypto-0.0.1
bmwill Sep 26, 2024
7363454
chore: update crates to latest versions (#19)
stefan-mysten Sep 29, 2024
dff3361
sui-graphql-rpc: add balance function (#13)
stefan-mysten Sep 29, 2024
8339695
sui-graphql-client: add coins function (#12)
stefan-mysten Sep 30, 2024
2374813
sui-graphql-client: introduce a faucet client (#11)
stefan-mysten Sep 30, 2024
c055420
sui-graphql-client: use 0x0 as sender for event if none (#20)
stefan-mysten Oct 1, 2024
74b91c1
sui-graphql-client: add method for querying total supply of a coin (#17)
stefan-mysten Oct 1, 2024
bc65d4a
sui-graphql-client: add execute transaction query (#22)
stefan-mysten Oct 1, 2024
e3b24ad
sui-graphql-client: ignore events test due to graphql server failures…
stefan-mysten Oct 1, 2024
0e0ff8e
sui-graphql-client: add active validators query function (#21)
stefan-mysten Oct 1, 2024
c5f9770
chore: format with imports_granularity=Item (#27)
bmwill Oct 1, 2024
73d2e96
sui-graphql-client: use Address as scalar for SuiAddress (#28)
stefan-mysten Oct 1, 2024
43b7930
sui-crypto: introduce multisig verifier and aggregator (#25)
bmwill Oct 2, 2024
112bfb3
sui-graphql-client: impl_scalar for u64 and Uint53 (#29)
stefan-mysten Oct 4, 2024
2699101
sui-graphql-client: add dry run query (#23)
stefan-mysten Oct 9, 2024
77b93fb
sui-graphql-client: avoid an extra RPC call by checking if first and …
stefan-mysten Oct 15, 2024
659664e
sui-graphql-client: fix transaction(s) query (#32)
stefan-mysten Oct 15, 2024
20373b3
type_tag: add StructTag parsing test case
bmwill Oct 16, 2024
31bd9da
types: improve format of UnresolvedTransaction
bmwill Oct 15, 2024
ad78437
sui-graphql-client: update GraphQL schema and fix events to use the n…
stefan-mysten Oct 16, 2024
e62ce52
sui-graphql-client: add checkpoints query (#34)
stefan-mysten Oct 17, 2024
7c0ab44
sui-graphql-client: rework the Page type to support empty pages (#36)
stefan-mysten Oct 18, 2024
5703b4d
sui-graphql-client: add a pagination filter (#37)
stefan-mysten Oct 18, 2024
c5a25ce
passkey: update passkey challenge format
bmwill Oct 21, 2024
494b3a6
sui-graphql-client: simplify pagination filter usage (#39)
stefan-mysten Oct 22, 2024
86ad4b2
ci: separate tests that require network and run localnet in ci (#38)
stefan-mysten Oct 22, 2024
dd03025
sui-graphql-client: fix coin stream test (#42)
stefan-mysten Oct 23, 2024
62f33cc
sui-graphql-client: add dynamic fields query (#18)
stefan-mysten Oct 23, 2024
24207a2
sui-graphql-client: fix return of bcs and typetag in DynamicFieldOutp…
stefan-mysten Oct 25, 2024
9eed43e
sui-graphql-client: return Result<Page> instead of Result<Option<Page…
stefan-mysten Oct 25, 2024
bc481a1
crypto: add blanket implementation for SuiSigner and SuiVerifier
bmwill Oct 26, 2024
df32a46
crypto: support der and pem format for pub/priv keys
bmwill Oct 27, 2024
8d64c06
crypto: introduce SimpleKeypair type
bmwill Oct 27, 2024
9b571b4
crypto: rexpect UserSignatureVerifier from top-level
bmwill Oct 27, 2024
d617fe1
crypto: collapse 'der' feature into 'pem'
bmwill Oct 27, 2024
89b289b
sui-graphql-client: add some more doc comments (#50)
stefan-mysten Oct 28, 2024
1daf680
sui-graphql-client: add total transaction blocks query (#47)
stefan-mysten Oct 28, 2024
1c33dd6
sui-graphql-client: change PaginationFilter to use a String vs &str (…
stefan-mysten Oct 28, 2024
7712ef4
sui-graphql-client: add normalized move function and module queries (…
stefan-mysten Oct 28, 2024
12a24f9
sui-graphql-client: add suins queries (#48)
stefan-mysten Oct 30, 2024
c2d3080
sui-graphql-client: add generic stream impl (#51)
stefan-mysten Oct 31, 2024
b155195
sui-graphql-client: add package queries (#33)
stefan-mysten Oct 31, 2024
79a0ed6
sui-graphql-client: properly await pagination_filter query (#52)
stefan-mysten Oct 31, 2024
0db436f
sui-graphql-client: make dynamic field queries using owner (#54)
stefan-mysten Nov 1, 2024
5ee3ec1
sui-graphql-client: cleanup of Option<Page> and add tests back (#56)
stefan-mysten Nov 11, 2024
43090fc
ci: set toolchain to 1.81.0 for wasm builds
bmwill Nov 11, 2024
5e1a0dd
sui-graphql-client: add a build crate to allow registering schema in …
stefan-mysten Nov 11, 2024
4aa79e6
sui-graphql-client: initialize service config and max page size lazil…
stefan-mysten Nov 11, 2024
98ecfa1
sui-graphql-client: add transaction effects query (#55)
stefan-mysten Nov 13, 2024
ff5ccfe
sui-graphql-client: rework errors (#58)
stefan-mysten Nov 14, 2024
83feb73
sui-sdk-types: rename types and add constructors for unresolved::Valu…
stefan-mysten Nov 19, 2024
6969208
types: improve construction and accessing of inner fields
bmwill Nov 20, 2024
37e0dd9
types: fix schema names for unresolved types
bmwill Nov 20, 2024
5062e71
Fix issue with serde renaming (#63)
stefan-mysten Nov 22, 2024
6918fd8
types: enable proptest::Arbitrary impls via the 'proptest' feature
bmwill Dec 4, 2024
ae27938
types: fix Arbitrary impl for Identifier
bmwill Dec 4, 2024
b2e9b83
sui-sdk-types: address rust 1.82 clippy lints (#65)
stefan-mysten Dec 5, 2024
85b9a86
sui-transaction-builder: introduce a crate for building transaction (…
stefan-mysten Dec 5, 2024
24c3493
types: add accessors and constructor for PasskeyAuthenticator
bmwill Dec 6, 2024
6c44290
sui-graphql-client: make pagination consistent across queries (#66)
stefan-mysten Dec 11, 2024
8ae5b61
roaring: pin to 0.10.6 to work around no-std breakage
bmwill Dec 11, 2024
b6f1a87
sui-graphql-client: return a tuple of Event, TxDigest when querying e…
stefan-mysten Dec 11, 2024
e852e03
Update GraphQL schema to v1.39.0
stefan-mysten Dec 12, 2024
e240ad0
Use Sui CLI from version 1.39.1 that matches the GraphQL schema
stefan-mysten Dec 12, 2024
b3537da
sui-graphql-client: use `bcs` from `Checkpoint` instead of manual con…
stefan-mysten Dec 12, 2024
d1ebef5
sui-graphql-client: use typed digests for queries (#59)
stefan-mysten Dec 12, 2024
1e3b4d0
ci: update to sui v1.39.3 and use --ignore-chain in sui move build (#75)
stefan-mysten Dec 18, 2024
e0d4557
sui-graphql-client: update docs for using custom queries (#76)
stefan-mysten Dec 19, 2024
975b425
feat(sui-sdk-types): add From<StructTag> for TypeTag (#77)
unmaykr-aftermath Dec 19, 2024
18da152
roaring: update to v0.10.9 (#79)
bmwill Dec 19, 2024
877f2c0
sui-graphql-client: use rustls instead of openssl for reqwest (#80)
stefan-mysten Dec 19, 2024
f0c771b
sui-graphql-client: add retry to getting coins from faucet to fix fla…
stefan-mysten Dec 19, 2024
5e97a67
sui-crypto: add support for verifying passkey authenticators (#81)
bmwill Dec 19, 2024
d965897
types: move unresolved types to sui-transaction-builder
bmwill Dec 19, 2024
aa546ca
types: fold EffectsObjectChange into ChangedObject struct
bmwill Dec 19, 2024
dc54c46
sui-sdk-types: flatten the types module
bmwill Dec 19, 2024
4526b87
chore: update proptest to 1.6.0 (#85)
bmwill Dec 23, 2024
d49d67f
sui-transaction-builder: enable base64ct feature 'std'
bmwill Dec 23, 2024
396f9a1
chore: add help target to Makefile to display the usage of all target…
caseylove Dec 31, 2024
b6ff352
release sui-sdk-types-0.0.2 and sui-crypto-0.0.2
bmwill Jan 6, 2025
6c63f6a
Slipstream
DaughterOfMars Jan 7, 2025
ebefd0f
chore: rustfmt (#3)
muXxer Oct 8, 2024
a56c0bd
Add `EndOfEpochData::epoch_supply_change` field
DaughterOfMars Oct 17, 2024
f658261
chore(types): cleaned up removed and renamed transaction types (#5)
alexsporn Oct 18, 2024
7abf263
feat: remove the `DenyListStateCreate` transaction (#7)
valeriyr Oct 21, 2024
cdb2d8a
chore(cleanup): Remove legacy MultiSig (#8)
piotrm50 Oct 22, 2024
2106f05
feat!: rename types for iota PR https://github.com/iotaledger/iota/pu…
Thoralf-M Oct 29, 2024
70178eb
feat!: remove TransactionEffectsV1 and rename V2 to V1
Thoralf-M Oct 28, 2024
ec65a0b
Update tests
Thoralf-M Oct 29, 2024
0aad1f8
fix: Add events to genesis transaction
DaughterOfMars Oct 30, 2024
f562884
fix: update fixtures
Thoralf-M Oct 30, 2024
ab64609
fix(CI): Fix workflow triggers (#21)
DaughterOfMars Nov 7, 2024
301bbe2
refactor: Remove has_public_transfer in MoveStruct
jkrvivian Nov 1, 2024
d47ec7c
fix: Update serialization test bytes
jkrvivian Nov 4, 2024
3e0ea9d
add crate to update transaction fixtures and also update them
Thoralf-M Nov 7, 2024
fdf6d63
feat(protocol): Add computation_cost_burned field to GasCostSummary (…
DaughterOfMars Nov 8, 2024
7a76797
rename: fix capitalization (`Iota` to `IOTA`) (#24)
muXxer Jan 16, 2025
1af3664
chore: Fix some typos, CI, docs, urls and re-add signing fns that wer…
DaughterOfMars Feb 17, 2025
bd62950
Merge branch 'develop' into dev-tools/pull-upstream-3
DaughterOfMars Feb 17, 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
66 changes: 61 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: CI

on:
push:
branches: [main]
branches: [develop]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
schedule: [cron: "40 1 * * *"]

Expand Down Expand Up @@ -43,18 +44,18 @@ jobs:
- name: Install latest nightly
run: rustup toolchain install nightly --component rustfmt --allow-downgrade

- name: feature compatibility
run: make check-features

- name: rustfmt
run: cargo +nightly fmt -- --check
run: make check-fmt

- name: clippy
run: make clippy

- name: rustdoc
run: make doc

- name: feature compatibility
run: make check-features

wasm:
runs-on: ubuntu-latest

Expand All @@ -64,6 +65,7 @@ jobs:

- name: rust version
run: |
rustup default 1.81.0
rustc --version
cargo --version

Expand All @@ -74,3 +76,57 @@ jobs:

- name: Run tests in wasm
run: make wasm

run_tests_with_network:
runs-on: ubuntu-latest
env:
EPOCH_DURATION_MS: 10000
services:
postgres: # we need this postgres instance for running a local network with indexer and graphql
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgrespw
POSTGRES_DB: iota_indexer_v2
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: rust version
run: |
rustc --version
cargo --version

- uses: taiki-e/install-action@cargo-nextest

- name: Get the Iota testnet binary and start a local network
shell: bash
env:
IOTA_BINARY_VERSION: "1.39.3" # used for downloading a specific Iota binary versions that matches the GraphQL schema for local network tests
IOTA_NETWORK_RELEASE: "testnet" # which release to use
run: |
ASSET_NAME="iota-$IOTA_NETWORK_RELEASE-v$IOTA_BINARY_VERSION-ubuntu-x86_64.tgz"
download_url="https://github.com/iotaledger/iota/releases/download/$IOTA_NETWORK_RELEASE-v$IOTA_BINARY_VERSION/$ASSET_NAME"

echo "Downloading testnet binary from $download_url"
wget -q $download_url -O iota.tgz
tar -zxvf iota.tgz ./iota
chmod +x ./iota
echo "Starting local network with a faucet, an indexer (port 5432) and GraphQL. Epoch duration is set to $EPOCH_DURATION_MS ms"
echo "$(pwd)" >> $GITHUB_PATH # we need it on the path for calling iota move build for some tests
./iota start --force-regenesis --with-faucet --with-indexer --with-graphql --pg-port 5432 --pg-db-name iota_indexer_v2 --epoch-duration-ms $EPOCH_DURATION_MS &

- name: Run tests that require local network (GraphQL Client and Tx Builder)
env:
NETWORK: "local" # other expected options are mainnet, testnet, or devnet, or an actual URL to a GraphQL server: http://localhost:port
run: |
sleep $((EPOCH_DURATION_MS / 1000)) # wait for the network to get to epoch #2
make test-with-localnet
2 changes: 1 addition & 1 deletion .github/workflows/rustdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: rustdoc

on:
push:
branches: [main]
branches: [develop]
workflow_dispatch:

env:
Expand Down
52 changes: 35 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,46 +1,64 @@
# Set the default target of this Makefile
.PHONY: all
all:: ci
all:: ci ## Default target, runs the CI process

.PHONY: check-features
check-features:
$(MAKE) -C crates/iota-rust-sdk check-features
check-features: ## Check feature flags for crates
$(MAKE) -C crates/iota-sdk-types check-features
$(MAKE) -C crates/iota-crypto check-features

.PHONY: check-fmt
check-fmt:
cargo fmt -- --check
check-fmt: ## Check code formatting
cargo +nightly fmt -- --check

.PHONY: fmt
fmt: ## Format code
cargo +nightly fmt

.PHONY: clippy
clippy:
clippy: ## Run Clippy linter
cargo clippy --all-features --all-targets

.PHONY: test
test:
cargo nextest run --all-features
test: ## Run unit tests
cargo nextest run --all-features -p iota-sdk-types -p iota-crypto
cargo test --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 > ../../$@

.PHONY: test-with-localnet
test-with-localnet: package_test_example_v1.json package_test_example_v2.json ## Run tests with localnet
cargo nextest run -p iota-graphql-client -p iota-transaction-builder

.PHONY: wasm
wasm:
$(MAKE) -C crates/iota-rust-sdk wasm
wasm: ## Build WASM modules
$(MAKE) -C crates/iota-sdk-types wasm
$(MAKE) -C crates/iota-crypto wasm

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

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

.PHONY: ci
ci: check-features check-fmt test wasm
ci: check-features check-fmt test wasm ## Run the full CI process

.PHONY: ci-full
ci-full: ci doc
ci-full: ci doc ## Run the full CI process and generate documentation

.PHONY: clean
clean:
clean: ## Clean build artifacts
cargo clean

.PHONY: clean-all
clean-all: clean
git clean -dX
clean-all: clean ## Clean all generated files, including those ignored by Git. Force removal.
git clean -dXf

.PHONY: help
help: ## Show this help
@echo "Available targets:"
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
40 changes: 37 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# IOTA Sdk
# Iota Sdk

[![Documentation (master)](https://img.shields.io/badge/docs-master-59f)](https://github.com/iotaledger/iota-rust-sdk/iota_sdk/)
A rust Sdk for integrating with the [Iota blockchain](https://docs.iota.org/).

A WIP from-scratch rust sdk for the IOTA blockchain
> [!NOTE]
> This is project is under development and many features may still be under
> development or missing.

## Overview

This repository contains a collection of libraries for integrating with the Iota blockchain.

A few of the project's high-level goals are as follows:

- **Be modular** - user's should only need to pay the cost (in terms of dependencies/compilation time) for the features that they use.
- **Be light** - strive to have a minimal dependency footprint.
- **Support developers** - provide all needed types, abstractions and APIs to enable developers to build robust applications on Iota.
- **Support wasm** - where possible, libraries should be usable in wasm environments.

## Crates

In an effort to be modular, functionality is split between a number of crates.

- [`iota-sdk-types`](crates/iota-sdk-types)
[![iota-sdk-types on crates.io](https://img.shields.io/crates/v/iota-sdk-types)](https://crates.io/crates/iota-sdk-types)
[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.rs/iota-sdk-types)
[![Documentation (master)](https://img.shields.io/badge/docs-master-59f)](https://github.com/iotaledger/sui-rust-sdk/iota_sdk_types/)
- [`iota-crypto`](crates/iota-crypto)
[![iota-crypto on crates.io](https://img.shields.io/crates/v/iota-crypto)](https://crates.io/crates/iota-crypto)
[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.rs/iota-crypto)
[![Documentation (master)](https://img.shields.io/badge/docs-master-59f)](https://github.com/iotaledger/sui-rust-sdk/iota_crypto/)
- [`iota-graphql-client`](crates/iota-crypto)
[![iota-graphql-client on crates.io](https://img.shields.io/crates/v/iota-graphql-client)](https://crates.io/crates/iota-graphql-client)
[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.rs/iota-graphql-client)
[![Documentation (master)](https://img.shields.io/badge/docs-master-59f)](https://github.com/iotaledger/sui-rust-sdk/iota-graphql-client/)

## License

This project is available under the terms of the [Apache 2.0 license](LICENSE).
22 changes: 22 additions & 0 deletions crates/iota-crypto/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# [0.0.2] - 2025-01-06

## Added

- Added support for multisig verification and aggregation ([#25])
- Added blanket implementation for IotaSigner and IotaVerifier ([`bc481a1`])
- Added support for der and pem format for public and private keys ([`df32a46`])
- Added a `SimpleKeypair` type which could be either an ed25519, secp256k1, or secp256r1 keypair ([`8d64c06`])
- Added support for verifying passkey authenticators ([#81])

[#25]: https://github.com/iotaledger/sui-rust-sdk/pull/25
[`bc481a1`]: https://github.com/iotaledger/sui-rust-sdk/commit/bc481a1ea156e6ccb528b5b49e62a511be5ba60a
[`df32a46`]: https://github.com/iotaledger/sui-rust-sdk/commit/df32a46bfbecbbbf4ec7e9c1974eef0916ccd359
[`8d64c06`]: https://github.com/iotaledger/sui-rust-sdk/commit/8d64c06628b9494c674c27158ce74036fe45080e
[#81]: https://github.com/iotaledger/sui-rust-sdk/pull/81

# [0.0.1] - 2024-09-25

Initial release

[0.0.2]: https://github.com/iotaledger/sui-rust-sdk/releases/tag/iota-crypto-0.0.2
[0.0.1]: https://github.com/iotaledger/sui-rust-sdk/releases/tag/iota-crypto-0.0.1
106 changes: 106 additions & 0 deletions crates/iota-crypto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
[package]
name = "iota-crypto"
version = "0.0.2"
authors = ["IOTA Foundation <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/mystenlabs/sui-rust-sdk/"
description = "Defines the interface for signing and verying messages in the Iota ecosystem"

[package.metadata.docs.rs]
# To build locally:
# RUSTDOCFLAGS="--cfg=doc_cfg -Zunstable-options --generate-link-to-definition" RUSTC_BOOTSTRAP=1 cargo doc --all-features --no-deps --open
all-features = true
rustdoc-args = [
# Enable doc_cfg showing the required features.
"--cfg=doc_cfg",

# Generate links to definition in rustdoc source code pages
# https://github.com/rust-lang/rust/pull/84176
"-Zunstable-options",
"--generate-link-to-definition",
]

[features]
default = []
ed25519 = ["dep:ed25519-dalek", "dep:rand_core"]
secp256r1 = ["dep:p256", "dep:rand_core"]
passkey = ["secp256r1", "dep:sha2"]
secp256k1 = ["dep:k256", "dep:rand_core", "signature/std"]
zklogin = [
"dep:ark-bn254",
"dep:ark-ff",
"dep:ark-groth16",
"dep:ark-snark",
"dep:ark-std",
"dep:base64ct",
"dep:bnum",
"dep:itertools",
"dep:serde",
"dep:serde_derive",
"dep:serde_json",
"signature/std",
]
pem = [
"dep:pkcs8",
"dep:pem-rfc7468",
"ed25519-dalek?/pkcs8",
"p256?/pkcs8",
"k256?/pkcs8",
"ed25519-dalek?/pem",
"p256?/pem",
"k256?/pem",
]

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

# RNG support
rand_core = { version = "0.6.4", optional = true }

# ed25519 support
ed25519-dalek = { version = "2.1.1", optional = true }

# secp256r1 support
p256 = { version = "0.13.2", default-features = false, features = ["ecdsa", "std"], optional = true }

# passkey verification support
sha2 = { version = "0.10.8", optional = true }

# secp256k1 support
k256 = { version = "0.13.4", default-features = false, features = ["ecdsa"], optional = true }

# zklogin verification support
ark-bn254 = { version = "0.4.0", optional = true }
ark-ff = { version = "0.4.2", features = ["asm"], optional = true }
ark-groth16 = { version = "0.4.0", default-features = false, optional = true }
ark-snark = { version = "0.4.0", optional = true }
ark-std = { version = "0.4.0", optional = true }
base64ct = { version = "1.6.0", features = ["alloc"], optional = true }
bnum = { version = "0.12.0", optional = true }
itertools = { version = "0.13.0", optional = true }
serde = { version = "1.0.210", optional = true }
serde_derive = { version = "1.0.210", optional = true }
serde_json = { version = "1.0.128", optional = true }

# pkcs8 der and pem support
pem-rfc7468 = { version = "0.7", optional = true, features = ["std"] }
pkcs8 = { version = "0.10", optional = true, features = ["std"] }

[dev-dependencies]
bcs = { version = "0.1.6" }
hex = "0.4.3"
serde_json = { version = "1.0.128" }

# proptest support in tests
proptest = { version = "1.6.0", default-features = false, features = ["std"] }
test-strategy = "0.4.0"

[target.wasm32-unknown-unknown.dev-dependencies]
wasm-bindgen-test = "0.3"
getrandom = { version = "0.2", features = ["js"] }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(doc_cfg)'] }
23 changes: 23 additions & 0 deletions crates/iota-crypto/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Set the default target of this Makefile
.PHONY: all
all:: check-features clippy test wasm

.PHONY: check-features
check-features:
cargo hack check --feature-powerset --no-dev-deps

.PHONY: clippy
clippy:
cargo clippy --all-features --all-targets

.PHONY: test
test:
cargo nextest run --all-features
cargo test --doc

.PHONY: wasm
wasm:
CC=clang wasm-pack test -r --node --all-features

%:
$(MAKE) -C ../.. $@
8 changes: 8 additions & 0 deletions crates/iota-crypto/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# iota-crypto

[![iota-crypto on crates.io](https://img.shields.io/crates/v/iota-crypto)](https://crates.io/crates/iota-crypto)
[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.rs/iota-crypto)
[![Documentation (master)](https://img.shields.io/badge/docs-master-59f)](https://github.com/iotaledger/sui-rust-sdk/iota_crypto/)

The `iota-crypto` crate provides the interface for signing and verifying
transactions and messages in the Iota ecosystem.
Loading
Loading