@stellar/stellar-sdk 14.3.2 → 14.4.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 +21 -1
- package/dist/stellar-sdk-minimal.js +7222 -7108
- package/dist/stellar-sdk-minimal.min.js +1 -1
- package/dist/stellar-sdk-no-axios.js +3460 -3346
- package/dist/stellar-sdk-no-axios.min.js +1 -1
- package/dist/stellar-sdk-no-eventsource.js +7213 -7099
- package/dist/stellar-sdk-no-eventsource.min.js +1 -1
- package/dist/stellar-sdk.js +8051 -7937
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/config.d.ts +2 -6
- package/lib/contract/assembled_transaction.d.ts +16 -132
- package/lib/contract/assembled_transaction.js +14 -114
- package/lib/contract/errors.d.ts +26 -0
- package/lib/contract/errors.js +126 -0
- package/lib/contract/sent_transaction.d.ts +1 -1
- package/lib/contract/spec.d.ts +2 -2
- package/lib/contract/spec.js +40 -28
- package/lib/contract/types.d.ts +35 -9
- package/lib/contract/utils.d.ts +1 -1
- package/lib/contract/utils.js +18 -53
- package/lib/contract/wasm_spec_parser.d.ts +7 -0
- package/lib/contract/wasm_spec_parser.js +15 -0
- package/lib/errors/network.d.ts +1 -1
- package/lib/federation/server.d.ts +7 -7
- package/lib/horizon/horizon_axios_client.js +1 -1
- package/lib/horizon/server.d.ts +1 -1
- package/lib/horizon/server.js +2 -2
- package/lib/index.d.ts +0 -3
- package/lib/minimal/config.d.ts +2 -6
- package/lib/minimal/contract/assembled_transaction.d.ts +16 -132
- package/lib/minimal/contract/assembled_transaction.js +14 -114
- package/lib/minimal/contract/errors.d.ts +26 -0
- package/lib/minimal/contract/errors.js +126 -0
- package/lib/minimal/contract/sent_transaction.d.ts +1 -1
- package/lib/minimal/contract/spec.d.ts +2 -2
- package/lib/minimal/contract/spec.js +40 -28
- package/lib/minimal/contract/types.d.ts +35 -9
- package/lib/minimal/contract/utils.d.ts +1 -1
- package/lib/minimal/contract/utils.js +18 -53
- package/lib/minimal/contract/wasm_spec_parser.d.ts +7 -0
- package/lib/minimal/contract/wasm_spec_parser.js +15 -0
- package/lib/minimal/errors/network.d.ts +1 -1
- package/lib/minimal/federation/server.d.ts +7 -7
- package/lib/minimal/horizon/horizon_axios_client.js +1 -1
- package/lib/minimal/horizon/server.d.ts +1 -1
- package/lib/minimal/horizon/server.js +2 -2
- package/lib/minimal/index.d.ts +0 -3
- package/lib/minimal/rpc/api.d.ts +27 -3
- package/lib/minimal/rpc/axios.js +1 -1
- package/lib/minimal/rpc/jsonrpc.d.ts +2 -1
- package/lib/minimal/rpc/jsonrpc.js +1 -1
- package/lib/minimal/rpc/parsers.js +8 -5
- package/lib/minimal/rpc/server.d.ts +46 -7
- package/lib/minimal/rpc/server.js +290 -211
- package/lib/minimal/rpc/utils.js +1 -1
- package/lib/minimal/webauth/challenge_transaction.d.ts +235 -0
- package/lib/minimal/webauth/challenge_transaction.js +307 -0
- package/lib/minimal/webauth/index.d.ts +1 -0
- package/lib/minimal/webauth/index.js +13 -1
- package/lib/minimal/webauth/utils.d.ts +28 -273
- package/lib/minimal/webauth/utils.js +12 -288
- package/lib/no-axios/config.d.ts +2 -6
- package/lib/no-axios/contract/assembled_transaction.d.ts +16 -132
- package/lib/no-axios/contract/assembled_transaction.js +14 -114
- package/lib/no-axios/contract/errors.d.ts +26 -0
- package/lib/no-axios/contract/errors.js +126 -0
- package/lib/no-axios/contract/sent_transaction.d.ts +1 -1
- package/lib/no-axios/contract/spec.d.ts +2 -2
- package/lib/no-axios/contract/spec.js +40 -28
- package/lib/no-axios/contract/types.d.ts +35 -9
- package/lib/no-axios/contract/utils.d.ts +1 -1
- package/lib/no-axios/contract/utils.js +18 -53
- package/lib/no-axios/contract/wasm_spec_parser.d.ts +7 -0
- package/lib/no-axios/contract/wasm_spec_parser.js +15 -0
- package/lib/no-axios/errors/network.d.ts +1 -1
- package/lib/no-axios/federation/server.d.ts +7 -7
- package/lib/no-axios/horizon/horizon_axios_client.js +1 -1
- package/lib/no-axios/horizon/server.d.ts +1 -1
- package/lib/no-axios/horizon/server.js +2 -2
- package/lib/no-axios/index.d.ts +0 -3
- package/lib/no-axios/rpc/api.d.ts +27 -3
- package/lib/no-axios/rpc/axios.js +1 -1
- package/lib/no-axios/rpc/jsonrpc.d.ts +2 -1
- package/lib/no-axios/rpc/jsonrpc.js +1 -1
- package/lib/no-axios/rpc/parsers.js +8 -5
- package/lib/no-axios/rpc/server.d.ts +46 -7
- package/lib/no-axios/rpc/server.js +290 -211
- package/lib/no-axios/rpc/utils.js +1 -1
- package/lib/no-axios/webauth/challenge_transaction.d.ts +235 -0
- package/lib/no-axios/webauth/challenge_transaction.js +307 -0
- package/lib/no-axios/webauth/index.d.ts +1 -0
- package/lib/no-axios/webauth/index.js +13 -1
- package/lib/no-axios/webauth/utils.d.ts +28 -273
- package/lib/no-axios/webauth/utils.js +12 -288
- package/lib/no-eventsource/config.d.ts +2 -6
- package/lib/no-eventsource/contract/assembled_transaction.d.ts +16 -132
- package/lib/no-eventsource/contract/assembled_transaction.js +14 -114
- package/lib/no-eventsource/contract/errors.d.ts +26 -0
- package/lib/no-eventsource/contract/errors.js +126 -0
- package/lib/no-eventsource/contract/sent_transaction.d.ts +1 -1
- package/lib/no-eventsource/contract/spec.d.ts +2 -2
- package/lib/no-eventsource/contract/spec.js +40 -28
- package/lib/no-eventsource/contract/types.d.ts +35 -9
- package/lib/no-eventsource/contract/utils.d.ts +1 -1
- package/lib/no-eventsource/contract/utils.js +18 -53
- package/lib/no-eventsource/contract/wasm_spec_parser.d.ts +7 -0
- package/lib/no-eventsource/contract/wasm_spec_parser.js +15 -0
- package/lib/no-eventsource/errors/network.d.ts +1 -1
- package/lib/no-eventsource/federation/server.d.ts +7 -7
- package/lib/no-eventsource/horizon/horizon_axios_client.js +1 -1
- package/lib/no-eventsource/horizon/server.d.ts +1 -1
- package/lib/no-eventsource/horizon/server.js +2 -2
- package/lib/no-eventsource/index.d.ts +0 -3
- package/lib/no-eventsource/rpc/api.d.ts +27 -3
- package/lib/no-eventsource/rpc/axios.js +1 -1
- package/lib/no-eventsource/rpc/jsonrpc.d.ts +2 -1
- package/lib/no-eventsource/rpc/jsonrpc.js +1 -1
- package/lib/no-eventsource/rpc/parsers.js +8 -5
- package/lib/no-eventsource/rpc/server.d.ts +46 -7
- package/lib/no-eventsource/rpc/server.js +290 -211
- package/lib/no-eventsource/rpc/utils.js +1 -1
- package/lib/no-eventsource/webauth/challenge_transaction.d.ts +235 -0
- package/lib/no-eventsource/webauth/challenge_transaction.js +307 -0
- package/lib/no-eventsource/webauth/index.d.ts +1 -0
- package/lib/no-eventsource/webauth/index.js +13 -1
- package/lib/no-eventsource/webauth/utils.d.ts +28 -273
- package/lib/no-eventsource/webauth/utils.js +12 -288
- package/lib/rpc/api.d.ts +27 -3
- package/lib/rpc/axios.js +1 -1
- package/lib/rpc/jsonrpc.d.ts +2 -1
- package/lib/rpc/jsonrpc.js +1 -1
- package/lib/rpc/parsers.js +8 -5
- package/lib/rpc/server.d.ts +46 -7
- package/lib/rpc/server.js +290 -211
- package/lib/rpc/utils.js +1 -1
- package/lib/webauth/challenge_transaction.d.ts +235 -0
- package/lib/webauth/challenge_transaction.js +307 -0
- package/lib/webauth/index.d.ts +1 -0
- package/lib/webauth/index.js +13 -1
- package/lib/webauth/utils.d.ts +28 -273
- package/lib/webauth/utils.js +12 -288
- package/package.json +14 -14
- package/types/dom-monkeypatch.d.ts +1 -1
|
@@ -3,6 +3,7 @@ import type { AssembledTransactionOptions, ClientOptions, Tx, XDR_BASE64 } from
|
|
|
3
3
|
import { Api } from "../rpc/api";
|
|
4
4
|
import { SentTransaction, Watcher } from "./sent_transaction";
|
|
5
5
|
import { Spec } from "./spec";
|
|
6
|
+
import { ExpiredStateError, ExternalServiceError, FakeAccountError, InternalWalletError, InvalidClientRequestError, NeedsMoreSignaturesError, NoSignatureNeededError, NoSignerError, NotYetSimulatedError, NoUnsignedNonInvokerAuthEntriesError, RestoreFailureError, SimulationFailedError, UserRejectedError } from "./errors";
|
|
6
7
|
/** @module contract */
|
|
7
8
|
/**
|
|
8
9
|
* The main workhorse of {@link Client}. This class is used to wrap a
|
|
@@ -279,136 +280,19 @@ export declare class AssembledTransaction<T> {
|
|
|
279
280
|
* logic.
|
|
280
281
|
*/
|
|
281
282
|
static Errors: {
|
|
282
|
-
ExpiredState:
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
message: string;
|
|
296
|
-
stack?: string;
|
|
297
|
-
};
|
|
298
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
299
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
300
|
-
stackTraceLimit: number;
|
|
301
|
-
};
|
|
302
|
-
NeedsMoreSignatures: {
|
|
303
|
-
new (message?: string): {
|
|
304
|
-
name: string;
|
|
305
|
-
message: string;
|
|
306
|
-
stack?: string;
|
|
307
|
-
};
|
|
308
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
309
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
310
|
-
stackTraceLimit: number;
|
|
311
|
-
};
|
|
312
|
-
NoSignatureNeeded: {
|
|
313
|
-
new (message?: string): {
|
|
314
|
-
name: string;
|
|
315
|
-
message: string;
|
|
316
|
-
stack?: string;
|
|
317
|
-
};
|
|
318
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
319
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
320
|
-
stackTraceLimit: number;
|
|
321
|
-
};
|
|
322
|
-
NoUnsignedNonInvokerAuthEntries: {
|
|
323
|
-
new (message?: string): {
|
|
324
|
-
name: string;
|
|
325
|
-
message: string;
|
|
326
|
-
stack?: string;
|
|
327
|
-
};
|
|
328
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
329
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
330
|
-
stackTraceLimit: number;
|
|
331
|
-
};
|
|
332
|
-
NoSigner: {
|
|
333
|
-
new (message?: string): {
|
|
334
|
-
name: string;
|
|
335
|
-
message: string;
|
|
336
|
-
stack?: string;
|
|
337
|
-
};
|
|
338
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
339
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
340
|
-
stackTraceLimit: number;
|
|
341
|
-
};
|
|
342
|
-
NotYetSimulated: {
|
|
343
|
-
new (message?: string): {
|
|
344
|
-
name: string;
|
|
345
|
-
message: string;
|
|
346
|
-
stack?: string;
|
|
347
|
-
};
|
|
348
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
349
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
350
|
-
stackTraceLimit: number;
|
|
351
|
-
};
|
|
352
|
-
FakeAccount: {
|
|
353
|
-
new (message?: string): {
|
|
354
|
-
name: string;
|
|
355
|
-
message: string;
|
|
356
|
-
stack?: string;
|
|
357
|
-
};
|
|
358
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
359
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
360
|
-
stackTraceLimit: number;
|
|
361
|
-
};
|
|
362
|
-
SimulationFailed: {
|
|
363
|
-
new (message?: string): {
|
|
364
|
-
name: string;
|
|
365
|
-
message: string;
|
|
366
|
-
stack?: string;
|
|
367
|
-
};
|
|
368
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
369
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
370
|
-
stackTraceLimit: number;
|
|
371
|
-
};
|
|
372
|
-
InternalWalletError: {
|
|
373
|
-
new (message?: string): {
|
|
374
|
-
name: string;
|
|
375
|
-
message: string;
|
|
376
|
-
stack?: string;
|
|
377
|
-
};
|
|
378
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
379
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
380
|
-
stackTraceLimit: number;
|
|
381
|
-
};
|
|
382
|
-
ExternalServiceError: {
|
|
383
|
-
new (message?: string): {
|
|
384
|
-
name: string;
|
|
385
|
-
message: string;
|
|
386
|
-
stack?: string;
|
|
387
|
-
};
|
|
388
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
389
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
390
|
-
stackTraceLimit: number;
|
|
391
|
-
};
|
|
392
|
-
InvalidClientRequest: {
|
|
393
|
-
new (message?: string): {
|
|
394
|
-
name: string;
|
|
395
|
-
message: string;
|
|
396
|
-
stack?: string;
|
|
397
|
-
};
|
|
398
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
399
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
400
|
-
stackTraceLimit: number;
|
|
401
|
-
};
|
|
402
|
-
UserRejected: {
|
|
403
|
-
new (message?: string): {
|
|
404
|
-
name: string;
|
|
405
|
-
message: string;
|
|
406
|
-
stack?: string;
|
|
407
|
-
};
|
|
408
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
409
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
410
|
-
stackTraceLimit: number;
|
|
411
|
-
};
|
|
283
|
+
ExpiredState: typeof ExpiredStateError;
|
|
284
|
+
RestorationFailure: typeof RestoreFailureError;
|
|
285
|
+
NeedsMoreSignatures: typeof NeedsMoreSignaturesError;
|
|
286
|
+
NoSignatureNeeded: typeof NoSignatureNeededError;
|
|
287
|
+
NoUnsignedNonInvokerAuthEntries: typeof NoUnsignedNonInvokerAuthEntriesError;
|
|
288
|
+
NoSigner: typeof NoSignerError;
|
|
289
|
+
NotYetSimulated: typeof NotYetSimulatedError;
|
|
290
|
+
FakeAccount: typeof FakeAccountError;
|
|
291
|
+
SimulationFailed: typeof SimulationFailedError;
|
|
292
|
+
InternalWalletError: typeof InternalWalletError;
|
|
293
|
+
ExternalServiceError: typeof ExternalServiceError;
|
|
294
|
+
InvalidClientRequest: typeof InvalidClientRequestError;
|
|
295
|
+
UserRejected: typeof UserRejectedError;
|
|
412
296
|
};
|
|
413
297
|
/**
|
|
414
298
|
* Serialize the AssembledTransaction to a JSON string. This is useful for
|
|
@@ -590,7 +474,7 @@ export declare class AssembledTransaction<T> {
|
|
|
590
474
|
*/
|
|
591
475
|
signAuthEntry?: ClientOptions["signAuthEntry"];
|
|
592
476
|
/**
|
|
593
|
-
* If you have a pro use-case and need to override the default `authorizeEntry` function, rather than using the one in
|
|
477
|
+
* If you have a pro use-case and need to override the default `authorizeEntry` function, rather than using the one in `@stellar/stellar-base`, you can do that! Your function needs to take at least the first argument, `entry: xdr.SorobanAuthorizationEntry`, and return a `Promise<xdr.SorobanAuthorizationEntry>`.
|
|
594
478
|
*
|
|
595
479
|
* Note that you if you pass this, then `signAuthEntry` will be ignored.
|
|
596
480
|
*/
|
|
@@ -620,7 +504,7 @@ export declare class AssembledTransaction<T> {
|
|
|
620
504
|
*
|
|
621
505
|
* @throws {Error} - Throws an error if no `signTransaction` function is provided during
|
|
622
506
|
* Client initialization.
|
|
623
|
-
* @throws {
|
|
507
|
+
* @throws {RestoreFailureError} - Throws a custom error if the
|
|
624
508
|
* restore transaction fails, providing the details of the failure.
|
|
625
509
|
*/
|
|
626
510
|
restoreFootprint(
|
|
@@ -12,16 +12,7 @@ var _rust_result = require("./rust_result");
|
|
|
12
12
|
var _utils = require("./utils");
|
|
13
13
|
var _types = require("./types");
|
|
14
14
|
var _sent_transaction = require("./sent_transaction");
|
|
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); }
|
|
17
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
18
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
19
|
-
function _wrapNativeSuper(t) { var r = "function" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); }
|
|
20
|
-
function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }
|
|
21
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
|
-
function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } }
|
|
23
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
24
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
15
|
+
var _errors = require("./errors");
|
|
25
16
|
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); }
|
|
26
17
|
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; }
|
|
27
18
|
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; }
|
|
@@ -719,108 +710,17 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
719
710
|
}]);
|
|
720
711
|
}();
|
|
721
712
|
_defineProperty(AssembledTransaction, "Errors", {
|
|
722
|
-
ExpiredState:
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
_inherits(RestoreFailureError, _Error2);
|
|
736
|
-
return _createClass(RestoreFailureError);
|
|
737
|
-
}(_wrapNativeSuper(Error)),
|
|
738
|
-
NeedsMoreSignatures: function (_Error3) {
|
|
739
|
-
function NeedsMoreSignaturesError() {
|
|
740
|
-
_classCallCheck(this, NeedsMoreSignaturesError);
|
|
741
|
-
return _callSuper(this, NeedsMoreSignaturesError, arguments);
|
|
742
|
-
}
|
|
743
|
-
_inherits(NeedsMoreSignaturesError, _Error3);
|
|
744
|
-
return _createClass(NeedsMoreSignaturesError);
|
|
745
|
-
}(_wrapNativeSuper(Error)),
|
|
746
|
-
NoSignatureNeeded: function (_Error4) {
|
|
747
|
-
function NoSignatureNeededError() {
|
|
748
|
-
_classCallCheck(this, NoSignatureNeededError);
|
|
749
|
-
return _callSuper(this, NoSignatureNeededError, arguments);
|
|
750
|
-
}
|
|
751
|
-
_inherits(NoSignatureNeededError, _Error4);
|
|
752
|
-
return _createClass(NoSignatureNeededError);
|
|
753
|
-
}(_wrapNativeSuper(Error)),
|
|
754
|
-
NoUnsignedNonInvokerAuthEntries: function (_Error5) {
|
|
755
|
-
function NoUnsignedNonInvokerAuthEntriesError() {
|
|
756
|
-
_classCallCheck(this, NoUnsignedNonInvokerAuthEntriesError);
|
|
757
|
-
return _callSuper(this, NoUnsignedNonInvokerAuthEntriesError, arguments);
|
|
758
|
-
}
|
|
759
|
-
_inherits(NoUnsignedNonInvokerAuthEntriesError, _Error5);
|
|
760
|
-
return _createClass(NoUnsignedNonInvokerAuthEntriesError);
|
|
761
|
-
}(_wrapNativeSuper(Error)),
|
|
762
|
-
NoSigner: function (_Error6) {
|
|
763
|
-
function NoSignerError() {
|
|
764
|
-
_classCallCheck(this, NoSignerError);
|
|
765
|
-
return _callSuper(this, NoSignerError, arguments);
|
|
766
|
-
}
|
|
767
|
-
_inherits(NoSignerError, _Error6);
|
|
768
|
-
return _createClass(NoSignerError);
|
|
769
|
-
}(_wrapNativeSuper(Error)),
|
|
770
|
-
NotYetSimulated: function (_Error7) {
|
|
771
|
-
function NotYetSimulatedError() {
|
|
772
|
-
_classCallCheck(this, NotYetSimulatedError);
|
|
773
|
-
return _callSuper(this, NotYetSimulatedError, arguments);
|
|
774
|
-
}
|
|
775
|
-
_inherits(NotYetSimulatedError, _Error7);
|
|
776
|
-
return _createClass(NotYetSimulatedError);
|
|
777
|
-
}(_wrapNativeSuper(Error)),
|
|
778
|
-
FakeAccount: function (_Error8) {
|
|
779
|
-
function FakeAccountError() {
|
|
780
|
-
_classCallCheck(this, FakeAccountError);
|
|
781
|
-
return _callSuper(this, FakeAccountError, arguments);
|
|
782
|
-
}
|
|
783
|
-
_inherits(FakeAccountError, _Error8);
|
|
784
|
-
return _createClass(FakeAccountError);
|
|
785
|
-
}(_wrapNativeSuper(Error)),
|
|
786
|
-
SimulationFailed: function (_Error9) {
|
|
787
|
-
function SimulationFailedError() {
|
|
788
|
-
_classCallCheck(this, SimulationFailedError);
|
|
789
|
-
return _callSuper(this, SimulationFailedError, arguments);
|
|
790
|
-
}
|
|
791
|
-
_inherits(SimulationFailedError, _Error9);
|
|
792
|
-
return _createClass(SimulationFailedError);
|
|
793
|
-
}(_wrapNativeSuper(Error)),
|
|
794
|
-
InternalWalletError: function (_Error0) {
|
|
795
|
-
function InternalWalletError() {
|
|
796
|
-
_classCallCheck(this, InternalWalletError);
|
|
797
|
-
return _callSuper(this, InternalWalletError, arguments);
|
|
798
|
-
}
|
|
799
|
-
_inherits(InternalWalletError, _Error0);
|
|
800
|
-
return _createClass(InternalWalletError);
|
|
801
|
-
}(_wrapNativeSuper(Error)),
|
|
802
|
-
ExternalServiceError: function (_Error1) {
|
|
803
|
-
function ExternalServiceError() {
|
|
804
|
-
_classCallCheck(this, ExternalServiceError);
|
|
805
|
-
return _callSuper(this, ExternalServiceError, arguments);
|
|
806
|
-
}
|
|
807
|
-
_inherits(ExternalServiceError, _Error1);
|
|
808
|
-
return _createClass(ExternalServiceError);
|
|
809
|
-
}(_wrapNativeSuper(Error)),
|
|
810
|
-
InvalidClientRequest: function (_Error10) {
|
|
811
|
-
function InvalidClientRequestError() {
|
|
812
|
-
_classCallCheck(this, InvalidClientRequestError);
|
|
813
|
-
return _callSuper(this, InvalidClientRequestError, arguments);
|
|
814
|
-
}
|
|
815
|
-
_inherits(InvalidClientRequestError, _Error10);
|
|
816
|
-
return _createClass(InvalidClientRequestError);
|
|
817
|
-
}(_wrapNativeSuper(Error)),
|
|
818
|
-
UserRejected: function (_Error11) {
|
|
819
|
-
function UserRejectedError() {
|
|
820
|
-
_classCallCheck(this, UserRejectedError);
|
|
821
|
-
return _callSuper(this, UserRejectedError, arguments);
|
|
822
|
-
}
|
|
823
|
-
_inherits(UserRejectedError, _Error11);
|
|
824
|
-
return _createClass(UserRejectedError);
|
|
825
|
-
}(_wrapNativeSuper(Error))
|
|
713
|
+
ExpiredState: _errors.ExpiredStateError,
|
|
714
|
+
RestorationFailure: _errors.RestoreFailureError,
|
|
715
|
+
NeedsMoreSignatures: _errors.NeedsMoreSignaturesError,
|
|
716
|
+
NoSignatureNeeded: _errors.NoSignatureNeededError,
|
|
717
|
+
NoUnsignedNonInvokerAuthEntries: _errors.NoUnsignedNonInvokerAuthEntriesError,
|
|
718
|
+
NoSigner: _errors.NoSignerError,
|
|
719
|
+
NotYetSimulated: _errors.NotYetSimulatedError,
|
|
720
|
+
FakeAccount: _errors.FakeAccountError,
|
|
721
|
+
SimulationFailed: _errors.SimulationFailedError,
|
|
722
|
+
InternalWalletError: _errors.InternalWalletError,
|
|
723
|
+
ExternalServiceError: _errors.ExternalServiceError,
|
|
724
|
+
InvalidClientRequest: _errors.InvalidClientRequestError,
|
|
725
|
+
UserRejected: _errors.UserRejectedError
|
|
826
726
|
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare class ExpiredStateError extends Error {
|
|
2
|
+
}
|
|
3
|
+
export declare class RestoreFailureError extends Error {
|
|
4
|
+
}
|
|
5
|
+
export declare class NeedsMoreSignaturesError extends Error {
|
|
6
|
+
}
|
|
7
|
+
export declare class NoSignatureNeededError extends Error {
|
|
8
|
+
}
|
|
9
|
+
export declare class NoUnsignedNonInvokerAuthEntriesError extends Error {
|
|
10
|
+
}
|
|
11
|
+
export declare class NoSignerError extends Error {
|
|
12
|
+
}
|
|
13
|
+
export declare class NotYetSimulatedError extends Error {
|
|
14
|
+
}
|
|
15
|
+
export declare class FakeAccountError extends Error {
|
|
16
|
+
}
|
|
17
|
+
export declare class SimulationFailedError extends Error {
|
|
18
|
+
}
|
|
19
|
+
export declare class InternalWalletError extends Error {
|
|
20
|
+
}
|
|
21
|
+
export declare class ExternalServiceError extends Error {
|
|
22
|
+
}
|
|
23
|
+
export declare class InvalidClientRequestError extends Error {
|
|
24
|
+
}
|
|
25
|
+
export declare class UserRejectedError extends Error {
|
|
26
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.UserRejectedError = exports.SimulationFailedError = exports.RestoreFailureError = exports.NotYetSimulatedError = exports.NoUnsignedNonInvokerAuthEntriesError = exports.NoSignerError = exports.NoSignatureNeededError = exports.NeedsMoreSignaturesError = exports.InvalidClientRequestError = exports.InternalWalletError = exports.FakeAccountError = exports.ExternalServiceError = exports.ExpiredStateError = void 0;
|
|
8
|
+
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); } }
|
|
9
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
11
|
+
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); }
|
|
12
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
13
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
14
|
+
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); }
|
|
15
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
16
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
17
|
+
function _wrapNativeSuper(t) { var r = "function" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); }
|
|
18
|
+
function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }
|
|
19
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
|
+
function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } }
|
|
21
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
22
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
23
|
+
var ExpiredStateError = exports.ExpiredStateError = function (_Error) {
|
|
24
|
+
function ExpiredStateError() {
|
|
25
|
+
_classCallCheck(this, ExpiredStateError);
|
|
26
|
+
return _callSuper(this, ExpiredStateError, arguments);
|
|
27
|
+
}
|
|
28
|
+
_inherits(ExpiredStateError, _Error);
|
|
29
|
+
return _createClass(ExpiredStateError);
|
|
30
|
+
}(_wrapNativeSuper(Error));
|
|
31
|
+
var RestoreFailureError = exports.RestoreFailureError = function (_Error2) {
|
|
32
|
+
function RestoreFailureError() {
|
|
33
|
+
_classCallCheck(this, RestoreFailureError);
|
|
34
|
+
return _callSuper(this, RestoreFailureError, arguments);
|
|
35
|
+
}
|
|
36
|
+
_inherits(RestoreFailureError, _Error2);
|
|
37
|
+
return _createClass(RestoreFailureError);
|
|
38
|
+
}(_wrapNativeSuper(Error));
|
|
39
|
+
var NeedsMoreSignaturesError = exports.NeedsMoreSignaturesError = function (_Error3) {
|
|
40
|
+
function NeedsMoreSignaturesError() {
|
|
41
|
+
_classCallCheck(this, NeedsMoreSignaturesError);
|
|
42
|
+
return _callSuper(this, NeedsMoreSignaturesError, arguments);
|
|
43
|
+
}
|
|
44
|
+
_inherits(NeedsMoreSignaturesError, _Error3);
|
|
45
|
+
return _createClass(NeedsMoreSignaturesError);
|
|
46
|
+
}(_wrapNativeSuper(Error));
|
|
47
|
+
var NoSignatureNeededError = exports.NoSignatureNeededError = function (_Error4) {
|
|
48
|
+
function NoSignatureNeededError() {
|
|
49
|
+
_classCallCheck(this, NoSignatureNeededError);
|
|
50
|
+
return _callSuper(this, NoSignatureNeededError, arguments);
|
|
51
|
+
}
|
|
52
|
+
_inherits(NoSignatureNeededError, _Error4);
|
|
53
|
+
return _createClass(NoSignatureNeededError);
|
|
54
|
+
}(_wrapNativeSuper(Error));
|
|
55
|
+
var NoUnsignedNonInvokerAuthEntriesError = exports.NoUnsignedNonInvokerAuthEntriesError = function (_Error5) {
|
|
56
|
+
function NoUnsignedNonInvokerAuthEntriesError() {
|
|
57
|
+
_classCallCheck(this, NoUnsignedNonInvokerAuthEntriesError);
|
|
58
|
+
return _callSuper(this, NoUnsignedNonInvokerAuthEntriesError, arguments);
|
|
59
|
+
}
|
|
60
|
+
_inherits(NoUnsignedNonInvokerAuthEntriesError, _Error5);
|
|
61
|
+
return _createClass(NoUnsignedNonInvokerAuthEntriesError);
|
|
62
|
+
}(_wrapNativeSuper(Error));
|
|
63
|
+
var NoSignerError = exports.NoSignerError = function (_Error6) {
|
|
64
|
+
function NoSignerError() {
|
|
65
|
+
_classCallCheck(this, NoSignerError);
|
|
66
|
+
return _callSuper(this, NoSignerError, arguments);
|
|
67
|
+
}
|
|
68
|
+
_inherits(NoSignerError, _Error6);
|
|
69
|
+
return _createClass(NoSignerError);
|
|
70
|
+
}(_wrapNativeSuper(Error));
|
|
71
|
+
var NotYetSimulatedError = exports.NotYetSimulatedError = function (_Error7) {
|
|
72
|
+
function NotYetSimulatedError() {
|
|
73
|
+
_classCallCheck(this, NotYetSimulatedError);
|
|
74
|
+
return _callSuper(this, NotYetSimulatedError, arguments);
|
|
75
|
+
}
|
|
76
|
+
_inherits(NotYetSimulatedError, _Error7);
|
|
77
|
+
return _createClass(NotYetSimulatedError);
|
|
78
|
+
}(_wrapNativeSuper(Error));
|
|
79
|
+
var FakeAccountError = exports.FakeAccountError = function (_Error8) {
|
|
80
|
+
function FakeAccountError() {
|
|
81
|
+
_classCallCheck(this, FakeAccountError);
|
|
82
|
+
return _callSuper(this, FakeAccountError, arguments);
|
|
83
|
+
}
|
|
84
|
+
_inherits(FakeAccountError, _Error8);
|
|
85
|
+
return _createClass(FakeAccountError);
|
|
86
|
+
}(_wrapNativeSuper(Error));
|
|
87
|
+
var SimulationFailedError = exports.SimulationFailedError = function (_Error9) {
|
|
88
|
+
function SimulationFailedError() {
|
|
89
|
+
_classCallCheck(this, SimulationFailedError);
|
|
90
|
+
return _callSuper(this, SimulationFailedError, arguments);
|
|
91
|
+
}
|
|
92
|
+
_inherits(SimulationFailedError, _Error9);
|
|
93
|
+
return _createClass(SimulationFailedError);
|
|
94
|
+
}(_wrapNativeSuper(Error));
|
|
95
|
+
var InternalWalletError = exports.InternalWalletError = function (_Error0) {
|
|
96
|
+
function InternalWalletError() {
|
|
97
|
+
_classCallCheck(this, InternalWalletError);
|
|
98
|
+
return _callSuper(this, InternalWalletError, arguments);
|
|
99
|
+
}
|
|
100
|
+
_inherits(InternalWalletError, _Error0);
|
|
101
|
+
return _createClass(InternalWalletError);
|
|
102
|
+
}(_wrapNativeSuper(Error));
|
|
103
|
+
var ExternalServiceError = exports.ExternalServiceError = function (_Error1) {
|
|
104
|
+
function ExternalServiceError() {
|
|
105
|
+
_classCallCheck(this, ExternalServiceError);
|
|
106
|
+
return _callSuper(this, ExternalServiceError, arguments);
|
|
107
|
+
}
|
|
108
|
+
_inherits(ExternalServiceError, _Error1);
|
|
109
|
+
return _createClass(ExternalServiceError);
|
|
110
|
+
}(_wrapNativeSuper(Error));
|
|
111
|
+
var InvalidClientRequestError = exports.InvalidClientRequestError = function (_Error10) {
|
|
112
|
+
function InvalidClientRequestError() {
|
|
113
|
+
_classCallCheck(this, InvalidClientRequestError);
|
|
114
|
+
return _callSuper(this, InvalidClientRequestError, arguments);
|
|
115
|
+
}
|
|
116
|
+
_inherits(InvalidClientRequestError, _Error10);
|
|
117
|
+
return _createClass(InvalidClientRequestError);
|
|
118
|
+
}(_wrapNativeSuper(Error));
|
|
119
|
+
var UserRejectedError = exports.UserRejectedError = function (_Error11) {
|
|
120
|
+
function UserRejectedError() {
|
|
121
|
+
_classCallCheck(this, UserRejectedError);
|
|
122
|
+
return _callSuper(this, UserRejectedError, arguments);
|
|
123
|
+
}
|
|
124
|
+
_inherits(UserRejectedError, _Error11);
|
|
125
|
+
return _createClass(UserRejectedError);
|
|
126
|
+
}(_wrapNativeSuper(Error));
|
|
@@ -19,7 +19,7 @@ import type { AssembledTransaction } from "./assembled_transaction";
|
|
|
19
19
|
* @class
|
|
20
20
|
*
|
|
21
21
|
* @param {Function} signTransaction More info in {@link MethodOptions}
|
|
22
|
-
* @param {module:contract.AssembledTransaction
|
|
22
|
+
* @param {module:contract.AssembledTransaction} assembled {@link AssembledTransaction} from which this SentTransaction was initialized
|
|
23
23
|
*/
|
|
24
24
|
export declare class SentTransaction<T> {
|
|
25
25
|
assembled: AssembledTransaction<T>;
|
|
@@ -45,7 +45,7 @@ export declare class Spec {
|
|
|
45
45
|
* @returns {Promise<module:contract.Spec>} A Promise that resolves to a Spec instance.
|
|
46
46
|
* @throws {Error} If the contract spec cannot be obtained from the provided wasm binary.
|
|
47
47
|
*/
|
|
48
|
-
static fromWasm(wasm: Buffer):
|
|
48
|
+
static fromWasm(wasm: Buffer): Spec;
|
|
49
49
|
/**
|
|
50
50
|
* Generates a Spec instance from contract specs in any of the following forms:
|
|
51
51
|
* - An XDR encoded stream of xdr.ScSpecEntry entries, the format of the spec
|
|
@@ -153,7 +153,7 @@ export declare class Spec {
|
|
|
153
153
|
/**
|
|
154
154
|
* Gets the XDR error cases from the spec.
|
|
155
155
|
*
|
|
156
|
-
* @returns
|
|
156
|
+
* @returns all contract functions
|
|
157
157
|
*
|
|
158
158
|
*/
|
|
159
159
|
errorCases(): xdr.ScSpecUdtErrorEnumCaseV0[];
|
|
@@ -7,10 +7,7 @@ exports.Spec = void 0;
|
|
|
7
7
|
var _stellarBase = require("@stellar/stellar-base");
|
|
8
8
|
var _rust_result = require("./rust_result");
|
|
9
9
|
var _utils = require("./utils");
|
|
10
|
-
|
|
11
|
-
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
12
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
13
|
-
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); }); }; }
|
|
10
|
+
var _wasm_spec_parser = require("./wasm_spec_parser");
|
|
14
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; }
|
|
15
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; }
|
|
16
13
|
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); }
|
|
@@ -88,6 +85,7 @@ function stringToScVal(str, ty) {
|
|
|
88
85
|
case _stellarBase.xdr.ScSpecType.scSpecTypeSymbol().value:
|
|
89
86
|
return _stellarBase.xdr.ScVal.scvSymbol(str);
|
|
90
87
|
case _stellarBase.xdr.ScSpecType.scSpecTypeAddress().value:
|
|
88
|
+
case _stellarBase.xdr.ScSpecType.scSpecTypeMuxedAddress().value:
|
|
91
89
|
return _stellarBase.Address.fromString(str).toScVal();
|
|
92
90
|
case _stellarBase.xdr.ScSpecType.scSpecTypeU64().value:
|
|
93
91
|
return new _stellarBase.XdrLargeInt("u64", str).toScVal();
|
|
@@ -104,6 +102,14 @@ function stringToScVal(str, ty) {
|
|
|
104
102
|
case _stellarBase.xdr.ScSpecType.scSpecTypeBytes().value:
|
|
105
103
|
case _stellarBase.xdr.ScSpecType.scSpecTypeBytesN().value:
|
|
106
104
|
return _stellarBase.xdr.ScVal.scvBytes(Buffer.from(str, "base64"));
|
|
105
|
+
case _stellarBase.xdr.ScSpecType.scSpecTypeTimepoint().value:
|
|
106
|
+
{
|
|
107
|
+
return _stellarBase.xdr.ScVal.scvTimepoint(new _stellarBase.xdr.Uint64(str));
|
|
108
|
+
}
|
|
109
|
+
case _stellarBase.xdr.ScSpecType.scSpecTypeDuration().value:
|
|
110
|
+
{
|
|
111
|
+
return _stellarBase.xdr.ScVal.scvDuration(new _stellarBase.xdr.Uint64(str));
|
|
112
|
+
}
|
|
107
113
|
default:
|
|
108
114
|
throw new TypeError("invalid type ".concat(ty.name, " specified for string value"));
|
|
109
115
|
}
|
|
@@ -125,6 +131,18 @@ var PRIMITIVE_DEFINITONS = {
|
|
|
125
131
|
minLength: 1,
|
|
126
132
|
maxLength: 20
|
|
127
133
|
},
|
|
134
|
+
Timepoint: {
|
|
135
|
+
type: "string",
|
|
136
|
+
pattern: "^([1-9][0-9]*|0)$",
|
|
137
|
+
minLength: 1,
|
|
138
|
+
maxLength: 20
|
|
139
|
+
},
|
|
140
|
+
Duration: {
|
|
141
|
+
type: "string",
|
|
142
|
+
pattern: "^([1-9][0-9]*|0)$",
|
|
143
|
+
minLength: 1,
|
|
144
|
+
maxLength: 20
|
|
145
|
+
},
|
|
128
146
|
I64: {
|
|
129
147
|
type: "string",
|
|
130
148
|
pattern: "^(-?[1-9][0-9]*|0)$",
|
|
@@ -160,6 +178,11 @@ var PRIMITIVE_DEFINITONS = {
|
|
|
160
178
|
format: "address",
|
|
161
179
|
description: "Address can be a public key or contract id"
|
|
162
180
|
},
|
|
181
|
+
MuxedAddress: {
|
|
182
|
+
type: "string",
|
|
183
|
+
format: "address",
|
|
184
|
+
description: "Stellar public key with M prefix combining a G address and unique ID"
|
|
185
|
+
},
|
|
163
186
|
ScString: {
|
|
164
187
|
type: "string",
|
|
165
188
|
description: "ScString is a string"
|
|
@@ -222,13 +245,11 @@ function typeRef(typeDef) {
|
|
|
222
245
|
}
|
|
223
246
|
case _stellarBase.xdr.ScSpecType.scSpecTypeTimepoint().value:
|
|
224
247
|
{
|
|
225
|
-
throw new Error("Timepoint type not supported");
|
|
226
248
|
ref = "Timepoint";
|
|
227
249
|
break;
|
|
228
250
|
}
|
|
229
251
|
case _stellarBase.xdr.ScSpecType.scSpecTypeDuration().value:
|
|
230
252
|
{
|
|
231
|
-
throw new Error("Duration not supported");
|
|
232
253
|
ref = "Duration";
|
|
233
254
|
break;
|
|
234
255
|
}
|
|
@@ -272,6 +293,11 @@ function typeRef(typeDef) {
|
|
|
272
293
|
ref = "Address";
|
|
273
294
|
break;
|
|
274
295
|
}
|
|
296
|
+
case _stellarBase.xdr.ScSpecType.scSpecTypeMuxedAddress().value:
|
|
297
|
+
{
|
|
298
|
+
ref = "MuxedAddress";
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
275
301
|
case _stellarBase.xdr.ScSpecType.scSpecTypeOption().value:
|
|
276
302
|
{
|
|
277
303
|
var opt = typeDef.option();
|
|
@@ -690,6 +716,8 @@ var Spec = exports.Spec = function () {
|
|
|
690
716
|
case _stellarBase.xdr.ScSpecType.scSpecTypeI128().value:
|
|
691
717
|
case _stellarBase.xdr.ScSpecType.scSpecTypeU256().value:
|
|
692
718
|
case _stellarBase.xdr.ScSpecType.scSpecTypeI256().value:
|
|
719
|
+
case _stellarBase.xdr.ScSpecType.scSpecTypeTimepoint().value:
|
|
720
|
+
case _stellarBase.xdr.ScSpecType.scSpecTypeDuration().value:
|
|
693
721
|
{
|
|
694
722
|
var intType = t.name.substring(10).toLowerCase();
|
|
695
723
|
return new _stellarBase.XdrLargeInt(intType, val).toScVal();
|
|
@@ -839,6 +867,8 @@ var Spec = exports.Spec = function () {
|
|
|
839
867
|
return null;
|
|
840
868
|
case _stellarBase.xdr.ScValType.scvU64().value:
|
|
841
869
|
case _stellarBase.xdr.ScValType.scvI64().value:
|
|
870
|
+
case _stellarBase.xdr.ScValType.scvTimepoint().value:
|
|
871
|
+
case _stellarBase.xdr.ScValType.scvDuration().value:
|
|
842
872
|
case _stellarBase.xdr.ScValType.scvU128().value:
|
|
843
873
|
case _stellarBase.xdr.ScValType.scvI128().value:
|
|
844
874
|
case _stellarBase.xdr.ScValType.scvU256().value:
|
|
@@ -894,9 +924,6 @@ var Spec = exports.Spec = function () {
|
|
|
894
924
|
}
|
|
895
925
|
return (_scv$value = scv.value()) === null || _scv$value === void 0 ? void 0 : _scv$value.toString();
|
|
896
926
|
}
|
|
897
|
-
case _stellarBase.xdr.ScValType.scvTimepoint().value:
|
|
898
|
-
case _stellarBase.xdr.ScValType.scvDuration().value:
|
|
899
|
-
return (0, _stellarBase.scValToBigInt)(_stellarBase.xdr.ScVal.scvU64(scv.u64()));
|
|
900
927
|
default:
|
|
901
928
|
throw new TypeError("failed to convert ".concat(JSON.stringify(scv, null, 2), " to native type from type ").concat(t.name));
|
|
902
929
|
}
|
|
@@ -1034,24 +1061,9 @@ var Spec = exports.Spec = function () {
|
|
|
1034
1061
|
}
|
|
1035
1062
|
}], [{
|
|
1036
1063
|
key: "fromWasm",
|
|
1037
|
-
value:
|
|
1038
|
-
var
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
while (1) switch (_context.n) {
|
|
1042
|
-
case 0:
|
|
1043
|
-
_context.n = 1;
|
|
1044
|
-
return (0, _utils.specFromWasm)(wasm);
|
|
1045
|
-
case 1:
|
|
1046
|
-
spec = _context.v;
|
|
1047
|
-
return _context.a(2, new Spec(spec));
|
|
1048
|
-
}
|
|
1049
|
-
}, _callee);
|
|
1050
|
-
}));
|
|
1051
|
-
function fromWasm(_x) {
|
|
1052
|
-
return _fromWasm.apply(this, arguments);
|
|
1053
|
-
}
|
|
1054
|
-
return fromWasm;
|
|
1055
|
-
}())
|
|
1064
|
+
value: function fromWasm(wasm) {
|
|
1065
|
+
var spec = (0, _wasm_spec_parser.specFromWasm)(wasm);
|
|
1066
|
+
return new Spec(spec);
|
|
1067
|
+
}
|
|
1056
1068
|
}]);
|
|
1057
1069
|
}();
|