@stellar/stellar-sdk 12.1.0 → 12.2.0
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 +52 -0
- package/dist/stellar-sdk.js +848 -815
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/browser.d.ts +1 -1
- package/lib/browser.js +4 -4
- package/lib/config.js +5 -2
- package/lib/contract/assembled_transaction.d.ts +25 -27
- package/lib/contract/assembled_transaction.js +6 -6
- package/lib/contract/client.d.ts +0 -1
- package/lib/contract/client.js +2 -2
- package/lib/contract/index.d.ts +0 -1
- package/lib/contract/index.js +1 -18
- package/lib/contract/sent_transaction.d.ts +9 -10
- package/lib/contract/sent_transaction.js +2 -1
- package/lib/contract/spec.d.ts +1 -1
- package/lib/contract/spec.js +921 -956
- package/lib/contract/types.d.ts +5 -0
- package/lib/contract/types.js +4 -1
- package/lib/contract/utils.d.ts +0 -5
- package/lib/contract/utils.js +4 -18
- package/lib/errors.d.ts +4 -4
- package/lib/federation/server.d.ts +1 -1
- package/lib/horizon/account_call_builder.d.ts +2 -3
- package/lib/horizon/account_response.d.ts +1 -1
- package/lib/horizon/assets_call_builder.d.ts +2 -3
- package/lib/horizon/call_builder.d.ts +8 -8
- package/lib/horizon/call_builder.js +2 -6
- package/lib/horizon/claimable_balances_call_builder.d.ts +3 -4
- package/lib/horizon/effect_call_builder.d.ts +2 -3
- package/lib/horizon/friendbot_builder.d.ts +0 -1
- package/lib/horizon/horizon_api.d.ts +5 -1
- package/lib/horizon/horizon_axios_client.js +6 -6
- package/lib/horizon/ledger_call_builder.d.ts +2 -3
- package/lib/horizon/liquidity_pool_call_builder.d.ts +2 -4
- package/lib/horizon/offer_call_builder.d.ts +2 -3
- package/lib/horizon/operation_call_builder.d.ts +3 -4
- package/lib/horizon/orderbook_call_builder.d.ts +0 -1
- package/lib/horizon/path_call_builder.d.ts +1 -2
- package/lib/horizon/payment_call_builder.d.ts +2 -3
- package/lib/horizon/server.d.ts +29 -10
- package/lib/horizon/server.js +98 -55
- package/lib/horizon/strict_receive_path_call_builder.d.ts +1 -2
- package/lib/horizon/strict_send_path_call_builder.d.ts +1 -2
- package/lib/horizon/trade_aggregation_call_builder.d.ts +9 -10
- package/lib/horizon/trade_aggregation_call_builder.js +3 -7
- package/lib/horizon/trades_call_builder.d.ts +2 -3
- package/lib/horizon/transaction_call_builder.d.ts +3 -4
- package/lib/horizon/types/assets.d.ts +1 -1
- package/lib/horizon/types/effects.d.ts +1 -1
- package/lib/horizon/types/offer.d.ts +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/rpc/api.d.ts +29 -5
- package/lib/rpc/browser.d.ts +1 -1
- package/lib/rpc/browser.js +4 -4
- package/lib/rpc/index.d.ts +0 -1
- package/lib/rpc/jsonrpc.js +3 -3
- package/lib/rpc/parsers.d.ts +3 -3
- package/lib/rpc/parsers.js +23 -23
- package/lib/rpc/server.d.ts +13 -7
- package/lib/rpc/server.js +48 -56
- package/lib/rpc/transaction.d.ts +3 -4
- package/lib/rpc/transaction.js +23 -25
- package/lib/webauth/utils.js +3 -3
- package/package.json +17 -17
package/lib/browser.d.ts
CHANGED
package/lib/browser.js
CHANGED
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
var _exportNames = {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
axios: true,
|
|
9
|
+
StellarBase: true
|
|
10
10
|
};
|
|
11
11
|
exports.StellarBase = void 0;
|
|
12
12
|
Object.defineProperty(exports, "axios", {
|
|
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "axios", {
|
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
exports.default = void 0;
|
|
19
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
19
20
|
var _index = require("./index");
|
|
20
21
|
Object.keys(_index).forEach(function (key) {
|
|
21
22
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -30,8 +31,7 @@ Object.keys(_index).forEach(function (key) {
|
|
|
30
31
|
});
|
|
31
32
|
var _StellarBase = _interopRequireWildcard(require("@stellar/stellar-base"));
|
|
32
33
|
exports.StellarBase = _StellarBase;
|
|
33
|
-
var _axios = _interopRequireDefault(require("axios"));
|
|
34
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
35
34
|
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); }
|
|
36
35
|
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 && {}.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; }
|
|
36
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
37
37
|
var _default = exports.default = module.exports;
|
package/lib/config.js
CHANGED
|
@@ -8,13 +8,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
8
8
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
9
9
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
10
10
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
11
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
11
14
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
15
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
16
|
var defaultConfig = {
|
|
14
17
|
allowHttp: false,
|
|
15
18
|
timeout: 0
|
|
16
19
|
};
|
|
17
|
-
var config =
|
|
20
|
+
var config = _objectSpread({}, defaultConfig);
|
|
18
21
|
var Config = exports.Config = function () {
|
|
19
22
|
function Config() {
|
|
20
23
|
_classCallCheck(this, Config);
|
|
@@ -42,7 +45,7 @@ var Config = exports.Config = function () {
|
|
|
42
45
|
}, {
|
|
43
46
|
key: "setDefault",
|
|
44
47
|
value: function setDefault() {
|
|
45
|
-
config =
|
|
48
|
+
config = _objectSpread({}, defaultConfig);
|
|
46
49
|
}
|
|
47
50
|
}]);
|
|
48
51
|
}();
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Account, SorobanDataBuilder, TransactionBuilder, xdr } from "@stellar/stellar-base";
|
|
3
2
|
import type { AssembledTransactionOptions, ClientOptions, Tx, XDR_BASE64 } from "./types";
|
|
4
3
|
import { Api } from "../rpc/api";
|
|
5
4
|
import { SentTransaction } from "./sent_transaction";
|
|
6
5
|
import { Spec } from "./spec";
|
|
7
|
-
export declare const NULL_ACCOUNT = "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF";
|
|
8
6
|
/**
|
|
9
7
|
* The main workhorse of {@link Client}. This class is used to wrap a
|
|
10
8
|
* transaction-under-construction and provide high-level interfaces to the most
|
|
@@ -279,82 +277,82 @@ export declare class AssembledTransaction<T> {
|
|
|
279
277
|
*/
|
|
280
278
|
static Errors: {
|
|
281
279
|
ExpiredState: {
|
|
282
|
-
new (message?: string
|
|
280
|
+
new (message?: string): {
|
|
283
281
|
name: string;
|
|
284
282
|
message: string;
|
|
285
|
-
stack?: string
|
|
283
|
+
stack?: string;
|
|
286
284
|
};
|
|
287
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function
|
|
285
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
288
286
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
289
287
|
stackTraceLimit: number;
|
|
290
288
|
};
|
|
291
289
|
RestorationFailure: {
|
|
292
|
-
new (message?: string
|
|
290
|
+
new (message?: string): {
|
|
293
291
|
name: string;
|
|
294
292
|
message: string;
|
|
295
|
-
stack?: string
|
|
293
|
+
stack?: string;
|
|
296
294
|
};
|
|
297
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function
|
|
295
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
298
296
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
299
297
|
stackTraceLimit: number;
|
|
300
298
|
};
|
|
301
299
|
NeedsMoreSignatures: {
|
|
302
|
-
new (message?: string
|
|
300
|
+
new (message?: string): {
|
|
303
301
|
name: string;
|
|
304
302
|
message: string;
|
|
305
|
-
stack?: string
|
|
303
|
+
stack?: string;
|
|
306
304
|
};
|
|
307
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function
|
|
305
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
308
306
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
309
307
|
stackTraceLimit: number;
|
|
310
308
|
};
|
|
311
309
|
NoSignatureNeeded: {
|
|
312
|
-
new (message?: string
|
|
310
|
+
new (message?: string): {
|
|
313
311
|
name: string;
|
|
314
312
|
message: string;
|
|
315
|
-
stack?: string
|
|
313
|
+
stack?: string;
|
|
316
314
|
};
|
|
317
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function
|
|
315
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
318
316
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
319
317
|
stackTraceLimit: number;
|
|
320
318
|
};
|
|
321
319
|
NoUnsignedNonInvokerAuthEntries: {
|
|
322
|
-
new (message?: string
|
|
320
|
+
new (message?: string): {
|
|
323
321
|
name: string;
|
|
324
322
|
message: string;
|
|
325
|
-
stack?: string
|
|
323
|
+
stack?: string;
|
|
326
324
|
};
|
|
327
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function
|
|
325
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
328
326
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
329
327
|
stackTraceLimit: number;
|
|
330
328
|
};
|
|
331
329
|
NoSigner: {
|
|
332
|
-
new (message?: string
|
|
330
|
+
new (message?: string): {
|
|
333
331
|
name: string;
|
|
334
332
|
message: string;
|
|
335
|
-
stack?: string
|
|
333
|
+
stack?: string;
|
|
336
334
|
};
|
|
337
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function
|
|
335
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
338
336
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
339
337
|
stackTraceLimit: number;
|
|
340
338
|
};
|
|
341
339
|
NotYetSimulated: {
|
|
342
|
-
new (message?: string
|
|
340
|
+
new (message?: string): {
|
|
343
341
|
name: string;
|
|
344
342
|
message: string;
|
|
345
|
-
stack?: string
|
|
343
|
+
stack?: string;
|
|
346
344
|
};
|
|
347
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function
|
|
345
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
348
346
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
349
347
|
stackTraceLimit: number;
|
|
350
348
|
};
|
|
351
349
|
FakeAccount: {
|
|
352
|
-
new (message?: string
|
|
350
|
+
new (message?: string): {
|
|
353
351
|
name: string;
|
|
354
352
|
message: string;
|
|
355
|
-
stack?: string
|
|
353
|
+
stack?: string;
|
|
356
354
|
};
|
|
357
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function
|
|
355
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
358
356
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
359
357
|
stackTraceLimit: number;
|
|
360
358
|
};
|
|
@@ -536,7 +534,7 @@ export declare class AssembledTransaction<T> {
|
|
|
536
534
|
* Client initialization.
|
|
537
535
|
* @throws {AssembledTransaction.Errors.RestoreFailure} - Throws a custom error if the
|
|
538
536
|
* restore transaction fails, providing the details of the failure.
|
|
539
|
-
|
|
537
|
+
*/
|
|
540
538
|
restoreFootprint(
|
|
541
539
|
/**
|
|
542
540
|
* The preamble object containing data required to
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.AssembledTransaction = void 0;
|
|
7
7
|
var _stellarBase = require("@stellar/stellar-base");
|
|
8
8
|
var _server = require("../rpc/server");
|
|
9
9
|
var _api = require("../rpc/api");
|
|
10
10
|
var _transaction = require("../rpc/transaction");
|
|
11
11
|
var _rust_result = require("./rust_result");
|
|
12
12
|
var _utils = require("./utils");
|
|
13
|
+
var _types = require("./types");
|
|
13
14
|
var _sent_transaction = require("./sent_transaction");
|
|
14
15
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
15
16
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
@@ -44,7 +45,6 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
44
45
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
45
46
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
46
47
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
47
|
-
var NULL_ACCOUNT = exports.NULL_ACCOUNT = "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF";
|
|
48
48
|
var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
49
49
|
function AssembledTransaction(options) {
|
|
50
50
|
var _this = this,
|
|
@@ -105,7 +105,7 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
105
105
|
_this.raw = new _stellarBase.TransactionBuilder(account, {
|
|
106
106
|
fee: (_this$options$fee = _this.options.fee) !== null && _this$options$fee !== void 0 ? _this$options$fee : _stellarBase.BASE_FEE,
|
|
107
107
|
networkPassphrase: _this.options.networkPassphrase
|
|
108
|
-
}).addOperation(contract.call.apply(contract, [_this.options.method].concat(_toConsumableArray((_this$options$args = _this.options.args) !== null && _this$options$args !== void 0 ? _this$options$args : [])))).setTimeout((_this$options$timeout = _this.options.timeoutInSeconds) !== null && _this$options$timeout !== void 0 ? _this$options$timeout :
|
|
108
|
+
}).addOperation(contract.call.apply(contract, [_this.options.method].concat(_toConsumableArray((_this$options$args = _this.options.args) !== null && _this$options$args !== void 0 ? _this$options$args : [])))).setTimeout((_this$options$timeout = _this.options.timeoutInSeconds) !== null && _this$options$timeout !== void 0 ? _this$options$timeout : _types.DEFAULT_TIMEOUT);
|
|
109
109
|
_context.next = 23;
|
|
110
110
|
return _this.simulate();
|
|
111
111
|
case 23:
|
|
@@ -161,7 +161,7 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
161
161
|
}
|
|
162
162
|
throw new AssembledTransaction.Errors.NeedsMoreSignatures("Transaction requires more signatures. " + "See `needsNonInvokerSigningBy` for details.");
|
|
163
163
|
case 9:
|
|
164
|
-
timeoutInSeconds = (_this$options$timeout2 = _this.options.timeoutInSeconds) !== null && _this$options$timeout2 !== void 0 ? _this$options$timeout2 :
|
|
164
|
+
timeoutInSeconds = (_this$options$timeout2 = _this.options.timeoutInSeconds) !== null && _this$options$timeout2 !== void 0 ? _this$options$timeout2 : _types.DEFAULT_TIMEOUT;
|
|
165
165
|
_this.built = _stellarBase.TransactionBuilder.cloneFrom(_this.built, {
|
|
166
166
|
fee: _this.built.fee,
|
|
167
167
|
timebounds: undefined,
|
|
@@ -608,7 +608,7 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
608
608
|
tx.raw = new _stellarBase.TransactionBuilder(account, {
|
|
609
609
|
fee: (_options$fee = options.fee) !== null && _options$fee !== void 0 ? _options$fee : _stellarBase.BASE_FEE,
|
|
610
610
|
networkPassphrase: options.networkPassphrase
|
|
611
|
-
}).addOperation(contract.call.apply(contract, [options.method].concat(_toConsumableArray((_options$args = options.args) !== null && _options$args !== void 0 ? _options$args : [])))).setTimeout((_options$timeoutInSec = options.timeoutInSeconds) !== null && _options$timeoutInSec !== void 0 ? _options$timeoutInSec :
|
|
611
|
+
}).addOperation(contract.call.apply(contract, [options.method].concat(_toConsumableArray((_options$args = options.args) !== null && _options$args !== void 0 ? _options$args : [])))).setTimeout((_options$timeoutInSec = options.timeoutInSeconds) !== null && _options$timeoutInSec !== void 0 ? _options$timeoutInSec : _types.DEFAULT_TIMEOUT);
|
|
612
612
|
if (!options.simulate) {
|
|
613
613
|
_context9.next = 9;
|
|
614
614
|
break;
|
|
@@ -641,7 +641,7 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
641
641
|
tx.raw = new _stellarBase.TransactionBuilder(account, {
|
|
642
642
|
fee: fee,
|
|
643
643
|
networkPassphrase: options.networkPassphrase
|
|
644
|
-
}).setSorobanData(sorobanData instanceof _stellarBase.SorobanDataBuilder ? sorobanData.build() : sorobanData).addOperation(_stellarBase.Operation.restoreFootprint({})).setTimeout((_options$timeoutInSec2 = options.timeoutInSeconds) !== null && _options$timeoutInSec2 !== void 0 ? _options$timeoutInSec2 :
|
|
644
|
+
}).setSorobanData(sorobanData instanceof _stellarBase.SorobanDataBuilder ? sorobanData.build() : sorobanData).addOperation(_stellarBase.Operation.restoreFootprint({})).setTimeout((_options$timeoutInSec2 = options.timeoutInSeconds) !== null && _options$timeoutInSec2 !== void 0 ? _options$timeoutInSec2 : _types.DEFAULT_TIMEOUT);
|
|
645
645
|
_context10.next = 4;
|
|
646
646
|
return tx.simulate({
|
|
647
647
|
restore: false
|
package/lib/contract/client.d.ts
CHANGED
package/lib/contract/client.js
CHANGED
|
@@ -15,8 +15,8 @@ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.
|
|
|
15
15
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
16
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
19
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
18
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
19
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
20
20
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
21
21
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
22
22
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
package/lib/contract/index.d.ts
CHANGED
package/lib/contract/index.js
CHANGED
|
@@ -3,19 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
DEFAULT_TIMEOUT: true
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "DEFAULT_TIMEOUT", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function get() {
|
|
12
|
-
return _utils.DEFAULT_TIMEOUT;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
6
|
var _assembled_transaction = require("./assembled_transaction");
|
|
16
7
|
Object.keys(_assembled_transaction).forEach(function (key) {
|
|
17
8
|
if (key === "default" || key === "__esModule") return;
|
|
18
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
19
9
|
if (key in exports && exports[key] === _assembled_transaction[key]) return;
|
|
20
10
|
Object.defineProperty(exports, key, {
|
|
21
11
|
enumerable: true,
|
|
@@ -27,7 +17,6 @@ Object.keys(_assembled_transaction).forEach(function (key) {
|
|
|
27
17
|
var _basic_node_signer = require("./basic_node_signer");
|
|
28
18
|
Object.keys(_basic_node_signer).forEach(function (key) {
|
|
29
19
|
if (key === "default" || key === "__esModule") return;
|
|
30
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
31
20
|
if (key in exports && exports[key] === _basic_node_signer[key]) return;
|
|
32
21
|
Object.defineProperty(exports, key, {
|
|
33
22
|
enumerable: true,
|
|
@@ -39,7 +28,6 @@ Object.keys(_basic_node_signer).forEach(function (key) {
|
|
|
39
28
|
var _client = require("./client");
|
|
40
29
|
Object.keys(_client).forEach(function (key) {
|
|
41
30
|
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
43
31
|
if (key in exports && exports[key] === _client[key]) return;
|
|
44
32
|
Object.defineProperty(exports, key, {
|
|
45
33
|
enumerable: true,
|
|
@@ -51,7 +39,6 @@ Object.keys(_client).forEach(function (key) {
|
|
|
51
39
|
var _rust_result = require("./rust_result");
|
|
52
40
|
Object.keys(_rust_result).forEach(function (key) {
|
|
53
41
|
if (key === "default" || key === "__esModule") return;
|
|
54
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
55
42
|
if (key in exports && exports[key] === _rust_result[key]) return;
|
|
56
43
|
Object.defineProperty(exports, key, {
|
|
57
44
|
enumerable: true,
|
|
@@ -63,7 +50,6 @@ Object.keys(_rust_result).forEach(function (key) {
|
|
|
63
50
|
var _sent_transaction = require("./sent_transaction");
|
|
64
51
|
Object.keys(_sent_transaction).forEach(function (key) {
|
|
65
52
|
if (key === "default" || key === "__esModule") return;
|
|
66
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
67
53
|
if (key in exports && exports[key] === _sent_transaction[key]) return;
|
|
68
54
|
Object.defineProperty(exports, key, {
|
|
69
55
|
enumerable: true,
|
|
@@ -75,7 +61,6 @@ Object.keys(_sent_transaction).forEach(function (key) {
|
|
|
75
61
|
var _spec = require("./spec");
|
|
76
62
|
Object.keys(_spec).forEach(function (key) {
|
|
77
63
|
if (key === "default" || key === "__esModule") return;
|
|
78
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
79
64
|
if (key in exports && exports[key] === _spec[key]) return;
|
|
80
65
|
Object.defineProperty(exports, key, {
|
|
81
66
|
enumerable: true,
|
|
@@ -87,7 +72,6 @@ Object.keys(_spec).forEach(function (key) {
|
|
|
87
72
|
var _types = require("./types");
|
|
88
73
|
Object.keys(_types).forEach(function (key) {
|
|
89
74
|
if (key === "default" || key === "__esModule") return;
|
|
90
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
91
75
|
if (key in exports && exports[key] === _types[key]) return;
|
|
92
76
|
Object.defineProperty(exports, key, {
|
|
93
77
|
enumerable: true,
|
|
@@ -95,5 +79,4 @@ Object.keys(_types).forEach(function (key) {
|
|
|
95
79
|
return _types[key];
|
|
96
80
|
}
|
|
97
81
|
});
|
|
98
|
-
});
|
|
99
|
-
var _utils = require("./utils");
|
|
82
|
+
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Server } from "../rpc/server";
|
|
3
2
|
import { Api } from "../rpc/api";
|
|
4
3
|
import type { AssembledTransaction } from "./assembled_transaction";
|
|
@@ -38,32 +37,32 @@ export declare class SentTransaction<T> {
|
|
|
38
37
|
getTransactionResponse?: Api.GetTransactionResponse;
|
|
39
38
|
static Errors: {
|
|
40
39
|
SendFailed: {
|
|
41
|
-
new (message?: string
|
|
40
|
+
new (message?: string): {
|
|
42
41
|
name: string;
|
|
43
42
|
message: string;
|
|
44
|
-
stack?: string
|
|
43
|
+
stack?: string;
|
|
45
44
|
};
|
|
46
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function
|
|
45
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
47
46
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
48
47
|
stackTraceLimit: number;
|
|
49
48
|
};
|
|
50
49
|
SendResultOnly: {
|
|
51
|
-
new (message?: string
|
|
50
|
+
new (message?: string): {
|
|
52
51
|
name: string;
|
|
53
52
|
message: string;
|
|
54
|
-
stack?: string
|
|
53
|
+
stack?: string;
|
|
55
54
|
};
|
|
56
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function
|
|
55
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
57
56
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
58
57
|
stackTraceLimit: number;
|
|
59
58
|
};
|
|
60
59
|
TransactionStillPending: {
|
|
61
|
-
new (message?: string
|
|
60
|
+
new (message?: string): {
|
|
62
61
|
name: string;
|
|
63
62
|
message: string;
|
|
64
|
-
stack?: string
|
|
63
|
+
stack?: string;
|
|
65
64
|
};
|
|
66
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function
|
|
65
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
67
66
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
68
67
|
stackTraceLimit: number;
|
|
69
68
|
};
|
|
@@ -7,6 +7,7 @@ exports.SentTransaction = void 0;
|
|
|
7
7
|
var _server = require("../rpc/server");
|
|
8
8
|
var _api = require("../rpc/api");
|
|
9
9
|
var _utils = require("./utils");
|
|
10
|
+
var _types = require("./types");
|
|
10
11
|
var _SentTransaction;
|
|
11
12
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
13
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
@@ -50,7 +51,7 @@ var SentTransaction = exports.SentTransaction = function () {
|
|
|
50
51
|
throw new SentTransaction.Errors.SendFailed("Sending the transaction to the network failed!\n".concat(JSON.stringify(_this.sendTransactionResponse, null, 2)));
|
|
51
52
|
case 5:
|
|
52
53
|
hash = _this.sendTransactionResponse.hash;
|
|
53
|
-
timeoutInSeconds = (_this$assembled$optio = _this.assembled.options.timeoutInSeconds) !== null && _this$assembled$optio !== void 0 ? _this$assembled$optio :
|
|
54
|
+
timeoutInSeconds = (_this$assembled$optio = _this.assembled.options.timeoutInSeconds) !== null && _this$assembled$optio !== void 0 ? _this$assembled$optio : _types.DEFAULT_TIMEOUT;
|
|
54
55
|
_context.next = 9;
|
|
55
56
|
return (0, _utils.withExponentialBackoff)(function () {
|
|
56
57
|
return _this.server.getTransaction(hash);
|
package/lib/contract/spec.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export declare class Spec {
|
|
|
59
59
|
* Converts native JS arguments to ScVals for calling a contract function.
|
|
60
60
|
*
|
|
61
61
|
* @param {string} name the name of the function
|
|
62
|
-
* @param {
|
|
62
|
+
* @param {object} args the arguments object
|
|
63
63
|
* @returns {xdr.ScVal[]} the converted arguments
|
|
64
64
|
*
|
|
65
65
|
* @throws {Error} if argument is missing or incorrect type
|