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