@matchain/matchid-sdk-react 0.1.44-alpha.2 → 0.1.44-alpha.4
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/assets/icon/index.d.mts +1 -1
- package/dist/assets/icon/index.d.ts +1 -1
- package/dist/{chunk-Z3USECNP.mjs → chunk-24AMOG53.mjs} +2 -2
- package/dist/{chunk-7P4NHPH5.mjs → chunk-RAX4G26O.mjs} +56 -10
- package/dist/chunk-RAX4G26O.mjs.map +1 -0
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +52 -6
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/hooks/api/index.d.mts +2 -2
- package/dist/hooks/api/index.d.ts +2 -2
- package/dist/hooks/api/index.js +52 -6
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +2 -2
- package/dist/hooks/index.d.mts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +50 -4
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/{index-Ca9nh_8s.d.ts → index-BQDL8XkC.d.ts} +1 -1
- package/dist/{index-DlhAHm_s.d.mts → index-C1NfMaCm.d.mts} +1 -1
- package/dist/{index-q5XDobUF.d.mts → index-DAj3aVo6.d.mts} +1 -1
- package/dist/{index-Bluim2ZP.d.mts → index-DnK10Gz7.d.mts} +1 -1
- package/dist/{index-BxS06a5O.d.ts → index-DzVjb4K-.d.ts} +1 -1
- package/dist/{index-DFZpfAfc.d.mts → index-Rb-jdkzE.d.mts} +1 -1
- package/dist/{index-EqksEEto.d.ts → index-ivTptZeo.d.ts} +1 -1
- package/dist/{index-CLvQH5gM.d.ts → index-x432SkFJ.d.ts} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +55 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/{types-CVwZEgQ0.d.mts → types-E2MeOwmE.d.mts} +1 -1
- package/dist/{types-CVwZEgQ0.d.ts → types-E2MeOwmE.d.ts} +1 -1
- package/package.json +2 -1
- package/dist/chunk-7P4NHPH5.mjs.map +0 -1
- /package/dist/{chunk-Z3USECNP.mjs.map → chunk-24AMOG53.mjs.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React, { CSSProperties } from 'react';
|
|
3
|
-
import { s as IconProps$1 } from '../../types-
|
|
3
|
+
import { s as IconProps$1 } from '../../types-E2MeOwmE.mjs';
|
|
4
4
|
|
|
5
5
|
declare function BackIcon({ color, size, className, style }: {
|
|
6
6
|
color?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React, { CSSProperties } from 'react';
|
|
3
|
-
import { s as IconProps$1 } from '../../types-
|
|
3
|
+
import { s as IconProps$1 } from '../../types-E2MeOwmE.js';
|
|
4
4
|
|
|
5
5
|
declare function BackIcon({ color, size, className, style }: {
|
|
6
6
|
color?: string;
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
unBindWalletApi,
|
|
10
10
|
useUserInfo,
|
|
11
11
|
verifyPohApi
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RAX4G26O.mjs";
|
|
13
13
|
import {
|
|
14
14
|
__export
|
|
15
15
|
} from "./chunk-J5LGTIGS.mjs";
|
|
@@ -90,4 +90,4 @@ export {
|
|
|
90
90
|
user_exports,
|
|
91
91
|
api_exports
|
|
92
92
|
};
|
|
93
|
-
//# sourceMappingURL=chunk-
|
|
93
|
+
//# sourceMappingURL=chunk-24AMOG53.mjs.map
|
|
@@ -181,6 +181,7 @@ var matchlog = new Proxy(console, handler);
|
|
|
181
181
|
var matchlog_default = matchlog;
|
|
182
182
|
|
|
183
183
|
// src/api/request.ts
|
|
184
|
+
import axiosRetry from "axios-retry";
|
|
184
185
|
var SUCCESS_CODE = 0;
|
|
185
186
|
var isSuccess = (res) => {
|
|
186
187
|
return res.code === SUCCESS_CODE;
|
|
@@ -222,6 +223,51 @@ var request = async (config) => {
|
|
|
222
223
|
};
|
|
223
224
|
}
|
|
224
225
|
};
|
|
226
|
+
var retryInstance = axios.create({
|
|
227
|
+
timeout: 6e4,
|
|
228
|
+
validateStatus(status) {
|
|
229
|
+
return status >= 200 && status <= 500;
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
axiosRetry(retryInstance, {
|
|
233
|
+
retries: 3,
|
|
234
|
+
retryDelay: (retryCount) => retryCount * 1e3,
|
|
235
|
+
shouldResetTimeout: true,
|
|
236
|
+
retryCondition: (error) => {
|
|
237
|
+
return error.response.status >= 500 && error.response.status < 600 || error.code === "ECONNABORTED";
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
var retryRequest = async (config) => {
|
|
241
|
+
try {
|
|
242
|
+
const endpoints = getEndpoints();
|
|
243
|
+
const token = getToken();
|
|
244
|
+
retryInstance.defaults.baseURL = `${endpoints.back}`;
|
|
245
|
+
retryInstance.defaults.headers.common["Appid"] = getAppid();
|
|
246
|
+
if (token) {
|
|
247
|
+
retryInstance.defaults.headers.common["Authorization"] = token;
|
|
248
|
+
}
|
|
249
|
+
retryInstance.defaults.headers.common["Accept-Language"] = getLocale();
|
|
250
|
+
const { data } = await retryInstance.request(config);
|
|
251
|
+
matchlog_default.log("api", data);
|
|
252
|
+
if (data.code == 401001) {
|
|
253
|
+
localStore.getState().logout();
|
|
254
|
+
throw new Error("Your session has expired, please log in again");
|
|
255
|
+
}
|
|
256
|
+
return data;
|
|
257
|
+
} catch (err) {
|
|
258
|
+
console.error("qwe-err", err);
|
|
259
|
+
const message = "Request Error";
|
|
260
|
+
console.error(message);
|
|
261
|
+
return {
|
|
262
|
+
code: -1,
|
|
263
|
+
data: null,
|
|
264
|
+
message,
|
|
265
|
+
success: false,
|
|
266
|
+
fail: true,
|
|
267
|
+
result: null
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
};
|
|
225
271
|
var request_default = request;
|
|
226
272
|
|
|
227
273
|
// src/api/index.ts
|
|
@@ -240,13 +286,13 @@ var verifyEmailCodeApi = ({ email, verification_key, verification_code }) => {
|
|
|
240
286
|
});
|
|
241
287
|
};
|
|
242
288
|
var getOverviewInfoApi = () => {
|
|
243
|
-
return
|
|
289
|
+
return retryRequest({
|
|
244
290
|
url: `/api/v1/user/overview`,
|
|
245
291
|
method: "GET"
|
|
246
292
|
});
|
|
247
293
|
};
|
|
248
294
|
var toLogoutApi = () => {
|
|
249
|
-
return
|
|
295
|
+
return retryRequest({
|
|
250
296
|
url: `/api/v1/user/logout`,
|
|
251
297
|
method: "POST"
|
|
252
298
|
});
|
|
@@ -259,19 +305,19 @@ var setUserNameApi = (data) => {
|
|
|
259
305
|
});
|
|
260
306
|
};
|
|
261
307
|
var getBindListApi = () => {
|
|
262
|
-
return
|
|
308
|
+
return retryRequest({
|
|
263
309
|
url: `/api/v1/bind/list`,
|
|
264
310
|
method: "GET"
|
|
265
311
|
});
|
|
266
312
|
};
|
|
267
313
|
var getPohListApi = () => {
|
|
268
|
-
return
|
|
314
|
+
return retryRequest({
|
|
269
315
|
url: `/api/v1/poh/list`,
|
|
270
316
|
method: "GET"
|
|
271
317
|
});
|
|
272
318
|
};
|
|
273
319
|
var getBindInfoApi = () => {
|
|
274
|
-
return
|
|
320
|
+
return retryRequest({
|
|
275
321
|
url: `/api/v1/bind`,
|
|
276
322
|
method: "GET"
|
|
277
323
|
});
|
|
@@ -338,13 +384,13 @@ var mintPassportNftApi = () => {
|
|
|
338
384
|
});
|
|
339
385
|
};
|
|
340
386
|
var getAuthInfoApi = () => {
|
|
341
|
-
return
|
|
387
|
+
return retryRequest({
|
|
342
388
|
url: `/api/v1/user/auth`,
|
|
343
389
|
method: "GET"
|
|
344
390
|
});
|
|
345
391
|
};
|
|
346
392
|
var getWalletNonceApi = (data) => {
|
|
347
|
-
return
|
|
393
|
+
return retryRequest({
|
|
348
394
|
url: `/api/v1/login/wallet/init`,
|
|
349
395
|
method: "POST",
|
|
350
396
|
data
|
|
@@ -365,7 +411,7 @@ var loginByWalletApi = ({
|
|
|
365
411
|
});
|
|
366
412
|
};
|
|
367
413
|
var getWalletInitApi = (data) => {
|
|
368
|
-
return
|
|
414
|
+
return retryRequest({
|
|
369
415
|
url: `/api/v1/wallet/init`,
|
|
370
416
|
method: "POST",
|
|
371
417
|
data
|
|
@@ -3436,7 +3482,7 @@ function useWallet() {
|
|
|
3436
3482
|
}) : void 0;
|
|
3437
3483
|
}, [address]);
|
|
3438
3484
|
useEffect18(() => {
|
|
3439
|
-
|
|
3485
|
+
matchlog_default.log("qwe-evmAccount", evmAccount);
|
|
3440
3486
|
}, [evmAccount]);
|
|
3441
3487
|
return {
|
|
3442
3488
|
walletReady,
|
|
@@ -4754,4 +4800,4 @@ export {
|
|
|
4754
4800
|
MatchProvider,
|
|
4755
4801
|
useMatch
|
|
4756
4802
|
};
|
|
4757
|
-
//# sourceMappingURL=chunk-
|
|
4803
|
+
//# sourceMappingURL=chunk-RAX4G26O.mjs.map
|