Skip to content

Commit

Permalink
Binary port (#47)
Browse files Browse the repository at this point in the history
* stash temp

* add get_binary_ methods

* Move test

* Fix tests config lock

* Add unit test

* Start some unit tests

* Fix some binary test

* Update build

* Change cargo

* Compile

* Small change

* wasm binary port

* Move some types

* Start binary actions

* start node address switch

* stash

* Update angular

* Binary fixes

* binary port

* Update build
  • Loading branch information
gRoussac authored Oct 31, 2024
1 parent 5e0fad0 commit 3113e60
Show file tree
Hide file tree
Showing 751 changed files with 32,050 additions and 21,542 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci-rust-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ jobs:
cat $GITHUB_ENV
- uses: actions/checkout@v2

- name: Swatinem cache
uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c #v1.4.0

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand Down
7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description = "Casper Rust Wasm Web SDK"
repository = "https://github.com/casper-ecosystem/rustSDK"
license = "Apache-2.0"
readme = "docs/README.md"
homepage = "https://casperlabs.io"
homepage = "https://www.casper.network"
categories = ["development-tools", "wasm", "web-programming"]
keywords = ["casper", "sdk", "rust", "wasm"]
exclude = [
Expand All @@ -25,6 +25,8 @@ casper-types = { version = "5.0.0", default-features = false, features = [
"datasize",
] }
casper-client = { version = "2.0.0", default-features = false }
casper-binary-port = { version = "1.0.0" }
casper-binary-port-access = { version = "0.1.0" }
rand = { version = "0.8.5", default-features = false }
wasm-bindgen = "*"
wasm-bindgen-futures = "*"
Expand All @@ -46,6 +48,7 @@ reqwest = { version = "0.12.5", default-features = false, features = [
"stream",
] }
futures-util = "*"
async-trait = "0.1.77"

[lib]
crate-type = ["cdylib", "rlib"]
Expand All @@ -70,3 +73,5 @@ dotenvy = "0.15.7"
[patch.crates-io]
casper-types = { version = "5.0.0", git = "https://github.com/casper-network/casper-node", branch = "feat-2.0" }
casper-client = { version = "2.0.0", git = "https://github.com/casper-ecosystem/casper-client-rs", branch = "feat-track-node-2.0" }
casper-binary-port = { version = "1.0.0", git = "https://github.com/casper-network/casper-node", branch = "feat-2.0" }
casper-binary-port-access = { version = "0.1.0", git = "https://github.com/casper-ecosystem/casper-binary-port-client", branch = "rustSDK-feat-2.0" }
366 changes: 183 additions & 183 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ e2e-test: start-app run-e2e-tests
doc:
cargo doc --package casper-rust-wasm-sdk --no-deps
cp -r target/doc/* docs/api-rust/
npx typedoc --name api-wasm --out docs/api-wasm pkg/casper_rust_wasm_sdk.d.ts
npx typedoc --options typedoc.json && rm -rf docs/api-wasm/media

build: pack
cd examples/frontend/angular/ && npm install && npm run build && cd .
Expand Down
26 changes: 17 additions & 9 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ You can find all RPC methods on the [RPC doc](https://casper-ecosystem.github.io

```rust
use casper_rust_wasm_sdk::types::{
transaction::Transaction, transaction_hash::TransactionHash,
transaction::Transaction, hash::transaction_hash::TransactionHash,
};

let transaction_hash =
Expand All @@ -314,7 +314,7 @@ println!("{timestamp} {hash}");
#### Get deploy by deploy hash (legacy)

```rust
use casper_rust_wasm_sdk::types::deploy_hash::DeployHash;
use casper_rust_wasm_sdk::types::hash::deploy_hash::DeployHash;

let deploy_hash =
DeployHash::new("a8778b2e4bd1ad02c168329a1f6f3674513f4d350da1b5f078e058a3422ad0b9")
Expand Down Expand Up @@ -633,7 +633,7 @@ console.log(transaction_hash);
```rust
use casper_rust_wasm_sdk::types::{
addr::entity_addr::EntityAddr,
addressable_entity_hash::AddressableEntityHash,
hash::addressable_entity_hash::AddressableEntityHash,
transaction_params::{
transaction_builder_params::TransactionBuilderParams,
transaction_str_params::TransactionStrParams,
Expand Down Expand Up @@ -712,7 +712,7 @@ let sdk = SDK::new(
);

use casper_rust_wasm_sdk::types::{
addressable_entity_hash::AddressableEntityHash,
hash::addressable_entity_hash::AddressableEntityHash,
transaction_params::{
transaction_builder_params::TransactionBuilderParams,
transaction_str_params::TransactionStrParams,
Expand Down Expand Up @@ -798,7 +798,7 @@ Puts a [`Transaction`] to the network for execution.

```rust
use casper_rust_wasm_sdk::types::{
addressable_entity_hash::AddressableEntityHash,
hash::addressable_entity_hash::AddressableEntityHash,
transaction_params::{
transaction_builder_params::TransactionBuilderParams,
transaction_str_params::TransactionStrParams,
Expand Down Expand Up @@ -1128,7 +1128,7 @@ console.log(results);
use casper_rust_wasm_sdk::{
helpers::json_pretty_print,
types::{
transaction_hash::TransactionHash,
hash::transaction_hash::TransactionHash,
transaction_params::transaction_str_params::TransactionStrParams,
},
};
Expand Down Expand Up @@ -1290,7 +1290,7 @@ async function loadFile() {

```rust
use casper_rust_wasm_sdk::types::{
addressable_entity_hash::AddressableEntityHash,
hash::addressable_entity_hash::AddressableEntityHash,
transaction_params::{
transaction_builder_params::TransactionBuilderParams,
transaction_str_params::TransactionStrParams,
Expand Down Expand Up @@ -2061,7 +2061,7 @@ console.log(results);
use casper_rust_wasm_sdk::{
helpers::json_pretty_print,
types::{
deploy_hash::DeployHash,
hash::deploy_hash::DeployHash,
deploy_params::{
deploy_str_params::DeployStrParams, payment_str_params::PaymentStrParams,
session_str_params::SessionStrParams,
Expand Down Expand Up @@ -2225,7 +2225,7 @@ async function loadFile() {

```rust
use casper_rust_wasm_sdk::types::{
deploy_hash::DeployHash,
hash::deploy_hash::DeployHash,
deploy_params::{
deploy_str_params::DeployStrParams, payment_str_params::PaymentStrParams,
session_str_params::SessionStrParams,
Expand Down Expand Up @@ -2386,6 +2386,10 @@ You can download an alpha version of the app illustrating the SDK here:

- [Rust helpers](https://casper-ecosystem.github.io/rustSDK/condor/api-rust/casper_rust_wasm_sdk/helpers/index.html)

## Binary Port

- [Binary methods](https://casper-ecosystem.github.io/rustSDK/condor/api-rust/casper_rust_wasm_sdk/binary_port/index.html)

## Typescript API

- [Full item list](https://casper-ecosystem.github.io/rustSDK/condor/api-wasm/index.html)
Expand Down Expand Up @@ -2429,6 +2433,10 @@ You can download an alpha version of the app illustrating the SDK here:

- [TS helpers](https://casper-ecosystem.github.io/rustSDK/condor/api-wasm/modules.html#Functions)

## Binary Port

- [Binary methods](https://casper-ecosystem.github.io/rustSDK/condor/api-wasm/classes/)

## Casper Wallet

In Typescript the `window.CasperWalletProvider` is wrapped into `CasperWallet` Class.
Expand Down
Loading

0 comments on commit 3113e60

Please sign in to comment.