@reown/appkit-core-react-native 0.0.0-feat-smart-account-20241017180406 → 0.0.0-fix-token-balance-20241017200828
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/AccountController.js +1 -11
- package/lib/commonjs/controllers/AccountController.js.map +1 -1
- package/lib/commonjs/controllers/ConnectionController.js +1 -11
- package/lib/commonjs/controllers/ConnectionController.js.map +1 -1
- package/lib/commonjs/controllers/NetworkController.js +1 -14
- package/lib/commonjs/controllers/NetworkController.js.map +1 -1
- package/lib/commonjs/controllers/OptionsController.js +1 -9
- package/lib/commonjs/controllers/OptionsController.js.map +1 -1
- package/lib/commonjs/controllers/RouterController.js.map +1 -1
- package/lib/commonjs/controllers/SendController.js +4 -4
- package/lib/commonjs/controllers/SendController.js.map +1 -1
- package/lib/commonjs/controllers/TransactionsController.js +1 -2
- package/lib/commonjs/controllers/TransactionsController.js.map +1 -1
- package/lib/commonjs/index.js +0 -7
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/ConstantsUtil.js +1 -7
- package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
- package/lib/commonjs/utils/StorageUtil.js +0 -24
- package/lib/commonjs/utils/StorageUtil.js.map +1 -1
- package/lib/module/controllers/AccountController.js +1 -11
- package/lib/module/controllers/AccountController.js.map +1 -1
- package/lib/module/controllers/ConnectionController.js +1 -11
- package/lib/module/controllers/ConnectionController.js.map +1 -1
- package/lib/module/controllers/NetworkController.js +1 -14
- package/lib/module/controllers/NetworkController.js.map +1 -1
- package/lib/module/controllers/OptionsController.js +1 -9
- package/lib/module/controllers/OptionsController.js.map +1 -1
- package/lib/module/controllers/RouterController.js.map +1 -1
- package/lib/module/controllers/SendController.js +4 -4
- package/lib/module/controllers/SendController.js.map +1 -1
- package/lib/module/controllers/TransactionsController.js +1 -2
- package/lib/module/controllers/TransactionsController.js.map +1 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/ConstantsUtil.js +1 -7
- package/lib/module/utils/ConstantsUtil.js.map +1 -1
- package/lib/module/utils/StorageUtil.js +0 -24
- package/lib/module/utils/StorageUtil.js.map +1 -1
- package/lib/typescript/controllers/AccountController.d.ts +1 -5
- package/lib/typescript/controllers/AccountController.d.ts.map +1 -1
- package/lib/typescript/controllers/ApiController.d.ts +1 -1
- package/lib/typescript/controllers/ConnectionController.d.ts +0 -3
- package/lib/typescript/controllers/ConnectionController.d.ts.map +1 -1
- package/lib/typescript/controllers/NetworkController.d.ts +0 -3
- package/lib/typescript/controllers/NetworkController.d.ts.map +1 -1
- package/lib/typescript/controllers/OptionsController.d.ts +2 -4
- package/lib/typescript/controllers/OptionsController.d.ts.map +1 -1
- package/lib/typescript/controllers/RouterController.d.ts +1 -3
- package/lib/typescript/controllers/RouterController.d.ts.map +1 -1
- package/lib/typescript/controllers/TransactionsController.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +0 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/utils/ConstantsUtil.d.ts +0 -2
- package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
- package/lib/typescript/utils/StorageUtil.d.ts +0 -4
- package/lib/typescript/utils/StorageUtil.d.ts.map +1 -1
- package/lib/typescript/utils/TypeUtil.d.ts +4 -104
- package/lib/typescript/utils/TypeUtil.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/controllers/AccountController.ts +2 -16
- package/src/controllers/ConnectionController.ts +1 -15
- package/src/controllers/NetworkController.ts +1 -21
- package/src/controllers/OptionsController.ts +3 -18
- package/src/controllers/RouterController.ts +0 -7
- package/src/controllers/SendController.ts +4 -4
- package/src/controllers/TransactionsController.ts +1 -2
- package/src/index.ts +0 -2
- package/src/utils/ConstantsUtil.ts +1 -11
- package/src/utils/StorageUtil.ts +0 -30
- package/src/utils/TypeUtil.ts +4 -106
- package/lib/commonjs/controllers/WebviewController.js +0 -40
- package/lib/commonjs/controllers/WebviewController.js.map +0 -1
- package/lib/module/controllers/WebviewController.js +0 -35
- package/lib/module/controllers/WebviewController.js.map +0 -1
- package/lib/typescript/controllers/WebviewController.d.ts +0 -18
- package/lib/typescript/controllers/WebviewController.d.ts.map +0 -1
- package/src/controllers/WebviewController.ts +0 -48
package/src/utils/TypeUtil.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Balance, SocialProvider, Transaction } from '@reown/appkit-common-react-native';
|
|
1
|
+
import type { Balance, Transaction } from '@reown/appkit-common-react-native';
|
|
3
2
|
|
|
4
3
|
export interface BaseError {
|
|
5
4
|
message?: string;
|
|
@@ -56,31 +55,11 @@ export type CaipNamespaces = Record<
|
|
|
56
55
|
}
|
|
57
56
|
>;
|
|
58
57
|
|
|
59
|
-
export type SdkType = 'appkit';
|
|
60
|
-
|
|
61
58
|
export type SdkVersion =
|
|
62
59
|
| `react-native-wagmi-${string}`
|
|
63
60
|
| `react-native-ethers5-${string}`
|
|
64
61
|
| `react-native-ethers-${string}`;
|
|
65
62
|
|
|
66
|
-
export type Features = {
|
|
67
|
-
/**
|
|
68
|
-
* @description Enable or disable the email feature. Enabled by default.
|
|
69
|
-
* @type {boolean}
|
|
70
|
-
*/
|
|
71
|
-
email?: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* @description Show or hide the regular wallet options when email is enabled. Enabled by default.
|
|
74
|
-
* @type {boolean}
|
|
75
|
-
*/
|
|
76
|
-
emailShowWallets?: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* @description Enable or disable the socials feature. Enabled by default.
|
|
79
|
-
* @type {FeaturesSocials[]}
|
|
80
|
-
*/
|
|
81
|
-
socials?: SocialProvider[] | false;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
63
|
// -- ApiController Types -------------------------------------------------------
|
|
85
64
|
export interface WcWallet {
|
|
86
65
|
id: string;
|
|
@@ -377,34 +356,18 @@ export type Event =
|
|
|
377
356
|
| {
|
|
378
357
|
type: 'track';
|
|
379
358
|
event: 'CLICK_SIGN_SIWE_MESSAGE';
|
|
380
|
-
properties: {
|
|
381
|
-
network: string;
|
|
382
|
-
isSmartAccount: boolean;
|
|
383
|
-
};
|
|
384
359
|
}
|
|
385
360
|
| {
|
|
386
361
|
type: 'track';
|
|
387
362
|
event: 'CLICK_CANCEL_SIWE';
|
|
388
|
-
properties: {
|
|
389
|
-
network: string;
|
|
390
|
-
isSmartAccount: boolean;
|
|
391
|
-
};
|
|
392
363
|
}
|
|
393
364
|
| {
|
|
394
365
|
type: 'track';
|
|
395
366
|
event: 'SIWE_AUTH_SUCCESS';
|
|
396
|
-
properties: {
|
|
397
|
-
network: string;
|
|
398
|
-
isSmartAccount: boolean;
|
|
399
|
-
};
|
|
400
367
|
}
|
|
401
368
|
| {
|
|
402
369
|
type: 'track';
|
|
403
370
|
event: 'SIWE_AUTH_ERROR';
|
|
404
|
-
properties: {
|
|
405
|
-
network: string;
|
|
406
|
-
isSmartAccount: boolean;
|
|
407
|
-
};
|
|
408
371
|
}
|
|
409
372
|
| {
|
|
410
373
|
type: 'track';
|
|
@@ -470,35 +433,6 @@ export type Event =
|
|
|
470
433
|
token: string;
|
|
471
434
|
amount: number;
|
|
472
435
|
};
|
|
473
|
-
}
|
|
474
|
-
| {
|
|
475
|
-
type: 'track';
|
|
476
|
-
event: 'SOCIAL_LOGIN_STARTED';
|
|
477
|
-
properties: {
|
|
478
|
-
provider: SocialProvider;
|
|
479
|
-
};
|
|
480
|
-
}
|
|
481
|
-
| {
|
|
482
|
-
type: 'track';
|
|
483
|
-
event: 'SOCIAL_LOGIN_SUCCESS';
|
|
484
|
-
properties: {
|
|
485
|
-
provider: SocialProvider;
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
| {
|
|
489
|
-
type: 'track';
|
|
490
|
-
event: 'SOCIAL_LOGIN_ERROR';
|
|
491
|
-
properties: {
|
|
492
|
-
provider: SocialProvider;
|
|
493
|
-
};
|
|
494
|
-
}
|
|
495
|
-
| {
|
|
496
|
-
type: 'track';
|
|
497
|
-
event: 'SET_PREFERRED_ACCOUNT_TYPE';
|
|
498
|
-
properties: {
|
|
499
|
-
accountType: AppKitFrameAccountType;
|
|
500
|
-
network: string;
|
|
501
|
-
};
|
|
502
436
|
};
|
|
503
437
|
|
|
504
438
|
// -- Send Controller Types -------------------------------------
|
|
@@ -523,46 +457,24 @@ export interface WriteContractArgs {
|
|
|
523
457
|
|
|
524
458
|
// -- Email Types ------------------------------------------------
|
|
525
459
|
/**
|
|
526
|
-
* Matches type defined for packages/
|
|
460
|
+
* Matches type defined for packages/email/src/AppKitFrameProvider.ts
|
|
527
461
|
* It's duplicated in order to decouple scaffold from email package
|
|
528
462
|
*/
|
|
529
|
-
|
|
530
|
-
export type AppKitFrameAccountType = 'eoa' | 'smartAccount';
|
|
531
|
-
|
|
532
463
|
export interface AppKitFrameProvider {
|
|
533
464
|
readonly id: string;
|
|
534
465
|
readonly name: string;
|
|
535
|
-
getEventEmitter(): EventEmitter;
|
|
536
466
|
getSecureSiteURL(): string;
|
|
537
467
|
getSecureSiteDashboardURL(): string;
|
|
538
468
|
getSecureSiteIconURL(): string;
|
|
539
469
|
getSecureSiteHeaders(): Record<string, string>;
|
|
470
|
+
getLoginEmailUsed(): Promise<boolean>;
|
|
540
471
|
getEmail(): string | undefined;
|
|
541
|
-
getUsername(): string | undefined;
|
|
542
|
-
getLastUsedChainId(): Promise<number | undefined>;
|
|
543
472
|
rejectRpcRequest(): void;
|
|
544
473
|
connectEmail(payload: { email: string }): Promise<{
|
|
545
474
|
action: 'VERIFY_DEVICE' | 'VERIFY_OTP';
|
|
546
475
|
}>;
|
|
547
476
|
connectDevice(): Promise<unknown>;
|
|
548
|
-
connectSocial(uri: string): Promise<{
|
|
549
|
-
chainId: string | number;
|
|
550
|
-
email: string;
|
|
551
|
-
address: string;
|
|
552
|
-
accounts?:
|
|
553
|
-
| {
|
|
554
|
-
type: AppKitFrameAccountType;
|
|
555
|
-
address: string;
|
|
556
|
-
}[]
|
|
557
|
-
| undefined;
|
|
558
|
-
userName?: string | undefined;
|
|
559
|
-
}>;
|
|
560
|
-
getSocialRedirectUri(payload: { provider: SocialProvider }): Promise<{
|
|
561
|
-
uri: string;
|
|
562
|
-
}>;
|
|
563
477
|
connectOtp(payload: { otp: string }): Promise<unknown>;
|
|
564
|
-
connectFarcaster: () => Promise<{ userName: string }>;
|
|
565
|
-
getFarcasterUri(): Promise<{ url: string }>;
|
|
566
478
|
isConnected(): Promise<{
|
|
567
479
|
isConnected: boolean;
|
|
568
480
|
}>;
|
|
@@ -583,31 +495,17 @@ export interface AppKitFrameProvider {
|
|
|
583
495
|
syncDappData(payload: {
|
|
584
496
|
projectId: string;
|
|
585
497
|
sdkVersion: SdkVersion;
|
|
586
|
-
sdkType: SdkType;
|
|
587
498
|
metadata?: Metadata;
|
|
588
499
|
}): Promise<unknown>;
|
|
589
500
|
connect(payload?: { chainId: number | undefined }): Promise<{
|
|
590
501
|
chainId: number;
|
|
591
|
-
email
|
|
502
|
+
email: string;
|
|
592
503
|
address: string;
|
|
593
|
-
smartAccountDeployed: boolean;
|
|
594
|
-
preferredAccountType: AppKitFrameAccountType;
|
|
595
504
|
}>;
|
|
596
505
|
switchNetwork(chainId: number): Promise<{
|
|
597
506
|
chainId: number;
|
|
598
507
|
}>;
|
|
599
|
-
setPreferredAccount(type: AppKitFrameAccountType): Promise<{
|
|
600
|
-
type: AppKitFrameAccountType;
|
|
601
|
-
address: string;
|
|
602
|
-
}>;
|
|
603
|
-
getSmartAccountEnabledNetworks(): Promise<{
|
|
604
|
-
smartAccountEnabledNetworks: number[];
|
|
605
|
-
}>;
|
|
606
508
|
disconnect(): Promise<unknown>;
|
|
607
509
|
request(req: any): Promise<any>;
|
|
608
510
|
AuthView: () => JSX.Element | null;
|
|
609
|
-
Webview: () => JSX.Element | null;
|
|
610
|
-
onSetPreferredAccount: (
|
|
611
|
-
callback: (values: { type: AppKitFrameAccountType; address: string }) => void
|
|
612
|
-
) => void;
|
|
613
511
|
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.WebviewController = void 0;
|
|
7
|
-
var _valtio = require("valtio");
|
|
8
|
-
// -- Types --------------------------------------------- //
|
|
9
|
-
|
|
10
|
-
// -- State --------------------------------------------- //
|
|
11
|
-
const state = (0, _valtio.proxy)({
|
|
12
|
-
frameViewVisible: false,
|
|
13
|
-
webviewVisible: false,
|
|
14
|
-
connecting: false,
|
|
15
|
-
connectingProvider: undefined
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
// -- Controller ---------------------------------------- //
|
|
19
|
-
const WebviewController = exports.WebviewController = {
|
|
20
|
-
state,
|
|
21
|
-
subscribe(callback) {
|
|
22
|
-
return (0, _valtio.subscribe)(state, () => callback(state));
|
|
23
|
-
},
|
|
24
|
-
setFrameViewVisible(frameViewVisible) {
|
|
25
|
-
state.frameViewVisible = frameViewVisible;
|
|
26
|
-
},
|
|
27
|
-
setWebviewVisible(visible) {
|
|
28
|
-
state.webviewVisible = visible;
|
|
29
|
-
},
|
|
30
|
-
setWebviewUrl(url) {
|
|
31
|
-
state.webviewUrl = url;
|
|
32
|
-
},
|
|
33
|
-
setConnecting(connecting) {
|
|
34
|
-
state.connecting = connecting;
|
|
35
|
-
},
|
|
36
|
-
setConnectingProvider(provider) {
|
|
37
|
-
state.connectingProvider = provider;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=WebviewController.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_valtio","require","state","proxy","frameViewVisible","webviewVisible","connecting","connectingProvider","undefined","WebviewController","exports","subscribe","callback","sub","setFrameViewVisible","setWebviewVisible","visible","setWebviewUrl","url","webviewUrl","setConnecting","setConnectingProvider","provider"],"sourceRoot":"../../../src","sources":["controllers/WebviewController.ts"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAEA;;AASA;AACA,MAAMC,KAAK,GAAG,IAAAC,aAAK,EAAyB;EAC1CC,gBAAgB,EAAE,KAAK;EACvBC,cAAc,EAAE,KAAK;EACrBC,UAAU,EAAE,KAAK;EACjBC,kBAAkB,EAAEC;AACtB,CAAC,CAAC;;AAEF;AACO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAC/BP,KAAK;EAELS,SAASA,CAACC,QAAoD,EAAE;IAC9D,OAAO,IAAAC,iBAAG,EAACX,KAAK,EAAE,MAAMU,QAAQ,CAACV,KAAK,CAAC,CAAC;EAC1C,CAAC;EAEDY,mBAAmBA,CAACV,gBAA4D,EAAE;IAChFF,KAAK,CAACE,gBAAgB,GAAGA,gBAAgB;EAC3C,CAAC;EAEDW,iBAAiBA,CAACC,OAAiD,EAAE;IACnEd,KAAK,CAACG,cAAc,GAAGW,OAAO;EAChC,CAAC;EAEDC,aAAaA,CAACC,GAAyC,EAAE;IACvDhB,KAAK,CAACiB,UAAU,GAAGD,GAAG;EACxB,CAAC;EAEDE,aAAaA,CAACd,UAAgD,EAAE;IAC9DJ,KAAK,CAACI,UAAU,GAAGA,UAAU;EAC/B,CAAC;EAEDe,qBAAqBA,CAACC,QAAsD,EAAE;IAC5EpB,KAAK,CAACK,kBAAkB,GAAGe,QAAQ;EACrC;AACF,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { proxy, subscribe as sub } from 'valtio';
|
|
2
|
-
|
|
3
|
-
// -- Types --------------------------------------------- //
|
|
4
|
-
|
|
5
|
-
// -- State --------------------------------------------- //
|
|
6
|
-
const state = proxy({
|
|
7
|
-
frameViewVisible: false,
|
|
8
|
-
webviewVisible: false,
|
|
9
|
-
connecting: false,
|
|
10
|
-
connectingProvider: undefined
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
// -- Controller ---------------------------------------- //
|
|
14
|
-
export const WebviewController = {
|
|
15
|
-
state,
|
|
16
|
-
subscribe(callback) {
|
|
17
|
-
return sub(state, () => callback(state));
|
|
18
|
-
},
|
|
19
|
-
setFrameViewVisible(frameViewVisible) {
|
|
20
|
-
state.frameViewVisible = frameViewVisible;
|
|
21
|
-
},
|
|
22
|
-
setWebviewVisible(visible) {
|
|
23
|
-
state.webviewVisible = visible;
|
|
24
|
-
},
|
|
25
|
-
setWebviewUrl(url) {
|
|
26
|
-
state.webviewUrl = url;
|
|
27
|
-
},
|
|
28
|
-
setConnecting(connecting) {
|
|
29
|
-
state.connecting = connecting;
|
|
30
|
-
},
|
|
31
|
-
setConnectingProvider(provider) {
|
|
32
|
-
state.connectingProvider = provider;
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=WebviewController.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["proxy","subscribe","sub","state","frameViewVisible","webviewVisible","connecting","connectingProvider","undefined","WebviewController","callback","setFrameViewVisible","setWebviewVisible","visible","setWebviewUrl","url","webviewUrl","setConnecting","setConnectingProvider","provider"],"sourceRoot":"../../../src","sources":["controllers/WebviewController.ts"],"mappings":"AACA,SAASA,KAAK,EAAEC,SAAS,IAAIC,GAAG,QAAQ,QAAQ;;AAEhD;;AASA;AACA,MAAMC,KAAK,GAAGH,KAAK,CAAyB;EAC1CI,gBAAgB,EAAE,KAAK;EACvBC,cAAc,EAAE,KAAK;EACrBC,UAAU,EAAE,KAAK;EACjBC,kBAAkB,EAAEC;AACtB,CAAC,CAAC;;AAEF;AACA,OAAO,MAAMC,iBAAiB,GAAG;EAC/BN,KAAK;EAELF,SAASA,CAACS,QAAoD,EAAE;IAC9D,OAAOR,GAAG,CAACC,KAAK,EAAE,MAAMO,QAAQ,CAACP,KAAK,CAAC,CAAC;EAC1C,CAAC;EAEDQ,mBAAmBA,CAACP,gBAA4D,EAAE;IAChFD,KAAK,CAACC,gBAAgB,GAAGA,gBAAgB;EAC3C,CAAC;EAEDQ,iBAAiBA,CAACC,OAAiD,EAAE;IACnEV,KAAK,CAACE,cAAc,GAAGQ,OAAO;EAChC,CAAC;EAEDC,aAAaA,CAACC,GAAyC,EAAE;IACvDZ,KAAK,CAACa,UAAU,GAAGD,GAAG;EACxB,CAAC;EAEDE,aAAaA,CAACX,UAAgD,EAAE;IAC9DH,KAAK,CAACG,UAAU,GAAGA,UAAU;EAC/B,CAAC;EAEDY,qBAAqBA,CAACC,QAAsD,EAAE;IAC5EhB,KAAK,CAACI,kBAAkB,GAAGY,QAAQ;EACrC;AACF,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { SocialProvider } from '@reown/appkit-common-react-native';
|
|
2
|
-
export interface WebviewControllerState {
|
|
3
|
-
frameViewVisible: boolean;
|
|
4
|
-
webviewVisible: boolean;
|
|
5
|
-
webviewUrl?: string;
|
|
6
|
-
connecting?: boolean;
|
|
7
|
-
connectingProvider?: SocialProvider;
|
|
8
|
-
}
|
|
9
|
-
export declare const WebviewController: {
|
|
10
|
-
state: WebviewControllerState;
|
|
11
|
-
subscribe(callback: (newState: WebviewControllerState) => void): () => void;
|
|
12
|
-
setFrameViewVisible(frameViewVisible: WebviewControllerState['frameViewVisible']): void;
|
|
13
|
-
setWebviewVisible(visible: WebviewControllerState['webviewVisible']): void;
|
|
14
|
-
setWebviewUrl(url: WebviewControllerState['webviewUrl']): void;
|
|
15
|
-
setConnecting(connecting: WebviewControllerState['connecting']): void;
|
|
16
|
-
setConnectingProvider(provider: WebviewControllerState['connectingProvider']): void;
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=WebviewController.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebviewController.d.ts","sourceRoot":"","sources":["../../../src/controllers/WebviewController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAIxE,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,cAAc,CAAC;CACrC;AAWD,eAAO,MAAM,iBAAiB;;mCAGG,sBAAsB,KAAK,IAAI;0CAIxB,sBAAsB,CAAC,kBAAkB,CAAC;+BAIrD,sBAAsB,CAAC,gBAAgB,CAAC;uBAIhD,sBAAsB,CAAC,YAAY,CAAC;8BAI7B,sBAAsB,CAAC,YAAY,CAAC;oCAI9B,sBAAsB,CAAC,oBAAoB,CAAC;CAG7E,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { SocialProvider } from '@reown/appkit-common-react-native';
|
|
2
|
-
import { proxy, subscribe as sub } from 'valtio';
|
|
3
|
-
|
|
4
|
-
// -- Types --------------------------------------------- //
|
|
5
|
-
export interface WebviewControllerState {
|
|
6
|
-
frameViewVisible: boolean;
|
|
7
|
-
webviewVisible: boolean;
|
|
8
|
-
webviewUrl?: string;
|
|
9
|
-
connecting?: boolean;
|
|
10
|
-
connectingProvider?: SocialProvider;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// -- State --------------------------------------------- //
|
|
14
|
-
const state = proxy<WebviewControllerState>({
|
|
15
|
-
frameViewVisible: false,
|
|
16
|
-
webviewVisible: false,
|
|
17
|
-
connecting: false,
|
|
18
|
-
connectingProvider: undefined
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
// -- Controller ---------------------------------------- //
|
|
22
|
-
export const WebviewController = {
|
|
23
|
-
state,
|
|
24
|
-
|
|
25
|
-
subscribe(callback: (newState: WebviewControllerState) => void) {
|
|
26
|
-
return sub(state, () => callback(state));
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
setFrameViewVisible(frameViewVisible: WebviewControllerState['frameViewVisible']) {
|
|
30
|
-
state.frameViewVisible = frameViewVisible;
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
setWebviewVisible(visible: WebviewControllerState['webviewVisible']) {
|
|
34
|
-
state.webviewVisible = visible;
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
setWebviewUrl(url: WebviewControllerState['webviewUrl']) {
|
|
38
|
-
state.webviewUrl = url;
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
setConnecting(connecting: WebviewControllerState['connecting']) {
|
|
42
|
-
state.connecting = connecting;
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
setConnectingProvider(provider: WebviewControllerState['connectingProvider']) {
|
|
46
|
-
state.connectingProvider = provider;
|
|
47
|
-
}
|
|
48
|
-
};
|