@stellar/typescript-wallet-sdk 4.0.0-beta.1786156822907 → 4.0.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/lib/bundle.js +56 -1
- package/lib/bundle.js.map +1 -1
- package/lib/bundle_browser.js +56 -1
- package/lib/bundle_browser.js.map +1 -1
- package/package.json +2 -2
- package/src/shims/eventsource.js +45 -0
- package/webpack.config.js +11 -0
package/lib/bundle.js
CHANGED
|
@@ -6878,6 +6878,61 @@ var ApplicationConfiguration = /** @class */ (function () {
|
|
|
6878
6878
|
exports.ApplicationConfiguration = ApplicationConfiguration;
|
|
6879
6879
|
|
|
6880
6880
|
|
|
6881
|
+
/***/ }),
|
|
6882
|
+
|
|
6883
|
+
/***/ "./src/shims/eventsource.js":
|
|
6884
|
+
/*!**********************************!*\
|
|
6885
|
+
!*** ./src/shims/eventsource.js ***!
|
|
6886
|
+
\**********************************/
|
|
6887
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6888
|
+
|
|
6889
|
+
/**
|
|
6890
|
+
* Lazy `eventsource` facade.
|
|
6891
|
+
*
|
|
6892
|
+
* eventsource v4 subclasses the DOM globals `Event`/`EventTarget` at module
|
|
6893
|
+
* scope, which React Native's Hermes does not provide. Horizon's CallBuilder
|
|
6894
|
+
* requires this module eagerly but only reads it inside `stream()`, so deferring
|
|
6895
|
+
* evaluation to first property access keeps imports working everywhere while
|
|
6896
|
+
* leaving streaming intact wherever those globals exist.
|
|
6897
|
+
*
|
|
6898
|
+
* Aliased in webpack.config.js: `eventsource$` resolves here, `eventsource-real$`
|
|
6899
|
+
* to the real package.
|
|
6900
|
+
*/
|
|
6901
|
+
let realModule;
|
|
6902
|
+
|
|
6903
|
+
const load = () => {
|
|
6904
|
+
if (!realModule) {
|
|
6905
|
+
try {
|
|
6906
|
+
// eslint-disable-next-line global-require
|
|
6907
|
+
realModule = __webpack_require__(/*! eventsource-real */ "../../node_modules/eventsource/dist/index.cjs");
|
|
6908
|
+
} catch (cause) {
|
|
6909
|
+
// CallBuilder.stream() catches this and retries on a timer, so make the
|
|
6910
|
+
// error it reports to onerror self-explanatory.
|
|
6911
|
+
throw new Error(
|
|
6912
|
+
"Horizon streaming needs the DOM Event/EventTarget globals and a " +
|
|
6913
|
+
"streaming fetch body, which React Native does not provide. Alias " +
|
|
6914
|
+
'"eventsource" to a native SSE client (e.g. react-native-sse) to use ' +
|
|
6915
|
+
`CallBuilder.stream(). Original error: ${cause.message}`,
|
|
6916
|
+
);
|
|
6917
|
+
}
|
|
6918
|
+
}
|
|
6919
|
+
|
|
6920
|
+
return realModule;
|
|
6921
|
+
};
|
|
6922
|
+
|
|
6923
|
+
Object.defineProperty(exports, "EventSource", ({
|
|
6924
|
+
enumerable: true,
|
|
6925
|
+
configurable: true,
|
|
6926
|
+
get: () => load().EventSource,
|
|
6927
|
+
}));
|
|
6928
|
+
|
|
6929
|
+
Object.defineProperty(exports, "ErrorEvent", ({
|
|
6930
|
+
enumerable: true,
|
|
6931
|
+
configurable: true,
|
|
6932
|
+
get: () => load().ErrorEvent,
|
|
6933
|
+
}));
|
|
6934
|
+
|
|
6935
|
+
|
|
6881
6936
|
/***/ }),
|
|
6882
6937
|
|
|
6883
6938
|
/***/ "../../node_modules/asynckit/index.js":
|
|
@@ -34520,7 +34575,7 @@ exports.AssetsCallBuilder = AssetsCallBuilder;
|
|
|
34520
34575
|
"use strict";
|
|
34521
34576
|
|
|
34522
34577
|
|
|
34523
|
-
var eventsource = __webpack_require__(/*! eventsource */ "
|
|
34578
|
+
var eventsource = __webpack_require__(/*! eventsource */ "./src/shims/eventsource.js");
|
|
34524
34579
|
var network = __webpack_require__(/*! ../errors/network.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/errors/network.js");
|
|
34525
34580
|
var not_found = __webpack_require__(/*! ../errors/not_found.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/errors/not_found.js");
|
|
34526
34581
|
var bad_request = __webpack_require__(/*! ../errors/bad_request.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/errors/bad_request.js");
|