Skip to content

Commit

Permalink
Release v6.0.2, fixing Typescript defs to allow muxed operations. (#466)
Browse files Browse the repository at this point in the history
* Add withMuxing to all Operation options
* Bump bugfix version and corresponding changelog
  • Loading branch information
Shaptic authored Sep 13, 2021
1 parent a37e125 commit f73a226
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased


## [v6.0.2](https://github.com/stellar/js-stellar-base/compare/v6.0.1..v6.0.2)

### Fix
- Fix Typescript signatures for operations to universally allow setting the `withMuxing` flag.


## [v6.0.1](https://github.com/stellar/js-stellar-base/compare/v5.3.2..v6.0.1)

### Add
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Once all of the PRs for a particular release are in, it's time to actually publi

- [ ] Update the top-level `"version"` field in the [package.json](./package.json) file to reflect the new version.

- [ ] Run the final sanity check to ensure the builds pass: `yarn dtslint && yarn test && yarn preversion`.
- [ ] Run the final sanity check to ensure the builds pass: `yarn dtslint && yarn test && yarn preversion`. The first command checks that you have Typescript compatibility (one of the most common sources of bugs, since this library is written purely in JS but must be usable from TS).

- [ ] Commit & push your branch, then [create a PR](https://github.com/stellar/js-stellar-base/compare).

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stellar-base",
"version": "6.0.1",
"version": "6.0.2",
"description": "Low level stellar support library",
"main": "./lib/index.js",
"types": "./types/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ export type OperationType =
export namespace OperationOptions {
interface BaseOptions {
source?: string;
withMuxing?: boolean; // all operations support a muxed source
}
interface AccountMerge extends BaseOptions {
destination: string;
Expand Down
11 changes: 10 additions & 1 deletion types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,19 @@ const transaction = new StellarSdk.TransactionBuilder(account, {
.addOperation(
StellarSdk.Operation.beginSponsoringFutureReserves({
sponsoredId: account.accountId(),
source: masterKey.publicKey()
source: masterKey.publicKey(),
withMuxing: false, // ensures source can always be muxed
})
).addOperation(
StellarSdk.Operation.accountMerge({ destination: destKey.publicKey() }),
).addOperation(
StellarSdk.Operation.payment({
source: account.accountId(),
destination: muxedAccount.accountId(),
amount: "100",
asset: usd,
withMuxing: false, // ensure muxed ops also allow the flag
})
).addOperation(
StellarSdk.Operation.createClaimableBalance({
amount: "10",
Expand Down

0 comments on commit f73a226

Please sign in to comment.