Skip to content

Commit

Permalink
feat: create soroban-rpc crate
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Jan 25, 2024
1 parent 2af47af commit a0309db
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 11 deletions.
56 changes: 50 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ rev = "e6c2c900ab82b5f6eec48f69cb2cb519e19819cb"
version = "20.2.0"
path = "cmd/soroban-cli"

[workspace.dependencies.soroban-rpc]
version = "20.2.0"
path = "cmd/crates/soroban-rpc"

[workspace.dependencies.stellar-xdr]
version = "=20.0.2"
default-features = true
Expand Down
59 changes: 59 additions & 0 deletions cmd/crates/soroban-rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[package]
name = "soroban-rpc"
description = "Soroban RPC client for rust"
homepage = "https://github.com/stellar/soroban-tools"
repository = "https://github.com/stellar/soroban-tools"
authors = ["Stellar Development Foundation <[email protected]>"]
license = "Apache-2.0"
readme = "README.md"
version.workspace = true
edition = "2021"
rust-version = "1.70"
autobins = false


[lib]
crate-type = ["rlib"]


[dependencies]
soroban-sdk = { workspace = true }
soroban-spec-tools = { workspace = true }

soroban-env-host = { workspace = true }
stellar-strkey = { workspace = true }
stellar-xdr = { workspace = true, features = ["curr", "std", "serde"] }
soroban-spec = { workspace = true }


termcolor = { workspace = true }
termcolor_output = { workspace = true }
clap = { workspace = true }

serde_json = { workspace = true }
serde-aux = { workspace = true }
itertools = { workspace = true }
ethnum = { workspace = true }
hex = { workspace = true }
wasmparser = { workspace = true }
base64 = { workspace = true }
thiserror = { workspace = true }
serde = { workspace = true }
tokio = { workspace = true }
sha2 = { workspace = true }
ed25519-dalek = { workspace = true }
tracing = { workspace = true }


# networking
jsonrpsee-http-client = { workspace = true }
jsonrpsee-core = { workspace = true }
http = { workspace = true }

# soroban-ledger-snapshot = { workspace = true }
# soroban-sdk = { workspace = true }
# sep5 = { workspace = true }


[dev-dependencies]
which = { workspace = true }
3 changes: 3 additions & 0 deletions cmd/crates/soroban-rpc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# soroban-rpc

Tools and utilities for soroban rpc.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ mod txn;

pub use txn::*;

use soroban_spec_tools::contract::Spec as Contract;
use soroban_spec_tools::contract;

use crate::utils::contract_spec as contract;
const VERSION: Option<&str> = option_env!("CARGO_PKG_VERSION");

pub type LogEvents = fn(
Expand Down Expand Up @@ -958,7 +957,7 @@ soroban config identity fund {address} --helper-url <url>"#
xdr::ScVal::ContractInstance(xdr::ScContractInstance {
executable: xdr::ContractExecutable::Wasm(hash),
..
}) => Ok(Contract::new(&self.get_remote_wasm_from_hash(hash).await?)
}) => Ok(contract::Spec::new(&self.get_remote_wasm_from_hash(hash).await?)
.map_err(Error::CouldNotParseContractSpec)?
.spec),
xdr::ScVal::ContractInstance(xdr::ScContractInstance {
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions cmd/soroban-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ soroban-spec-typescript = { workspace = true }
soroban-ledger-snapshot = { workspace = true }
stellar-strkey = { workspace = true }
soroban-sdk = { workspace = true }
soroban-rpc = { workspace = true }

clap = { workspace = true, features = [
"derive",
Expand Down
5 changes: 3 additions & 2 deletions cmd/soroban-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
clippy::must_use_candidate,
clippy::missing_panics_doc
)]
use std::path::Path;
pub(crate) use soroban_rpc as rpc;

pub mod commands;
pub mod fee;
pub mod key;
pub mod log;
pub mod rpc;
pub mod toid;
pub mod utils;
pub mod wasm;

use std::path::Path;

pub use commands::Root;

Expand Down

0 comments on commit a0309db

Please sign in to comment.