stellar-base
Advanced tools
Comparing version 10.0.0-beta.2 to 10.0.0-beta.3
@@ -6,3 +6,14 @@ # Changelog | ||
### Fixed | ||
- The type definition for `Memo.hash` now allows `Buffer`s ([#698](https://github.com/stellar/js-stellar-base/pull/698)). | ||
## [`v10.0.0-beta.3`](https://github.com/stellar/js-stellar-base/compare/v10.0.0-beta.2...v10.0.0-beta.3) | ||
### Fixed | ||
* Fixes a bug where `authorizeEntry` might perform a no-op when it shouldn't ([#701](https://github.com/stellar/js-stellar-base/pull/701)). | ||
* Fixes a TypeScript bug where `Memo.hash` did not accept a `Buffer` ([#698](https://github.com/stellar/js-stellar-base/pull/698)). | ||
* Upgrades a transient dependency for security ([#296](https://github.com/stellar/js-stellar-base/pull/696)). | ||
## [`v10.0.0-beta.2`](https://github.com/stellar/js-stellar-base/compare/v10.0.0-beta.1...v10.0.0-beta.2) | ||
@@ -9,0 +20,0 @@ |
@@ -33,3 +33,3 @@ "use strict"; | ||
*/ | ||
var Account = /*#__PURE__*/function () { | ||
var Account = exports.Account = /*#__PURE__*/function () { | ||
function Account(accountId, sequence) { | ||
@@ -81,3 +81,2 @@ _classCallCheck(this, Account); | ||
return Account; | ||
}(); | ||
exports.Account = Account; | ||
}(); |
@@ -29,3 +29,3 @@ "use strict"; | ||
*/ | ||
var Address = /*#__PURE__*/function () { | ||
var Address = exports.Address = /*#__PURE__*/function () { | ||
function Address(address) { | ||
@@ -170,3 +170,2 @@ _classCallCheck(this, Address); | ||
return Address; | ||
}(); | ||
exports.Address = Address; | ||
}(); |
@@ -30,3 +30,3 @@ "use strict"; | ||
*/ | ||
var Asset = /*#__PURE__*/function () { | ||
var Asset = exports.Asset = /*#__PURE__*/function () { | ||
function Asset(code, issuer) { | ||
@@ -322,5 +322,4 @@ _classCallCheck(this, Asset); | ||
*/ | ||
exports.Asset = Asset; | ||
function asciiCompare(a, b) { | ||
return Buffer.compare(Buffer.from(a, 'ascii'), Buffer.from(b, 'ascii')); | ||
} |
@@ -118,4 +118,3 @@ "use strict"; | ||
* | ||
* This is in contrast to {@link authorizeEntry}, which signs an existing entry | ||
* "in place". | ||
* This is in contrast to {@link authorizeEntry}, which signs an existing entry. | ||
* | ||
@@ -163,3 +162,3 @@ * @param {Keypair | SigningCallback} signer either a {@link Keypair} instance | ||
networkPassphrase = _args.length > 3 && _args[3] !== undefined ? _args[3] : _network.Networks.FUTURENET; | ||
if (!(entry.credentials()["switch"]() !== _xdr["default"].SorobanCredentialsType.sorobanCredentialsAddress())) { | ||
if (!(entry.credentials()["switch"]().value !== _xdr["default"].SorobanCredentialsType.sorobanCredentialsAddress().value)) { | ||
_context.next = 3; | ||
@@ -166,0 +165,0 @@ break; |
@@ -26,3 +26,3 @@ "use strict"; | ||
*/ | ||
var Claimant = /*#__PURE__*/function () { | ||
var Claimant = exports.Claimant = /*#__PURE__*/function () { | ||
function Claimant(destination, predicate) { | ||
@@ -194,3 +194,2 @@ _classCallCheck(this, Claimant); | ||
return Claimant; | ||
}(); | ||
exports.Claimant = Claimant; | ||
}(); |
@@ -31,3 +31,3 @@ "use strict"; | ||
*/ | ||
var Contract = /*#__PURE__*/function () { | ||
var Contract = exports.Contract = /*#__PURE__*/function () { | ||
function Contract(contractId) { | ||
@@ -114,3 +114,2 @@ _classCallCheck(this, Contract); | ||
return Contract; | ||
}(); | ||
exports.Contract = Contract; | ||
}(); |
@@ -42,3 +42,3 @@ "use strict"; | ||
*/ | ||
var FeeBumpTransaction = /*#__PURE__*/function (_TransactionBase) { | ||
var FeeBumpTransaction = exports.FeeBumpTransaction = /*#__PURE__*/function (_TransactionBase) { | ||
_inherits(FeeBumpTransaction, _TransactionBase); | ||
@@ -136,3 +136,2 @@ var _super = _createSuper(FeeBumpTransaction); | ||
return FeeBumpTransaction; | ||
}(_transaction_base.TransactionBase); | ||
exports.FeeBumpTransaction = FeeBumpTransaction; | ||
}(_transaction_base.TransactionBase); |
@@ -13,3 +13,3 @@ "use strict"; | ||
// LiquidityPoolFeeV18 is the default liquidity pool fee in protocol v18. It defaults to 30 base points (0.3%). | ||
var LiquidityPoolFeeV18 = 30; | ||
var LiquidityPoolFeeV18 = exports.LiquidityPoolFeeV18 = 30; | ||
@@ -30,3 +30,2 @@ /** | ||
*/ | ||
exports.LiquidityPoolFeeV18 = LiquidityPoolFeeV18; | ||
function getLiquidityPoolId(liquidityPoolType) { | ||
@@ -33,0 +32,0 @@ var liquidityPoolParameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; |
@@ -385,3 +385,2 @@ "use strict"; | ||
// | ||
var _default = module.exports; | ||
exports["default"] = _default; | ||
var _default = exports["default"] = module.exports; |
@@ -36,3 +36,3 @@ "use strict"; | ||
*/ | ||
var Keypair = /*#__PURE__*/function () { | ||
var Keypair = exports.Keypair = /*#__PURE__*/function () { | ||
function Keypair(keys) { | ||
@@ -309,3 +309,2 @@ _classCallCheck(this, Keypair); | ||
return Keypair; | ||
}(); | ||
exports.Keypair = Keypair; | ||
}(); |
@@ -28,3 +28,3 @@ "use strict"; | ||
*/ | ||
var LiquidityPoolAsset = /*#__PURE__*/function () { | ||
var LiquidityPoolAsset = exports.LiquidityPoolAsset = /*#__PURE__*/function () { | ||
function LiquidityPoolAsset(assetA, assetB, fee) { | ||
@@ -127,3 +127,2 @@ _classCallCheck(this, LiquidityPoolAsset); | ||
return LiquidityPoolAsset; | ||
}(); | ||
exports.LiquidityPoolAsset = LiquidityPoolAsset; | ||
}(); |
@@ -22,3 +22,3 @@ "use strict"; | ||
*/ | ||
var LiquidityPoolId = /*#__PURE__*/function () { | ||
var LiquidityPoolId = exports.LiquidityPoolId = /*#__PURE__*/function () { | ||
function LiquidityPoolId(liquidityPoolId) { | ||
@@ -102,3 +102,2 @@ _classCallCheck(this, LiquidityPoolId); | ||
return LiquidityPoolId; | ||
}(); | ||
exports.LiquidityPoolId = LiquidityPoolId; | ||
}(); |
@@ -20,23 +20,19 @@ "use strict"; | ||
*/ | ||
var MemoNone = 'none'; | ||
var MemoNone = exports.MemoNone = 'none'; | ||
/** | ||
* Type of {@link Memo}. | ||
*/ | ||
exports.MemoNone = MemoNone; | ||
var MemoID = 'id'; | ||
var MemoID = exports.MemoID = 'id'; | ||
/** | ||
* Type of {@link Memo}. | ||
*/ | ||
exports.MemoID = MemoID; | ||
var MemoText = 'text'; | ||
var MemoText = exports.MemoText = 'text'; | ||
/** | ||
* Type of {@link Memo}. | ||
*/ | ||
exports.MemoText = MemoText; | ||
var MemoHash = 'hash'; | ||
var MemoHash = exports.MemoHash = 'hash'; | ||
/** | ||
* Type of {@link Memo}. | ||
*/ | ||
exports.MemoHash = MemoHash; | ||
var MemoReturn = 'return'; | ||
var MemoReturn = exports.MemoReturn = 'return'; | ||
@@ -51,4 +47,3 @@ /** | ||
*/ | ||
exports.MemoReturn = MemoReturn; | ||
var Memo = /*#__PURE__*/function () { | ||
var Memo = exports.Memo = /*#__PURE__*/function () { | ||
function Memo(type) { | ||
@@ -277,3 +272,2 @@ var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
return Memo; | ||
}(); | ||
exports.Memo = Memo; | ||
}(); |
@@ -55,3 +55,3 @@ "use strict"; | ||
*/ | ||
var MuxedAccount = /*#__PURE__*/function () { | ||
var MuxedAccount = exports.MuxedAccount = /*#__PURE__*/function () { | ||
function MuxedAccount(baseAccount, id) { | ||
@@ -160,3 +160,2 @@ _classCallCheck(this, MuxedAccount); | ||
return MuxedAccount; | ||
}(); | ||
exports.MuxedAccount = MuxedAccount; | ||
}(); |
@@ -16,3 +16,3 @@ "use strict"; | ||
*/ | ||
var Networks = { | ||
var Networks = exports.Networks = { | ||
PUBLIC: 'Public Global Stellar Network ; September 2015', | ||
@@ -23,3 +23,2 @@ TESTNET: 'Test SDF Network ; September 2015', | ||
STANDALONE: 'Standalone Network ; February 2017' | ||
}; | ||
exports.Networks = Networks; | ||
}; |
@@ -21,3 +21,3 @@ "use strict"; | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
var Int128 = /*#__PURE__*/function (_LargeInt) { | ||
var Int128 = exports.Int128 = /*#__PURE__*/function (_LargeInt) { | ||
_inherits(Int128, _LargeInt); | ||
@@ -51,3 +51,2 @@ var _super = _createSuper(Int128); | ||
}(_jsXdr.LargeInt); | ||
exports.Int128 = Int128; | ||
Int128.defineIntBoundaries(); |
@@ -21,3 +21,3 @@ "use strict"; | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
var Int256 = /*#__PURE__*/function (_LargeInt) { | ||
var Int256 = exports.Int256 = /*#__PURE__*/function (_LargeInt) { | ||
_inherits(Int256, _LargeInt); | ||
@@ -51,3 +51,2 @@ var _super = _createSuper(Int256); | ||
}(_jsXdr.LargeInt); | ||
exports.Int256 = Int256; | ||
Int256.defineIntBoundaries(); |
@@ -94,3 +94,3 @@ "use strict"; | ||
*/ | ||
var ScInt = /*#__PURE__*/function (_XdrLargeInt) { | ||
var ScInt = exports.ScInt = /*#__PURE__*/function (_XdrLargeInt) { | ||
_inherits(ScInt, _XdrLargeInt); | ||
@@ -126,3 +126,2 @@ var _super = _createSuper(ScInt); | ||
}(_xdr_large_int.XdrLargeInt); | ||
exports.ScInt = ScInt; | ||
function nearestBigIntSize(bigI) { | ||
@@ -129,0 +128,0 @@ var _find; |
@@ -21,3 +21,3 @@ "use strict"; | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
var Uint128 = /*#__PURE__*/function (_LargeInt) { | ||
var Uint128 = exports.Uint128 = /*#__PURE__*/function (_LargeInt) { | ||
_inherits(Uint128, _LargeInt); | ||
@@ -51,3 +51,2 @@ var _super = _createSuper(Uint128); | ||
}(_jsXdr.LargeInt); | ||
exports.Uint128 = Uint128; | ||
Uint128.defineIntBoundaries(); |
@@ -21,3 +21,3 @@ "use strict"; | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
var Uint256 = /*#__PURE__*/function (_LargeInt) { | ||
var Uint256 = exports.Uint256 = /*#__PURE__*/function (_LargeInt) { | ||
_inherits(Uint256, _LargeInt); | ||
@@ -51,3 +51,2 @@ var _super = _createSuper(Uint256); | ||
}(_jsXdr.LargeInt); | ||
exports.Uint256 = Uint256; | ||
Uint256.defineIntBoundaries(); |
@@ -34,3 +34,3 @@ "use strict"; | ||
*/ | ||
var XdrLargeInt = /*#__PURE__*/function () { | ||
var XdrLargeInt = exports.XdrLargeInt = /*#__PURE__*/function () { | ||
function XdrLargeInt(type, values) { | ||
@@ -272,3 +272,2 @@ _classCallCheck(this, XdrLargeInt); | ||
return XdrLargeInt; | ||
}(); | ||
exports.XdrLargeInt = XdrLargeInt; | ||
}(); |
@@ -39,3 +39,3 @@ "use strict"; | ||
*/ | ||
var AuthRequiredFlag = 1 << 0; | ||
var AuthRequiredFlag = exports.AuthRequiredFlag = 1 << 0; | ||
/** | ||
@@ -48,4 +48,3 @@ * When set using `{@link Operation.setOptions}` option, allows the issuing | ||
*/ | ||
exports.AuthRequiredFlag = AuthRequiredFlag; | ||
var AuthRevocableFlag = 1 << 1; | ||
var AuthRevocableFlag = exports.AuthRevocableFlag = 1 << 1; | ||
/** | ||
@@ -58,4 +57,3 @@ * When set using `{@link Operation.setOptions}` option, then none of the | ||
*/ | ||
exports.AuthRevocableFlag = AuthRevocableFlag; | ||
var AuthImmutableFlag = 1 << 2; | ||
var AuthImmutableFlag = exports.AuthImmutableFlag = 1 << 2; | ||
@@ -70,4 +68,3 @@ /** | ||
*/ | ||
exports.AuthImmutableFlag = AuthImmutableFlag; | ||
var AuthClawbackEnabledFlag = 1 << 3; | ||
var AuthClawbackEnabledFlag = exports.AuthClawbackEnabledFlag = 1 << 3; | ||
@@ -116,4 +113,3 @@ /** | ||
*/ | ||
exports.AuthClawbackEnabledFlag = AuthClawbackEnabledFlag; | ||
var Operation = /*#__PURE__*/function () { | ||
var Operation = exports.Operation = /*#__PURE__*/function () { | ||
function Operation() { | ||
@@ -582,3 +578,2 @@ _classCallCheck(this, Operation); | ||
}(); | ||
exports.Operation = Operation; | ||
function extractRevokeSponshipDetails(attrs, result) { | ||
@@ -585,0 +580,0 @@ switch (attrs["switch"]().name) { |
@@ -25,3 +25,3 @@ "use strict"; | ||
*/ | ||
var SignerKey = /*#__PURE__*/function () { | ||
var SignerKey = exports.SignerKey = /*#__PURE__*/function () { | ||
function SignerKey() { | ||
@@ -104,3 +104,2 @@ _classCallCheck(this, SignerKey); | ||
return SignerKey; | ||
}(); | ||
exports.SignerKey = SignerKey; | ||
}(); |
@@ -23,4 +23,3 @@ "use strict"; | ||
*/ | ||
var FastSigning = checkFastSigning(); | ||
exports.FastSigning = FastSigning; | ||
var FastSigning = exports.FastSigning = checkFastSigning(); | ||
function sign(data, secretKey) { | ||
@@ -27,0 +26,0 @@ return actualMethods.sign(data, secretKey); |
@@ -24,3 +24,3 @@ "use strict"; | ||
*/ | ||
var Soroban = /*#__PURE__*/function () { | ||
var Soroban = exports.Soroban = /*#__PURE__*/function () { | ||
function Soroban() { | ||
@@ -90,3 +90,2 @@ _classCallCheck(this, Soroban); | ||
return Soroban; | ||
}(); | ||
exports.Soroban = Soroban; | ||
}(); |
@@ -47,3 +47,3 @@ "use strict"; | ||
*/ | ||
var SorobanDataBuilder = /*#__PURE__*/function () { | ||
var SorobanDataBuilder = exports.SorobanDataBuilder = /*#__PURE__*/function () { | ||
function SorobanDataBuilder(sorobanData) { | ||
@@ -221,3 +221,2 @@ _classCallCheck(this, SorobanDataBuilder); | ||
return SorobanDataBuilder; | ||
}(); | ||
exports.SorobanDataBuilder = SorobanDataBuilder; | ||
}(); |
@@ -49,3 +49,3 @@ "use strict"; | ||
*/ | ||
var StrKey = /*#__PURE__*/function () { | ||
var StrKey = exports.StrKey = /*#__PURE__*/function () { | ||
function StrKey() { | ||
@@ -289,3 +289,2 @@ _classCallCheck(this, StrKey); | ||
*/ | ||
exports.StrKey = StrKey; | ||
function isValid(versionByteName, encoded) { | ||
@@ -292,0 +291,0 @@ if (typeof encoded !== 'string') { |
@@ -20,3 +20,3 @@ "use strict"; | ||
*/ | ||
var TransactionBase = /*#__PURE__*/function () { | ||
var TransactionBase = exports.TransactionBase = /*#__PURE__*/function () { | ||
function TransactionBase(tx, signatures, fee, networkPassphrase) { | ||
@@ -249,3 +249,2 @@ _classCallCheck(this, TransactionBase); | ||
return TransactionBase; | ||
}(); | ||
exports.TransactionBase = TransactionBase; | ||
}(); |
@@ -46,3 +46,3 @@ "use strict"; | ||
*/ | ||
var BASE_FEE = '100'; // Stroops | ||
var BASE_FEE = exports.BASE_FEE = '100'; // Stroops | ||
@@ -54,4 +54,3 @@ /** | ||
*/ | ||
exports.BASE_FEE = BASE_FEE; | ||
var TimeoutInfinite = 0; | ||
var TimeoutInfinite = exports.TimeoutInfinite = 0; | ||
@@ -147,4 +146,3 @@ /** | ||
*/ | ||
exports.TimeoutInfinite = TimeoutInfinite; | ||
var TransactionBuilder = /*#__PURE__*/function () { | ||
var TransactionBuilder = exports.TransactionBuilder = /*#__PURE__*/function () { | ||
function TransactionBuilder(sourceAccount) { | ||
@@ -754,3 +752,2 @@ var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
*/ | ||
exports.TransactionBuilder = TransactionBuilder; | ||
function isValidDate(d) { | ||
@@ -757,0 +754,0 @@ // isnan is okay here because it correctly checks for invalid date objects |
@@ -47,3 +47,3 @@ "use strict"; | ||
*/ | ||
var Transaction = /*#__PURE__*/function (_TransactionBase) { | ||
var Transaction = exports.Transaction = /*#__PURE__*/function (_TransactionBase) { | ||
_inherits(Transaction, _TransactionBase); | ||
@@ -366,3 +366,2 @@ var _super = _createSuper(Transaction); | ||
return Transaction; | ||
}(_transaction_base.TransactionBase); | ||
exports.Transaction = Transaction; | ||
}(_transaction_base.TransactionBase); |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.trimEnd = void 0; | ||
var trimEnd = function trimEnd(input, _char) { | ||
var trimEnd = exports.trimEnd = function trimEnd(input, _char) { | ||
var isNumber = typeof input === 'number'; | ||
@@ -15,3 +15,2 @@ var str = String(input); | ||
return isNumber ? Number(str) : str; | ||
}; | ||
exports.trimEnd = trimEnd; | ||
}; |
@@ -9,3 +9,2 @@ "use strict"; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _default = _curr_generated["default"]; | ||
exports["default"] = _default; | ||
var _default = exports["default"] = _curr_generated["default"]; |
{ | ||
"name": "stellar-base", | ||
"version": "10.0.0-beta.2", | ||
"version": "10.0.0-beta.3", | ||
"description": "Low-level support library for the Stellar network.", | ||
@@ -73,4 +73,4 @@ "main": "./lib/index.js", | ||
"devDependencies": { | ||
"@babel/cli": "^7.22.15", | ||
"@babel/core": "^7.22.20", | ||
"@babel/cli": "^7.23.0", | ||
"@babel/core": "^7.23.0", | ||
"@babel/eslint-parser": "^7.22.15", | ||
@@ -80,12 +80,12 @@ "@babel/eslint-plugin": "^7.22.10", | ||
"@babel/register": "^7.22.15", | ||
"@definitelytyped/dtslint": "^0.0.178", | ||
"@definitelytyped/dtslint": "^0.0.182", | ||
"@istanbuljs/nyc-config-babel": "3.0.0", | ||
"@types/node": "^20.6.3", | ||
"@typescript-eslint/parser": "^6.7.2", | ||
"@types/node": "^20.8.4", | ||
"@typescript-eslint/parser": "^6.7.5", | ||
"babel-loader": "^9.1.3", | ||
"babel-plugin-istanbul": "^6.1.1", | ||
"chai": "^4.3.8", | ||
"chai": "^4.3.10", | ||
"chai-as-promised": "^7.1.1", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^8.49.0", | ||
"eslint": "^8.51.0", | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
@@ -115,3 +115,3 @@ "eslint-config-prettier": "^9.0.0", | ||
"randombytes": "^2.1.0", | ||
"sinon": "^16.0.0", | ||
"sinon": "^16.1.0", | ||
"sinon-chai": "^3.7.0", | ||
@@ -118,0 +118,0 @@ "taffydb": "^2.7.3", |
@@ -214,3 +214,3 @@ // TypeScript Version: 2.9 | ||
static fromXDRObject(memo: xdr.Memo): Memo; | ||
static hash(hash: string): Memo<MemoType.Hash>; | ||
static hash(hash: string | Buffer): Memo<MemoType.Hash>; | ||
static id(id: string): Memo<MemoType.ID>; | ||
@@ -217,0 +217,0 @@ static none(): Memo<MemoType.None>; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
3483874
70925