Skip to content

Commit

Permalink
feat(bindings-ts): support multi-auth workflows
Browse files Browse the repository at this point in the history
- add `atomic_swap` and `token` contracts from
  https://github.com/stellar/soroban-examples to `test-wasms`
- switch from `ts-tests/package.json` to an `initialize.sh` script that
  uses a `.env` if available or defaults to environment variables. As
  before, this will build, deploy, and generate bindings for the new
  contracts, plus creating an `alice` identity and minting separate
  amounts of two separate tokens to the `root` user and `alice`
- add tests for atomic swap functionality inspired by
  https://github.com/stellar/soroban-react-atomic-swap
- let this logic guide needed updates to `bindings typescript`-generated
  libraries:
  - don't return flat values
  - instead, return a `new AssembledTransaction`, a class that has a
    `result` getter that can be used to get the result of the simulation
    right away, or can be used to `await tx.sign()` then `await
    tx.send()`.
  - `AssembledTransaction` also contains all possibly-relevant fields
    from the logic it performs, such as `sendTransactionAll` (these
    field names are a bit raw right now, and could probably be renamed
    to be more clear to new users)
  - `AssembledTransaction` also has a `nonInvokerAuthEntries()` getter
    and a `signAuthEntriesFor(publicKey, signingFunction)` to facilitate
    multi-auth workflows.

Co-authored-by: Aristides Staffieri <aristides.staffieri@stellar.org>
  • Loading branch information
chadoh and aristidesstaffieri committed Nov 7, 2023
1 parent c51c141 commit ede871b
Show file tree
Hide file tree
Showing 52 changed files with 10,803 additions and 2,540 deletions.
23 changes: 23 additions & 0 deletions Cargo.lock

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

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ version = "20.0.0-rc2"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "0992413f9b05e5bfb1f872bce99e89d9129b2e61"

[workspace.dependencies.soroban-token-sdk]
version = "20.0.0-rc2"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "0992413f9b05e5bfb1f872bce99e89d9129b2e61"

[workspace.dependencies.soroban-ledger-snapshot]
version = "20.0.0-rc2"
git = "https://github.com/stellar/rs-soroban-sdk"
Expand Down

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

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

Loading

0 comments on commit ede871b

Please sign in to comment.