@0xsequence/api 3.0.0-beta.8 → 3.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/dist/api.gen.js CHANGED
@@ -1,75 +1,70 @@
1
- "use strict";
2
1
  /* eslint-disable */
3
- // sequence-api v0.4.0 d7026da603b2c29baf21c6aceeebc86eada372d8
2
+ // sequence-api v0.4.0 3c15fa79614e43a5321cd2ac0c080e80af291bd1
4
3
  // --
5
4
  // Code generated by Webrpc-gen@v0.31.0 with typescript generator. DO NOT EDIT.
6
5
  //
7
6
  // webrpc-gen -schema=api.ridl -target=typescript -client -out=./clients/api.gen.ts
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.QueryFailedError = exports.UnavailableError = exports.InvalidArgumentError = exports.TimeoutError = exports.AtLeastOneKeyError = exports.MaxAccessKeysError = exports.NoDefaultKeyError = exports.QuotaRateLimitError = exports.QuotaExceededError = exports.UnauthorizedUserError = exports.InvalidServiceError = exports.InvalidOriginError = exports.AccessKeyMismatchError = exports.AccessKeyNotFoundError = exports.ProjectNotFoundError = exports.RateLimitedError = exports.GeoblockedError = exports.AbortedError = exports.RequestConflictError = exports.MethodNotFoundError = exports.SessionExpiredError = exports.PermissionDeniedError = exports.UnauthorizedError = exports.WebrpcStreamFinishedError = exports.WebrpcStreamLostError = exports.WebrpcClientAbortedError = exports.WebrpcInternalErrorError = exports.WebrpcServerPanicError = exports.WebrpcBadResponseError = exports.WebrpcBadRequestError = exports.WebrpcBadMethodError = exports.WebrpcBadRouteError = exports.WebrpcRequestFailedError = exports.WebrpcEndpointError = exports.WebrpcError = exports.JsonDecode = exports.JsonEncode = exports.API = exports.CheckoutOptionSwapProvider = exports.CheckoutOptionOnRampProvider = exports.CheckoutOptionNFTCheckoutProvider = exports.CheckoutOptionCrypto = exports.TradeType = exports.TransakBuySell = exports.TokenType = exports.GetLifiSwapRouteDirection = exports.SortOrder = exports.WebrpcSchemaHash = exports.WebrpcSchemaVersion = exports.WebrpcVersion = void 0;
10
- exports.WebrpcHeaderValue = exports.WebrpcHeader = exports.webrpcErrorByCode = exports.WebrpcErrorCodes = exports.errors = exports.UnsupportedNetworkError = exports.NotFoundError = void 0;
11
- exports.VersionFromHeader = VersionFromHeader;
12
7
  // Webrpc description and code-gen version
13
- exports.WebrpcVersion = 'v1';
8
+ export const WebrpcVersion = 'v1';
14
9
  // Schema version of your RIDL schema
15
- exports.WebrpcSchemaVersion = 'v0.4.0';
10
+ export const WebrpcSchemaVersion = 'v0.4.0';
16
11
  // Schema hash generated from your RIDL schema
17
- exports.WebrpcSchemaHash = 'd7026da603b2c29baf21c6aceeebc86eada372d8';
12
+ export const WebrpcSchemaHash = '3c15fa79614e43a5321cd2ac0c080e80af291bd1';
18
13
  //
19
14
  // Schema types
20
15
  //
21
- var SortOrder;
16
+ export var SortOrder;
22
17
  (function (SortOrder) {
23
18
  SortOrder["DESC"] = "DESC";
24
19
  SortOrder["ASC"] = "ASC";
25
- })(SortOrder || (exports.SortOrder = SortOrder = {}));
26
- var GetLifiSwapRouteDirection;
20
+ })(SortOrder || (SortOrder = {}));
21
+ export var GetLifiSwapRouteDirection;
27
22
  (function (GetLifiSwapRouteDirection) {
28
23
  GetLifiSwapRouteDirection["to"] = "to";
29
24
  GetLifiSwapRouteDirection["from"] = "from";
30
- })(GetLifiSwapRouteDirection || (exports.GetLifiSwapRouteDirection = GetLifiSwapRouteDirection = {}));
31
- var TokenType;
25
+ })(GetLifiSwapRouteDirection || (GetLifiSwapRouteDirection = {}));
26
+ export var TokenType;
32
27
  (function (TokenType) {
33
28
  TokenType["ERC20"] = "ERC20";
34
29
  TokenType["ERC721"] = "ERC721";
35
30
  TokenType["ERC1155"] = "ERC1155";
36
- })(TokenType || (exports.TokenType = TokenType = {}));
37
- var TransakBuySell;
31
+ })(TokenType || (TokenType = {}));
32
+ export var TransakBuySell;
38
33
  (function (TransakBuySell) {
39
34
  TransakBuySell["UNKNOWN"] = "UNKNOWN";
40
35
  TransakBuySell["BUY"] = "BUY";
41
36
  TransakBuySell["SELL"] = "SELL";
42
- })(TransakBuySell || (exports.TransakBuySell = TransakBuySell = {}));
43
- var TradeType;
37
+ })(TransakBuySell || (TransakBuySell = {}));
38
+ export var TradeType;
44
39
  (function (TradeType) {
45
40
  TradeType["EXACT_INPUT"] = "EXACT_INPUT";
46
41
  TradeType["EXACT_OUTPUT"] = "EXACT_OUTPUT";
47
- })(TradeType || (exports.TradeType = TradeType = {}));
48
- var CheckoutOptionCrypto;
42
+ })(TradeType || (TradeType = {}));
43
+ export var CheckoutOptionCrypto;
49
44
  (function (CheckoutOptionCrypto) {
50
45
  CheckoutOptionCrypto["none"] = "none";
51
46
  CheckoutOptionCrypto["partially"] = "partially";
52
47
  CheckoutOptionCrypto["all"] = "all";
53
- })(CheckoutOptionCrypto || (exports.CheckoutOptionCrypto = CheckoutOptionCrypto = {}));
54
- var CheckoutOptionNFTCheckoutProvider;
48
+ })(CheckoutOptionCrypto || (CheckoutOptionCrypto = {}));
49
+ export var CheckoutOptionNFTCheckoutProvider;
55
50
  (function (CheckoutOptionNFTCheckoutProvider) {
56
51
  CheckoutOptionNFTCheckoutProvider["unknown"] = "unknown";
57
52
  CheckoutOptionNFTCheckoutProvider["transak"] = "transak";
58
- })(CheckoutOptionNFTCheckoutProvider || (exports.CheckoutOptionNFTCheckoutProvider = CheckoutOptionNFTCheckoutProvider = {}));
59
- var CheckoutOptionOnRampProvider;
53
+ })(CheckoutOptionNFTCheckoutProvider || (CheckoutOptionNFTCheckoutProvider = {}));
54
+ export var CheckoutOptionOnRampProvider;
60
55
  (function (CheckoutOptionOnRampProvider) {
61
56
  CheckoutOptionOnRampProvider["unknown"] = "unknown";
62
57
  CheckoutOptionOnRampProvider["transak"] = "transak";
63
- })(CheckoutOptionOnRampProvider || (exports.CheckoutOptionOnRampProvider = CheckoutOptionOnRampProvider = {}));
64
- var CheckoutOptionSwapProvider;
58
+ })(CheckoutOptionOnRampProvider || (CheckoutOptionOnRampProvider = {}));
59
+ export var CheckoutOptionSwapProvider;
65
60
  (function (CheckoutOptionSwapProvider) {
66
61
  CheckoutOptionSwapProvider["unknown"] = "unknown";
67
62
  CheckoutOptionSwapProvider["lifi"] = "lifi";
68
- })(CheckoutOptionSwapProvider || (exports.CheckoutOptionSwapProvider = CheckoutOptionSwapProvider = {}));
63
+ })(CheckoutOptionSwapProvider || (CheckoutOptionSwapProvider = {}));
69
64
  //
70
65
  // Client
71
66
  //
72
- class API {
67
+ export class API {
73
68
  hostname;
74
69
  fetch;
75
70
  path = '/rpc/API/';
@@ -138,9 +133,6 @@ class API {
138
133
  getLifiTokens: (req) => ['API', 'getLifiTokens', req],
139
134
  getLifiSwapRoutes: (req) => ['API', 'getLifiSwapRoutes', req],
140
135
  getLifiSwapQuote: (req) => ['API', 'getLifiSwapQuote', req],
141
- getIntentCallsPayloads: (req) => ['API', 'getIntentCallsPayloads', req],
142
- commitIntentConfig: (req) => ['API', 'commitIntentConfig', req],
143
- getIntentConfig: (req) => ['API', 'getIntentConfig', req],
144
136
  listCurrencyGroups: () => ['API', 'listCurrencyGroups'],
145
137
  addOffchainInventory: (req) => ['API', 'addOffchainInventory', req],
146
138
  getOffchainInventory: (req) => ['API', 'getOffchainInventory', req],
@@ -159,961 +151,703 @@ class API {
159
151
  checkoutOptionsSecondary: (req) => ['API', 'checkoutOptionsSecondary', req],
160
152
  checkoutOptionsGetTransakContractID: (req) => ['API', 'checkoutOptionsGetTransakContractID', req],
161
153
  fortePayCreateIntent: (req) => ['API', 'fortePayCreateIntent', req],
162
- fortePayGetPaymentStatuses: (req) => ['API', 'fortePayGetPaymentStatuses', req],
163
- getCCTPTransfer: (req) => ['API', 'getCCTPTransfer', req],
164
- queueCCTPTransfer: (req) => ['API', 'queueCCTPTransfer', req],
165
- queueIntentConfigExecution: (req) => ['API', 'queueIntentConfigExecution', req],
166
- getIntentConfigExecutionStatus: (req) => ['API', 'getIntentConfigExecutionStatus', req],
167
- listIntentConfigs: (req) => ['API', 'listIntentConfigs', req],
168
- queueMetaTxnReceipt: (req) => ['API', 'queueMetaTxnReceipt', req],
154
+ fortePayGetPaymentStatuses: (req) => ['API', 'fortePayGetPaymentStatuses', req]
169
155
  };
170
156
  ping = (headers, signal) => {
171
- return this.fetch(this.url('Ping'), createHttpRequest('{}', headers, signal)).then((res) => {
172
- return buildResponse(res).then((_data) => {
173
- return (0, exports.JsonDecode)(_data, 'PingResponse');
174
- });
175
- }, (error) => {
176
- throw WebrpcRequestFailedError.new({
177
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
157
+ return this.fetch(this.url('Ping'), createHttpRequest('{}', headers, signal)).then(res => {
158
+ return buildResponse(res).then(_data => {
159
+ return JsonDecode(_data, 'PingResponse');
178
160
  });
161
+ }, error => {
162
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
179
163
  });
180
164
  };
181
165
  version = (headers, signal) => {
182
- return this.fetch(this.url('Version'), createHttpRequest('{}', headers, signal)).then((res) => {
183
- return buildResponse(res).then((_data) => {
184
- return (0, exports.JsonDecode)(_data, 'VersionResponse');
185
- });
186
- }, (error) => {
187
- throw WebrpcRequestFailedError.new({
188
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
166
+ return this.fetch(this.url('Version'), createHttpRequest('{}', headers, signal)).then(res => {
167
+ return buildResponse(res).then(_data => {
168
+ return JsonDecode(_data, 'VersionResponse');
189
169
  });
170
+ }, error => {
171
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
190
172
  });
191
173
  };
192
174
  runtimeStatus = (headers, signal) => {
193
- return this.fetch(this.url('RuntimeStatus'), createHttpRequest('{}', headers, signal)).then((res) => {
194
- return buildResponse(res).then((_data) => {
195
- return (0, exports.JsonDecode)(_data, 'RuntimeStatusResponse');
196
- });
197
- }, (error) => {
198
- throw WebrpcRequestFailedError.new({
199
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
175
+ return this.fetch(this.url('RuntimeStatus'), createHttpRequest('{}', headers, signal)).then(res => {
176
+ return buildResponse(res).then(_data => {
177
+ return JsonDecode(_data, 'RuntimeStatusResponse');
200
178
  });
179
+ }, error => {
180
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
201
181
  });
202
182
  };
203
183
  clock = (headers, signal) => {
204
- return this.fetch(this.url('Clock'), createHttpRequest('{}', headers, signal)).then((res) => {
205
- return buildResponse(res).then((_data) => {
206
- return (0, exports.JsonDecode)(_data, 'ClockResponse');
207
- });
208
- }, (error) => {
209
- throw WebrpcRequestFailedError.new({
210
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
184
+ return this.fetch(this.url('Clock'), createHttpRequest('{}', headers, signal)).then(res => {
185
+ return buildResponse(res).then(_data => {
186
+ return JsonDecode(_data, 'ClockResponse');
211
187
  });
188
+ }, error => {
189
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
212
190
  });
213
191
  };
214
192
  getSequenceContext = (headers, signal) => {
215
- return this.fetch(this.url('GetSequenceContext'), createHttpRequest('{}', headers, signal)).then((res) => {
216
- return buildResponse(res).then((_data) => {
217
- return (0, exports.JsonDecode)(_data, 'GetSequenceContextResponse');
218
- });
219
- }, (error) => {
220
- throw WebrpcRequestFailedError.new({
221
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
193
+ return this.fetch(this.url('GetSequenceContext'), createHttpRequest('{}', headers, signal)).then(res => {
194
+ return buildResponse(res).then(_data => {
195
+ return JsonDecode(_data, 'GetSequenceContextResponse');
222
196
  });
197
+ }, error => {
198
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
223
199
  });
224
200
  };
225
201
  getAuthToken = (req, headers, signal) => {
226
- return this.fetch(this.url('GetAuthToken'), createHttpRequest((0, exports.JsonEncode)(req, 'GetAuthTokenRequest'), headers, signal)).then((res) => {
227
- return buildResponse(res).then((_data) => {
228
- return (0, exports.JsonDecode)(_data, 'GetAuthTokenResponse');
229
- });
230
- }, (error) => {
231
- throw WebrpcRequestFailedError.new({
232
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
202
+ return this.fetch(this.url('GetAuthToken'), createHttpRequest(JsonEncode(req, 'GetAuthTokenRequest'), headers, signal)).then(res => {
203
+ return buildResponse(res).then(_data => {
204
+ return JsonDecode(_data, 'GetAuthTokenResponse');
233
205
  });
206
+ }, error => {
207
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
234
208
  });
235
209
  };
236
210
  getAuthToken2 = (req, headers, signal) => {
237
- return this.fetch(this.url('GetAuthToken2'), createHttpRequest((0, exports.JsonEncode)(req, 'GetAuthToken2Request'), headers, signal)).then((res) => {
238
- return buildResponse(res).then((_data) => {
239
- return (0, exports.JsonDecode)(_data, 'GetAuthToken2Response');
240
- });
241
- }, (error) => {
242
- throw WebrpcRequestFailedError.new({
243
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
211
+ return this.fetch(this.url('GetAuthToken2'), createHttpRequest(JsonEncode(req, 'GetAuthToken2Request'), headers, signal)).then(res => {
212
+ return buildResponse(res).then(_data => {
213
+ return JsonDecode(_data, 'GetAuthToken2Response');
244
214
  });
215
+ }, error => {
216
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
245
217
  });
246
218
  };
247
219
  sendPasswordlessLink = (req, headers, signal) => {
248
- return this.fetch(this.url('SendPasswordlessLink'), createHttpRequest((0, exports.JsonEncode)(req, 'SendPasswordlessLinkRequest'), headers, signal)).then((res) => {
249
- return buildResponse(res).then((_data) => {
250
- return (0, exports.JsonDecode)(_data, 'SendPasswordlessLinkResponse');
251
- });
252
- }, (error) => {
253
- throw WebrpcRequestFailedError.new({
254
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
220
+ return this.fetch(this.url('SendPasswordlessLink'), createHttpRequest(JsonEncode(req, 'SendPasswordlessLinkRequest'), headers, signal)).then(res => {
221
+ return buildResponse(res).then(_data => {
222
+ return JsonDecode(_data, 'SendPasswordlessLinkResponse');
255
223
  });
224
+ }, error => {
225
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
256
226
  });
257
227
  };
258
228
  registerPublicKey = (req, headers, signal) => {
259
- return this.fetch(this.url('RegisterPublicKey'), createHttpRequest((0, exports.JsonEncode)(req, 'RegisterPublicKeyRequest'), headers, signal)).then((res) => {
260
- return buildResponse(res).then((_data) => {
261
- return (0, exports.JsonDecode)(_data, 'RegisterPublicKeyResponse');
262
- });
263
- }, (error) => {
264
- throw WebrpcRequestFailedError.new({
265
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
229
+ return this.fetch(this.url('RegisterPublicKey'), createHttpRequest(JsonEncode(req, 'RegisterPublicKeyRequest'), headers, signal)).then(res => {
230
+ return buildResponse(res).then(_data => {
231
+ return JsonDecode(_data, 'RegisterPublicKeyResponse');
266
232
  });
233
+ }, error => {
234
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
267
235
  });
268
236
  };
269
237
  getPublicKey = (req, headers, signal) => {
270
- return this.fetch(this.url('GetPublicKey'), createHttpRequest((0, exports.JsonEncode)(req, 'GetPublicKeyRequest'), headers, signal)).then((res) => {
271
- return buildResponse(res).then((_data) => {
272
- return (0, exports.JsonDecode)(_data, 'GetPublicKeyResponse');
273
- });
274
- }, (error) => {
275
- throw WebrpcRequestFailedError.new({
276
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
238
+ return this.fetch(this.url('GetPublicKey'), createHttpRequest(JsonEncode(req, 'GetPublicKeyRequest'), headers, signal)).then(res => {
239
+ return buildResponse(res).then(_data => {
240
+ return JsonDecode(_data, 'GetPublicKeyResponse');
277
241
  });
242
+ }, error => {
243
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
278
244
  });
279
245
  };
280
246
  friendList = (req, headers, signal) => {
281
- return this.fetch(this.url('FriendList'), createHttpRequest((0, exports.JsonEncode)(req, 'FriendListRequest'), headers, signal)).then((res) => {
282
- return buildResponse(res).then((_data) => {
283
- return (0, exports.JsonDecode)(_data, 'FriendListResponse');
284
- });
285
- }, (error) => {
286
- throw WebrpcRequestFailedError.new({
287
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
247
+ return this.fetch(this.url('FriendList'), createHttpRequest(JsonEncode(req, 'FriendListRequest'), headers, signal)).then(res => {
248
+ return buildResponse(res).then(_data => {
249
+ return JsonDecode(_data, 'FriendListResponse');
288
250
  });
251
+ }, error => {
252
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
289
253
  });
290
254
  };
291
255
  getFriendByAddress = (req, headers, signal) => {
292
- return this.fetch(this.url('GetFriendByAddress'), createHttpRequest((0, exports.JsonEncode)(req, 'GetFriendByAddressRequest'), headers, signal)).then((res) => {
293
- return buildResponse(res).then((_data) => {
294
- return (0, exports.JsonDecode)(_data, 'GetFriendByAddressResponse');
295
- });
296
- }, (error) => {
297
- throw WebrpcRequestFailedError.new({
298
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
256
+ return this.fetch(this.url('GetFriendByAddress'), createHttpRequest(JsonEncode(req, 'GetFriendByAddressRequest'), headers, signal)).then(res => {
257
+ return buildResponse(res).then(_data => {
258
+ return JsonDecode(_data, 'GetFriendByAddressResponse');
299
259
  });
260
+ }, error => {
261
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
300
262
  });
301
263
  };
302
264
  searchFriends = (req, headers, signal) => {
303
- return this.fetch(this.url('SearchFriends'), createHttpRequest((0, exports.JsonEncode)(req, 'SearchFriendsRequest'), headers, signal)).then((res) => {
304
- return buildResponse(res).then((_data) => {
305
- return (0, exports.JsonDecode)(_data, 'SearchFriendsResponse');
306
- });
307
- }, (error) => {
308
- throw WebrpcRequestFailedError.new({
309
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
265
+ return this.fetch(this.url('SearchFriends'), createHttpRequest(JsonEncode(req, 'SearchFriendsRequest'), headers, signal)).then(res => {
266
+ return buildResponse(res).then(_data => {
267
+ return JsonDecode(_data, 'SearchFriendsResponse');
310
268
  });
269
+ }, error => {
270
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
311
271
  });
312
272
  };
313
273
  addFriend = (req, headers, signal) => {
314
- return this.fetch(this.url('AddFriend'), createHttpRequest((0, exports.JsonEncode)(req, 'AddFriendRequest'), headers, signal)).then((res) => {
315
- return buildResponse(res).then((_data) => {
316
- return (0, exports.JsonDecode)(_data, 'AddFriendResponse');
317
- });
318
- }, (error) => {
319
- throw WebrpcRequestFailedError.new({
320
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
274
+ return this.fetch(this.url('AddFriend'), createHttpRequest(JsonEncode(req, 'AddFriendRequest'), headers, signal)).then(res => {
275
+ return buildResponse(res).then(_data => {
276
+ return JsonDecode(_data, 'AddFriendResponse');
321
277
  });
278
+ }, error => {
279
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
322
280
  });
323
281
  };
324
282
  updateFriendNickname = (req, headers, signal) => {
325
- return this.fetch(this.url('UpdateFriendNickname'), createHttpRequest((0, exports.JsonEncode)(req, 'UpdateFriendNicknameRequest'), headers, signal)).then((res) => {
326
- return buildResponse(res).then((_data) => {
327
- return (0, exports.JsonDecode)(_data, 'UpdateFriendNicknameResponse');
328
- });
329
- }, (error) => {
330
- throw WebrpcRequestFailedError.new({
331
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
283
+ return this.fetch(this.url('UpdateFriendNickname'), createHttpRequest(JsonEncode(req, 'UpdateFriendNicknameRequest'), headers, signal)).then(res => {
284
+ return buildResponse(res).then(_data => {
285
+ return JsonDecode(_data, 'UpdateFriendNicknameResponse');
332
286
  });
287
+ }, error => {
288
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
333
289
  });
334
290
  };
335
291
  removeFriend = (req, headers, signal) => {
336
- return this.fetch(this.url('RemoveFriend'), createHttpRequest((0, exports.JsonEncode)(req, 'RemoveFriendRequest'), headers, signal)).then((res) => {
337
- return buildResponse(res).then((_data) => {
338
- return (0, exports.JsonDecode)(_data, 'RemoveFriendResponse');
339
- });
340
- }, (error) => {
341
- throw WebrpcRequestFailedError.new({
342
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
292
+ return this.fetch(this.url('RemoveFriend'), createHttpRequest(JsonEncode(req, 'RemoveFriendRequest'), headers, signal)).then(res => {
293
+ return buildResponse(res).then(_data => {
294
+ return JsonDecode(_data, 'RemoveFriendResponse');
343
295
  });
296
+ }, error => {
297
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
344
298
  });
345
299
  };
346
300
  contractCall = (req, headers, signal) => {
347
- return this.fetch(this.url('ContractCall'), createHttpRequest((0, exports.JsonEncode)(req, 'ContractCallRequest'), headers, signal)).then((res) => {
348
- return buildResponse(res).then((_data) => {
349
- return (0, exports.JsonDecode)(_data, 'ContractCallResponse');
350
- });
351
- }, (error) => {
352
- throw WebrpcRequestFailedError.new({
353
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
301
+ return this.fetch(this.url('ContractCall'), createHttpRequest(JsonEncode(req, 'ContractCallRequest'), headers, signal)).then(res => {
302
+ return buildResponse(res).then(_data => {
303
+ return JsonDecode(_data, 'ContractCallResponse');
354
304
  });
305
+ }, error => {
306
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
355
307
  });
356
308
  };
357
309
  decodeContractCall = (req, headers, signal) => {
358
- return this.fetch(this.url('DecodeContractCall'), createHttpRequest((0, exports.JsonEncode)(req, 'DecodeContractCallRequest'), headers, signal)).then((res) => {
359
- return buildResponse(res).then((_data) => {
360
- return (0, exports.JsonDecode)(_data, 'DecodeContractCallResponse');
361
- });
362
- }, (error) => {
363
- throw WebrpcRequestFailedError.new({
364
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
310
+ return this.fetch(this.url('DecodeContractCall'), createHttpRequest(JsonEncode(req, 'DecodeContractCallRequest'), headers, signal)).then(res => {
311
+ return buildResponse(res).then(_data => {
312
+ return JsonDecode(_data, 'DecodeContractCallResponse');
365
313
  });
314
+ }, error => {
315
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
366
316
  });
367
317
  };
368
318
  lookupContractCallSelectors = (req, headers, signal) => {
369
- return this.fetch(this.url('LookupContractCallSelectors'), createHttpRequest((0, exports.JsonEncode)(req, 'LookupContractCallSelectorsRequest'), headers, signal)).then((res) => {
370
- return buildResponse(res).then((_data) => {
371
- return (0, exports.JsonDecode)(_data, 'LookupContractCallSelectorsResponse');
372
- });
373
- }, (error) => {
374
- throw WebrpcRequestFailedError.new({
375
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
319
+ return this.fetch(this.url('LookupContractCallSelectors'), createHttpRequest(JsonEncode(req, 'LookupContractCallSelectorsRequest'), headers, signal)).then(res => {
320
+ return buildResponse(res).then(_data => {
321
+ return JsonDecode(_data, 'LookupContractCallSelectorsResponse');
376
322
  });
323
+ }, error => {
324
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
377
325
  });
378
326
  };
379
327
  userStorageFetch = (req, headers, signal) => {
380
- return this.fetch(this.url('UserStorageFetch'), createHttpRequest((0, exports.JsonEncode)(req, 'UserStorageFetchRequest'), headers, signal)).then((res) => {
381
- return buildResponse(res).then((_data) => {
382
- return (0, exports.JsonDecode)(_data, 'UserStorageFetchResponse');
383
- });
384
- }, (error) => {
385
- throw WebrpcRequestFailedError.new({
386
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
328
+ return this.fetch(this.url('UserStorageFetch'), createHttpRequest(JsonEncode(req, 'UserStorageFetchRequest'), headers, signal)).then(res => {
329
+ return buildResponse(res).then(_data => {
330
+ return JsonDecode(_data, 'UserStorageFetchResponse');
387
331
  });
332
+ }, error => {
333
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
388
334
  });
389
335
  };
390
336
  userStorageSave = (req, headers, signal) => {
391
- return this.fetch(this.url('UserStorageSave'), createHttpRequest((0, exports.JsonEncode)(req, 'UserStorageSaveRequest'), headers, signal)).then((res) => {
392
- return buildResponse(res).then((_data) => {
393
- return (0, exports.JsonDecode)(_data, 'UserStorageSaveResponse');
394
- });
395
- }, (error) => {
396
- throw WebrpcRequestFailedError.new({
397
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
337
+ return this.fetch(this.url('UserStorageSave'), createHttpRequest(JsonEncode(req, 'UserStorageSaveRequest'), headers, signal)).then(res => {
338
+ return buildResponse(res).then(_data => {
339
+ return JsonDecode(_data, 'UserStorageSaveResponse');
398
340
  });
341
+ }, error => {
342
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
399
343
  });
400
344
  };
401
345
  userStorageDelete = (req, headers, signal) => {
402
- return this.fetch(this.url('UserStorageDelete'), createHttpRequest((0, exports.JsonEncode)(req, 'UserStorageDeleteRequest'), headers, signal)).then((res) => {
403
- return buildResponse(res).then((_data) => {
404
- return (0, exports.JsonDecode)(_data, 'UserStorageDeleteResponse');
405
- });
406
- }, (error) => {
407
- throw WebrpcRequestFailedError.new({
408
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
346
+ return this.fetch(this.url('UserStorageDelete'), createHttpRequest(JsonEncode(req, 'UserStorageDeleteRequest'), headers, signal)).then(res => {
347
+ return buildResponse(res).then(_data => {
348
+ return JsonDecode(_data, 'UserStorageDeleteResponse');
409
349
  });
350
+ }, error => {
351
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
410
352
  });
411
353
  };
412
354
  userStorageFetchAll = (req, headers, signal) => {
413
- return this.fetch(this.url('UserStorageFetchAll'), createHttpRequest((0, exports.JsonEncode)(req, 'UserStorageFetchAllRequest'), headers, signal)).then((res) => {
414
- return buildResponse(res).then((_data) => {
415
- return (0, exports.JsonDecode)(_data, 'UserStorageFetchAllResponse');
416
- });
417
- }, (error) => {
418
- throw WebrpcRequestFailedError.new({
419
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
355
+ return this.fetch(this.url('UserStorageFetchAll'), createHttpRequest(JsonEncode(req, 'UserStorageFetchAllRequest'), headers, signal)).then(res => {
356
+ return buildResponse(res).then(_data => {
357
+ return JsonDecode(_data, 'UserStorageFetchAllResponse');
420
358
  });
359
+ }, error => {
360
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
421
361
  });
422
362
  };
423
363
  getMoonpayLink = (req, headers, signal) => {
424
- return this.fetch(this.url('GetMoonpayLink'), createHttpRequest((0, exports.JsonEncode)(req, 'GetMoonpayLinkRequest'), headers, signal)).then((res) => {
425
- return buildResponse(res).then((_data) => {
426
- return (0, exports.JsonDecode)(_data, 'GetMoonpayLinkResponse');
427
- });
428
- }, (error) => {
429
- throw WebrpcRequestFailedError.new({
430
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
364
+ return this.fetch(this.url('GetMoonpayLink'), createHttpRequest(JsonEncode(req, 'GetMoonpayLinkRequest'), headers, signal)).then(res => {
365
+ return buildResponse(res).then(_data => {
366
+ return JsonDecode(_data, 'GetMoonpayLinkResponse');
431
367
  });
368
+ }, error => {
369
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
432
370
  });
433
371
  };
434
372
  resolveENSAddress = (req, headers, signal) => {
435
- return this.fetch(this.url('ResolveENSAddress'), createHttpRequest((0, exports.JsonEncode)(req, 'ResolveENSAddressRequest'), headers, signal)).then((res) => {
436
- return buildResponse(res).then((_data) => {
437
- return (0, exports.JsonDecode)(_data, 'ResolveENSAddressResponse');
438
- });
439
- }, (error) => {
440
- throw WebrpcRequestFailedError.new({
441
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
373
+ return this.fetch(this.url('ResolveENSAddress'), createHttpRequest(JsonEncode(req, 'ResolveENSAddressRequest'), headers, signal)).then(res => {
374
+ return buildResponse(res).then(_data => {
375
+ return JsonDecode(_data, 'ResolveENSAddressResponse');
442
376
  });
377
+ }, error => {
378
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
443
379
  });
444
380
  };
445
381
  isValidSignature = (req, headers, signal) => {
446
- return this.fetch(this.url('IsValidSignature'), createHttpRequest((0, exports.JsonEncode)(req, 'IsValidSignatureRequest'), headers, signal)).then((res) => {
447
- return buildResponse(res).then((_data) => {
448
- return (0, exports.JsonDecode)(_data, 'IsValidSignatureResponse');
449
- });
450
- }, (error) => {
451
- throw WebrpcRequestFailedError.new({
452
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
382
+ return this.fetch(this.url('IsValidSignature'), createHttpRequest(JsonEncode(req, 'IsValidSignatureRequest'), headers, signal)).then(res => {
383
+ return buildResponse(res).then(_data => {
384
+ return JsonDecode(_data, 'IsValidSignatureResponse');
453
385
  });
386
+ }, error => {
387
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
454
388
  });
455
389
  };
456
390
  isValidMessageSignature = (req, headers, signal) => {
457
- return this.fetch(this.url('IsValidMessageSignature'), createHttpRequest((0, exports.JsonEncode)(req, 'IsValidMessageSignatureRequest'), headers, signal)).then((res) => {
458
- return buildResponse(res).then((_data) => {
459
- return (0, exports.JsonDecode)(_data, 'IsValidMessageSignatureResponse');
460
- });
461
- }, (error) => {
462
- throw WebrpcRequestFailedError.new({
463
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
391
+ return this.fetch(this.url('IsValidMessageSignature'), createHttpRequest(JsonEncode(req, 'IsValidMessageSignatureRequest'), headers, signal)).then(res => {
392
+ return buildResponse(res).then(_data => {
393
+ return JsonDecode(_data, 'IsValidMessageSignatureResponse');
464
394
  });
395
+ }, error => {
396
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
465
397
  });
466
398
  };
467
399
  isValidTypedDataSignature = (req, headers, signal) => {
468
- return this.fetch(this.url('IsValidTypedDataSignature'), createHttpRequest((0, exports.JsonEncode)(req, 'IsValidTypedDataSignatureRequest'), headers, signal)).then((res) => {
469
- return buildResponse(res).then((_data) => {
470
- return (0, exports.JsonDecode)(_data, 'IsValidTypedDataSignatureResponse');
471
- });
472
- }, (error) => {
473
- throw WebrpcRequestFailedError.new({
474
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
400
+ return this.fetch(this.url('IsValidTypedDataSignature'), createHttpRequest(JsonEncode(req, 'IsValidTypedDataSignatureRequest'), headers, signal)).then(res => {
401
+ return buildResponse(res).then(_data => {
402
+ return JsonDecode(_data, 'IsValidTypedDataSignatureResponse');
475
403
  });
404
+ }, error => {
405
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
476
406
  });
477
407
  };
478
408
  isValidETHAuthProof = (req, headers, signal) => {
479
- return this.fetch(this.url('IsValidETHAuthProof'), createHttpRequest((0, exports.JsonEncode)(req, 'IsValidETHAuthProofRequest'), headers, signal)).then((res) => {
480
- return buildResponse(res).then((_data) => {
481
- return (0, exports.JsonDecode)(_data, 'IsValidETHAuthProofResponse');
482
- });
483
- }, (error) => {
484
- throw WebrpcRequestFailedError.new({
485
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
409
+ return this.fetch(this.url('IsValidETHAuthProof'), createHttpRequest(JsonEncode(req, 'IsValidETHAuthProofRequest'), headers, signal)).then(res => {
410
+ return buildResponse(res).then(_data => {
411
+ return JsonDecode(_data, 'IsValidETHAuthProofResponse');
486
412
  });
413
+ }, error => {
414
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
487
415
  });
488
416
  };
489
417
  getOnRampURL = (req, headers, signal) => {
490
- return this.fetch(this.url('GetOnRampURL'), createHttpRequest((0, exports.JsonEncode)(req, 'GetOnRampURLRequest'), headers, signal)).then((res) => {
491
- return buildResponse(res).then((_data) => {
492
- return (0, exports.JsonDecode)(_data, 'GetOnRampURLResponse');
493
- });
494
- }, (error) => {
495
- throw WebrpcRequestFailedError.new({
496
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
418
+ return this.fetch(this.url('GetOnRampURL'), createHttpRequest(JsonEncode(req, 'GetOnRampURLRequest'), headers, signal)).then(res => {
419
+ return buildResponse(res).then(_data => {
420
+ return JsonDecode(_data, 'GetOnRampURLResponse');
497
421
  });
422
+ }, error => {
423
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
498
424
  });
499
425
  };
500
426
  transakGetCountries = (headers, signal) => {
501
- return this.fetch(this.url('TransakGetCountries'), createHttpRequest('{}', headers, signal)).then((res) => {
502
- return buildResponse(res).then((_data) => {
503
- return (0, exports.JsonDecode)(_data, 'TransakGetCountriesResponse');
504
- });
505
- }, (error) => {
506
- throw WebrpcRequestFailedError.new({
507
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
427
+ return this.fetch(this.url('TransakGetCountries'), createHttpRequest('{}', headers, signal)).then(res => {
428
+ return buildResponse(res).then(_data => {
429
+ return JsonDecode(_data, 'TransakGetCountriesResponse');
508
430
  });
431
+ }, error => {
432
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
509
433
  });
510
434
  };
511
435
  transakGetCryptoCurrencies = (headers, signal) => {
512
- return this.fetch(this.url('TransakGetCryptoCurrencies'), createHttpRequest('{}', headers, signal)).then((res) => {
513
- return buildResponse(res).then((_data) => {
514
- return (0, exports.JsonDecode)(_data, 'TransakGetCryptoCurrenciesResponse');
515
- });
516
- }, (error) => {
517
- throw WebrpcRequestFailedError.new({
518
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
436
+ return this.fetch(this.url('TransakGetCryptoCurrencies'), createHttpRequest('{}', headers, signal)).then(res => {
437
+ return buildResponse(res).then(_data => {
438
+ return JsonDecode(_data, 'TransakGetCryptoCurrenciesResponse');
519
439
  });
440
+ }, error => {
441
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
520
442
  });
521
443
  };
522
444
  transakGetFiatCurrencies = (headers, signal) => {
523
- return this.fetch(this.url('TransakGetFiatCurrencies'), createHttpRequest('{}', headers, signal)).then((res) => {
524
- return buildResponse(res).then((_data) => {
525
- return (0, exports.JsonDecode)(_data, 'TransakGetFiatCurrenciesResponse');
526
- });
527
- }, (error) => {
528
- throw WebrpcRequestFailedError.new({
529
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
445
+ return this.fetch(this.url('TransakGetFiatCurrencies'), createHttpRequest('{}', headers, signal)).then(res => {
446
+ return buildResponse(res).then(_data => {
447
+ return JsonDecode(_data, 'TransakGetFiatCurrenciesResponse');
530
448
  });
449
+ }, error => {
450
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
531
451
  });
532
452
  };
533
453
  transakGetPrice = (req, headers, signal) => {
534
- return this.fetch(this.url('TransakGetPrice'), createHttpRequest((0, exports.JsonEncode)(req, 'TransakGetPriceRequest'), headers, signal)).then((res) => {
535
- return buildResponse(res).then((_data) => {
536
- return (0, exports.JsonDecode)(_data, 'TransakGetPriceResponse');
537
- });
538
- }, (error) => {
539
- throw WebrpcRequestFailedError.new({
540
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
454
+ return this.fetch(this.url('TransakGetPrice'), createHttpRequest(JsonEncode(req, 'TransakGetPriceRequest'), headers, signal)).then(res => {
455
+ return buildResponse(res).then(_data => {
456
+ return JsonDecode(_data, 'TransakGetPriceResponse');
541
457
  });
458
+ }, error => {
459
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
542
460
  });
543
461
  };
544
462
  transakGetSupportedNFTCheckoutChains = (headers, signal) => {
545
- return this.fetch(this.url('TransakGetSupportedNFTCheckoutChains'), createHttpRequest('{}', headers, signal)).then((res) => {
546
- return buildResponse(res).then((_data) => {
547
- return (0, exports.JsonDecode)(_data, 'TransakGetSupportedNFTCheckoutChainsResponse');
548
- });
549
- }, (error) => {
550
- throw WebrpcRequestFailedError.new({
551
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
463
+ return this.fetch(this.url('TransakGetSupportedNFTCheckoutChains'), createHttpRequest('{}', headers, signal)).then(res => {
464
+ return buildResponse(res).then(_data => {
465
+ return JsonDecode(_data, 'TransakGetSupportedNFTCheckoutChainsResponse');
552
466
  });
467
+ }, error => {
468
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
553
469
  });
554
470
  };
555
471
  transakGetWidgetURL = (req, headers, signal) => {
556
- return this.fetch(this.url('TransakGetWidgetURL'), createHttpRequest((0, exports.JsonEncode)(req, 'TransakGetWidgetURLRequest'), headers, signal)).then((res) => {
557
- return buildResponse(res).then((_data) => {
558
- return (0, exports.JsonDecode)(_data, 'TransakGetWidgetURLResponse');
559
- });
560
- }, (error) => {
561
- throw WebrpcRequestFailedError.new({
562
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
472
+ return this.fetch(this.url('TransakGetWidgetURL'), createHttpRequest(JsonEncode(req, 'TransakGetWidgetURLRequest'), headers, signal)).then(res => {
473
+ return buildResponse(res).then(_data => {
474
+ return JsonDecode(_data, 'TransakGetWidgetURLResponse');
563
475
  });
476
+ }, error => {
477
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
564
478
  });
565
479
  };
566
480
  getCoinPrices = (req, headers, signal) => {
567
- return this.fetch(this.url('GetCoinPrices'), createHttpRequest((0, exports.JsonEncode)(req, 'GetCoinPricesRequest'), headers, signal)).then((res) => {
568
- return buildResponse(res).then((_data) => {
569
- return (0, exports.JsonDecode)(_data, 'GetCoinPricesResponse');
570
- });
571
- }, (error) => {
572
- throw WebrpcRequestFailedError.new({
573
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
481
+ return this.fetch(this.url('GetCoinPrices'), createHttpRequest(JsonEncode(req, 'GetCoinPricesRequest'), headers, signal)).then(res => {
482
+ return buildResponse(res).then(_data => {
483
+ return JsonDecode(_data, 'GetCoinPricesResponse');
574
484
  });
485
+ }, error => {
486
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
575
487
  });
576
488
  };
577
489
  getCollectiblePrices = (req, headers, signal) => {
578
- return this.fetch(this.url('GetCollectiblePrices'), createHttpRequest((0, exports.JsonEncode)(req, 'GetCollectiblePricesRequest'), headers, signal)).then((res) => {
579
- return buildResponse(res).then((_data) => {
580
- return (0, exports.JsonDecode)(_data, 'GetCollectiblePricesResponse');
581
- });
582
- }, (error) => {
583
- throw WebrpcRequestFailedError.new({
584
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
490
+ return this.fetch(this.url('GetCollectiblePrices'), createHttpRequest(JsonEncode(req, 'GetCollectiblePricesRequest'), headers, signal)).then(res => {
491
+ return buildResponse(res).then(_data => {
492
+ return JsonDecode(_data, 'GetCollectiblePricesResponse');
585
493
  });
494
+ }, error => {
495
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
586
496
  });
587
497
  };
588
498
  getExchangeRate = (req, headers, signal) => {
589
- return this.fetch(this.url('GetExchangeRate'), createHttpRequest((0, exports.JsonEncode)(req, 'GetExchangeRateRequest'), headers, signal)).then((res) => {
590
- return buildResponse(res).then((_data) => {
591
- return (0, exports.JsonDecode)(_data, 'GetExchangeRateResponse');
592
- });
593
- }, (error) => {
594
- throw WebrpcRequestFailedError.new({
595
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
499
+ return this.fetch(this.url('GetExchangeRate'), createHttpRequest(JsonEncode(req, 'GetExchangeRateRequest'), headers, signal)).then(res => {
500
+ return buildResponse(res).then(_data => {
501
+ return JsonDecode(_data, 'GetExchangeRateResponse');
596
502
  });
503
+ }, error => {
504
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
597
505
  });
598
506
  };
599
507
  memoryStore = (req, headers, signal) => {
600
- return this.fetch(this.url('MemoryStore'), createHttpRequest((0, exports.JsonEncode)(req, 'MemoryStoreRequest'), headers, signal)).then((res) => {
601
- return buildResponse(res).then((_data) => {
602
- return (0, exports.JsonDecode)(_data, 'MemoryStoreResponse');
603
- });
604
- }, (error) => {
605
- throw WebrpcRequestFailedError.new({
606
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
508
+ return this.fetch(this.url('MemoryStore'), createHttpRequest(JsonEncode(req, 'MemoryStoreRequest'), headers, signal)).then(res => {
509
+ return buildResponse(res).then(_data => {
510
+ return JsonDecode(_data, 'MemoryStoreResponse');
607
511
  });
512
+ }, error => {
513
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
608
514
  });
609
515
  };
610
516
  memoryLoad = (req, headers, signal) => {
611
- return this.fetch(this.url('MemoryLoad'), createHttpRequest((0, exports.JsonEncode)(req, 'MemoryLoadRequest'), headers, signal)).then((res) => {
612
- return buildResponse(res).then((_data) => {
613
- return (0, exports.JsonDecode)(_data, 'MemoryLoadResponse');
614
- });
615
- }, (error) => {
616
- throw WebrpcRequestFailedError.new({
617
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
517
+ return this.fetch(this.url('MemoryLoad'), createHttpRequest(JsonEncode(req, 'MemoryLoadRequest'), headers, signal)).then(res => {
518
+ return buildResponse(res).then(_data => {
519
+ return JsonDecode(_data, 'MemoryLoadResponse');
618
520
  });
521
+ }, error => {
522
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
619
523
  });
620
524
  };
621
525
  getInviteInfo = (headers, signal) => {
622
- return this.fetch(this.url('GetInviteInfo'), createHttpRequest('{}', headers, signal)).then((res) => {
623
- return buildResponse(res).then((_data) => {
624
- return (0, exports.JsonDecode)(_data, 'GetInviteInfoResponse');
625
- });
626
- }, (error) => {
627
- throw WebrpcRequestFailedError.new({
628
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
526
+ return this.fetch(this.url('GetInviteInfo'), createHttpRequest('{}', headers, signal)).then(res => {
527
+ return buildResponse(res).then(_data => {
528
+ return JsonDecode(_data, 'GetInviteInfoResponse');
629
529
  });
530
+ }, error => {
531
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
630
532
  });
631
533
  };
632
534
  isValidAccessCode = (req, headers, signal) => {
633
- return this.fetch(this.url('IsValidAccessCode'), createHttpRequest((0, exports.JsonEncode)(req, 'IsValidAccessCodeRequest'), headers, signal)).then((res) => {
634
- return buildResponse(res).then((_data) => {
635
- return (0, exports.JsonDecode)(_data, 'IsValidAccessCodeResponse');
636
- });
637
- }, (error) => {
638
- throw WebrpcRequestFailedError.new({
639
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
535
+ return this.fetch(this.url('IsValidAccessCode'), createHttpRequest(JsonEncode(req, 'IsValidAccessCodeRequest'), headers, signal)).then(res => {
536
+ return buildResponse(res).then(_data => {
537
+ return JsonDecode(_data, 'IsValidAccessCodeResponse');
640
538
  });
539
+ }, error => {
540
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
641
541
  });
642
542
  };
643
543
  internalClaimAccessCode = (req, headers, signal) => {
644
- return this.fetch(this.url('InternalClaimAccessCode'), createHttpRequest((0, exports.JsonEncode)(req, 'InternalClaimAccessCodeRequest'), headers, signal)).then((res) => {
645
- return buildResponse(res).then((_data) => {
646
- return (0, exports.JsonDecode)(_data, 'InternalClaimAccessCodeResponse');
647
- });
648
- }, (error) => {
649
- throw WebrpcRequestFailedError.new({
650
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
544
+ return this.fetch(this.url('InternalClaimAccessCode'), createHttpRequest(JsonEncode(req, 'InternalClaimAccessCodeRequest'), headers, signal)).then(res => {
545
+ return buildResponse(res).then(_data => {
546
+ return JsonDecode(_data, 'InternalClaimAccessCodeResponse');
651
547
  });
548
+ }, error => {
549
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
652
550
  });
653
551
  };
654
552
  blockNumberAtTime = (req, headers, signal) => {
655
- return this.fetch(this.url('BlockNumberAtTime'), createHttpRequest((0, exports.JsonEncode)(req, 'BlockNumberAtTimeRequest'), headers, signal)).then((res) => {
656
- return buildResponse(res).then((_data) => {
657
- return (0, exports.JsonDecode)(_data, 'BlockNumberAtTimeResponse');
658
- });
659
- }, (error) => {
660
- throw WebrpcRequestFailedError.new({
661
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
553
+ return this.fetch(this.url('BlockNumberAtTime'), createHttpRequest(JsonEncode(req, 'BlockNumberAtTimeRequest'), headers, signal)).then(res => {
554
+ return buildResponse(res).then(_data => {
555
+ return JsonDecode(_data, 'BlockNumberAtTimeResponse');
662
556
  });
557
+ }, error => {
558
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
663
559
  });
664
560
  };
665
561
  paperSessionSecret = (req, headers, signal) => {
666
- return this.fetch(this.url('PaperSessionSecret'), createHttpRequest((0, exports.JsonEncode)(req, 'PaperSessionSecretRequest'), headers, signal)).then((res) => {
667
- return buildResponse(res).then((_data) => {
668
- return (0, exports.JsonDecode)(_data, 'PaperSessionSecretResponse');
669
- });
670
- }, (error) => {
671
- throw WebrpcRequestFailedError.new({
672
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
562
+ return this.fetch(this.url('PaperSessionSecret'), createHttpRequest(JsonEncode(req, 'PaperSessionSecretRequest'), headers, signal)).then(res => {
563
+ return buildResponse(res).then(_data => {
564
+ return JsonDecode(_data, 'PaperSessionSecretResponse');
673
565
  });
566
+ }, error => {
567
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
674
568
  });
675
569
  };
676
570
  paperSessionSecret2 = (req, headers, signal) => {
677
- return this.fetch(this.url('PaperSessionSecret2'), createHttpRequest((0, exports.JsonEncode)(req, 'PaperSessionSecret2Request'), headers, signal)).then((res) => {
678
- return buildResponse(res).then((_data) => {
679
- return (0, exports.JsonDecode)(_data, 'PaperSessionSecret2Response');
680
- });
681
- }, (error) => {
682
- throw WebrpcRequestFailedError.new({
683
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
571
+ return this.fetch(this.url('PaperSessionSecret2'), createHttpRequest(JsonEncode(req, 'PaperSessionSecret2Request'), headers, signal)).then(res => {
572
+ return buildResponse(res).then(_data => {
573
+ return JsonDecode(_data, 'PaperSessionSecret2Response');
684
574
  });
575
+ }, error => {
576
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
685
577
  });
686
578
  };
687
579
  linkWallet = (req, headers, signal) => {
688
- return this.fetch(this.url('LinkWallet'), createHttpRequest((0, exports.JsonEncode)(req, 'LinkWalletRequest'), headers, signal)).then((res) => {
689
- return buildResponse(res).then((_data) => {
690
- return (0, exports.JsonDecode)(_data, 'LinkWalletResponse');
691
- });
692
- }, (error) => {
693
- throw WebrpcRequestFailedError.new({
694
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
580
+ return this.fetch(this.url('LinkWallet'), createHttpRequest(JsonEncode(req, 'LinkWalletRequest'), headers, signal)).then(res => {
581
+ return buildResponse(res).then(_data => {
582
+ return JsonDecode(_data, 'LinkWalletResponse');
695
583
  });
584
+ }, error => {
585
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
696
586
  });
697
587
  };
698
588
  getLinkedWallets = (req, headers, signal) => {
699
- return this.fetch(this.url('GetLinkedWallets'), createHttpRequest((0, exports.JsonEncode)(req, 'GetLinkedWalletsRequest'), headers, signal)).then((res) => {
700
- return buildResponse(res).then((_data) => {
701
- return (0, exports.JsonDecode)(_data, 'GetLinkedWalletsResponse');
702
- });
703
- }, (error) => {
704
- throw WebrpcRequestFailedError.new({
705
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
589
+ return this.fetch(this.url('GetLinkedWallets'), createHttpRequest(JsonEncode(req, 'GetLinkedWalletsRequest'), headers, signal)).then(res => {
590
+ return buildResponse(res).then(_data => {
591
+ return JsonDecode(_data, 'GetLinkedWalletsResponse');
706
592
  });
593
+ }, error => {
594
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
707
595
  });
708
596
  };
709
597
  removeLinkedWallet = (req, headers, signal) => {
710
- return this.fetch(this.url('RemoveLinkedWallet'), createHttpRequest((0, exports.JsonEncode)(req, 'RemoveLinkedWalletRequest'), headers, signal)).then((res) => {
711
- return buildResponse(res).then((_data) => {
712
- return (0, exports.JsonDecode)(_data, 'RemoveLinkedWalletResponse');
713
- });
714
- }, (error) => {
715
- throw WebrpcRequestFailedError.new({
716
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
598
+ return this.fetch(this.url('RemoveLinkedWallet'), createHttpRequest(JsonEncode(req, 'RemoveLinkedWalletRequest'), headers, signal)).then(res => {
599
+ return buildResponse(res).then(_data => {
600
+ return JsonDecode(_data, 'RemoveLinkedWalletResponse');
717
601
  });
602
+ }, error => {
603
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
718
604
  });
719
605
  };
720
606
  generateWaaSVerificationURL = (req, headers, signal) => {
721
- return this.fetch(this.url('GenerateWaaSVerificationURL'), createHttpRequest((0, exports.JsonEncode)(req, 'GenerateWaaSVerificationURLRequest'), headers, signal)).then((res) => {
722
- return buildResponse(res).then((_data) => {
723
- return (0, exports.JsonDecode)(_data, 'GenerateWaaSVerificationURLResponse');
724
- });
725
- }, (error) => {
726
- throw WebrpcRequestFailedError.new({
727
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
607
+ return this.fetch(this.url('GenerateWaaSVerificationURL'), createHttpRequest(JsonEncode(req, 'GenerateWaaSVerificationURLRequest'), headers, signal)).then(res => {
608
+ return buildResponse(res).then(_data => {
609
+ return JsonDecode(_data, 'GenerateWaaSVerificationURLResponse');
728
610
  });
611
+ }, error => {
612
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
729
613
  });
730
614
  };
731
615
  validateWaaSVerificationNonce = (req, headers, signal) => {
732
- return this.fetch(this.url('ValidateWaaSVerificationNonce'), createHttpRequest((0, exports.JsonEncode)(req, 'ValidateWaaSVerificationNonceRequest'), headers, signal)).then((res) => {
733
- return buildResponse(res).then((_data) => {
734
- return (0, exports.JsonDecode)(_data, 'ValidateWaaSVerificationNonceResponse');
735
- });
736
- }, (error) => {
737
- throw WebrpcRequestFailedError.new({
738
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
616
+ return this.fetch(this.url('ValidateWaaSVerificationNonce'), createHttpRequest(JsonEncode(req, 'ValidateWaaSVerificationNonceRequest'), headers, signal)).then(res => {
617
+ return buildResponse(res).then(_data => {
618
+ return JsonDecode(_data, 'ValidateWaaSVerificationNonceResponse');
739
619
  });
620
+ }, error => {
621
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
740
622
  });
741
623
  };
742
624
  listAdoptedWallets = (req, headers, signal) => {
743
- return this.fetch(this.url('ListAdoptedWallets'), createHttpRequest((0, exports.JsonEncode)(req, 'ListAdoptedWalletsRequest'), headers, signal)).then((res) => {
744
- return buildResponse(res).then((_data) => {
745
- return (0, exports.JsonDecode)(_data, 'ListAdoptedWalletsResponse');
746
- });
747
- }, (error) => {
748
- throw WebrpcRequestFailedError.new({
749
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
625
+ return this.fetch(this.url('ListAdoptedWallets'), createHttpRequest(JsonEncode(req, 'ListAdoptedWalletsRequest'), headers, signal)).then(res => {
626
+ return buildResponse(res).then(_data => {
627
+ return JsonDecode(_data, 'ListAdoptedWalletsResponse');
750
628
  });
629
+ }, error => {
630
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
751
631
  });
752
632
  };
753
633
  getLifiChains = (headers, signal) => {
754
- return this.fetch(this.url('GetLifiChains'), createHttpRequest('{}', headers, signal)).then((res) => {
755
- return buildResponse(res).then((_data) => {
756
- return (0, exports.JsonDecode)(_data, 'GetLifiChainsResponse');
757
- });
758
- }, (error) => {
759
- throw WebrpcRequestFailedError.new({
760
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
634
+ return this.fetch(this.url('GetLifiChains'), createHttpRequest('{}', headers, signal)).then(res => {
635
+ return buildResponse(res).then(_data => {
636
+ return JsonDecode(_data, 'GetLifiChainsResponse');
761
637
  });
638
+ }, error => {
639
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
762
640
  });
763
641
  };
764
642
  getLifiTokens = (req, headers, signal) => {
765
- return this.fetch(this.url('GetLifiTokens'), createHttpRequest((0, exports.JsonEncode)(req, 'GetLifiTokensRequest'), headers, signal)).then((res) => {
766
- return buildResponse(res).then((_data) => {
767
- return (0, exports.JsonDecode)(_data, 'GetLifiTokensResponse');
768
- });
769
- }, (error) => {
770
- throw WebrpcRequestFailedError.new({
771
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
643
+ return this.fetch(this.url('GetLifiTokens'), createHttpRequest(JsonEncode(req, 'GetLifiTokensRequest'), headers, signal)).then(res => {
644
+ return buildResponse(res).then(_data => {
645
+ return JsonDecode(_data, 'GetLifiTokensResponse');
772
646
  });
647
+ }, error => {
648
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
773
649
  });
774
650
  };
775
651
  getLifiSwapRoutes = (req, headers, signal) => {
776
- return this.fetch(this.url('GetLifiSwapRoutes'), createHttpRequest((0, exports.JsonEncode)(req, 'GetLifiSwapRoutesRequest'), headers, signal)).then((res) => {
777
- return buildResponse(res).then((_data) => {
778
- return (0, exports.JsonDecode)(_data, 'GetLifiSwapRoutesResponse');
779
- });
780
- }, (error) => {
781
- throw WebrpcRequestFailedError.new({
782
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
652
+ return this.fetch(this.url('GetLifiSwapRoutes'), createHttpRequest(JsonEncode(req, 'GetLifiSwapRoutesRequest'), headers, signal)).then(res => {
653
+ return buildResponse(res).then(_data => {
654
+ return JsonDecode(_data, 'GetLifiSwapRoutesResponse');
783
655
  });
656
+ }, error => {
657
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
784
658
  });
785
659
  };
786
660
  getLifiSwapQuote = (req, headers, signal) => {
787
- return this.fetch(this.url('GetLifiSwapQuote'), createHttpRequest((0, exports.JsonEncode)(req, 'GetLifiSwapQuoteRequest'), headers, signal)).then((res) => {
788
- return buildResponse(res).then((_data) => {
789
- return (0, exports.JsonDecode)(_data, 'GetLifiSwapQuoteResponse');
790
- });
791
- }, (error) => {
792
- throw WebrpcRequestFailedError.new({
793
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
794
- });
795
- });
796
- };
797
- getIntentCallsPayloads = (req, headers, signal) => {
798
- return this.fetch(this.url('GetIntentCallsPayloads'), createHttpRequest((0, exports.JsonEncode)(req, 'GetIntentCallsPayloadsRequest'), headers, signal)).then((res) => {
799
- return buildResponse(res).then((_data) => {
800
- return (0, exports.JsonDecode)(_data, 'GetIntentCallsPayloadsResponse');
801
- });
802
- }, (error) => {
803
- throw WebrpcRequestFailedError.new({
804
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
805
- });
806
- });
807
- };
808
- commitIntentConfig = (req, headers, signal) => {
809
- return this.fetch(this.url('CommitIntentConfig'), createHttpRequest((0, exports.JsonEncode)(req, 'CommitIntentConfigRequest'), headers, signal)).then((res) => {
810
- return buildResponse(res).then((_data) => {
811
- return (0, exports.JsonDecode)(_data, 'CommitIntentConfigResponse');
812
- });
813
- }, (error) => {
814
- throw WebrpcRequestFailedError.new({
815
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
816
- });
817
- });
818
- };
819
- getIntentConfig = (req, headers, signal) => {
820
- return this.fetch(this.url('GetIntentConfig'), createHttpRequest((0, exports.JsonEncode)(req, 'GetIntentConfigRequest'), headers, signal)).then((res) => {
821
- return buildResponse(res).then((_data) => {
822
- return (0, exports.JsonDecode)(_data, 'GetIntentConfigResponse');
823
- });
824
- }, (error) => {
825
- throw WebrpcRequestFailedError.new({
826
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
661
+ return this.fetch(this.url('GetLifiSwapQuote'), createHttpRequest(JsonEncode(req, 'GetLifiSwapQuoteRequest'), headers, signal)).then(res => {
662
+ return buildResponse(res).then(_data => {
663
+ return JsonDecode(_data, 'GetLifiSwapQuoteResponse');
827
664
  });
665
+ }, error => {
666
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
828
667
  });
829
668
  };
830
669
  listCurrencyGroups = (headers, signal) => {
831
- return this.fetch(this.url('ListCurrencyGroups'), createHttpRequest('{}', headers, signal)).then((res) => {
832
- return buildResponse(res).then((_data) => {
833
- return (0, exports.JsonDecode)(_data, 'ListCurrencyGroupsResponse');
834
- });
835
- }, (error) => {
836
- throw WebrpcRequestFailedError.new({
837
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
670
+ return this.fetch(this.url('ListCurrencyGroups'), createHttpRequest('{}', headers, signal)).then(res => {
671
+ return buildResponse(res).then(_data => {
672
+ return JsonDecode(_data, 'ListCurrencyGroupsResponse');
838
673
  });
674
+ }, error => {
675
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
839
676
  });
840
677
  };
841
678
  addOffchainInventory = (req, headers, signal) => {
842
- return this.fetch(this.url('AddOffchainInventory'), createHttpRequest((0, exports.JsonEncode)(req, 'AddOffchainInventoryRequest'), headers, signal)).then((res) => {
843
- return buildResponse(res).then((_data) => {
844
- return (0, exports.JsonDecode)(_data, 'AddOffchainInventoryResponse');
845
- });
846
- }, (error) => {
847
- throw WebrpcRequestFailedError.new({
848
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
679
+ return this.fetch(this.url('AddOffchainInventory'), createHttpRequest(JsonEncode(req, 'AddOffchainInventoryRequest'), headers, signal)).then(res => {
680
+ return buildResponse(res).then(_data => {
681
+ return JsonDecode(_data, 'AddOffchainInventoryResponse');
849
682
  });
683
+ }, error => {
684
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
850
685
  });
851
686
  };
852
687
  getOffchainInventory = (req, headers, signal) => {
853
- return this.fetch(this.url('GetOffchainInventory'), createHttpRequest((0, exports.JsonEncode)(req, 'GetOffchainInventoryRequest'), headers, signal)).then((res) => {
854
- return buildResponse(res).then((_data) => {
855
- return (0, exports.JsonDecode)(_data, 'GetOffchainInventoryResponse');
856
- });
857
- }, (error) => {
858
- throw WebrpcRequestFailedError.new({
859
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
688
+ return this.fetch(this.url('GetOffchainInventory'), createHttpRequest(JsonEncode(req, 'GetOffchainInventoryRequest'), headers, signal)).then(res => {
689
+ return buildResponse(res).then(_data => {
690
+ return JsonDecode(_data, 'GetOffchainInventoryResponse');
860
691
  });
692
+ }, error => {
693
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
861
694
  });
862
695
  };
863
696
  listOffchainInventories = (req, headers, signal) => {
864
- return this.fetch(this.url('ListOffchainInventories'), createHttpRequest((0, exports.JsonEncode)(req, 'ListOffchainInventoriesRequest'), headers, signal)).then((res) => {
865
- return buildResponse(res).then((_data) => {
866
- return (0, exports.JsonDecode)(_data, 'ListOffchainInventoriesResponse');
867
- });
868
- }, (error) => {
869
- throw WebrpcRequestFailedError.new({
870
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
697
+ return this.fetch(this.url('ListOffchainInventories'), createHttpRequest(JsonEncode(req, 'ListOffchainInventoriesRequest'), headers, signal)).then(res => {
698
+ return buildResponse(res).then(_data => {
699
+ return JsonDecode(_data, 'ListOffchainInventoriesResponse');
871
700
  });
701
+ }, error => {
702
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
872
703
  });
873
704
  };
874
705
  updateOffchainInventory = (req, headers, signal) => {
875
- return this.fetch(this.url('UpdateOffchainInventory'), createHttpRequest((0, exports.JsonEncode)(req, 'UpdateOffchainInventoryRequest'), headers, signal)).then((res) => {
876
- return buildResponse(res).then((_data) => {
877
- return (0, exports.JsonDecode)(_data, 'UpdateOffchainInventoryResponse');
878
- });
879
- }, (error) => {
880
- throw WebrpcRequestFailedError.new({
881
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
706
+ return this.fetch(this.url('UpdateOffchainInventory'), createHttpRequest(JsonEncode(req, 'UpdateOffchainInventoryRequest'), headers, signal)).then(res => {
707
+ return buildResponse(res).then(_data => {
708
+ return JsonDecode(_data, 'UpdateOffchainInventoryResponse');
882
709
  });
710
+ }, error => {
711
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
883
712
  });
884
713
  };
885
714
  deleteOffchainInventory = (req, headers, signal) => {
886
- return this.fetch(this.url('DeleteOffchainInventory'), createHttpRequest((0, exports.JsonEncode)(req, 'DeleteOffchainInventoryRequest'), headers, signal)).then((res) => {
887
- return buildResponse(res).then((_data) => {
888
- return (0, exports.JsonDecode)(_data, 'DeleteOffchainInventoryResponse');
889
- });
890
- }, (error) => {
891
- throw WebrpcRequestFailedError.new({
892
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
715
+ return this.fetch(this.url('DeleteOffchainInventory'), createHttpRequest(JsonEncode(req, 'DeleteOffchainInventoryRequest'), headers, signal)).then(res => {
716
+ return buildResponse(res).then(_data => {
717
+ return JsonDecode(_data, 'DeleteOffchainInventoryResponse');
893
718
  });
719
+ }, error => {
720
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
894
721
  });
895
722
  };
896
723
  requestOffchainPayment = (req, headers, signal) => {
897
- return this.fetch(this.url('RequestOffchainPayment'), createHttpRequest((0, exports.JsonEncode)(req, 'RequestOffchainPaymentRequest'), headers, signal)).then((res) => {
898
- return buildResponse(res).then((_data) => {
899
- return (0, exports.JsonDecode)(_data, 'RequestOffchainPaymentResponse');
900
- });
901
- }, (error) => {
902
- throw WebrpcRequestFailedError.new({
903
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
724
+ return this.fetch(this.url('RequestOffchainPayment'), createHttpRequest(JsonEncode(req, 'RequestOffchainPaymentRequest'), headers, signal)).then(res => {
725
+ return buildResponse(res).then(_data => {
726
+ return JsonDecode(_data, 'RequestOffchainPaymentResponse');
904
727
  });
728
+ }, error => {
729
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
905
730
  });
906
731
  };
907
732
  listOffchainPayments = (req, headers, signal) => {
908
- return this.fetch(this.url('ListOffchainPayments'), createHttpRequest((0, exports.JsonEncode)(req, 'ListOffchainPaymentsRequest'), headers, signal)).then((res) => {
909
- return buildResponse(res).then((_data) => {
910
- return (0, exports.JsonDecode)(_data, 'ListOffchainPaymentsResponse');
911
- });
912
- }, (error) => {
913
- throw WebrpcRequestFailedError.new({
914
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
733
+ return this.fetch(this.url('ListOffchainPayments'), createHttpRequest(JsonEncode(req, 'ListOffchainPaymentsRequest'), headers, signal)).then(res => {
734
+ return buildResponse(res).then(_data => {
735
+ return JsonDecode(_data, 'ListOffchainPaymentsResponse');
915
736
  });
737
+ }, error => {
738
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
916
739
  });
917
740
  };
918
741
  savePack = (req, headers, signal) => {
919
- return this.fetch(this.url('SavePack'), createHttpRequest((0, exports.JsonEncode)(req, 'SavePackRequest'), headers, signal)).then((res) => {
920
- return buildResponse(res).then((_data) => {
921
- return (0, exports.JsonDecode)(_data, 'SavePackResponse');
922
- });
923
- }, (error) => {
924
- throw WebrpcRequestFailedError.new({
925
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
742
+ return this.fetch(this.url('SavePack'), createHttpRequest(JsonEncode(req, 'SavePackRequest'), headers, signal)).then(res => {
743
+ return buildResponse(res).then(_data => {
744
+ return JsonDecode(_data, 'SavePackResponse');
926
745
  });
746
+ }, error => {
747
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
927
748
  });
928
749
  };
929
750
  getPack = (req, headers, signal) => {
930
- return this.fetch(this.url('GetPack'), createHttpRequest((0, exports.JsonEncode)(req, 'GetPackRequest'), headers, signal)).then((res) => {
931
- return buildResponse(res).then((_data) => {
932
- return (0, exports.JsonDecode)(_data, 'GetPackResponse');
933
- });
934
- }, (error) => {
935
- throw WebrpcRequestFailedError.new({
936
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
751
+ return this.fetch(this.url('GetPack'), createHttpRequest(JsonEncode(req, 'GetPackRequest'), headers, signal)).then(res => {
752
+ return buildResponse(res).then(_data => {
753
+ return JsonDecode(_data, 'GetPackResponse');
937
754
  });
755
+ }, error => {
756
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
938
757
  });
939
758
  };
940
759
  getPackIds = (req, headers, signal) => {
941
- return this.fetch(this.url('GetPackIds'), createHttpRequest((0, exports.JsonEncode)(req, 'GetPackIdsRequest'), headers, signal)).then((res) => {
942
- return buildResponse(res).then((_data) => {
943
- return (0, exports.JsonDecode)(_data, 'GetPackIdsResponse');
944
- });
945
- }, (error) => {
946
- throw WebrpcRequestFailedError.new({
947
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
760
+ return this.fetch(this.url('GetPackIds'), createHttpRequest(JsonEncode(req, 'GetPackIdsRequest'), headers, signal)).then(res => {
761
+ return buildResponse(res).then(_data => {
762
+ return JsonDecode(_data, 'GetPackIdsResponse');
948
763
  });
764
+ }, error => {
765
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
949
766
  });
950
767
  };
951
768
  deletePack = (req, headers, signal) => {
952
- return this.fetch(this.url('DeletePack'), createHttpRequest((0, exports.JsonEncode)(req, 'DeletePackRequest'), headers, signal)).then((res) => {
953
- return buildResponse(res).then((_data) => {
954
- return (0, exports.JsonDecode)(_data, 'DeletePackResponse');
955
- });
956
- }, (error) => {
957
- throw WebrpcRequestFailedError.new({
958
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
769
+ return this.fetch(this.url('DeletePack'), createHttpRequest(JsonEncode(req, 'DeletePackRequest'), headers, signal)).then(res => {
770
+ return buildResponse(res).then(_data => {
771
+ return JsonDecode(_data, 'DeletePackResponse');
959
772
  });
773
+ }, error => {
774
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
960
775
  });
961
776
  };
962
777
  updatePackContent = (req, headers, signal) => {
963
- return this.fetch(this.url('UpdatePackContent'), createHttpRequest((0, exports.JsonEncode)(req, 'UpdatePackContentRequest'), headers, signal)).then((res) => {
964
- return buildResponse(res).then((_data) => {
965
- return (0, exports.JsonDecode)(_data, 'UpdatePackContentResponse');
966
- });
967
- }, (error) => {
968
- throw WebrpcRequestFailedError.new({
969
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
778
+ return this.fetch(this.url('UpdatePackContent'), createHttpRequest(JsonEncode(req, 'UpdatePackContentRequest'), headers, signal)).then(res => {
779
+ return buildResponse(res).then(_data => {
780
+ return JsonDecode(_data, 'UpdatePackContentResponse');
970
781
  });
782
+ }, error => {
783
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
971
784
  });
972
785
  };
973
786
  getRevealTxData = (req, headers, signal) => {
974
- return this.fetch(this.url('GetRevealTxData'), createHttpRequest((0, exports.JsonEncode)(req, 'GetRevealTxDataRequest'), headers, signal)).then((res) => {
975
- return buildResponse(res).then((_data) => {
976
- return (0, exports.JsonDecode)(_data, 'GetRevealTxDataResponse');
977
- });
978
- }, (error) => {
979
- throw WebrpcRequestFailedError.new({
980
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
787
+ return this.fetch(this.url('GetRevealTxData'), createHttpRequest(JsonEncode(req, 'GetRevealTxDataRequest'), headers, signal)).then(res => {
788
+ return buildResponse(res).then(_data => {
789
+ return JsonDecode(_data, 'GetRevealTxDataResponse');
981
790
  });
791
+ }, error => {
792
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
982
793
  });
983
794
  };
984
795
  checkoutOptionsPrimary = (req, headers, signal) => {
985
- return this.fetch(this.url('CheckoutOptionsPrimary'), createHttpRequest((0, exports.JsonEncode)(req, 'CheckoutOptionsPrimaryRequest'), headers, signal)).then((res) => {
986
- return buildResponse(res).then((_data) => {
987
- return (0, exports.JsonDecode)(_data, 'CheckoutOptionsPrimaryResponse');
988
- });
989
- }, (error) => {
990
- throw WebrpcRequestFailedError.new({
991
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
796
+ return this.fetch(this.url('CheckoutOptionsPrimary'), createHttpRequest(JsonEncode(req, 'CheckoutOptionsPrimaryRequest'), headers, signal)).then(res => {
797
+ return buildResponse(res).then(_data => {
798
+ return JsonDecode(_data, 'CheckoutOptionsPrimaryResponse');
992
799
  });
800
+ }, error => {
801
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
993
802
  });
994
803
  };
995
804
  checkoutOptionsSecondary = (req, headers, signal) => {
996
- return this.fetch(this.url('CheckoutOptionsSecondary'), createHttpRequest((0, exports.JsonEncode)(req, 'CheckoutOptionsSecondaryRequest'), headers, signal)).then((res) => {
997
- return buildResponse(res).then((_data) => {
998
- return (0, exports.JsonDecode)(_data, 'CheckoutOptionsSecondaryResponse');
999
- });
1000
- }, (error) => {
1001
- throw WebrpcRequestFailedError.new({
1002
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
805
+ return this.fetch(this.url('CheckoutOptionsSecondary'), createHttpRequest(JsonEncode(req, 'CheckoutOptionsSecondaryRequest'), headers, signal)).then(res => {
806
+ return buildResponse(res).then(_data => {
807
+ return JsonDecode(_data, 'CheckoutOptionsSecondaryResponse');
1003
808
  });
809
+ }, error => {
810
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
1004
811
  });
1005
812
  };
1006
813
  checkoutOptionsGetTransakContractID = (req, headers, signal) => {
1007
- return this.fetch(this.url('CheckoutOptionsGetTransakContractID'), createHttpRequest((0, exports.JsonEncode)(req, 'CheckoutOptionsGetTransakContractIDRequest'), headers, signal)).then((res) => {
1008
- return buildResponse(res).then((_data) => {
1009
- return (0, exports.JsonDecode)(_data, 'CheckoutOptionsGetTransakContractIDResponse');
1010
- });
1011
- }, (error) => {
1012
- throw WebrpcRequestFailedError.new({
1013
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
814
+ return this.fetch(this.url('CheckoutOptionsGetTransakContractID'), createHttpRequest(JsonEncode(req, 'CheckoutOptionsGetTransakContractIDRequest'), headers, signal)).then(res => {
815
+ return buildResponse(res).then(_data => {
816
+ return JsonDecode(_data, 'CheckoutOptionsGetTransakContractIDResponse');
1014
817
  });
818
+ }, error => {
819
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
1015
820
  });
1016
821
  };
1017
822
  fortePayCreateIntent = (req, headers, signal) => {
1018
- return this.fetch(this.url('FortePayCreateIntent'), createHttpRequest((0, exports.JsonEncode)(req, 'FortePayCreateIntentRequest'), headers, signal)).then((res) => {
1019
- return buildResponse(res).then((_data) => {
1020
- return (0, exports.JsonDecode)(_data, 'FortePayCreateIntentResponse');
1021
- });
1022
- }, (error) => {
1023
- throw WebrpcRequestFailedError.new({
1024
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
823
+ return this.fetch(this.url('FortePayCreateIntent'), createHttpRequest(JsonEncode(req, 'FortePayCreateIntentRequest'), headers, signal)).then(res => {
824
+ return buildResponse(res).then(_data => {
825
+ return JsonDecode(_data, 'FortePayCreateIntentResponse');
1025
826
  });
827
+ }, error => {
828
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
1026
829
  });
1027
830
  };
1028
831
  fortePayGetPaymentStatuses = (req, headers, signal) => {
1029
- return this.fetch(this.url('FortePayGetPaymentStatuses'), createHttpRequest((0, exports.JsonEncode)(req, 'FortePayGetPaymentStatusesRequest'), headers, signal)).then((res) => {
1030
- return buildResponse(res).then((_data) => {
1031
- return (0, exports.JsonDecode)(_data, 'FortePayGetPaymentStatusesResponse');
1032
- });
1033
- }, (error) => {
1034
- throw WebrpcRequestFailedError.new({
1035
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
1036
- });
1037
- });
1038
- };
1039
- getCCTPTransfer = (req, headers, signal) => {
1040
- return this.fetch(this.url('GetCCTPTransfer'), createHttpRequest((0, exports.JsonEncode)(req, 'GetCCTPTransferRequest'), headers, signal)).then((res) => {
1041
- return buildResponse(res).then((_data) => {
1042
- return (0, exports.JsonDecode)(_data, 'GetCCTPTransferResponse');
1043
- });
1044
- }, (error) => {
1045
- throw WebrpcRequestFailedError.new({
1046
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
1047
- });
1048
- });
1049
- };
1050
- queueCCTPTransfer = (req, headers, signal) => {
1051
- return this.fetch(this.url('QueueCCTPTransfer'), createHttpRequest((0, exports.JsonEncode)(req, 'QueueCCTPTransferRequest'), headers, signal)).then((res) => {
1052
- return buildResponse(res).then((_data) => {
1053
- return (0, exports.JsonDecode)(_data, 'QueueCCTPTransferResponse');
1054
- });
1055
- }, (error) => {
1056
- throw WebrpcRequestFailedError.new({
1057
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
1058
- });
1059
- });
1060
- };
1061
- queueIntentConfigExecution = (req, headers, signal) => {
1062
- return this.fetch(this.url('QueueIntentConfigExecution'), createHttpRequest((0, exports.JsonEncode)(req, 'QueueIntentConfigExecutionRequest'), headers, signal)).then((res) => {
1063
- return buildResponse(res).then((_data) => {
1064
- return (0, exports.JsonDecode)(_data, 'QueueIntentConfigExecutionResponse');
1065
- });
1066
- }, (error) => {
1067
- throw WebrpcRequestFailedError.new({
1068
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
1069
- });
1070
- });
1071
- };
1072
- getIntentConfigExecutionStatus = (req, headers, signal) => {
1073
- return this.fetch(this.url('GetIntentConfigExecutionStatus'), createHttpRequest((0, exports.JsonEncode)(req, 'GetIntentConfigExecutionStatusRequest'), headers, signal)).then((res) => {
1074
- return buildResponse(res).then((_data) => {
1075
- return (0, exports.JsonDecode)(_data, 'GetIntentConfigExecutionStatusResponse');
1076
- });
1077
- }, (error) => {
1078
- throw WebrpcRequestFailedError.new({
1079
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
1080
- });
1081
- });
1082
- };
1083
- listIntentConfigs = (req, headers, signal) => {
1084
- return this.fetch(this.url('ListIntentConfigs'), createHttpRequest((0, exports.JsonEncode)(req, 'ListIntentConfigsRequest'), headers, signal)).then((res) => {
1085
- return buildResponse(res).then((_data) => {
1086
- return (0, exports.JsonDecode)(_data, 'ListIntentConfigsResponse');
1087
- });
1088
- }, (error) => {
1089
- throw WebrpcRequestFailedError.new({
1090
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
1091
- });
1092
- });
1093
- };
1094
- queueMetaTxnReceipt = (req, headers, signal) => {
1095
- return this.fetch(this.url('QueueMetaTxnReceipt'), createHttpRequest((0, exports.JsonEncode)(req, 'QueueMetaTxnReceiptRequest'), headers, signal)).then((res) => {
1096
- return buildResponse(res).then((_data) => {
1097
- return (0, exports.JsonDecode)(_data, 'QueueMetaTxnReceiptResponse');
1098
- });
1099
- }, (error) => {
1100
- throw WebrpcRequestFailedError.new({
1101
- cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`,
832
+ return this.fetch(this.url('FortePayGetPaymentStatuses'), createHttpRequest(JsonEncode(req, 'FortePayGetPaymentStatusesRequest'), headers, signal)).then(res => {
833
+ return buildResponse(res).then(_data => {
834
+ return JsonDecode(_data, 'FortePayGetPaymentStatusesResponse');
1102
835
  });
836
+ }, error => {
837
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` });
1103
838
  });
1104
839
  };
1105
840
  }
1106
- exports.API = API;
1107
841
  const createHttpRequest = (body = '{}', headers = {}, signal = null) => {
1108
842
  const reqHeaders = {
1109
843
  ...headers,
1110
844
  'Content-Type': 'application/json',
1111
- [exports.WebrpcHeader]: exports.WebrpcHeaderValue,
845
+ [WebrpcHeader]: WebrpcHeaderValue
1112
846
  };
1113
847
  return { method: 'POST', headers: reqHeaders, body, signal };
1114
848
  };
1115
849
  const buildResponse = (res) => {
1116
- return res.text().then((text) => {
850
+ return res.text().then(text => {
1117
851
  let data;
1118
852
  try {
1119
853
  data = JSON.parse(text);
@@ -1121,21 +855,20 @@ const buildResponse = (res) => {
1121
855
  catch (error) {
1122
856
  throw WebrpcBadResponseError.new({
1123
857
  status: res.status,
1124
- cause: `JSON.parse(): ${error instanceof Error ? error.message : String(error)}: response text: ${text}`,
858
+ cause: `JSON.parse(): ${error instanceof Error ? error.message : String(error)}: response text: ${text}`
1125
859
  });
1126
860
  }
1127
861
  if (!res.ok) {
1128
862
  const code = typeof data.code === 'number' ? data.code : 0;
1129
- throw (exports.webrpcErrorByCode[code] || WebrpcError).new(data);
863
+ throw (webrpcErrorByCode[code] || WebrpcError).new(data);
1130
864
  }
1131
865
  return data;
1132
866
  });
1133
867
  };
1134
- const JsonEncode = (obj, _typ = '') => {
868
+ export const JsonEncode = (obj, _typ = '') => {
1135
869
  return JSON.stringify(obj);
1136
870
  };
1137
- exports.JsonEncode = JsonEncode;
1138
- const JsonDecode = (data, _typ = '') => {
871
+ export const JsonDecode = (data, _typ = '') => {
1139
872
  let parsed = data;
1140
873
  if (typeof data === 'string') {
1141
874
  try {
@@ -1147,8 +880,7 @@ const JsonDecode = (data, _typ = '') => {
1147
880
  }
1148
881
  return parsed;
1149
882
  };
1150
- exports.JsonDecode = JsonDecode;
1151
- class WebrpcError extends Error {
883
+ export class WebrpcError extends Error {
1152
884
  code;
1153
885
  status;
1154
886
  constructor(error = {}) {
@@ -1165,8 +897,7 @@ class WebrpcError extends Error {
1165
897
  return new this({ message: payload.message, code: payload.code, status: payload.status, cause: payload.cause });
1166
898
  }
1167
899
  }
1168
- exports.WebrpcError = WebrpcError;
1169
- class WebrpcEndpointError extends WebrpcError {
900
+ export class WebrpcEndpointError extends WebrpcError {
1170
901
  constructor(error = {}) {
1171
902
  super(error);
1172
903
  this.name = error.name || 'WebrpcEndpoint';
@@ -1178,8 +909,7 @@ class WebrpcEndpointError extends WebrpcError {
1178
909
  Object.setPrototypeOf(this, WebrpcEndpointError.prototype);
1179
910
  }
1180
911
  }
1181
- exports.WebrpcEndpointError = WebrpcEndpointError;
1182
- class WebrpcRequestFailedError extends WebrpcError {
912
+ export class WebrpcRequestFailedError extends WebrpcError {
1183
913
  constructor(error = {}) {
1184
914
  super(error);
1185
915
  this.name = error.name || 'WebrpcRequestFailed';
@@ -1191,8 +921,7 @@ class WebrpcRequestFailedError extends WebrpcError {
1191
921
  Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype);
1192
922
  }
1193
923
  }
1194
- exports.WebrpcRequestFailedError = WebrpcRequestFailedError;
1195
- class WebrpcBadRouteError extends WebrpcError {
924
+ export class WebrpcBadRouteError extends WebrpcError {
1196
925
  constructor(error = {}) {
1197
926
  super(error);
1198
927
  this.name = error.name || 'WebrpcBadRoute';
@@ -1204,8 +933,7 @@ class WebrpcBadRouteError extends WebrpcError {
1204
933
  Object.setPrototypeOf(this, WebrpcBadRouteError.prototype);
1205
934
  }
1206
935
  }
1207
- exports.WebrpcBadRouteError = WebrpcBadRouteError;
1208
- class WebrpcBadMethodError extends WebrpcError {
936
+ export class WebrpcBadMethodError extends WebrpcError {
1209
937
  constructor(error = {}) {
1210
938
  super(error);
1211
939
  this.name = error.name || 'WebrpcBadMethod';
@@ -1217,8 +945,7 @@ class WebrpcBadMethodError extends WebrpcError {
1217
945
  Object.setPrototypeOf(this, WebrpcBadMethodError.prototype);
1218
946
  }
1219
947
  }
1220
- exports.WebrpcBadMethodError = WebrpcBadMethodError;
1221
- class WebrpcBadRequestError extends WebrpcError {
948
+ export class WebrpcBadRequestError extends WebrpcError {
1222
949
  constructor(error = {}) {
1223
950
  super(error);
1224
951
  this.name = error.name || 'WebrpcBadRequest';
@@ -1230,8 +957,7 @@ class WebrpcBadRequestError extends WebrpcError {
1230
957
  Object.setPrototypeOf(this, WebrpcBadRequestError.prototype);
1231
958
  }
1232
959
  }
1233
- exports.WebrpcBadRequestError = WebrpcBadRequestError;
1234
- class WebrpcBadResponseError extends WebrpcError {
960
+ export class WebrpcBadResponseError extends WebrpcError {
1235
961
  constructor(error = {}) {
1236
962
  super(error);
1237
963
  this.name = error.name || 'WebrpcBadResponse';
@@ -1243,8 +969,7 @@ class WebrpcBadResponseError extends WebrpcError {
1243
969
  Object.setPrototypeOf(this, WebrpcBadResponseError.prototype);
1244
970
  }
1245
971
  }
1246
- exports.WebrpcBadResponseError = WebrpcBadResponseError;
1247
- class WebrpcServerPanicError extends WebrpcError {
972
+ export class WebrpcServerPanicError extends WebrpcError {
1248
973
  constructor(error = {}) {
1249
974
  super(error);
1250
975
  this.name = error.name || 'WebrpcServerPanic';
@@ -1256,8 +981,7 @@ class WebrpcServerPanicError extends WebrpcError {
1256
981
  Object.setPrototypeOf(this, WebrpcServerPanicError.prototype);
1257
982
  }
1258
983
  }
1259
- exports.WebrpcServerPanicError = WebrpcServerPanicError;
1260
- class WebrpcInternalErrorError extends WebrpcError {
984
+ export class WebrpcInternalErrorError extends WebrpcError {
1261
985
  constructor(error = {}) {
1262
986
  super(error);
1263
987
  this.name = error.name || 'WebrpcInternalError';
@@ -1269,8 +993,7 @@ class WebrpcInternalErrorError extends WebrpcError {
1269
993
  Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype);
1270
994
  }
1271
995
  }
1272
- exports.WebrpcInternalErrorError = WebrpcInternalErrorError;
1273
- class WebrpcClientAbortedError extends WebrpcError {
996
+ export class WebrpcClientAbortedError extends WebrpcError {
1274
997
  constructor(error = {}) {
1275
998
  super(error);
1276
999
  this.name = error.name || 'WebrpcClientAborted';
@@ -1282,8 +1005,7 @@ class WebrpcClientAbortedError extends WebrpcError {
1282
1005
  Object.setPrototypeOf(this, WebrpcClientAbortedError.prototype);
1283
1006
  }
1284
1007
  }
1285
- exports.WebrpcClientAbortedError = WebrpcClientAbortedError;
1286
- class WebrpcStreamLostError extends WebrpcError {
1008
+ export class WebrpcStreamLostError extends WebrpcError {
1287
1009
  constructor(error = {}) {
1288
1010
  super(error);
1289
1011
  this.name = error.name || 'WebrpcStreamLost';
@@ -1295,8 +1017,7 @@ class WebrpcStreamLostError extends WebrpcError {
1295
1017
  Object.setPrototypeOf(this, WebrpcStreamLostError.prototype);
1296
1018
  }
1297
1019
  }
1298
- exports.WebrpcStreamLostError = WebrpcStreamLostError;
1299
- class WebrpcStreamFinishedError extends WebrpcError {
1020
+ export class WebrpcStreamFinishedError extends WebrpcError {
1300
1021
  constructor(error = {}) {
1301
1022
  super(error);
1302
1023
  this.name = error.name || 'WebrpcStreamFinished';
@@ -1308,11 +1029,10 @@ class WebrpcStreamFinishedError extends WebrpcError {
1308
1029
  Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype);
1309
1030
  }
1310
1031
  }
1311
- exports.WebrpcStreamFinishedError = WebrpcStreamFinishedError;
1312
1032
  //
1313
1033
  // Schema errors
1314
1034
  //
1315
- class UnauthorizedError extends WebrpcError {
1035
+ export class UnauthorizedError extends WebrpcError {
1316
1036
  constructor(error = {}) {
1317
1037
  super(error);
1318
1038
  this.name = error.name || 'Unauthorized';
@@ -1324,8 +1044,7 @@ class UnauthorizedError extends WebrpcError {
1324
1044
  Object.setPrototypeOf(this, UnauthorizedError.prototype);
1325
1045
  }
1326
1046
  }
1327
- exports.UnauthorizedError = UnauthorizedError;
1328
- class PermissionDeniedError extends WebrpcError {
1047
+ export class PermissionDeniedError extends WebrpcError {
1329
1048
  constructor(error = {}) {
1330
1049
  super(error);
1331
1050
  this.name = error.name || 'PermissionDenied';
@@ -1337,8 +1056,7 @@ class PermissionDeniedError extends WebrpcError {
1337
1056
  Object.setPrototypeOf(this, PermissionDeniedError.prototype);
1338
1057
  }
1339
1058
  }
1340
- exports.PermissionDeniedError = PermissionDeniedError;
1341
- class SessionExpiredError extends WebrpcError {
1059
+ export class SessionExpiredError extends WebrpcError {
1342
1060
  constructor(error = {}) {
1343
1061
  super(error);
1344
1062
  this.name = error.name || 'SessionExpired';
@@ -1350,8 +1068,7 @@ class SessionExpiredError extends WebrpcError {
1350
1068
  Object.setPrototypeOf(this, SessionExpiredError.prototype);
1351
1069
  }
1352
1070
  }
1353
- exports.SessionExpiredError = SessionExpiredError;
1354
- class MethodNotFoundError extends WebrpcError {
1071
+ export class MethodNotFoundError extends WebrpcError {
1355
1072
  constructor(error = {}) {
1356
1073
  super(error);
1357
1074
  this.name = error.name || 'MethodNotFound';
@@ -1363,8 +1080,7 @@ class MethodNotFoundError extends WebrpcError {
1363
1080
  Object.setPrototypeOf(this, MethodNotFoundError.prototype);
1364
1081
  }
1365
1082
  }
1366
- exports.MethodNotFoundError = MethodNotFoundError;
1367
- class RequestConflictError extends WebrpcError {
1083
+ export class RequestConflictError extends WebrpcError {
1368
1084
  constructor(error = {}) {
1369
1085
  super(error);
1370
1086
  this.name = error.name || 'RequestConflict';
@@ -1376,8 +1092,7 @@ class RequestConflictError extends WebrpcError {
1376
1092
  Object.setPrototypeOf(this, RequestConflictError.prototype);
1377
1093
  }
1378
1094
  }
1379
- exports.RequestConflictError = RequestConflictError;
1380
- class AbortedError extends WebrpcError {
1095
+ export class AbortedError extends WebrpcError {
1381
1096
  constructor(error = {}) {
1382
1097
  super(error);
1383
1098
  this.name = error.name || 'Aborted';
@@ -1389,8 +1104,7 @@ class AbortedError extends WebrpcError {
1389
1104
  Object.setPrototypeOf(this, AbortedError.prototype);
1390
1105
  }
1391
1106
  }
1392
- exports.AbortedError = AbortedError;
1393
- class GeoblockedError extends WebrpcError {
1107
+ export class GeoblockedError extends WebrpcError {
1394
1108
  constructor(error = {}) {
1395
1109
  super(error);
1396
1110
  this.name = error.name || 'Geoblocked';
@@ -1402,8 +1116,7 @@ class GeoblockedError extends WebrpcError {
1402
1116
  Object.setPrototypeOf(this, GeoblockedError.prototype);
1403
1117
  }
1404
1118
  }
1405
- exports.GeoblockedError = GeoblockedError;
1406
- class RateLimitedError extends WebrpcError {
1119
+ export class RateLimitedError extends WebrpcError {
1407
1120
  constructor(error = {}) {
1408
1121
  super(error);
1409
1122
  this.name = error.name || 'RateLimited';
@@ -1415,8 +1128,7 @@ class RateLimitedError extends WebrpcError {
1415
1128
  Object.setPrototypeOf(this, RateLimitedError.prototype);
1416
1129
  }
1417
1130
  }
1418
- exports.RateLimitedError = RateLimitedError;
1419
- class ProjectNotFoundError extends WebrpcError {
1131
+ export class ProjectNotFoundError extends WebrpcError {
1420
1132
  constructor(error = {}) {
1421
1133
  super(error);
1422
1134
  this.name = error.name || 'ProjectNotFound';
@@ -1428,8 +1140,7 @@ class ProjectNotFoundError extends WebrpcError {
1428
1140
  Object.setPrototypeOf(this, ProjectNotFoundError.prototype);
1429
1141
  }
1430
1142
  }
1431
- exports.ProjectNotFoundError = ProjectNotFoundError;
1432
- class AccessKeyNotFoundError extends WebrpcError {
1143
+ export class AccessKeyNotFoundError extends WebrpcError {
1433
1144
  constructor(error = {}) {
1434
1145
  super(error);
1435
1146
  this.name = error.name || 'AccessKeyNotFound';
@@ -1441,8 +1152,7 @@ class AccessKeyNotFoundError extends WebrpcError {
1441
1152
  Object.setPrototypeOf(this, AccessKeyNotFoundError.prototype);
1442
1153
  }
1443
1154
  }
1444
- exports.AccessKeyNotFoundError = AccessKeyNotFoundError;
1445
- class AccessKeyMismatchError extends WebrpcError {
1155
+ export class AccessKeyMismatchError extends WebrpcError {
1446
1156
  constructor(error = {}) {
1447
1157
  super(error);
1448
1158
  this.name = error.name || 'AccessKeyMismatch';
@@ -1454,8 +1164,7 @@ class AccessKeyMismatchError extends WebrpcError {
1454
1164
  Object.setPrototypeOf(this, AccessKeyMismatchError.prototype);
1455
1165
  }
1456
1166
  }
1457
- exports.AccessKeyMismatchError = AccessKeyMismatchError;
1458
- class InvalidOriginError extends WebrpcError {
1167
+ export class InvalidOriginError extends WebrpcError {
1459
1168
  constructor(error = {}) {
1460
1169
  super(error);
1461
1170
  this.name = error.name || 'InvalidOrigin';
@@ -1467,8 +1176,7 @@ class InvalidOriginError extends WebrpcError {
1467
1176
  Object.setPrototypeOf(this, InvalidOriginError.prototype);
1468
1177
  }
1469
1178
  }
1470
- exports.InvalidOriginError = InvalidOriginError;
1471
- class InvalidServiceError extends WebrpcError {
1179
+ export class InvalidServiceError extends WebrpcError {
1472
1180
  constructor(error = {}) {
1473
1181
  super(error);
1474
1182
  this.name = error.name || 'InvalidService';
@@ -1480,8 +1188,7 @@ class InvalidServiceError extends WebrpcError {
1480
1188
  Object.setPrototypeOf(this, InvalidServiceError.prototype);
1481
1189
  }
1482
1190
  }
1483
- exports.InvalidServiceError = InvalidServiceError;
1484
- class UnauthorizedUserError extends WebrpcError {
1191
+ export class UnauthorizedUserError extends WebrpcError {
1485
1192
  constructor(error = {}) {
1486
1193
  super(error);
1487
1194
  this.name = error.name || 'UnauthorizedUser';
@@ -1493,8 +1200,7 @@ class UnauthorizedUserError extends WebrpcError {
1493
1200
  Object.setPrototypeOf(this, UnauthorizedUserError.prototype);
1494
1201
  }
1495
1202
  }
1496
- exports.UnauthorizedUserError = UnauthorizedUserError;
1497
- class QuotaExceededError extends WebrpcError {
1203
+ export class QuotaExceededError extends WebrpcError {
1498
1204
  constructor(error = {}) {
1499
1205
  super(error);
1500
1206
  this.name = error.name || 'QuotaExceeded';
@@ -1506,8 +1212,7 @@ class QuotaExceededError extends WebrpcError {
1506
1212
  Object.setPrototypeOf(this, QuotaExceededError.prototype);
1507
1213
  }
1508
1214
  }
1509
- exports.QuotaExceededError = QuotaExceededError;
1510
- class QuotaRateLimitError extends WebrpcError {
1215
+ export class QuotaRateLimitError extends WebrpcError {
1511
1216
  constructor(error = {}) {
1512
1217
  super(error);
1513
1218
  this.name = error.name || 'QuotaRateLimit';
@@ -1519,8 +1224,7 @@ class QuotaRateLimitError extends WebrpcError {
1519
1224
  Object.setPrototypeOf(this, QuotaRateLimitError.prototype);
1520
1225
  }
1521
1226
  }
1522
- exports.QuotaRateLimitError = QuotaRateLimitError;
1523
- class NoDefaultKeyError extends WebrpcError {
1227
+ export class NoDefaultKeyError extends WebrpcError {
1524
1228
  constructor(error = {}) {
1525
1229
  super(error);
1526
1230
  this.name = error.name || 'NoDefaultKey';
@@ -1532,8 +1236,7 @@ class NoDefaultKeyError extends WebrpcError {
1532
1236
  Object.setPrototypeOf(this, NoDefaultKeyError.prototype);
1533
1237
  }
1534
1238
  }
1535
- exports.NoDefaultKeyError = NoDefaultKeyError;
1536
- class MaxAccessKeysError extends WebrpcError {
1239
+ export class MaxAccessKeysError extends WebrpcError {
1537
1240
  constructor(error = {}) {
1538
1241
  super(error);
1539
1242
  this.name = error.name || 'MaxAccessKeys';
@@ -1545,8 +1248,7 @@ class MaxAccessKeysError extends WebrpcError {
1545
1248
  Object.setPrototypeOf(this, MaxAccessKeysError.prototype);
1546
1249
  }
1547
1250
  }
1548
- exports.MaxAccessKeysError = MaxAccessKeysError;
1549
- class AtLeastOneKeyError extends WebrpcError {
1251
+ export class AtLeastOneKeyError extends WebrpcError {
1550
1252
  constructor(error = {}) {
1551
1253
  super(error);
1552
1254
  this.name = error.name || 'AtLeastOneKey';
@@ -1558,8 +1260,7 @@ class AtLeastOneKeyError extends WebrpcError {
1558
1260
  Object.setPrototypeOf(this, AtLeastOneKeyError.prototype);
1559
1261
  }
1560
1262
  }
1561
- exports.AtLeastOneKeyError = AtLeastOneKeyError;
1562
- class TimeoutError extends WebrpcError {
1263
+ export class TimeoutError extends WebrpcError {
1563
1264
  constructor(error = {}) {
1564
1265
  super(error);
1565
1266
  this.name = error.name || 'Timeout';
@@ -1571,8 +1272,7 @@ class TimeoutError extends WebrpcError {
1571
1272
  Object.setPrototypeOf(this, TimeoutError.prototype);
1572
1273
  }
1573
1274
  }
1574
- exports.TimeoutError = TimeoutError;
1575
- class InvalidArgumentError extends WebrpcError {
1275
+ export class InvalidArgumentError extends WebrpcError {
1576
1276
  constructor(error = {}) {
1577
1277
  super(error);
1578
1278
  this.name = error.name || 'InvalidArgument';
@@ -1584,8 +1284,7 @@ class InvalidArgumentError extends WebrpcError {
1584
1284
  Object.setPrototypeOf(this, InvalidArgumentError.prototype);
1585
1285
  }
1586
1286
  }
1587
- exports.InvalidArgumentError = InvalidArgumentError;
1588
- class UnavailableError extends WebrpcError {
1287
+ export class UnavailableError extends WebrpcError {
1589
1288
  constructor(error = {}) {
1590
1289
  super(error);
1591
1290
  this.name = error.name || 'Unavailable';
@@ -1597,8 +1296,7 @@ class UnavailableError extends WebrpcError {
1597
1296
  Object.setPrototypeOf(this, UnavailableError.prototype);
1598
1297
  }
1599
1298
  }
1600
- exports.UnavailableError = UnavailableError;
1601
- class QueryFailedError extends WebrpcError {
1299
+ export class QueryFailedError extends WebrpcError {
1602
1300
  constructor(error = {}) {
1603
1301
  super(error);
1604
1302
  this.name = error.name || 'QueryFailed';
@@ -1610,8 +1308,7 @@ class QueryFailedError extends WebrpcError {
1610
1308
  Object.setPrototypeOf(this, QueryFailedError.prototype);
1611
1309
  }
1612
1310
  }
1613
- exports.QueryFailedError = QueryFailedError;
1614
- class NotFoundError extends WebrpcError {
1311
+ export class NotFoundError extends WebrpcError {
1615
1312
  constructor(error = {}) {
1616
1313
  super(error);
1617
1314
  this.name = error.name || 'NotFound';
@@ -1623,8 +1320,7 @@ class NotFoundError extends WebrpcError {
1623
1320
  Object.setPrototypeOf(this, NotFoundError.prototype);
1624
1321
  }
1625
1322
  }
1626
- exports.NotFoundError = NotFoundError;
1627
- class UnsupportedNetworkError extends WebrpcError {
1323
+ export class UnsupportedNetworkError extends WebrpcError {
1628
1324
  constructor(error = {}) {
1629
1325
  super(error);
1630
1326
  this.name = error.name || 'UnsupportedNetwork';
@@ -1636,8 +1332,7 @@ class UnsupportedNetworkError extends WebrpcError {
1636
1332
  Object.setPrototypeOf(this, UnsupportedNetworkError.prototype);
1637
1333
  }
1638
1334
  }
1639
- exports.UnsupportedNetworkError = UnsupportedNetworkError;
1640
- var errors;
1335
+ export var errors;
1641
1336
  (function (errors) {
1642
1337
  errors["WebrpcEndpoint"] = "WebrpcEndpoint";
1643
1338
  errors["WebrpcRequestFailed"] = "WebrpcRequestFailed";
@@ -1675,8 +1370,8 @@ var errors;
1675
1370
  errors["QueryFailed"] = "QueryFailed";
1676
1371
  errors["NotFound"] = "NotFound";
1677
1372
  errors["UnsupportedNetwork"] = "UnsupportedNetwork";
1678
- })(errors || (exports.errors = errors = {}));
1679
- var WebrpcErrorCodes;
1373
+ })(errors || (errors = {}));
1374
+ export var WebrpcErrorCodes;
1680
1375
  (function (WebrpcErrorCodes) {
1681
1376
  WebrpcErrorCodes[WebrpcErrorCodes["WebrpcEndpoint"] = 0] = "WebrpcEndpoint";
1682
1377
  WebrpcErrorCodes[WebrpcErrorCodes["WebrpcRequestFailed"] = -1] = "WebrpcRequestFailed";
@@ -1714,8 +1409,8 @@ var WebrpcErrorCodes;
1714
1409
  WebrpcErrorCodes[WebrpcErrorCodes["QueryFailed"] = 2003] = "QueryFailed";
1715
1410
  WebrpcErrorCodes[WebrpcErrorCodes["NotFound"] = 3000] = "NotFound";
1716
1411
  WebrpcErrorCodes[WebrpcErrorCodes["UnsupportedNetwork"] = 3008] = "UnsupportedNetwork";
1717
- })(WebrpcErrorCodes || (exports.WebrpcErrorCodes = WebrpcErrorCodes = {}));
1718
- exports.webrpcErrorByCode = {
1412
+ })(WebrpcErrorCodes || (WebrpcErrorCodes = {}));
1413
+ export const webrpcErrorByCode = {
1719
1414
  [0]: WebrpcEndpointError,
1720
1415
  [-1]: WebrpcRequestFailedError,
1721
1416
  [-2]: WebrpcBadRouteError,
@@ -1751,22 +1446,22 @@ exports.webrpcErrorByCode = {
1751
1446
  [2002]: UnavailableError,
1752
1447
  [2003]: QueryFailedError,
1753
1448
  [3000]: NotFoundError,
1754
- [3008]: UnsupportedNetworkError,
1449
+ [3008]: UnsupportedNetworkError
1755
1450
  };
1756
1451
  //
1757
1452
  // Webrpc
1758
1453
  //
1759
- exports.WebrpcHeader = 'Webrpc';
1760
- exports.WebrpcHeaderValue = 'webrpc@v0.31.0;gen-typescript@v0.22.5;sequence-api@v0.4.0';
1761
- function VersionFromHeader(headers) {
1762
- const headerValue = headers.get(exports.WebrpcHeader);
1454
+ export const WebrpcHeader = 'Webrpc';
1455
+ export const WebrpcHeaderValue = 'webrpc@v0.31.0;gen-typescript@v0.22.5;sequence-api@v0.4.0';
1456
+ export function VersionFromHeader(headers) {
1457
+ const headerValue = headers.get(WebrpcHeader);
1763
1458
  if (!headerValue) {
1764
1459
  return {
1765
1460
  WebrpcGenVersion: '',
1766
1461
  codeGenName: '',
1767
1462
  codeGenVersion: '',
1768
1463
  schemaName: '',
1769
- schemaVersion: '',
1464
+ schemaVersion: ''
1770
1465
  };
1771
1466
  }
1772
1467
  return parseWebrpcGenVersions(headerValue);
@@ -1779,7 +1474,7 @@ function parseWebrpcGenVersions(header) {
1779
1474
  codeGenName: '',
1780
1475
  codeGenVersion: '',
1781
1476
  schemaName: '',
1782
- schemaVersion: '',
1477
+ schemaVersion: ''
1783
1478
  };
1784
1479
  }
1785
1480
  const [_, WebrpcGenVersion] = versions[0].split('@');
@@ -1790,6 +1485,6 @@ function parseWebrpcGenVersions(header) {
1790
1485
  codeGenName: codeGenName ?? '',
1791
1486
  codeGenVersion: codeGenVersion ?? '',
1792
1487
  schemaName: schemaName ?? '',
1793
- schemaVersion: schemaVersion ?? '',
1488
+ schemaVersion: schemaVersion ?? ''
1794
1489
  };
1795
1490
  }