@stellar/stellar-sdk 12.0.0-rc.2 → 12.0.0-rc.3

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +1 -1
  3. package/dist/stellar-sdk.js +1643 -466
  4. package/dist/stellar-sdk.min.js +1 -1
  5. package/lib/{contract_client → contract}/assembled_transaction.d.ts +59 -40
  6. package/lib/{contract_client → contract}/assembled_transaction.js +128 -146
  7. package/lib/{contract_client → contract}/basic_node_signer.d.ts +2 -2
  8. package/lib/{contract_client → contract}/basic_node_signer.js +3 -3
  9. package/lib/contract/client.d.ts +51 -0
  10. package/lib/contract/client.js +177 -0
  11. package/lib/contract/index.d.ts +7 -0
  12. package/lib/{contract_client → contract}/index.js +19 -8
  13. package/lib/{contract_client → contract}/sent_transaction.d.ts +21 -10
  14. package/lib/{contract_client → contract}/sent_transaction.js +27 -13
  15. package/lib/{contract_spec.d.ts → contract/spec.d.ts} +3 -3
  16. package/lib/{contract_spec.js → contract/spec.js} +160 -160
  17. package/lib/{contract_client → contract}/types.d.ts +10 -8
  18. package/lib/contract/utils.d.ts +40 -0
  19. package/lib/{contract_client → contract}/utils.js +12 -2
  20. package/lib/index.d.ts +26 -2
  21. package/lib/index.js +10 -16
  22. package/lib/rpc/index.d.ts +7 -0
  23. package/lib/{soroban → rpc}/server.d.ts +49 -0
  24. package/lib/{soroban → rpc}/server.js +199 -118
  25. package/package.json +20 -3
  26. package/lib/contract_client/client.d.ts +0 -17
  27. package/lib/contract_client/client.js +0 -57
  28. package/lib/contract_client/index.d.ts +0 -6
  29. package/lib/contract_client/utils.d.ts +0 -23
  30. package/lib/rust_types/index.d.ts +0 -1
  31. package/lib/rust_types/index.js +0 -16
  32. package/lib/soroban/index.d.ts +0 -7
  33. /package/lib/{rust_types/result.d.ts → contract/rust_result.d.ts} +0 -0
  34. /package/lib/{rust_types/result.js → contract/rust_result.js} +0 -0
  35. /package/lib/{contract_client → contract}/types.js +0 -0
  36. /package/lib/{soroban → rpc}/api.d.ts +0 -0
  37. /package/lib/{soroban → rpc}/api.js +0 -0
  38. /package/lib/{soroban → rpc}/axios.d.ts +0 -0
  39. /package/lib/{soroban → rpc}/axios.js +0 -0
  40. /package/lib/{soroban → rpc}/browser.d.ts +0 -0
  41. /package/lib/{soroban → rpc}/browser.js +0 -0
  42. /package/lib/{soroban → rpc}/index.js +0 -0
  43. /package/lib/{soroban → rpc}/jsonrpc.d.ts +0 -0
  44. /package/lib/{soroban → rpc}/jsonrpc.js +0 -0
  45. /package/lib/{soroban → rpc}/parsers.d.ts +0 -0
  46. /package/lib/{soroban → rpc}/parsers.js +0 -0
  47. /package/lib/{soroban → rpc}/transaction.d.ts +0 -0
  48. /package/lib/{soroban → rpc}/transaction.js +0 -0
  49. /package/lib/{soroban → rpc}/utils.d.ts +0 -0
  50. /package/lib/{soroban → rpc}/utils.js +0 -0
@@ -1,57 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ContractClient = void 0;
7
- var _assembled_transaction = require("./assembled_transaction");
8
- var _excluded = ["method"];
9
- 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); }
10
- 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; }
11
- 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; }
12
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
13
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
14
- 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); } }
15
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
16
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
17
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
- 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); }
20
- var ContractClient = exports.ContractClient = _createClass(function ContractClient(spec, options) {
21
- var _this = this;
22
- _classCallCheck(this, ContractClient);
23
- _defineProperty(this, "txFromJSON", function (json) {
24
- var _JSON$parse = JSON.parse(json),
25
- method = _JSON$parse.method,
26
- tx = _objectWithoutProperties(_JSON$parse, _excluded);
27
- return _assembled_transaction.AssembledTransaction.fromJSON(_objectSpread(_objectSpread({}, _this.options), {}, {
28
- method: method,
29
- parseResultXdr: function parseResultXdr(result) {
30
- return _this.spec.funcResToNative(method, result);
31
- }
32
- }), tx);
33
- });
34
- this.spec = spec;
35
- this.options = options;
36
- this.spec.funcs().forEach(function (xdrFn) {
37
- var method = xdrFn.name().toString();
38
- var assembleTransaction = function assembleTransaction(args, methodOptions) {
39
- return _assembled_transaction.AssembledTransaction.build(_objectSpread(_objectSpread(_objectSpread({
40
- method: method,
41
- args: args && spec.funcArgsToScVals(method, args)
42
- }, options), methodOptions), {}, {
43
- errorTypes: spec.errorCases().reduce(function (acc, curr) {
44
- return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, curr.value(), {
45
- message: curr.doc().toString()
46
- }));
47
- }, {}),
48
- parseResultXdr: function parseResultXdr(result) {
49
- return spec.funcResToNative(method, result);
50
- }
51
- }));
52
- };
53
- _this[method] = spec.getFunc(method).inputs().length === 0 ? function (opts) {
54
- return assembleTransaction(undefined, opts);
55
- } : assembleTransaction;
56
- });
57
- });
@@ -1,6 +0,0 @@
1
- export * from './assembled_transaction';
2
- export * from './basic_node_signer';
3
- export * from './client';
4
- export * from './sent_transaction';
5
- export * from './types';
6
- export * from './utils';
@@ -1,23 +0,0 @@
1
- /**
2
- * The default timeout for waiting for a transaction to be included in a block.
3
- */
4
- export declare const DEFAULT_TIMEOUT: number;
5
- /**
6
- * Keep calling a `fn` for `timeoutInSeconds` seconds, if `keepWaitingIf` is true.
7
- * Returns an array of all attempts to call the function.
8
- */
9
- export declare function withExponentialBackoff<T>(fn: (previousFailure?: T) => Promise<T>, keepWaitingIf: (result: T) => boolean, timeoutInSeconds: number, exponentialFactor?: number, verbose?: boolean): Promise<T[]>;
10
- /**
11
- * If contracts are implemented using the `#[contracterror]` macro, then the
12
- * errors get included in the on-chain XDR that also describes your contract's
13
- * methods. Each error will have a specific number. This Regular Expression
14
- * matches these "expected error types" that a contract may throw, and helps
15
- * @{link AssembledTransaction} parse these errors.
16
- */
17
- export declare const contractErrorPattern: RegExp;
18
- /**
19
- * A TypeScript type guard that checks if an object has a `toString` method.
20
- */
21
- export declare function implementsToString(obj: unknown): obj is {
22
- toString(): string;
23
- };
@@ -1 +0,0 @@
1
- export * from "./result";
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _result = require("./result");
7
- Object.keys(_result).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _result[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function get() {
13
- return _result[key];
14
- }
15
- });
16
- });
@@ -1,7 +0,0 @@
1
- export * from './api';
2
- export { Server, Durability } from './server';
3
- export { default as AxiosClient } from './axios';
4
- export { parseRawSimulation, parseRawEvents } from './parsers';
5
- export * from './transaction';
6
- declare const _default: any;
7
- export default _default;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes