New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

stellar-sdk

Package Overview
Dependencies
Maintainers
8
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stellar-sdk - npm Package Compare versions

Comparing version 11.0.0-beta.4 to 11.0.0-beta.5

lib/contract_spec.d.ts

9

CHANGELOG.md

@@ -9,2 +9,11 @@ # Changelog

## [v11.0.0-beta.5](https://github.com/stellar/js-stellar-sdk/compare/v11.0.0-beta.4...v11.0.0-beta.5)
### Breaking Changes
* The `soroban-client` library ([stellar/js-soroban-client](https://github.com/stellar/js-soroban-client)) has been merged into this package, causing significant breaking changes in the module structure ([#860](https://github.com/stellar/js-stellar-sdk/pull/860)):
- The namespaces have changed to move each server-dependent component into its own module. Shared components (e.g. `TransactionBuilder`) are still in the top level, Horizon-specific interactions are in the `Horizon` namespace (i.e. `Server` is now `Horizon.Server`), and new Soroban RPC interactions are in the `SorobanRpc` namespace.
- There is a [detailed migration guide](https://gist.github.com/Shaptic/5ce4f16d9cce7118f391fbde398c2f30) available to outline both the literal (i.e. necessary code changes) and philosophical (i.e. how to find certain functionality) changes needed to adapt to this merge.
* The `SorobanRpc.Server.prepareTransaction` and `SorobanRpc.assembleTransaction` methods no longer need an optional `networkPassphrase` parameter, because it is implicitly part of the transaction already ([#870](https://github.com/stellar/js-stellar-sdk/pull/870)).
## [v11.0.0-beta.4](https://github.com/stellar/js-stellar-sdk/compare/v11.0.0-beta.3...v11.0.0-beta.4)

@@ -11,0 +20,0 @@

4

lib/browser.js

@@ -35,4 +35,4 @@ "use strict";

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
var _default = exports.default = module.exports;

@@ -1,5 +0,5 @@

import { Horizon } from "./horizon_api";
import { HorizonApi } from "./horizon/horizon_api";
export declare class NetworkError extends Error {
response: {
data?: Horizon.ErrorResponseData;
data?: HorizonApi.ErrorResponseData;
status?: number;

@@ -12,3 +12,3 @@ statusText?: string;

getResponse(): {
data?: Horizon.ErrorResponseData | undefined;
data?: HorizonApi.ErrorResponseData | undefined;
status?: number | undefined;

@@ -28,6 +28,2 @@ statusText?: string | undefined;

}
export declare class InvalidSep10ChallengeError extends Error {
__proto__: InvalidSep10ChallengeError;
constructor(message: string);
}
/**

@@ -34,0 +30,0 @@ * AccountRequiresMemoError is raised when a transaction is trying to submit an

@@ -7,3 +7,3 @@ "use strict";

});
exports.NotFoundError = exports.NetworkError = exports.InvalidSep10ChallengeError = exports.BadResponseError = exports.BadRequestError = exports.AccountRequiresMemoError = void 0;
exports.NotFoundError = exports.NetworkError = exports.BadResponseError = exports.BadRequestError = exports.AccountRequiresMemoError = void 0;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -21,3 +21,3 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf("[native code]") !== -1; } catch (e) { return typeof fn === "function"; } }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

@@ -91,33 +91,18 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

}(NetworkError);
var InvalidSep10ChallengeError = exports.InvalidSep10ChallengeError = function (_Error2) {
_inherits(InvalidSep10ChallengeError, _Error2);
var _super5 = _createSuper(InvalidSep10ChallengeError);
function InvalidSep10ChallengeError(message) {
var AccountRequiresMemoError = exports.AccountRequiresMemoError = function (_Error2) {
_inherits(AccountRequiresMemoError, _Error2);
var _super5 = _createSuper(AccountRequiresMemoError);
function AccountRequiresMemoError(message, accountId, operationIndex) {
var _this5;
_classCallCheck(this, InvalidSep10ChallengeError);
var trueProto = (this instanceof InvalidSep10ChallengeError ? this.constructor : void 0).prototype;
_classCallCheck(this, AccountRequiresMemoError);
var trueProto = (this instanceof AccountRequiresMemoError ? this.constructor : void 0).prototype;
_this5 = _super5.call(this, message);
_this5.__proto__ = trueProto;
_this5.constructor = InvalidSep10ChallengeError;
_this5.name = "InvalidSep10ChallengeError";
_this5.constructor = AccountRequiresMemoError;
_this5.name = "AccountRequiresMemoError";
_this5.accountId = accountId;
_this5.operationIndex = operationIndex;
return _this5;
}
return _createClass(InvalidSep10ChallengeError);
}(_wrapNativeSuper(Error));
var AccountRequiresMemoError = exports.AccountRequiresMemoError = function (_Error3) {
_inherits(AccountRequiresMemoError, _Error3);
var _super6 = _createSuper(AccountRequiresMemoError);
function AccountRequiresMemoError(message, accountId, operationIndex) {
var _this6;
_classCallCheck(this, AccountRequiresMemoError);
var trueProto = (this instanceof AccountRequiresMemoError ? this.constructor : void 0).prototype;
_this6 = _super6.call(this, message);
_this6.__proto__ = trueProto;
_this6.constructor = AccountRequiresMemoError;
_this6.name = "AccountRequiresMemoError";
_this6.accountId = accountId;
_this6.operationIndex = operationIndex;
return _this6;
}
return _createClass(AccountRequiresMemoError);
}(_wrapNativeSuper(Error));
/// <reference path="../types/dom-monkeypatch.d.ts" />
declare const version: any;
export * from "./horizon_api";
export * from "./server_api";
export * from "./account_response";
export * from "./errors";
export { Config } from "./config";
export { Server } from "./server";
export { FederationServer, FEDERATION_RESPONSE_MAX_SIZE } from "./federation_server";
export { StellarTomlResolver, STELLAR_TOML_MAX_SIZE } from "./stellar_toml_resolver";
export { default as HorizonAxiosClient, SERVER_TIME_MAP, getCurrentServerTime } from "./horizon_axios_client";
export * from "./utils";
export * from "stellar-base";
export { version };
export * from './errors';
export { Config } from './config';
export { Utils } from './utils';
export * as StellarToml from './stellartoml';
export * as Federation from './federation';
export * as WebAuth from './webauth';
export * as Friendbot from './friendbot';
export * as Horizon from './horizon';
export * as SorobanRpc from './soroban';
export { ContractSpec } from './contract_spec';
export * from 'stellar-base';
declare const _default: any;
export default _default;

@@ -8,12 +8,11 @@ "use strict";

var _exportNames = {
version: true,
Config: true,
Server: true,
FederationServer: true,
FEDERATION_RESPONSE_MAX_SIZE: true,
StellarTomlResolver: true,
STELLAR_TOML_MAX_SIZE: true,
HorizonAxiosClient: true,
SERVER_TIME_MAP: true,
getCurrentServerTime: true
Utils: true,
StellarToml: true,
Federation: true,
WebAuth: true,
Friendbot: true,
Horizon: true,
SorobanRpc: true,
ContractSpec: true
};

@@ -26,88 +25,16 @@ Object.defineProperty(exports, "Config", {

});
Object.defineProperty(exports, "FEDERATION_RESPONSE_MAX_SIZE", {
Object.defineProperty(exports, "ContractSpec", {
enumerable: true,
get: function get() {
return _federation_server.FEDERATION_RESPONSE_MAX_SIZE;
return _contract_spec.ContractSpec;
}
});
Object.defineProperty(exports, "FederationServer", {
exports.StellarToml = exports.SorobanRpc = exports.Horizon = exports.Friendbot = exports.Federation = void 0;
Object.defineProperty(exports, "Utils", {
enumerable: true,
get: function get() {
return _federation_server.FederationServer;
return _utils.Utils;
}
});
Object.defineProperty(exports, "HorizonAxiosClient", {
enumerable: true,
get: function get() {
return _horizon_axios_client.default;
}
});
Object.defineProperty(exports, "SERVER_TIME_MAP", {
enumerable: true,
get: function get() {
return _horizon_axios_client.SERVER_TIME_MAP;
}
});
Object.defineProperty(exports, "STELLAR_TOML_MAX_SIZE", {
enumerable: true,
get: function get() {
return _stellar_toml_resolver.STELLAR_TOML_MAX_SIZE;
}
});
Object.defineProperty(exports, "Server", {
enumerable: true,
get: function get() {
return _server.Server;
}
});
Object.defineProperty(exports, "StellarTomlResolver", {
enumerable: true,
get: function get() {
return _stellar_toml_resolver.StellarTomlResolver;
}
});
exports.default = void 0;
Object.defineProperty(exports, "getCurrentServerTime", {
enumerable: true,
get: function get() {
return _horizon_axios_client.getCurrentServerTime;
}
});
exports.version = void 0;
var _horizon_api = require("./horizon_api");
Object.keys(_horizon_api).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _horizon_api[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _horizon_api[key];
}
});
});
var _server_api = require("./server_api");
Object.keys(_server_api).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _server_api[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _server_api[key];
}
});
});
var _account_response = require("./account_response");
Object.keys(_account_response).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _account_response[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _account_response[key];
}
});
});
exports.default = exports.WebAuth = void 0;
var _errors = require("./errors");

@@ -126,18 +53,16 @@ Object.keys(_errors).forEach(function (key) {

var _config = require("./config");
var _server = require("./server");
var _federation_server = require("./federation_server");
var _stellar_toml_resolver = require("./stellar_toml_resolver");
var _horizon_axios_client = _interopRequireWildcard(require("./horizon_axios_client"));
var _utils = require("./utils");
Object.keys(_utils).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _utils[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _utils[key];
}
});
});
var _StellarToml = _interopRequireWildcard(require("./stellartoml"));
exports.StellarToml = _StellarToml;
var _Federation = _interopRequireWildcard(require("./federation"));
exports.Federation = _Federation;
var _WebAuth = _interopRequireWildcard(require("./webauth"));
exports.WebAuth = _WebAuth;
var _Friendbot = _interopRequireWildcard(require("./friendbot"));
exports.Friendbot = _Friendbot;
var _Horizon = _interopRequireWildcard(require("./horizon"));
exports.Horizon = _Horizon;
var _SorobanRpc = _interopRequireWildcard(require("./soroban"));
exports.SorobanRpc = _SorobanRpc;
var _contract_spec = require("./contract_spec");
var _stellarBase = require("stellar-base");

@@ -155,5 +80,4 @@ Object.keys(_stellarBase).forEach(function (key) {

});
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var version = exports.version = require("../package.json").version;
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
var _default = exports.default = module.exports;

@@ -1,234 +0,12 @@

import { FeeBumpTransaction, Keypair, Transaction } from "stellar-base";
import { ServerApi } from "./server_api";
/**
* @namespace Utils
*/
export declare namespace Utils {
import { Transaction } from "stellar-base";
export declare class Utils {
/**
* Returns a valid [SEP0010](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md)
* challenge transaction which you can use for Stellar Web Authentication.
* Verifies if the current date is within the transaction's timebonds
*
* @see [SEP0010: Stellar Web Authentication](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md).
* @static
* @function
* @memberof Utils
* @param {Keypair} serverKeypair Keypair for server's signing account.
* @param {string} clientAccountID The stellar account (G...) or muxed account (M...) that the wallet wishes to authenticate with the server.
* @param {string} homeDomain The fully qualified domain name of the service requiring authentication
* @param {number} [timeout=300] Challenge duration (default to 5 minutes).
* @param {string} networkPassphrase The network passphrase. If you pass this argument then timeout is required.
* @param {string} webAuthDomain The fully qualified domain name of the service issuing the challenge.
* @param {string} [memo] The memo to attach to the challenge transaction. The memo must be of type `id`. If the `clientaccountID` is a muxed account, memos cannot be used.
* @param {string} [clientDomain] The fully qualified domain of the client requesting the challenge. Only necessary when the the 'client_domain' parameter is passed.
* @param {string} [clientSigningKey] The public key assigned to the SIGNING_KEY attribute specified on the stellar.toml hosted on the client domain. Only necessary when the 'client_domain' parameter is passed.
* @example
* import { Utils, Keypair, Networks } from 'stellar-sdk'
*
* let serverKeyPair = Keypair.fromSecret("server-secret")
* let challenge = Utils.buildChallengeTx(serverKeyPair, "client-stellar-account-id", "stellar.org", 300, Networks.TESTNET)
* @returns {string} A base64 encoded string of the raw TransactionEnvelope xdr struct for the transaction.
* @param {Transaction} transaction the transaction whose timebonds will be validated.
* @returns {boolean} returns true if the current time is within the transaction's [minTime, maxTime] range.
*/
function buildChallengeTx(serverKeypair: Keypair, clientAccountID: string, homeDomain: string, timeout: number | undefined, networkPassphrase: string, webAuthDomain: string, memo?: string | null, clientDomain?: string | null, clientSigningKey?: string | null): string;
/**
* readChallengeTx reads a SEP 10 challenge transaction and returns the decoded
* transaction and client account ID contained within.
*
* It also verifies that the transaction has been signed by the server.
*
* It does not verify that the transaction has been signed by the client or
* that any signatures other than the server's on the transaction are valid. Use
* one of the following functions to completely verify the transaction:
* - verifyChallengeTxThreshold
* - verifyChallengeTxSigners
*
* @see [SEP0010: Stellar Web Authentication](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md).
* @function
* @memberof Utils
* @param {string} challengeTx SEP0010 challenge transaction in base64.
* @param {string} serverAccountID The server's stellar account (public key).
* @param {string} networkPassphrase The network passphrase, e.g.: 'Test SDF Network ; September 2015'.
* @param {string|string[]} [homeDomains] The home domain that is expected to be included in the first Manage Data operation's string key. If an array is provided, one of the domain names in the array must match.
* @param {string} webAuthDomain The home domain that is expected to be included as the value of the Manage Data operation with the 'web_auth_domain' key. If no such operation is included, this parameter is not used.
* @returns {Transaction|string|string|string} The actual transaction and the stellar public key (master key) used to sign the Manage Data operation, the matched home domain, and the memo attached to the transaction, which will be null if not present.
*/
function readChallengeTx(challengeTx: string, serverAccountID: string, networkPassphrase: string, homeDomains: string | string[], webAuthDomain: string): {
tx: Transaction;
clientAccountID: string;
matchedHomeDomain: string;
memo: string | null;
};
/**
* verifyChallengeTxThreshold verifies that for a SEP 10 challenge transaction
* all signatures on the transaction are accounted for and that the signatures
* meet a threshold on an account. A transaction is verified if it is signed by
* the server account, and all other signatures match a signer that has been
* provided as an argument, and those signatures meet a threshold on the
* account.
*
* Signers that are not prefixed as an address/account ID strkey (G...) will be
* ignored.
*
* Errors will be raised if:
* - The transaction is invalid according to ReadChallengeTx.
* - No client signatures are found on the transaction.
* - One or more signatures in the transaction are not identifiable as the
* server account or one of the signers provided in the arguments.
* - The signatures are all valid but do not meet the threshold.
*
* @see [SEP0010: Stellar Web Authentication](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md).
* @function
* @memberof Utils
* @param {string} challengeTx SEP0010 challenge transaction in base64.
* @param {string} serverAccountID The server's stellar account (public key).
* @param {string} networkPassphrase The network passphrase, e.g.: 'Test SDF Network ; September 2015'.
* @param {number} threshold The required signatures threshold for verifying this transaction.
* @param {ServerApi.AccountRecordSigners[]} signerSummary a map of all authorized signers to their weights. It's used to validate if the transaction signatures have met the given threshold.
* @param {string|string[]} [homeDomains] The home domain(s) that should be included in the first Manage Data operation's string key. Required in verifyChallengeTxSigners() => readChallengeTx().
* @param {string} webAuthDomain The home domain that is expected to be included as the value of the Manage Data operation with the 'web_auth_domain' key, if present. Used in verifyChallengeTxSigners() => readChallengeTx().
* @returns {string[]} The list of signers public keys that have signed the transaction, excluding the server account ID, given that the threshold was met.
* @example
*
* import { Networks, TransactionBuilder, Utils } from 'stellar-sdk';
*
* const serverKP = Keypair.random();
* const clientKP1 = Keypair.random();
* const clientKP2 = Keypair.random();
*
* // Challenge, possibly built in the server side
* const challenge = Utils.buildChallengeTx(
* serverKP,
* clientKP1.publicKey(),
* "SDF",
* 300,
* Networks.TESTNET
* );
*
* // clock.tick(200); // Simulates a 200 ms delay when communicating from server to client
*
* // Transaction gathered from a challenge, possibly from the client side
* const transaction = TransactionBuilder.fromXDR(challenge, Networks.TESTNET);
* transaction.sign(clientKP1, clientKP2);
* const signedChallenge = transaction
* .toEnvelope()
* .toXDR("base64")
* .toString();
*
* // Defining the threshold and signerSummary
* const threshold = 3;
* const signerSummary = [
* {
* key: this.clientKP1.publicKey(),
* weight: 1,
* },
* {
* key: this.clientKP2.publicKey(),
* weight: 2,
* },
* ];
*
* // The result below should be equal to [clientKP1.publicKey(), clientKP2.publicKey()]
* Utils.verifyChallengeTxThreshold(signedChallenge, serverKP.publicKey(), Networks.TESTNET, threshold, signerSummary);
*/
function verifyChallengeTxThreshold(challengeTx: string, serverAccountID: string, networkPassphrase: string, threshold: number, signerSummary: ServerApi.AccountRecordSigners[], homeDomains: string | string[], webAuthDomain: string): string[];
/**
* verifyChallengeTxSigners verifies that for a SEP 10 challenge transaction all
* signatures on the transaction are accounted for. A transaction is verified
* if it is signed by the server account, and all other signatures match a signer
* that has been provided as an argument (as the accountIDs list). Additional signers
* can be provided that do not have a signature, but all signatures must be matched
* to a signer (accountIDs) for verification to succeed. If verification succeeds,
* a list of signers that were found is returned, not including the server account ID.
*
* Signers that are not prefixed as an address/account ID strkey (G...) will be ignored.
*
* Errors will be raised if:
* - The transaction is invalid according to ReadChallengeTx.
* - No client signatures are found on the transaction.
* - One or more signatures in the transaction are not identifiable as the
* server account or one of the signers provided in the arguments.
*
* @see [SEP0010: Stellar Web Authentication](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md).
* @function
* @memberof Utils
* @param {string} challengeTx SEP0010 challenge transaction in base64.
* @param {string} serverAccountID The server's stellar account (public key).
* @param {string} networkPassphrase The network passphrase, e.g.: 'Test SDF Network ; September 2015'.
* @param {string[]} signers The signers public keys. This list should contain the public keys for all signers that have signed the transaction.
* @param {string|string[]} [homeDomains] The home domain(s) that should be included in the first Manage Data operation's string key. Required in readChallengeTx().
* @param {string} webAuthDomain The home domain that is expected to be included as the value of the Manage Data operation with the 'web_auth_domain' key, if present. Used in readChallengeTx().
* @returns {string[]} The list of signers public keys that have signed the transaction, excluding the server account ID.
* @example
*
* import { Networks, TransactionBuilder, Utils } from 'stellar-sdk';
*
* const serverKP = Keypair.random();
* const clientKP1 = Keypair.random();
* const clientKP2 = Keypair.random();
*
* // Challenge, possibly built in the server side
* const challenge = Utils.buildChallengeTx(
* serverKP,
* clientKP1.publicKey(),
* "SDF",
* 300,
* Networks.TESTNET
* );
*
* // clock.tick(200); // Simulates a 200 ms delay when communicating from server to client
*
* // Transaction gathered from a challenge, possibly from the client side
* const transaction = TransactionBuilder.fromXDR(challenge, Networks.TESTNET);
* transaction.sign(clientKP1, clientKP2);
* const signedChallenge = transaction
* .toEnvelope()
* .toXDR("base64")
* .toString();
*
* // The result below should be equal to [clientKP1.publicKey(), clientKP2.publicKey()]
* Utils.verifyChallengeTxSigners(signedChallenge, serverKP.publicKey(), Networks.TESTNET, threshold, [clientKP1.publicKey(), clientKP2.publicKey()]);
*/
function verifyChallengeTxSigners(challengeTx: string, serverAccountID: string, networkPassphrase: string, signers: string[], homeDomains: string | string[], webAuthDomain: string): string[];
/**
* Verifies if a transaction was signed by the given account id.
*
* @function
* @memberof Utils
* @param {Transaction} transaction
* @param {string} accountID
* @example
* let keypair = Keypair.random();
* const account = new StellarSdk.Account(keypair.publicKey(), "-1");
*
* const transaction = new TransactionBuilder(account, { fee: 100 })
* .setTimeout(30)
* .build();
*
* transaction.sign(keypair)
* Utils.verifyTxSignedBy(transaction, keypair.publicKey())
* @returns {boolean}.
*/
function verifyTxSignedBy(transaction: FeeBumpTransaction | Transaction, accountID: string): boolean;
/**
*
* gatherTxSigners checks if a transaction has been signed by one or more of
* the given signers, returning a list of non-repeated signers that were found to have
* signed the given transaction.
*
* @function
* @memberof Utils
* @param {Transaction} transaction the signed transaction.
* @param {string[]} signers The signers public keys.
* @example
* let keypair1 = Keypair.random();
* let keypair2 = Keypair.random();
* const account = new StellarSdk.Account(keypair1.publicKey(), "-1");
*
* const transaction = new TransactionBuilder(account, { fee: 100 })
* .setTimeout(30)
* .build();
*
* transaction.sign(keypair1, keypair2)
* Utils.gatherTxSigners(transaction, [keypair1.publicKey(), keypair2.publicKey()])
* @returns {string[]} a list of signers that were found to have signed the transaction.
*/
function gatherTxSigners(transaction: FeeBumpTransaction | Transaction, signers: string[]): string[];
static validateTimebounds(transaction: Transaction, gracePeriod?: number): boolean;
}

@@ -7,341 +7,27 @@ "use strict";

exports.Utils = void 0;
var _randombytes = _interopRequireDefault(require("randombytes"));
var _stellarBase = require("stellar-base");
var _errors = require("./errors");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var Utils;
(function (_Utils) {
function buildChallengeTx(serverKeypair, clientAccountID, homeDomain) {
var timeout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 300;
var networkPassphrase = arguments.length > 4 ? arguments[4] : undefined;
var webAuthDomain = arguments.length > 5 ? arguments[5] : undefined;
var memo = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
var clientDomain = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
var clientSigningKey = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
if (clientAccountID.startsWith("M") && memo) {
throw Error("memo cannot be used if clientAccountID is a muxed account");
}
var account = new _stellarBase.Account(serverKeypair.publicKey(), "-1");
var now = Math.floor(Date.now() / 1000);
var value = (0, _randombytes.default)(48).toString("base64");
var builder = new _stellarBase.TransactionBuilder(account, {
fee: _stellarBase.BASE_FEE,
networkPassphrase: networkPassphrase,
timebounds: {
minTime: now,
maxTime: now + timeout
}
}).addOperation(_stellarBase.Operation.manageData({
name: "".concat(homeDomain, " auth"),
value: value,
source: clientAccountID
})).addOperation(_stellarBase.Operation.manageData({
name: "web_auth_domain",
value: webAuthDomain,
source: account.accountId()
}));
if (clientDomain) {
if (!clientSigningKey) {
throw Error("clientSigningKey is required if clientDomain is provided");
}
builder.addOperation(_stellarBase.Operation.manageData({
name: "client_domain",
value: clientDomain,
source: clientSigningKey
}));
}
if (memo) {
builder.addMemo(_stellarBase.Memo.id(memo));
}
var transaction = builder.build();
transaction.sign(serverKeypair);
return transaction.toEnvelope().toXDR("base64").toString();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var Utils = exports.Utils = function () {
function Utils() {
_classCallCheck(this, Utils);
}
_Utils.buildChallengeTx = buildChallengeTx;
function readChallengeTx(challengeTx, serverAccountID, networkPassphrase, homeDomains, webAuthDomain) {
var _transaction$timeBoun;
if (serverAccountID.startsWith("M")) {
throw Error("Invalid serverAccountID: multiplexed accounts are not supported.");
}
var transaction;
try {
transaction = new _stellarBase.Transaction(challengeTx, networkPassphrase);
} catch (_unused) {
try {
transaction = new _stellarBase.FeeBumpTransaction(challengeTx, networkPassphrase);
} catch (_unused2) {
throw new _errors.InvalidSep10ChallengeError("Invalid challenge: unable to deserialize challengeTx transaction string");
_createClass(Utils, null, [{
key: "validateTimebounds",
value: function validateTimebounds(transaction) {
var gracePeriod = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
if (!transaction.timeBounds) {
return false;
}
throw new _errors.InvalidSep10ChallengeError("Invalid challenge: expected a Transaction but received a FeeBumpTransaction");
var now = Math.floor(Date.now() / 1000);
var _transaction$timeBoun = transaction.timeBounds,
minTime = _transaction$timeBoun.minTime,
maxTime = _transaction$timeBoun.maxTime;
return now >= Number.parseInt(minTime, 10) - gracePeriod && now <= Number.parseInt(maxTime, 10) + gracePeriod;
}
var sequence = Number.parseInt(transaction.sequence, 10);
if (sequence !== 0) {
throw new _errors.InvalidSep10ChallengeError("The transaction sequence number should be zero");
}
if (transaction.source !== serverAccountID) {
throw new _errors.InvalidSep10ChallengeError("The transaction source account is not equal to the server's account");
}
if (transaction.operations.length < 1) {
throw new _errors.InvalidSep10ChallengeError("The transaction should contain at least one operation");
}
var _transaction$operatio = _toArray(transaction.operations),
operation = _transaction$operatio[0],
subsequentOperations = _transaction$operatio.slice(1);
if (!operation.source) {
throw new _errors.InvalidSep10ChallengeError("The transaction's operation should contain a source account");
}
var clientAccountID = operation.source;
var memo = null;
if (transaction.memo.type !== _stellarBase.MemoNone) {
if (clientAccountID.startsWith("M")) {
throw new _errors.InvalidSep10ChallengeError("The transaction has a memo but the client account ID is a muxed account");
}
if (transaction.memo.type !== _stellarBase.MemoID) {
throw new _errors.InvalidSep10ChallengeError("The transaction's memo must be of type `id`");
}
memo = transaction.memo.value;
}
if (operation.type !== "manageData") {
throw new _errors.InvalidSep10ChallengeError("The transaction's operation type should be 'manageData'");
}
if (transaction.timeBounds && Number.parseInt((_transaction$timeBoun = transaction.timeBounds) === null || _transaction$timeBoun === void 0 ? void 0 : _transaction$timeBoun.maxTime, 10) === _stellarBase.TimeoutInfinite) {
throw new _errors.InvalidSep10ChallengeError("The transaction requires non-infinite timebounds");
}
if (!validateTimebounds(transaction, 60 * 5)) {
throw new _errors.InvalidSep10ChallengeError("The transaction has expired");
}
if (operation.value === undefined) {
throw new _errors.InvalidSep10ChallengeError("The transaction's operation values should not be null");
}
if (!operation.value) {
throw new _errors.InvalidSep10ChallengeError("The transaction's operation value should not be null");
}
if (Buffer.from(operation.value.toString(), "base64").length !== 48) {
throw new _errors.InvalidSep10ChallengeError("The transaction's operation value should be a 64 bytes base64 random string");
}
if (!homeDomains) {
throw new _errors.InvalidSep10ChallengeError("Invalid homeDomains: a home domain must be provided for verification");
}
var matchedHomeDomain;
if (typeof homeDomains === "string") {
if ("".concat(homeDomains, " auth") === operation.name) {
matchedHomeDomain = homeDomains;
}
} else if (Array.isArray(homeDomains)) {
matchedHomeDomain = homeDomains.find(function (domain) {
return "".concat(domain, " auth") === operation.name;
});
} else {
throw new _errors.InvalidSep10ChallengeError("Invalid homeDomains: homeDomains type is ".concat(_typeof(homeDomains), " but should be a string or an array"));
}
if (!matchedHomeDomain) {
throw new _errors.InvalidSep10ChallengeError("Invalid homeDomains: the transaction's operation key name does not match the expected home domain");
}
var _iterator = _createForOfIteratorHelper(subsequentOperations),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var op = _step.value;
if (op.type !== "manageData") {
throw new _errors.InvalidSep10ChallengeError("The transaction has operations that are not of type 'manageData'");
}
if (op.source !== serverAccountID && op.name !== "client_domain") {
throw new _errors.InvalidSep10ChallengeError("The transaction has operations that are unrecognized");
}
if (op.name === "web_auth_domain") {
if (op.value === undefined) {
throw new _errors.InvalidSep10ChallengeError("'web_auth_domain' operation value should not be null");
}
if (op.value.compare(Buffer.from(webAuthDomain))) {
throw new _errors.InvalidSep10ChallengeError("'web_auth_domain' operation value does not match ".concat(webAuthDomain));
}
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
if (!verifyTxSignedBy(transaction, serverAccountID)) {
throw new _errors.InvalidSep10ChallengeError("Transaction not signed by server: '".concat(serverAccountID, "'"));
}
return {
tx: transaction,
clientAccountID: clientAccountID,
matchedHomeDomain: matchedHomeDomain,
memo: memo
};
}
_Utils.readChallengeTx = readChallengeTx;
function verifyChallengeTxThreshold(challengeTx, serverAccountID, networkPassphrase, threshold, signerSummary, homeDomains, webAuthDomain) {
var signers = signerSummary.map(function (signer) {
return signer.key;
});
var signersFound = verifyChallengeTxSigners(challengeTx, serverAccountID, networkPassphrase, signers, homeDomains, webAuthDomain);
var weight = 0;
var _loop = function _loop() {
var _signerSummary$find;
var signer = _signersFound[_i];
var sigWeight = ((_signerSummary$find = signerSummary.find(function (s) {
return s.key === signer;
})) === null || _signerSummary$find === void 0 ? void 0 : _signerSummary$find.weight) || 0;
weight += sigWeight;
};
for (var _i = 0, _signersFound = signersFound; _i < _signersFound.length; _i++) {
_loop();
}
if (weight < threshold) {
throw new _errors.InvalidSep10ChallengeError("signers with weight ".concat(weight, " do not meet threshold ").concat(threshold, "\""));
}
return signersFound;
}
_Utils.verifyChallengeTxThreshold = verifyChallengeTxThreshold;
function verifyChallengeTxSigners(challengeTx, serverAccountID, networkPassphrase, signers, homeDomains, webAuthDomain) {
var _readChallengeTx = readChallengeTx(challengeTx, serverAccountID, networkPassphrase, homeDomains, webAuthDomain),
tx = _readChallengeTx.tx;
var serverKP;
try {
serverKP = _stellarBase.Keypair.fromPublicKey(serverAccountID);
} catch (err) {
throw new Error("Couldn't infer keypair from the provided 'serverAccountID': " + err.message);
}
var clientSigners = new Set();
var _iterator2 = _createForOfIteratorHelper(signers),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var _signer = _step2.value;
if (_signer === serverKP.publicKey()) {
continue;
}
if (_signer.charAt(0) !== "G") {
continue;
}
clientSigners.add(_signer);
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
if (clientSigners.size === 0) {
throw new _errors.InvalidSep10ChallengeError("No verifiable client signers provided, at least one G... address must be provided");
}
var clientSigningKey;
var _iterator3 = _createForOfIteratorHelper(tx.operations),
_step3;
try {
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
var op = _step3.value;
if (op.type === "manageData" && op.name === "client_domain") {
if (clientSigningKey) {
throw new _errors.InvalidSep10ChallengeError("Found more than one client_domain operation");
}
clientSigningKey = op.source;
}
}
} catch (err) {
_iterator3.e(err);
} finally {
_iterator3.f();
}
var allSigners = [serverKP.publicKey()].concat(_toConsumableArray(Array.from(clientSigners)));
if (clientSigningKey) {
allSigners.push(clientSigningKey);
}
var signersFound = gatherTxSigners(tx, allSigners);
var serverSignatureFound = false;
var clientSigningKeySignatureFound = false;
for (var _i2 = 0, _signersFound2 = signersFound; _i2 < _signersFound2.length; _i2++) {
var signer = _signersFound2[_i2];
if (signer === serverKP.publicKey()) {
serverSignatureFound = true;
}
if (signer === clientSigningKey) {
clientSigningKeySignatureFound = true;
}
}
if (!serverSignatureFound) {
throw new _errors.InvalidSep10ChallengeError("Transaction not signed by server: '" + serverKP.publicKey() + "'");
}
if (clientSigningKey && !clientSigningKeySignatureFound) {
throw new _errors.InvalidSep10ChallengeError("Transaction not signed by the source account of the 'client_domain' " + "ManageData operation");
}
if (signersFound.length === 1) {
throw new _errors.InvalidSep10ChallengeError("None of the given signers match the transaction signatures");
}
if (signersFound.length !== tx.signatures.length) {
throw new _errors.InvalidSep10ChallengeError("Transaction has unrecognized signatures");
}
signersFound.splice(signersFound.indexOf(serverKP.publicKey()), 1);
if (clientSigningKey) {
signersFound.splice(signersFound.indexOf(clientSigningKey), 1);
}
return signersFound;
}
_Utils.verifyChallengeTxSigners = verifyChallengeTxSigners;
function verifyTxSignedBy(transaction, accountID) {
return gatherTxSigners(transaction, [accountID]).length !== 0;
}
_Utils.verifyTxSignedBy = verifyTxSignedBy;
function gatherTxSigners(transaction, signers) {
var hashedSignatureBase = transaction.hash();
var txSignatures = _toConsumableArray(transaction.signatures);
var signersFound = new Set();
var _iterator4 = _createForOfIteratorHelper(signers),
_step4;
try {
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
var signer = _step4.value;
if (txSignatures.length === 0) {
break;
}
var keypair = void 0;
try {
keypair = _stellarBase.Keypair.fromPublicKey(signer);
} catch (err) {
throw new _errors.InvalidSep10ChallengeError("Signer is not a valid address: " + err.message);
}
for (var i = 0; i < txSignatures.length; i++) {
var decSig = txSignatures[i];
if (!decSig.hint().equals(keypair.signatureHint())) {
continue;
}
if (keypair.verify(hashedSignatureBase, decSig.signature())) {
signersFound.add(signer);
txSignatures.splice(i, 1);
break;
}
}
}
} catch (err) {
_iterator4.e(err);
} finally {
_iterator4.f();
}
return Array.from(signersFound);
}
_Utils.gatherTxSigners = gatherTxSigners;
function validateTimebounds(transaction) {
var gracePeriod = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
if (!transaction.timeBounds) {
return false;
}
var now = Math.floor(Date.now() / 1000);
var _transaction$timeBoun2 = transaction.timeBounds,
minTime = _transaction$timeBoun2.minTime,
maxTime = _transaction$timeBoun2.maxTime;
return now >= Number.parseInt(minTime, 10) - gracePeriod && now <= Number.parseInt(maxTime, 10) + gracePeriod;
}
})(Utils || (exports.Utils = Utils = {}));
}]);
return Utils;
}();
{
"name": "stellar-sdk",
"version": "11.0.0-beta.4",
"description": "A library for working with the Stellar Horizon server.",
"version": "11.0.0-beta.5",
"description": "A library for working with the Stellar network, including communication with the Horizon and Soroban RPC servers.",
"keywords": [

@@ -31,2 +31,3 @@ "stellar"

"build:ts": "tsc -p ./config/tsconfig.json",
"build:test": "tsc -p ./test/tsconfig.json",
"build:browser": "webpack -c config/webpack.config.browser.js",

@@ -36,3 +37,3 @@ "build:docs": "cross-env NODE_ENV=docs yarn _babel",

"docs": "yarn build:docs && jsdoc -c ./config/.jsdoc.json --verbose",
"test": "yarn test:node && yarn test:integration && yarn test:browser",
"test": "yarn build:test && yarn test:node && yarn test:integration && yarn test:browser",
"test:node": "yarn _nyc mocha --recursive 'test/unit/**/*.js'",

@@ -44,6 +45,6 @@ "test:integration": "yarn _nyc mocha --recursive 'test/integration/**/*.js'",

"prepare": "yarn build:prod",
"_build": "yarn build:node && yarn build:browser",
"_build": "yarn build:node && yarn build:test && yarn build:browser",
"_babel": "babel --extensions '.ts' --out-dir lib/ src/",
"_nyc": "nyc --nycrc-path config/.nycrc",
"_prettier": "prettier --ignore-path config/.prettierignore --write './**/*.js'"
"_prettier": "prettier --ignore-path config/.prettierignore --write './test/**/*.js'"
},

@@ -57,4 +58,3 @@ "husky": {

"**/*.{js,json,ts}": [
"yarn fmt",
"yarn lint"
"yarn fmt"
]

@@ -73,3 +73,3 @@ },

"recursive": true,
"timeout": 60000
"timeout": 30000
},

@@ -91,10 +91,13 @@ "nyc": {

"@babel/register": "^7.22.15",
"@definitelytyped/dtslint": "^0.0.182",
"@definitelytyped/dtslint": "^0.0.184",
"@istanbuljs/nyc-config-babel": "3.0.0",
"@stellar/tsconfig": "^1.0.2",
"@types/chai": "^4.3.6",
"@types/detect-node": "^2.0.0",
"@types/eventsource": "^1.1.12",
"@types/lodash": "^4.14.199",
"@types/node": "^20.8.2",
"@types/mocha": "^10.0.2",
"@types/node": "^20.8.8",
"@types/randombytes": "^2.0.1",
"@types/sinon": "^10.0.19",
"@types/urijs": "^1.19.20",

@@ -152,3 +155,3 @@ "@typescript-eslint/parser": "^6.7.4",

"randombytes": "^2.1.0",
"stellar-base": "10.0.0-beta.2",
"stellar-base": "10.0.0-beta.3",
"toml": "^3.0.0",

@@ -155,0 +158,0 @@ "urijs": "^1.19.1"

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc