@stellar/stellar-sdk 14.1.1 → 14.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/CHANGELOG.md +23 -0
- package/README.md +14 -20
- package/dist/stellar-sdk-minimal.js +532 -375
- package/dist/stellar-sdk-minimal.min.js +1 -1
- package/dist/stellar-sdk-no-axios.js +532 -375
- package/dist/stellar-sdk-no-axios.min.js +1 -1
- package/dist/stellar-sdk-no-eventsource.js +781 -551
- package/dist/stellar-sdk-no-eventsource.min.js +1 -1
- package/dist/stellar-sdk.js +781 -551
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/contract/client.js +2 -2
- package/lib/contract/spec.js +10 -2
- package/lib/contract/utils.js +7 -7
- package/lib/errors/account_requires_memo.d.ts +0 -1
- package/lib/errors/account_requires_memo.js +0 -4
- package/lib/errors/bad_request.d.ts +0 -1
- package/lib/errors/bad_request.js +2 -8
- package/lib/errors/bad_response.d.ts +0 -1
- package/lib/errors/bad_response.js +2 -8
- package/lib/errors/network.d.ts +0 -1
- package/lib/errors/network.js +0 -3
- package/lib/errors/not_found.d.ts +0 -1
- package/lib/errors/not_found.js +2 -8
- package/lib/federation/index.d.ts +2 -2
- package/lib/horizon/call_builder.js +1 -1
- package/lib/horizon/horizon_api.js +0 -1
- package/lib/horizon/horizon_axios_client.js +4 -4
- package/lib/horizon/index.d.ts +1 -1
- package/lib/horizon/types/effects.d.ts +41 -41
- package/lib/horizon/types/trade.d.ts +1 -1
- package/lib/http-client/fetch-client.d.ts +2 -2
- package/lib/http-client/fetch-client.js +16 -16
- package/lib/http-client/index.js +2 -2
- package/lib/http-client/types.d.ts +2 -2
- package/lib/index.d.ts +11 -11
- package/lib/index.js +2 -2
- package/lib/minimal/contract/client.js +2 -2
- package/lib/minimal/contract/spec.js +10 -2
- package/lib/minimal/contract/utils.js +7 -7
- package/lib/minimal/errors/account_requires_memo.d.ts +0 -1
- package/lib/minimal/errors/account_requires_memo.js +0 -4
- package/lib/minimal/errors/bad_request.d.ts +0 -1
- package/lib/minimal/errors/bad_request.js +2 -8
- package/lib/minimal/errors/bad_response.d.ts +0 -1
- package/lib/minimal/errors/bad_response.js +2 -8
- package/lib/minimal/errors/network.d.ts +0 -1
- package/lib/minimal/errors/network.js +0 -3
- package/lib/minimal/errors/not_found.d.ts +0 -1
- package/lib/minimal/errors/not_found.js +2 -8
- package/lib/minimal/federation/index.d.ts +2 -2
- package/lib/minimal/horizon/call_builder.js +1 -1
- package/lib/minimal/horizon/horizon_api.js +0 -1
- package/lib/minimal/horizon/horizon_axios_client.js +4 -4
- package/lib/minimal/horizon/index.d.ts +1 -1
- package/lib/minimal/horizon/types/effects.d.ts +41 -41
- package/lib/minimal/horizon/types/trade.d.ts +1 -1
- package/lib/minimal/http-client/fetch-client.d.ts +2 -2
- package/lib/minimal/http-client/fetch-client.js +16 -16
- package/lib/minimal/http-client/index.js +2 -2
- package/lib/minimal/http-client/types.d.ts +2 -2
- package/lib/minimal/index.d.ts +11 -11
- package/lib/minimal/index.js +2 -2
- package/lib/minimal/rpc/api.d.ts +148 -8
- package/lib/minimal/rpc/api.js +3 -3
- package/lib/minimal/rpc/axios.js +3 -3
- package/lib/minimal/rpc/browser.d.ts +2 -2
- package/lib/minimal/rpc/index.d.ts +1 -1
- package/lib/minimal/rpc/parsers.d.ts +3 -2
- package/lib/minimal/rpc/parsers.js +42 -19
- package/lib/minimal/rpc/server.d.ts +123 -31
- package/lib/minimal/rpc/server.js +425 -267
- package/lib/minimal/rpc/transaction.d.ts +2 -2
- package/lib/minimal/rpc/transaction.js +6 -6
- package/lib/minimal/webauth/errors.d.ts +0 -2
- package/lib/minimal/webauth/errors.js +2 -8
- package/lib/minimal/webauth/index.d.ts +2 -2
- package/lib/no-axios/contract/client.js +2 -2
- package/lib/no-axios/contract/spec.js +10 -2
- package/lib/no-axios/contract/utils.js +7 -7
- package/lib/no-axios/errors/account_requires_memo.d.ts +0 -1
- package/lib/no-axios/errors/account_requires_memo.js +0 -4
- package/lib/no-axios/errors/bad_request.d.ts +0 -1
- package/lib/no-axios/errors/bad_request.js +2 -8
- package/lib/no-axios/errors/bad_response.d.ts +0 -1
- package/lib/no-axios/errors/bad_response.js +2 -8
- package/lib/no-axios/errors/network.d.ts +0 -1
- package/lib/no-axios/errors/network.js +0 -3
- package/lib/no-axios/errors/not_found.d.ts +0 -1
- package/lib/no-axios/errors/not_found.js +2 -8
- package/lib/no-axios/federation/index.d.ts +2 -2
- package/lib/no-axios/horizon/call_builder.js +1 -1
- package/lib/no-axios/horizon/horizon_api.js +0 -1
- package/lib/no-axios/horizon/horizon_axios_client.js +4 -4
- package/lib/no-axios/horizon/index.d.ts +1 -1
- package/lib/no-axios/horizon/types/effects.d.ts +41 -41
- package/lib/no-axios/horizon/types/trade.d.ts +1 -1
- package/lib/no-axios/http-client/fetch-client.d.ts +2 -2
- package/lib/no-axios/http-client/fetch-client.js +16 -16
- package/lib/no-axios/http-client/index.js +2 -2
- package/lib/no-axios/http-client/types.d.ts +2 -2
- package/lib/no-axios/index.d.ts +11 -11
- package/lib/no-axios/index.js +2 -2
- package/lib/no-axios/rpc/api.d.ts +148 -8
- package/lib/no-axios/rpc/api.js +3 -3
- package/lib/no-axios/rpc/axios.js +3 -3
- package/lib/no-axios/rpc/browser.d.ts +2 -2
- package/lib/no-axios/rpc/index.d.ts +1 -1
- package/lib/no-axios/rpc/parsers.d.ts +3 -2
- package/lib/no-axios/rpc/parsers.js +42 -19
- package/lib/no-axios/rpc/server.d.ts +123 -31
- package/lib/no-axios/rpc/server.js +425 -267
- package/lib/no-axios/rpc/transaction.d.ts +2 -2
- package/lib/no-axios/rpc/transaction.js +6 -6
- package/lib/no-axios/webauth/errors.d.ts +0 -2
- package/lib/no-axios/webauth/errors.js +2 -8
- package/lib/no-axios/webauth/index.d.ts +2 -2
- package/lib/no-eventsource/contract/client.js +2 -2
- package/lib/no-eventsource/contract/spec.js +10 -2
- package/lib/no-eventsource/contract/utils.js +7 -7
- package/lib/no-eventsource/errors/account_requires_memo.d.ts +0 -1
- package/lib/no-eventsource/errors/account_requires_memo.js +0 -4
- package/lib/no-eventsource/errors/bad_request.d.ts +0 -1
- package/lib/no-eventsource/errors/bad_request.js +2 -8
- package/lib/no-eventsource/errors/bad_response.d.ts +0 -1
- package/lib/no-eventsource/errors/bad_response.js +2 -8
- package/lib/no-eventsource/errors/network.d.ts +0 -1
- package/lib/no-eventsource/errors/network.js +0 -3
- package/lib/no-eventsource/errors/not_found.d.ts +0 -1
- package/lib/no-eventsource/errors/not_found.js +2 -8
- package/lib/no-eventsource/federation/index.d.ts +2 -2
- package/lib/no-eventsource/horizon/call_builder.js +1 -1
- package/lib/no-eventsource/horizon/horizon_api.js +0 -1
- package/lib/no-eventsource/horizon/horizon_axios_client.js +4 -4
- package/lib/no-eventsource/horizon/index.d.ts +1 -1
- package/lib/no-eventsource/horizon/types/effects.d.ts +41 -41
- package/lib/no-eventsource/horizon/types/trade.d.ts +1 -1
- package/lib/no-eventsource/http-client/fetch-client.d.ts +2 -2
- package/lib/no-eventsource/http-client/fetch-client.js +16 -16
- package/lib/no-eventsource/http-client/index.js +2 -2
- package/lib/no-eventsource/http-client/types.d.ts +2 -2
- package/lib/no-eventsource/index.d.ts +11 -11
- package/lib/no-eventsource/index.js +2 -2
- package/lib/no-eventsource/rpc/api.d.ts +148 -8
- package/lib/no-eventsource/rpc/api.js +3 -3
- package/lib/no-eventsource/rpc/axios.js +3 -3
- package/lib/no-eventsource/rpc/browser.d.ts +2 -2
- package/lib/no-eventsource/rpc/index.d.ts +1 -1
- package/lib/no-eventsource/rpc/parsers.d.ts +3 -2
- package/lib/no-eventsource/rpc/parsers.js +42 -19
- package/lib/no-eventsource/rpc/server.d.ts +123 -31
- package/lib/no-eventsource/rpc/server.js +425 -267
- package/lib/no-eventsource/rpc/transaction.d.ts +2 -2
- package/lib/no-eventsource/rpc/transaction.js +6 -6
- package/lib/no-eventsource/webauth/errors.d.ts +0 -2
- package/lib/no-eventsource/webauth/errors.js +2 -8
- package/lib/no-eventsource/webauth/index.d.ts +2 -2
- package/lib/rpc/api.d.ts +148 -8
- package/lib/rpc/api.js +3 -3
- package/lib/rpc/axios.js +3 -3
- package/lib/rpc/browser.d.ts +2 -2
- package/lib/rpc/index.d.ts +1 -1
- package/lib/rpc/parsers.d.ts +3 -2
- package/lib/rpc/parsers.js +42 -19
- package/lib/rpc/server.d.ts +123 -31
- package/lib/rpc/server.js +425 -267
- package/lib/rpc/transaction.d.ts +2 -2
- package/lib/rpc/transaction.js +6 -6
- package/lib/webauth/errors.d.ts +0 -2
- package/lib/webauth/errors.js +2 -8
- package/lib/webauth/index.d.ts +2 -2
- package/package.json +17 -9
|
@@ -52,7 +52,7 @@ var InterceptorManager = function () {
|
|
|
52
52
|
function getFormConfig(config) {
|
|
53
53
|
var formConfig = config || {};
|
|
54
54
|
formConfig.headers = new Headers(formConfig.headers || {});
|
|
55
|
-
formConfig.headers.set(
|
|
55
|
+
formConfig.headers.set("Content-Type", "application/x-www-form-urlencoded");
|
|
56
56
|
return formConfig;
|
|
57
57
|
}
|
|
58
58
|
function createFetchClient() {
|
|
@@ -84,7 +84,7 @@ function createFetchClient() {
|
|
|
84
84
|
if (config.cancelToken) {
|
|
85
85
|
config.cancelToken.promise.then(function () {
|
|
86
86
|
abortController.abort();
|
|
87
|
-
reject(new Error(
|
|
87
|
+
reject(new Error("Request canceled"));
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
var modifiedConfig = config;
|
|
@@ -108,7 +108,7 @@ function createFetchClient() {
|
|
|
108
108
|
}
|
|
109
109
|
var adapter = modifiedConfig.adapter || _this.defaults.adapter;
|
|
110
110
|
if (!adapter) {
|
|
111
|
-
throw new Error(
|
|
111
|
+
throw new Error("No adapter available");
|
|
112
112
|
}
|
|
113
113
|
var responsePromise = adapter(modifiedConfig).then(function (axiosResponse) {
|
|
114
114
|
var httpClientResponse = {
|
|
@@ -129,13 +129,13 @@ function createFetchClient() {
|
|
|
129
129
|
var _loop = function _loop(_i) {
|
|
130
130
|
responsePromise = responsePromise.then(function (response) {
|
|
131
131
|
var fulfilledInterceptor = _chain[_i];
|
|
132
|
-
if (typeof fulfilledInterceptor ===
|
|
132
|
+
if (typeof fulfilledInterceptor === "function") {
|
|
133
133
|
return fulfilledInterceptor(response);
|
|
134
134
|
}
|
|
135
135
|
return response;
|
|
136
136
|
}, function (error) {
|
|
137
137
|
var rejectedInterceptor = _chain[_i + 1];
|
|
138
|
-
if (typeof rejectedInterceptor ===
|
|
138
|
+
if (typeof rejectedInterceptor === "function") {
|
|
139
139
|
return rejectedInterceptor(error);
|
|
140
140
|
}
|
|
141
141
|
throw error;
|
|
@@ -153,45 +153,45 @@ function createFetchClient() {
|
|
|
153
153
|
get: function get(url, config) {
|
|
154
154
|
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
|
|
155
155
|
url: url,
|
|
156
|
-
method:
|
|
156
|
+
method: "get"
|
|
157
157
|
}));
|
|
158
158
|
},
|
|
159
159
|
delete: function _delete(url, config) {
|
|
160
160
|
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
|
|
161
161
|
url: url,
|
|
162
|
-
method:
|
|
162
|
+
method: "delete"
|
|
163
163
|
}));
|
|
164
164
|
},
|
|
165
165
|
head: function head(url, config) {
|
|
166
166
|
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
|
|
167
167
|
url: url,
|
|
168
|
-
method:
|
|
168
|
+
method: "head"
|
|
169
169
|
}));
|
|
170
170
|
},
|
|
171
171
|
options: function options(url, config) {
|
|
172
172
|
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
|
|
173
173
|
url: url,
|
|
174
|
-
method:
|
|
174
|
+
method: "options"
|
|
175
175
|
}));
|
|
176
176
|
},
|
|
177
177
|
post: function post(url, data, config) {
|
|
178
178
|
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
|
|
179
179
|
url: url,
|
|
180
|
-
method:
|
|
180
|
+
method: "post",
|
|
181
181
|
data: data
|
|
182
182
|
}));
|
|
183
183
|
},
|
|
184
184
|
put: function put(url, data, config) {
|
|
185
185
|
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
|
|
186
186
|
url: url,
|
|
187
|
-
method:
|
|
187
|
+
method: "put",
|
|
188
188
|
data: data
|
|
189
189
|
}));
|
|
190
190
|
},
|
|
191
191
|
patch: function patch(url, data, config) {
|
|
192
192
|
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
|
|
193
193
|
url: url,
|
|
194
|
-
method:
|
|
194
|
+
method: "patch",
|
|
195
195
|
data: data
|
|
196
196
|
}));
|
|
197
197
|
},
|
|
@@ -199,7 +199,7 @@ function createFetchClient() {
|
|
|
199
199
|
var formConfig = getFormConfig(config);
|
|
200
200
|
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), formConfig), {}, {
|
|
201
201
|
url: url,
|
|
202
|
-
method:
|
|
202
|
+
method: "post",
|
|
203
203
|
data: data
|
|
204
204
|
}));
|
|
205
205
|
},
|
|
@@ -207,7 +207,7 @@ function createFetchClient() {
|
|
|
207
207
|
var formConfig = getFormConfig(config);
|
|
208
208
|
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), formConfig), {}, {
|
|
209
209
|
url: url,
|
|
210
|
-
method:
|
|
210
|
+
method: "put",
|
|
211
211
|
data: data
|
|
212
212
|
}));
|
|
213
213
|
},
|
|
@@ -215,13 +215,13 @@ function createFetchClient() {
|
|
|
215
215
|
var formConfig = getFormConfig(config);
|
|
216
216
|
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), formConfig), {}, {
|
|
217
217
|
url: url,
|
|
218
|
-
method:
|
|
218
|
+
method: "patch",
|
|
219
219
|
data: data
|
|
220
220
|
}));
|
|
221
221
|
},
|
|
222
222
|
CancelToken: _types.CancelToken,
|
|
223
223
|
isCancel: function isCancel(value) {
|
|
224
|
-
return value instanceof Error && value.message ===
|
|
224
|
+
return value instanceof Error && value.message === "Request canceled";
|
|
225
225
|
}
|
|
226
226
|
};
|
|
227
227
|
return httpClient;
|
package/lib/http-client/index.js
CHANGED
|
@@ -23,11 +23,11 @@ Object.keys(_types).forEach(function (key) {
|
|
|
23
23
|
var httpClient;
|
|
24
24
|
var create;
|
|
25
25
|
if (true) {
|
|
26
|
-
var axiosModule = require(
|
|
26
|
+
var axiosModule = require("./axios-client");
|
|
27
27
|
exports.httpClient = httpClient = axiosModule.axiosClient;
|
|
28
28
|
exports.create = create = axiosModule.create;
|
|
29
29
|
} else {
|
|
30
|
-
var fetchModule = require(
|
|
30
|
+
var fetchModule = require("./fetch-client");
|
|
31
31
|
exports.httpClient = httpClient = fetchModule.fetchClient;
|
|
32
32
|
exports.create = create = fetchModule.create;
|
|
33
33
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type HttpResponseHeaders = Record<string, string | boolean | undefined> & {
|
|
2
|
-
|
|
2
|
+
"set-cookie"?: string[];
|
|
3
3
|
};
|
|
4
|
-
export interface HttpClientDefaults extends Omit<HttpClientRequestConfig,
|
|
4
|
+
export interface HttpClientDefaults extends Omit<HttpClientRequestConfig, "headers"> {
|
|
5
5
|
headers?: [string, string][] | Record<string, string> | Headers | undefined;
|
|
6
6
|
}
|
|
7
7
|
export interface HttpClientResponse<T = any> {
|
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export { Config } from
|
|
3
|
-
export { Utils } from
|
|
4
|
-
export * as StellarToml from
|
|
5
|
-
export * as Federation from
|
|
6
|
-
export * as WebAuth from
|
|
7
|
-
export * as Friendbot from
|
|
8
|
-
export * as Horizon from
|
|
1
|
+
export * from "./errors";
|
|
2
|
+
export { Config } from "./config";
|
|
3
|
+
export { Utils } from "./utils";
|
|
4
|
+
export * as StellarToml from "./stellartoml";
|
|
5
|
+
export * as Federation from "./federation";
|
|
6
|
+
export * as WebAuth from "./webauth";
|
|
7
|
+
export * as Friendbot from "./friendbot";
|
|
8
|
+
export * as Horizon from "./horizon";
|
|
9
9
|
/**
|
|
10
10
|
* Tools for interacting with the Soroban RPC server, such as `Server`,
|
|
11
11
|
* `assembleTransaction`, and the `Api` types. You can import these from the
|
|
@@ -15,7 +15,7 @@ export * as Horizon from './horizon';
|
|
|
15
15
|
* @example
|
|
16
16
|
* import { Server } from '@stellar/stellar-sdk/rpc';
|
|
17
17
|
*/
|
|
18
|
-
export * as rpc from
|
|
18
|
+
export * as rpc from "./rpc";
|
|
19
19
|
/**
|
|
20
20
|
* Tools for interacting with smart contracts, such as `Client`, `Spec`, and
|
|
21
21
|
* `AssembledTransaction`. You can import these from the `/contract`
|
|
@@ -26,7 +26,7 @@ export * as rpc from './rpc';
|
|
|
26
26
|
* import { Client } from '@stellar/stellar-sdk/contract';
|
|
27
27
|
* @private
|
|
28
28
|
*/
|
|
29
|
-
export * as contract from
|
|
30
|
-
export * from
|
|
29
|
+
export * as contract from "./contract";
|
|
30
|
+
export * from "@stellar/stellar-base";
|
|
31
31
|
declare const _default: any;
|
|
32
32
|
export default _default;
|
package/lib/index.js
CHANGED
|
@@ -71,9 +71,9 @@ Object.keys(_stellarBase).forEach(function (key) {
|
|
|
71
71
|
});
|
|
72
72
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
73
73
|
var _default = exports.default = module.exports;
|
|
74
|
-
if (typeof global.__USE_AXIOS__ ===
|
|
74
|
+
if (typeof global.__USE_AXIOS__ === "undefined") {
|
|
75
75
|
global.__USE_AXIOS__ = true;
|
|
76
76
|
}
|
|
77
|
-
if (typeof global.__USE_EVENTSOURCE__ ===
|
|
77
|
+
if (typeof global.__USE_EVENTSOURCE__ === "undefined") {
|
|
78
78
|
global.__USE_EVENTSOURCE__ = false;
|
|
79
79
|
}
|
|
@@ -167,7 +167,7 @@ var Client = exports.Client = function () {
|
|
|
167
167
|
_context2.n = 1;
|
|
168
168
|
break;
|
|
169
169
|
}
|
|
170
|
-
throw new TypeError(
|
|
170
|
+
throw new TypeError("options must contain rpcUrl");
|
|
171
171
|
case 1:
|
|
172
172
|
rpcUrl = options.rpcUrl, allowHttp = options.allowHttp;
|
|
173
173
|
serverOpts = {
|
|
@@ -220,7 +220,7 @@ var Client = exports.Client = function () {
|
|
|
220
220
|
_context4.n = 1;
|
|
221
221
|
break;
|
|
222
222
|
}
|
|
223
|
-
throw new TypeError(
|
|
223
|
+
throw new TypeError("options must contain rpcUrl and contractId");
|
|
224
224
|
case 1:
|
|
225
225
|
rpcUrl = options.rpcUrl, contractId = options.contractId, allowHttp = options.allowHttp;
|
|
226
226
|
serverOpts = {
|
|
@@ -559,7 +559,7 @@ var Spec = exports.Spec = function () {
|
|
|
559
559
|
}
|
|
560
560
|
if (value === _stellarBase.xdr.ScSpecType.scSpecTypeOption().value) {
|
|
561
561
|
var opt = ty.option();
|
|
562
|
-
if (val === undefined) {
|
|
562
|
+
if (val === null || val === undefined) {
|
|
563
563
|
return _stellarBase.xdr.ScVal.scvVoid();
|
|
564
564
|
}
|
|
565
565
|
return this.nativeToScVal(val, opt.valueType());
|
|
@@ -823,12 +823,20 @@ var Spec = exports.Spec = function () {
|
|
|
823
823
|
var _this5 = this;
|
|
824
824
|
var t = typeDef.switch();
|
|
825
825
|
var value = t.value;
|
|
826
|
+
if (value === _stellarBase.xdr.ScSpecType.scSpecTypeOption().value) {
|
|
827
|
+
switch (scv.switch().value) {
|
|
828
|
+
case _stellarBase.xdr.ScValType.scvVoid().value:
|
|
829
|
+
return null;
|
|
830
|
+
default:
|
|
831
|
+
return this.scValToNative(scv, typeDef.option().valueType());
|
|
832
|
+
}
|
|
833
|
+
}
|
|
826
834
|
if (value === _stellarBase.xdr.ScSpecType.scSpecTypeUdt().value) {
|
|
827
835
|
return this.scValUdtToNative(scv, typeDef.udt());
|
|
828
836
|
}
|
|
829
837
|
switch (scv.switch().value) {
|
|
830
838
|
case _stellarBase.xdr.ScValType.scvVoid().value:
|
|
831
|
-
return
|
|
839
|
+
return null;
|
|
832
840
|
case _stellarBase.xdr.ScValType.scvU64().value:
|
|
833
841
|
case _stellarBase.xdr.ScValType.scvI64().value:
|
|
834
842
|
case _stellarBase.xdr.ScValType.scvU128().value:
|
|
@@ -122,7 +122,7 @@ function _specFromWasm() {
|
|
|
122
122
|
_context2.p = 2;
|
|
123
123
|
_t3 = _context2.v;
|
|
124
124
|
customData = parseWasmCustomSections(wasm);
|
|
125
|
-
xdrSections = customData.get(
|
|
125
|
+
xdrSections = customData.get("contractspecv0");
|
|
126
126
|
case 3:
|
|
127
127
|
if (!(!xdrSections || xdrSections.length === 0)) {
|
|
128
128
|
_context2.n = 4;
|
|
@@ -141,13 +141,13 @@ function parseWasmCustomSections(buffer) {
|
|
|
141
141
|
var arrayBuffer = buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
|
|
142
142
|
var offset = 0;
|
|
143
143
|
var read = function read(length) {
|
|
144
|
-
if (offset + length > buffer.byteLength) throw new Error(
|
|
144
|
+
if (offset + length > buffer.byteLength) throw new Error("Buffer overflow");
|
|
145
145
|
var bytes = new Uint8Array(arrayBuffer, offset, length);
|
|
146
146
|
offset += length;
|
|
147
147
|
return bytes;
|
|
148
148
|
};
|
|
149
|
-
if (_toConsumableArray(read(4)).join() !==
|
|
150
|
-
if (_toConsumableArray(read(4)).join() !==
|
|
149
|
+
if (_toConsumableArray(read(4)).join() !== "0,97,115,109") throw new Error("Invalid WASM magic");
|
|
150
|
+
if (_toConsumableArray(read(4)).join() !== "1,0,0,0") throw new Error("Invalid WASM version");
|
|
151
151
|
while (offset < buffer.byteLength) {
|
|
152
152
|
var sectionId = read(1)[0];
|
|
153
153
|
var sectionLength = readVarUint32();
|
|
@@ -158,7 +158,7 @@ function parseWasmCustomSections(buffer) {
|
|
|
158
158
|
var nameBytes = read(nameLen);
|
|
159
159
|
var payload = read(sectionLength - (offset - start));
|
|
160
160
|
try {
|
|
161
|
-
var name = new TextDecoder(
|
|
161
|
+
var name = new TextDecoder("utf-8", {
|
|
162
162
|
fatal: true
|
|
163
163
|
}).decode(nameBytes);
|
|
164
164
|
if (payload.length > 0) {
|
|
@@ -174,9 +174,9 @@ function parseWasmCustomSections(buffer) {
|
|
|
174
174
|
shift = 0;
|
|
175
175
|
while (true) {
|
|
176
176
|
var byte = read(1)[0];
|
|
177
|
-
value |= (byte &
|
|
177
|
+
value |= (byte & 0x7f) << shift;
|
|
178
178
|
if ((byte & 0x80) === 0) break;
|
|
179
|
-
if ((shift += 7) >= 32) throw new Error(
|
|
179
|
+
if ((shift += 7) >= 32) throw new Error("Invalid WASM value");
|
|
180
180
|
}
|
|
181
181
|
return value >>> 0;
|
|
182
182
|
}
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
* console.log('The account is used in operation: ', err.operationIndex)
|
|
18
18
|
*/
|
|
19
19
|
export declare class AccountRequiresMemoError extends Error {
|
|
20
|
-
__proto__: AccountRequiresMemoError;
|
|
21
20
|
accountId: string;
|
|
22
21
|
operationIndex: number;
|
|
23
22
|
constructor(message: string, accountId: string, operationIndex: number);
|
|
@@ -24,11 +24,7 @@ var AccountRequiresMemoError = exports.AccountRequiresMemoError = function (_Err
|
|
|
24
24
|
function AccountRequiresMemoError(message, accountId, operationIndex) {
|
|
25
25
|
var _this;
|
|
26
26
|
_classCallCheck(this, AccountRequiresMemoError);
|
|
27
|
-
var trueProto = (this instanceof AccountRequiresMemoError ? this.constructor : void 0).prototype;
|
|
28
27
|
_this = _callSuper(this, AccountRequiresMemoError, [message]);
|
|
29
|
-
_this.__proto__ = trueProto;
|
|
30
|
-
_this.constructor = AccountRequiresMemoError;
|
|
31
|
-
_this.name = "AccountRequiresMemoError";
|
|
32
28
|
_this.accountId = accountId;
|
|
33
29
|
_this.operationIndex = operationIndex;
|
|
34
30
|
return _this;
|
|
@@ -19,15 +19,9 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
19
19
|
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); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
21
|
var BadRequestError = exports.BadRequestError = function (_NetworkError) {
|
|
22
|
-
function BadRequestError(
|
|
23
|
-
var _this;
|
|
22
|
+
function BadRequestError() {
|
|
24
23
|
_classCallCheck(this, BadRequestError);
|
|
25
|
-
|
|
26
|
-
_this = _callSuper(this, BadRequestError, [message, response]);
|
|
27
|
-
_this.__proto__ = trueProto;
|
|
28
|
-
_this.constructor = BadRequestError;
|
|
29
|
-
_this.name = "BadRequestError";
|
|
30
|
-
return _this;
|
|
24
|
+
return _callSuper(this, BadRequestError, arguments);
|
|
31
25
|
}
|
|
32
26
|
_inherits(BadRequestError, _NetworkError);
|
|
33
27
|
return _createClass(BadRequestError);
|
|
@@ -19,15 +19,9 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
19
19
|
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); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
21
|
var BadResponseError = exports.BadResponseError = function (_NetworkError) {
|
|
22
|
-
function BadResponseError(
|
|
23
|
-
var _this;
|
|
22
|
+
function BadResponseError() {
|
|
24
23
|
_classCallCheck(this, BadResponseError);
|
|
25
|
-
|
|
26
|
-
_this = _callSuper(this, BadResponseError, [message, response]);
|
|
27
|
-
_this.__proto__ = trueProto;
|
|
28
|
-
_this.constructor = BadResponseError;
|
|
29
|
-
_this.name = "BadResponseError";
|
|
30
|
-
return _this;
|
|
24
|
+
return _callSuper(this, BadResponseError, arguments);
|
|
31
25
|
}
|
|
32
26
|
_inherits(BadResponseError, _NetworkError);
|
|
33
27
|
return _createClass(BadResponseError);
|
|
@@ -24,10 +24,7 @@ var NetworkError = exports.NetworkError = function (_Error) {
|
|
|
24
24
|
function NetworkError(message, response) {
|
|
25
25
|
var _this;
|
|
26
26
|
_classCallCheck(this, NetworkError);
|
|
27
|
-
var trueProto = (this instanceof NetworkError ? this.constructor : void 0).prototype;
|
|
28
27
|
_this = _callSuper(this, NetworkError, [message]);
|
|
29
|
-
_this.__proto__ = trueProto;
|
|
30
|
-
_this.constructor = NetworkError;
|
|
31
28
|
_this.response = response;
|
|
32
29
|
return _this;
|
|
33
30
|
}
|
|
@@ -19,15 +19,9 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
19
19
|
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); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
21
|
var NotFoundError = exports.NotFoundError = function (_NetworkError) {
|
|
22
|
-
function NotFoundError(
|
|
23
|
-
var _this;
|
|
22
|
+
function NotFoundError() {
|
|
24
23
|
_classCallCheck(this, NotFoundError);
|
|
25
|
-
|
|
26
|
-
_this = _callSuper(this, NotFoundError, [message, response]);
|
|
27
|
-
_this.__proto__ = trueProto;
|
|
28
|
-
_this.constructor = NotFoundError;
|
|
29
|
-
_this.name = "NotFoundError";
|
|
30
|
-
return _this;
|
|
24
|
+
return _callSuper(this, NotFoundError, arguments);
|
|
31
25
|
}
|
|
32
26
|
_inherits(NotFoundError, _NetworkError);
|
|
33
27
|
return _createClass(NotFoundError);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { FederationServer as Server, FEDERATION_RESPONSE_MAX_SIZE } from
|
|
2
|
-
export * from
|
|
1
|
+
export { FederationServer as Server, FEDERATION_RESPONSE_MAX_SIZE, } from "./server";
|
|
2
|
+
export * from "./api";
|
|
@@ -22,7 +22,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
22
22
|
var JOINABLE = ["transaction"];
|
|
23
23
|
var anyGlobal = global;
|
|
24
24
|
var EventSource;
|
|
25
|
-
if (typeof false !==
|
|
25
|
+
if (typeof false !== "undefined" && false) {
|
|
26
26
|
var _ref, _anyGlobal$EventSourc, _anyGlobal$window;
|
|
27
27
|
EventSource = (_ref = (_anyGlobal$EventSourc = anyGlobal.EventSource) !== null && _anyGlobal$EventSourc !== void 0 ? _anyGlobal$EventSourc : (_anyGlobal$window = anyGlobal.window) === null || _anyGlobal$window === void 0 ? void 0 : _anyGlobal$window.EventSource) !== null && _ref !== void 0 ? _ref : require("eventsource");
|
|
28
28
|
}
|
|
@@ -73,7 +73,6 @@ var HorizonApi;
|
|
|
73
73
|
return OperationResponseTypeI;
|
|
74
74
|
}({});
|
|
75
75
|
_HorizonApi.OperationResponseTypeI = OperationResponseTypeI;
|
|
76
|
-
;
|
|
77
76
|
var TransactionFailedResultCodes = function (TransactionFailedResultCodes) {
|
|
78
77
|
TransactionFailedResultCodes["TX_FAILED"] = "tx_failed";
|
|
79
78
|
TransactionFailedResultCodes["TX_BAD_SEQ"] = "tx_bad_seq";
|
|
@@ -10,7 +10,7 @@ var _urijs = _interopRequireDefault(require("urijs"));
|
|
|
10
10
|
var _httpClient = require("../http-client");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
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); }
|
|
13
|
-
var version = exports.version = "14.
|
|
13
|
+
var version = exports.version = "14.3.0";
|
|
14
14
|
var SERVER_TIME_MAP = exports.SERVER_TIME_MAP = {};
|
|
15
15
|
var AxiosClient = exports.AxiosClient = (0, _httpClient.create)({
|
|
16
16
|
headers: {
|
|
@@ -25,13 +25,13 @@ AxiosClient.interceptors.response.use(function (response) {
|
|
|
25
25
|
var hostname = (0, _urijs.default)(response.config.url).hostname();
|
|
26
26
|
var serverTime = 0;
|
|
27
27
|
if (response.headers instanceof Headers) {
|
|
28
|
-
var dateHeader = response.headers.get(
|
|
28
|
+
var dateHeader = response.headers.get("date");
|
|
29
29
|
if (dateHeader) {
|
|
30
30
|
serverTime = toSeconds(Date.parse(dateHeader));
|
|
31
31
|
}
|
|
32
|
-
} else if (_typeof(response.headers) ===
|
|
32
|
+
} else if (_typeof(response.headers) === "object" && "date" in response.headers) {
|
|
33
33
|
var headers = response.headers;
|
|
34
|
-
if (typeof headers.date ===
|
|
34
|
+
if (typeof headers.date === "string") {
|
|
35
35
|
serverTime = toSeconds(Date.parse(headers.date));
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -3,6 +3,6 @@ export * from "./horizon_api";
|
|
|
3
3
|
export * from "./server_api";
|
|
4
4
|
export * from "./account_response";
|
|
5
5
|
export { HorizonServer as Server } from "./server";
|
|
6
|
-
export { default as AxiosClient, SERVER_TIME_MAP, getCurrentServerTime } from "./horizon_axios_client";
|
|
6
|
+
export { default as AxiosClient, SERVER_TIME_MAP, getCurrentServerTime, } from "./horizon_axios_client";
|
|
7
7
|
declare const _default: any;
|
|
8
8
|
export default _default;
|