Skip to content

Commit

Permalink
feat(ts-bindings): Client.deploy with constructor args
Browse files Browse the repository at this point in the history
- allow omiting `--contract-id` flag to `stellar contract bindings
  typescript` command, passing only `--wasm` instead
- if no `--contract-id` is included, then the contract will not be
  fetched from a network, so no network information is logged in this
  case
- this means it's possible to create TS Bindings libraries for contracts
  that have not yet been deployed, which makes it useful to add types
  for `Client.deploy` to the generated TS Bindings
  • Loading branch information
chadoh committed Nov 21, 2024
1 parent 9853a77 commit bb00731
Show file tree
Hide file tree
Showing 14 changed files with 186 additions and 1,153 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/bindings-ts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
--health-timeout 5s
--health-retries 50
steps:
- uses: actions/setup-node@v4
with:
node-version: '22.x'
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
Expand Down
10 changes: 5 additions & 5 deletions FULL_HELP_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,20 +289,20 @@ Generate Rust bindings

Generate a TypeScript / JavaScript package

**Usage:** `stellar contract bindings typescript [OPTIONS] --output-dir <OUTPUT_DIR> --contract-id <CONTRACT_ID>`
**Usage:** `stellar contract bindings typescript [OPTIONS] --output-dir <OUTPUT_DIR>`

###### **Options:**

* `--wasm <WASM>` — Path to optional wasm binary
* `--wasm <WASM>` — Path to wasm file on local filesystem. You must either include this OR `--contract-id`
* `--contract-id <CONTRACT_ID>` — A contract ID/address on a network (if no network settings provided, Testnet will be assumed). You must either include this OR `--wasm`
* `--output-dir <OUTPUT_DIR>` — Where to place generated project
* `--overwrite` — Whether to overwrite output directory if it already exists
* `--contract-id <CONTRACT_ID>` — The contract ID/address on the network
* `--global` — Use global config
* `--config-dir <CONFIG_DIR>` — Location of config directory, default is "."
* `--rpc-url <RPC_URL>` — RPC server endpoint
* `--rpc-header <RPC_HEADERS>` — RPC Header(s) to include in requests to the RPC provider
* `--network-passphrase <NETWORK_PASSPHRASE>` — Network passphrase to sign the transaction sent to the rpc server
* `--network <NETWORK>` — Name of network to use from config
* `--global` — Use global config
* `--config-dir <CONFIG_DIR>` — Location of config directory, default is "."



Expand Down

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

Loading

0 comments on commit bb00731

Please sign in to comment.