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

Draft PR SDK Rust/Wasm #21

Closed
wants to merge 202 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
202 commits
Select commit Hold shift + click to select a range
8663583
First commit
gRoussac Jul 25, 2023
e6c2b37
Update path
gRoussac Jul 25, 2023
57b2620
Add default pkg to github
gRoussac Jul 25, 2023
184cff5
readme
gRoussac Jul 25, 2023
22ba5dc
update lib
gRoussac Jul 25, 2023
ed29532
update client with fraser fork
gRoussac Jul 25, 2023
5fe102d
Update sub module
gRoussac Jul 25, 2023
9fa2198
update
gRoussac Jul 25, 2023
375a3c1
update sub module
gRoussac Jul 26, 2023
aa61844
Update
gRoussac Jul 26, 2023
bda549d
update sub module
gRoussac Jul 26, 2023
ccf6c88
Update casper-types
gRoussac Jul 26, 2023
7b013c9
update methods and exports
gRoussac Jul 27, 2023
f04fc7f
debug info_get_deploy
gRoussac Jul 27, 2023
648464b
Clean up
gRoussac Jul 27, 2023
58a9d20
up
gRoussac Jul 27, 2023
5d03259
Renme sub module
gRoussac Jul 27, 2023
c9c7675
Rename mv folders
gRoussac Jul 27, 2023
f11260d
sub module rip
gRoussac Jul 27, 2023
d3ec193
update paths
gRoussac Jul 27, 2023
8a4353a
update pkg
gRoussac Jul 27, 2023
d3743ab
update name sdk
gRoussac Jul 27, 2023
df9329e
oops
gRoussac Jul 27, 2023
1010273
update name again
gRoussac Jul 27, 2023
aac68ce
update frontend lock
gRoussac Jul 27, 2023
fa5a452
update json pkg
gRoussac Jul 27, 2023
f4af1ff
update pkg & app for json
gRoussac Jul 27, 2023
17859d2
update json
gRoussac Jul 28, 2023
fd88515
add state_get_account_info
gRoussac Jul 28, 2023
bfe5770
stash dev
gRoussac Jul 30, 2023
e55900d
start to tidy things
gRoussac Jul 30, 2023
4312eaa
remove old poc
gRoussac Jul 30, 2023
5603296
Clean up
gRoussac Jul 31, 2023
9d75582
Put deploy woot
gRoussac Jul 31, 2023
08f7cd1
remove await
gRoussac Jul 31, 2023
ffca05b
add some types
gRoussac Jul 31, 2023
6e6e95e
BlockIdentifier to option
gRoussac Jul 31, 2023
2e4fe06
hexToUint8Array exposed
gRoussac Aug 1, 2023
2a6cc5d
Add some rpcs methods and change params order
gRoussac Aug 1, 2023
26d0a9f
Fix some types
gRoussac Aug 1, 2023
2f577f1
Fix some types Digest & DeployHash
gRoussac Aug 1, 2023
e3c5280
missing js_name
gRoussac Aug 1, 2023
3490bba
Add PublicKey type
gRoussac Aug 1, 2023
9dd6bb0
Expose cli to sdk
gRoussac Aug 1, 2023
9a4ee7b
account hash type fix
gRoussac Aug 2, 2023
4df614d
Start make_deploy add type DeployStrParams SessionStrParams PaymentSt…
gRoussac Aug 2, 2023
429713b
use casper_types::Timestamp
gRoussac Aug 2, 2023
22084f5
Debug make_deploy make_transfer getter on oncecell string unwraping t…
gRoussac Aug 3, 2023
9d4ba97
update session params to make deploy
gRoussac Aug 3, 2023
0174c75
Deploy to string back
gRoussac Aug 3, 2023
683e8ca
Last state of frontend app
gRoussac Aug 7, 2023
e97824a
Update to last dev version
gRoussac Aug 8, 2023
62993a7
Remove debug f64
gRoussac Aug 8, 2023
4618f64
Update deploy to json (bigint to string in js for now)
gRoussac Aug 8, 2023
5a7d530
Update last state
gRoussac Aug 9, 2023
d03cef4
Don't use serde_wasm_bindgen anymore + remove js_sys timestamp to chrono
gRoussac Aug 9, 2023
4984231
Current state + add speculative_transfer + json_pretty_print
gRoussac Aug 10, 2023
36da57c
sign deploy
gRoussac Aug 14, 2023
c766633
Adding helper privateToPublicKey
gRoussac Aug 14, 2023
23d0591
Add getTimestamp
gRoussac Aug 14, 2023
6b83180
// small change
gRoussac Aug 14, 2023
0f180d8
Implement addArg to deploy
gRoussac Aug 14, 2023
d4ae64b
deploy.sign
gRoussac Aug 14, 2023
628537c
stash simple arg for addArg
gRoussac Aug 15, 2023
124f6aa
update sub module rs-client
gRoussac Aug 15, 2023
9027977
Deploy without approvals
gRoussac Aug 15, 2023
b3bae17
Remove fix me
gRoussac Aug 15, 2023
b6ab146
addArg from json arg
gRoussac Aug 16, 2023
61f9997
test session_args_json
gRoussac Aug 16, 2023
6f3f0e9
Update sub module
gRoussac Aug 16, 2023
1e2ab34
Update sub module
gRoussac Aug 16, 2023
b1db98f
Add Deploy.withSession and Deploy.withTransfer as static
gRoussac Aug 16, 2023
febca8b
Add dummy rust consuming app
gRoussac Aug 17, 2023
4d4cd42
Remove js aliases from lib
gRoussac Aug 17, 2023
0fb2e0d
Expose get_peers to lib for now
gRoussac Aug 17, 2023
61edd50
some struct changes
gRoussac Aug 17, 2023
b80ecea
bad save
gRoussac Aug 17, 2023
df660b8
Update rpc calls structure between wasm32 and not wasm32
gRoussac Aug 17, 2023
022f60a
Clean up sdk
gRoussac Aug 18, 2023
7630486
satrt a deploy builder with
gRoussac Aug 18, 2023
592da99
modify_session
gRoussac Aug 18, 2023
9233d98
modify_session
gRoussac Aug 18, 2023
61b7b0d
Update with*
gRoussac Aug 18, 2023
3755b43
Add Hash
gRoussac Aug 19, 2023
d69b87f
Clean params default
gRoussac Aug 19, 2023
5ac9308
Introduce SdkError
gRoussac Aug 19, 2023
02cc82d
Start to rework bad api for rapc calls
gRoussac Aug 19, 2023
668dd05
bad commmit
gRoussac Aug 19, 2023
745bf2d
Remove test
gRoussac Aug 19, 2023
7d903fb
Update get_dictionary_item
gRoussac Aug 19, 2023
dde2f6d
Begin to rework api
gRoussac Aug 21, 2023
19a418e
small change
gRoussac Aug 21, 2023
7c58f2a
Rework api get_account
gRoussac Aug 21, 2023
98edf86
get auction api
gRoussac Aug 21, 2023
4c70f7b
BlockIdentifierInput
gRoussac Aug 21, 2023
5bd1396
get balance api
gRoussac Aug 21, 2023
83c4028
change api for some rpc calls
gRoussac Aug 22, 2023
d301b04
Change API query global state and get balance
gRoussac Aug 22, 2023
ff9b5d9
Update api for deploys
gRoussac Aug 22, 2023
506a98e
Fix options
gRoussac Aug 24, 2023
842a268
call_entrypoint + fix build
gRoussac Aug 24, 2023
6732fc1
query_contract
gRoussac Aug 24, 2023
ee95d43
add contract methods
gRoussac Aug 24, 2023
5e4b513
update sub module
gRoussac Aug 24, 2023
87f3633
move rust app to tests
gRoussac Aug 25, 2023
b4f401a
Move Tauri app
gRoussac Aug 25, 2023
fac1537
Add angular app
gRoussac Aug 26, 2023
a532b4d
Update angular app + debug
gRoussac Aug 27, 2023
d1faebc
Fix few things for dict identifier
gRoussac Aug 28, 2023
3ba6a95
Fix path in query global state
gRoussac Aug 28, 2023
f3619c0
start PB/PV key
gRoussac Aug 28, 2023
feb6ad2
Add make_transfer to app
gRoussac Aug 28, 2023
531e3b9
start ui with make_deploy
gRoussac Aug 29, 2023
456cbc6
fix transfer
gRoussac Aug 30, 2023
bd0da3d
Update app
gRoussac Aug 30, 2023
1698906
Bug dictionary_item + query_contract_dict
gRoussac Aug 31, 2023
5b7a3c0
Update app
gRoussac Aug 31, 2023
ccf5296
Bug isExpired
gRoussac Aug 31, 2023
1f8ef9d
update sign deploy
gRoussac Aug 31, 2023
b798f3c
Speculative exec
gRoussac Aug 31, 2023
7061189
update motesToCSPR
gRoussac Sep 1, 2023
a51bfe7
Bug path + install
gRoussac Sep 1, 2023
2087a00
Add basic network mngt
gRoussac Sep 1, 2023
4ef50f2
Start to remove serialize result to some types
gRoussac Sep 3, 2023
f30af31
target_arch = "wasm32
gRoussac Sep 3, 2023
f0f4da2
Add some integration tests for rpc + utils
gRoussac Sep 4, 2023
4458b8f
Remove casper types from tests
gRoussac Sep 4, 2023
f996247
Update tests
gRoussac Sep 5, 2023
036c4a3
Update app
gRoussac Sep 5, 2023
4011bcf
Add some integration tests
gRoussac Sep 6, 2023
9adfdf3
Adding some integration tests
gRoussac Sep 6, 2023
741544d
Add first e2e test for angular app
gRoussac Sep 6, 2023
50a3963
Add nodejs folder
gRoussac Sep 7, 2023
00d3344
clean up
gRoussac Sep 7, 2023
470b197
update readme
gRoussac Sep 7, 2023
e128014
typo
gRoussac Sep 7, 2023
8127b13
Bad test
gRoussac Sep 7, 2023
74c77be
Update casper client
gRoussac Sep 8, 2023
2aef09b
Fix account identifier
gRoussac Sep 9, 2023
478b4fc
add some e2e tests
gRoussac Sep 10, 2023
7be9af1
Add some e2e tests
gRoussac Sep 11, 2023
6ab4f22
Move test wasm path
gRoussac Sep 11, 2023
57ebb4b
Update tests
gRoussac Sep 11, 2023
1ea32bb
bad state root hash
gRoussac Sep 11, 2023
a27712b
Test install cep78
gRoussac Sep 11, 2023
3afe700
Remove console.log
gRoussac Sep 11, 2023
39e838d
Fix some e2e tests
gRoussac Sep 12, 2023
0df653d
Update e2e tests
gRoussac Sep 12, 2023
d990811
Update e2e tests
gRoussac Sep 12, 2023
b05b339
Update integration tests
gRoussac Sep 14, 2023
ef4f97f
Remove a todo in era info test
gRoussac Sep 14, 2023
e98e921
small change
gRoussac Sep 14, 2023
ab13e27
Update post merge feat-2.0
gRoussac Sep 16, 2023
37fc831
Remove submodule
gRoussac Sep 16, 2023
15c1e32
Remove .gitmodules file
gRoussac Sep 16, 2023
23b5680
Remove submodule
gRoussac Sep 16, 2023
e4eb5a9
move folder
gRoussac Sep 16, 2023
d53b0d7
add clipboard and highlight
gRoussac Sep 17, 2023
1a1c3d7
Upload pkg
gRoussac Sep 18, 2023
216cd73
Change structure
gRoussac Sep 18, 2023
06f2a2a
Fix react app
gRoussac Sep 18, 2023
d7ea103
Fix some pathes
gRoussac Sep 18, 2023
6e20a63
Start to change node_adress param
gRoussac Sep 18, 2023
8645098
Renaming
gRoussac Sep 18, 2023
76b2e2f
node address + rename wasm
gRoussac Sep 18, 2023
1808cda
react app node_address
gRoussac Sep 18, 2023
473aaa2
Remove Tauri app
gRoussac Sep 18, 2023
3915944
Fix node_adress + verbosity
gRoussac Sep 19, 2023
15278ae
verbosity react app
gRoussac Sep 19, 2023
fafc169
path e2e
gRoussac Sep 19, 2023
1128a1e
Update intergation tests
gRoussac Sep 19, 2023
e09f851
Test verbosity + app icon
gRoussac Sep 19, 2023
a89056b
Partial update readme
gRoussac Sep 19, 2023
2ed62c2
Update readme
gRoussac Sep 19, 2023
27bb37b
Update readme
gRoussac Sep 20, 2023
61db279
Update cargo toml
gRoussac Sep 20, 2023
4c3f8c2
Readme
gRoussac Sep 20, 2023
990e4fa
Update doc
gRoussac Sep 20, 2023
4eba194
Readme
gRoussac Sep 20, 2023
6d97e58
Upload a pkg for doc purpose
gRoussac Sep 20, 2023
2f30e75
Update docs
gRoussac Sep 21, 2023
ffae47a
Remove logging
gRoussac Sep 21, 2023
7b08063
Doc update
gRoussac Sep 21, 2023
4d8f82c
doc
gRoussac Sep 21, 2023
2943681
Change public/private key in react app
gRoussac Sep 30, 2023
d42581f
get_node_address in get_node_address
gRoussac Sep 30, 2023
be7a7cb
Fix finalized_approvals
gRoussac Sep 30, 2023
6ad08f9
self.get_node_address
gRoussac Sep 30, 2023
a02ee55
Bad seed_uref
gRoussac Sep 30, 2023
36def1c
move block hash query in integraton test
gRoussac Sep 30, 2023
5de5db9
Update e2e tests
gRoussac Oct 2, 2023
e1297c9
Update tests integration
gRoussac Oct 2, 2023
ab36c57
Update README.md
gRoussac Oct 3, 2023
c1fe36e
Update README.md
gRoussac Oct 3, 2023
2c2069f
dictionary uref test
gRoussac Oct 4, 2023
d9edd61
Merge branch 'dev' of ssh://github.com:/casper-ecosystem/rustSDK into…
gRoussac Oct 4, 2023
afc5231
Missing target_arch on some alias
gRoussac Oct 4, 2023
837e97f
insert_js_value_arg fro wasm32
gRoussac Oct 4, 2023
1bac8c4
insert_js_value_arg
gRoussac Oct 4, 2023
096b766
Update build
gRoussac Oct 4, 2023
f59848a
Update tests and build
gRoussac Oct 4, 2023
a629b42
Remove toJson for non wasm32
gRoussac Oct 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

## any pem Key
*.pem
47 changes: 47 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[package]
name = "casper-rust-wasm-sdk"
version = "0.1.0"
edition = "2021"
description = "Casper Rust Wasm Web SDK"
repository = "https://github.com/casper-ecosystem/rustSDK"
license = "Apache-2.0"
readme = "README.md"
homepage = "https://casperlabs.io"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
casper-types = { version = "3.0.0", git = "https://github.com/casper-network/casper-node.git", branch = "rustSDK", default-features = false }
casper-client = { version = "2.0.0", git = "https://github.com/casper-ecosystem/casper-client-rs", branch = "rustSDK", default-features = false, features = [
"sdk",
] }
rand = { version = "0.8.5", default-features = false }
wee_alloc = { version = "*", default-features = false, optional = true }
wasm-bindgen = "*"
wasm-bindgen-test = "*"
wasm-bindgen-futures = "*"
js-sys = "*"
gloo-utils = { version = "0.2", default-features = false, features = ["serde"] }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_json = "1.0"
once_cell = { version = "1.18.0", default-features = false }
chrono = "0.4"
num-traits = "0.2"
humantime = "2"
thiserror = "=1.0.34"
base16 = "0.2.1"
hex = { version = "0.4.3", default-features = false }
rust_decimal = "1.10"

[lib]
crate-type = ["cdylib", "rlib"]
name = "casper_rust_wasm_sdk"
path = "src/lib.rs"

[[bin]]
name = "casper_rust_wasm_sdk"
path = "src/main.rs"
doc = false

[profile.release]
lto = true
201 changes: 201 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2022 CasperLabs Holdings AG

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
prepare:
rustup target add wasm32-unknown-unknown

CURRENT_DIR = .

# Specify the output directories for web and Node.js targets.
WEB_OUT_DIR = pkg
NODEJS_OUT_DIR = pkg-nodejs

.PHONY: all web nodejs clean build doc

pack: web nodejs

web:
wasm-pack build --target web --release --out-dir $(WEB_OUT_DIR) $(CURRENT_DIR)

nodejs:
wasm-pack build --target nodejs --release --out-dir $(NODEJS_OUT_DIR) $(CURRENT_DIR)

clean:
rm -rf $(WEB_OUT_DIR) $(NODEJS_OUT_DIR)

doc:
cargo doc --package casper-rust-wasm-sdk
cp -r target/doc/static.files/ docs/static.files/
cp -r target/doc/casper_rust_wasm_sdk/* docs/api-rust/
typedoc --out docs/api-wasm pkg/casper_rust_wasm_sdk.d.ts

build: pack doc
cd examples/frontend/angular/ && npm run build && cd .
cd examples/frontend/react/ && npm run build && cd .
cd examples/desktop/node/ && npx tsc index.ts && cd .
cd examples/desktop/electron && npm run build && cd .
Loading