@reown/appkit-core-react-native 2.0.0-alpha.4 → 2.0.0-alpha.6
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/lib/commonjs/controllers/ApiController.js +102 -84
- package/lib/commonjs/controllers/ApiController.js.map +1 -1
- package/lib/commonjs/controllers/BlockchainApiController.js +1 -1
- package/lib/commonjs/controllers/BlockchainApiController.js.map +1 -1
- package/lib/commonjs/controllers/ConnectionsController.js +34 -21
- package/lib/commonjs/controllers/ConnectionsController.js.map +1 -1
- package/lib/commonjs/controllers/ModalController.js +4 -1
- package/lib/commonjs/controllers/ModalController.js.map +1 -1
- package/lib/commonjs/controllers/OnRampController.js +4 -1
- package/lib/commonjs/controllers/OnRampController.js.map +1 -1
- package/lib/commonjs/controllers/OptionsController.js +6 -3
- package/lib/commonjs/controllers/OptionsController.js.map +1 -1
- package/lib/commonjs/controllers/SendController.js +15 -1
- package/lib/commonjs/controllers/SendController.js.map +1 -1
- package/lib/commonjs/controllers/ThemeController.js +5 -0
- package/lib/commonjs/controllers/ThemeController.js.map +1 -1
- package/lib/commonjs/features/reown-authentication/ReownAuthentication.js +264 -0
- package/lib/commonjs/features/reown-authentication/ReownAuthentication.js.map +1 -0
- package/lib/commonjs/features/reown-authentication/ReownAuthenticationMessenger.js +48 -0
- package/lib/commonjs/features/reown-authentication/ReownAuthenticationMessenger.js.map +1 -0
- package/lib/commonjs/features/reown-authentication/index.js +28 -0
- package/lib/commonjs/features/reown-authentication/index.js.map +1 -0
- package/lib/commonjs/index.js +12 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/ConstantsUtil.js +1 -5
- package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
- package/lib/commonjs/utils/CoreHelperUtil.js +13 -2
- package/lib/commonjs/utils/CoreHelperUtil.js.map +1 -1
- package/lib/commonjs/utils/FetchUtil.js.map +1 -1
- package/lib/commonjs/utils/StorageUtil.js +27 -27
- package/lib/commonjs/utils/StorageUtil.js.map +1 -1
- package/lib/module/controllers/ApiController.js +102 -84
- package/lib/module/controllers/ApiController.js.map +1 -1
- package/lib/module/controllers/BlockchainApiController.js +1 -1
- package/lib/module/controllers/BlockchainApiController.js.map +1 -1
- package/lib/module/controllers/ConnectionsController.js +35 -22
- package/lib/module/controllers/ConnectionsController.js.map +1 -1
- package/lib/module/controllers/ModalController.js +4 -1
- package/lib/module/controllers/ModalController.js.map +1 -1
- package/lib/module/controllers/OnRampController.js +4 -1
- package/lib/module/controllers/OnRampController.js.map +1 -1
- package/lib/module/controllers/OptionsController.js +6 -3
- package/lib/module/controllers/OptionsController.js.map +1 -1
- package/lib/module/controllers/SendController.js +15 -1
- package/lib/module/controllers/SendController.js.map +1 -1
- package/lib/module/controllers/ThemeController.js +5 -0
- package/lib/module/controllers/ThemeController.js.map +1 -1
- package/lib/module/features/reown-authentication/ReownAuthentication.js +260 -0
- package/lib/module/features/reown-authentication/ReownAuthentication.js.map +1 -0
- package/lib/module/features/reown-authentication/ReownAuthenticationMessenger.js +43 -0
- package/lib/module/features/reown-authentication/ReownAuthenticationMessenger.js.map +1 -0
- package/lib/module/features/reown-authentication/index.js +5 -0
- package/lib/module/features/reown-authentication/index.js.map +1 -0
- package/lib/module/index.js +4 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/ConstantsUtil.js +1 -5
- package/lib/module/utils/ConstantsUtil.js.map +1 -1
- package/lib/module/utils/CoreHelperUtil.js +13 -2
- package/lib/module/utils/CoreHelperUtil.js.map +1 -1
- package/lib/module/utils/FetchUtil.js.map +1 -1
- package/lib/module/utils/StorageUtil.js +28 -28
- package/lib/module/utils/StorageUtil.js.map +1 -1
- package/lib/typescript/controllers/ApiController.d.ts.map +1 -1
- package/lib/typescript/controllers/ConnectionsController.d.ts +3 -2
- package/lib/typescript/controllers/ConnectionsController.d.ts.map +1 -1
- package/lib/typescript/controllers/ModalController.d.ts.map +1 -1
- package/lib/typescript/controllers/OnRampController.d.ts.map +1 -1
- package/lib/typescript/controllers/OptionsController.d.ts +3 -3
- package/lib/typescript/controllers/OptionsController.d.ts.map +1 -1
- package/lib/typescript/controllers/RouterController.d.ts +1 -1
- package/lib/typescript/controllers/RouterController.d.ts.map +1 -1
- package/lib/typescript/controllers/SendController.d.ts.map +1 -1
- package/lib/typescript/controllers/ThemeController.d.ts +2 -0
- package/lib/typescript/controllers/ThemeController.d.ts.map +1 -1
- package/lib/typescript/features/reown-authentication/ReownAuthentication.d.ts +174 -0
- package/lib/typescript/features/reown-authentication/ReownAuthentication.d.ts.map +1 -0
- package/lib/typescript/features/reown-authentication/ReownAuthenticationMessenger.d.ts +16 -0
- package/lib/typescript/features/reown-authentication/ReownAuthenticationMessenger.d.ts.map +1 -0
- package/lib/typescript/features/reown-authentication/index.d.ts +3 -0
- package/lib/typescript/features/reown-authentication/index.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +2 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
- package/lib/typescript/utils/CoreHelperUtil.d.ts +2 -1
- package/lib/typescript/utils/CoreHelperUtil.d.ts.map +1 -1
- package/lib/typescript/utils/FetchUtil.d.ts +1 -1
- package/lib/typescript/utils/FetchUtil.d.ts.map +1 -1
- package/lib/typescript/utils/StorageUtil.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/controllers/ApiController.ts +93 -73
- package/src/controllers/BlockchainApiController.ts +1 -1
- package/src/controllers/ConnectionsController.ts +60 -20
- package/src/controllers/ModalController.ts +5 -1
- package/src/controllers/OnRampController.ts +5 -1
- package/src/controllers/OptionsController.ts +11 -6
- package/src/controllers/RouterController.ts +3 -3
- package/src/controllers/SendController.ts +22 -2
- package/src/controllers/ThemeController.ts +7 -0
- package/src/features/reown-authentication/ReownAuthentication.ts +470 -0
- package/src/features/reown-authentication/ReownAuthenticationMessenger.ts +80 -0
- package/src/features/reown-authentication/index.ts +2 -0
- package/src/index.ts +4 -1
- package/src/utils/ConstantsUtil.ts +1 -5
- package/src/utils/CoreHelperUtil.ts +20 -2
- package/src/utils/FetchUtil.ts +1 -1
- package/src/utils/StorageUtil.ts +37 -53
- package/lib/commonjs/utils/RouterUtil.js +0 -25
- package/lib/commonjs/utils/RouterUtil.js.map +0 -1
- package/lib/module/utils/RouterUtil.js +0 -21
- package/lib/module/utils/RouterUtil.js.map +0 -1
- package/lib/typescript/utils/RouterUtil.d.ts +0 -5
- package/lib/typescript/utils/RouterUtil.d.ts.map +0 -1
- package/src/utils/RouterUtil.ts +0 -21
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { type CaipNetworkId, type ChainNamespace, type SIWXConfig, type SIWXMessage, type SIWXSession } from '@reown/appkit-common-react-native';
|
|
2
|
+
/**
|
|
3
|
+
* This is the configuration for using SIWX with Reown Authentication service.
|
|
4
|
+
* It allows you to authenticate and capture user sessions through the Reown Dashboard.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ReownAuthentication implements SIWXConfig {
|
|
7
|
+
private readonly localAuthStorageKey;
|
|
8
|
+
private readonly localNonceStorageKey;
|
|
9
|
+
private readonly messenger;
|
|
10
|
+
private readonly fetchUtil;
|
|
11
|
+
readonly signOutOnDisconnect: boolean;
|
|
12
|
+
private required;
|
|
13
|
+
private listeners;
|
|
14
|
+
constructor(params?: ReownAuthentication.ConstructorParams);
|
|
15
|
+
createMessage(input: SIWXMessage.Input): Promise<SIWXMessage>;
|
|
16
|
+
addSession(session: SIWXSession): Promise<void>;
|
|
17
|
+
getSessions(chainId: CaipNetworkId, address: string): Promise<SIWXSession[]>;
|
|
18
|
+
revokeSession(_chainId: CaipNetworkId, _address: string): Promise<void>;
|
|
19
|
+
setSessions(sessions: SIWXSession[]): Promise<void>;
|
|
20
|
+
getRequired(): boolean;
|
|
21
|
+
getSessionAccount(): Promise<Omit<ReownAuthentication.SessionAccount, "appKitAccount">>;
|
|
22
|
+
setSessionAccountMetadata(metadata?: object | null): Promise<unknown>;
|
|
23
|
+
on<Event extends keyof ReownAuthentication.Events>(event: Event, callback: ReownAuthentication.Listener<Event>): () => void;
|
|
24
|
+
removeAllListeners(): void;
|
|
25
|
+
private request;
|
|
26
|
+
private getStorageToken;
|
|
27
|
+
private setStorageToken;
|
|
28
|
+
private clearStorageTokens;
|
|
29
|
+
private getNonce;
|
|
30
|
+
private getClientId;
|
|
31
|
+
private getWalletInfo;
|
|
32
|
+
private getSDKProperties;
|
|
33
|
+
private emit;
|
|
34
|
+
}
|
|
35
|
+
export declare namespace ReownAuthentication {
|
|
36
|
+
type ConstructorParams = {
|
|
37
|
+
/**
|
|
38
|
+
* The key to use for storing the session token in local storage.
|
|
39
|
+
* @default '@appkit/siwx-auth-token'
|
|
40
|
+
*/
|
|
41
|
+
localAuthStorageKey?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The key to use for storing the nonce token in local storage.
|
|
44
|
+
* @default '@appkit/siwx-nonce-token'
|
|
45
|
+
*/
|
|
46
|
+
localNonceStorageKey?: string;
|
|
47
|
+
/**
|
|
48
|
+
* If false the wallet stays connected when user denies the signature request.
|
|
49
|
+
* @default true
|
|
50
|
+
*/
|
|
51
|
+
required?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* This flag determines whether the session should be cleared when the user disconnects.
|
|
54
|
+
*
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
signOutOnDisconnect?: boolean;
|
|
58
|
+
};
|
|
59
|
+
type AvailableRequestHeaders = {
|
|
60
|
+
nonce: {
|
|
61
|
+
'x-nonce-jwt': string;
|
|
62
|
+
};
|
|
63
|
+
auth: {
|
|
64
|
+
Authorization: string;
|
|
65
|
+
};
|
|
66
|
+
origin: {
|
|
67
|
+
origin: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
type RequestParams<Key extends keyof Requests[Method], Method extends Methods> = {
|
|
71
|
+
method: Method;
|
|
72
|
+
key: Key;
|
|
73
|
+
} & Pick<Requests[Method][Key], 'query' | 'body' | 'headers'>;
|
|
74
|
+
type RequestResponse<Method extends Methods, Key extends RequestKeys<Method>> = Requests[Method][Key]['response'];
|
|
75
|
+
type Request<Body, Response, Query extends Record<string, unknown> | undefined = undefined, Headers extends (keyof AvailableRequestHeaders)[] | undefined = undefined> = (Response extends undefined ? {
|
|
76
|
+
response?: never;
|
|
77
|
+
} : {
|
|
78
|
+
response: Response;
|
|
79
|
+
}) & (Body extends undefined ? {
|
|
80
|
+
body?: never;
|
|
81
|
+
} : {
|
|
82
|
+
body: Body;
|
|
83
|
+
}) & (Query extends undefined ? {
|
|
84
|
+
query?: never;
|
|
85
|
+
} : {
|
|
86
|
+
query: Query;
|
|
87
|
+
}) & (Headers extends undefined ? {
|
|
88
|
+
headers?: never;
|
|
89
|
+
} : {
|
|
90
|
+
headers: Headers;
|
|
91
|
+
});
|
|
92
|
+
type Requests = {
|
|
93
|
+
GET: {
|
|
94
|
+
nonce: Request<undefined, {
|
|
95
|
+
nonce: string;
|
|
96
|
+
token: string;
|
|
97
|
+
}>;
|
|
98
|
+
me: Request<undefined, Omit<SessionAccount, 'appKitAccount'>, {
|
|
99
|
+
includeAppKitAccount?: boolean;
|
|
100
|
+
}, [
|
|
101
|
+
'auth'
|
|
102
|
+
]>;
|
|
103
|
+
};
|
|
104
|
+
POST: {
|
|
105
|
+
'authenticate': Request<{
|
|
106
|
+
data?: SIWXMessage.Data;
|
|
107
|
+
message: string;
|
|
108
|
+
signature: string;
|
|
109
|
+
clientId?: string | null;
|
|
110
|
+
walletInfo?: WalletInfo;
|
|
111
|
+
}, {
|
|
112
|
+
token: string;
|
|
113
|
+
}, undefined, [
|
|
114
|
+
'nonce'
|
|
115
|
+
]>;
|
|
116
|
+
'sign-out': Request<undefined, never, never, ['auth']>;
|
|
117
|
+
};
|
|
118
|
+
PUT: {
|
|
119
|
+
'account-metadata': Request<{
|
|
120
|
+
metadata: object | null;
|
|
121
|
+
}, unknown, undefined, ['auth']>;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
type Methods = 'GET' | 'POST' | 'PUT';
|
|
125
|
+
type RequestKeys<Method extends Methods> = keyof Requests[Method];
|
|
126
|
+
type WalletInfo = {
|
|
127
|
+
type: 'walletconnect' | 'external' | 'unknown';
|
|
128
|
+
name: string | undefined;
|
|
129
|
+
icon: string | undefined;
|
|
130
|
+
} | {
|
|
131
|
+
type: 'social';
|
|
132
|
+
social: string;
|
|
133
|
+
identifier: string;
|
|
134
|
+
};
|
|
135
|
+
type Events = {
|
|
136
|
+
sessionChanged: SIWXSession | undefined;
|
|
137
|
+
};
|
|
138
|
+
type Listener<Event extends keyof Events> = (event: Events[Event]) => void;
|
|
139
|
+
type EventListeners = {
|
|
140
|
+
[Key in keyof Events]: Listener<Key>[];
|
|
141
|
+
};
|
|
142
|
+
type SessionAccount = {
|
|
143
|
+
aud: string;
|
|
144
|
+
iss: string;
|
|
145
|
+
exp: number;
|
|
146
|
+
projectIdKey: string;
|
|
147
|
+
sub: string;
|
|
148
|
+
address: string;
|
|
149
|
+
chainId: number | string;
|
|
150
|
+
chainNamespace: ChainNamespace;
|
|
151
|
+
caip2Network: string;
|
|
152
|
+
uri: string;
|
|
153
|
+
domain: string;
|
|
154
|
+
projectUuid: string;
|
|
155
|
+
profileUuid: string;
|
|
156
|
+
nonce: string;
|
|
157
|
+
email?: string;
|
|
158
|
+
appKitAccount?: {
|
|
159
|
+
uuid: string;
|
|
160
|
+
caip2_chain: string;
|
|
161
|
+
address: string;
|
|
162
|
+
profile_uuid: string;
|
|
163
|
+
created_at: string;
|
|
164
|
+
is_main_account: boolean;
|
|
165
|
+
verification_status: null;
|
|
166
|
+
connection_method: object | null;
|
|
167
|
+
metadata: object;
|
|
168
|
+
last_signed_in_at: string;
|
|
169
|
+
signed_up_at: string;
|
|
170
|
+
updated_at: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=ReownAuthentication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;QACzB,cAAc,EAAE,cAAc,CAAC;QAC/B,YAAY,EAAE,MAAM,CAAC;QACrB,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE;YACd,IAAI,EAAE,MAAM,CAAC;YACb,WAAW,EAAE,MAAM,CAAC;YACpB,OAAO,EAAE,MAAM,CAAC;YAChB,YAAY,EAAE,MAAM,CAAC;YACrB,UAAU,EAAE,MAAM,CAAC;YACnB,eAAe,EAAE,OAAO,CAAC;YACzB,mBAAmB,EAAE,IAAI,CAAC;YAC1B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;YACjC,QAAQ,EAAE,MAAM,CAAC;YACjB,iBAAiB,EAAE,MAAM,CAAC;YAC1B,YAAY,EAAE,MAAM,CAAC;YACrB,UAAU,EAAE,MAAM,CAAC;SACpB,CAAC;KACH,CAAC;CACH"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SIWXMessage } from '@reown/appkit-common-react-native';
|
|
2
|
+
export declare class ReownAuthenticationMessenger {
|
|
3
|
+
resources?: SIWXMessage['resources'];
|
|
4
|
+
protected getNonce: (params: SIWXMessage.Input) => Promise<SIWXMessage['nonce']>;
|
|
5
|
+
constructor(params: ReownAuthenticationMessenger.ConstructorParams);
|
|
6
|
+
createMessage(input: SIWXMessage.Input): Promise<SIWXMessage>;
|
|
7
|
+
private stringify;
|
|
8
|
+
private getNetworkName;
|
|
9
|
+
private stringifyDate;
|
|
10
|
+
}
|
|
11
|
+
export declare namespace ReownAuthenticationMessenger {
|
|
12
|
+
interface ConstructorParams {
|
|
13
|
+
getNonce: (params: SIWXMessage.Input) => Promise<SIWXMessage['nonce']>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=ReownAuthenticationMessenger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReownAuthenticationMessenger.d.ts","sourceRoot":"","sources":["../../../../src/features/reown-authentication/ReownAuthenticationMessenger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,mCAAmC,CAAC;AAKpF,qBAAa,4BAA4B;IAChC,SAAS,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAE5C,SAAS,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,KAAK,KAAK,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;gBAErE,MAAM,EAAE,4BAA4B,CAAC,iBAAiB;IAI5D,aAAa,CAAC,KAAK,EAAE,WAAW,CAAC,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC;IAwBnE,OAAO,CAAC,SAAS;IAuBjB,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,aAAa;CAGtB;AAED,yBAAiB,4BAA4B,CAAC;IAC5C,UAAiB,iBAAiB;QAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,KAAK,KAAK,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;KACxE;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/reown-authentication/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC"}
|
|
@@ -21,6 +21,7 @@ export { ConstantsUtil } from './utils/ConstantsUtil';
|
|
|
21
21
|
export { CoreHelperUtil } from './utils/CoreHelperUtil';
|
|
22
22
|
export { StorageUtil } from './utils/StorageUtil';
|
|
23
23
|
export { EventUtil } from './utils/EventUtil';
|
|
24
|
-
export { RouterUtil } from './utils/RouterUtil';
|
|
25
24
|
export { WalletUtil } from './utils/WalletUtil';
|
|
25
|
+
export { ReownAuthentication } from './features/reown-authentication/ReownAuthentication';
|
|
26
|
+
export { ReownAuthenticationMessenger } from './features/reown-authentication/ReownAuthenticationMessenger';
|
|
26
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE9F,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAElF,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,EAChC,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE3F,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAErF,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE3F,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE3F,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEjG,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,EAChC,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAExF,OAAO,EAAE,gBAAgB,EA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AAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConstantsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/ConstantsUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AASlF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;CAclB,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ConstantsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/ConstantsUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AASlF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;CAclB,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsRzB,CAAC"}
|
|
@@ -2,9 +2,10 @@ import { BlockchainAdapter, type Balance, type CaipAddress, type CaipNetwork, ty
|
|
|
2
2
|
export declare const CoreHelperUtil: {
|
|
3
3
|
isPairingExpired(expiry?: number): boolean;
|
|
4
4
|
isAllowedRetry(lastRetry: number): boolean;
|
|
5
|
+
isCaipAddress(address?: unknown): address is `${string}:${string}:${string}`;
|
|
5
6
|
getPairingExpiry(): number;
|
|
6
7
|
getNetworkId(caipAddress: CaipAddress | undefined): string | undefined;
|
|
7
|
-
getPlainAddress(
|
|
8
|
+
getPlainAddress(address: CaipAddress | string | undefined): string | undefined;
|
|
8
9
|
wait(milliseconds: number): Promise<unknown>;
|
|
9
10
|
isHttpUrl(url: string): boolean;
|
|
10
11
|
isLinkModeURL(url?: string): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreHelperUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/CoreHelperUt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AW,MAAM,GAAG,UAAU;;CAsB/E,CAAC"}
|
|
@@ -22,7 +22,7 @@ export declare class FetchUtil {
|
|
|
22
22
|
put<T>({ body, headers, signal, ...args }: PostArguments): Promise<T | undefined>;
|
|
23
23
|
delete<T>({ body, headers, signal, ...args }: PostArguments): Promise<T | undefined>;
|
|
24
24
|
fetchImage(path: string, headers?: Record<string, string>): Promise<string | undefined>;
|
|
25
|
-
|
|
25
|
+
createUrl({ path, params }: RequestArguments): string;
|
|
26
26
|
private processResponse;
|
|
27
27
|
}
|
|
28
28
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FetchUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/FetchUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAGtE,UAAU,OAAO;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAC5C,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,UAAU,aAAc,SAAQ,gBAAgB;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAGD,qBAAa,SAAS;IACb,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;gBAElB,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO;IAKpC,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,gBAAgB;I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AE,GAAG,IAAI,EAAE,EAAE,gBAAgB;IAOrD,IAAI,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa;IAYzD,GAAG,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa;IAYxD,MAAM,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa;IAY3D,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAgB/D,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,gBAAgB;YAsCrC,eAAe;CA2B9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/StorageUtil.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,QAAQ,EAEb,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EAEpB,MAAM,mCAAmC,CAAC;AAI3C,eAAO,MAAM,WAAW;6CACmB,cAAc;;;4BAkCzB,QAAQ;
|
|
1
|
+
{"version":3,"file":"StorageUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/StorageUtil.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,QAAQ,EAEb,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EAEpB,MAAM,mCAAmC,CAAC;AAI3C,eAAO,MAAM,WAAW;6CACmB,cAAc;;;4BAkCzB,QAAQ;8BAuBN,QAAQ,EAAE;wBAQhB,QAAQ,QAAQ,EAAE,CAAC;;cAgBrC,aAAa;oBACP,MAAM,EAAE;;8BAiBU,QAAQ;QAAE,IAAI,EAAE,aAAa,CAAC;QAAC,UAAU,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;oCAclD,aAAa;uCAaV,aAAa;;6CAyBP,kBAAkB;;kCAyB7B,aAAa,EAAE;;kDAsBC,qBAAqB,EAAE;;gDAsCzB,qBAAqB,EAAE;;oCAuCnC,eAAe,EAAE;;4CAsCT,kBAAkB,EAAE;;mCAsC7B,cAAc;;;CAoCpD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-core-react-native",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.6",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"types": "lib/typescript/index.d.ts",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -30,19 +30,20 @@
|
|
|
30
30
|
"repository": "https://github.com/reown-com/appkit-react-native",
|
|
31
31
|
"author": "Reown (https://discord.gg/reown)",
|
|
32
32
|
"homepage": "https://reown.com/appkit",
|
|
33
|
-
"license": "
|
|
33
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
34
34
|
"bugs": {
|
|
35
35
|
"url": "https://github.com/reown-com/appkit-react-native/issues"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"registry": "https://registry.npmjs.org/",
|
|
39
|
-
"access": "public"
|
|
39
|
+
"access": "public",
|
|
40
|
+
"provenance": true
|
|
40
41
|
},
|
|
41
42
|
"dependencies": {
|
|
42
|
-
"@reown/appkit-common-react-native": "2.0.0-alpha.
|
|
43
|
+
"@reown/appkit-common-react-native": "2.0.0-alpha.6",
|
|
43
44
|
"countries-and-timezones": "3.7.2",
|
|
44
45
|
"derive-valtio": "0.2.0",
|
|
45
|
-
"valtio": "2.1.
|
|
46
|
+
"valtio": "2.1.8"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
48
49
|
"@walletconnect/react-native-compat": ">=2.16.1",
|
|
@@ -108,87 +108,104 @@ export const ApiController = {
|
|
|
108
108
|
},
|
|
109
109
|
|
|
110
110
|
async fetchInstalledWallets() {
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
path,
|
|
115
|
-
headers: ApiController._getApiHeaders()
|
|
116
|
-
});
|
|
111
|
+
// Add timeout to prevent hanging
|
|
112
|
+
const controller = new AbortController();
|
|
113
|
+
let timeoutId: NodeJS.Timeout | undefined;
|
|
117
114
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
try {
|
|
116
|
+
const { includeWalletIds, customWallets } = OptionsController.state;
|
|
117
|
+
const path = Platform.select({ default: 'getIosData', android: 'getAndroidData' });
|
|
118
|
+
const response = await api.get<ApiGetDataWalletsResponse>({
|
|
119
|
+
path,
|
|
120
|
+
headers: ApiController._getApiHeaders()
|
|
121
|
+
});
|
|
121
122
|
|
|
122
|
-
|
|
123
|
-
walletData = walletData.filter(({ id }) => includeWalletIds.includes(id));
|
|
124
|
-
}
|
|
123
|
+
if (!response) return;
|
|
125
124
|
|
|
126
|
-
|
|
127
|
-
return {
|
|
128
|
-
id: item.id,
|
|
129
|
-
isInstalled: await CoreHelperUtil.checkInstalled(item)
|
|
130
|
-
};
|
|
131
|
-
});
|
|
125
|
+
let { data: walletData } = response;
|
|
132
126
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
isInstalled: await CoreHelperUtil.checkInstalled(item)
|
|
137
|
-
};
|
|
138
|
-
});
|
|
127
|
+
if (includeWalletIds?.length) {
|
|
128
|
+
walletData = walletData.filter(({ id }) => includeWalletIds.includes(id));
|
|
129
|
+
}
|
|
139
130
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
131
|
+
const promises = walletData.map(async item => {
|
|
132
|
+
return {
|
|
133
|
+
id: item.id,
|
|
134
|
+
isInstalled: await CoreHelperUtil.checkInstalled(item)
|
|
135
|
+
};
|
|
136
|
+
});
|
|
144
137
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
headers: ApiController._getApiHeaders(),
|
|
151
|
-
params: {
|
|
152
|
-
page: '1',
|
|
153
|
-
platform: this.platform(),
|
|
154
|
-
entries: installed?.length.toString(),
|
|
155
|
-
include: installed?.join(','),
|
|
156
|
-
exclude: excludeWalletIds?.join(','),
|
|
157
|
-
chains: chains.join(',')
|
|
158
|
-
}
|
|
138
|
+
const customPromises = customWallets?.map(async item => {
|
|
139
|
+
return {
|
|
140
|
+
id: item.id,
|
|
141
|
+
isInstalled: await CoreHelperUtil.checkInstalled(item)
|
|
142
|
+
};
|
|
159
143
|
});
|
|
160
144
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
145
|
+
const results = await Promise.all(promises);
|
|
146
|
+
const installed = results.filter(({ isInstalled }) => isInstalled).map(({ id }) => id);
|
|
147
|
+
const { excludeWalletIds } = OptionsController.state;
|
|
148
|
+
const chains = CoreHelperUtil.getRequestedCaipNetworkIds();
|
|
149
|
+
|
|
150
|
+
// Add timeout to prevent hanging
|
|
151
|
+
timeoutId = setTimeout(() => controller.abort(), 10000);
|
|
152
|
+
|
|
153
|
+
// Collect API-sourced installed wallets
|
|
154
|
+
let apiInstalledWallets: WcWallet[] = [];
|
|
155
|
+
if (installed.length > 0) {
|
|
156
|
+
const walletResponse = await api.get<ApiGetWalletsResponse>({
|
|
157
|
+
path: '/getWallets',
|
|
158
|
+
headers: ApiController._getApiHeaders(),
|
|
159
|
+
params: {
|
|
160
|
+
page: '1',
|
|
161
|
+
platform: this.platform(),
|
|
162
|
+
entries: installed?.length.toString(),
|
|
163
|
+
include: installed?.join(','),
|
|
164
|
+
exclude: excludeWalletIds?.join(','),
|
|
165
|
+
chains: chains.join(',')
|
|
166
|
+
},
|
|
167
|
+
signal: controller.signal
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
if (walletResponse?.data) {
|
|
171
|
+
const walletImages = walletResponse.data.map(d => d.image_id).filter(Boolean);
|
|
172
|
+
await CoreHelperUtil.allSettled(
|
|
173
|
+
(walletImages as string[]).map(id => ApiController._fetchWalletImage(id))
|
|
174
|
+
);
|
|
175
|
+
apiInstalledWallets = walletResponse.data;
|
|
176
|
+
}
|
|
167
177
|
}
|
|
168
|
-
}
|
|
169
178
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
clearTimeout(timeoutId);
|
|
180
|
+
|
|
181
|
+
// Collect custom installed wallets
|
|
182
|
+
let customInstalledWallets: CustomWallet[] = [];
|
|
183
|
+
if (customPromises?.length) {
|
|
184
|
+
const customResults = await Promise.all(customPromises);
|
|
185
|
+
const customInstalled = customResults
|
|
186
|
+
.filter(({ isInstalled }) => isInstalled)
|
|
187
|
+
.map(({ id }) => id);
|
|
188
|
+
customInstalledWallets =
|
|
189
|
+
customWallets?.filter(wallet => customInstalled.includes(wallet.id)) ?? [];
|
|
190
|
+
}
|
|
180
191
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
192
|
+
// Merge and de-duplicate by id, preserving order (API first, then custom)
|
|
193
|
+
const byId = new Map<string, WcWallet>();
|
|
194
|
+
[...apiInstalledWallets, ...customInstalledWallets].forEach(wallet => {
|
|
195
|
+
if (!byId.has(wallet.id)) {
|
|
196
|
+
byId.set(wallet.id, wallet);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
const combinedInstalled = Array.from(byId.values());
|
|
200
|
+
state.installed = combinedInstalled;
|
|
201
|
+
if (combinedInstalled.length) {
|
|
202
|
+
this.updateRecentWalletsInfo(combinedInstalled);
|
|
186
203
|
}
|
|
187
|
-
})
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
204
|
+
} catch (error) {
|
|
205
|
+
state.installed = [];
|
|
206
|
+
clearTimeout(timeoutId);
|
|
207
|
+
// eslint-disable-next-line no-console
|
|
208
|
+
console.log('Error fetching installed wallets', error);
|
|
192
209
|
}
|
|
193
210
|
},
|
|
194
211
|
|
|
@@ -375,19 +392,22 @@ export const ApiController = {
|
|
|
375
392
|
try {
|
|
376
393
|
state.prefetchError = false;
|
|
377
394
|
state.prefetchLoading = true;
|
|
378
|
-
// this fetch must resolve first so we filter them in the other wallet requests
|
|
379
|
-
await ApiController.fetchInstalledWallets();
|
|
380
395
|
|
|
381
396
|
const promises = [
|
|
382
|
-
ApiController.fetchFeaturedWallets(),
|
|
383
|
-
ApiController.fetchRecommendedWallets(),
|
|
384
397
|
ApiController.fetchNetworkImages(),
|
|
385
398
|
ApiController.fetchCustomWalletImages()
|
|
386
399
|
];
|
|
400
|
+
|
|
387
401
|
if (OptionsController.state.enableAnalytics === undefined) {
|
|
388
402
|
promises.push(ApiController.fetchAnalyticsConfig());
|
|
389
403
|
}
|
|
390
404
|
|
|
405
|
+
// this fetch must resolve first so we filter them in the other wallet requests
|
|
406
|
+
await ApiController.fetchInstalledWallets();
|
|
407
|
+
|
|
408
|
+
promises.push(ApiController.fetchFeaturedWallets());
|
|
409
|
+
promises.push(ApiController.fetchRecommendedWallets());
|
|
410
|
+
|
|
391
411
|
state.prefetchPromise = Promise.race([
|
|
392
412
|
CoreHelperUtil.allSettled(promises),
|
|
393
413
|
CoreHelperUtil.wait(3000)
|
|
@@ -119,7 +119,7 @@ export const BlockchainApiController = {
|
|
|
119
119
|
|
|
120
120
|
async fetchTransactions(params: BlockchainApiTransactionsRequest) {
|
|
121
121
|
const { account, projectId, cursor, signal, cache, chainId } = params;
|
|
122
|
-
const isSupported =
|
|
122
|
+
const isSupported = ConstantsUtil.ACTIVITY_SUPPORTED_CHAINS.includes(chainId);
|
|
123
123
|
|
|
124
124
|
if (!isSupported) {
|
|
125
125
|
return { data: [], next: undefined };
|