-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use JS SDK's Client for "invoke contract"
This page contained a very complicated, old-school example of how to invoke a smart contract. I've updated it with how to use `contract.Client`. I made this somewhat more complicated than it needs to be, showing how to also deploy a new contract from an already-uploaded Wasm hash. I wanted to do this for a few reasons: - The part where we actually call `increment` has become so simple that the page feels almost unnecessary, if that's all we show. (Although maybe that would be good?) - The example contract ID is almost certainly invalid. If people want to walk through the whole thing, it would be nice to show them how to walk through _the whole thing._ - It's actually fairly straightforward! It allows us to show off more of Client's features. That said, I would love to add the ability to deploy directly from a file: ```ts Client.deploy({ wasm: "path/to/some/file.wasm" }) ``` If the JS SDK gains this ability, then we can clean up this example even more, removing the `stellar contract install` CLI step.
- Loading branch information
Showing
1 changed file
with
99 additions
and
108 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