@matchain/matchid-sdk-react 0.1.8 → 0.1.10
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/index.d.mts +116 -19
- package/dist/index.d.ts +116 -19
- package/dist/index.js +317 -159
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +329 -172
- package/dist/index.mjs.map +1 -1
- package/example/index.html +1 -1
- package/example/package-lock.json +1 -1
- package/example/package.json +1 -1
- package/example/src/App.tsx +2 -2
- package/example/src/pages/Home.tsx +1 -1
- package/example/src/pages/Login.tsx +112 -67
- package/example/vite.config.ts +1 -1
- package/example/yarn.lock +3 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,8 @@ import React$1, { PropsWithChildren, CSSProperties, ReactNode } from 'react';
|
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import * as viem from 'viem';
|
|
4
4
|
import { SignableMessage, Hex, TransactionSerializable } from 'viem';
|
|
5
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
|
+
import { UseQueryOptions } from '@tanstack/react-query/src/types';
|
|
5
7
|
|
|
6
8
|
type LoginMethodType = 'wallet' | 'email' | 'google' | 'X' | 'telegram'
|
|
7
9
|
type IEnvName = 'main' | 'dev' | 'test'
|
|
@@ -84,6 +86,53 @@ type ButtonProps = {
|
|
|
84
86
|
className?: string
|
|
85
87
|
}
|
|
86
88
|
|
|
89
|
+
type BindItemType= {
|
|
90
|
+
type: string,
|
|
91
|
+
type_sort: string,
|
|
92
|
+
platform_name: string,
|
|
93
|
+
platform_id: number,
|
|
94
|
+
platform_uid: string,
|
|
95
|
+
platform_nickname: string,
|
|
96
|
+
platform_status: number
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
type PohItemType = {
|
|
100
|
+
user_id: number,
|
|
101
|
+
poh_market_id: number,
|
|
102
|
+
image_type: string,
|
|
103
|
+
category: string,
|
|
104
|
+
name: string,
|
|
105
|
+
app_id: string,
|
|
106
|
+
schema_id: string,
|
|
107
|
+
active: boolean,
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
type BindInfoType = {
|
|
111
|
+
progress_count: number,
|
|
112
|
+
progress_current: number,
|
|
113
|
+
total_assets: number,
|
|
114
|
+
wallet_count: number,
|
|
115
|
+
wallet_current: number,
|
|
116
|
+
cex_count: number,
|
|
117
|
+
cex_current: number,
|
|
118
|
+
social_count: number,
|
|
119
|
+
social_current: number,
|
|
120
|
+
others_count: number,
|
|
121
|
+
others_current: number,
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
type PohZkpassParams = {
|
|
125
|
+
taskId: string,
|
|
126
|
+
schemaId: string,
|
|
127
|
+
publicFields: any,
|
|
128
|
+
allocatorAddress: string,
|
|
129
|
+
publicFieldsHash: string,
|
|
130
|
+
allocatorSignature: string,
|
|
131
|
+
uHash: string,
|
|
132
|
+
validatorAddress: string,
|
|
133
|
+
validatorSignature: string,
|
|
134
|
+
}
|
|
135
|
+
|
|
87
136
|
type MatchContextType = {
|
|
88
137
|
env: IEnvName;
|
|
89
138
|
appid: string;
|
|
@@ -141,20 +190,20 @@ declare function PasswordModal({ title, isOpen, onSuccess, ...props }: ModalWith
|
|
|
141
190
|
onSuccess?: () => void;
|
|
142
191
|
}): react_jsx_runtime.JSX.Element;
|
|
143
192
|
|
|
144
|
-
declare const index$
|
|
145
|
-
declare const index$
|
|
146
|
-
declare const index$
|
|
147
|
-
declare const index$
|
|
148
|
-
declare const index$
|
|
149
|
-
declare const index$
|
|
150
|
-
declare const index$
|
|
151
|
-
declare const index$
|
|
152
|
-
declare const index$
|
|
153
|
-
declare const index$
|
|
154
|
-
declare const index$
|
|
155
|
-
declare const index$
|
|
156
|
-
declare namespace index$
|
|
157
|
-
export { index$
|
|
193
|
+
declare const index$2_Button: typeof Button;
|
|
194
|
+
declare const index$2_EmailModal: typeof EmailModal;
|
|
195
|
+
declare const index$2_Field: typeof Field;
|
|
196
|
+
declare const index$2_Input: typeof Input;
|
|
197
|
+
declare const index$2_LoginBox: typeof LoginBox;
|
|
198
|
+
declare const index$2_LoginButton: typeof LoginButton;
|
|
199
|
+
declare const index$2_LoginModal: typeof LoginModal;
|
|
200
|
+
declare const index$2_LoginPanel: typeof LoginPanel;
|
|
201
|
+
declare const index$2_Modal: typeof Modal;
|
|
202
|
+
declare const index$2_ModalWithHeader: typeof ModalWithHeader;
|
|
203
|
+
declare const index$2_PasswordModal: typeof PasswordModal;
|
|
204
|
+
declare const index$2_UsernameModal: typeof UsernameModal;
|
|
205
|
+
declare namespace index$2 {
|
|
206
|
+
export { index$2_Button as Button, index$2_EmailModal as EmailModal, index$2_Field as Field, index$2_Input as Input, index$2_LoginBox as LoginBox, index$2_LoginButton as LoginButton, index$2_LoginModal as LoginModal, index$2_LoginPanel as LoginPanel, index$2_Modal as Modal, index$2_ModalWithHeader as ModalWithHeader, index$2_PasswordModal as PasswordModal, index$2_UsernameModal as UsernameModal };
|
|
158
207
|
}
|
|
159
208
|
|
|
160
209
|
declare function useUserInfo(): {
|
|
@@ -201,11 +250,59 @@ interface UseWalletReturnType {
|
|
|
201
250
|
}
|
|
202
251
|
declare function useWallet(): UseWalletReturnType;
|
|
203
252
|
|
|
204
|
-
declare const
|
|
205
|
-
declare const
|
|
206
|
-
declare const
|
|
253
|
+
declare const index$1_useMatchEvents: typeof useMatchEvents;
|
|
254
|
+
declare const index$1_useUserInfo: typeof useUserInfo;
|
|
255
|
+
declare const index$1_useWallet: typeof useWallet;
|
|
256
|
+
declare namespace index$1 {
|
|
257
|
+
export { index$1_useMatchEvents as useMatchEvents, index$1_useUserInfo as useUserInfo, index$1_useWallet as useWallet };
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
interface MyResponseType<T> {
|
|
261
|
+
code: number;
|
|
262
|
+
data: T;
|
|
263
|
+
message: string;
|
|
264
|
+
success: boolean;
|
|
265
|
+
fail: boolean;
|
|
266
|
+
result: T;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
declare const bindCexApi: ({ cex, api_key, api_secret }: {
|
|
270
|
+
cex: string;
|
|
271
|
+
api_key: string;
|
|
272
|
+
api_secret: string;
|
|
273
|
+
}) => Promise<MyResponseType<any>>;
|
|
274
|
+
declare const unBindApi: ({ type }: {
|
|
275
|
+
type: string;
|
|
276
|
+
}) => Promise<MyResponseType<any>>;
|
|
277
|
+
declare const unBindWalletApi: ({ address }: {
|
|
278
|
+
address: string;
|
|
279
|
+
}) => Promise<MyResponseType<any>>;
|
|
280
|
+
declare const verifyPohApi: ({ taskId, schemaId, publicFields, allocatorAddress, publicFieldsHash, allocatorSignature, uHash, validatorAddress, validatorSignature }: PohZkpassParams) => Promise<MyResponseType<any>>;
|
|
281
|
+
|
|
282
|
+
declare function useBindList(options?: Omit<UseQueryOptions<BindItemType[]>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<BindItemType[], Error>;
|
|
283
|
+
declare function useBindInfo(options?: Omit<UseQueryOptions<BindInfoType>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<BindInfoType, Error>;
|
|
284
|
+
|
|
285
|
+
declare const bind_bindCexApi: typeof bindCexApi;
|
|
286
|
+
declare const bind_unBindApi: typeof unBindApi;
|
|
287
|
+
declare const bind_unBindWalletApi: typeof unBindWalletApi;
|
|
288
|
+
declare const bind_useBindInfo: typeof useBindInfo;
|
|
289
|
+
declare const bind_useBindList: typeof useBindList;
|
|
290
|
+
declare namespace bind {
|
|
291
|
+
export { bind_bindCexApi as bindCexApi, bind_unBindApi as unBindApi, bind_unBindWalletApi as unBindWalletApi, bind_useBindInfo as useBindInfo, bind_useBindList as useBindList };
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
declare function usePohList(options?: Omit<UseQueryOptions<PohItemType[]>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<PohItemType[], Error>;
|
|
295
|
+
|
|
296
|
+
declare const poh_usePohList: typeof usePohList;
|
|
297
|
+
declare const poh_verifyPohApi: typeof verifyPohApi;
|
|
298
|
+
declare namespace poh {
|
|
299
|
+
export { poh_usePohList as usePohList, poh_verifyPohApi as verifyPohApi };
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
declare const index_bind: typeof bind;
|
|
303
|
+
declare const index_poh: typeof poh;
|
|
207
304
|
declare namespace index {
|
|
208
|
-
export {
|
|
305
|
+
export { index_bind as bind, index_poh as poh };
|
|
209
306
|
}
|
|
210
307
|
|
|
211
|
-
export { index$
|
|
308
|
+
export { index as Api, index$2 as Components, index$1 as Hooks, MatchProvider, useMatch };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import React$1, { PropsWithChildren, CSSProperties, ReactNode } from 'react';
|
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import * as viem from 'viem';
|
|
4
4
|
import { SignableMessage, Hex, TransactionSerializable } from 'viem';
|
|
5
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
|
+
import { UseQueryOptions } from '@tanstack/react-query/src/types';
|
|
5
7
|
|
|
6
8
|
type LoginMethodType = 'wallet' | 'email' | 'google' | 'X' | 'telegram'
|
|
7
9
|
type IEnvName = 'main' | 'dev' | 'test'
|
|
@@ -84,6 +86,53 @@ type ButtonProps = {
|
|
|
84
86
|
className?: string
|
|
85
87
|
}
|
|
86
88
|
|
|
89
|
+
type BindItemType= {
|
|
90
|
+
type: string,
|
|
91
|
+
type_sort: string,
|
|
92
|
+
platform_name: string,
|
|
93
|
+
platform_id: number,
|
|
94
|
+
platform_uid: string,
|
|
95
|
+
platform_nickname: string,
|
|
96
|
+
platform_status: number
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
type PohItemType = {
|
|
100
|
+
user_id: number,
|
|
101
|
+
poh_market_id: number,
|
|
102
|
+
image_type: string,
|
|
103
|
+
category: string,
|
|
104
|
+
name: string,
|
|
105
|
+
app_id: string,
|
|
106
|
+
schema_id: string,
|
|
107
|
+
active: boolean,
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
type BindInfoType = {
|
|
111
|
+
progress_count: number,
|
|
112
|
+
progress_current: number,
|
|
113
|
+
total_assets: number,
|
|
114
|
+
wallet_count: number,
|
|
115
|
+
wallet_current: number,
|
|
116
|
+
cex_count: number,
|
|
117
|
+
cex_current: number,
|
|
118
|
+
social_count: number,
|
|
119
|
+
social_current: number,
|
|
120
|
+
others_count: number,
|
|
121
|
+
others_current: number,
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
type PohZkpassParams = {
|
|
125
|
+
taskId: string,
|
|
126
|
+
schemaId: string,
|
|
127
|
+
publicFields: any,
|
|
128
|
+
allocatorAddress: string,
|
|
129
|
+
publicFieldsHash: string,
|
|
130
|
+
allocatorSignature: string,
|
|
131
|
+
uHash: string,
|
|
132
|
+
validatorAddress: string,
|
|
133
|
+
validatorSignature: string,
|
|
134
|
+
}
|
|
135
|
+
|
|
87
136
|
type MatchContextType = {
|
|
88
137
|
env: IEnvName;
|
|
89
138
|
appid: string;
|
|
@@ -141,20 +190,20 @@ declare function PasswordModal({ title, isOpen, onSuccess, ...props }: ModalWith
|
|
|
141
190
|
onSuccess?: () => void;
|
|
142
191
|
}): react_jsx_runtime.JSX.Element;
|
|
143
192
|
|
|
144
|
-
declare const index$
|
|
145
|
-
declare const index$
|
|
146
|
-
declare const index$
|
|
147
|
-
declare const index$
|
|
148
|
-
declare const index$
|
|
149
|
-
declare const index$
|
|
150
|
-
declare const index$
|
|
151
|
-
declare const index$
|
|
152
|
-
declare const index$
|
|
153
|
-
declare const index$
|
|
154
|
-
declare const index$
|
|
155
|
-
declare const index$
|
|
156
|
-
declare namespace index$
|
|
157
|
-
export { index$
|
|
193
|
+
declare const index$2_Button: typeof Button;
|
|
194
|
+
declare const index$2_EmailModal: typeof EmailModal;
|
|
195
|
+
declare const index$2_Field: typeof Field;
|
|
196
|
+
declare const index$2_Input: typeof Input;
|
|
197
|
+
declare const index$2_LoginBox: typeof LoginBox;
|
|
198
|
+
declare const index$2_LoginButton: typeof LoginButton;
|
|
199
|
+
declare const index$2_LoginModal: typeof LoginModal;
|
|
200
|
+
declare const index$2_LoginPanel: typeof LoginPanel;
|
|
201
|
+
declare const index$2_Modal: typeof Modal;
|
|
202
|
+
declare const index$2_ModalWithHeader: typeof ModalWithHeader;
|
|
203
|
+
declare const index$2_PasswordModal: typeof PasswordModal;
|
|
204
|
+
declare const index$2_UsernameModal: typeof UsernameModal;
|
|
205
|
+
declare namespace index$2 {
|
|
206
|
+
export { index$2_Button as Button, index$2_EmailModal as EmailModal, index$2_Field as Field, index$2_Input as Input, index$2_LoginBox as LoginBox, index$2_LoginButton as LoginButton, index$2_LoginModal as LoginModal, index$2_LoginPanel as LoginPanel, index$2_Modal as Modal, index$2_ModalWithHeader as ModalWithHeader, index$2_PasswordModal as PasswordModal, index$2_UsernameModal as UsernameModal };
|
|
158
207
|
}
|
|
159
208
|
|
|
160
209
|
declare function useUserInfo(): {
|
|
@@ -201,11 +250,59 @@ interface UseWalletReturnType {
|
|
|
201
250
|
}
|
|
202
251
|
declare function useWallet(): UseWalletReturnType;
|
|
203
252
|
|
|
204
|
-
declare const
|
|
205
|
-
declare const
|
|
206
|
-
declare const
|
|
253
|
+
declare const index$1_useMatchEvents: typeof useMatchEvents;
|
|
254
|
+
declare const index$1_useUserInfo: typeof useUserInfo;
|
|
255
|
+
declare const index$1_useWallet: typeof useWallet;
|
|
256
|
+
declare namespace index$1 {
|
|
257
|
+
export { index$1_useMatchEvents as useMatchEvents, index$1_useUserInfo as useUserInfo, index$1_useWallet as useWallet };
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
interface MyResponseType<T> {
|
|
261
|
+
code: number;
|
|
262
|
+
data: T;
|
|
263
|
+
message: string;
|
|
264
|
+
success: boolean;
|
|
265
|
+
fail: boolean;
|
|
266
|
+
result: T;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
declare const bindCexApi: ({ cex, api_key, api_secret }: {
|
|
270
|
+
cex: string;
|
|
271
|
+
api_key: string;
|
|
272
|
+
api_secret: string;
|
|
273
|
+
}) => Promise<MyResponseType<any>>;
|
|
274
|
+
declare const unBindApi: ({ type }: {
|
|
275
|
+
type: string;
|
|
276
|
+
}) => Promise<MyResponseType<any>>;
|
|
277
|
+
declare const unBindWalletApi: ({ address }: {
|
|
278
|
+
address: string;
|
|
279
|
+
}) => Promise<MyResponseType<any>>;
|
|
280
|
+
declare const verifyPohApi: ({ taskId, schemaId, publicFields, allocatorAddress, publicFieldsHash, allocatorSignature, uHash, validatorAddress, validatorSignature }: PohZkpassParams) => Promise<MyResponseType<any>>;
|
|
281
|
+
|
|
282
|
+
declare function useBindList(options?: Omit<UseQueryOptions<BindItemType[]>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<BindItemType[], Error>;
|
|
283
|
+
declare function useBindInfo(options?: Omit<UseQueryOptions<BindInfoType>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<BindInfoType, Error>;
|
|
284
|
+
|
|
285
|
+
declare const bind_bindCexApi: typeof bindCexApi;
|
|
286
|
+
declare const bind_unBindApi: typeof unBindApi;
|
|
287
|
+
declare const bind_unBindWalletApi: typeof unBindWalletApi;
|
|
288
|
+
declare const bind_useBindInfo: typeof useBindInfo;
|
|
289
|
+
declare const bind_useBindList: typeof useBindList;
|
|
290
|
+
declare namespace bind {
|
|
291
|
+
export { bind_bindCexApi as bindCexApi, bind_unBindApi as unBindApi, bind_unBindWalletApi as unBindWalletApi, bind_useBindInfo as useBindInfo, bind_useBindList as useBindList };
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
declare function usePohList(options?: Omit<UseQueryOptions<PohItemType[]>, 'queryKey' | 'queryFn'>): _tanstack_react_query.UseQueryResult<PohItemType[], Error>;
|
|
295
|
+
|
|
296
|
+
declare const poh_usePohList: typeof usePohList;
|
|
297
|
+
declare const poh_verifyPohApi: typeof verifyPohApi;
|
|
298
|
+
declare namespace poh {
|
|
299
|
+
export { poh_usePohList as usePohList, poh_verifyPohApi as verifyPohApi };
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
declare const index_bind: typeof bind;
|
|
303
|
+
declare const index_poh: typeof poh;
|
|
207
304
|
declare namespace index {
|
|
208
|
-
export {
|
|
305
|
+
export { index_bind as bind, index_poh as poh };
|
|
209
306
|
}
|
|
210
307
|
|
|
211
|
-
export { index$
|
|
308
|
+
export { index as Api, index$2 as Components, index$1 as Hooks, MatchProvider, useMatch };
|