@matchain/matchid-sdk-react 0.1.40-alpha.2 → 0.1.40-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.
@@ -4,7 +4,7 @@ import {
4
4
  useMatchEvents,
5
5
  useUserInfo,
6
6
  useWallet
7
- } from "../chunk-3CHFSRD3.mjs";
7
+ } from "../chunk-HL5ODTAH.mjs";
8
8
  import "../chunk-6PWH7WZI.mjs";
9
9
  import "../chunk-J5LGTIGS.mjs";
10
10
  export {
@@ -11,10 +11,11 @@ interface MyResponseType<T> {
11
11
  result: T;
12
12
  }
13
13
 
14
- declare const bindCexApi: ({ cex, api_key, api_secret }: {
14
+ declare const bindCexApi: (data: {
15
15
  cex: string;
16
16
  api_key: string;
17
17
  api_secret: string;
18
+ api_passphrase?: string;
18
19
  }) => Promise<MyResponseType<any>>;
19
20
  declare const unBindApi: ({ type }: {
20
21
  type: string;
@@ -11,10 +11,11 @@ interface MyResponseType<T> {
11
11
  result: T;
12
12
  }
13
13
 
14
- declare const bindCexApi: ({ cex, api_key, api_secret }: {
14
+ declare const bindCexApi: (data: {
15
15
  cex: string;
16
16
  api_key: string;
17
17
  api_secret: string;
18
+ api_passphrase?: string;
18
19
  }) => Promise<MyResponseType<any>>;
19
20
  declare const unBindApi: ({ type }: {
20
21
  type: string;
package/dist/index.d.mts CHANGED
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
2
2
  import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType } from './types.d-IS3DBl3p.mjs';
3
3
  export { i as Components } from './index-ClQl2MMF.mjs';
4
4
  export { i as Hooks } from './index-Dm5o2w2J.mjs';
5
- export { i as Api } from './index-mEK7Lcps.mjs';
5
+ export { i as Api } from './index-CiM5L42f.mjs';
6
6
  export { i as Chains } from './index-DXRGMAbv.mjs';
7
7
  import 'react/jsx-runtime';
8
8
  import 'viem';
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
2
2
  import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType } from './types.d-IS3DBl3p.js';
3
3
  export { i as Components } from './index-CvCSpU8m.js';
4
4
  export { i as Hooks } from './index-BPveUnst.js';
5
- export { i as Api } from './index-DlrDrTMk.js';
5
+ export { i as Api } from './index-DBscX8i6.js';
6
6
  export { i as Chains } from './index-DXRGMAbv.js';
7
7
  import 'react/jsx-runtime';
8
8
  import 'viem';
package/dist/index.js CHANGED
@@ -1434,11 +1434,11 @@ var getBindInfoApi = () => {
1434
1434
  method: "GET"
1435
1435
  });
1436
1436
  };
1437
- var bindCexApi = ({ cex, api_key, api_secret }) => {
1437
+ var bindCexApi = (data) => {
1438
1438
  return request_default({
1439
1439
  url: `/api/v1/cex/subscribe`,
1440
1440
  method: "POST",
1441
- data: { cex, api_key, api_secret }
1441
+ data
1442
1442
  });
1443
1443
  };
1444
1444
  var unBindApi = ({ type }) => {
@@ -3937,7 +3937,7 @@ function CEXBindModal({
3937
3937
  ) }),
3938
3938
  /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Field, { label: intl.formatMessage({
3939
3939
  id: "CEXBindApiSecretKey"
3940
- }), error: type != "OKX" && error, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
3940
+ }), error: !needPassphrase && error, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
3941
3941
  Input,
3942
3942
  {
3943
3943
  value: secret,
@@ -4084,17 +4084,11 @@ function useWalletInit({
4084
4084
  document.body.insertBefore(iframe, document.body.firstChild);
4085
4085
  window.sendMatchWalletMessage = (method, data, retry = 5, times = 0) => {
4086
4086
  try {
4087
- if (!iframeLoaded) {
4088
- throw new Error("Wallet not ready");
4089
- }
4090
- if (!walletInited) {
4091
- throw new Error("Wallet not inited");
4092
- }
4093
4087
  if (!document.getElementById("match-wallet")) {
4094
4088
  throw new Error("Wallet not found");
4095
4089
  }
4096
4090
  } catch (error) {
4097
- console.error(`wallet init[${retry}/${times}]`, error);
4091
+ console.error(`wallet init[${times}/${retry}]`, error);
4098
4092
  if (times < retry) {
4099
4093
  setTimeout(() => {
4100
4094
  window.sendMatchWalletMessage(method, data, retry, times + 1);