Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bindings-ts): support multi-auth workflows
- 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 eslint to catch missing `await`s - 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 `needsNonInvokerSigningBy()` getter and a `signAuthEntriesFor(publicKey, signingFunction)` to facilitate multi-auth workflows. - Since assembling transactions will now take place across multiple users' browsers, you can also call `json = tx.toJSON()` on an AssembledTransaction and then `contract.fromJSON[method](json)` on the next machine to continue signing Co-authored-by: Aristides Staffieri <[email protected]>
- Loading branch information