Skip to content

Commit

Permalink
feat: generate types with wit and update scripts to use the new types
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Feb 4, 2022
1 parent e55bac8 commit 325d570
Show file tree
Hide file tree
Showing 20 changed files with 1,691 additions and 683 deletions.
118 changes: 110 additions & 8 deletions Cargo.lock

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

6 changes: 4 additions & 2 deletions contracts/tenk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ edition = "2018"
crate-type = ["cdylib"]

[dependencies]
near-sdk = { git = "https://github.com/near/near-sdk-rs", rev = "ea8c1f48e0f7fef8b5721848dc312646d3c1c20e"}
near-contract-standards = { git = "https://github.com/near/near-sdk-rs", rev = "ea8c1f48e0f7fef8b5721848dc312646d3c1c20e" }
# near-sdk = { path = "../../../near-sdk-rs/near-sdk"}
# near-contract-standards = { path = "../../../near-sdk-rs/near-contract-standards" }
near-sdk = { git = "https://github.com/ahalabs/near-sdk-rs", rev = "87044d1cd5a2215cc3616586432c14fafdde2eac"}
near-contract-standards = { git = "https://github.com/ahalabs/near-sdk-rs", rev = "87044d1cd5a2215cc3616586432c14fafdde2eac" }
serde = "1.0.0"
near-units = "0.2.0"
serde_with = "1.0.0"
Expand Down
10 changes: 10 additions & 0 deletions contracts/tenk/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e
cargo install --git https://github.com/ahalabs/witgen --rev 1aca670c8c4589a214a7e9e1e79bd9a89001870e cargo-witgen
cargo install --git https://github.com/ahalabs/wit-bindgen --rev fe43a371d31d8875b0856de5a954f537fe71f7cd wit-bindgen-cli
# cargo install --path ~/c/wit-bindgen

cargo witgen generate --prefix-file ./sdk.wit
wit-bindgen js-near -i ./witgen.wit --out-dir res/
mv res/witgen.ts res/index.ts
tsc
Loading

0 comments on commit 325d570

Please sign in to comment.