-
Notifications
You must be signed in to change notification settings - Fork 893
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: switch from soroban-react to generated libs (#117)
* feat: switch from soroban-react to generated libs * feat: add ft-contract source; rm `../examples` - don't use `soroban lab token` to generate/deploy token - instead, copy example token from examples repo - remove `../examples` reference in `generate` script - add `target/bin/soroban` with pinned version of `soroban` to be used throughout initialize.sh * fix: use workspace dependency versions; update sdk * feat: no more embedding secret keys This copies ideas from the contract in https://github.com/AhaLabs/soroban-abundance-token, allowing anyone to mint themselves tokens. Now this can be used from the frontend directly, so we no longer need to embed the admin's secret key in the JS. Hooray! Upon closer inspection, we didn't need any of those constants anymore, since the contract IDs are embedded in the token libraries. * fix: add mint_100 and comment out events * fix: start tryna fix event subscriptions * fix: update UI after minting 100 ABND * fix: signAndSend `deposit`; fix modal; update form The whole page no longer reloads after a pledge. Instead, FormPledge now takes an `onPledge` param, which it calls after the pledge succeeds. The now-somewhat-awkward `resultSubmit` has also been filled back out to match what the modal expects, so the modal looks correct. * docs: update AlmostUnnecessaryProvider comment * build: allow newer node versions; improve package name * build: generate contract clients * build: fill in .soroban-example-dapp/* first The CI script needs the values there before it can generate the libraries, of course. And the `token_admin*` stuff isn't needed anymore. * build: install locked CLI version with alias * build: build contracts before generating clients * build: s/run-script/run/ Replace `run-script` with the much more common alias `run` to match the rest of the workflow file * build: make convert.ts pass strict; exclude target/ from type checking * build: use node 18 in CI * build: update lockfile; cat lockfiles during build * build: switch to yarn; will it work better? * build: omg yarn works with relative paths but not file: * build: rm busted debug steps; update docs for yarn * build: s/yarn ci/yarn install --frozen-lockfile * build: back to npm we go * build: switch to postinstall script * build: rm outdated build step * build: warn, don't deny, on clippy complaints and add .cargo/config.toml to match CI settings * feat: use [email protected] * feat: straightforward copy/paste of subscribe logic This gets the subscriptions working, and finally breaks all dependence on the @soroban-react packages. The logic is a little confusing, but it works! * feat: move subscribe logic to useSubscription hook This is a hook that can be copy/pasted into other React projects that need such functionality, to work alongside their generated libraries until these generated libraries expose subscription logic natively. * fix: update all relevant UI after pledging * fix: avoid Freighter error if not yet connected * fix: can't default build to wasm because tests * build: use latest soroban-cli Uses the version with updated freighter-api stellar/stellar-cli#708 * build: use latest cli/soroban-client; rm stellar-base pin * build: use latest CLI rev from stellar repo * fix: deal with undefined case * build: rm RUSTFLAGS from Makefile Since d771b3f, the default settings are now set in `.cargo/config.toml` * fix: allow using standalone Everything looks correct, but when running the app it fails with: Error: Cannot connect to insecure soroban-rpc server * build: update freighter-api * build: update pinned soroban-cli version * build(ci): stub .soroban-example-dapp/network * fix: add 'await' --------- Co-authored-by: Willem Wyndham <[email protected]>
- Loading branch information
1 parent
6bf4bdd
commit c2924f0
Showing
39 changed files
with
1,555 additions
and
4,738 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
# paths = ["/path/to/override"] # path dependency overrides | ||
|
||
[alias] # command aliases | ||
install_soroban = "install --git https://github.com/stellar/soroban-tools --rev 2b343d3e6afdb5eff54fb03622627cd55e785358 --root ./target soroban-cli --debug" | ||
b = "build --target wasm32-unknown-unknown --release" | ||
# c = "check" | ||
# t = "test" | ||
# r = "run" | ||
# rr = "run --release" | ||
# recursive_example = "rr --example recursions" | ||
# space_example = ["run", "--release", "--", "\"command list\""] | ||
|
||
[build] | ||
# jobs = 1 # number of parallel jobs, defaults to # of CPUs | ||
# rustc = "rustc" # the rust compiler tool | ||
# rustc-wrapper = "…" # run this wrapper instead of `rustc` | ||
# rustc-workspace-wrapper = "…" # run this wrapper instead of `rustc` for workspace members | ||
# rustdoc = "rustdoc" # the doc generator tool | ||
# target = "wasm32-unknown-unknown" # build for the target triple (ignored by `cargo install`) | ||
# target-dir = "target" # path of where to place all generated artifacts | ||
rustflags = [ # set these to match .github/workflows/rust.yml | ||
"-Wclippy::all", # warn for all clippy lints | ||
"-Wclippy::pedantic", # warn for pedantic clippy lints | ||
] # custom flags to pass to all compiler invocations | ||
# rustdocflags = ["…", "…"] # custom flags to pass to rustdoc | ||
# incremental = true # whether or not to enable incremental compilation | ||
# dep-info-basedir = "…" # path for the base directory for targets in depfiles | ||
|
||
# [doc] | ||
# browser = "chromium" # browser to use with `cargo doc --open`, | ||
# # overrides the `BROWSER` environment variable | ||
|
||
# [env] | ||
# # Set ENV_VAR_NAME=value for any process run by Cargo | ||
# ENV_VAR_NAME = "value" | ||
# # Set even if already present in environment | ||
# ENV_VAR_NAME_2 = { value = "value", force = true } | ||
# # Value is relative to .cargo directory containing `config.toml`, make absolute | ||
# ENV_VAR_NAME_3 = { value = "relative/path", relative = true } | ||
|
||
# [future-incompat-report] | ||
# frequency = 'always' # when to display a notification about a future incompat report | ||
|
||
# [cargo-new] | ||
# vcs = "none" # VCS to use ('git', 'hg', 'pijul', 'fossil', 'none') | ||
|
||
# [http] | ||
# debug = false # HTTP debugging | ||
# proxy = "host:port" # HTTP proxy in libcurl format | ||
# ssl-version = "tlsv1.3" # TLS version to use | ||
# ssl-version.max = "tlsv1.3" # maximum TLS version | ||
# ssl-version.min = "tlsv1.1" # minimum TLS version | ||
# timeout = 30 # timeout for each HTTP request, in seconds | ||
# low-speed-limit = 10 # network timeout threshold (bytes/sec) | ||
# cainfo = "cert.pem" # path to Certificate Authority (CA) bundle | ||
# check-revoke = true # check for SSL certificate revocation | ||
# multiplexing = true # HTTP/2 multiplexing | ||
# user-agent = "…" # the user-agent header | ||
|
||
# [install] | ||
# root = "/some/path" # `cargo install` destination directory | ||
|
||
# [net] | ||
# retry = 2 # network retries | ||
# git-fetch-with-cli = true # use the `git` executable for git operations | ||
# offline = true # do not access the network | ||
|
||
# [net.ssh] | ||
# known-hosts = ["..."] # known SSH host keys | ||
|
||
# [patch.<registry>] | ||
# # Same keys as for [patch] in Cargo.toml | ||
|
||
# [profile.<name>] # Modify profile settings via config. | ||
# inherits = "dev" # Inherits settings from [profile.dev]. | ||
# opt-level = 0 # Optimization level. | ||
# debug = true # Include debug info. | ||
# split-debuginfo = '...' # Debug info splitting behavior. | ||
# debug-assertions = true # Enables debug assertions. | ||
# overflow-checks = true # Enables runtime integer overflow checks. | ||
# lto = false # Sets link-time optimization. | ||
# panic = 'unwind' # The panic strategy. | ||
# incremental = true # Incremental compilation. | ||
# codegen-units = 16 # Number of code generation units. | ||
# rpath = false # Sets the rpath linking option. | ||
# [profile.<name>.build-override] # Overrides build-script settings. | ||
# # Same keys for a normal profile. | ||
# [profile.<name>.package.<name>] # Override profile for a package. | ||
# # Same keys for a normal profile (minus `panic`, `lto`, and `rpath`). | ||
|
||
# [registries.<name>] # registries other than crates.io | ||
# index = "…" # URL of the registry index | ||
# token = "…" # authentication token for the registry | ||
|
||
# [registry] | ||
# default = "…" # name of the default registry | ||
# token = "…" # authentication token for crates.io | ||
|
||
# [source.<name>] # source definition and replacement | ||
# replace-with = "…" # replace this source with the given named source | ||
# directory = "…" # path to a directory source | ||
# registry = "…" # URL to a registry source | ||
# local-registry = "…" # path to a local registry source | ||
# git = "…" # URL of a git repository source | ||
# branch = "…" # branch name for the git repository | ||
# tag = "…" # tag name for the git repository | ||
# rev = "…" # revision for the git repository | ||
|
||
# [target.<triple>] | ||
# linker = "…" # linker to use | ||
# runner = "…" # wrapper to run executables | ||
# rustflags = ["…", "…"] # custom flags for `rustc` | ||
|
||
# [target.<cfg>] | ||
# runner = "…" # wrapper to run executables | ||
# rustflags = ["…", "…"] # custom flags for `rustc` | ||
|
||
# [target.<triple>.<links>] # `links` build script override | ||
# rustc-link-lib = ["foo"] | ||
# rustc-link-search = ["/path/to/foo"] | ||
# rustc-flags = ["-L", "/some/path"] | ||
# rustc-cfg = ['key="value"'] | ||
# rustc-env = {key = "value"} | ||
# rustc-cdylib-link-arg = ["…"] | ||
# metadata_key1 = "value" | ||
# metadata_key2 = "value" | ||
|
||
# [term] | ||
# quiet = false # whether cargo output is quiet | ||
# verbose = false # whether cargo provides verbose output | ||
# color = 'auto' # whether cargo colorizes output | ||
# progress.when = 'auto' # whether cargo shows progress bar | ||
# progress.width = 80 # width of progress bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.