@reown/appkit-core-react-native 2.0.0-alpha.2 → 2.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/controllers/ApiController.js +56 -30
- 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 +0 -2
- package/lib/commonjs/controllers/BlockchainApiController.js.map +1 -1
- package/lib/commonjs/controllers/ConnectionsController.js +0 -15
- package/lib/commonjs/controllers/ConnectionsController.js.map +1 -1
- package/lib/commonjs/controllers/OnRampController.js +3 -3
- 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 +8 -2
- package/lib/commonjs/controllers/RouterController.js.map +1 -1
- package/lib/commonjs/controllers/SwapController.js +3 -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 -7
- 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.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 +56 -29
- 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 +0 -2
- package/lib/module/controllers/BlockchainApiController.js.map +1 -1
- package/lib/module/controllers/ConnectionsController.js +0 -15
- package/lib/module/controllers/ConnectionsController.js.map +1 -1
- package/lib/module/controllers/OnRampController.js +1 -1
- 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 +8 -2
- package/lib/module/controllers/RouterController.js.map +1 -1
- package/lib/module/controllers/SwapController.js +3 -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 -1
- 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.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.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/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 -6
- 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 -2
- 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 +61 -36
- package/src/controllers/AssetController.ts +0 -6
- package/src/controllers/BlockchainApiController.ts +5 -5
- package/src/controllers/ConnectionsController.ts +0 -22
- package/src/controllers/EnsController.ts +1 -1
- package/src/controllers/EventsController.ts +1 -1
- package/src/controllers/OnRampController.ts +1 -1
- package/src/controllers/OptionsController.ts +17 -8
- package/src/controllers/RouterController.ts +20 -8
- package/src/controllers/SwapController.ts +4 -3
- package/src/controllers/WcController.ts +93 -0
- package/src/index.ts +3 -6
- package/src/utils/AssetUtil.ts +11 -8
- package/src/utils/ConstantsUtil.ts +1 -2
- 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/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/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/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/TypeUtil.ts +0 -899
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouterController.d.ts","sourceRoot":"","sources":["../../../src/controllers/RouterController.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"RouterController.d.ts","sourceRoot":"","sources":["../../../src/controllers/RouterController.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,QAAQ,EACR,uBAAuB,EACxB,MAAM,mCAAmC,CAAC;AAG3C,MAAM,WAAW,qBAAqB;IACpC,IAAI,EACA,SAAS,GACT,gBAAgB,GAChB,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,oBAAoB,GACpB,gBAAgB,GAChB,kBAAkB,GAClB,yBAAyB,GACzB,WAAW,GACX,UAAU,GACV,QAAQ,GACR,gBAAgB,GAChB,eAAe,GACf,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,MAAM,GACN,aAAa,GACb,cAAc,GACd,kBAAkB,GAClB,oBAAoB,GACpB,0BAA0B,GAC1B,eAAe,GACf,YAAY,GACZ,mBAAmB,GACnB,uBAAuB,GACvB,gBAAgB,GAChB,eAAe,CAAC;IACpB,OAAO,EAAE,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC;IACzC,mBAAmB,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IACrD,IAAI,CAAC,EAAE;QACL,MAAM,CAAC,EAAE,QAAQ,CAAC;QAClB,OAAO,CAAC,EAAE,aAAa,CAAC;QACxB,YAAY,CAAC,EAAE,uBAAuB,CAAC;QACvC,cAAc,CAAC,EAAE,cAAc,CAAC;KACjC,CAAC;CACH;AAUD,eAAO,MAAM,gBAAgB;;eAInB,qBAAqB,CAAC,MAAM,CAAC,SAC5B,qBAAqB,CAAC,MAAM,CAAC,cACzB,SAAS,GAAG,UAAU;gBAUvB,qBAAqB,CAAC,MAAM,CAAC,SAAS,qBAAqB,CAAC,MAAM,CAAC;kBAOjE,qBAAqB,CAAC,MAAM,CAAC,SAAS,qBAAqB,CAAC,MAAM,CAAC;;gCAoBrD,MAAM;CAUnC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type CaipAddress } from '@reown/appkit-common-react-native';
|
|
2
|
-
import type { SwapInputTarget, SwapTokenWithBalance } from '../utils/TypeUtil';
|
|
1
|
+
import { type CaipAddress, type SwapInputTarget, type SwapTokenWithBalance } from '@reown/appkit-common-react-native';
|
|
3
2
|
export declare const INITIAL_GAS_LIMIT = 150000;
|
|
4
3
|
export declare const TO_AMOUNT_DECIMALS = 6;
|
|
5
4
|
type TransactionParams = {
|
|
@@ -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';
|
|
@@ -22,5 +22,5 @@ export { CoreHelperUtil } from './utils/CoreHelperUtil';
|
|
|
22
22
|
export { StorageUtil } from './utils/StorageUtil';
|
|
23
23
|
export { EventUtil } from './utils/EventUtil';
|
|
24
24
|
export { RouterUtil } from './utils/RouterUtil';
|
|
25
|
-
export
|
|
25
|
+
export { WalletUtil } from './utils/WalletUtil';
|
|
26
26
|
//# 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;AAChD,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0RzB,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": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.4",
|
|
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": "2.0.0-alpha.
|
|
42
|
+
"@reown/appkit-common-react-native": "2.0.0-alpha.4",
|
|
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,7 +108,7 @@ export const ApiController = {
|
|
|
124
108
|
},
|
|
125
109
|
|
|
126
110
|
async fetchInstalledWallets() {
|
|
127
|
-
const { includeWalletIds } = OptionsController.state;
|
|
111
|
+
const { includeWalletIds, customWallets } = OptionsController.state;
|
|
128
112
|
const path = Platform.select({ default: 'getIosData', android: 'getAndroidData' });
|
|
129
113
|
const response = await api.get<ApiGetDataWalletsResponse>({
|
|
130
114
|
path,
|
|
@@ -146,10 +130,20 @@ export const ApiController = {
|
|
|
146
130
|
};
|
|
147
131
|
});
|
|
148
132
|
|
|
133
|
+
const customPromises = customWallets?.map(async item => {
|
|
134
|
+
return {
|
|
135
|
+
id: item.id,
|
|
136
|
+
isInstalled: await CoreHelperUtil.checkInstalled(item)
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
|
|
149
140
|
const results = await Promise.all(promises);
|
|
150
141
|
const installed = results.filter(({ isInstalled }) => isInstalled).map(({ id }) => id);
|
|
151
142
|
const { excludeWalletIds } = OptionsController.state;
|
|
143
|
+
const chains = CoreHelperUtil.getRequestedCaipNetworkIds();
|
|
152
144
|
|
|
145
|
+
// Collect API-sourced installed wallets
|
|
146
|
+
let apiInstalledWallets: WcWallet[] = [];
|
|
153
147
|
if (installed.length > 0) {
|
|
154
148
|
const walletResponse = await api.get<ApiGetWalletsResponse>({
|
|
155
149
|
path: '/getWallets',
|
|
@@ -159,7 +153,8 @@ export const ApiController = {
|
|
|
159
153
|
platform: this.platform(),
|
|
160
154
|
entries: installed?.length.toString(),
|
|
161
155
|
include: installed?.join(','),
|
|
162
|
-
exclude: excludeWalletIds?.join(',')
|
|
156
|
+
exclude: excludeWalletIds?.join(','),
|
|
157
|
+
chains: chains.join(',')
|
|
163
158
|
}
|
|
164
159
|
});
|
|
165
160
|
|
|
@@ -168,15 +163,39 @@ export const ApiController = {
|
|
|
168
163
|
await CoreHelperUtil.allSettled(
|
|
169
164
|
(walletImages as string[]).map(id => ApiController._fetchWalletImage(id))
|
|
170
165
|
);
|
|
171
|
-
|
|
172
|
-
this.updateRecentWalletsInfo(walletResponse.data);
|
|
166
|
+
apiInstalledWallets = walletResponse.data;
|
|
173
167
|
}
|
|
174
168
|
}
|
|
169
|
+
|
|
170
|
+
// Collect custom installed wallets
|
|
171
|
+
let customInstalledWallets: CustomWallet[] = [];
|
|
172
|
+
if (customPromises?.length) {
|
|
173
|
+
const customResults = await Promise.all(customPromises);
|
|
174
|
+
const customInstalled = customResults
|
|
175
|
+
.filter(({ isInstalled }) => isInstalled)
|
|
176
|
+
.map(({ id }) => id);
|
|
177
|
+
customInstalledWallets =
|
|
178
|
+
customWallets?.filter(wallet => customInstalled.includes(wallet.id)) ?? [];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Merge and de-duplicate by id, preserving order (API first, then custom)
|
|
182
|
+
const byId = new Map<string, WcWallet>();
|
|
183
|
+
[...apiInstalledWallets, ...customInstalledWallets].forEach(wallet => {
|
|
184
|
+
if (!byId.has(wallet.id)) {
|
|
185
|
+
byId.set(wallet.id, wallet);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
const combinedInstalled = Array.from(byId.values());
|
|
189
|
+
state.installed = combinedInstalled;
|
|
190
|
+
if (combinedInstalled.length) {
|
|
191
|
+
this.updateRecentWalletsInfo(combinedInstalled);
|
|
192
|
+
}
|
|
175
193
|
},
|
|
176
194
|
|
|
177
195
|
async fetchFeaturedWallets() {
|
|
178
196
|
const { featuredWalletIds } = OptionsController.state;
|
|
179
197
|
const exclude = state.installed.map(({ id }) => id);
|
|
198
|
+
const chains = CoreHelperUtil.getRequestedCaipNetworkIds();
|
|
180
199
|
|
|
181
200
|
if (featuredWalletIds?.length) {
|
|
182
201
|
const response = await api.get<ApiGetWalletsResponse>({
|
|
@@ -189,7 +208,8 @@ export const ApiController = {
|
|
|
189
208
|
? String(featuredWalletIds.length)
|
|
190
209
|
: recommendedEntries,
|
|
191
210
|
include: featuredWalletIds?.join(','),
|
|
192
|
-
exclude: exclude?.join(',')
|
|
211
|
+
exclude: exclude?.join(','),
|
|
212
|
+
chains: chains.join(',')
|
|
193
213
|
}
|
|
194
214
|
});
|
|
195
215
|
if (!response) return;
|
|
@@ -221,6 +241,7 @@ export const ApiController = {
|
|
|
221
241
|
async fetchRecommendedWallets() {
|
|
222
242
|
const { installed } = ApiController.state;
|
|
223
243
|
const { includeWalletIds, excludeWalletIds, featuredWalletIds } = OptionsController.state;
|
|
244
|
+
const chains = CoreHelperUtil.getRequestedCaipNetworkIds();
|
|
224
245
|
|
|
225
246
|
const exclude = [
|
|
226
247
|
...installed.map(({ id }) => id),
|
|
@@ -236,7 +257,8 @@ export const ApiController = {
|
|
|
236
257
|
platform: this.platform(),
|
|
237
258
|
entries: recommendedEntries,
|
|
238
259
|
include: includeWalletIds?.join(','),
|
|
239
|
-
exclude: exclude?.join(',')
|
|
260
|
+
exclude: exclude?.join(','),
|
|
261
|
+
chains: chains.join(',')
|
|
240
262
|
}
|
|
241
263
|
});
|
|
242
264
|
|
|
@@ -259,6 +281,7 @@ export const ApiController = {
|
|
|
259
281
|
|
|
260
282
|
async fetchWallets({ page }: Pick<ApiGetWalletsRequest, 'page'>) {
|
|
261
283
|
const { includeWalletIds, excludeWalletIds, featuredWalletIds } = OptionsController.state;
|
|
284
|
+
const chains = CoreHelperUtil.getRequestedCaipNetworkIds();
|
|
262
285
|
const exclude = [
|
|
263
286
|
...state.installed.map(({ id }) => id),
|
|
264
287
|
...state.recommended.map(({ id }) => id),
|
|
@@ -273,7 +296,8 @@ export const ApiController = {
|
|
|
273
296
|
platform: this.platform(),
|
|
274
297
|
entries: String(defaultEntries),
|
|
275
298
|
include: includeWalletIds?.join(','),
|
|
276
|
-
exclude: exclude.join(',')
|
|
299
|
+
exclude: exclude.join(','),
|
|
300
|
+
chains: chains.join(',')
|
|
277
301
|
}
|
|
278
302
|
});
|
|
279
303
|
|
|
@@ -296,6 +320,7 @@ export const ApiController = {
|
|
|
296
320
|
|
|
297
321
|
async searchWallet({ search }: Pick<ApiGetWalletsRequest, 'search'>) {
|
|
298
322
|
const { includeWalletIds, excludeWalletIds } = OptionsController.state;
|
|
323
|
+
const chains = CoreHelperUtil.getRequestedCaipNetworkIds();
|
|
299
324
|
state.search = [];
|
|
300
325
|
const response = await api.get<ApiGetWalletsResponse>({
|
|
301
326
|
path: '/getWallets',
|
|
@@ -306,7 +331,8 @@ export const ApiController = {
|
|
|
306
331
|
entries: String(defaultEntries),
|
|
307
332
|
search,
|
|
308
333
|
include: includeWalletIds?.join(','),
|
|
309
|
-
exclude: excludeWalletIds?.join(',')
|
|
334
|
+
exclude: excludeWalletIds?.join(','),
|
|
335
|
+
chains: chains.join(',')
|
|
310
336
|
}
|
|
311
337
|
});
|
|
312
338
|
|
|
@@ -341,7 +367,7 @@ export const ApiController = {
|
|
|
341
367
|
|
|
342
368
|
if (update) {
|
|
343
369
|
await StorageUtil.setRecentWallets(updatedRecent);
|
|
344
|
-
|
|
370
|
+
WcController.setRecentWallets(updatedRecent);
|
|
345
371
|
}
|
|
346
372
|
},
|
|
347
373
|
|
|
@@ -356,7 +382,6 @@ export const ApiController = {
|
|
|
356
382
|
ApiController.fetchFeaturedWallets(),
|
|
357
383
|
ApiController.fetchRecommendedWallets(),
|
|
358
384
|
ApiController.fetchNetworkImages(),
|
|
359
|
-
ApiController.fetchConnectorImages(),
|
|
360
385
|
ApiController.fetchCustomWalletImages()
|
|
361
386
|
];
|
|
362
387
|
if (OptionsController.state.enableAnalytics === undefined) {
|
|
@@ -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,7 +118,7 @@ export const BlockchainApiController = {
|
|
|
117
118
|
},
|
|
118
119
|
|
|
119
120
|
async fetchTransactions(params: BlockchainApiTransactionsRequest) {
|
|
120
|
-
const { account, projectId, cursor,
|
|
121
|
+
const { account, projectId, cursor, signal, cache, chainId } = params;
|
|
121
122
|
const isSupported = await BlockchainApiController.isNetworkSupported(chainId);
|
|
122
123
|
|
|
123
124
|
if (!isSupported) {
|
|
@@ -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,
|
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
import { StorageUtil } from '../utils/StorageUtil';
|
|
19
19
|
import { BlockchainApiController } from './BlockchainApiController';
|
|
20
20
|
import { SnackController } from './SnackController';
|
|
21
|
-
import { OptionsController } from './OptionsController';
|
|
22
21
|
import { CoreHelperUtil } from '../utils/CoreHelperUtil';
|
|
23
22
|
|
|
24
23
|
// -- Types --------------------------------------------- //
|
|
@@ -132,27 +131,6 @@ const derivedState = derive(
|
|
|
132
131
|
return undefined;
|
|
133
132
|
}
|
|
134
133
|
|
|
135
|
-
// Check if there's a specific token configured in OptionsController
|
|
136
|
-
const configuredTokens = OptionsController.state.tokens;
|
|
137
|
-
const activeNetwork = snap.networks.find(
|
|
138
|
-
network =>
|
|
139
|
-
network.chainNamespace === snap.activeNamespace &&
|
|
140
|
-
network.id?.toString() === connection.caipNetwork?.split(':')[1]
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
if (configuredTokens && activeNetwork) {
|
|
144
|
-
const configuredToken = configuredTokens[activeNetwork.caipNetworkId];
|
|
145
|
-
if (configuredToken) {
|
|
146
|
-
// Find the configured token in the balances
|
|
147
|
-
const specificToken = addressBalances.find(
|
|
148
|
-
balance => balance.address === configuredToken.address
|
|
149
|
-
);
|
|
150
|
-
if (specificToken) {
|
|
151
|
-
return specificToken;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
134
|
// Return the native token (first balance without address)
|
|
157
135
|
const nativeToken = addressBalances.find(balance => !balance.address);
|
|
158
136
|
if (nativeToken) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { subscribeKey as subKey } from 'valtio/utils';
|
|
2
2
|
import { proxy, subscribe as sub } from 'valtio';
|
|
3
3
|
import { BlockchainApiController } from './BlockchainApiController';
|
|
4
|
-
import type { BlockchainApiEnsError } from '
|
|
4
|
+
import type { BlockchainApiEnsError } from '@reown/appkit-common-react-native';
|
|
5
5
|
|
|
6
6
|
// -- Types --------------------------------------------- //
|
|
7
7
|
|
|
@@ -3,7 +3,7 @@ import { ApiController } from './ApiController';
|
|
|
3
3
|
import { OptionsController } from './OptionsController';
|
|
4
4
|
import { CoreHelperUtil } from '../utils/CoreHelperUtil';
|
|
5
5
|
import { FetchUtil } from '../utils/FetchUtil';
|
|
6
|
-
import type { Event, EventName } from '
|
|
6
|
+
import type { Event, EventName } from '@reown/appkit-common-react-native';
|
|
7
7
|
|
|
8
8
|
// -- Helpers ------------------------------------------- //
|
|
9
9
|
const baseUrl = CoreHelperUtil.getAnalyticsUrl();
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
type OnRampErrorTypeValues,
|
|
13
13
|
type OnRampCountryDefaults,
|
|
14
14
|
BlockchainOnRampError
|
|
15
|
-
} from '
|
|
15
|
+
} from '@reown/appkit-common-react-native';
|
|
16
16
|
|
|
17
17
|
import { CoreHelperUtil } from '../utils/CoreHelperUtil';
|
|
18
18
|
import { OptionsController } from './OptionsController';
|