@stellar/stellar-base 12.1.0 → 12.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/stellar-base.js +17 -11
- package/dist/stellar-base.min.js +1 -1
- package/lib/asset.js +1 -1
- package/lib/auth.js +14 -9
- package/lib/invocation.js +2 -1
- package/package.json +11 -11
- package/types/index.d.ts +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
## [`v12.1.1`](https://github.com/stellar/js-stellar-base/compare/v12.1.0...v12.1.1)
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
* Add missing methods to TypeScript definitions ([#766](https://github.com/stellar/js-stellar-base/pull/766)).
|
|
10
|
+
* Fix the TypeScript definition of `walkInvocationTree` to allow void returns on the callback function as intended rather than forcing a `return null` ([#765](https://github.com/stellar/js-stellar-base/pull/765)).
|
|
11
|
+
* Fix `authorizeEntry` to use the correct public key when passing `Keypair`s ([#772](https://github.com/stellar/js-stellar-base/pull/772)).
|
|
12
|
+
* Upgrade misc. dependencies ([#771](https://github.com/stellar/js-stellar-base/pull/771), [#773](https://github.com/stellar/js-stellar-base/pull/773)).
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## [`v12.1.0`](https://github.com/stellar/js-stellar-base/compare/v12.0.1...v12.1.0)
|
|
7
16
|
|
|
8
17
|
### Added
|
package/dist/stellar-base.js
CHANGED
|
@@ -11532,7 +11532,7 @@ var Asset = /*#__PURE__*/function () {
|
|
|
11532
11532
|
*/
|
|
11533
11533
|
}], [{
|
|
11534
11534
|
key: "native",
|
|
11535
|
-
value: function
|
|
11535
|
+
value: function _native() {
|
|
11536
11536
|
return new Asset('XLM');
|
|
11537
11537
|
}
|
|
11538
11538
|
|
|
@@ -21327,6 +21327,10 @@ function _asyncToGenerator(n) { return function () { var t = this, e = arguments
|
|
|
21327
21327
|
* authorization entry that you can pass along to
|
|
21328
21328
|
* {@link Operation.invokeHostFunction}
|
|
21329
21329
|
*
|
|
21330
|
+
* @note If using the `SigningCallback` variation, the signer is assumed to be
|
|
21331
|
+
* the entry's credential address. If you need a different key to sign the
|
|
21332
|
+
* entry, you will need to use different method (e.g., fork this code).
|
|
21333
|
+
*
|
|
21330
21334
|
* @see authorizeInvocation
|
|
21331
21335
|
* @example
|
|
21332
21336
|
* import {
|
|
@@ -21410,7 +21414,7 @@ function authorizeEntry(_x, _x2, _x3) {
|
|
|
21410
21414
|
* @see authorizeEntry
|
|
21411
21415
|
*/
|
|
21412
21416
|
function _authorizeEntry() {
|
|
21413
|
-
_authorizeEntry = _asyncToGenerator(
|
|
21417
|
+
_authorizeEntry = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(entry, signer, validUntilLedgerSeq) {
|
|
21414
21418
|
var networkPassphrase,
|
|
21415
21419
|
clone,
|
|
21416
21420
|
addrAuth,
|
|
@@ -21444,7 +21448,7 @@ function _authorizeEntry() {
|
|
|
21444
21448
|
}));
|
|
21445
21449
|
payload = hashing_hash(preimage.toXDR());
|
|
21446
21450
|
if (!(typeof signer === 'function')) {
|
|
21447
|
-
_context.next =
|
|
21451
|
+
_context.next = 18;
|
|
21448
21452
|
break;
|
|
21449
21453
|
}
|
|
21450
21454
|
_context.t0 = auth_Buffer;
|
|
@@ -21453,18 +21457,19 @@ function _authorizeEntry() {
|
|
|
21453
21457
|
case 13:
|
|
21454
21458
|
_context.t1 = _context.sent;
|
|
21455
21459
|
signature = _context.t0.from.call(_context.t0, _context.t1);
|
|
21456
|
-
|
|
21460
|
+
publicKey = Address.fromScAddress(addrAuth.address()).toString();
|
|
21461
|
+
_context.next = 20;
|
|
21457
21462
|
break;
|
|
21458
|
-
case 17:
|
|
21459
|
-
signature = auth_Buffer.from(signer.sign(payload));
|
|
21460
21463
|
case 18:
|
|
21461
|
-
|
|
21464
|
+
signature = auth_Buffer.from(signer.sign(payload));
|
|
21465
|
+
publicKey = signer.publicKey();
|
|
21466
|
+
case 20:
|
|
21462
21467
|
if (Keypair.fromPublicKey(publicKey).verify(payload, signature)) {
|
|
21463
|
-
_context.next =
|
|
21468
|
+
_context.next = 22;
|
|
21464
21469
|
break;
|
|
21465
21470
|
}
|
|
21466
21471
|
throw new Error("signature doesn't match payload");
|
|
21467
|
-
case
|
|
21472
|
+
case 22:
|
|
21468
21473
|
// This structure is defined here:
|
|
21469
21474
|
// https://soroban.stellar.org/docs/fundamentals-and-concepts/invoking-contracts-with-transactions#stellar-account-signatures
|
|
21470
21475
|
//
|
|
@@ -21481,7 +21486,7 @@ function _authorizeEntry() {
|
|
|
21481
21486
|
});
|
|
21482
21487
|
addrAuth.signature(src_xdr.ScVal.scvVec([sigScVal]));
|
|
21483
21488
|
return _context.abrupt("return", clone);
|
|
21484
|
-
case
|
|
21489
|
+
case 25:
|
|
21485
21490
|
case "end":
|
|
21486
21491
|
return _context.stop();
|
|
21487
21492
|
}
|
|
@@ -21684,7 +21689,8 @@ function buildInvocationTree(root) {
|
|
|
21684
21689
|
* @param {xdr.SorobanAuthorizedInvocation} [parent] this `node`s parent node,
|
|
21685
21690
|
* if any (i.e. this doesn't exist at the root)
|
|
21686
21691
|
*
|
|
21687
|
-
* @returns {boolean
|
|
21692
|
+
* @returns {boolean|null|void} returning exactly `false` is a hint to stop
|
|
21693
|
+
* exploring, other values are ignored
|
|
21688
21694
|
*/
|
|
21689
21695
|
|
|
21690
21696
|
/**
|