@0xsequence/api 2.3.35 → 3.0.0-beta.2
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/.turbo/turbo-build.log +5 -0
- package/CHANGELOG.md +2166 -0
- package/LICENSE +0 -17
- package/README.md +1 -2
- package/dist/api.gen.d.ts +1887 -0
- package/dist/api.gen.d.ts.map +1 -0
- package/dist/api.gen.js +1795 -0
- package/dist/{declarations/src/index.d.ts → index.d.ts} +3 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/package.json +19 -13
- package/src/api.gen.ts +3068 -2429
- package/src/index.ts +1 -1
- package/tsconfig.json +10 -0
- package/dist/0xsequence-api.cjs.d.ts +0 -2
- package/dist/0xsequence-api.cjs.dev.js +0 -1743
- package/dist/0xsequence-api.cjs.js +0 -7
- package/dist/0xsequence-api.cjs.prod.js +0 -1743
- package/dist/0xsequence-api.esm.js +0 -1683
- package/dist/declarations/src/api.gen.d.ts +0 -1795
package/dist/api.gen.js
ADDED
|
@@ -0,0 +1,1795 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
// sequence-api v0.4.0 d7026da603b2c29baf21c6aceeebc86eada372d8
|
|
4
|
+
// --
|
|
5
|
+
// Code generated by Webrpc-gen@v0.31.0 with typescript generator. DO NOT EDIT.
|
|
6
|
+
//
|
|
7
|
+
// 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
|
+
// Webrpc description and code-gen version
|
|
13
|
+
exports.WebrpcVersion = 'v1';
|
|
14
|
+
// Schema version of your RIDL schema
|
|
15
|
+
exports.WebrpcSchemaVersion = 'v0.4.0';
|
|
16
|
+
// Schema hash generated from your RIDL schema
|
|
17
|
+
exports.WebrpcSchemaHash = 'd7026da603b2c29baf21c6aceeebc86eada372d8';
|
|
18
|
+
//
|
|
19
|
+
// Schema types
|
|
20
|
+
//
|
|
21
|
+
var SortOrder;
|
|
22
|
+
(function (SortOrder) {
|
|
23
|
+
SortOrder["DESC"] = "DESC";
|
|
24
|
+
SortOrder["ASC"] = "ASC";
|
|
25
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
26
|
+
var GetLifiSwapRouteDirection;
|
|
27
|
+
(function (GetLifiSwapRouteDirection) {
|
|
28
|
+
GetLifiSwapRouteDirection["to"] = "to";
|
|
29
|
+
GetLifiSwapRouteDirection["from"] = "from";
|
|
30
|
+
})(GetLifiSwapRouteDirection || (exports.GetLifiSwapRouteDirection = GetLifiSwapRouteDirection = {}));
|
|
31
|
+
var TokenType;
|
|
32
|
+
(function (TokenType) {
|
|
33
|
+
TokenType["ERC20"] = "ERC20";
|
|
34
|
+
TokenType["ERC721"] = "ERC721";
|
|
35
|
+
TokenType["ERC1155"] = "ERC1155";
|
|
36
|
+
})(TokenType || (exports.TokenType = TokenType = {}));
|
|
37
|
+
var TransakBuySell;
|
|
38
|
+
(function (TransakBuySell) {
|
|
39
|
+
TransakBuySell["UNKNOWN"] = "UNKNOWN";
|
|
40
|
+
TransakBuySell["BUY"] = "BUY";
|
|
41
|
+
TransakBuySell["SELL"] = "SELL";
|
|
42
|
+
})(TransakBuySell || (exports.TransakBuySell = TransakBuySell = {}));
|
|
43
|
+
var TradeType;
|
|
44
|
+
(function (TradeType) {
|
|
45
|
+
TradeType["EXACT_INPUT"] = "EXACT_INPUT";
|
|
46
|
+
TradeType["EXACT_OUTPUT"] = "EXACT_OUTPUT";
|
|
47
|
+
})(TradeType || (exports.TradeType = TradeType = {}));
|
|
48
|
+
var CheckoutOptionCrypto;
|
|
49
|
+
(function (CheckoutOptionCrypto) {
|
|
50
|
+
CheckoutOptionCrypto["none"] = "none";
|
|
51
|
+
CheckoutOptionCrypto["partially"] = "partially";
|
|
52
|
+
CheckoutOptionCrypto["all"] = "all";
|
|
53
|
+
})(CheckoutOptionCrypto || (exports.CheckoutOptionCrypto = CheckoutOptionCrypto = {}));
|
|
54
|
+
var CheckoutOptionNFTCheckoutProvider;
|
|
55
|
+
(function (CheckoutOptionNFTCheckoutProvider) {
|
|
56
|
+
CheckoutOptionNFTCheckoutProvider["unknown"] = "unknown";
|
|
57
|
+
CheckoutOptionNFTCheckoutProvider["transak"] = "transak";
|
|
58
|
+
})(CheckoutOptionNFTCheckoutProvider || (exports.CheckoutOptionNFTCheckoutProvider = CheckoutOptionNFTCheckoutProvider = {}));
|
|
59
|
+
var CheckoutOptionOnRampProvider;
|
|
60
|
+
(function (CheckoutOptionOnRampProvider) {
|
|
61
|
+
CheckoutOptionOnRampProvider["unknown"] = "unknown";
|
|
62
|
+
CheckoutOptionOnRampProvider["transak"] = "transak";
|
|
63
|
+
})(CheckoutOptionOnRampProvider || (exports.CheckoutOptionOnRampProvider = CheckoutOptionOnRampProvider = {}));
|
|
64
|
+
var CheckoutOptionSwapProvider;
|
|
65
|
+
(function (CheckoutOptionSwapProvider) {
|
|
66
|
+
CheckoutOptionSwapProvider["unknown"] = "unknown";
|
|
67
|
+
CheckoutOptionSwapProvider["lifi"] = "lifi";
|
|
68
|
+
})(CheckoutOptionSwapProvider || (exports.CheckoutOptionSwapProvider = CheckoutOptionSwapProvider = {}));
|
|
69
|
+
//
|
|
70
|
+
// Client
|
|
71
|
+
//
|
|
72
|
+
class API {
|
|
73
|
+
hostname;
|
|
74
|
+
fetch;
|
|
75
|
+
path = '/rpc/API/';
|
|
76
|
+
constructor(hostname, fetch) {
|
|
77
|
+
this.hostname = hostname.replace(/\/*$/, '');
|
|
78
|
+
this.fetch = (input, init) => fetch(input, init);
|
|
79
|
+
}
|
|
80
|
+
url(name) {
|
|
81
|
+
return this.hostname + this.path + name;
|
|
82
|
+
}
|
|
83
|
+
queryKey = {
|
|
84
|
+
ping: () => ['API', 'ping'],
|
|
85
|
+
version: () => ['API', 'version'],
|
|
86
|
+
runtimeStatus: () => ['API', 'runtimeStatus'],
|
|
87
|
+
clock: () => ['API', 'clock'],
|
|
88
|
+
getSequenceContext: () => ['API', 'getSequenceContext'],
|
|
89
|
+
getAuthToken: (req) => ['API', 'getAuthToken', req],
|
|
90
|
+
getAuthToken2: (req) => ['API', 'getAuthToken2', req],
|
|
91
|
+
sendPasswordlessLink: (req) => ['API', 'sendPasswordlessLink', req],
|
|
92
|
+
registerPublicKey: (req) => ['API', 'registerPublicKey', req],
|
|
93
|
+
getPublicKey: (req) => ['API', 'getPublicKey', req],
|
|
94
|
+
friendList: (req) => ['API', 'friendList', req],
|
|
95
|
+
getFriendByAddress: (req) => ['API', 'getFriendByAddress', req],
|
|
96
|
+
searchFriends: (req) => ['API', 'searchFriends', req],
|
|
97
|
+
addFriend: (req) => ['API', 'addFriend', req],
|
|
98
|
+
updateFriendNickname: (req) => ['API', 'updateFriendNickname', req],
|
|
99
|
+
removeFriend: (req) => ['API', 'removeFriend', req],
|
|
100
|
+
contractCall: (req) => ['API', 'contractCall', req],
|
|
101
|
+
decodeContractCall: (req) => ['API', 'decodeContractCall', req],
|
|
102
|
+
lookupContractCallSelectors: (req) => ['API', 'lookupContractCallSelectors', req],
|
|
103
|
+
userStorageFetch: (req) => ['API', 'userStorageFetch', req],
|
|
104
|
+
userStorageSave: (req) => ['API', 'userStorageSave', req],
|
|
105
|
+
userStorageDelete: (req) => ['API', 'userStorageDelete', req],
|
|
106
|
+
userStorageFetchAll: (req) => ['API', 'userStorageFetchAll', req],
|
|
107
|
+
getMoonpayLink: (req) => ['API', 'getMoonpayLink', req],
|
|
108
|
+
resolveENSAddress: (req) => ['API', 'resolveENSAddress', req],
|
|
109
|
+
isValidSignature: (req) => ['API', 'isValidSignature', req],
|
|
110
|
+
isValidMessageSignature: (req) => ['API', 'isValidMessageSignature', req],
|
|
111
|
+
isValidTypedDataSignature: (req) => ['API', 'isValidTypedDataSignature', req],
|
|
112
|
+
isValidETHAuthProof: (req) => ['API', 'isValidETHAuthProof', req],
|
|
113
|
+
getOnRampURL: (req) => ['API', 'getOnRampURL', req],
|
|
114
|
+
transakGetCountries: () => ['API', 'transakGetCountries'],
|
|
115
|
+
transakGetCryptoCurrencies: () => ['API', 'transakGetCryptoCurrencies'],
|
|
116
|
+
transakGetFiatCurrencies: () => ['API', 'transakGetFiatCurrencies'],
|
|
117
|
+
transakGetPrice: (req) => ['API', 'transakGetPrice', req],
|
|
118
|
+
transakGetSupportedNFTCheckoutChains: () => ['API', 'transakGetSupportedNFTCheckoutChains'],
|
|
119
|
+
transakGetWidgetURL: (req) => ['API', 'transakGetWidgetURL', req],
|
|
120
|
+
getCoinPrices: (req) => ['API', 'getCoinPrices', req],
|
|
121
|
+
getCollectiblePrices: (req) => ['API', 'getCollectiblePrices', req],
|
|
122
|
+
getExchangeRate: (req) => ['API', 'getExchangeRate', req],
|
|
123
|
+
memoryStore: (req) => ['API', 'memoryStore', req],
|
|
124
|
+
memoryLoad: (req) => ['API', 'memoryLoad', req],
|
|
125
|
+
getInviteInfo: () => ['API', 'getInviteInfo'],
|
|
126
|
+
isValidAccessCode: (req) => ['API', 'isValidAccessCode', req],
|
|
127
|
+
internalClaimAccessCode: (req) => ['API', 'internalClaimAccessCode', req],
|
|
128
|
+
blockNumberAtTime: (req) => ['API', 'blockNumberAtTime', req],
|
|
129
|
+
paperSessionSecret: (req) => ['API', 'paperSessionSecret', req],
|
|
130
|
+
paperSessionSecret2: (req) => ['API', 'paperSessionSecret2', req],
|
|
131
|
+
linkWallet: (req) => ['API', 'linkWallet', req],
|
|
132
|
+
getLinkedWallets: (req) => ['API', 'getLinkedWallets', req],
|
|
133
|
+
removeLinkedWallet: (req) => ['API', 'removeLinkedWallet', req],
|
|
134
|
+
generateWaaSVerificationURL: (req) => ['API', 'generateWaaSVerificationURL', req],
|
|
135
|
+
validateWaaSVerificationNonce: (req) => ['API', 'validateWaaSVerificationNonce', req],
|
|
136
|
+
listAdoptedWallets: (req) => ['API', 'listAdoptedWallets', req],
|
|
137
|
+
getLifiChains: () => ['API', 'getLifiChains'],
|
|
138
|
+
getLifiTokens: (req) => ['API', 'getLifiTokens', req],
|
|
139
|
+
getLifiSwapRoutes: (req) => ['API', 'getLifiSwapRoutes', req],
|
|
140
|
+
getLifiSwapQuote: (req) => ['API', 'getLifiSwapQuote', req],
|
|
141
|
+
getIntentCallsPayloads: (req) => ['API', 'getIntentCallsPayloads', req],
|
|
142
|
+
commitIntentConfig: (req) => ['API', 'commitIntentConfig', req],
|
|
143
|
+
getIntentConfig: (req) => ['API', 'getIntentConfig', req],
|
|
144
|
+
listCurrencyGroups: () => ['API', 'listCurrencyGroups'],
|
|
145
|
+
addOffchainInventory: (req) => ['API', 'addOffchainInventory', req],
|
|
146
|
+
getOffchainInventory: (req) => ['API', 'getOffchainInventory', req],
|
|
147
|
+
listOffchainInventories: (req) => ['API', 'listOffchainInventories', req],
|
|
148
|
+
updateOffchainInventory: (req) => ['API', 'updateOffchainInventory', req],
|
|
149
|
+
deleteOffchainInventory: (req) => ['API', 'deleteOffchainInventory', req],
|
|
150
|
+
requestOffchainPayment: (req) => ['API', 'requestOffchainPayment', req],
|
|
151
|
+
listOffchainPayments: (req) => ['API', 'listOffchainPayments', req],
|
|
152
|
+
savePack: (req) => ['API', 'savePack', req],
|
|
153
|
+
getPack: (req) => ['API', 'getPack', req],
|
|
154
|
+
getPackIds: (req) => ['API', 'getPackIds', req],
|
|
155
|
+
deletePack: (req) => ['API', 'deletePack', req],
|
|
156
|
+
updatePackContent: (req) => ['API', 'updatePackContent', req],
|
|
157
|
+
getRevealTxData: (req) => ['API', 'getRevealTxData', req],
|
|
158
|
+
checkoutOptionsPrimary: (req) => ['API', 'checkoutOptionsPrimary', req],
|
|
159
|
+
checkoutOptionsSecondary: (req) => ['API', 'checkoutOptionsSecondary', req],
|
|
160
|
+
checkoutOptionsGetTransakContractID: (req) => ['API', 'checkoutOptionsGetTransakContractID', req],
|
|
161
|
+
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],
|
|
169
|
+
};
|
|
170
|
+
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)}`,
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
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)}`,
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
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)}`,
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
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)}`,
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
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)}`,
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
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)}`,
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
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)}`,
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
};
|
|
247
|
+
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)}`,
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
};
|
|
258
|
+
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)}`,
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
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)}`,
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
};
|
|
280
|
+
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)}`,
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
};
|
|
291
|
+
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)}`,
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
};
|
|
302
|
+
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)}`,
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
};
|
|
313
|
+
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)}`,
|
|
321
|
+
});
|
|
322
|
+
});
|
|
323
|
+
};
|
|
324
|
+
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)}`,
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
};
|
|
335
|
+
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)}`,
|
|
343
|
+
});
|
|
344
|
+
});
|
|
345
|
+
};
|
|
346
|
+
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)}`,
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
};
|
|
357
|
+
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)}`,
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
};
|
|
368
|
+
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)}`,
|
|
376
|
+
});
|
|
377
|
+
});
|
|
378
|
+
};
|
|
379
|
+
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)}`,
|
|
387
|
+
});
|
|
388
|
+
});
|
|
389
|
+
};
|
|
390
|
+
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)}`,
|
|
398
|
+
});
|
|
399
|
+
});
|
|
400
|
+
};
|
|
401
|
+
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)}`,
|
|
409
|
+
});
|
|
410
|
+
});
|
|
411
|
+
};
|
|
412
|
+
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)}`,
|
|
420
|
+
});
|
|
421
|
+
});
|
|
422
|
+
};
|
|
423
|
+
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)}`,
|
|
431
|
+
});
|
|
432
|
+
});
|
|
433
|
+
};
|
|
434
|
+
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)}`,
|
|
442
|
+
});
|
|
443
|
+
});
|
|
444
|
+
};
|
|
445
|
+
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)}`,
|
|
453
|
+
});
|
|
454
|
+
});
|
|
455
|
+
};
|
|
456
|
+
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)}`,
|
|
464
|
+
});
|
|
465
|
+
});
|
|
466
|
+
};
|
|
467
|
+
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)}`,
|
|
475
|
+
});
|
|
476
|
+
});
|
|
477
|
+
};
|
|
478
|
+
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)}`,
|
|
486
|
+
});
|
|
487
|
+
});
|
|
488
|
+
};
|
|
489
|
+
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)}`,
|
|
497
|
+
});
|
|
498
|
+
});
|
|
499
|
+
};
|
|
500
|
+
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)}`,
|
|
508
|
+
});
|
|
509
|
+
});
|
|
510
|
+
};
|
|
511
|
+
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)}`,
|
|
519
|
+
});
|
|
520
|
+
});
|
|
521
|
+
};
|
|
522
|
+
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)}`,
|
|
530
|
+
});
|
|
531
|
+
});
|
|
532
|
+
};
|
|
533
|
+
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)}`,
|
|
541
|
+
});
|
|
542
|
+
});
|
|
543
|
+
};
|
|
544
|
+
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)}`,
|
|
552
|
+
});
|
|
553
|
+
});
|
|
554
|
+
};
|
|
555
|
+
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)}`,
|
|
563
|
+
});
|
|
564
|
+
});
|
|
565
|
+
};
|
|
566
|
+
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)}`,
|
|
574
|
+
});
|
|
575
|
+
});
|
|
576
|
+
};
|
|
577
|
+
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)}`,
|
|
585
|
+
});
|
|
586
|
+
});
|
|
587
|
+
};
|
|
588
|
+
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)}`,
|
|
596
|
+
});
|
|
597
|
+
});
|
|
598
|
+
};
|
|
599
|
+
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)}`,
|
|
607
|
+
});
|
|
608
|
+
});
|
|
609
|
+
};
|
|
610
|
+
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)}`,
|
|
618
|
+
});
|
|
619
|
+
});
|
|
620
|
+
};
|
|
621
|
+
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)}`,
|
|
629
|
+
});
|
|
630
|
+
});
|
|
631
|
+
};
|
|
632
|
+
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)}`,
|
|
640
|
+
});
|
|
641
|
+
});
|
|
642
|
+
};
|
|
643
|
+
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)}`,
|
|
651
|
+
});
|
|
652
|
+
});
|
|
653
|
+
};
|
|
654
|
+
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)}`,
|
|
662
|
+
});
|
|
663
|
+
});
|
|
664
|
+
};
|
|
665
|
+
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)}`,
|
|
673
|
+
});
|
|
674
|
+
});
|
|
675
|
+
};
|
|
676
|
+
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)}`,
|
|
684
|
+
});
|
|
685
|
+
});
|
|
686
|
+
};
|
|
687
|
+
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)}`,
|
|
695
|
+
});
|
|
696
|
+
});
|
|
697
|
+
};
|
|
698
|
+
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)}`,
|
|
706
|
+
});
|
|
707
|
+
});
|
|
708
|
+
};
|
|
709
|
+
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)}`,
|
|
717
|
+
});
|
|
718
|
+
});
|
|
719
|
+
};
|
|
720
|
+
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)}`,
|
|
728
|
+
});
|
|
729
|
+
});
|
|
730
|
+
};
|
|
731
|
+
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)}`,
|
|
739
|
+
});
|
|
740
|
+
});
|
|
741
|
+
};
|
|
742
|
+
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)}`,
|
|
750
|
+
});
|
|
751
|
+
});
|
|
752
|
+
};
|
|
753
|
+
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)}`,
|
|
761
|
+
});
|
|
762
|
+
});
|
|
763
|
+
};
|
|
764
|
+
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)}`,
|
|
772
|
+
});
|
|
773
|
+
});
|
|
774
|
+
};
|
|
775
|
+
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)}`,
|
|
783
|
+
});
|
|
784
|
+
});
|
|
785
|
+
};
|
|
786
|
+
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)}`,
|
|
827
|
+
});
|
|
828
|
+
});
|
|
829
|
+
};
|
|
830
|
+
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)}`,
|
|
838
|
+
});
|
|
839
|
+
});
|
|
840
|
+
};
|
|
841
|
+
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)}`,
|
|
849
|
+
});
|
|
850
|
+
});
|
|
851
|
+
};
|
|
852
|
+
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)}`,
|
|
860
|
+
});
|
|
861
|
+
});
|
|
862
|
+
};
|
|
863
|
+
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)}`,
|
|
871
|
+
});
|
|
872
|
+
});
|
|
873
|
+
};
|
|
874
|
+
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)}`,
|
|
882
|
+
});
|
|
883
|
+
});
|
|
884
|
+
};
|
|
885
|
+
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)}`,
|
|
893
|
+
});
|
|
894
|
+
});
|
|
895
|
+
};
|
|
896
|
+
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)}`,
|
|
904
|
+
});
|
|
905
|
+
});
|
|
906
|
+
};
|
|
907
|
+
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)}`,
|
|
915
|
+
});
|
|
916
|
+
});
|
|
917
|
+
};
|
|
918
|
+
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)}`,
|
|
926
|
+
});
|
|
927
|
+
});
|
|
928
|
+
};
|
|
929
|
+
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)}`,
|
|
937
|
+
});
|
|
938
|
+
});
|
|
939
|
+
};
|
|
940
|
+
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)}`,
|
|
948
|
+
});
|
|
949
|
+
});
|
|
950
|
+
};
|
|
951
|
+
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)}`,
|
|
959
|
+
});
|
|
960
|
+
});
|
|
961
|
+
};
|
|
962
|
+
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)}`,
|
|
970
|
+
});
|
|
971
|
+
});
|
|
972
|
+
};
|
|
973
|
+
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)}`,
|
|
981
|
+
});
|
|
982
|
+
});
|
|
983
|
+
};
|
|
984
|
+
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)}`,
|
|
992
|
+
});
|
|
993
|
+
});
|
|
994
|
+
};
|
|
995
|
+
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)}`,
|
|
1003
|
+
});
|
|
1004
|
+
});
|
|
1005
|
+
};
|
|
1006
|
+
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)}`,
|
|
1014
|
+
});
|
|
1015
|
+
});
|
|
1016
|
+
};
|
|
1017
|
+
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)}`,
|
|
1025
|
+
});
|
|
1026
|
+
});
|
|
1027
|
+
};
|
|
1028
|
+
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)}`,
|
|
1102
|
+
});
|
|
1103
|
+
});
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
exports.API = API;
|
|
1107
|
+
const createHttpRequest = (body = '{}', headers = {}, signal = null) => {
|
|
1108
|
+
const reqHeaders = {
|
|
1109
|
+
...headers,
|
|
1110
|
+
'Content-Type': 'application/json',
|
|
1111
|
+
[exports.WebrpcHeader]: exports.WebrpcHeaderValue,
|
|
1112
|
+
};
|
|
1113
|
+
return { method: 'POST', headers: reqHeaders, body, signal };
|
|
1114
|
+
};
|
|
1115
|
+
const buildResponse = (res) => {
|
|
1116
|
+
return res.text().then((text) => {
|
|
1117
|
+
let data;
|
|
1118
|
+
try {
|
|
1119
|
+
data = JSON.parse(text);
|
|
1120
|
+
}
|
|
1121
|
+
catch (error) {
|
|
1122
|
+
throw WebrpcBadResponseError.new({
|
|
1123
|
+
status: res.status,
|
|
1124
|
+
cause: `JSON.parse(): ${error instanceof Error ? error.message : String(error)}: response text: ${text}`,
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
if (!res.ok) {
|
|
1128
|
+
const code = typeof data.code === 'number' ? data.code : 0;
|
|
1129
|
+
throw (exports.webrpcErrorByCode[code] || WebrpcError).new(data);
|
|
1130
|
+
}
|
|
1131
|
+
return data;
|
|
1132
|
+
});
|
|
1133
|
+
};
|
|
1134
|
+
const JsonEncode = (obj, _typ = '') => {
|
|
1135
|
+
return JSON.stringify(obj);
|
|
1136
|
+
};
|
|
1137
|
+
exports.JsonEncode = JsonEncode;
|
|
1138
|
+
const JsonDecode = (data, _typ = '') => {
|
|
1139
|
+
let parsed = data;
|
|
1140
|
+
if (typeof data === 'string') {
|
|
1141
|
+
try {
|
|
1142
|
+
parsed = JSON.parse(data);
|
|
1143
|
+
}
|
|
1144
|
+
catch (err) {
|
|
1145
|
+
throw WebrpcBadResponseError.new({ cause: `JsonDecode: JSON.parse failed: ${err.message}` });
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
return parsed;
|
|
1149
|
+
};
|
|
1150
|
+
exports.JsonDecode = JsonDecode;
|
|
1151
|
+
class WebrpcError extends Error {
|
|
1152
|
+
code;
|
|
1153
|
+
status;
|
|
1154
|
+
constructor(error = {}) {
|
|
1155
|
+
super(error.message);
|
|
1156
|
+
this.name = error.name || 'WebrpcEndpointError';
|
|
1157
|
+
this.code = typeof error.code === 'number' ? error.code : 0;
|
|
1158
|
+
this.message = error.message || `endpoint error`;
|
|
1159
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1160
|
+
if (error.cause !== undefined)
|
|
1161
|
+
this.cause = error.cause;
|
|
1162
|
+
Object.setPrototypeOf(this, WebrpcError.prototype);
|
|
1163
|
+
}
|
|
1164
|
+
static new(payload) {
|
|
1165
|
+
return new this({ message: payload.message, code: payload.code, status: payload.status, cause: payload.cause });
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
exports.WebrpcError = WebrpcError;
|
|
1169
|
+
class WebrpcEndpointError extends WebrpcError {
|
|
1170
|
+
constructor(error = {}) {
|
|
1171
|
+
super(error);
|
|
1172
|
+
this.name = error.name || 'WebrpcEndpoint';
|
|
1173
|
+
this.code = typeof error.code === 'number' ? error.code : 0;
|
|
1174
|
+
this.message = error.message || `endpoint error`;
|
|
1175
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1176
|
+
if (error.cause !== undefined)
|
|
1177
|
+
this.cause = error.cause;
|
|
1178
|
+
Object.setPrototypeOf(this, WebrpcEndpointError.prototype);
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
exports.WebrpcEndpointError = WebrpcEndpointError;
|
|
1182
|
+
class WebrpcRequestFailedError extends WebrpcError {
|
|
1183
|
+
constructor(error = {}) {
|
|
1184
|
+
super(error);
|
|
1185
|
+
this.name = error.name || 'WebrpcRequestFailed';
|
|
1186
|
+
this.code = typeof error.code === 'number' ? error.code : -1;
|
|
1187
|
+
this.message = error.message || `request failed`;
|
|
1188
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1189
|
+
if (error.cause !== undefined)
|
|
1190
|
+
this.cause = error.cause;
|
|
1191
|
+
Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype);
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
exports.WebrpcRequestFailedError = WebrpcRequestFailedError;
|
|
1195
|
+
class WebrpcBadRouteError extends WebrpcError {
|
|
1196
|
+
constructor(error = {}) {
|
|
1197
|
+
super(error);
|
|
1198
|
+
this.name = error.name || 'WebrpcBadRoute';
|
|
1199
|
+
this.code = typeof error.code === 'number' ? error.code : -2;
|
|
1200
|
+
this.message = error.message || `bad route`;
|
|
1201
|
+
this.status = typeof error.status === 'number' ? error.status : 404;
|
|
1202
|
+
if (error.cause !== undefined)
|
|
1203
|
+
this.cause = error.cause;
|
|
1204
|
+
Object.setPrototypeOf(this, WebrpcBadRouteError.prototype);
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
exports.WebrpcBadRouteError = WebrpcBadRouteError;
|
|
1208
|
+
class WebrpcBadMethodError extends WebrpcError {
|
|
1209
|
+
constructor(error = {}) {
|
|
1210
|
+
super(error);
|
|
1211
|
+
this.name = error.name || 'WebrpcBadMethod';
|
|
1212
|
+
this.code = typeof error.code === 'number' ? error.code : -3;
|
|
1213
|
+
this.message = error.message || `bad method`;
|
|
1214
|
+
this.status = typeof error.status === 'number' ? error.status : 405;
|
|
1215
|
+
if (error.cause !== undefined)
|
|
1216
|
+
this.cause = error.cause;
|
|
1217
|
+
Object.setPrototypeOf(this, WebrpcBadMethodError.prototype);
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
exports.WebrpcBadMethodError = WebrpcBadMethodError;
|
|
1221
|
+
class WebrpcBadRequestError extends WebrpcError {
|
|
1222
|
+
constructor(error = {}) {
|
|
1223
|
+
super(error);
|
|
1224
|
+
this.name = error.name || 'WebrpcBadRequest';
|
|
1225
|
+
this.code = typeof error.code === 'number' ? error.code : -4;
|
|
1226
|
+
this.message = error.message || `bad request`;
|
|
1227
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1228
|
+
if (error.cause !== undefined)
|
|
1229
|
+
this.cause = error.cause;
|
|
1230
|
+
Object.setPrototypeOf(this, WebrpcBadRequestError.prototype);
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
exports.WebrpcBadRequestError = WebrpcBadRequestError;
|
|
1234
|
+
class WebrpcBadResponseError extends WebrpcError {
|
|
1235
|
+
constructor(error = {}) {
|
|
1236
|
+
super(error);
|
|
1237
|
+
this.name = error.name || 'WebrpcBadResponse';
|
|
1238
|
+
this.code = typeof error.code === 'number' ? error.code : -5;
|
|
1239
|
+
this.message = error.message || `bad response`;
|
|
1240
|
+
this.status = typeof error.status === 'number' ? error.status : 500;
|
|
1241
|
+
if (error.cause !== undefined)
|
|
1242
|
+
this.cause = error.cause;
|
|
1243
|
+
Object.setPrototypeOf(this, WebrpcBadResponseError.prototype);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
exports.WebrpcBadResponseError = WebrpcBadResponseError;
|
|
1247
|
+
class WebrpcServerPanicError extends WebrpcError {
|
|
1248
|
+
constructor(error = {}) {
|
|
1249
|
+
super(error);
|
|
1250
|
+
this.name = error.name || 'WebrpcServerPanic';
|
|
1251
|
+
this.code = typeof error.code === 'number' ? error.code : -6;
|
|
1252
|
+
this.message = error.message || `server panic`;
|
|
1253
|
+
this.status = typeof error.status === 'number' ? error.status : 500;
|
|
1254
|
+
if (error.cause !== undefined)
|
|
1255
|
+
this.cause = error.cause;
|
|
1256
|
+
Object.setPrototypeOf(this, WebrpcServerPanicError.prototype);
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
exports.WebrpcServerPanicError = WebrpcServerPanicError;
|
|
1260
|
+
class WebrpcInternalErrorError extends WebrpcError {
|
|
1261
|
+
constructor(error = {}) {
|
|
1262
|
+
super(error);
|
|
1263
|
+
this.name = error.name || 'WebrpcInternalError';
|
|
1264
|
+
this.code = typeof error.code === 'number' ? error.code : -7;
|
|
1265
|
+
this.message = error.message || `internal error`;
|
|
1266
|
+
this.status = typeof error.status === 'number' ? error.status : 500;
|
|
1267
|
+
if (error.cause !== undefined)
|
|
1268
|
+
this.cause = error.cause;
|
|
1269
|
+
Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype);
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
exports.WebrpcInternalErrorError = WebrpcInternalErrorError;
|
|
1273
|
+
class WebrpcClientAbortedError extends WebrpcError {
|
|
1274
|
+
constructor(error = {}) {
|
|
1275
|
+
super(error);
|
|
1276
|
+
this.name = error.name || 'WebrpcClientAborted';
|
|
1277
|
+
this.code = typeof error.code === 'number' ? error.code : -8;
|
|
1278
|
+
this.message = error.message || `request aborted by client`;
|
|
1279
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1280
|
+
if (error.cause !== undefined)
|
|
1281
|
+
this.cause = error.cause;
|
|
1282
|
+
Object.setPrototypeOf(this, WebrpcClientAbortedError.prototype);
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
exports.WebrpcClientAbortedError = WebrpcClientAbortedError;
|
|
1286
|
+
class WebrpcStreamLostError extends WebrpcError {
|
|
1287
|
+
constructor(error = {}) {
|
|
1288
|
+
super(error);
|
|
1289
|
+
this.name = error.name || 'WebrpcStreamLost';
|
|
1290
|
+
this.code = typeof error.code === 'number' ? error.code : -9;
|
|
1291
|
+
this.message = error.message || `stream lost`;
|
|
1292
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1293
|
+
if (error.cause !== undefined)
|
|
1294
|
+
this.cause = error.cause;
|
|
1295
|
+
Object.setPrototypeOf(this, WebrpcStreamLostError.prototype);
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
exports.WebrpcStreamLostError = WebrpcStreamLostError;
|
|
1299
|
+
class WebrpcStreamFinishedError extends WebrpcError {
|
|
1300
|
+
constructor(error = {}) {
|
|
1301
|
+
super(error);
|
|
1302
|
+
this.name = error.name || 'WebrpcStreamFinished';
|
|
1303
|
+
this.code = typeof error.code === 'number' ? error.code : -10;
|
|
1304
|
+
this.message = error.message || `stream finished`;
|
|
1305
|
+
this.status = typeof error.status === 'number' ? error.status : 200;
|
|
1306
|
+
if (error.cause !== undefined)
|
|
1307
|
+
this.cause = error.cause;
|
|
1308
|
+
Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype);
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
exports.WebrpcStreamFinishedError = WebrpcStreamFinishedError;
|
|
1312
|
+
//
|
|
1313
|
+
// Schema errors
|
|
1314
|
+
//
|
|
1315
|
+
class UnauthorizedError extends WebrpcError {
|
|
1316
|
+
constructor(error = {}) {
|
|
1317
|
+
super(error);
|
|
1318
|
+
this.name = error.name || 'Unauthorized';
|
|
1319
|
+
this.code = typeof error.code === 'number' ? error.code : 1000;
|
|
1320
|
+
this.message = error.message || `Unauthorized access`;
|
|
1321
|
+
this.status = typeof error.status === 'number' ? error.status : 401;
|
|
1322
|
+
if (error.cause !== undefined)
|
|
1323
|
+
this.cause = error.cause;
|
|
1324
|
+
Object.setPrototypeOf(this, UnauthorizedError.prototype);
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
exports.UnauthorizedError = UnauthorizedError;
|
|
1328
|
+
class PermissionDeniedError extends WebrpcError {
|
|
1329
|
+
constructor(error = {}) {
|
|
1330
|
+
super(error);
|
|
1331
|
+
this.name = error.name || 'PermissionDenied';
|
|
1332
|
+
this.code = typeof error.code === 'number' ? error.code : 1001;
|
|
1333
|
+
this.message = error.message || `Permission denied`;
|
|
1334
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1335
|
+
if (error.cause !== undefined)
|
|
1336
|
+
this.cause = error.cause;
|
|
1337
|
+
Object.setPrototypeOf(this, PermissionDeniedError.prototype);
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
exports.PermissionDeniedError = PermissionDeniedError;
|
|
1341
|
+
class SessionExpiredError extends WebrpcError {
|
|
1342
|
+
constructor(error = {}) {
|
|
1343
|
+
super(error);
|
|
1344
|
+
this.name = error.name || 'SessionExpired';
|
|
1345
|
+
this.code = typeof error.code === 'number' ? error.code : 1002;
|
|
1346
|
+
this.message = error.message || `Session expired`;
|
|
1347
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1348
|
+
if (error.cause !== undefined)
|
|
1349
|
+
this.cause = error.cause;
|
|
1350
|
+
Object.setPrototypeOf(this, SessionExpiredError.prototype);
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
exports.SessionExpiredError = SessionExpiredError;
|
|
1354
|
+
class MethodNotFoundError extends WebrpcError {
|
|
1355
|
+
constructor(error = {}) {
|
|
1356
|
+
super(error);
|
|
1357
|
+
this.name = error.name || 'MethodNotFound';
|
|
1358
|
+
this.code = typeof error.code === 'number' ? error.code : 1003;
|
|
1359
|
+
this.message = error.message || `Method not found`;
|
|
1360
|
+
this.status = typeof error.status === 'number' ? error.status : 404;
|
|
1361
|
+
if (error.cause !== undefined)
|
|
1362
|
+
this.cause = error.cause;
|
|
1363
|
+
Object.setPrototypeOf(this, MethodNotFoundError.prototype);
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
exports.MethodNotFoundError = MethodNotFoundError;
|
|
1367
|
+
class RequestConflictError extends WebrpcError {
|
|
1368
|
+
constructor(error = {}) {
|
|
1369
|
+
super(error);
|
|
1370
|
+
this.name = error.name || 'RequestConflict';
|
|
1371
|
+
this.code = typeof error.code === 'number' ? error.code : 1004;
|
|
1372
|
+
this.message = error.message || `Conflict with target resource`;
|
|
1373
|
+
this.status = typeof error.status === 'number' ? error.status : 409;
|
|
1374
|
+
if (error.cause !== undefined)
|
|
1375
|
+
this.cause = error.cause;
|
|
1376
|
+
Object.setPrototypeOf(this, RequestConflictError.prototype);
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
exports.RequestConflictError = RequestConflictError;
|
|
1380
|
+
class AbortedError extends WebrpcError {
|
|
1381
|
+
constructor(error = {}) {
|
|
1382
|
+
super(error);
|
|
1383
|
+
this.name = error.name || 'Aborted';
|
|
1384
|
+
this.code = typeof error.code === 'number' ? error.code : 1005;
|
|
1385
|
+
this.message = error.message || `Request aborted`;
|
|
1386
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1387
|
+
if (error.cause !== undefined)
|
|
1388
|
+
this.cause = error.cause;
|
|
1389
|
+
Object.setPrototypeOf(this, AbortedError.prototype);
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
exports.AbortedError = AbortedError;
|
|
1393
|
+
class GeoblockedError extends WebrpcError {
|
|
1394
|
+
constructor(error = {}) {
|
|
1395
|
+
super(error);
|
|
1396
|
+
this.name = error.name || 'Geoblocked';
|
|
1397
|
+
this.code = typeof error.code === 'number' ? error.code : 1006;
|
|
1398
|
+
this.message = error.message || `Geoblocked region`;
|
|
1399
|
+
this.status = typeof error.status === 'number' ? error.status : 451;
|
|
1400
|
+
if (error.cause !== undefined)
|
|
1401
|
+
this.cause = error.cause;
|
|
1402
|
+
Object.setPrototypeOf(this, GeoblockedError.prototype);
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
exports.GeoblockedError = GeoblockedError;
|
|
1406
|
+
class RateLimitedError extends WebrpcError {
|
|
1407
|
+
constructor(error = {}) {
|
|
1408
|
+
super(error);
|
|
1409
|
+
this.name = error.name || 'RateLimited';
|
|
1410
|
+
this.code = typeof error.code === 'number' ? error.code : 1007;
|
|
1411
|
+
this.message = error.message || `Rate-limited. Please slow down.`;
|
|
1412
|
+
this.status = typeof error.status === 'number' ? error.status : 429;
|
|
1413
|
+
if (error.cause !== undefined)
|
|
1414
|
+
this.cause = error.cause;
|
|
1415
|
+
Object.setPrototypeOf(this, RateLimitedError.prototype);
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
exports.RateLimitedError = RateLimitedError;
|
|
1419
|
+
class ProjectNotFoundError extends WebrpcError {
|
|
1420
|
+
constructor(error = {}) {
|
|
1421
|
+
super(error);
|
|
1422
|
+
this.name = error.name || 'ProjectNotFound';
|
|
1423
|
+
this.code = typeof error.code === 'number' ? error.code : 1008;
|
|
1424
|
+
this.message = error.message || `Project not found`;
|
|
1425
|
+
this.status = typeof error.status === 'number' ? error.status : 401;
|
|
1426
|
+
if (error.cause !== undefined)
|
|
1427
|
+
this.cause = error.cause;
|
|
1428
|
+
Object.setPrototypeOf(this, ProjectNotFoundError.prototype);
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
exports.ProjectNotFoundError = ProjectNotFoundError;
|
|
1432
|
+
class AccessKeyNotFoundError extends WebrpcError {
|
|
1433
|
+
constructor(error = {}) {
|
|
1434
|
+
super(error);
|
|
1435
|
+
this.name = error.name || 'AccessKeyNotFound';
|
|
1436
|
+
this.code = typeof error.code === 'number' ? error.code : 1101;
|
|
1437
|
+
this.message = error.message || `Access key not found`;
|
|
1438
|
+
this.status = typeof error.status === 'number' ? error.status : 401;
|
|
1439
|
+
if (error.cause !== undefined)
|
|
1440
|
+
this.cause = error.cause;
|
|
1441
|
+
Object.setPrototypeOf(this, AccessKeyNotFoundError.prototype);
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
exports.AccessKeyNotFoundError = AccessKeyNotFoundError;
|
|
1445
|
+
class AccessKeyMismatchError extends WebrpcError {
|
|
1446
|
+
constructor(error = {}) {
|
|
1447
|
+
super(error);
|
|
1448
|
+
this.name = error.name || 'AccessKeyMismatch';
|
|
1449
|
+
this.code = typeof error.code === 'number' ? error.code : 1102;
|
|
1450
|
+
this.message = error.message || `Access key mismatch`;
|
|
1451
|
+
this.status = typeof error.status === 'number' ? error.status : 409;
|
|
1452
|
+
if (error.cause !== undefined)
|
|
1453
|
+
this.cause = error.cause;
|
|
1454
|
+
Object.setPrototypeOf(this, AccessKeyMismatchError.prototype);
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
exports.AccessKeyMismatchError = AccessKeyMismatchError;
|
|
1458
|
+
class InvalidOriginError extends WebrpcError {
|
|
1459
|
+
constructor(error = {}) {
|
|
1460
|
+
super(error);
|
|
1461
|
+
this.name = error.name || 'InvalidOrigin';
|
|
1462
|
+
this.code = typeof error.code === 'number' ? error.code : 1103;
|
|
1463
|
+
this.message = error.message || `Invalid origin for Access Key`;
|
|
1464
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1465
|
+
if (error.cause !== undefined)
|
|
1466
|
+
this.cause = error.cause;
|
|
1467
|
+
Object.setPrototypeOf(this, InvalidOriginError.prototype);
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
exports.InvalidOriginError = InvalidOriginError;
|
|
1471
|
+
class InvalidServiceError extends WebrpcError {
|
|
1472
|
+
constructor(error = {}) {
|
|
1473
|
+
super(error);
|
|
1474
|
+
this.name = error.name || 'InvalidService';
|
|
1475
|
+
this.code = typeof error.code === 'number' ? error.code : 1104;
|
|
1476
|
+
this.message = error.message || `Service not enabled for Access key`;
|
|
1477
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1478
|
+
if (error.cause !== undefined)
|
|
1479
|
+
this.cause = error.cause;
|
|
1480
|
+
Object.setPrototypeOf(this, InvalidServiceError.prototype);
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
exports.InvalidServiceError = InvalidServiceError;
|
|
1484
|
+
class UnauthorizedUserError extends WebrpcError {
|
|
1485
|
+
constructor(error = {}) {
|
|
1486
|
+
super(error);
|
|
1487
|
+
this.name = error.name || 'UnauthorizedUser';
|
|
1488
|
+
this.code = typeof error.code === 'number' ? error.code : 1105;
|
|
1489
|
+
this.message = error.message || `Unauthorized user`;
|
|
1490
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1491
|
+
if (error.cause !== undefined)
|
|
1492
|
+
this.cause = error.cause;
|
|
1493
|
+
Object.setPrototypeOf(this, UnauthorizedUserError.prototype);
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
exports.UnauthorizedUserError = UnauthorizedUserError;
|
|
1497
|
+
class QuotaExceededError extends WebrpcError {
|
|
1498
|
+
constructor(error = {}) {
|
|
1499
|
+
super(error);
|
|
1500
|
+
this.name = error.name || 'QuotaExceeded';
|
|
1501
|
+
this.code = typeof error.code === 'number' ? error.code : 1200;
|
|
1502
|
+
this.message = error.message || `Quota request exceeded`;
|
|
1503
|
+
this.status = typeof error.status === 'number' ? error.status : 429;
|
|
1504
|
+
if (error.cause !== undefined)
|
|
1505
|
+
this.cause = error.cause;
|
|
1506
|
+
Object.setPrototypeOf(this, QuotaExceededError.prototype);
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
exports.QuotaExceededError = QuotaExceededError;
|
|
1510
|
+
class QuotaRateLimitError extends WebrpcError {
|
|
1511
|
+
constructor(error = {}) {
|
|
1512
|
+
super(error);
|
|
1513
|
+
this.name = error.name || 'QuotaRateLimit';
|
|
1514
|
+
this.code = typeof error.code === 'number' ? error.code : 1201;
|
|
1515
|
+
this.message = error.message || `Quota rate limit exceeded`;
|
|
1516
|
+
this.status = typeof error.status === 'number' ? error.status : 429;
|
|
1517
|
+
if (error.cause !== undefined)
|
|
1518
|
+
this.cause = error.cause;
|
|
1519
|
+
Object.setPrototypeOf(this, QuotaRateLimitError.prototype);
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
exports.QuotaRateLimitError = QuotaRateLimitError;
|
|
1523
|
+
class NoDefaultKeyError extends WebrpcError {
|
|
1524
|
+
constructor(error = {}) {
|
|
1525
|
+
super(error);
|
|
1526
|
+
this.name = error.name || 'NoDefaultKey';
|
|
1527
|
+
this.code = typeof error.code === 'number' ? error.code : 1300;
|
|
1528
|
+
this.message = error.message || `No default access key found`;
|
|
1529
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1530
|
+
if (error.cause !== undefined)
|
|
1531
|
+
this.cause = error.cause;
|
|
1532
|
+
Object.setPrototypeOf(this, NoDefaultKeyError.prototype);
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
exports.NoDefaultKeyError = NoDefaultKeyError;
|
|
1536
|
+
class MaxAccessKeysError extends WebrpcError {
|
|
1537
|
+
constructor(error = {}) {
|
|
1538
|
+
super(error);
|
|
1539
|
+
this.name = error.name || 'MaxAccessKeys';
|
|
1540
|
+
this.code = typeof error.code === 'number' ? error.code : 1301;
|
|
1541
|
+
this.message = error.message || `Access keys limit reached`;
|
|
1542
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1543
|
+
if (error.cause !== undefined)
|
|
1544
|
+
this.cause = error.cause;
|
|
1545
|
+
Object.setPrototypeOf(this, MaxAccessKeysError.prototype);
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
exports.MaxAccessKeysError = MaxAccessKeysError;
|
|
1549
|
+
class AtLeastOneKeyError extends WebrpcError {
|
|
1550
|
+
constructor(error = {}) {
|
|
1551
|
+
super(error);
|
|
1552
|
+
this.name = error.name || 'AtLeastOneKey';
|
|
1553
|
+
this.code = typeof error.code === 'number' ? error.code : 1302;
|
|
1554
|
+
this.message = error.message || `You need at least one Access Key`;
|
|
1555
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1556
|
+
if (error.cause !== undefined)
|
|
1557
|
+
this.cause = error.cause;
|
|
1558
|
+
Object.setPrototypeOf(this, AtLeastOneKeyError.prototype);
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
exports.AtLeastOneKeyError = AtLeastOneKeyError;
|
|
1562
|
+
class TimeoutError extends WebrpcError {
|
|
1563
|
+
constructor(error = {}) {
|
|
1564
|
+
super(error);
|
|
1565
|
+
this.name = error.name || 'Timeout';
|
|
1566
|
+
this.code = typeof error.code === 'number' ? error.code : 1900;
|
|
1567
|
+
this.message = error.message || `Request timed out`;
|
|
1568
|
+
this.status = typeof error.status === 'number' ? error.status : 408;
|
|
1569
|
+
if (error.cause !== undefined)
|
|
1570
|
+
this.cause = error.cause;
|
|
1571
|
+
Object.setPrototypeOf(this, TimeoutError.prototype);
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
exports.TimeoutError = TimeoutError;
|
|
1575
|
+
class InvalidArgumentError extends WebrpcError {
|
|
1576
|
+
constructor(error = {}) {
|
|
1577
|
+
super(error);
|
|
1578
|
+
this.name = error.name || 'InvalidArgument';
|
|
1579
|
+
this.code = typeof error.code === 'number' ? error.code : 2000;
|
|
1580
|
+
this.message = error.message || `Invalid argument`;
|
|
1581
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1582
|
+
if (error.cause !== undefined)
|
|
1583
|
+
this.cause = error.cause;
|
|
1584
|
+
Object.setPrototypeOf(this, InvalidArgumentError.prototype);
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
exports.InvalidArgumentError = InvalidArgumentError;
|
|
1588
|
+
class UnavailableError extends WebrpcError {
|
|
1589
|
+
constructor(error = {}) {
|
|
1590
|
+
super(error);
|
|
1591
|
+
this.name = error.name || 'Unavailable';
|
|
1592
|
+
this.code = typeof error.code === 'number' ? error.code : 2002;
|
|
1593
|
+
this.message = error.message || `Unavailable resource`;
|
|
1594
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1595
|
+
if (error.cause !== undefined)
|
|
1596
|
+
this.cause = error.cause;
|
|
1597
|
+
Object.setPrototypeOf(this, UnavailableError.prototype);
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
exports.UnavailableError = UnavailableError;
|
|
1601
|
+
class QueryFailedError extends WebrpcError {
|
|
1602
|
+
constructor(error = {}) {
|
|
1603
|
+
super(error);
|
|
1604
|
+
this.name = error.name || 'QueryFailed';
|
|
1605
|
+
this.code = typeof error.code === 'number' ? error.code : 2003;
|
|
1606
|
+
this.message = error.message || `Query failed`;
|
|
1607
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1608
|
+
if (error.cause !== undefined)
|
|
1609
|
+
this.cause = error.cause;
|
|
1610
|
+
Object.setPrototypeOf(this, QueryFailedError.prototype);
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
exports.QueryFailedError = QueryFailedError;
|
|
1614
|
+
class NotFoundError extends WebrpcError {
|
|
1615
|
+
constructor(error = {}) {
|
|
1616
|
+
super(error);
|
|
1617
|
+
this.name = error.name || 'NotFound';
|
|
1618
|
+
this.code = typeof error.code === 'number' ? error.code : 3000;
|
|
1619
|
+
this.message = error.message || `Resource not found`;
|
|
1620
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1621
|
+
if (error.cause !== undefined)
|
|
1622
|
+
this.cause = error.cause;
|
|
1623
|
+
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
exports.NotFoundError = NotFoundError;
|
|
1627
|
+
class UnsupportedNetworkError extends WebrpcError {
|
|
1628
|
+
constructor(error = {}) {
|
|
1629
|
+
super(error);
|
|
1630
|
+
this.name = error.name || 'UnsupportedNetwork';
|
|
1631
|
+
this.code = typeof error.code === 'number' ? error.code : 3008;
|
|
1632
|
+
this.message = error.message || `Unsupported network`;
|
|
1633
|
+
this.status = typeof error.status === 'number' ? error.status : 422;
|
|
1634
|
+
if (error.cause !== undefined)
|
|
1635
|
+
this.cause = error.cause;
|
|
1636
|
+
Object.setPrototypeOf(this, UnsupportedNetworkError.prototype);
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
exports.UnsupportedNetworkError = UnsupportedNetworkError;
|
|
1640
|
+
var errors;
|
|
1641
|
+
(function (errors) {
|
|
1642
|
+
errors["WebrpcEndpoint"] = "WebrpcEndpoint";
|
|
1643
|
+
errors["WebrpcRequestFailed"] = "WebrpcRequestFailed";
|
|
1644
|
+
errors["WebrpcBadRoute"] = "WebrpcBadRoute";
|
|
1645
|
+
errors["WebrpcBadMethod"] = "WebrpcBadMethod";
|
|
1646
|
+
errors["WebrpcBadRequest"] = "WebrpcBadRequest";
|
|
1647
|
+
errors["WebrpcBadResponse"] = "WebrpcBadResponse";
|
|
1648
|
+
errors["WebrpcServerPanic"] = "WebrpcServerPanic";
|
|
1649
|
+
errors["WebrpcInternalError"] = "WebrpcInternalError";
|
|
1650
|
+
errors["WebrpcClientAborted"] = "WebrpcClientAborted";
|
|
1651
|
+
errors["WebrpcStreamLost"] = "WebrpcStreamLost";
|
|
1652
|
+
errors["WebrpcStreamFinished"] = "WebrpcStreamFinished";
|
|
1653
|
+
errors["Unauthorized"] = "Unauthorized";
|
|
1654
|
+
errors["PermissionDenied"] = "PermissionDenied";
|
|
1655
|
+
errors["SessionExpired"] = "SessionExpired";
|
|
1656
|
+
errors["MethodNotFound"] = "MethodNotFound";
|
|
1657
|
+
errors["RequestConflict"] = "RequestConflict";
|
|
1658
|
+
errors["Aborted"] = "Aborted";
|
|
1659
|
+
errors["Geoblocked"] = "Geoblocked";
|
|
1660
|
+
errors["RateLimited"] = "RateLimited";
|
|
1661
|
+
errors["ProjectNotFound"] = "ProjectNotFound";
|
|
1662
|
+
errors["AccessKeyNotFound"] = "AccessKeyNotFound";
|
|
1663
|
+
errors["AccessKeyMismatch"] = "AccessKeyMismatch";
|
|
1664
|
+
errors["InvalidOrigin"] = "InvalidOrigin";
|
|
1665
|
+
errors["InvalidService"] = "InvalidService";
|
|
1666
|
+
errors["UnauthorizedUser"] = "UnauthorizedUser";
|
|
1667
|
+
errors["QuotaExceeded"] = "QuotaExceeded";
|
|
1668
|
+
errors["QuotaRateLimit"] = "QuotaRateLimit";
|
|
1669
|
+
errors["NoDefaultKey"] = "NoDefaultKey";
|
|
1670
|
+
errors["MaxAccessKeys"] = "MaxAccessKeys";
|
|
1671
|
+
errors["AtLeastOneKey"] = "AtLeastOneKey";
|
|
1672
|
+
errors["Timeout"] = "Timeout";
|
|
1673
|
+
errors["InvalidArgument"] = "InvalidArgument";
|
|
1674
|
+
errors["Unavailable"] = "Unavailable";
|
|
1675
|
+
errors["QueryFailed"] = "QueryFailed";
|
|
1676
|
+
errors["NotFound"] = "NotFound";
|
|
1677
|
+
errors["UnsupportedNetwork"] = "UnsupportedNetwork";
|
|
1678
|
+
})(errors || (exports.errors = errors = {}));
|
|
1679
|
+
var WebrpcErrorCodes;
|
|
1680
|
+
(function (WebrpcErrorCodes) {
|
|
1681
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcEndpoint"] = 0] = "WebrpcEndpoint";
|
|
1682
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcRequestFailed"] = -1] = "WebrpcRequestFailed";
|
|
1683
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadRoute"] = -2] = "WebrpcBadRoute";
|
|
1684
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadMethod"] = -3] = "WebrpcBadMethod";
|
|
1685
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadRequest"] = -4] = "WebrpcBadRequest";
|
|
1686
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadResponse"] = -5] = "WebrpcBadResponse";
|
|
1687
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcServerPanic"] = -6] = "WebrpcServerPanic";
|
|
1688
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcInternalError"] = -7] = "WebrpcInternalError";
|
|
1689
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcClientAborted"] = -8] = "WebrpcClientAborted";
|
|
1690
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcStreamLost"] = -9] = "WebrpcStreamLost";
|
|
1691
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcStreamFinished"] = -10] = "WebrpcStreamFinished";
|
|
1692
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Unauthorized"] = 1000] = "Unauthorized";
|
|
1693
|
+
WebrpcErrorCodes[WebrpcErrorCodes["PermissionDenied"] = 1001] = "PermissionDenied";
|
|
1694
|
+
WebrpcErrorCodes[WebrpcErrorCodes["SessionExpired"] = 1002] = "SessionExpired";
|
|
1695
|
+
WebrpcErrorCodes[WebrpcErrorCodes["MethodNotFound"] = 1003] = "MethodNotFound";
|
|
1696
|
+
WebrpcErrorCodes[WebrpcErrorCodes["RequestConflict"] = 1004] = "RequestConflict";
|
|
1697
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Aborted"] = 1005] = "Aborted";
|
|
1698
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Geoblocked"] = 1006] = "Geoblocked";
|
|
1699
|
+
WebrpcErrorCodes[WebrpcErrorCodes["RateLimited"] = 1007] = "RateLimited";
|
|
1700
|
+
WebrpcErrorCodes[WebrpcErrorCodes["ProjectNotFound"] = 1008] = "ProjectNotFound";
|
|
1701
|
+
WebrpcErrorCodes[WebrpcErrorCodes["AccessKeyNotFound"] = 1101] = "AccessKeyNotFound";
|
|
1702
|
+
WebrpcErrorCodes[WebrpcErrorCodes["AccessKeyMismatch"] = 1102] = "AccessKeyMismatch";
|
|
1703
|
+
WebrpcErrorCodes[WebrpcErrorCodes["InvalidOrigin"] = 1103] = "InvalidOrigin";
|
|
1704
|
+
WebrpcErrorCodes[WebrpcErrorCodes["InvalidService"] = 1104] = "InvalidService";
|
|
1705
|
+
WebrpcErrorCodes[WebrpcErrorCodes["UnauthorizedUser"] = 1105] = "UnauthorizedUser";
|
|
1706
|
+
WebrpcErrorCodes[WebrpcErrorCodes["QuotaExceeded"] = 1200] = "QuotaExceeded";
|
|
1707
|
+
WebrpcErrorCodes[WebrpcErrorCodes["QuotaRateLimit"] = 1201] = "QuotaRateLimit";
|
|
1708
|
+
WebrpcErrorCodes[WebrpcErrorCodes["NoDefaultKey"] = 1300] = "NoDefaultKey";
|
|
1709
|
+
WebrpcErrorCodes[WebrpcErrorCodes["MaxAccessKeys"] = 1301] = "MaxAccessKeys";
|
|
1710
|
+
WebrpcErrorCodes[WebrpcErrorCodes["AtLeastOneKey"] = 1302] = "AtLeastOneKey";
|
|
1711
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Timeout"] = 1900] = "Timeout";
|
|
1712
|
+
WebrpcErrorCodes[WebrpcErrorCodes["InvalidArgument"] = 2000] = "InvalidArgument";
|
|
1713
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Unavailable"] = 2002] = "Unavailable";
|
|
1714
|
+
WebrpcErrorCodes[WebrpcErrorCodes["QueryFailed"] = 2003] = "QueryFailed";
|
|
1715
|
+
WebrpcErrorCodes[WebrpcErrorCodes["NotFound"] = 3000] = "NotFound";
|
|
1716
|
+
WebrpcErrorCodes[WebrpcErrorCodes["UnsupportedNetwork"] = 3008] = "UnsupportedNetwork";
|
|
1717
|
+
})(WebrpcErrorCodes || (exports.WebrpcErrorCodes = WebrpcErrorCodes = {}));
|
|
1718
|
+
exports.webrpcErrorByCode = {
|
|
1719
|
+
[0]: WebrpcEndpointError,
|
|
1720
|
+
[-1]: WebrpcRequestFailedError,
|
|
1721
|
+
[-2]: WebrpcBadRouteError,
|
|
1722
|
+
[-3]: WebrpcBadMethodError,
|
|
1723
|
+
[-4]: WebrpcBadRequestError,
|
|
1724
|
+
[-5]: WebrpcBadResponseError,
|
|
1725
|
+
[-6]: WebrpcServerPanicError,
|
|
1726
|
+
[-7]: WebrpcInternalErrorError,
|
|
1727
|
+
[-8]: WebrpcClientAbortedError,
|
|
1728
|
+
[-9]: WebrpcStreamLostError,
|
|
1729
|
+
[-10]: WebrpcStreamFinishedError,
|
|
1730
|
+
[1000]: UnauthorizedError,
|
|
1731
|
+
[1001]: PermissionDeniedError,
|
|
1732
|
+
[1002]: SessionExpiredError,
|
|
1733
|
+
[1003]: MethodNotFoundError,
|
|
1734
|
+
[1004]: RequestConflictError,
|
|
1735
|
+
[1005]: AbortedError,
|
|
1736
|
+
[1006]: GeoblockedError,
|
|
1737
|
+
[1007]: RateLimitedError,
|
|
1738
|
+
[1008]: ProjectNotFoundError,
|
|
1739
|
+
[1101]: AccessKeyNotFoundError,
|
|
1740
|
+
[1102]: AccessKeyMismatchError,
|
|
1741
|
+
[1103]: InvalidOriginError,
|
|
1742
|
+
[1104]: InvalidServiceError,
|
|
1743
|
+
[1105]: UnauthorizedUserError,
|
|
1744
|
+
[1200]: QuotaExceededError,
|
|
1745
|
+
[1201]: QuotaRateLimitError,
|
|
1746
|
+
[1300]: NoDefaultKeyError,
|
|
1747
|
+
[1301]: MaxAccessKeysError,
|
|
1748
|
+
[1302]: AtLeastOneKeyError,
|
|
1749
|
+
[1900]: TimeoutError,
|
|
1750
|
+
[2000]: InvalidArgumentError,
|
|
1751
|
+
[2002]: UnavailableError,
|
|
1752
|
+
[2003]: QueryFailedError,
|
|
1753
|
+
[3000]: NotFoundError,
|
|
1754
|
+
[3008]: UnsupportedNetworkError,
|
|
1755
|
+
};
|
|
1756
|
+
//
|
|
1757
|
+
// Webrpc
|
|
1758
|
+
//
|
|
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);
|
|
1763
|
+
if (!headerValue) {
|
|
1764
|
+
return {
|
|
1765
|
+
WebrpcGenVersion: '',
|
|
1766
|
+
codeGenName: '',
|
|
1767
|
+
codeGenVersion: '',
|
|
1768
|
+
schemaName: '',
|
|
1769
|
+
schemaVersion: '',
|
|
1770
|
+
};
|
|
1771
|
+
}
|
|
1772
|
+
return parseWebrpcGenVersions(headerValue);
|
|
1773
|
+
}
|
|
1774
|
+
function parseWebrpcGenVersions(header) {
|
|
1775
|
+
const versions = header.split(';');
|
|
1776
|
+
if (versions.length < 3) {
|
|
1777
|
+
return {
|
|
1778
|
+
WebrpcGenVersion: '',
|
|
1779
|
+
codeGenName: '',
|
|
1780
|
+
codeGenVersion: '',
|
|
1781
|
+
schemaName: '',
|
|
1782
|
+
schemaVersion: '',
|
|
1783
|
+
};
|
|
1784
|
+
}
|
|
1785
|
+
const [_, WebrpcGenVersion] = versions[0].split('@');
|
|
1786
|
+
const [codeGenName, codeGenVersion] = versions[1].split('@');
|
|
1787
|
+
const [schemaName, schemaVersion] = versions[2].split('@');
|
|
1788
|
+
return {
|
|
1789
|
+
WebrpcGenVersion: WebrpcGenVersion ?? '',
|
|
1790
|
+
codeGenName: codeGenName ?? '',
|
|
1791
|
+
codeGenVersion: codeGenVersion ?? '',
|
|
1792
|
+
schemaName: schemaName ?? '',
|
|
1793
|
+
schemaVersion: schemaVersion ?? '',
|
|
1794
|
+
};
|
|
1795
|
+
}
|