@0xsequence/api 2.3.35 → 2.3.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/0xsequence-api.cjs.dev.js +768 -670
- package/dist/0xsequence-api.cjs.prod.js +768 -670
- package/dist/0xsequence-api.esm.js +763 -667
- package/dist/declarations/src/api.gen.d.ts +607 -520
- package/package.json +1 -1
- package/src/api.gen.ts +2339 -2046
|
@@ -13,61 +13,27 @@ function _extends() {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/* eslint-disable */
|
|
16
|
-
// sequence-api v0.4.0
|
|
16
|
+
// sequence-api v0.4.0 c7a95904c3e083c5e5239662c725ee904ab4492a
|
|
17
17
|
// --
|
|
18
|
-
// Code generated by
|
|
18
|
+
// Code generated by Webrpc-gen@v0.31.0 with typescript generator. DO NOT EDIT.
|
|
19
19
|
//
|
|
20
20
|
// webrpc-gen -schema=api.ridl -target=typescript -client -out=./clients/api.gen.ts
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
// WebRPC description and code-gen version
|
|
26
|
-
const WebRPCVersion = 'v1';
|
|
22
|
+
// Webrpc description and code-gen version
|
|
23
|
+
const WebrpcVersion = 'v1';
|
|
27
24
|
|
|
28
25
|
// Schema version of your RIDL schema
|
|
29
|
-
const
|
|
26
|
+
const WebrpcSchemaVersion = 'v0.4.0';
|
|
30
27
|
|
|
31
28
|
// Schema hash generated from your RIDL schema
|
|
32
|
-
const
|
|
33
|
-
function VersionFromHeader(headers) {
|
|
34
|
-
const headerValue = headers.get(WebrpcHeader);
|
|
35
|
-
if (!headerValue) {
|
|
36
|
-
return {
|
|
37
|
-
webrpcGenVersion: '',
|
|
38
|
-
codeGenName: '',
|
|
39
|
-
codeGenVersion: '',
|
|
40
|
-
schemaName: '',
|
|
41
|
-
schemaVersion: ''
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
return parseWebrpcGenVersions(headerValue);
|
|
45
|
-
}
|
|
46
|
-
function parseWebrpcGenVersions(header) {
|
|
47
|
-
const versions = header.split(';');
|
|
48
|
-
if (versions.length < 3) {
|
|
49
|
-
return {
|
|
50
|
-
webrpcGenVersion: '',
|
|
51
|
-
codeGenName: '',
|
|
52
|
-
codeGenVersion: '',
|
|
53
|
-
schemaName: '',
|
|
54
|
-
schemaVersion: ''
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
const [_, webrpcGenVersion] = versions[0].split('@');
|
|
58
|
-
const [codeGenName, codeGenVersion] = versions[1].split('@');
|
|
59
|
-
const [schemaName, schemaVersion] = versions[2].split('@');
|
|
60
|
-
return {
|
|
61
|
-
webrpcGenVersion: webrpcGenVersion != null ? webrpcGenVersion : '',
|
|
62
|
-
codeGenName: codeGenName != null ? codeGenName : '',
|
|
63
|
-
codeGenVersion: codeGenVersion != null ? codeGenVersion : '',
|
|
64
|
-
schemaName: schemaName != null ? schemaName : '',
|
|
65
|
-
schemaVersion: schemaVersion != null ? schemaVersion : ''
|
|
66
|
-
};
|
|
67
|
-
}
|
|
29
|
+
const WebrpcSchemaHash = 'c7a95904c3e083c5e5239662c725ee904ab4492a';
|
|
68
30
|
|
|
69
31
|
//
|
|
70
|
-
//
|
|
32
|
+
// Client interface
|
|
33
|
+
//
|
|
34
|
+
|
|
35
|
+
//
|
|
36
|
+
// Schema types
|
|
71
37
|
//
|
|
72
38
|
|
|
73
39
|
let SortOrder = /*#__PURE__*/function (SortOrder) {
|
|
@@ -121,1133 +87,1031 @@ let CheckoutOptionSwapProvider = /*#__PURE__*/function (CheckoutOptionSwapProvid
|
|
|
121
87
|
//
|
|
122
88
|
// Client
|
|
123
89
|
//
|
|
90
|
+
|
|
124
91
|
class API {
|
|
125
92
|
constructor(hostname, fetch) {
|
|
126
93
|
this.hostname = void 0;
|
|
127
94
|
this.fetch = void 0;
|
|
128
95
|
this.path = '/rpc/API/';
|
|
96
|
+
this.queryKey = {
|
|
97
|
+
ping: () => ['API', 'ping'],
|
|
98
|
+
version: () => ['API', 'version'],
|
|
99
|
+
runtimeStatus: () => ['API', 'runtimeStatus'],
|
|
100
|
+
clock: () => ['API', 'clock'],
|
|
101
|
+
getSequenceContext: () => ['API', 'getSequenceContext'],
|
|
102
|
+
getAuthToken: req => ['API', 'getAuthToken', req],
|
|
103
|
+
getAuthToken2: req => ['API', 'getAuthToken2', req],
|
|
104
|
+
sendPasswordlessLink: req => ['API', 'sendPasswordlessLink', req],
|
|
105
|
+
registerPublicKey: req => ['API', 'registerPublicKey', req],
|
|
106
|
+
getPublicKey: req => ['API', 'getPublicKey', req],
|
|
107
|
+
friendList: req => ['API', 'friendList', req],
|
|
108
|
+
getFriendByAddress: req => ['API', 'getFriendByAddress', req],
|
|
109
|
+
searchFriends: req => ['API', 'searchFriends', req],
|
|
110
|
+
addFriend: req => ['API', 'addFriend', req],
|
|
111
|
+
updateFriendNickname: req => ['API', 'updateFriendNickname', req],
|
|
112
|
+
removeFriend: req => ['API', 'removeFriend', req],
|
|
113
|
+
contractCall: req => ['API', 'contractCall', req],
|
|
114
|
+
decodeContractCall: req => ['API', 'decodeContractCall', req],
|
|
115
|
+
lookupContractCallSelectors: req => ['API', 'lookupContractCallSelectors', req],
|
|
116
|
+
userStorageFetch: req => ['API', 'userStorageFetch', req],
|
|
117
|
+
userStorageSave: req => ['API', 'userStorageSave', req],
|
|
118
|
+
userStorageDelete: req => ['API', 'userStorageDelete', req],
|
|
119
|
+
userStorageFetchAll: req => ['API', 'userStorageFetchAll', req],
|
|
120
|
+
getMoonpayLink: req => ['API', 'getMoonpayLink', req],
|
|
121
|
+
resolveENSAddress: req => ['API', 'resolveENSAddress', req],
|
|
122
|
+
isValidSignature: req => ['API', 'isValidSignature', req],
|
|
123
|
+
isValidMessageSignature: req => ['API', 'isValidMessageSignature', req],
|
|
124
|
+
isValidTypedDataSignature: req => ['API', 'isValidTypedDataSignature', req],
|
|
125
|
+
isValidETHAuthProof: req => ['API', 'isValidETHAuthProof', req],
|
|
126
|
+
getOnRampURL: req => ['API', 'getOnRampURL', req],
|
|
127
|
+
transakGetCountries: () => ['API', 'transakGetCountries'],
|
|
128
|
+
transakGetCryptoCurrencies: () => ['API', 'transakGetCryptoCurrencies'],
|
|
129
|
+
transakGetFiatCurrencies: () => ['API', 'transakGetFiatCurrencies'],
|
|
130
|
+
transakGetPrice: req => ['API', 'transakGetPrice', req],
|
|
131
|
+
transakGetSupportedNFTCheckoutChains: () => ['API', 'transakGetSupportedNFTCheckoutChains'],
|
|
132
|
+
transakGetWidgetURL: req => ['API', 'transakGetWidgetURL', req],
|
|
133
|
+
getCoinPrices: req => ['API', 'getCoinPrices', req],
|
|
134
|
+
getCollectiblePrices: req => ['API', 'getCollectiblePrices', req],
|
|
135
|
+
getExchangeRate: req => ['API', 'getExchangeRate', req],
|
|
136
|
+
memoryStore: req => ['API', 'memoryStore', req],
|
|
137
|
+
memoryLoad: req => ['API', 'memoryLoad', req],
|
|
138
|
+
getInviteInfo: () => ['API', 'getInviteInfo'],
|
|
139
|
+
isValidAccessCode: req => ['API', 'isValidAccessCode', req],
|
|
140
|
+
internalClaimAccessCode: req => ['API', 'internalClaimAccessCode', req],
|
|
141
|
+
blockNumberAtTime: req => ['API', 'blockNumberAtTime', req],
|
|
142
|
+
paperSessionSecret: req => ['API', 'paperSessionSecret', req],
|
|
143
|
+
paperSessionSecret2: req => ['API', 'paperSessionSecret2', req],
|
|
144
|
+
linkWallet: req => ['API', 'linkWallet', req],
|
|
145
|
+
getLinkedWallets: req => ['API', 'getLinkedWallets', req],
|
|
146
|
+
removeLinkedWallet: req => ['API', 'removeLinkedWallet', req],
|
|
147
|
+
generateWaaSVerificationURL: req => ['API', 'generateWaaSVerificationURL', req],
|
|
148
|
+
validateWaaSVerificationNonce: req => ['API', 'validateWaaSVerificationNonce', req],
|
|
149
|
+
listAdoptedWallets: req => ['API', 'listAdoptedWallets', req],
|
|
150
|
+
getLifiChains: () => ['API', 'getLifiChains'],
|
|
151
|
+
getLifiTokens: req => ['API', 'getLifiTokens', req],
|
|
152
|
+
getLifiSwapRoutes: req => ['API', 'getLifiSwapRoutes', req],
|
|
153
|
+
getLifiSwapQuote: req => ['API', 'getLifiSwapQuote', req],
|
|
154
|
+
getIntentCallsPayloads: req => ['API', 'getIntentCallsPayloads', req],
|
|
155
|
+
commitIntentConfig: req => ['API', 'commitIntentConfig', req],
|
|
156
|
+
getIntentConfig: req => ['API', 'getIntentConfig', req],
|
|
157
|
+
listCurrencyGroups: () => ['API', 'listCurrencyGroups'],
|
|
158
|
+
addOffchainInventory: req => ['API', 'addOffchainInventory', req],
|
|
159
|
+
getOffchainInventory: req => ['API', 'getOffchainInventory', req],
|
|
160
|
+
listOffchainInventories: req => ['API', 'listOffchainInventories', req],
|
|
161
|
+
updateOffchainInventory: req => ['API', 'updateOffchainInventory', req],
|
|
162
|
+
deleteOffchainInventory: req => ['API', 'deleteOffchainInventory', req],
|
|
163
|
+
requestOffchainPayment: req => ['API', 'requestOffchainPayment', req],
|
|
164
|
+
listOffchainPayments: req => ['API', 'listOffchainPayments', req],
|
|
165
|
+
savePack: req => ['API', 'savePack', req],
|
|
166
|
+
getPack: req => ['API', 'getPack', req],
|
|
167
|
+
getPackIds: req => ['API', 'getPackIds', req],
|
|
168
|
+
deletePack: req => ['API', 'deletePack', req],
|
|
169
|
+
updatePackContent: req => ['API', 'updatePackContent', req],
|
|
170
|
+
getRevealTxData: req => ['API', 'getRevealTxData', req],
|
|
171
|
+
checkoutOptionsPrimary: req => ['API', 'checkoutOptionsPrimary', req],
|
|
172
|
+
checkoutOptionsSecondary: req => ['API', 'checkoutOptionsSecondary', req],
|
|
173
|
+
checkoutOptionsGetTransakContractID: req => ['API', 'checkoutOptionsGetTransakContractID', req],
|
|
174
|
+
fortePayCreateIntent: req => ['API', 'fortePayCreateIntent', req],
|
|
175
|
+
fortePayGetPaymentStatuses: req => ['API', 'fortePayGetPaymentStatuses', req],
|
|
176
|
+
getCCTPTransfer: req => ['API', 'getCCTPTransfer', req],
|
|
177
|
+
queueCCTPTransfer: req => ['API', 'queueCCTPTransfer', req],
|
|
178
|
+
queueIntentConfigExecution: req => ['API', 'queueIntentConfigExecution', req],
|
|
179
|
+
getIntentConfigExecutionStatus: req => ['API', 'getIntentConfigExecutionStatus', req],
|
|
180
|
+
listIntentConfigs: req => ['API', 'listIntentConfigs', req],
|
|
181
|
+
queueMetaTxnReceipt: req => ['API', 'queueMetaTxnReceipt', req]
|
|
182
|
+
};
|
|
129
183
|
this.ping = (headers, signal) => {
|
|
130
|
-
return this.fetch(this.url('Ping'),
|
|
184
|
+
return this.fetch(this.url('Ping'), createHttpRequest('{}', headers, signal)).then(res => {
|
|
131
185
|
return buildResponse(res).then(_data => {
|
|
132
|
-
return
|
|
133
|
-
status: _data.status
|
|
134
|
-
};
|
|
186
|
+
return JsonDecode(_data, 'PingResponse');
|
|
135
187
|
});
|
|
136
188
|
}, error => {
|
|
137
189
|
throw WebrpcRequestFailedError.new({
|
|
138
|
-
cause: `fetch(): ${error.message
|
|
190
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
139
191
|
});
|
|
140
192
|
});
|
|
141
193
|
};
|
|
142
194
|
this.version = (headers, signal) => {
|
|
143
|
-
return this.fetch(this.url('Version'),
|
|
195
|
+
return this.fetch(this.url('Version'), createHttpRequest('{}', headers, signal)).then(res => {
|
|
144
196
|
return buildResponse(res).then(_data => {
|
|
145
|
-
return
|
|
146
|
-
version: _data.version
|
|
147
|
-
};
|
|
197
|
+
return JsonDecode(_data, 'VersionResponse');
|
|
148
198
|
});
|
|
149
199
|
}, error => {
|
|
150
200
|
throw WebrpcRequestFailedError.new({
|
|
151
|
-
cause: `fetch(): ${error.message
|
|
201
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
152
202
|
});
|
|
153
203
|
});
|
|
154
204
|
};
|
|
155
205
|
this.runtimeStatus = (headers, signal) => {
|
|
156
|
-
return this.fetch(this.url('RuntimeStatus'),
|
|
206
|
+
return this.fetch(this.url('RuntimeStatus'), createHttpRequest('{}', headers, signal)).then(res => {
|
|
157
207
|
return buildResponse(res).then(_data => {
|
|
158
|
-
return
|
|
159
|
-
status: _data.status
|
|
160
|
-
};
|
|
208
|
+
return JsonDecode(_data, 'RuntimeStatusResponse');
|
|
161
209
|
});
|
|
162
210
|
}, error => {
|
|
163
211
|
throw WebrpcRequestFailedError.new({
|
|
164
|
-
cause: `fetch(): ${error.message
|
|
212
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
165
213
|
});
|
|
166
214
|
});
|
|
167
215
|
};
|
|
168
216
|
this.clock = (headers, signal) => {
|
|
169
|
-
return this.fetch(this.url('Clock'),
|
|
217
|
+
return this.fetch(this.url('Clock'), createHttpRequest('{}', headers, signal)).then(res => {
|
|
170
218
|
return buildResponse(res).then(_data => {
|
|
171
|
-
return
|
|
172
|
-
serverTime: _data.serverTime
|
|
173
|
-
};
|
|
219
|
+
return JsonDecode(_data, 'ClockResponse');
|
|
174
220
|
});
|
|
175
221
|
}, error => {
|
|
176
222
|
throw WebrpcRequestFailedError.new({
|
|
177
|
-
cause: `fetch(): ${error.message
|
|
223
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
178
224
|
});
|
|
179
225
|
});
|
|
180
226
|
};
|
|
181
227
|
this.getSequenceContext = (headers, signal) => {
|
|
182
|
-
return this.fetch(this.url('GetSequenceContext'),
|
|
228
|
+
return this.fetch(this.url('GetSequenceContext'), createHttpRequest('{}', headers, signal)).then(res => {
|
|
183
229
|
return buildResponse(res).then(_data => {
|
|
184
|
-
return
|
|
185
|
-
data: _data.data
|
|
186
|
-
};
|
|
230
|
+
return JsonDecode(_data, 'GetSequenceContextResponse');
|
|
187
231
|
});
|
|
188
232
|
}, error => {
|
|
189
233
|
throw WebrpcRequestFailedError.new({
|
|
190
|
-
cause: `fetch(): ${error.message
|
|
234
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
191
235
|
});
|
|
192
236
|
});
|
|
193
237
|
};
|
|
194
|
-
this.getAuthToken = (
|
|
195
|
-
return this.fetch(this.url('GetAuthToken'),
|
|
238
|
+
this.getAuthToken = (req, headers, signal) => {
|
|
239
|
+
return this.fetch(this.url('GetAuthToken'), createHttpRequest(JsonEncode(req, 'GetAuthTokenRequest'), headers, signal)).then(res => {
|
|
196
240
|
return buildResponse(res).then(_data => {
|
|
197
|
-
return
|
|
198
|
-
status: _data.status,
|
|
199
|
-
jwtToken: _data.jwtToken,
|
|
200
|
-
address: _data.address,
|
|
201
|
-
user: _data.user
|
|
202
|
-
};
|
|
241
|
+
return JsonDecode(_data, 'GetAuthTokenResponse');
|
|
203
242
|
});
|
|
204
243
|
}, error => {
|
|
205
244
|
throw WebrpcRequestFailedError.new({
|
|
206
|
-
cause: `fetch(): ${error.message
|
|
245
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
207
246
|
});
|
|
208
247
|
});
|
|
209
248
|
};
|
|
210
|
-
this.getAuthToken2 = (
|
|
211
|
-
return this.fetch(this.url('GetAuthToken2'),
|
|
249
|
+
this.getAuthToken2 = (req, headers, signal) => {
|
|
250
|
+
return this.fetch(this.url('GetAuthToken2'), createHttpRequest(JsonEncode(req, 'GetAuthToken2Request'), headers, signal)).then(res => {
|
|
212
251
|
return buildResponse(res).then(_data => {
|
|
213
|
-
return
|
|
214
|
-
status: _data.status,
|
|
215
|
-
jwtToken: _data.jwtToken,
|
|
216
|
-
address: _data.address,
|
|
217
|
-
user: _data.user
|
|
218
|
-
};
|
|
252
|
+
return JsonDecode(_data, 'GetAuthToken2Response');
|
|
219
253
|
});
|
|
220
254
|
}, error => {
|
|
221
255
|
throw WebrpcRequestFailedError.new({
|
|
222
|
-
cause: `fetch(): ${error.message
|
|
256
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
223
257
|
});
|
|
224
258
|
});
|
|
225
259
|
};
|
|
226
|
-
this.sendPasswordlessLink = (
|
|
227
|
-
return this.fetch(this.url('SendPasswordlessLink'),
|
|
260
|
+
this.sendPasswordlessLink = (req, headers, signal) => {
|
|
261
|
+
return this.fetch(this.url('SendPasswordlessLink'), createHttpRequest(JsonEncode(req, 'SendPasswordlessLinkRequest'), headers, signal)).then(res => {
|
|
228
262
|
return buildResponse(res).then(_data => {
|
|
229
|
-
return
|
|
230
|
-
status: _data.status
|
|
231
|
-
};
|
|
263
|
+
return JsonDecode(_data, 'SendPasswordlessLinkResponse');
|
|
232
264
|
});
|
|
233
265
|
}, error => {
|
|
234
266
|
throw WebrpcRequestFailedError.new({
|
|
235
|
-
cause: `fetch(): ${error.message
|
|
267
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
236
268
|
});
|
|
237
269
|
});
|
|
238
270
|
};
|
|
239
|
-
this.registerPublicKey = (
|
|
240
|
-
return this.fetch(this.url('RegisterPublicKey'),
|
|
271
|
+
this.registerPublicKey = (req, headers, signal) => {
|
|
272
|
+
return this.fetch(this.url('RegisterPublicKey'), createHttpRequest(JsonEncode(req, 'RegisterPublicKeyRequest'), headers, signal)).then(res => {
|
|
241
273
|
return buildResponse(res).then(_data => {
|
|
242
|
-
return
|
|
243
|
-
status: _data.status
|
|
244
|
-
};
|
|
274
|
+
return JsonDecode(_data, 'RegisterPublicKeyResponse');
|
|
245
275
|
});
|
|
246
276
|
}, error => {
|
|
247
277
|
throw WebrpcRequestFailedError.new({
|
|
248
|
-
cause: `fetch(): ${error.message
|
|
278
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
249
279
|
});
|
|
250
280
|
});
|
|
251
281
|
};
|
|
252
|
-
this.getPublicKey = (
|
|
253
|
-
return this.fetch(this.url('GetPublicKey'),
|
|
282
|
+
this.getPublicKey = (req, headers, signal) => {
|
|
283
|
+
return this.fetch(this.url('GetPublicKey'), createHttpRequest(JsonEncode(req, 'GetPublicKeyRequest'), headers, signal)).then(res => {
|
|
254
284
|
return buildResponse(res).then(_data => {
|
|
255
|
-
return
|
|
256
|
-
publicKey: _data.publicKey
|
|
257
|
-
};
|
|
285
|
+
return JsonDecode(_data, 'GetPublicKeyResponse');
|
|
258
286
|
});
|
|
259
287
|
}, error => {
|
|
260
288
|
throw WebrpcRequestFailedError.new({
|
|
261
|
-
cause: `fetch(): ${error.message
|
|
289
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
262
290
|
});
|
|
263
291
|
});
|
|
264
292
|
};
|
|
265
|
-
this.friendList = (
|
|
266
|
-
return this.fetch(this.url('FriendList'),
|
|
293
|
+
this.friendList = (req, headers, signal) => {
|
|
294
|
+
return this.fetch(this.url('FriendList'), createHttpRequest(JsonEncode(req, 'FriendListRequest'), headers, signal)).then(res => {
|
|
267
295
|
return buildResponse(res).then(_data => {
|
|
268
|
-
return
|
|
269
|
-
page: _data.page,
|
|
270
|
-
friends: _data.friends
|
|
271
|
-
};
|
|
296
|
+
return JsonDecode(_data, 'FriendListResponse');
|
|
272
297
|
});
|
|
273
298
|
}, error => {
|
|
274
299
|
throw WebrpcRequestFailedError.new({
|
|
275
|
-
cause: `fetch(): ${error.message
|
|
300
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
276
301
|
});
|
|
277
302
|
});
|
|
278
303
|
};
|
|
279
|
-
this.getFriendByAddress = (
|
|
280
|
-
return this.fetch(this.url('GetFriendByAddress'),
|
|
304
|
+
this.getFriendByAddress = (req, headers, signal) => {
|
|
305
|
+
return this.fetch(this.url('GetFriendByAddress'), createHttpRequest(JsonEncode(req, 'GetFriendByAddressRequest'), headers, signal)).then(res => {
|
|
281
306
|
return buildResponse(res).then(_data => {
|
|
282
|
-
return
|
|
283
|
-
status: _data.status,
|
|
284
|
-
friend: _data.friend
|
|
285
|
-
};
|
|
307
|
+
return JsonDecode(_data, 'GetFriendByAddressResponse');
|
|
286
308
|
});
|
|
287
309
|
}, error => {
|
|
288
310
|
throw WebrpcRequestFailedError.new({
|
|
289
|
-
cause: `fetch(): ${error.message
|
|
311
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
290
312
|
});
|
|
291
313
|
});
|
|
292
314
|
};
|
|
293
|
-
this.searchFriends = (
|
|
294
|
-
return this.fetch(this.url('SearchFriends'),
|
|
315
|
+
this.searchFriends = (req, headers, signal) => {
|
|
316
|
+
return this.fetch(this.url('SearchFriends'), createHttpRequest(JsonEncode(req, 'SearchFriendsRequest'), headers, signal)).then(res => {
|
|
295
317
|
return buildResponse(res).then(_data => {
|
|
296
|
-
return
|
|
297
|
-
friends: _data.friends
|
|
298
|
-
};
|
|
318
|
+
return JsonDecode(_data, 'SearchFriendsResponse');
|
|
299
319
|
});
|
|
300
320
|
}, error => {
|
|
301
321
|
throw WebrpcRequestFailedError.new({
|
|
302
|
-
cause: `fetch(): ${error.message
|
|
322
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
303
323
|
});
|
|
304
324
|
});
|
|
305
325
|
};
|
|
306
|
-
this.addFriend = (
|
|
307
|
-
return this.fetch(this.url('AddFriend'),
|
|
326
|
+
this.addFriend = (req, headers, signal) => {
|
|
327
|
+
return this.fetch(this.url('AddFriend'), createHttpRequest(JsonEncode(req, 'AddFriendRequest'), headers, signal)).then(res => {
|
|
308
328
|
return buildResponse(res).then(_data => {
|
|
309
|
-
return
|
|
310
|
-
status: _data.status,
|
|
311
|
-
friend: _data.friend
|
|
312
|
-
};
|
|
329
|
+
return JsonDecode(_data, 'AddFriendResponse');
|
|
313
330
|
});
|
|
314
331
|
}, error => {
|
|
315
332
|
throw WebrpcRequestFailedError.new({
|
|
316
|
-
cause: `fetch(): ${error.message
|
|
333
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
317
334
|
});
|
|
318
335
|
});
|
|
319
336
|
};
|
|
320
|
-
this.updateFriendNickname = (
|
|
321
|
-
return this.fetch(this.url('UpdateFriendNickname'),
|
|
337
|
+
this.updateFriendNickname = (req, headers, signal) => {
|
|
338
|
+
return this.fetch(this.url('UpdateFriendNickname'), createHttpRequest(JsonEncode(req, 'UpdateFriendNicknameRequest'), headers, signal)).then(res => {
|
|
322
339
|
return buildResponse(res).then(_data => {
|
|
323
|
-
return
|
|
324
|
-
status: _data.status,
|
|
325
|
-
friend: _data.friend
|
|
326
|
-
};
|
|
340
|
+
return JsonDecode(_data, 'UpdateFriendNicknameResponse');
|
|
327
341
|
});
|
|
328
342
|
}, error => {
|
|
329
343
|
throw WebrpcRequestFailedError.new({
|
|
330
|
-
cause: `fetch(): ${error.message
|
|
344
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
331
345
|
});
|
|
332
346
|
});
|
|
333
347
|
};
|
|
334
|
-
this.removeFriend = (
|
|
335
|
-
return this.fetch(this.url('RemoveFriend'),
|
|
348
|
+
this.removeFriend = (req, headers, signal) => {
|
|
349
|
+
return this.fetch(this.url('RemoveFriend'), createHttpRequest(JsonEncode(req, 'RemoveFriendRequest'), headers, signal)).then(res => {
|
|
336
350
|
return buildResponse(res).then(_data => {
|
|
337
|
-
return
|
|
338
|
-
status: _data.status
|
|
339
|
-
};
|
|
351
|
+
return JsonDecode(_data, 'RemoveFriendResponse');
|
|
340
352
|
});
|
|
341
353
|
}, error => {
|
|
342
354
|
throw WebrpcRequestFailedError.new({
|
|
343
|
-
cause: `fetch(): ${error.message
|
|
355
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
344
356
|
});
|
|
345
357
|
});
|
|
346
358
|
};
|
|
347
|
-
this.contractCall = (
|
|
348
|
-
return this.fetch(this.url('ContractCall'),
|
|
359
|
+
this.contractCall = (req, headers, signal) => {
|
|
360
|
+
return this.fetch(this.url('ContractCall'), createHttpRequest(JsonEncode(req, 'ContractCallRequest'), headers, signal)).then(res => {
|
|
349
361
|
return buildResponse(res).then(_data => {
|
|
350
|
-
return
|
|
351
|
-
returns: _data.returns
|
|
352
|
-
};
|
|
362
|
+
return JsonDecode(_data, 'ContractCallResponse');
|
|
353
363
|
});
|
|
354
364
|
}, error => {
|
|
355
365
|
throw WebrpcRequestFailedError.new({
|
|
356
|
-
cause: `fetch(): ${error.message
|
|
366
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
357
367
|
});
|
|
358
368
|
});
|
|
359
369
|
};
|
|
360
|
-
this.decodeContractCall = (
|
|
361
|
-
return this.fetch(this.url('DecodeContractCall'),
|
|
370
|
+
this.decodeContractCall = (req, headers, signal) => {
|
|
371
|
+
return this.fetch(this.url('DecodeContractCall'), createHttpRequest(JsonEncode(req, 'DecodeContractCallRequest'), headers, signal)).then(res => {
|
|
362
372
|
return buildResponse(res).then(_data => {
|
|
363
|
-
return
|
|
364
|
-
call: _data.call
|
|
365
|
-
};
|
|
373
|
+
return JsonDecode(_data, 'DecodeContractCallResponse');
|
|
366
374
|
});
|
|
367
375
|
}, error => {
|
|
368
376
|
throw WebrpcRequestFailedError.new({
|
|
369
|
-
cause: `fetch(): ${error.message
|
|
377
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
370
378
|
});
|
|
371
379
|
});
|
|
372
380
|
};
|
|
373
|
-
this.lookupContractCallSelectors = (
|
|
374
|
-
return this.fetch(this.url('LookupContractCallSelectors'),
|
|
381
|
+
this.lookupContractCallSelectors = (req, headers, signal) => {
|
|
382
|
+
return this.fetch(this.url('LookupContractCallSelectors'), createHttpRequest(JsonEncode(req, 'LookupContractCallSelectorsRequest'), headers, signal)).then(res => {
|
|
375
383
|
return buildResponse(res).then(_data => {
|
|
376
|
-
return
|
|
377
|
-
signatures: _data.signatures
|
|
378
|
-
};
|
|
384
|
+
return JsonDecode(_data, 'LookupContractCallSelectorsResponse');
|
|
379
385
|
});
|
|
380
386
|
}, error => {
|
|
381
387
|
throw WebrpcRequestFailedError.new({
|
|
382
|
-
cause: `fetch(): ${error.message
|
|
388
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
383
389
|
});
|
|
384
390
|
});
|
|
385
391
|
};
|
|
386
|
-
this.userStorageFetch = (
|
|
387
|
-
return this.fetch(this.url('UserStorageFetch'),
|
|
392
|
+
this.userStorageFetch = (req, headers, signal) => {
|
|
393
|
+
return this.fetch(this.url('UserStorageFetch'), createHttpRequest(JsonEncode(req, 'UserStorageFetchRequest'), headers, signal)).then(res => {
|
|
388
394
|
return buildResponse(res).then(_data => {
|
|
389
|
-
return
|
|
390
|
-
object: _data.object
|
|
391
|
-
};
|
|
395
|
+
return JsonDecode(_data, 'UserStorageFetchResponse');
|
|
392
396
|
});
|
|
393
397
|
}, error => {
|
|
394
398
|
throw WebrpcRequestFailedError.new({
|
|
395
|
-
cause: `fetch(): ${error.message
|
|
399
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
396
400
|
});
|
|
397
401
|
});
|
|
398
402
|
};
|
|
399
|
-
this.userStorageSave = (
|
|
400
|
-
return this.fetch(this.url('UserStorageSave'),
|
|
403
|
+
this.userStorageSave = (req, headers, signal) => {
|
|
404
|
+
return this.fetch(this.url('UserStorageSave'), createHttpRequest(JsonEncode(req, 'UserStorageSaveRequest'), headers, signal)).then(res => {
|
|
401
405
|
return buildResponse(res).then(_data => {
|
|
402
|
-
return
|
|
403
|
-
ok: _data.ok
|
|
404
|
-
};
|
|
406
|
+
return JsonDecode(_data, 'UserStorageSaveResponse');
|
|
405
407
|
});
|
|
406
408
|
}, error => {
|
|
407
409
|
throw WebrpcRequestFailedError.new({
|
|
408
|
-
cause: `fetch(): ${error.message
|
|
410
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
409
411
|
});
|
|
410
412
|
});
|
|
411
413
|
};
|
|
412
|
-
this.userStorageDelete = (
|
|
413
|
-
return this.fetch(this.url('UserStorageDelete'),
|
|
414
|
+
this.userStorageDelete = (req, headers, signal) => {
|
|
415
|
+
return this.fetch(this.url('UserStorageDelete'), createHttpRequest(JsonEncode(req, 'UserStorageDeleteRequest'), headers, signal)).then(res => {
|
|
414
416
|
return buildResponse(res).then(_data => {
|
|
415
|
-
return
|
|
416
|
-
ok: _data.ok
|
|
417
|
-
};
|
|
417
|
+
return JsonDecode(_data, 'UserStorageDeleteResponse');
|
|
418
418
|
});
|
|
419
419
|
}, error => {
|
|
420
420
|
throw WebrpcRequestFailedError.new({
|
|
421
|
-
cause: `fetch(): ${error.message
|
|
421
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
422
422
|
});
|
|
423
423
|
});
|
|
424
424
|
};
|
|
425
|
-
this.userStorageFetchAll = (
|
|
426
|
-
return this.fetch(this.url('UserStorageFetchAll'),
|
|
425
|
+
this.userStorageFetchAll = (req, headers, signal) => {
|
|
426
|
+
return this.fetch(this.url('UserStorageFetchAll'), createHttpRequest(JsonEncode(req, 'UserStorageFetchAllRequest'), headers, signal)).then(res => {
|
|
427
427
|
return buildResponse(res).then(_data => {
|
|
428
|
-
return
|
|
429
|
-
objects: _data.objects
|
|
430
|
-
};
|
|
428
|
+
return JsonDecode(_data, 'UserStorageFetchAllResponse');
|
|
431
429
|
});
|
|
432
430
|
}, error => {
|
|
433
431
|
throw WebrpcRequestFailedError.new({
|
|
434
|
-
cause: `fetch(): ${error.message
|
|
432
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
435
433
|
});
|
|
436
434
|
});
|
|
437
435
|
};
|
|
438
|
-
this.getMoonpayLink = (
|
|
439
|
-
return this.fetch(this.url('GetMoonpayLink'),
|
|
436
|
+
this.getMoonpayLink = (req, headers, signal) => {
|
|
437
|
+
return this.fetch(this.url('GetMoonpayLink'), createHttpRequest(JsonEncode(req, 'GetMoonpayLinkRequest'), headers, signal)).then(res => {
|
|
440
438
|
return buildResponse(res).then(_data => {
|
|
441
|
-
return
|
|
442
|
-
signedUrl: _data.signedUrl
|
|
443
|
-
};
|
|
439
|
+
return JsonDecode(_data, 'GetMoonpayLinkResponse');
|
|
444
440
|
});
|
|
445
441
|
}, error => {
|
|
446
442
|
throw WebrpcRequestFailedError.new({
|
|
447
|
-
cause: `fetch(): ${error.message
|
|
443
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
448
444
|
});
|
|
449
445
|
});
|
|
450
446
|
};
|
|
451
|
-
this.resolveENSAddress = (
|
|
452
|
-
return this.fetch(this.url('ResolveENSAddress'),
|
|
447
|
+
this.resolveENSAddress = (req, headers, signal) => {
|
|
448
|
+
return this.fetch(this.url('ResolveENSAddress'), createHttpRequest(JsonEncode(req, 'ResolveENSAddressRequest'), headers, signal)).then(res => {
|
|
453
449
|
return buildResponse(res).then(_data => {
|
|
454
|
-
return
|
|
455
|
-
address: _data.address,
|
|
456
|
-
ok: _data.ok
|
|
457
|
-
};
|
|
450
|
+
return JsonDecode(_data, 'ResolveENSAddressResponse');
|
|
458
451
|
});
|
|
459
452
|
}, error => {
|
|
460
453
|
throw WebrpcRequestFailedError.new({
|
|
461
|
-
cause: `fetch(): ${error.message
|
|
454
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
462
455
|
});
|
|
463
456
|
});
|
|
464
457
|
};
|
|
465
|
-
this.isValidSignature = (
|
|
466
|
-
return this.fetch(this.url('IsValidSignature'),
|
|
458
|
+
this.isValidSignature = (req, headers, signal) => {
|
|
459
|
+
return this.fetch(this.url('IsValidSignature'), createHttpRequest(JsonEncode(req, 'IsValidSignatureRequest'), headers, signal)).then(res => {
|
|
467
460
|
return buildResponse(res).then(_data => {
|
|
468
|
-
return
|
|
469
|
-
isValid: _data.isValid
|
|
470
|
-
};
|
|
461
|
+
return JsonDecode(_data, 'IsValidSignatureResponse');
|
|
471
462
|
});
|
|
472
463
|
}, error => {
|
|
473
464
|
throw WebrpcRequestFailedError.new({
|
|
474
|
-
cause: `fetch(): ${error.message
|
|
465
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
475
466
|
});
|
|
476
467
|
});
|
|
477
468
|
};
|
|
478
|
-
this.isValidMessageSignature = (
|
|
479
|
-
return this.fetch(this.url('IsValidMessageSignature'),
|
|
469
|
+
this.isValidMessageSignature = (req, headers, signal) => {
|
|
470
|
+
return this.fetch(this.url('IsValidMessageSignature'), createHttpRequest(JsonEncode(req, 'IsValidMessageSignatureRequest'), headers, signal)).then(res => {
|
|
480
471
|
return buildResponse(res).then(_data => {
|
|
481
|
-
return
|
|
482
|
-
isValid: _data.isValid
|
|
483
|
-
};
|
|
472
|
+
return JsonDecode(_data, 'IsValidMessageSignatureResponse');
|
|
484
473
|
});
|
|
485
474
|
}, error => {
|
|
486
475
|
throw WebrpcRequestFailedError.new({
|
|
487
|
-
cause: `fetch(): ${error.message
|
|
476
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
488
477
|
});
|
|
489
478
|
});
|
|
490
479
|
};
|
|
491
|
-
this.isValidTypedDataSignature = (
|
|
492
|
-
return this.fetch(this.url('IsValidTypedDataSignature'),
|
|
480
|
+
this.isValidTypedDataSignature = (req, headers, signal) => {
|
|
481
|
+
return this.fetch(this.url('IsValidTypedDataSignature'), createHttpRequest(JsonEncode(req, 'IsValidTypedDataSignatureRequest'), headers, signal)).then(res => {
|
|
493
482
|
return buildResponse(res).then(_data => {
|
|
494
|
-
return
|
|
495
|
-
isValid: _data.isValid
|
|
496
|
-
};
|
|
483
|
+
return JsonDecode(_data, 'IsValidTypedDataSignatureResponse');
|
|
497
484
|
});
|
|
498
485
|
}, error => {
|
|
499
486
|
throw WebrpcRequestFailedError.new({
|
|
500
|
-
cause: `fetch(): ${error.message
|
|
487
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
501
488
|
});
|
|
502
489
|
});
|
|
503
490
|
};
|
|
504
|
-
this.isValidETHAuthProof = (
|
|
505
|
-
return this.fetch(this.url('IsValidETHAuthProof'),
|
|
491
|
+
this.isValidETHAuthProof = (req, headers, signal) => {
|
|
492
|
+
return this.fetch(this.url('IsValidETHAuthProof'), createHttpRequest(JsonEncode(req, 'IsValidETHAuthProofRequest'), headers, signal)).then(res => {
|
|
506
493
|
return buildResponse(res).then(_data => {
|
|
507
|
-
return
|
|
508
|
-
isValid: _data.isValid
|
|
509
|
-
};
|
|
494
|
+
return JsonDecode(_data, 'IsValidETHAuthProofResponse');
|
|
510
495
|
});
|
|
511
496
|
}, error => {
|
|
512
497
|
throw WebrpcRequestFailedError.new({
|
|
513
|
-
cause: `fetch(): ${error.message
|
|
498
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
514
499
|
});
|
|
515
500
|
});
|
|
516
501
|
};
|
|
517
|
-
this.getOnRampURL = (
|
|
518
|
-
return this.fetch(this.url('GetOnRampURL'),
|
|
502
|
+
this.getOnRampURL = (req, headers, signal) => {
|
|
503
|
+
return this.fetch(this.url('GetOnRampURL'), createHttpRequest(JsonEncode(req, 'GetOnRampURLRequest'), headers, signal)).then(res => {
|
|
519
504
|
return buildResponse(res).then(_data => {
|
|
520
|
-
return
|
|
521
|
-
url: _data.url
|
|
522
|
-
};
|
|
505
|
+
return JsonDecode(_data, 'GetOnRampURLResponse');
|
|
523
506
|
});
|
|
524
507
|
}, error => {
|
|
525
508
|
throw WebrpcRequestFailedError.new({
|
|
526
|
-
cause: `fetch(): ${error.message
|
|
509
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
527
510
|
});
|
|
528
511
|
});
|
|
529
512
|
};
|
|
530
513
|
this.transakGetCountries = (headers, signal) => {
|
|
531
|
-
return this.fetch(this.url('TransakGetCountries'),
|
|
514
|
+
return this.fetch(this.url('TransakGetCountries'), createHttpRequest('{}', headers, signal)).then(res => {
|
|
532
515
|
return buildResponse(res).then(_data => {
|
|
533
|
-
return
|
|
534
|
-
regions: _data.regions
|
|
535
|
-
};
|
|
516
|
+
return JsonDecode(_data, 'TransakGetCountriesResponse');
|
|
536
517
|
});
|
|
537
518
|
}, error => {
|
|
538
519
|
throw WebrpcRequestFailedError.new({
|
|
539
|
-
cause: `fetch(): ${error.message
|
|
520
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
540
521
|
});
|
|
541
522
|
});
|
|
542
523
|
};
|
|
543
524
|
this.transakGetCryptoCurrencies = (headers, signal) => {
|
|
544
|
-
return this.fetch(this.url('TransakGetCryptoCurrencies'),
|
|
525
|
+
return this.fetch(this.url('TransakGetCryptoCurrencies'), createHttpRequest('{}', headers, signal)).then(res => {
|
|
545
526
|
return buildResponse(res).then(_data => {
|
|
546
|
-
return
|
|
547
|
-
currencies: _data.currencies
|
|
548
|
-
};
|
|
527
|
+
return JsonDecode(_data, 'TransakGetCryptoCurrenciesResponse');
|
|
549
528
|
});
|
|
550
529
|
}, error => {
|
|
551
530
|
throw WebrpcRequestFailedError.new({
|
|
552
|
-
cause: `fetch(): ${error.message
|
|
531
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
553
532
|
});
|
|
554
533
|
});
|
|
555
534
|
};
|
|
556
535
|
this.transakGetFiatCurrencies = (headers, signal) => {
|
|
557
|
-
return this.fetch(this.url('TransakGetFiatCurrencies'),
|
|
536
|
+
return this.fetch(this.url('TransakGetFiatCurrencies'), createHttpRequest('{}', headers, signal)).then(res => {
|
|
558
537
|
return buildResponse(res).then(_data => {
|
|
559
|
-
return
|
|
560
|
-
currencies: _data.currencies
|
|
561
|
-
};
|
|
538
|
+
return JsonDecode(_data, 'TransakGetFiatCurrenciesResponse');
|
|
562
539
|
});
|
|
563
540
|
}, error => {
|
|
564
541
|
throw WebrpcRequestFailedError.new({
|
|
565
|
-
cause: `fetch(): ${error.message
|
|
542
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
566
543
|
});
|
|
567
544
|
});
|
|
568
545
|
};
|
|
569
|
-
this.transakGetPrice = (
|
|
570
|
-
return this.fetch(this.url('TransakGetPrice'),
|
|
546
|
+
this.transakGetPrice = (req, headers, signal) => {
|
|
547
|
+
return this.fetch(this.url('TransakGetPrice'), createHttpRequest(JsonEncode(req, 'TransakGetPriceRequest'), headers, signal)).then(res => {
|
|
571
548
|
return buildResponse(res).then(_data => {
|
|
572
|
-
return
|
|
573
|
-
price: _data.price
|
|
574
|
-
};
|
|
549
|
+
return JsonDecode(_data, 'TransakGetPriceResponse');
|
|
575
550
|
});
|
|
576
551
|
}, error => {
|
|
577
552
|
throw WebrpcRequestFailedError.new({
|
|
578
|
-
cause: `fetch(): ${error.message
|
|
553
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
579
554
|
});
|
|
580
555
|
});
|
|
581
556
|
};
|
|
582
557
|
this.transakGetSupportedNFTCheckoutChains = (headers, signal) => {
|
|
583
|
-
return this.fetch(this.url('TransakGetSupportedNFTCheckoutChains'),
|
|
558
|
+
return this.fetch(this.url('TransakGetSupportedNFTCheckoutChains'), createHttpRequest('{}', headers, signal)).then(res => {
|
|
584
559
|
return buildResponse(res).then(_data => {
|
|
585
|
-
return
|
|
586
|
-
chains: _data.chains
|
|
587
|
-
};
|
|
560
|
+
return JsonDecode(_data, 'TransakGetSupportedNFTCheckoutChainsResponse');
|
|
588
561
|
});
|
|
589
562
|
}, error => {
|
|
590
563
|
throw WebrpcRequestFailedError.new({
|
|
591
|
-
cause: `fetch(): ${error.message
|
|
564
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
592
565
|
});
|
|
593
566
|
});
|
|
594
567
|
};
|
|
595
|
-
this.transakGetWidgetURL = (
|
|
596
|
-
return this.fetch(this.url('TransakGetWidgetURL'),
|
|
568
|
+
this.transakGetWidgetURL = (req, headers, signal) => {
|
|
569
|
+
return this.fetch(this.url('TransakGetWidgetURL'), createHttpRequest(JsonEncode(req, 'TransakGetWidgetURLRequest'), headers, signal)).then(res => {
|
|
597
570
|
return buildResponse(res).then(_data => {
|
|
598
|
-
return
|
|
599
|
-
url: _data.url
|
|
600
|
-
};
|
|
571
|
+
return JsonDecode(_data, 'TransakGetWidgetURLResponse');
|
|
601
572
|
});
|
|
602
573
|
}, error => {
|
|
603
574
|
throw WebrpcRequestFailedError.new({
|
|
604
|
-
cause: `fetch(): ${error.message
|
|
575
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
605
576
|
});
|
|
606
577
|
});
|
|
607
578
|
};
|
|
608
|
-
this.getCoinPrices = (
|
|
609
|
-
return this.fetch(this.url('GetCoinPrices'),
|
|
579
|
+
this.getCoinPrices = (req, headers, signal) => {
|
|
580
|
+
return this.fetch(this.url('GetCoinPrices'), createHttpRequest(JsonEncode(req, 'GetCoinPricesRequest'), headers, signal)).then(res => {
|
|
610
581
|
return buildResponse(res).then(_data => {
|
|
611
|
-
return
|
|
612
|
-
tokenPrices: _data.tokenPrices
|
|
613
|
-
};
|
|
582
|
+
return JsonDecode(_data, 'GetCoinPricesResponse');
|
|
614
583
|
});
|
|
615
584
|
}, error => {
|
|
616
585
|
throw WebrpcRequestFailedError.new({
|
|
617
|
-
cause: `fetch(): ${error.message
|
|
586
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
618
587
|
});
|
|
619
588
|
});
|
|
620
589
|
};
|
|
621
|
-
this.getCollectiblePrices = (
|
|
622
|
-
return this.fetch(this.url('GetCollectiblePrices'),
|
|
590
|
+
this.getCollectiblePrices = (req, headers, signal) => {
|
|
591
|
+
return this.fetch(this.url('GetCollectiblePrices'), createHttpRequest(JsonEncode(req, 'GetCollectiblePricesRequest'), headers, signal)).then(res => {
|
|
623
592
|
return buildResponse(res).then(_data => {
|
|
624
|
-
return
|
|
625
|
-
tokenPrices: _data.tokenPrices
|
|
626
|
-
};
|
|
593
|
+
return JsonDecode(_data, 'GetCollectiblePricesResponse');
|
|
627
594
|
});
|
|
628
595
|
}, error => {
|
|
629
596
|
throw WebrpcRequestFailedError.new({
|
|
630
|
-
cause: `fetch(): ${error.message
|
|
597
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
631
598
|
});
|
|
632
599
|
});
|
|
633
600
|
};
|
|
634
|
-
this.getExchangeRate = (
|
|
635
|
-
return this.fetch(this.url('GetExchangeRate'),
|
|
601
|
+
this.getExchangeRate = (req, headers, signal) => {
|
|
602
|
+
return this.fetch(this.url('GetExchangeRate'), createHttpRequest(JsonEncode(req, 'GetExchangeRateRequest'), headers, signal)).then(res => {
|
|
636
603
|
return buildResponse(res).then(_data => {
|
|
637
|
-
return
|
|
638
|
-
exchangeRate: _data.exchangeRate
|
|
639
|
-
};
|
|
604
|
+
return JsonDecode(_data, 'GetExchangeRateResponse');
|
|
640
605
|
});
|
|
641
606
|
}, error => {
|
|
642
607
|
throw WebrpcRequestFailedError.new({
|
|
643
|
-
cause: `fetch(): ${error.message
|
|
608
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
644
609
|
});
|
|
645
610
|
});
|
|
646
611
|
};
|
|
647
|
-
this.memoryStore = (
|
|
648
|
-
return this.fetch(this.url('MemoryStore'),
|
|
612
|
+
this.memoryStore = (req, headers, signal) => {
|
|
613
|
+
return this.fetch(this.url('MemoryStore'), createHttpRequest(JsonEncode(req, 'MemoryStoreRequest'), headers, signal)).then(res => {
|
|
649
614
|
return buildResponse(res).then(_data => {
|
|
650
|
-
return
|
|
651
|
-
ok: _data.ok
|
|
652
|
-
};
|
|
615
|
+
return JsonDecode(_data, 'MemoryStoreResponse');
|
|
653
616
|
});
|
|
654
617
|
}, error => {
|
|
655
618
|
throw WebrpcRequestFailedError.new({
|
|
656
|
-
cause: `fetch(): ${error.message
|
|
619
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
657
620
|
});
|
|
658
621
|
});
|
|
659
622
|
};
|
|
660
|
-
this.memoryLoad = (
|
|
661
|
-
return this.fetch(this.url('MemoryLoad'),
|
|
623
|
+
this.memoryLoad = (req, headers, signal) => {
|
|
624
|
+
return this.fetch(this.url('MemoryLoad'), createHttpRequest(JsonEncode(req, 'MemoryLoadRequest'), headers, signal)).then(res => {
|
|
662
625
|
return buildResponse(res).then(_data => {
|
|
663
|
-
return
|
|
664
|
-
value: _data.value
|
|
665
|
-
};
|
|
626
|
+
return JsonDecode(_data, 'MemoryLoadResponse');
|
|
666
627
|
});
|
|
667
628
|
}, error => {
|
|
668
629
|
throw WebrpcRequestFailedError.new({
|
|
669
|
-
cause: `fetch(): ${error.message
|
|
630
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
670
631
|
});
|
|
671
632
|
});
|
|
672
633
|
};
|
|
673
634
|
this.getInviteInfo = (headers, signal) => {
|
|
674
|
-
return this.fetch(this.url('GetInviteInfo'),
|
|
635
|
+
return this.fetch(this.url('GetInviteInfo'), createHttpRequest('{}', headers, signal)).then(res => {
|
|
675
636
|
return buildResponse(res).then(_data => {
|
|
676
|
-
return
|
|
677
|
-
inviteInfo: _data.inviteInfo
|
|
678
|
-
};
|
|
637
|
+
return JsonDecode(_data, 'GetInviteInfoResponse');
|
|
679
638
|
});
|
|
680
639
|
}, error => {
|
|
681
640
|
throw WebrpcRequestFailedError.new({
|
|
682
|
-
cause: `fetch(): ${error.message
|
|
641
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
683
642
|
});
|
|
684
643
|
});
|
|
685
644
|
};
|
|
686
|
-
this.isValidAccessCode = (
|
|
687
|
-
return this.fetch(this.url('IsValidAccessCode'),
|
|
645
|
+
this.isValidAccessCode = (req, headers, signal) => {
|
|
646
|
+
return this.fetch(this.url('IsValidAccessCode'), createHttpRequest(JsonEncode(req, 'IsValidAccessCodeRequest'), headers, signal)).then(res => {
|
|
688
647
|
return buildResponse(res).then(_data => {
|
|
689
|
-
return
|
|
690
|
-
status: _data.status
|
|
691
|
-
};
|
|
648
|
+
return JsonDecode(_data, 'IsValidAccessCodeResponse');
|
|
692
649
|
});
|
|
693
650
|
}, error => {
|
|
694
651
|
throw WebrpcRequestFailedError.new({
|
|
695
|
-
cause: `fetch(): ${error.message
|
|
652
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
696
653
|
});
|
|
697
654
|
});
|
|
698
655
|
};
|
|
699
|
-
this.internalClaimAccessCode = (
|
|
700
|
-
return this.fetch(this.url('InternalClaimAccessCode'),
|
|
656
|
+
this.internalClaimAccessCode = (req, headers, signal) => {
|
|
657
|
+
return this.fetch(this.url('InternalClaimAccessCode'), createHttpRequest(JsonEncode(req, 'InternalClaimAccessCodeRequest'), headers, signal)).then(res => {
|
|
701
658
|
return buildResponse(res).then(_data => {
|
|
702
|
-
return
|
|
703
|
-
status: _data.status
|
|
704
|
-
};
|
|
659
|
+
return JsonDecode(_data, 'InternalClaimAccessCodeResponse');
|
|
705
660
|
});
|
|
706
661
|
}, error => {
|
|
707
662
|
throw WebrpcRequestFailedError.new({
|
|
708
|
-
cause: `fetch(): ${error.message
|
|
663
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
709
664
|
});
|
|
710
665
|
});
|
|
711
666
|
};
|
|
712
|
-
this.blockNumberAtTime = (
|
|
713
|
-
return this.fetch(this.url('BlockNumberAtTime'),
|
|
667
|
+
this.blockNumberAtTime = (req, headers, signal) => {
|
|
668
|
+
return this.fetch(this.url('BlockNumberAtTime'), createHttpRequest(JsonEncode(req, 'BlockNumberAtTimeRequest'), headers, signal)).then(res => {
|
|
714
669
|
return buildResponse(res).then(_data => {
|
|
715
|
-
return
|
|
716
|
-
blocks: _data.blocks
|
|
717
|
-
};
|
|
670
|
+
return JsonDecode(_data, 'BlockNumberAtTimeResponse');
|
|
718
671
|
});
|
|
719
672
|
}, error => {
|
|
720
673
|
throw WebrpcRequestFailedError.new({
|
|
721
|
-
cause: `fetch(): ${error.message
|
|
674
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
722
675
|
});
|
|
723
676
|
});
|
|
724
677
|
};
|
|
725
|
-
this.paperSessionSecret = (
|
|
726
|
-
return this.fetch(this.url('PaperSessionSecret'),
|
|
678
|
+
this.paperSessionSecret = (req, headers, signal) => {
|
|
679
|
+
return this.fetch(this.url('PaperSessionSecret'), createHttpRequest(JsonEncode(req, 'PaperSessionSecretRequest'), headers, signal)).then(res => {
|
|
727
680
|
return buildResponse(res).then(_data => {
|
|
728
|
-
return
|
|
729
|
-
secret: _data.secret
|
|
730
|
-
};
|
|
681
|
+
return JsonDecode(_data, 'PaperSessionSecretResponse');
|
|
731
682
|
});
|
|
732
683
|
}, error => {
|
|
733
684
|
throw WebrpcRequestFailedError.new({
|
|
734
|
-
cause: `fetch(): ${error.message
|
|
685
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
735
686
|
});
|
|
736
687
|
});
|
|
737
688
|
};
|
|
738
|
-
this.paperSessionSecret2 = (
|
|
739
|
-
return this.fetch(this.url('PaperSessionSecret2'),
|
|
689
|
+
this.paperSessionSecret2 = (req, headers, signal) => {
|
|
690
|
+
return this.fetch(this.url('PaperSessionSecret2'), createHttpRequest(JsonEncode(req, 'PaperSessionSecret2Request'), headers, signal)).then(res => {
|
|
740
691
|
return buildResponse(res).then(_data => {
|
|
741
|
-
return
|
|
742
|
-
secret: _data.secret
|
|
743
|
-
};
|
|
692
|
+
return JsonDecode(_data, 'PaperSessionSecret2Response');
|
|
744
693
|
});
|
|
745
694
|
}, error => {
|
|
746
695
|
throw WebrpcRequestFailedError.new({
|
|
747
|
-
cause: `fetch(): ${error.message
|
|
696
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
748
697
|
});
|
|
749
698
|
});
|
|
750
699
|
};
|
|
751
|
-
this.linkWallet = (
|
|
752
|
-
return this.fetch(this.url('LinkWallet'),
|
|
700
|
+
this.linkWallet = (req, headers, signal) => {
|
|
701
|
+
return this.fetch(this.url('LinkWallet'), createHttpRequest(JsonEncode(req, 'LinkWalletRequest'), headers, signal)).then(res => {
|
|
753
702
|
return buildResponse(res).then(_data => {
|
|
754
|
-
return
|
|
755
|
-
status: _data.status
|
|
756
|
-
};
|
|
703
|
+
return JsonDecode(_data, 'LinkWalletResponse');
|
|
757
704
|
});
|
|
758
705
|
}, error => {
|
|
759
706
|
throw WebrpcRequestFailedError.new({
|
|
760
|
-
cause: `fetch(): ${error.message
|
|
707
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
761
708
|
});
|
|
762
709
|
});
|
|
763
710
|
};
|
|
764
|
-
this.getLinkedWallets = (
|
|
765
|
-
return this.fetch(this.url('GetLinkedWallets'),
|
|
711
|
+
this.getLinkedWallets = (req, headers, signal) => {
|
|
712
|
+
return this.fetch(this.url('GetLinkedWallets'), createHttpRequest(JsonEncode(req, 'GetLinkedWalletsRequest'), headers, signal)).then(res => {
|
|
766
713
|
return buildResponse(res).then(_data => {
|
|
767
|
-
return
|
|
768
|
-
linkedWallets: _data.linkedWallets
|
|
769
|
-
};
|
|
714
|
+
return JsonDecode(_data, 'GetLinkedWalletsResponse');
|
|
770
715
|
});
|
|
771
716
|
}, error => {
|
|
772
717
|
throw WebrpcRequestFailedError.new({
|
|
773
|
-
cause: `fetch(): ${error.message
|
|
718
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
774
719
|
});
|
|
775
720
|
});
|
|
776
721
|
};
|
|
777
|
-
this.removeLinkedWallet = (
|
|
778
|
-
return this.fetch(this.url('RemoveLinkedWallet'),
|
|
722
|
+
this.removeLinkedWallet = (req, headers, signal) => {
|
|
723
|
+
return this.fetch(this.url('RemoveLinkedWallet'), createHttpRequest(JsonEncode(req, 'RemoveLinkedWalletRequest'), headers, signal)).then(res => {
|
|
779
724
|
return buildResponse(res).then(_data => {
|
|
780
|
-
return
|
|
781
|
-
status: _data.status
|
|
782
|
-
};
|
|
725
|
+
return JsonDecode(_data, 'RemoveLinkedWalletResponse');
|
|
783
726
|
});
|
|
784
727
|
}, error => {
|
|
785
728
|
throw WebrpcRequestFailedError.new({
|
|
786
|
-
cause: `fetch(): ${error.message
|
|
729
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
787
730
|
});
|
|
788
731
|
});
|
|
789
732
|
};
|
|
790
|
-
this.generateWaaSVerificationURL = (
|
|
791
|
-
return this.fetch(this.url('GenerateWaaSVerificationURL'),
|
|
733
|
+
this.generateWaaSVerificationURL = (req, headers, signal) => {
|
|
734
|
+
return this.fetch(this.url('GenerateWaaSVerificationURL'), createHttpRequest(JsonEncode(req, 'GenerateWaaSVerificationURLRequest'), headers, signal)).then(res => {
|
|
792
735
|
return buildResponse(res).then(_data => {
|
|
793
|
-
return
|
|
794
|
-
nonce: _data.nonce,
|
|
795
|
-
verificationURL: _data.verificationURL
|
|
796
|
-
};
|
|
736
|
+
return JsonDecode(_data, 'GenerateWaaSVerificationURLResponse');
|
|
797
737
|
});
|
|
798
738
|
}, error => {
|
|
799
739
|
throw WebrpcRequestFailedError.new({
|
|
800
|
-
cause: `fetch(): ${error.message
|
|
740
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
801
741
|
});
|
|
802
742
|
});
|
|
803
743
|
};
|
|
804
|
-
this.validateWaaSVerificationNonce = (
|
|
805
|
-
return this.fetch(this.url('ValidateWaaSVerificationNonce'),
|
|
744
|
+
this.validateWaaSVerificationNonce = (req, headers, signal) => {
|
|
745
|
+
return this.fetch(this.url('ValidateWaaSVerificationNonce'), createHttpRequest(JsonEncode(req, 'ValidateWaaSVerificationNonceRequest'), headers, signal)).then(res => {
|
|
806
746
|
return buildResponse(res).then(_data => {
|
|
807
|
-
return
|
|
808
|
-
walletAddress: _data.walletAddress
|
|
809
|
-
};
|
|
747
|
+
return JsonDecode(_data, 'ValidateWaaSVerificationNonceResponse');
|
|
810
748
|
});
|
|
811
749
|
}, error => {
|
|
812
750
|
throw WebrpcRequestFailedError.new({
|
|
813
|
-
cause: `fetch(): ${error.message
|
|
751
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
814
752
|
});
|
|
815
753
|
});
|
|
816
754
|
};
|
|
817
|
-
this.listAdoptedWallets = (
|
|
818
|
-
return this.fetch(this.url('ListAdoptedWallets'),
|
|
755
|
+
this.listAdoptedWallets = (req, headers, signal) => {
|
|
756
|
+
return this.fetch(this.url('ListAdoptedWallets'), createHttpRequest(JsonEncode(req, 'ListAdoptedWalletsRequest'), headers, signal)).then(res => {
|
|
819
757
|
return buildResponse(res).then(_data => {
|
|
820
|
-
return
|
|
821
|
-
page: _data.page,
|
|
822
|
-
wallets: _data.wallets
|
|
823
|
-
};
|
|
758
|
+
return JsonDecode(_data, 'ListAdoptedWalletsResponse');
|
|
824
759
|
});
|
|
825
760
|
}, error => {
|
|
826
761
|
throw WebrpcRequestFailedError.new({
|
|
827
|
-
cause: `fetch(): ${error.message
|
|
762
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
828
763
|
});
|
|
829
764
|
});
|
|
830
765
|
};
|
|
831
766
|
this.getLifiChains = (headers, signal) => {
|
|
832
|
-
return this.fetch(this.url('GetLifiChains'),
|
|
767
|
+
return this.fetch(this.url('GetLifiChains'), createHttpRequest('{}', headers, signal)).then(res => {
|
|
833
768
|
return buildResponse(res).then(_data => {
|
|
834
|
-
return
|
|
835
|
-
chains: _data.chains
|
|
836
|
-
};
|
|
769
|
+
return JsonDecode(_data, 'GetLifiChainsResponse');
|
|
837
770
|
});
|
|
838
771
|
}, error => {
|
|
839
772
|
throw WebrpcRequestFailedError.new({
|
|
840
|
-
cause: `fetch(): ${error.message
|
|
773
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
841
774
|
});
|
|
842
775
|
});
|
|
843
776
|
};
|
|
844
|
-
this.getLifiTokens = (
|
|
845
|
-
return this.fetch(this.url('GetLifiTokens'),
|
|
777
|
+
this.getLifiTokens = (req, headers, signal) => {
|
|
778
|
+
return this.fetch(this.url('GetLifiTokens'), createHttpRequest(JsonEncode(req, 'GetLifiTokensRequest'), headers, signal)).then(res => {
|
|
846
779
|
return buildResponse(res).then(_data => {
|
|
847
|
-
return
|
|
848
|
-
tokens: _data.tokens
|
|
849
|
-
};
|
|
780
|
+
return JsonDecode(_data, 'GetLifiTokensResponse');
|
|
850
781
|
});
|
|
851
782
|
}, error => {
|
|
852
783
|
throw WebrpcRequestFailedError.new({
|
|
853
|
-
cause: `fetch(): ${error.message
|
|
784
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
854
785
|
});
|
|
855
786
|
});
|
|
856
787
|
};
|
|
857
|
-
this.getLifiSwapRoutes = (
|
|
858
|
-
return this.fetch(this.url('GetLifiSwapRoutes'),
|
|
788
|
+
this.getLifiSwapRoutes = (req, headers, signal) => {
|
|
789
|
+
return this.fetch(this.url('GetLifiSwapRoutes'), createHttpRequest(JsonEncode(req, 'GetLifiSwapRoutesRequest'), headers, signal)).then(res => {
|
|
859
790
|
return buildResponse(res).then(_data => {
|
|
860
|
-
return
|
|
861
|
-
routes: _data.routes
|
|
862
|
-
};
|
|
791
|
+
return JsonDecode(_data, 'GetLifiSwapRoutesResponse');
|
|
863
792
|
});
|
|
864
793
|
}, error => {
|
|
865
794
|
throw WebrpcRequestFailedError.new({
|
|
866
|
-
cause: `fetch(): ${error.message
|
|
795
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
867
796
|
});
|
|
868
797
|
});
|
|
869
798
|
};
|
|
870
|
-
this.getLifiSwapQuote = (
|
|
871
|
-
return this.fetch(this.url('GetLifiSwapQuote'),
|
|
799
|
+
this.getLifiSwapQuote = (req, headers, signal) => {
|
|
800
|
+
return this.fetch(this.url('GetLifiSwapQuote'), createHttpRequest(JsonEncode(req, 'GetLifiSwapQuoteRequest'), headers, signal)).then(res => {
|
|
872
801
|
return buildResponse(res).then(_data => {
|
|
873
|
-
return
|
|
874
|
-
quote: _data.quote
|
|
875
|
-
};
|
|
802
|
+
return JsonDecode(_data, 'GetLifiSwapQuoteResponse');
|
|
876
803
|
});
|
|
877
804
|
}, error => {
|
|
878
805
|
throw WebrpcRequestFailedError.new({
|
|
879
|
-
cause: `fetch(): ${error.message
|
|
806
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
880
807
|
});
|
|
881
808
|
});
|
|
882
809
|
};
|
|
883
|
-
this.getIntentCallsPayloads = (
|
|
884
|
-
return this.fetch(this.url('GetIntentCallsPayloads'),
|
|
810
|
+
this.getIntentCallsPayloads = (req, headers, signal) => {
|
|
811
|
+
return this.fetch(this.url('GetIntentCallsPayloads'), createHttpRequest(JsonEncode(req, 'GetIntentCallsPayloadsRequest'), headers, signal)).then(res => {
|
|
885
812
|
return buildResponse(res).then(_data => {
|
|
886
|
-
return
|
|
887
|
-
calls: _data.calls,
|
|
888
|
-
preconditions: _data.preconditions,
|
|
889
|
-
metaTxns: _data.metaTxns,
|
|
890
|
-
trailsFee: _data.trailsFee,
|
|
891
|
-
quote: _data.quote,
|
|
892
|
-
feeQuotes: _data.feeQuotes,
|
|
893
|
-
originIntentAddress: _data.originIntentAddress,
|
|
894
|
-
destinationIntentAddress: _data.destinationIntentAddress
|
|
895
|
-
};
|
|
813
|
+
return JsonDecode(_data, 'GetIntentCallsPayloadsResponse');
|
|
896
814
|
});
|
|
897
815
|
}, error => {
|
|
898
816
|
throw WebrpcRequestFailedError.new({
|
|
899
|
-
cause: `fetch(): ${error.message
|
|
817
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
900
818
|
});
|
|
901
819
|
});
|
|
902
820
|
};
|
|
903
|
-
this.commitIntentConfig = (
|
|
904
|
-
return this.fetch(this.url('CommitIntentConfig'),
|
|
821
|
+
this.commitIntentConfig = (req, headers, signal) => {
|
|
822
|
+
return this.fetch(this.url('CommitIntentConfig'), createHttpRequest(JsonEncode(req, 'CommitIntentConfigRequest'), headers, signal)).then(res => {
|
|
905
823
|
return buildResponse(res).then(_data => {
|
|
906
|
-
return
|
|
907
|
-
config: _data.config
|
|
908
|
-
};
|
|
824
|
+
return JsonDecode(_data, 'CommitIntentConfigResponse');
|
|
909
825
|
});
|
|
910
826
|
}, error => {
|
|
911
827
|
throw WebrpcRequestFailedError.new({
|
|
912
|
-
cause: `fetch(): ${error.message
|
|
828
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
913
829
|
});
|
|
914
830
|
});
|
|
915
831
|
};
|
|
916
|
-
this.getIntentConfig = (
|
|
917
|
-
return this.fetch(this.url('GetIntentConfig'),
|
|
832
|
+
this.getIntentConfig = (req, headers, signal) => {
|
|
833
|
+
return this.fetch(this.url('GetIntentConfig'), createHttpRequest(JsonEncode(req, 'GetIntentConfigRequest'), headers, signal)).then(res => {
|
|
918
834
|
return buildResponse(res).then(_data => {
|
|
919
|
-
return
|
|
920
|
-
config: _data.config
|
|
921
|
-
};
|
|
835
|
+
return JsonDecode(_data, 'GetIntentConfigResponse');
|
|
922
836
|
});
|
|
923
837
|
}, error => {
|
|
924
838
|
throw WebrpcRequestFailedError.new({
|
|
925
|
-
cause: `fetch(): ${error.message
|
|
839
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
926
840
|
});
|
|
927
841
|
});
|
|
928
842
|
};
|
|
929
843
|
this.listCurrencyGroups = (headers, signal) => {
|
|
930
|
-
return this.fetch(this.url('ListCurrencyGroups'),
|
|
844
|
+
return this.fetch(this.url('ListCurrencyGroups'), createHttpRequest('{}', headers, signal)).then(res => {
|
|
931
845
|
return buildResponse(res).then(_data => {
|
|
932
|
-
return
|
|
933
|
-
currencyGroups: _data.currencyGroups
|
|
934
|
-
};
|
|
846
|
+
return JsonDecode(_data, 'ListCurrencyGroupsResponse');
|
|
935
847
|
});
|
|
936
848
|
}, error => {
|
|
937
849
|
throw WebrpcRequestFailedError.new({
|
|
938
|
-
cause: `fetch(): ${error.message
|
|
850
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
939
851
|
});
|
|
940
852
|
});
|
|
941
853
|
};
|
|
942
|
-
this.addOffchainInventory = (
|
|
943
|
-
return this.fetch(this.url('AddOffchainInventory'),
|
|
854
|
+
this.addOffchainInventory = (req, headers, signal) => {
|
|
855
|
+
return this.fetch(this.url('AddOffchainInventory'), createHttpRequest(JsonEncode(req, 'AddOffchainInventoryRequest'), headers, signal)).then(res => {
|
|
944
856
|
return buildResponse(res).then(_data => {
|
|
945
|
-
return
|
|
946
|
-
inventoryId: _data.inventoryId
|
|
947
|
-
};
|
|
857
|
+
return JsonDecode(_data, 'AddOffchainInventoryResponse');
|
|
948
858
|
});
|
|
949
859
|
}, error => {
|
|
950
860
|
throw WebrpcRequestFailedError.new({
|
|
951
|
-
cause: `fetch(): ${error.message
|
|
861
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
952
862
|
});
|
|
953
863
|
});
|
|
954
864
|
};
|
|
955
|
-
this.getOffchainInventory = (
|
|
956
|
-
return this.fetch(this.url('GetOffchainInventory'),
|
|
865
|
+
this.getOffchainInventory = (req, headers, signal) => {
|
|
866
|
+
return this.fetch(this.url('GetOffchainInventory'), createHttpRequest(JsonEncode(req, 'GetOffchainInventoryRequest'), headers, signal)).then(res => {
|
|
957
867
|
return buildResponse(res).then(_data => {
|
|
958
|
-
return
|
|
959
|
-
inventory: _data.inventory
|
|
960
|
-
};
|
|
868
|
+
return JsonDecode(_data, 'GetOffchainInventoryResponse');
|
|
961
869
|
});
|
|
962
870
|
}, error => {
|
|
963
871
|
throw WebrpcRequestFailedError.new({
|
|
964
|
-
cause: `fetch(): ${error.message
|
|
872
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
965
873
|
});
|
|
966
874
|
});
|
|
967
875
|
};
|
|
968
|
-
this.listOffchainInventories = (
|
|
969
|
-
return this.fetch(this.url('ListOffchainInventories'),
|
|
876
|
+
this.listOffchainInventories = (req, headers, signal) => {
|
|
877
|
+
return this.fetch(this.url('ListOffchainInventories'), createHttpRequest(JsonEncode(req, 'ListOffchainInventoriesRequest'), headers, signal)).then(res => {
|
|
970
878
|
return buildResponse(res).then(_data => {
|
|
971
|
-
return
|
|
972
|
-
inventory: _data.inventory
|
|
973
|
-
};
|
|
879
|
+
return JsonDecode(_data, 'ListOffchainInventoriesResponse');
|
|
974
880
|
});
|
|
975
881
|
}, error => {
|
|
976
882
|
throw WebrpcRequestFailedError.new({
|
|
977
|
-
cause: `fetch(): ${error.message
|
|
883
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
978
884
|
});
|
|
979
885
|
});
|
|
980
886
|
};
|
|
981
|
-
this.updateOffchainInventory = (
|
|
982
|
-
return this.fetch(this.url('UpdateOffchainInventory'),
|
|
887
|
+
this.updateOffchainInventory = (req, headers, signal) => {
|
|
888
|
+
return this.fetch(this.url('UpdateOffchainInventory'), createHttpRequest(JsonEncode(req, 'UpdateOffchainInventoryRequest'), headers, signal)).then(res => {
|
|
983
889
|
return buildResponse(res).then(_data => {
|
|
984
|
-
return
|
|
890
|
+
return JsonDecode(_data, 'UpdateOffchainInventoryResponse');
|
|
985
891
|
});
|
|
986
892
|
}, error => {
|
|
987
893
|
throw WebrpcRequestFailedError.new({
|
|
988
|
-
cause: `fetch(): ${error.message
|
|
894
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
989
895
|
});
|
|
990
896
|
});
|
|
991
897
|
};
|
|
992
|
-
this.deleteOffchainInventory = (
|
|
993
|
-
return this.fetch(this.url('DeleteOffchainInventory'),
|
|
898
|
+
this.deleteOffchainInventory = (req, headers, signal) => {
|
|
899
|
+
return this.fetch(this.url('DeleteOffchainInventory'), createHttpRequest(JsonEncode(req, 'DeleteOffchainInventoryRequest'), headers, signal)).then(res => {
|
|
994
900
|
return buildResponse(res).then(_data => {
|
|
995
|
-
return
|
|
996
|
-
ok: _data.ok
|
|
997
|
-
};
|
|
901
|
+
return JsonDecode(_data, 'DeleteOffchainInventoryResponse');
|
|
998
902
|
});
|
|
999
903
|
}, error => {
|
|
1000
904
|
throw WebrpcRequestFailedError.new({
|
|
1001
|
-
cause: `fetch(): ${error.message
|
|
905
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1002
906
|
});
|
|
1003
907
|
});
|
|
1004
908
|
};
|
|
1005
|
-
this.requestOffchainPayment = (
|
|
1006
|
-
return this.fetch(this.url('RequestOffchainPayment'),
|
|
909
|
+
this.requestOffchainPayment = (req, headers, signal) => {
|
|
910
|
+
return this.fetch(this.url('RequestOffchainPayment'), createHttpRequest(JsonEncode(req, 'RequestOffchainPaymentRequest'), headers, signal)).then(res => {
|
|
1007
911
|
return buildResponse(res).then(_data => {
|
|
1008
|
-
return
|
|
1009
|
-
payment: _data.payment
|
|
1010
|
-
};
|
|
912
|
+
return JsonDecode(_data, 'RequestOffchainPaymentResponse');
|
|
1011
913
|
});
|
|
1012
914
|
}, error => {
|
|
1013
915
|
throw WebrpcRequestFailedError.new({
|
|
1014
|
-
cause: `fetch(): ${error.message
|
|
916
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1015
917
|
});
|
|
1016
918
|
});
|
|
1017
919
|
};
|
|
1018
|
-
this.listOffchainPayments = (
|
|
1019
|
-
return this.fetch(this.url('ListOffchainPayments'),
|
|
920
|
+
this.listOffchainPayments = (req, headers, signal) => {
|
|
921
|
+
return this.fetch(this.url('ListOffchainPayments'), createHttpRequest(JsonEncode(req, 'ListOffchainPaymentsRequest'), headers, signal)).then(res => {
|
|
1020
922
|
return buildResponse(res).then(_data => {
|
|
1021
|
-
return
|
|
1022
|
-
page: _data.page,
|
|
1023
|
-
payments: _data.payments
|
|
1024
|
-
};
|
|
923
|
+
return JsonDecode(_data, 'ListOffchainPaymentsResponse');
|
|
1025
924
|
});
|
|
1026
925
|
}, error => {
|
|
1027
926
|
throw WebrpcRequestFailedError.new({
|
|
1028
|
-
cause: `fetch(): ${error.message
|
|
927
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1029
928
|
});
|
|
1030
929
|
});
|
|
1031
930
|
};
|
|
1032
|
-
this.savePack = (
|
|
1033
|
-
return this.fetch(this.url('SavePack'),
|
|
931
|
+
this.savePack = (req, headers, signal) => {
|
|
932
|
+
return this.fetch(this.url('SavePack'), createHttpRequest(JsonEncode(req, 'SavePackRequest'), headers, signal)).then(res => {
|
|
1034
933
|
return buildResponse(res).then(_data => {
|
|
1035
|
-
return
|
|
1036
|
-
merkleRoot: _data.merkleRoot
|
|
1037
|
-
};
|
|
934
|
+
return JsonDecode(_data, 'SavePackResponse');
|
|
1038
935
|
});
|
|
1039
936
|
}, error => {
|
|
1040
937
|
throw WebrpcRequestFailedError.new({
|
|
1041
|
-
cause: `fetch(): ${error.message
|
|
938
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1042
939
|
});
|
|
1043
940
|
});
|
|
1044
941
|
};
|
|
1045
|
-
this.getPack = (
|
|
1046
|
-
return this.fetch(this.url('GetPack'),
|
|
942
|
+
this.getPack = (req, headers, signal) => {
|
|
943
|
+
return this.fetch(this.url('GetPack'), createHttpRequest(JsonEncode(req, 'GetPackRequest'), headers, signal)).then(res => {
|
|
1047
944
|
return buildResponse(res).then(_data => {
|
|
1048
|
-
return
|
|
1049
|
-
pack: _data.pack
|
|
1050
|
-
};
|
|
945
|
+
return JsonDecode(_data, 'GetPackResponse');
|
|
1051
946
|
});
|
|
1052
947
|
}, error => {
|
|
1053
948
|
throw WebrpcRequestFailedError.new({
|
|
1054
|
-
cause: `fetch(): ${error.message
|
|
949
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1055
950
|
});
|
|
1056
951
|
});
|
|
1057
952
|
};
|
|
1058
|
-
this.getPackIds = (
|
|
1059
|
-
return this.fetch(this.url('GetPackIds'),
|
|
953
|
+
this.getPackIds = (req, headers, signal) => {
|
|
954
|
+
return this.fetch(this.url('GetPackIds'), createHttpRequest(JsonEncode(req, 'GetPackIdsRequest'), headers, signal)).then(res => {
|
|
1060
955
|
return buildResponse(res).then(_data => {
|
|
1061
|
-
return
|
|
1062
|
-
packIds: _data.packIds
|
|
1063
|
-
};
|
|
956
|
+
return JsonDecode(_data, 'GetPackIdsResponse');
|
|
1064
957
|
});
|
|
1065
958
|
}, error => {
|
|
1066
959
|
throw WebrpcRequestFailedError.new({
|
|
1067
|
-
cause: `fetch(): ${error.message
|
|
960
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1068
961
|
});
|
|
1069
962
|
});
|
|
1070
963
|
};
|
|
1071
|
-
this.deletePack = (
|
|
1072
|
-
return this.fetch(this.url('DeletePack'),
|
|
964
|
+
this.deletePack = (req, headers, signal) => {
|
|
965
|
+
return this.fetch(this.url('DeletePack'), createHttpRequest(JsonEncode(req, 'DeletePackRequest'), headers, signal)).then(res => {
|
|
1073
966
|
return buildResponse(res).then(_data => {
|
|
1074
|
-
return
|
|
1075
|
-
status: _data.status
|
|
1076
|
-
};
|
|
967
|
+
return JsonDecode(_data, 'DeletePackResponse');
|
|
1077
968
|
});
|
|
1078
969
|
}, error => {
|
|
1079
970
|
throw WebrpcRequestFailedError.new({
|
|
1080
|
-
cause: `fetch(): ${error.message
|
|
971
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1081
972
|
});
|
|
1082
973
|
});
|
|
1083
974
|
};
|
|
1084
|
-
this.updatePackContent = (
|
|
1085
|
-
return this.fetch(this.url('UpdatePackContent'),
|
|
975
|
+
this.updatePackContent = (req, headers, signal) => {
|
|
976
|
+
return this.fetch(this.url('UpdatePackContent'), createHttpRequest(JsonEncode(req, 'UpdatePackContentRequest'), headers, signal)).then(res => {
|
|
1086
977
|
return buildResponse(res).then(_data => {
|
|
1087
|
-
return
|
|
1088
|
-
merkleRoot: _data.merkleRoot
|
|
1089
|
-
};
|
|
978
|
+
return JsonDecode(_data, 'UpdatePackContentResponse');
|
|
1090
979
|
});
|
|
1091
980
|
}, error => {
|
|
1092
981
|
throw WebrpcRequestFailedError.new({
|
|
1093
|
-
cause: `fetch(): ${error.message
|
|
982
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1094
983
|
});
|
|
1095
984
|
});
|
|
1096
985
|
};
|
|
1097
|
-
this.getRevealTxData = (
|
|
1098
|
-
return this.fetch(this.url('GetRevealTxData'),
|
|
986
|
+
this.getRevealTxData = (req, headers, signal) => {
|
|
987
|
+
return this.fetch(this.url('GetRevealTxData'), createHttpRequest(JsonEncode(req, 'GetRevealTxDataRequest'), headers, signal)).then(res => {
|
|
1099
988
|
return buildResponse(res).then(_data => {
|
|
1100
|
-
return
|
|
1101
|
-
txData: _data.txData
|
|
1102
|
-
};
|
|
989
|
+
return JsonDecode(_data, 'GetRevealTxDataResponse');
|
|
1103
990
|
});
|
|
1104
991
|
}, error => {
|
|
1105
992
|
throw WebrpcRequestFailedError.new({
|
|
1106
|
-
cause: `fetch(): ${error.message
|
|
993
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1107
994
|
});
|
|
1108
995
|
});
|
|
1109
996
|
};
|
|
1110
|
-
this.checkoutOptionsPrimary = (
|
|
1111
|
-
return this.fetch(this.url('CheckoutOptionsPrimary'),
|
|
997
|
+
this.checkoutOptionsPrimary = (req, headers, signal) => {
|
|
998
|
+
return this.fetch(this.url('CheckoutOptionsPrimary'), createHttpRequest(JsonEncode(req, 'CheckoutOptionsPrimaryRequest'), headers, signal)).then(res => {
|
|
1112
999
|
return buildResponse(res).then(_data => {
|
|
1113
|
-
return
|
|
1114
|
-
options: _data.options
|
|
1115
|
-
};
|
|
1000
|
+
return JsonDecode(_data, 'CheckoutOptionsPrimaryResponse');
|
|
1116
1001
|
});
|
|
1117
1002
|
}, error => {
|
|
1118
1003
|
throw WebrpcRequestFailedError.new({
|
|
1119
|
-
cause: `fetch(): ${error.message
|
|
1004
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1120
1005
|
});
|
|
1121
1006
|
});
|
|
1122
1007
|
};
|
|
1123
|
-
this.checkoutOptionsSecondary = (
|
|
1124
|
-
return this.fetch(this.url('CheckoutOptionsSecondary'),
|
|
1008
|
+
this.checkoutOptionsSecondary = (req, headers, signal) => {
|
|
1009
|
+
return this.fetch(this.url('CheckoutOptionsSecondary'), createHttpRequest(JsonEncode(req, 'CheckoutOptionsSecondaryRequest'), headers, signal)).then(res => {
|
|
1125
1010
|
return buildResponse(res).then(_data => {
|
|
1126
|
-
return
|
|
1127
|
-
options: _data.options
|
|
1128
|
-
};
|
|
1011
|
+
return JsonDecode(_data, 'CheckoutOptionsSecondaryResponse');
|
|
1129
1012
|
});
|
|
1130
1013
|
}, error => {
|
|
1131
1014
|
throw WebrpcRequestFailedError.new({
|
|
1132
|
-
cause: `fetch(): ${error.message
|
|
1015
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1133
1016
|
});
|
|
1134
1017
|
});
|
|
1135
1018
|
};
|
|
1136
|
-
this.checkoutOptionsGetTransakContractID = (
|
|
1137
|
-
return this.fetch(this.url('CheckoutOptionsGetTransakContractID'),
|
|
1019
|
+
this.checkoutOptionsGetTransakContractID = (req, headers, signal) => {
|
|
1020
|
+
return this.fetch(this.url('CheckoutOptionsGetTransakContractID'), createHttpRequest(JsonEncode(req, 'CheckoutOptionsGetTransakContractIDRequest'), headers, signal)).then(res => {
|
|
1138
1021
|
return buildResponse(res).then(_data => {
|
|
1139
|
-
return
|
|
1140
|
-
contractId: _data.contractId
|
|
1141
|
-
};
|
|
1022
|
+
return JsonDecode(_data, 'CheckoutOptionsGetTransakContractIDResponse');
|
|
1142
1023
|
});
|
|
1143
1024
|
}, error => {
|
|
1144
1025
|
throw WebrpcRequestFailedError.new({
|
|
1145
|
-
cause: `fetch(): ${error.message
|
|
1026
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1146
1027
|
});
|
|
1147
1028
|
});
|
|
1148
1029
|
};
|
|
1149
|
-
this.fortePayCreateIntent = (
|
|
1150
|
-
return this.fetch(this.url('FortePayCreateIntent'),
|
|
1030
|
+
this.fortePayCreateIntent = (req, headers, signal) => {
|
|
1031
|
+
return this.fetch(this.url('FortePayCreateIntent'), createHttpRequest(JsonEncode(req, 'FortePayCreateIntentRequest'), headers, signal)).then(res => {
|
|
1151
1032
|
return buildResponse(res).then(_data => {
|
|
1152
|
-
return
|
|
1153
|
-
resp: _data.resp
|
|
1154
|
-
};
|
|
1033
|
+
return JsonDecode(_data, 'FortePayCreateIntentResponse');
|
|
1155
1034
|
});
|
|
1156
1035
|
}, error => {
|
|
1157
1036
|
throw WebrpcRequestFailedError.new({
|
|
1158
|
-
cause: `fetch(): ${error.message
|
|
1037
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1159
1038
|
});
|
|
1160
1039
|
});
|
|
1161
1040
|
};
|
|
1162
|
-
this.fortePayGetPaymentStatuses = (
|
|
1163
|
-
return this.fetch(this.url('FortePayGetPaymentStatuses'),
|
|
1041
|
+
this.fortePayGetPaymentStatuses = (req, headers, signal) => {
|
|
1042
|
+
return this.fetch(this.url('FortePayGetPaymentStatuses'), createHttpRequest(JsonEncode(req, 'FortePayGetPaymentStatusesRequest'), headers, signal)).then(res => {
|
|
1164
1043
|
return buildResponse(res).then(_data => {
|
|
1165
|
-
return
|
|
1166
|
-
statuses: _data.statuses
|
|
1167
|
-
};
|
|
1044
|
+
return JsonDecode(_data, 'FortePayGetPaymentStatusesResponse');
|
|
1168
1045
|
});
|
|
1169
1046
|
}, error => {
|
|
1170
1047
|
throw WebrpcRequestFailedError.new({
|
|
1171
|
-
cause: `fetch(): ${error.message
|
|
1048
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1172
1049
|
});
|
|
1173
1050
|
});
|
|
1174
1051
|
};
|
|
1175
|
-
this.getCCTPTransfer = (
|
|
1176
|
-
return this.fetch(this.url('GetCCTPTransfer'),
|
|
1052
|
+
this.getCCTPTransfer = (req, headers, signal) => {
|
|
1053
|
+
return this.fetch(this.url('GetCCTPTransfer'), createHttpRequest(JsonEncode(req, 'GetCCTPTransferRequest'), headers, signal)).then(res => {
|
|
1177
1054
|
return buildResponse(res).then(_data => {
|
|
1178
|
-
return
|
|
1179
|
-
transfer: _data.transfer
|
|
1180
|
-
};
|
|
1055
|
+
return JsonDecode(_data, 'GetCCTPTransferResponse');
|
|
1181
1056
|
});
|
|
1182
1057
|
}, error => {
|
|
1183
1058
|
throw WebrpcRequestFailedError.new({
|
|
1184
|
-
cause: `fetch(): ${error.message
|
|
1059
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1185
1060
|
});
|
|
1186
1061
|
});
|
|
1187
1062
|
};
|
|
1188
|
-
this.queueCCTPTransfer = (
|
|
1189
|
-
return this.fetch(this.url('QueueCCTPTransfer'),
|
|
1063
|
+
this.queueCCTPTransfer = (req, headers, signal) => {
|
|
1064
|
+
return this.fetch(this.url('QueueCCTPTransfer'), createHttpRequest(JsonEncode(req, 'QueueCCTPTransferRequest'), headers, signal)).then(res => {
|
|
1190
1065
|
return buildResponse(res).then(_data => {
|
|
1191
|
-
return
|
|
1192
|
-
transfer: _data.transfer
|
|
1193
|
-
};
|
|
1066
|
+
return JsonDecode(_data, 'QueueCCTPTransferResponse');
|
|
1194
1067
|
});
|
|
1195
1068
|
}, error => {
|
|
1196
1069
|
throw WebrpcRequestFailedError.new({
|
|
1197
|
-
cause: `fetch(): ${error.message
|
|
1070
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1198
1071
|
});
|
|
1199
1072
|
});
|
|
1200
1073
|
};
|
|
1201
|
-
this.queueIntentConfigExecution = (
|
|
1202
|
-
return this.fetch(this.url('QueueIntentConfigExecution'),
|
|
1074
|
+
this.queueIntentConfigExecution = (req, headers, signal) => {
|
|
1075
|
+
return this.fetch(this.url('QueueIntentConfigExecution'), createHttpRequest(JsonEncode(req, 'QueueIntentConfigExecutionRequest'), headers, signal)).then(res => {
|
|
1203
1076
|
return buildResponse(res).then(_data => {
|
|
1204
|
-
return
|
|
1205
|
-
status: _data.status
|
|
1206
|
-
};
|
|
1077
|
+
return JsonDecode(_data, 'QueueIntentConfigExecutionResponse');
|
|
1207
1078
|
});
|
|
1208
1079
|
}, error => {
|
|
1209
1080
|
throw WebrpcRequestFailedError.new({
|
|
1210
|
-
cause: `fetch(): ${error.message
|
|
1081
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1211
1082
|
});
|
|
1212
1083
|
});
|
|
1213
1084
|
};
|
|
1214
|
-
this.getIntentConfigExecutionStatus = (
|
|
1215
|
-
return this.fetch(this.url('GetIntentConfigExecutionStatus'),
|
|
1085
|
+
this.getIntentConfigExecutionStatus = (req, headers, signal) => {
|
|
1086
|
+
return this.fetch(this.url('GetIntentConfigExecutionStatus'), createHttpRequest(JsonEncode(req, 'GetIntentConfigExecutionStatusRequest'), headers, signal)).then(res => {
|
|
1216
1087
|
return buildResponse(res).then(_data => {
|
|
1217
|
-
return
|
|
1218
|
-
executionStatus: _data.executionStatus
|
|
1219
|
-
};
|
|
1088
|
+
return JsonDecode(_data, 'GetIntentConfigExecutionStatusResponse');
|
|
1220
1089
|
});
|
|
1221
1090
|
}, error => {
|
|
1222
1091
|
throw WebrpcRequestFailedError.new({
|
|
1223
|
-
cause: `fetch(): ${error.message
|
|
1092
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1224
1093
|
});
|
|
1225
1094
|
});
|
|
1226
1095
|
};
|
|
1227
|
-
this.listIntentConfigs = (
|
|
1228
|
-
return this.fetch(this.url('ListIntentConfigs'),
|
|
1096
|
+
this.listIntentConfigs = (req, headers, signal) => {
|
|
1097
|
+
return this.fetch(this.url('ListIntentConfigs'), createHttpRequest(JsonEncode(req, 'ListIntentConfigsRequest'), headers, signal)).then(res => {
|
|
1229
1098
|
return buildResponse(res).then(_data => {
|
|
1230
|
-
return
|
|
1231
|
-
page: _data.page,
|
|
1232
|
-
intentConfigs: _data.intentConfigs
|
|
1233
|
-
};
|
|
1099
|
+
return JsonDecode(_data, 'ListIntentConfigsResponse');
|
|
1234
1100
|
});
|
|
1235
1101
|
}, error => {
|
|
1236
1102
|
throw WebrpcRequestFailedError.new({
|
|
1237
|
-
cause: `fetch(): ${error.message
|
|
1103
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1238
1104
|
});
|
|
1239
1105
|
});
|
|
1240
1106
|
};
|
|
1241
|
-
this.queueMetaTxnReceipt = (
|
|
1242
|
-
return this.fetch(this.url('QueueMetaTxnReceipt'),
|
|
1107
|
+
this.queueMetaTxnReceipt = (req, headers, signal) => {
|
|
1108
|
+
return this.fetch(this.url('QueueMetaTxnReceipt'), createHttpRequest(JsonEncode(req, 'QueueMetaTxnReceiptRequest'), headers, signal)).then(res => {
|
|
1243
1109
|
return buildResponse(res).then(_data => {
|
|
1244
|
-
return
|
|
1245
|
-
status: _data.status
|
|
1246
|
-
};
|
|
1110
|
+
return JsonDecode(_data, 'QueueMetaTxnReceiptResponse');
|
|
1247
1111
|
});
|
|
1248
1112
|
}, error => {
|
|
1249
1113
|
throw WebrpcRequestFailedError.new({
|
|
1250
|
-
cause: `fetch(): ${error.message
|
|
1114
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1251
1115
|
});
|
|
1252
1116
|
});
|
|
1253
1117
|
};
|
|
@@ -1258,15 +1122,15 @@ class API {
|
|
|
1258
1122
|
return this.hostname + this.path + name;
|
|
1259
1123
|
}
|
|
1260
1124
|
}
|
|
1261
|
-
const
|
|
1125
|
+
const createHttpRequest = (body = '{}', headers = {}, signal = null) => {
|
|
1262
1126
|
const reqHeaders = _extends({}, headers, {
|
|
1263
|
-
'Content-Type': 'application/json'
|
|
1127
|
+
'Content-Type': 'application/json',
|
|
1128
|
+
[WebrpcHeader]: WebrpcHeaderValue
|
|
1264
1129
|
});
|
|
1265
|
-
reqHeaders[WebrpcHeader] = WebrpcHeaderValue;
|
|
1266
1130
|
return {
|
|
1267
1131
|
method: 'POST',
|
|
1268
1132
|
headers: reqHeaders,
|
|
1269
|
-
body
|
|
1133
|
+
body,
|
|
1270
1134
|
signal
|
|
1271
1135
|
};
|
|
1272
1136
|
};
|
|
@@ -1276,13 +1140,9 @@ const buildResponse = res => {
|
|
|
1276
1140
|
try {
|
|
1277
1141
|
data = JSON.parse(text);
|
|
1278
1142
|
} catch (error) {
|
|
1279
|
-
let message = '';
|
|
1280
|
-
if (error instanceof Error) {
|
|
1281
|
-
message = error.message;
|
|
1282
|
-
}
|
|
1283
1143
|
throw WebrpcBadResponseError.new({
|
|
1284
1144
|
status: res.status,
|
|
1285
|
-
cause: `JSON.parse(): ${message}: response text: ${text}`
|
|
1145
|
+
cause: `JSON.parse(): ${error instanceof Error ? error.message : String(error)}: response text: ${text}`
|
|
1286
1146
|
});
|
|
1287
1147
|
}
|
|
1288
1148
|
if (!res.ok) {
|
|
@@ -1292,252 +1152,446 @@ const buildResponse = res => {
|
|
|
1292
1152
|
return data;
|
|
1293
1153
|
});
|
|
1294
1154
|
};
|
|
1155
|
+
const JsonEncode = (obj, _typ = '') => {
|
|
1156
|
+
return JSON.stringify(obj);
|
|
1157
|
+
};
|
|
1158
|
+
const JsonDecode = (data, _typ = '') => {
|
|
1159
|
+
let parsed = data;
|
|
1160
|
+
if (typeof data === 'string') {
|
|
1161
|
+
try {
|
|
1162
|
+
parsed = JSON.parse(data);
|
|
1163
|
+
} catch (err) {
|
|
1164
|
+
throw WebrpcBadResponseError.new({
|
|
1165
|
+
cause: `JsonDecode: JSON.parse failed: ${err.message}`
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
return parsed;
|
|
1170
|
+
};
|
|
1295
1171
|
|
|
1296
1172
|
//
|
|
1297
1173
|
// Errors
|
|
1298
1174
|
//
|
|
1299
1175
|
|
|
1300
1176
|
class WebrpcError extends Error {
|
|
1301
|
-
constructor(
|
|
1302
|
-
super(message);
|
|
1303
|
-
this.name = void 0;
|
|
1177
|
+
constructor(error = {}) {
|
|
1178
|
+
super(error.message);
|
|
1304
1179
|
this.code = void 0;
|
|
1305
|
-
this.message = void 0;
|
|
1306
1180
|
this.status = void 0;
|
|
1307
|
-
this.
|
|
1308
|
-
|
|
1309
|
-
this.
|
|
1310
|
-
this.
|
|
1311
|
-
|
|
1312
|
-
this.message = message || `endpoint error ${this.code}`;
|
|
1313
|
-
this.msg = this.message;
|
|
1314
|
-
this.status = typeof status === 'number' ? status : 0;
|
|
1315
|
-
this.cause = cause;
|
|
1181
|
+
this.name = error.name || 'WebrpcEndpointError';
|
|
1182
|
+
this.code = typeof error.code === 'number' ? error.code : 0;
|
|
1183
|
+
this.message = error.message || `endpoint error`;
|
|
1184
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1185
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1316
1186
|
Object.setPrototypeOf(this, WebrpcError.prototype);
|
|
1317
1187
|
}
|
|
1318
1188
|
static new(payload) {
|
|
1319
|
-
return new this(
|
|
1189
|
+
return new this({
|
|
1190
|
+
message: payload.message,
|
|
1191
|
+
code: payload.code,
|
|
1192
|
+
status: payload.status,
|
|
1193
|
+
cause: payload.cause
|
|
1194
|
+
});
|
|
1320
1195
|
}
|
|
1321
1196
|
}
|
|
1322
|
-
|
|
1323
|
-
// Webrpc errors
|
|
1324
|
-
|
|
1325
1197
|
class WebrpcEndpointError extends WebrpcError {
|
|
1326
|
-
constructor(
|
|
1327
|
-
super(
|
|
1198
|
+
constructor(error = {}) {
|
|
1199
|
+
super(error);
|
|
1200
|
+
this.name = error.name || 'WebrpcEndpoint';
|
|
1201
|
+
this.code = typeof error.code === 'number' ? error.code : 0;
|
|
1202
|
+
this.message = error.message || `endpoint error`;
|
|
1203
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1204
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1328
1205
|
Object.setPrototypeOf(this, WebrpcEndpointError.prototype);
|
|
1329
1206
|
}
|
|
1330
1207
|
}
|
|
1331
1208
|
class WebrpcRequestFailedError extends WebrpcError {
|
|
1332
|
-
constructor(
|
|
1333
|
-
super(
|
|
1209
|
+
constructor(error = {}) {
|
|
1210
|
+
super(error);
|
|
1211
|
+
this.name = error.name || 'WebrpcRequestFailed';
|
|
1212
|
+
this.code = typeof error.code === 'number' ? error.code : -1;
|
|
1213
|
+
this.message = error.message || `request failed`;
|
|
1214
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1215
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1334
1216
|
Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype);
|
|
1335
1217
|
}
|
|
1336
1218
|
}
|
|
1337
1219
|
class WebrpcBadRouteError extends WebrpcError {
|
|
1338
|
-
constructor(
|
|
1339
|
-
super(
|
|
1220
|
+
constructor(error = {}) {
|
|
1221
|
+
super(error);
|
|
1222
|
+
this.name = error.name || 'WebrpcBadRoute';
|
|
1223
|
+
this.code = typeof error.code === 'number' ? error.code : -2;
|
|
1224
|
+
this.message = error.message || `bad route`;
|
|
1225
|
+
this.status = typeof error.status === 'number' ? error.status : 404;
|
|
1226
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1340
1227
|
Object.setPrototypeOf(this, WebrpcBadRouteError.prototype);
|
|
1341
1228
|
}
|
|
1342
1229
|
}
|
|
1343
1230
|
class WebrpcBadMethodError extends WebrpcError {
|
|
1344
|
-
constructor(
|
|
1345
|
-
super(
|
|
1231
|
+
constructor(error = {}) {
|
|
1232
|
+
super(error);
|
|
1233
|
+
this.name = error.name || 'WebrpcBadMethod';
|
|
1234
|
+
this.code = typeof error.code === 'number' ? error.code : -3;
|
|
1235
|
+
this.message = error.message || `bad method`;
|
|
1236
|
+
this.status = typeof error.status === 'number' ? error.status : 405;
|
|
1237
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1346
1238
|
Object.setPrototypeOf(this, WebrpcBadMethodError.prototype);
|
|
1347
1239
|
}
|
|
1348
1240
|
}
|
|
1349
1241
|
class WebrpcBadRequestError extends WebrpcError {
|
|
1350
|
-
constructor(
|
|
1351
|
-
super(
|
|
1242
|
+
constructor(error = {}) {
|
|
1243
|
+
super(error);
|
|
1244
|
+
this.name = error.name || 'WebrpcBadRequest';
|
|
1245
|
+
this.code = typeof error.code === 'number' ? error.code : -4;
|
|
1246
|
+
this.message = error.message || `bad request`;
|
|
1247
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1248
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1352
1249
|
Object.setPrototypeOf(this, WebrpcBadRequestError.prototype);
|
|
1353
1250
|
}
|
|
1354
1251
|
}
|
|
1355
1252
|
class WebrpcBadResponseError extends WebrpcError {
|
|
1356
|
-
constructor(
|
|
1357
|
-
super(
|
|
1253
|
+
constructor(error = {}) {
|
|
1254
|
+
super(error);
|
|
1255
|
+
this.name = error.name || 'WebrpcBadResponse';
|
|
1256
|
+
this.code = typeof error.code === 'number' ? error.code : -5;
|
|
1257
|
+
this.message = error.message || `bad response`;
|
|
1258
|
+
this.status = typeof error.status === 'number' ? error.status : 500;
|
|
1259
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1358
1260
|
Object.setPrototypeOf(this, WebrpcBadResponseError.prototype);
|
|
1359
1261
|
}
|
|
1360
1262
|
}
|
|
1361
1263
|
class WebrpcServerPanicError extends WebrpcError {
|
|
1362
|
-
constructor(
|
|
1363
|
-
super(
|
|
1264
|
+
constructor(error = {}) {
|
|
1265
|
+
super(error);
|
|
1266
|
+
this.name = error.name || 'WebrpcServerPanic';
|
|
1267
|
+
this.code = typeof error.code === 'number' ? error.code : -6;
|
|
1268
|
+
this.message = error.message || `server panic`;
|
|
1269
|
+
this.status = typeof error.status === 'number' ? error.status : 500;
|
|
1270
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1364
1271
|
Object.setPrototypeOf(this, WebrpcServerPanicError.prototype);
|
|
1365
1272
|
}
|
|
1366
1273
|
}
|
|
1367
1274
|
class WebrpcInternalErrorError extends WebrpcError {
|
|
1368
|
-
constructor(
|
|
1369
|
-
super(
|
|
1275
|
+
constructor(error = {}) {
|
|
1276
|
+
super(error);
|
|
1277
|
+
this.name = error.name || 'WebrpcInternalError';
|
|
1278
|
+
this.code = typeof error.code === 'number' ? error.code : -7;
|
|
1279
|
+
this.message = error.message || `internal error`;
|
|
1280
|
+
this.status = typeof error.status === 'number' ? error.status : 500;
|
|
1281
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1370
1282
|
Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype);
|
|
1371
1283
|
}
|
|
1372
1284
|
}
|
|
1373
|
-
class
|
|
1374
|
-
constructor(
|
|
1375
|
-
super(
|
|
1376
|
-
|
|
1285
|
+
class WebrpcClientAbortedError extends WebrpcError {
|
|
1286
|
+
constructor(error = {}) {
|
|
1287
|
+
super(error);
|
|
1288
|
+
this.name = error.name || 'WebrpcClientAborted';
|
|
1289
|
+
this.code = typeof error.code === 'number' ? error.code : -8;
|
|
1290
|
+
this.message = error.message || `request aborted by client`;
|
|
1291
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1292
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1293
|
+
Object.setPrototypeOf(this, WebrpcClientAbortedError.prototype);
|
|
1377
1294
|
}
|
|
1378
1295
|
}
|
|
1379
1296
|
class WebrpcStreamLostError extends WebrpcError {
|
|
1380
|
-
constructor(
|
|
1381
|
-
super(
|
|
1297
|
+
constructor(error = {}) {
|
|
1298
|
+
super(error);
|
|
1299
|
+
this.name = error.name || 'WebrpcStreamLost';
|
|
1300
|
+
this.code = typeof error.code === 'number' ? error.code : -9;
|
|
1301
|
+
this.message = error.message || `stream lost`;
|
|
1302
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1303
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1382
1304
|
Object.setPrototypeOf(this, WebrpcStreamLostError.prototype);
|
|
1383
1305
|
}
|
|
1384
1306
|
}
|
|
1385
1307
|
class WebrpcStreamFinishedError extends WebrpcError {
|
|
1386
|
-
constructor(
|
|
1387
|
-
super(
|
|
1308
|
+
constructor(error = {}) {
|
|
1309
|
+
super(error);
|
|
1310
|
+
this.name = error.name || 'WebrpcStreamFinished';
|
|
1311
|
+
this.code = typeof error.code === 'number' ? error.code : -10;
|
|
1312
|
+
this.message = error.message || `stream finished`;
|
|
1313
|
+
this.status = typeof error.status === 'number' ? error.status : 200;
|
|
1314
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1388
1315
|
Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype);
|
|
1389
1316
|
}
|
|
1390
1317
|
}
|
|
1391
1318
|
|
|
1319
|
+
//
|
|
1392
1320
|
// Schema errors
|
|
1321
|
+
//
|
|
1393
1322
|
|
|
1394
1323
|
class UnauthorizedError extends WebrpcError {
|
|
1395
|
-
constructor(
|
|
1396
|
-
super(
|
|
1324
|
+
constructor(error = {}) {
|
|
1325
|
+
super(error);
|
|
1326
|
+
this.name = error.name || 'Unauthorized';
|
|
1327
|
+
this.code = typeof error.code === 'number' ? error.code : 1000;
|
|
1328
|
+
this.message = error.message || `Unauthorized access`;
|
|
1329
|
+
this.status = typeof error.status === 'number' ? error.status : 401;
|
|
1330
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1397
1331
|
Object.setPrototypeOf(this, UnauthorizedError.prototype);
|
|
1398
1332
|
}
|
|
1399
1333
|
}
|
|
1400
1334
|
class PermissionDeniedError extends WebrpcError {
|
|
1401
|
-
constructor(
|
|
1402
|
-
super(
|
|
1335
|
+
constructor(error = {}) {
|
|
1336
|
+
super(error);
|
|
1337
|
+
this.name = error.name || 'PermissionDenied';
|
|
1338
|
+
this.code = typeof error.code === 'number' ? error.code : 1001;
|
|
1339
|
+
this.message = error.message || `Permission denied`;
|
|
1340
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1341
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1403
1342
|
Object.setPrototypeOf(this, PermissionDeniedError.prototype);
|
|
1404
1343
|
}
|
|
1405
1344
|
}
|
|
1406
1345
|
class SessionExpiredError extends WebrpcError {
|
|
1407
|
-
constructor(
|
|
1408
|
-
super(
|
|
1346
|
+
constructor(error = {}) {
|
|
1347
|
+
super(error);
|
|
1348
|
+
this.name = error.name || 'SessionExpired';
|
|
1349
|
+
this.code = typeof error.code === 'number' ? error.code : 1002;
|
|
1350
|
+
this.message = error.message || `Session expired`;
|
|
1351
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1352
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1409
1353
|
Object.setPrototypeOf(this, SessionExpiredError.prototype);
|
|
1410
1354
|
}
|
|
1411
1355
|
}
|
|
1412
1356
|
class MethodNotFoundError extends WebrpcError {
|
|
1413
|
-
constructor(
|
|
1414
|
-
super(
|
|
1357
|
+
constructor(error = {}) {
|
|
1358
|
+
super(error);
|
|
1359
|
+
this.name = error.name || 'MethodNotFound';
|
|
1360
|
+
this.code = typeof error.code === 'number' ? error.code : 1003;
|
|
1361
|
+
this.message = error.message || `Method not found`;
|
|
1362
|
+
this.status = typeof error.status === 'number' ? error.status : 404;
|
|
1363
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1415
1364
|
Object.setPrototypeOf(this, MethodNotFoundError.prototype);
|
|
1416
1365
|
}
|
|
1417
1366
|
}
|
|
1418
1367
|
class RequestConflictError extends WebrpcError {
|
|
1419
|
-
constructor(
|
|
1420
|
-
super(
|
|
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) this.cause = error.cause;
|
|
1421
1375
|
Object.setPrototypeOf(this, RequestConflictError.prototype);
|
|
1422
1376
|
}
|
|
1423
1377
|
}
|
|
1424
1378
|
class AbortedError extends WebrpcError {
|
|
1425
|
-
constructor(
|
|
1426
|
-
super(
|
|
1379
|
+
constructor(error = {}) {
|
|
1380
|
+
super(error);
|
|
1381
|
+
this.name = error.name || 'Aborted';
|
|
1382
|
+
this.code = typeof error.code === 'number' ? error.code : 1005;
|
|
1383
|
+
this.message = error.message || `Request aborted`;
|
|
1384
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1385
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1427
1386
|
Object.setPrototypeOf(this, AbortedError.prototype);
|
|
1428
1387
|
}
|
|
1429
1388
|
}
|
|
1430
1389
|
class GeoblockedError extends WebrpcError {
|
|
1431
|
-
constructor(
|
|
1432
|
-
super(
|
|
1390
|
+
constructor(error = {}) {
|
|
1391
|
+
super(error);
|
|
1392
|
+
this.name = error.name || 'Geoblocked';
|
|
1393
|
+
this.code = typeof error.code === 'number' ? error.code : 1006;
|
|
1394
|
+
this.message = error.message || `Geoblocked region`;
|
|
1395
|
+
this.status = typeof error.status === 'number' ? error.status : 451;
|
|
1396
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1433
1397
|
Object.setPrototypeOf(this, GeoblockedError.prototype);
|
|
1434
1398
|
}
|
|
1435
1399
|
}
|
|
1436
1400
|
class RateLimitedError extends WebrpcError {
|
|
1437
|
-
constructor(
|
|
1438
|
-
super(
|
|
1401
|
+
constructor(error = {}) {
|
|
1402
|
+
super(error);
|
|
1403
|
+
this.name = error.name || 'RateLimited';
|
|
1404
|
+
this.code = typeof error.code === 'number' ? error.code : 1007;
|
|
1405
|
+
this.message = error.message || `Rate-limited. Please slow down.`;
|
|
1406
|
+
this.status = typeof error.status === 'number' ? error.status : 429;
|
|
1407
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1439
1408
|
Object.setPrototypeOf(this, RateLimitedError.prototype);
|
|
1440
1409
|
}
|
|
1441
1410
|
}
|
|
1442
1411
|
class ProjectNotFoundError extends WebrpcError {
|
|
1443
|
-
constructor(
|
|
1444
|
-
super(
|
|
1412
|
+
constructor(error = {}) {
|
|
1413
|
+
super(error);
|
|
1414
|
+
this.name = error.name || 'ProjectNotFound';
|
|
1415
|
+
this.code = typeof error.code === 'number' ? error.code : 1008;
|
|
1416
|
+
this.message = error.message || `Project not found`;
|
|
1417
|
+
this.status = typeof error.status === 'number' ? error.status : 401;
|
|
1418
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1445
1419
|
Object.setPrototypeOf(this, ProjectNotFoundError.prototype);
|
|
1446
1420
|
}
|
|
1447
1421
|
}
|
|
1448
1422
|
class AccessKeyNotFoundError extends WebrpcError {
|
|
1449
|
-
constructor(
|
|
1450
|
-
super(
|
|
1423
|
+
constructor(error = {}) {
|
|
1424
|
+
super(error);
|
|
1425
|
+
this.name = error.name || 'AccessKeyNotFound';
|
|
1426
|
+
this.code = typeof error.code === 'number' ? error.code : 1101;
|
|
1427
|
+
this.message = error.message || `Access key not found`;
|
|
1428
|
+
this.status = typeof error.status === 'number' ? error.status : 401;
|
|
1429
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1451
1430
|
Object.setPrototypeOf(this, AccessKeyNotFoundError.prototype);
|
|
1452
1431
|
}
|
|
1453
1432
|
}
|
|
1454
1433
|
class AccessKeyMismatchError extends WebrpcError {
|
|
1455
|
-
constructor(
|
|
1456
|
-
super(
|
|
1434
|
+
constructor(error = {}) {
|
|
1435
|
+
super(error);
|
|
1436
|
+
this.name = error.name || 'AccessKeyMismatch';
|
|
1437
|
+
this.code = typeof error.code === 'number' ? error.code : 1102;
|
|
1438
|
+
this.message = error.message || `Access key mismatch`;
|
|
1439
|
+
this.status = typeof error.status === 'number' ? error.status : 409;
|
|
1440
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1457
1441
|
Object.setPrototypeOf(this, AccessKeyMismatchError.prototype);
|
|
1458
1442
|
}
|
|
1459
1443
|
}
|
|
1460
1444
|
class InvalidOriginError extends WebrpcError {
|
|
1461
|
-
constructor(
|
|
1462
|
-
super(
|
|
1445
|
+
constructor(error = {}) {
|
|
1446
|
+
super(error);
|
|
1447
|
+
this.name = error.name || 'InvalidOrigin';
|
|
1448
|
+
this.code = typeof error.code === 'number' ? error.code : 1103;
|
|
1449
|
+
this.message = error.message || `Invalid origin for Access Key`;
|
|
1450
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1451
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1463
1452
|
Object.setPrototypeOf(this, InvalidOriginError.prototype);
|
|
1464
1453
|
}
|
|
1465
1454
|
}
|
|
1466
1455
|
class InvalidServiceError extends WebrpcError {
|
|
1467
|
-
constructor(
|
|
1468
|
-
super(
|
|
1456
|
+
constructor(error = {}) {
|
|
1457
|
+
super(error);
|
|
1458
|
+
this.name = error.name || 'InvalidService';
|
|
1459
|
+
this.code = typeof error.code === 'number' ? error.code : 1104;
|
|
1460
|
+
this.message = error.message || `Service not enabled for Access key`;
|
|
1461
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1462
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1469
1463
|
Object.setPrototypeOf(this, InvalidServiceError.prototype);
|
|
1470
1464
|
}
|
|
1471
1465
|
}
|
|
1472
1466
|
class UnauthorizedUserError extends WebrpcError {
|
|
1473
|
-
constructor(
|
|
1474
|
-
super(
|
|
1467
|
+
constructor(error = {}) {
|
|
1468
|
+
super(error);
|
|
1469
|
+
this.name = error.name || 'UnauthorizedUser';
|
|
1470
|
+
this.code = typeof error.code === 'number' ? error.code : 1105;
|
|
1471
|
+
this.message = error.message || `Unauthorized user`;
|
|
1472
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1473
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1475
1474
|
Object.setPrototypeOf(this, UnauthorizedUserError.prototype);
|
|
1476
1475
|
}
|
|
1477
1476
|
}
|
|
1478
1477
|
class QuotaExceededError extends WebrpcError {
|
|
1479
|
-
constructor(
|
|
1480
|
-
super(
|
|
1478
|
+
constructor(error = {}) {
|
|
1479
|
+
super(error);
|
|
1480
|
+
this.name = error.name || 'QuotaExceeded';
|
|
1481
|
+
this.code = typeof error.code === 'number' ? error.code : 1200;
|
|
1482
|
+
this.message = error.message || `Quota request exceeded`;
|
|
1483
|
+
this.status = typeof error.status === 'number' ? error.status : 429;
|
|
1484
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1481
1485
|
Object.setPrototypeOf(this, QuotaExceededError.prototype);
|
|
1482
1486
|
}
|
|
1483
1487
|
}
|
|
1484
1488
|
class QuotaRateLimitError extends WebrpcError {
|
|
1485
|
-
constructor(
|
|
1486
|
-
super(
|
|
1489
|
+
constructor(error = {}) {
|
|
1490
|
+
super(error);
|
|
1491
|
+
this.name = error.name || 'QuotaRateLimit';
|
|
1492
|
+
this.code = typeof error.code === 'number' ? error.code : 1201;
|
|
1493
|
+
this.message = error.message || `Quota rate limit exceeded`;
|
|
1494
|
+
this.status = typeof error.status === 'number' ? error.status : 429;
|
|
1495
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1487
1496
|
Object.setPrototypeOf(this, QuotaRateLimitError.prototype);
|
|
1488
1497
|
}
|
|
1489
1498
|
}
|
|
1490
1499
|
class NoDefaultKeyError extends WebrpcError {
|
|
1491
|
-
constructor(
|
|
1492
|
-
super(
|
|
1500
|
+
constructor(error = {}) {
|
|
1501
|
+
super(error);
|
|
1502
|
+
this.name = error.name || 'NoDefaultKey';
|
|
1503
|
+
this.code = typeof error.code === 'number' ? error.code : 1300;
|
|
1504
|
+
this.message = error.message || `No default access key found`;
|
|
1505
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1506
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1493
1507
|
Object.setPrototypeOf(this, NoDefaultKeyError.prototype);
|
|
1494
1508
|
}
|
|
1495
1509
|
}
|
|
1496
1510
|
class MaxAccessKeysError extends WebrpcError {
|
|
1497
|
-
constructor(
|
|
1498
|
-
super(
|
|
1511
|
+
constructor(error = {}) {
|
|
1512
|
+
super(error);
|
|
1513
|
+
this.name = error.name || 'MaxAccessKeys';
|
|
1514
|
+
this.code = typeof error.code === 'number' ? error.code : 1301;
|
|
1515
|
+
this.message = error.message || `Access keys limit reached`;
|
|
1516
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1517
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1499
1518
|
Object.setPrototypeOf(this, MaxAccessKeysError.prototype);
|
|
1500
1519
|
}
|
|
1501
1520
|
}
|
|
1502
1521
|
class AtLeastOneKeyError extends WebrpcError {
|
|
1503
|
-
constructor(
|
|
1504
|
-
super(
|
|
1522
|
+
constructor(error = {}) {
|
|
1523
|
+
super(error);
|
|
1524
|
+
this.name = error.name || 'AtLeastOneKey';
|
|
1525
|
+
this.code = typeof error.code === 'number' ? error.code : 1302;
|
|
1526
|
+
this.message = error.message || `You need at least one Access Key`;
|
|
1527
|
+
this.status = typeof error.status === 'number' ? error.status : 403;
|
|
1528
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1505
1529
|
Object.setPrototypeOf(this, AtLeastOneKeyError.prototype);
|
|
1506
1530
|
}
|
|
1507
1531
|
}
|
|
1508
1532
|
class TimeoutError extends WebrpcError {
|
|
1509
|
-
constructor(
|
|
1510
|
-
super(
|
|
1533
|
+
constructor(error = {}) {
|
|
1534
|
+
super(error);
|
|
1535
|
+
this.name = error.name || 'Timeout';
|
|
1536
|
+
this.code = typeof error.code === 'number' ? error.code : 1900;
|
|
1537
|
+
this.message = error.message || `Request timed out`;
|
|
1538
|
+
this.status = typeof error.status === 'number' ? error.status : 408;
|
|
1539
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1511
1540
|
Object.setPrototypeOf(this, TimeoutError.prototype);
|
|
1512
1541
|
}
|
|
1513
1542
|
}
|
|
1514
1543
|
class InvalidArgumentError extends WebrpcError {
|
|
1515
|
-
constructor(
|
|
1516
|
-
super(
|
|
1544
|
+
constructor(error = {}) {
|
|
1545
|
+
super(error);
|
|
1546
|
+
this.name = error.name || 'InvalidArgument';
|
|
1547
|
+
this.code = typeof error.code === 'number' ? error.code : 2000;
|
|
1548
|
+
this.message = error.message || `Invalid argument`;
|
|
1549
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1550
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1517
1551
|
Object.setPrototypeOf(this, InvalidArgumentError.prototype);
|
|
1518
1552
|
}
|
|
1519
1553
|
}
|
|
1520
1554
|
class UnavailableError extends WebrpcError {
|
|
1521
|
-
constructor(
|
|
1522
|
-
super(
|
|
1555
|
+
constructor(error = {}) {
|
|
1556
|
+
super(error);
|
|
1557
|
+
this.name = error.name || 'Unavailable';
|
|
1558
|
+
this.code = typeof error.code === 'number' ? error.code : 2002;
|
|
1559
|
+
this.message = error.message || `Unavailable resource`;
|
|
1560
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1561
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1523
1562
|
Object.setPrototypeOf(this, UnavailableError.prototype);
|
|
1524
1563
|
}
|
|
1525
1564
|
}
|
|
1526
1565
|
class QueryFailedError extends WebrpcError {
|
|
1527
|
-
constructor(
|
|
1528
|
-
super(
|
|
1566
|
+
constructor(error = {}) {
|
|
1567
|
+
super(error);
|
|
1568
|
+
this.name = error.name || 'QueryFailed';
|
|
1569
|
+
this.code = typeof error.code === 'number' ? error.code : 2003;
|
|
1570
|
+
this.message = error.message || `Query failed`;
|
|
1571
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1572
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1529
1573
|
Object.setPrototypeOf(this, QueryFailedError.prototype);
|
|
1530
1574
|
}
|
|
1531
1575
|
}
|
|
1532
1576
|
class NotFoundError extends WebrpcError {
|
|
1533
|
-
constructor(
|
|
1534
|
-
super(
|
|
1577
|
+
constructor(error = {}) {
|
|
1578
|
+
super(error);
|
|
1579
|
+
this.name = error.name || 'NotFound';
|
|
1580
|
+
this.code = typeof error.code === 'number' ? error.code : 3000;
|
|
1581
|
+
this.message = error.message || `Resource not found`;
|
|
1582
|
+
this.status = typeof error.status === 'number' ? error.status : 400;
|
|
1583
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1535
1584
|
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
1536
1585
|
}
|
|
1537
1586
|
}
|
|
1538
1587
|
class UnsupportedNetworkError extends WebrpcError {
|
|
1539
|
-
constructor(
|
|
1540
|
-
super(
|
|
1588
|
+
constructor(error = {}) {
|
|
1589
|
+
super(error);
|
|
1590
|
+
this.name = error.name || 'UnsupportedNetwork';
|
|
1591
|
+
this.code = typeof error.code === 'number' ? error.code : 3008;
|
|
1592
|
+
this.message = error.message || `Unsupported network`;
|
|
1593
|
+
this.status = typeof error.status === 'number' ? error.status : 422;
|
|
1594
|
+
if (error.cause !== undefined) this.cause = error.cause;
|
|
1541
1595
|
Object.setPrototypeOf(this, UnsupportedNetworkError.prototype);
|
|
1542
1596
|
}
|
|
1543
1597
|
}
|
|
@@ -1550,7 +1604,7 @@ let errors = /*#__PURE__*/function (errors) {
|
|
|
1550
1604
|
errors["WebrpcBadResponse"] = "WebrpcBadResponse";
|
|
1551
1605
|
errors["WebrpcServerPanic"] = "WebrpcServerPanic";
|
|
1552
1606
|
errors["WebrpcInternalError"] = "WebrpcInternalError";
|
|
1553
|
-
errors["
|
|
1607
|
+
errors["WebrpcClientAborted"] = "WebrpcClientAborted";
|
|
1554
1608
|
errors["WebrpcStreamLost"] = "WebrpcStreamLost";
|
|
1555
1609
|
errors["WebrpcStreamFinished"] = "WebrpcStreamFinished";
|
|
1556
1610
|
errors["Unauthorized"] = "Unauthorized";
|
|
@@ -1589,7 +1643,7 @@ let WebrpcErrorCodes = /*#__PURE__*/function (WebrpcErrorCodes) {
|
|
|
1589
1643
|
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadResponse"] = -5] = "WebrpcBadResponse";
|
|
1590
1644
|
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcServerPanic"] = -6] = "WebrpcServerPanic";
|
|
1591
1645
|
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcInternalError"] = -7] = "WebrpcInternalError";
|
|
1592
|
-
WebrpcErrorCodes[WebrpcErrorCodes["
|
|
1646
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcClientAborted"] = -8] = "WebrpcClientAborted";
|
|
1593
1647
|
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcStreamLost"] = -9] = "WebrpcStreamLost";
|
|
1594
1648
|
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcStreamFinished"] = -10] = "WebrpcStreamFinished";
|
|
1595
1649
|
WebrpcErrorCodes[WebrpcErrorCodes["Unauthorized"] = 1000] = "Unauthorized";
|
|
@@ -1628,7 +1682,7 @@ const webrpcErrorByCode = {
|
|
|
1628
1682
|
[-5]: WebrpcBadResponseError,
|
|
1629
1683
|
[-6]: WebrpcServerPanicError,
|
|
1630
1684
|
[-7]: WebrpcInternalErrorError,
|
|
1631
|
-
[-8]:
|
|
1685
|
+
[-8]: WebrpcClientAbortedError,
|
|
1632
1686
|
[-9]: WebrpcStreamLostError,
|
|
1633
1687
|
[-10]: WebrpcStreamFinishedError,
|
|
1634
1688
|
[1000]: UnauthorizedError,
|
|
@@ -1658,6 +1712,48 @@ const webrpcErrorByCode = {
|
|
|
1658
1712
|
[3008]: UnsupportedNetworkError
|
|
1659
1713
|
};
|
|
1660
1714
|
|
|
1715
|
+
//
|
|
1716
|
+
// Webrpc
|
|
1717
|
+
//
|
|
1718
|
+
|
|
1719
|
+
const WebrpcHeader = 'Webrpc';
|
|
1720
|
+
const WebrpcHeaderValue = 'webrpc@v0.31.0;gen-typescript@v0.22.5;sequence-api@v0.4.0';
|
|
1721
|
+
function VersionFromHeader(headers) {
|
|
1722
|
+
const headerValue = headers.get(WebrpcHeader);
|
|
1723
|
+
if (!headerValue) {
|
|
1724
|
+
return {
|
|
1725
|
+
WebrpcGenVersion: '',
|
|
1726
|
+
codeGenName: '',
|
|
1727
|
+
codeGenVersion: '',
|
|
1728
|
+
schemaName: '',
|
|
1729
|
+
schemaVersion: ''
|
|
1730
|
+
};
|
|
1731
|
+
}
|
|
1732
|
+
return parseWebrpcGenVersions(headerValue);
|
|
1733
|
+
}
|
|
1734
|
+
function parseWebrpcGenVersions(header) {
|
|
1735
|
+
const versions = header.split(';');
|
|
1736
|
+
if (versions.length < 3) {
|
|
1737
|
+
return {
|
|
1738
|
+
WebrpcGenVersion: '',
|
|
1739
|
+
codeGenName: '',
|
|
1740
|
+
codeGenVersion: '',
|
|
1741
|
+
schemaName: '',
|
|
1742
|
+
schemaVersion: ''
|
|
1743
|
+
};
|
|
1744
|
+
}
|
|
1745
|
+
const [_, WebrpcGenVersion] = versions[0].split('@');
|
|
1746
|
+
const [codeGenName, codeGenVersion] = versions[1].split('@');
|
|
1747
|
+
const [schemaName, schemaVersion] = versions[2].split('@');
|
|
1748
|
+
return {
|
|
1749
|
+
WebrpcGenVersion: WebrpcGenVersion != null ? WebrpcGenVersion : '',
|
|
1750
|
+
codeGenName: codeGenName != null ? codeGenName : '',
|
|
1751
|
+
codeGenVersion: codeGenVersion != null ? codeGenVersion : '',
|
|
1752
|
+
schemaName: schemaName != null ? schemaName : '',
|
|
1753
|
+
schemaVersion: schemaVersion != null ? schemaVersion : ''
|
|
1754
|
+
};
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1661
1757
|
class SequenceAPIClient extends API {
|
|
1662
1758
|
constructor(hostname, projectAccessKey, jwtAuth) {
|
|
1663
1759
|
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
|
|
@@ -1698,6 +1794,8 @@ exports.GetLifiSwapRouteDirection = GetLifiSwapRouteDirection;
|
|
|
1698
1794
|
exports.InvalidArgumentError = InvalidArgumentError;
|
|
1699
1795
|
exports.InvalidOriginError = InvalidOriginError;
|
|
1700
1796
|
exports.InvalidServiceError = InvalidServiceError;
|
|
1797
|
+
exports.JsonDecode = JsonDecode;
|
|
1798
|
+
exports.JsonEncode = JsonEncode;
|
|
1701
1799
|
exports.MaxAccessKeysError = MaxAccessKeysError;
|
|
1702
1800
|
exports.MethodNotFoundError = MethodNotFoundError;
|
|
1703
1801
|
exports.NoDefaultKeyError = NoDefaultKeyError;
|
|
@@ -1721,14 +1819,11 @@ exports.UnauthorizedUserError = UnauthorizedUserError;
|
|
|
1721
1819
|
exports.UnavailableError = UnavailableError;
|
|
1722
1820
|
exports.UnsupportedNetworkError = UnsupportedNetworkError;
|
|
1723
1821
|
exports.VersionFromHeader = VersionFromHeader;
|
|
1724
|
-
exports.WebRPCSchemaHash = WebRPCSchemaHash;
|
|
1725
|
-
exports.WebRPCSchemaVersion = WebRPCSchemaVersion;
|
|
1726
|
-
exports.WebRPCVersion = WebRPCVersion;
|
|
1727
1822
|
exports.WebrpcBadMethodError = WebrpcBadMethodError;
|
|
1728
1823
|
exports.WebrpcBadRequestError = WebrpcBadRequestError;
|
|
1729
1824
|
exports.WebrpcBadResponseError = WebrpcBadResponseError;
|
|
1730
1825
|
exports.WebrpcBadRouteError = WebrpcBadRouteError;
|
|
1731
|
-
exports.
|
|
1826
|
+
exports.WebrpcClientAbortedError = WebrpcClientAbortedError;
|
|
1732
1827
|
exports.WebrpcEndpointError = WebrpcEndpointError;
|
|
1733
1828
|
exports.WebrpcError = WebrpcError;
|
|
1734
1829
|
exports.WebrpcErrorCodes = WebrpcErrorCodes;
|
|
@@ -1736,8 +1831,11 @@ exports.WebrpcHeader = WebrpcHeader;
|
|
|
1736
1831
|
exports.WebrpcHeaderValue = WebrpcHeaderValue;
|
|
1737
1832
|
exports.WebrpcInternalErrorError = WebrpcInternalErrorError;
|
|
1738
1833
|
exports.WebrpcRequestFailedError = WebrpcRequestFailedError;
|
|
1834
|
+
exports.WebrpcSchemaHash = WebrpcSchemaHash;
|
|
1835
|
+
exports.WebrpcSchemaVersion = WebrpcSchemaVersion;
|
|
1739
1836
|
exports.WebrpcServerPanicError = WebrpcServerPanicError;
|
|
1740
1837
|
exports.WebrpcStreamFinishedError = WebrpcStreamFinishedError;
|
|
1741
1838
|
exports.WebrpcStreamLostError = WebrpcStreamLostError;
|
|
1839
|
+
exports.WebrpcVersion = WebrpcVersion;
|
|
1742
1840
|
exports.errors = errors;
|
|
1743
1841
|
exports.webrpcErrorByCode = webrpcErrorByCode;
|