@reown/appkit-core-react-native 0.0.0-chore-solflare-20250730210452 → 0.0.0-chore-spring-effect-20250909214820
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 +121 -77
- package/lib/commonjs/controllers/ApiController.js.map +1 -1
- package/lib/commonjs/controllers/AssetController.js +0 -4
- package/lib/commonjs/controllers/AssetController.js.map +1 -1
- package/lib/commonjs/controllers/BlockchainApiController.js +1 -3
- package/lib/commonjs/controllers/BlockchainApiController.js.map +1 -1
- package/lib/commonjs/controllers/ConnectionsController.js +31 -33
- 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 +7 -4
- package/lib/commonjs/controllers/OnRampController.js.map +1 -1
- package/lib/commonjs/controllers/OptionsController.js +5 -4
- package/lib/commonjs/controllers/OptionsController.js.map +1 -1
- package/lib/commonjs/controllers/RouterController.js +2 -2
- package/lib/commonjs/controllers/RouterController.js.map +1 -1
- package/lib/commonjs/controllers/SwapController.js.map +1 -1
- package/lib/commonjs/controllers/WcController.js +73 -0
- package/lib/commonjs/controllers/WcController.js.map +1 -0
- package/lib/commonjs/index.js +14 -14
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/AssetUtil.js +9 -7
- package/lib/commonjs/utils/AssetUtil.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 +7 -0
- package/lib/commonjs/utils/CoreHelperUtil.js.map +1 -1
- package/lib/commonjs/utils/StorageUtil.js +0 -46
- package/lib/commonjs/utils/StorageUtil.js.map +1 -1
- package/lib/commonjs/utils/SwapApiUtil.js.map +1 -1
- package/lib/commonjs/utils/SwapCalculationUtil.js.map +1 -1
- package/lib/commonjs/utils/WalletUtil.js +23 -0
- package/lib/commonjs/utils/WalletUtil.js.map +1 -0
- package/lib/module/controllers/ApiController.js +121 -76
- package/lib/module/controllers/ApiController.js.map +1 -1
- package/lib/module/controllers/AssetController.js +0 -4
- package/lib/module/controllers/AssetController.js.map +1 -1
- package/lib/module/controllers/BlockchainApiController.js +1 -3
- package/lib/module/controllers/BlockchainApiController.js.map +1 -1
- package/lib/module/controllers/ConnectionsController.js +31 -33
- 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 +5 -2
- package/lib/module/controllers/OnRampController.js.map +1 -1
- package/lib/module/controllers/OptionsController.js +5 -4
- package/lib/module/controllers/OptionsController.js.map +1 -1
- package/lib/module/controllers/RouterController.js +2 -2
- package/lib/module/controllers/RouterController.js.map +1 -1
- package/lib/module/controllers/SwapController.js.map +1 -1
- package/lib/module/controllers/WcController.js +70 -0
- package/lib/module/controllers/WcController.js.map +1 -0
- package/lib/module/index.js +4 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/AssetUtil.js +9 -7
- package/lib/module/utils/AssetUtil.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 +8 -0
- package/lib/module/utils/CoreHelperUtil.js.map +1 -1
- package/lib/module/utils/StorageUtil.js +0 -47
- package/lib/module/utils/StorageUtil.js.map +1 -1
- package/lib/module/utils/SwapApiUtil.js.map +1 -1
- package/lib/module/utils/SwapCalculationUtil.js +1 -0
- package/lib/module/utils/SwapCalculationUtil.js.map +1 -1
- package/lib/module/utils/WalletUtil.js +19 -0
- package/lib/module/utils/WalletUtil.js.map +1 -0
- package/lib/typescript/controllers/ApiController.d.ts +1 -3
- package/lib/typescript/controllers/ApiController.d.ts.map +1 -1
- package/lib/typescript/controllers/AssetController.d.ts +0 -2
- package/lib/typescript/controllers/AssetController.d.ts.map +1 -1
- package/lib/typescript/controllers/BlockchainApiController.d.ts +4 -3
- package/lib/typescript/controllers/BlockchainApiController.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/EnsController.d.ts +1 -1
- package/lib/typescript/controllers/EventsController.d.ts +1 -1
- package/lib/typescript/controllers/EventsController.d.ts.map +1 -1
- package/lib/typescript/controllers/ModalController.d.ts.map +1 -1
- package/lib/typescript/controllers/OnRampController.d.ts +2 -2
- package/lib/typescript/controllers/OnRampController.d.ts.map +1 -1
- package/lib/typescript/controllers/OptionsController.d.ts +3 -4
- package/lib/typescript/controllers/OptionsController.d.ts.map +1 -1
- package/lib/typescript/controllers/RouterController.d.ts +4 -7
- package/lib/typescript/controllers/RouterController.d.ts.map +1 -1
- package/lib/typescript/controllers/SwapController.d.ts +1 -2
- package/lib/typescript/controllers/SwapController.d.ts.map +1 -1
- package/lib/typescript/controllers/WcController.d.ts +27 -0
- package/lib/typescript/controllers/WcController.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +2 -3
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/utils/AssetUtil.d.ts +3 -3
- package/lib/typescript/utils/AssetUtil.d.ts.map +1 -1
- package/lib/typescript/utils/ConstantsUtil.d.ts +1 -1
- package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
- package/lib/typescript/utils/CoreHelperUtil.d.ts +2 -2
- package/lib/typescript/utils/CoreHelperUtil.d.ts.map +1 -1
- package/lib/typescript/utils/EventUtil.d.ts +1 -1
- package/lib/typescript/utils/EventUtil.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 +1 -8
- package/lib/typescript/utils/StorageUtil.d.ts.map +1 -1
- package/lib/typescript/utils/SwapApiUtil.d.ts +2 -3
- package/lib/typescript/utils/SwapApiUtil.d.ts.map +1 -1
- package/lib/typescript/utils/SwapCalculationUtil.d.ts +1 -1
- package/lib/typescript/utils/SwapCalculationUtil.d.ts.map +1 -1
- package/lib/typescript/utils/WalletUtil.d.ts +5 -0
- package/lib/typescript/utils/WalletUtil.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/controllers/ApiController.ts +119 -74
- package/src/controllers/AssetController.ts +0 -6
- package/src/controllers/BlockchainApiController.ts +6 -6
- package/src/controllers/ConnectionsController.ts +47 -39
- package/src/controllers/EnsController.ts +1 -1
- package/src/controllers/EventsController.ts +1 -1
- package/src/controllers/ModalController.ts +5 -1
- package/src/controllers/OnRampController.ts +6 -2
- package/src/controllers/OptionsController.ts +17 -8
- package/src/controllers/RouterController.ts +14 -9
- package/src/controllers/SwapController.ts +3 -2
- package/src/controllers/WcController.ts +93 -0
- package/src/index.ts +3 -7
- package/src/utils/AssetUtil.ts +11 -8
- package/src/utils/ConstantsUtil.ts +2 -7
- package/src/utils/CoreHelperUtil.ts +13 -2
- package/src/utils/EventUtil.ts +1 -1
- package/src/utils/FetchUtil.ts +1 -1
- package/src/utils/StorageUtil.ts +6 -76
- package/src/utils/SwapApiUtil.ts +6 -2
- package/src/utils/SwapCalculationUtil.ts +1 -2
- package/src/utils/WalletUtil.ts +14 -0
- package/lib/commonjs/controllers/ConnectionController.js +0 -123
- package/lib/commonjs/controllers/ConnectionController.js.map +0 -1
- package/lib/commonjs/utils/RouterUtil.js +0 -25
- package/lib/commonjs/utils/RouterUtil.js.map +0 -1
- package/lib/commonjs/utils/TypeUtil.js +0 -31
- package/lib/commonjs/utils/TypeUtil.js.map +0 -1
- package/lib/module/controllers/ConnectionController.js +0 -120
- package/lib/module/controllers/ConnectionController.js.map +0 -1
- package/lib/module/utils/RouterUtil.js +0 -21
- package/lib/module/utils/RouterUtil.js.map +0 -1
- package/lib/module/utils/TypeUtil.js +0 -26
- package/lib/module/utils/TypeUtil.js.map +0 -1
- package/lib/typescript/controllers/ConnectionController.d.ts +0 -55
- package/lib/typescript/controllers/ConnectionController.d.ts.map +0 -1
- package/lib/typescript/utils/RouterUtil.d.ts +0 -5
- package/lib/typescript/utils/RouterUtil.d.ts.map +0 -1
- package/lib/typescript/utils/TypeUtil.d.ts +0 -705
- package/lib/typescript/utils/TypeUtil.d.ts.map +0 -1
- package/src/controllers/ConnectionController.ts +0 -185
- package/src/utils/RouterUtil.ts +0 -21
- package/src/utils/TypeUtil.ts +0 -899
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapController.d.ts","sourceRoot":"","sources":["../../../src/controllers/SwapController.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"SwapController.d.ts","sourceRoot":"","sources":["../../../src/controllers/SwapController.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,WAAW,EAEhB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,mCAAmC,CAAC;AAe3C,eAAO,MAAM,iBAAiB,SAAS,CAAC;AACxC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAGpC,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAYF,MAAM,WAAW,mBAAmB;IAElC,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAG7B,UAAU,EAAE,OAAO,CAAC;IAGpB,mBAAmB,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACnD,eAAe,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC/C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAG1B,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAG/B,QAAQ,EAAE,MAAM,CAAC;IAGjB,MAAM,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAChC,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACzC,aAAa,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACvC,WAAW,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACrC,mBAAmB,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC7C,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAGvC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAuDD,eAAO,MAAM,cAAc;;mCAGM,mBAAmB,KAAK,IAAI;2GAI2B,IAAI;;;;;;;;;;;;;;;;;;;;;yCAgI/C,WAAW,EAAE;wCAWpB,oBAAoB,EAAE;gCAQ9B,oBAAoB,GAAG,SAAS;iCAa/B,MAAM;6BAQJ,WAAW;;;;;;;;;;;;0BAqEpB,oBAAoB,EAAE;wBAQxB,oBAAoB,GAAG,SAAS;6BAa3B,MAAM;2BAMF,WAAW,UAAU,eAAe;;;;;;;;;;;;;;;;;;;qCAyP1B,iBAAiB;iCA8BrB,iBAAiB,GAAG,SAAS;;;;4CA6GxB,MAAM,sBAAsB,MAAM;;CAiD3E,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { WalletDeepLink, WcWallet } from '@reown/appkit-common-react-native';
|
|
2
|
+
export interface WcControllerState {
|
|
3
|
+
wcUri?: string;
|
|
4
|
+
wcPromise?: Promise<void>;
|
|
5
|
+
wcPairingExpiry?: number;
|
|
6
|
+
wcLinking?: WalletDeepLink;
|
|
7
|
+
wcError?: boolean;
|
|
8
|
+
pressedWallet?: WcWallet;
|
|
9
|
+
recentWallets?: WcWallet[];
|
|
10
|
+
}
|
|
11
|
+
export declare const WcController: {
|
|
12
|
+
state: WcControllerState;
|
|
13
|
+
subscribeKey<K extends keyof WcControllerState>(key: K, callback: (value: WcControllerState[K]) => void): () => void;
|
|
14
|
+
setWcLinking(wcLinking: WcControllerState['wcLinking']): void;
|
|
15
|
+
removeWcLinking(): void;
|
|
16
|
+
setWcError(wcError: WcControllerState['wcError']): void;
|
|
17
|
+
setPressedWallet(wallet: WcControllerState['pressedWallet']): void;
|
|
18
|
+
removePressedWallet(): void;
|
|
19
|
+
setWcPromise(wcPromise: WcControllerState['wcPromise']): void;
|
|
20
|
+
setWcUri(wcUri: WcControllerState['wcUri']): void;
|
|
21
|
+
setRecentWallets(wallets: WcControllerState['recentWallets']): void;
|
|
22
|
+
addRecentWallet(wallet: WcWallet): Promise<void>;
|
|
23
|
+
setConnectedWallet: (wcLinking: WalletDeepLink, pressedWallet?: WcWallet) => Promise<void>;
|
|
24
|
+
clearUri(): void;
|
|
25
|
+
resetState(): void;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=WcController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WcController.d.ts","sourceRoot":"","sources":["../../../src/controllers/WcController.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAKlF,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,QAAQ,CAAC;IACzB,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAC;CAC5B;AAUD,eAAO,MAAM,YAAY;;uGAG6D,IAAI;4BAIhE,iBAAiB,CAAC,WAAW,CAAC;;wBAQlC,iBAAiB,CAAC,SAAS,CAAC;6BAIvB,iBAAiB,CAAC,eAAe,CAAC;;4BAQnC,iBAAiB,CAAC,WAAW,CAAC;oBAItC,iBAAiB,CAAC,OAAO,CAAC;8BAKhB,iBAAiB,CAAC,eAAe,CAAC;4BAI9B,QAAQ;oCAOA,cAAc,kBAAkB,QAAQ;;;CAoB/E,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ModalController, type ModalControllerArguments, type ModalControllerState } from './controllers/ModalController';
|
|
2
2
|
export { RouterController, type RouterControllerState } from './controllers/RouterController';
|
|
3
|
-
export {
|
|
3
|
+
export { WcController, type WcControllerState } from './controllers/WcController';
|
|
4
4
|
export { ConnectionsController, type ConnectionsControllerState } from './controllers/ConnectionsController';
|
|
5
5
|
export { SnackController, type SnackControllerState } from './controllers/SnackController';
|
|
6
6
|
export { ApiController, type ApiControllerState } from './controllers/ApiController';
|
|
@@ -21,6 +21,5 @@ 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 {
|
|
25
|
-
export type * from './utils/TypeUtil';
|
|
24
|
+
export { WalletUtil } from './utils/WalletUtil';
|
|
26
25
|
//# 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,
|
|
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,EAAE,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE9F,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAErF,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,EACjC,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAExF,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAG9F,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { WcWallet } from '
|
|
1
|
+
import type { AppKitNetwork, WcWallet } from '@reown/appkit-common-react-native';
|
|
2
2
|
export declare const AssetUtil: {
|
|
3
|
-
getWalletImage(wallet?: WcWallet): string | undefined;
|
|
4
|
-
|
|
3
|
+
getWalletImage(wallet?: WcWallet, walletImages?: Record<string, string>): string | undefined;
|
|
4
|
+
getNetworkImage(network?: AppKitNetwork, networkImages?: Record<string, string>): string | undefined;
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=AssetUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/AssetUtil.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AssetUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/AssetUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAEjF,eAAO,MAAM,SAAS;4BACI,QAAQ,iBAAiB,OAAO,MAAM,EAAE,MAAM,CAAC;8BAY7C,aAAa,kBAAkB,OAAO,MAAM,EAAE,MAAM,CAAC;CAWhF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConstantsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/ConstantsUtil.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BlockchainAdapter, type Balance, type CaipAddress, type CaipNetwork, type ChainNamespace, type SocialProvider, type LinkingRecord } from '@reown/appkit-common-react-native';
|
|
2
|
-
import type { DataWallet, SdkVersion } from './TypeUtil';
|
|
1
|
+
import { BlockchainAdapter, type Balance, type CaipAddress, type CaipNetwork, type ChainNamespace, type SocialProvider, type LinkingRecord, type DataWallet, type SdkVersion } from '@reown/appkit-common-react-native';
|
|
3
2
|
export declare const CoreHelperUtil: {
|
|
4
3
|
isPairingExpired(expiry?: number): boolean;
|
|
5
4
|
isAllowedRetry(lastRetry: number): boolean;
|
|
@@ -38,5 +37,6 @@ export declare const CoreHelperUtil: {
|
|
|
38
37
|
sortNetworks(approvedCaipNetworkIds: `${string}:${string}`[] | undefined, requestedCaipNetworks?: CaipNetwork[]): CaipNetwork[];
|
|
39
38
|
debounce<F extends (...args: any[]) => any>(func: F, wait: number): (...args: Parameters<F>) => void;
|
|
40
39
|
generateSdkVersion(adapters: BlockchainAdapter[], version: string): SdkVersion;
|
|
40
|
+
getRequestedCaipNetworkIds(): `${string}:${string}`[];
|
|
41
41
|
};
|
|
42
42
|
//# sourceMappingURL=CoreHelperUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreHelperUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/CoreHelperUtil.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,iBAAiB,EAGjB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"CoreHelperUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/CoreHelperUtil.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,iBAAiB,EAGjB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,UAAU,EAChB,MAAM,mCAAmC,CAAC;AA+B3C,eAAO,MAAM,cAAc;8BACC,MAAM;8BAIN,MAAM;;8BAQN,WAAW,GAAG,SAAS;iCAIpB,WAAW,GAAG,SAAS;uBAI3B,MAAM;mBAMhB,MAAM;wBAID,MAAM;4BAQF,MAAM,SAAS,MAAM,GAAG,aAAa;+BA2BlC,MAAM,SAAS,MAAM,aAAa,cAAc,GAAG,aAAa;kBAyBvE,MAAM;2BAQH,MAAM,GAAG,SAAS,UAAU,MAAM,GAAG,SAAS;uBAgBlD,MAAM,cAAa,cAAc,GAAc,OAAO;;;;;;;;sBAmFvD,GAAG,GAAG,MAAM;2BAYD,UAAU,GAAG,QAAQ,OAAO,CAAC;wBAiBtC,MAAM;yBAIL,QAAQ,OAAO,CAAC,EAAE;;;;;;;sCAUL,OAAO,EAAE;;;;yCAiBjB,GAAG,MAAM,IAAI,MAAM,EAAE,EAAE,GAAG,SAAS,0BACpC,WAAW,EAAE;iCAiBT,GAAG,EAAE,KAAK,GAAG,iBAAiB,MAAM;iCAcpC,iBAAiB,EAAE,WAAW,MAAM,GAAG,UAAU;;CAsB/E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/EventUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"EventUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/EventUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE5E,eAAO,MAAM,SAAS;8BACM,QAAQ,cAAc,OAAO,GAAG,QAAQ,GAAG,SAAS;CAkB/E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FetchUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/FetchUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
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;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;IAgBtE,OAAO,CAAC,SAAS;YAsCH,eAAe;CA2B9B"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type SocialProvider, type ConnectorType, type ChainNamespace, type WalletDeepLink } from '@reown/appkit-common-react-native';
|
|
1
|
+
import { type OnRampCountry, type OnRampFiatCurrency, type OnRampFiatLimit, type OnRampServiceProvider, type OnRampCountryDefaults, type WcWallet, type ConnectorType, type ChainNamespace, type WalletDeepLink } from '@reown/appkit-common-react-native';
|
|
3
2
|
export declare const StorageUtil: {
|
|
4
3
|
setWalletConnectDeepLink({ href, name }: WalletDeepLink): void;
|
|
5
4
|
getWalletConnectDeepLink(): Promise<WalletDeepLink | undefined>;
|
|
@@ -16,12 +15,6 @@ export declare const StorageUtil: {
|
|
|
16
15
|
namespaces: string[];
|
|
17
16
|
}[]>;
|
|
18
17
|
removeConnectedConnectors(type: ConnectorType): Promise<void>;
|
|
19
|
-
setConnectedWalletImageUrl(url: string): Promise<void>;
|
|
20
|
-
getConnectedWalletImageUrl(): Promise<any>;
|
|
21
|
-
removeConnectedWalletImageUrl(): Promise<void>;
|
|
22
|
-
setConnectedSocialProvider(provider: SocialProvider): Promise<void>;
|
|
23
|
-
getConnectedSocialProvider(): Promise<SocialProvider | undefined>;
|
|
24
|
-
removeConnectedSocialProvider(): Promise<void>;
|
|
25
18
|
setOnRampPreferredCountry(country: OnRampCountry): Promise<void>;
|
|
26
19
|
getOnRampPreferredCountry(): Promise<OnRampCountry | undefined>;
|
|
27
20
|
setOnRampPreferredFiatCurrency(currency: OnRampFiatCurrency): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/StorageUtil.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
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;8BA0BN,QAAQ,EAAE;wBAWhB,QAAQ,QAAQ,EAAE,CAAC;;cAkBrC,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;;kDAyBC,qBAAqB,EAAE;;gDAsCzB,qBAAqB,EAAE;;oCAuCnC,eAAe,EAAE;;4CAsCT,kBAAkB,EAAE;;mCAsC7B,cAAc;;;CAyCpD,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Balance } from '@reown/appkit-common-react-native';
|
|
2
|
-
import type { BlockchainApiSwapAllowanceRequest, SwapTokenWithBalance } from './TypeUtil';
|
|
1
|
+
import type { Balance, BlockchainApiSwapAllowanceRequest, SwapTokenWithBalance } from '@reown/appkit-common-react-native';
|
|
3
2
|
export declare const SwapApiUtil: {
|
|
4
3
|
getTokenList(): Promise<SwapTokenWithBalance[]>;
|
|
5
4
|
fetchSwapAllowance({ tokenAddress, userAddress, sourceTokenAmount, sourceTokenDecimals }: Pick<BlockchainApiSwapAllowanceRequest, "tokenAddress" | "userAddress"> & {
|
|
@@ -7,6 +6,6 @@ export declare const SwapApiUtil: {
|
|
|
7
6
|
sourceTokenDecimals: number;
|
|
8
7
|
}): Promise<boolean>;
|
|
9
8
|
mapBalancesToSwapTokens(balances?: Balance[]): SwapTokenWithBalance[];
|
|
10
|
-
fetchGasPrice(): Promise<import("
|
|
9
|
+
fetchGasPrice(): Promise<import("@reown/appkit-common-react-native").BlockchainApiGasPriceResponse | null | undefined>;
|
|
11
10
|
};
|
|
12
11
|
//# sourceMappingURL=SwapApiUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapApiUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/SwapApiUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"SwapApiUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/SwapApiUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAEP,iCAAiC,EACjC,oBAAoB,EACrB,MAAM,mCAAmC,CAAC;AAM3C,eAAO,MAAM,WAAW;;;2BAgCD,MAAM;6BACJ,MAAM;;uCAqBM,OAAO,EAAE;;CAmC7C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type SwapTokenWithBalance } from '@reown/appkit-common-react-native';
|
|
2
2
|
export declare const SwapCalculationUtil: {
|
|
3
3
|
getGasPriceInEther(gas: bigint, gasPrice: bigint): number;
|
|
4
4
|
getGasPriceInUSD(networkPrice: string, gas: bigint, gasPrice: bigint): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapCalculationUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/SwapCalculationUtil.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwapCalculationUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/SwapCalculationUtil.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAG1F,eAAO,MAAM,mBAAmB;4BACN,MAAM,YAAY,MAAM;mCAOjB,MAAM,OAAO,MAAM,YAAY,MAAM;;2BAc/C,MAAM;+BACF,MAAM;2BACV,MAAM;uBACV,MAAM;;6BASE,MAAM,iBAAiB,MAAM;sCAOpB,MAAM;2CAOnB,MAAM,yBACF,MAAM;0DASuB,MAAM,iBAAiB,MAAM,GAAG,SAAS;wDAW1E,MAAM,sBACL,MAAM,WACjB,oBAAoB,EAAE,GAAG,SAAS;;qBAmB9B,oBAAoB,GAAG,SAAS;iBACpC,oBAAoB,GAAG,SAAS;0BACvB,MAAM;sBACV,MAAM;2BACD,MAAM;;CA6C5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/WalletUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAIlE,eAAO,MAAM,UAAU;0BACC,MAAM,KAAG,QAAQ,GAAG,SAAS;CAQpD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-core-react-native",
|
|
3
|
-
"version": "0.0.0-chore-
|
|
3
|
+
"version": "0.0.0-chore-spring-effect-20250909214820",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"types": "lib/typescript/index.d.ts",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@reown/appkit-common-react-native": "0.0.0-chore-
|
|
42
|
+
"@reown/appkit-common-react-native": "0.0.0-chore-spring-effect-20250909214820",
|
|
43
43
|
"countries-and-timezones": "3.7.2",
|
|
44
44
|
"derive-valtio": "0.2.0",
|
|
45
45
|
"valtio": "2.1.5"
|
|
@@ -4,21 +4,21 @@ import { proxy } from 'valtio';
|
|
|
4
4
|
import { CoreHelperUtil } from '../utils/CoreHelperUtil';
|
|
5
5
|
import { FetchUtil } from '../utils/FetchUtil';
|
|
6
6
|
import { StorageUtil } from '../utils/StorageUtil';
|
|
7
|
-
import
|
|
8
|
-
ApiGetAnalyticsConfigResponse,
|
|
9
|
-
ApiGetDataWalletsResponse,
|
|
10
|
-
ApiGetWalletsRequest,
|
|
11
|
-
ApiGetWalletsResponse,
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
import {
|
|
8
|
+
type ApiGetAnalyticsConfigResponse,
|
|
9
|
+
type ApiGetDataWalletsResponse,
|
|
10
|
+
type ApiGetWalletsRequest,
|
|
11
|
+
type ApiGetWalletsResponse,
|
|
12
|
+
type CustomWallet,
|
|
13
|
+
type WcWallet,
|
|
14
|
+
PresetsUtil
|
|
15
|
+
} from '@reown/appkit-common-react-native';
|
|
14
16
|
import { AssetController } from './AssetController';
|
|
15
17
|
import { OptionsController } from './OptionsController';
|
|
16
|
-
|
|
17
|
-
import { ConnectionController } from './ConnectionController';
|
|
18
|
+
import { WcController } from './WcController';
|
|
18
19
|
import { ApiUtil } from '../utils/ApiUtil';
|
|
19
20
|
import { SnackController } from './SnackController';
|
|
20
21
|
import { ConnectionsController } from './ConnectionsController';
|
|
21
|
-
import { ConstantsUtil, PresetsUtil } from '@reown/appkit-common-react-native';
|
|
22
22
|
|
|
23
23
|
// -- Helpers ------------------------------------------- //
|
|
24
24
|
const baseUrl = CoreHelperUtil.getApiUrl();
|
|
@@ -85,14 +85,6 @@ export const ApiController = {
|
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
|
|
88
|
-
async _fetchConnectorImage(imageId: string) {
|
|
89
|
-
const headers = ApiController._getApiHeaders();
|
|
90
|
-
const url = await api.fetchImage(`/public/getAssetImage/${imageId}`, headers);
|
|
91
|
-
if (url) {
|
|
92
|
-
AssetController.setConnectorImage(imageId, url);
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
|
|
96
88
|
async _fetchNetworkImage(networkId: string) {
|
|
97
89
|
const imageId = PresetsUtil.NetworkImageIds[networkId];
|
|
98
90
|
if (!imageId) {
|
|
@@ -106,14 +98,6 @@ export const ApiController = {
|
|
|
106
98
|
}
|
|
107
99
|
},
|
|
108
100
|
|
|
109
|
-
async fetchConnectorImages() {
|
|
110
|
-
const connectors = [{ imageId: ConstantsUtil.WALLET_CONNECT_IMAGE_ID }];
|
|
111
|
-
const ids = connectors.map(({ imageId }) => imageId).filter(Boolean);
|
|
112
|
-
await CoreHelperUtil.allSettled(
|
|
113
|
-
(ids as string[]).map(id => ApiController._fetchConnectorImage(id))
|
|
114
|
-
);
|
|
115
|
-
},
|
|
116
|
-
|
|
117
101
|
async fetchNetworkImages() {
|
|
118
102
|
const networks = ConnectionsController.state.networks;
|
|
119
103
|
if (networks) {
|
|
@@ -124,59 +108,111 @@ export const ApiController = {
|
|
|
124
108
|
},
|
|
125
109
|
|
|
126
110
|
async fetchInstalledWallets() {
|
|
127
|
-
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
path,
|
|
131
|
-
headers: ApiController._getApiHeaders()
|
|
132
|
-
});
|
|
111
|
+
// Add timeout to prevent hanging
|
|
112
|
+
const controller = new AbortController();
|
|
113
|
+
let timeoutId: NodeJS.Timeout | undefined;
|
|
133
114
|
|
|
134
|
-
|
|
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
|
+
});
|
|
135
122
|
|
|
136
|
-
|
|
123
|
+
if (!response) return;
|
|
137
124
|
|
|
138
|
-
|
|
139
|
-
walletData = walletData.filter(({ id }) => includeWalletIds.includes(id));
|
|
140
|
-
}
|
|
125
|
+
let { data: walletData } = response;
|
|
141
126
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
isInstalled: await CoreHelperUtil.checkInstalled(item)
|
|
146
|
-
};
|
|
147
|
-
});
|
|
127
|
+
if (includeWalletIds?.length) {
|
|
128
|
+
walletData = walletData.filter(({ id }) => includeWalletIds.includes(id));
|
|
129
|
+
}
|
|
148
130
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
131
|
+
const promises = walletData.map(async item => {
|
|
132
|
+
return {
|
|
133
|
+
id: item.id,
|
|
134
|
+
isInstalled: await CoreHelperUtil.checkInstalled(item)
|
|
135
|
+
};
|
|
136
|
+
});
|
|
152
137
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
page: '1',
|
|
159
|
-
platform: this.platform(),
|
|
160
|
-
entries: installed?.length.toString(),
|
|
161
|
-
include: installed?.join(','),
|
|
162
|
-
exclude: excludeWalletIds?.join(',')
|
|
163
|
-
}
|
|
138
|
+
const customPromises = customWallets?.map(async item => {
|
|
139
|
+
return {
|
|
140
|
+
id: item.id,
|
|
141
|
+
isInstalled: await CoreHelperUtil.checkInstalled(item)
|
|
142
|
+
};
|
|
164
143
|
});
|
|
165
144
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
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
|
+
}
|
|
191
|
+
|
|
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);
|
|
173
203
|
}
|
|
204
|
+
} catch (error) {
|
|
205
|
+
state.installed = [];
|
|
206
|
+
clearTimeout(timeoutId);
|
|
207
|
+
// eslint-disable-next-line no-console
|
|
208
|
+
console.log('Error fetching installed wallets', error);
|
|
174
209
|
}
|
|
175
210
|
},
|
|
176
211
|
|
|
177
212
|
async fetchFeaturedWallets() {
|
|
178
213
|
const { featuredWalletIds } = OptionsController.state;
|
|
179
214
|
const exclude = state.installed.map(({ id }) => id);
|
|
215
|
+
const chains = CoreHelperUtil.getRequestedCaipNetworkIds();
|
|
180
216
|
|
|
181
217
|
if (featuredWalletIds?.length) {
|
|
182
218
|
const response = await api.get<ApiGetWalletsResponse>({
|
|
@@ -189,7 +225,8 @@ export const ApiController = {
|
|
|
189
225
|
? String(featuredWalletIds.length)
|
|
190
226
|
: recommendedEntries,
|
|
191
227
|
include: featuredWalletIds?.join(','),
|
|
192
|
-
exclude: exclude?.join(',')
|
|
228
|
+
exclude: exclude?.join(','),
|
|
229
|
+
chains: chains.join(',')
|
|
193
230
|
}
|
|
194
231
|
});
|
|
195
232
|
if (!response) return;
|
|
@@ -221,6 +258,7 @@ export const ApiController = {
|
|
|
221
258
|
async fetchRecommendedWallets() {
|
|
222
259
|
const { installed } = ApiController.state;
|
|
223
260
|
const { includeWalletIds, excludeWalletIds, featuredWalletIds } = OptionsController.state;
|
|
261
|
+
const chains = CoreHelperUtil.getRequestedCaipNetworkIds();
|
|
224
262
|
|
|
225
263
|
const exclude = [
|
|
226
264
|
...installed.map(({ id }) => id),
|
|
@@ -236,7 +274,8 @@ export const ApiController = {
|
|
|
236
274
|
platform: this.platform(),
|
|
237
275
|
entries: recommendedEntries,
|
|
238
276
|
include: includeWalletIds?.join(','),
|
|
239
|
-
exclude: exclude?.join(',')
|
|
277
|
+
exclude: exclude?.join(','),
|
|
278
|
+
chains: chains.join(',')
|
|
240
279
|
}
|
|
241
280
|
});
|
|
242
281
|
|
|
@@ -259,6 +298,7 @@ export const ApiController = {
|
|
|
259
298
|
|
|
260
299
|
async fetchWallets({ page }: Pick<ApiGetWalletsRequest, 'page'>) {
|
|
261
300
|
const { includeWalletIds, excludeWalletIds, featuredWalletIds } = OptionsController.state;
|
|
301
|
+
const chains = CoreHelperUtil.getRequestedCaipNetworkIds();
|
|
262
302
|
const exclude = [
|
|
263
303
|
...state.installed.map(({ id }) => id),
|
|
264
304
|
...state.recommended.map(({ id }) => id),
|
|
@@ -273,7 +313,8 @@ export const ApiController = {
|
|
|
273
313
|
platform: this.platform(),
|
|
274
314
|
entries: String(defaultEntries),
|
|
275
315
|
include: includeWalletIds?.join(','),
|
|
276
|
-
exclude: exclude.join(',')
|
|
316
|
+
exclude: exclude.join(','),
|
|
317
|
+
chains: chains.join(',')
|
|
277
318
|
}
|
|
278
319
|
});
|
|
279
320
|
|
|
@@ -296,6 +337,7 @@ export const ApiController = {
|
|
|
296
337
|
|
|
297
338
|
async searchWallet({ search }: Pick<ApiGetWalletsRequest, 'search'>) {
|
|
298
339
|
const { includeWalletIds, excludeWalletIds } = OptionsController.state;
|
|
340
|
+
const chains = CoreHelperUtil.getRequestedCaipNetworkIds();
|
|
299
341
|
state.search = [];
|
|
300
342
|
const response = await api.get<ApiGetWalletsResponse>({
|
|
301
343
|
path: '/getWallets',
|
|
@@ -306,7 +348,8 @@ export const ApiController = {
|
|
|
306
348
|
entries: String(defaultEntries),
|
|
307
349
|
search,
|
|
308
350
|
include: includeWalletIds?.join(','),
|
|
309
|
-
exclude: excludeWalletIds?.join(',')
|
|
351
|
+
exclude: excludeWalletIds?.join(','),
|
|
352
|
+
chains: chains.join(',')
|
|
310
353
|
}
|
|
311
354
|
});
|
|
312
355
|
|
|
@@ -341,7 +384,7 @@ export const ApiController = {
|
|
|
341
384
|
|
|
342
385
|
if (update) {
|
|
343
386
|
await StorageUtil.setRecentWallets(updatedRecent);
|
|
344
|
-
|
|
387
|
+
WcController.setRecentWallets(updatedRecent);
|
|
345
388
|
}
|
|
346
389
|
},
|
|
347
390
|
|
|
@@ -349,20 +392,22 @@ export const ApiController = {
|
|
|
349
392
|
try {
|
|
350
393
|
state.prefetchError = false;
|
|
351
394
|
state.prefetchLoading = true;
|
|
352
|
-
// this fetch must resolve first so we filter them in the other wallet requests
|
|
353
|
-
await ApiController.fetchInstalledWallets();
|
|
354
395
|
|
|
355
396
|
const promises = [
|
|
356
|
-
ApiController.fetchFeaturedWallets(),
|
|
357
|
-
ApiController.fetchRecommendedWallets(),
|
|
358
397
|
ApiController.fetchNetworkImages(),
|
|
359
|
-
ApiController.fetchConnectorImages(),
|
|
360
398
|
ApiController.fetchCustomWalletImages()
|
|
361
399
|
];
|
|
400
|
+
|
|
362
401
|
if (OptionsController.state.enableAnalytics === undefined) {
|
|
363
402
|
promises.push(ApiController.fetchAnalyticsConfig());
|
|
364
403
|
}
|
|
365
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
|
+
|
|
366
411
|
state.prefetchPromise = Promise.race([
|
|
367
412
|
CoreHelperUtil.allSettled(promises),
|
|
368
413
|
CoreHelperUtil.wait(3000)
|
|
@@ -4,7 +4,6 @@ import { proxy } from 'valtio';
|
|
|
4
4
|
export interface AssetControllerState {
|
|
5
5
|
walletImages: Record<string, string>;
|
|
6
6
|
networkImages: Record<string, string>;
|
|
7
|
-
connectorImages: Record<string, string>;
|
|
8
7
|
tokenImages: Record<string, string>;
|
|
9
8
|
}
|
|
10
9
|
|
|
@@ -12,7 +11,6 @@ export interface AssetControllerState {
|
|
|
12
11
|
const state = proxy<AssetControllerState>({
|
|
13
12
|
walletImages: {},
|
|
14
13
|
networkImages: {},
|
|
15
|
-
connectorImages: {},
|
|
16
14
|
tokenImages: {}
|
|
17
15
|
});
|
|
18
16
|
|
|
@@ -28,10 +26,6 @@ export const AssetController = {
|
|
|
28
26
|
state.networkImages[key] = value;
|
|
29
27
|
},
|
|
30
28
|
|
|
31
|
-
setConnectorImage(key: string, value: string) {
|
|
32
|
-
state.connectorImages[key] = value;
|
|
33
|
-
},
|
|
34
|
-
|
|
35
29
|
setTokenImage(key: string, value: string) {
|
|
36
30
|
state.tokenImages[key] = value;
|
|
37
31
|
}
|
|
@@ -33,12 +33,13 @@ import type {
|
|
|
33
33
|
BlockchainApiOnRampWidgetRequest,
|
|
34
34
|
BlockchainApiOnRampQuotesRequest,
|
|
35
35
|
OnRampFiatLimit,
|
|
36
|
-
OnRampCountryDefaults
|
|
37
|
-
|
|
36
|
+
OnRampCountryDefaults,
|
|
37
|
+
CaipAddress,
|
|
38
|
+
CaipNetworkId
|
|
39
|
+
} from '@reown/appkit-common-react-native';
|
|
38
40
|
import { OptionsController } from './OptionsController';
|
|
39
41
|
import { ConstantsUtil } from '../utils/ConstantsUtil';
|
|
40
42
|
import { ApiUtil } from '../utils/ApiUtil';
|
|
41
|
-
import type { CaipAddress, CaipNetworkId } from '@reown/appkit-common-react-native';
|
|
42
43
|
|
|
43
44
|
import { SnackController } from './SnackController';
|
|
44
45
|
|
|
@@ -117,8 +118,8 @@ export const BlockchainApiController = {
|
|
|
117
118
|
},
|
|
118
119
|
|
|
119
120
|
async fetchTransactions(params: BlockchainApiTransactionsRequest) {
|
|
120
|
-
const { account, projectId, cursor,
|
|
121
|
-
const isSupported =
|
|
121
|
+
const { account, projectId, cursor, signal, cache, chainId } = params;
|
|
122
|
+
const isSupported = ConstantsUtil.ACTIVITY_SUPPORTED_CHAINS.includes(chainId);
|
|
122
123
|
|
|
123
124
|
if (!isSupported) {
|
|
124
125
|
return { data: [], next: undefined };
|
|
@@ -130,7 +131,6 @@ export const BlockchainApiController = {
|
|
|
130
131
|
params: {
|
|
131
132
|
projectId,
|
|
132
133
|
cursor,
|
|
133
|
-
onramp,
|
|
134
134
|
chainId
|
|
135
135
|
},
|
|
136
136
|
signal,
|