@reown/appkit-core-react-native 1.0.2 → 1.1.1
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 +35 -1
- package/lib/commonjs/controllers/AccountController.js.map +1 -1
- package/lib/commonjs/controllers/ApiController.js +21 -9
- package/lib/commonjs/controllers/ApiController.js.map +1 -1
- package/lib/commonjs/controllers/BlockchainApiController.js +84 -0
- package/lib/commonjs/controllers/BlockchainApiController.js.map +1 -1
- package/lib/commonjs/controllers/ConnectionController.js +33 -7
- package/lib/commonjs/controllers/ConnectionController.js.map +1 -1
- package/lib/commonjs/controllers/ConnectorController.js +9 -1
- package/lib/commonjs/controllers/ConnectorController.js.map +1 -1
- package/lib/commonjs/controllers/EnsController.js +35 -0
- package/lib/commonjs/controllers/EnsController.js.map +1 -0
- package/lib/commonjs/controllers/EventsController.js +1 -15
- package/lib/commonjs/controllers/EventsController.js.map +1 -1
- package/lib/commonjs/controllers/ModalController.js +3 -1
- package/lib/commonjs/controllers/ModalController.js.map +1 -1
- package/lib/commonjs/controllers/NetworkController.js +20 -1
- package/lib/commonjs/controllers/NetworkController.js.map +1 -1
- package/lib/commonjs/controllers/OptionsController.js +14 -2
- package/lib/commonjs/controllers/OptionsController.js.map +1 -1
- package/lib/commonjs/controllers/RouterController.js +22 -1
- package/lib/commonjs/controllers/RouterController.js.map +1 -1
- package/lib/commonjs/controllers/SendController.js +176 -0
- package/lib/commonjs/controllers/SendController.js.map +1 -0
- package/lib/commonjs/controllers/SnackController.js +21 -1
- package/lib/commonjs/controllers/SnackController.js.map +1 -1
- package/lib/commonjs/controllers/SwapController.js +91 -0
- package/lib/commonjs/controllers/SwapController.js.map +1 -0
- package/lib/commonjs/controllers/TransactionsController.js +112 -0
- package/lib/commonjs/controllers/TransactionsController.js.map +1 -0
- package/lib/commonjs/controllers/WebviewController.js +52 -0
- package/lib/commonjs/controllers/WebviewController.js.map +1 -0
- package/lib/commonjs/index.js +42 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/ApiUtil.js +25 -0
- package/lib/commonjs/utils/ApiUtil.js.map +1 -0
- package/lib/commonjs/utils/ConstantsUtil.js +8 -1
- package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
- package/lib/commonjs/utils/CoreHelperUtil.js +33 -0
- package/lib/commonjs/utils/CoreHelperUtil.js.map +1 -1
- package/lib/commonjs/utils/FetchUtil.js.map +1 -1
- package/lib/commonjs/utils/StorageUtil.js +24 -0
- package/lib/commonjs/utils/StorageUtil.js.map +1 -1
- package/lib/commonjs/utils/SwapApiUtil.js +23 -0
- package/lib/commonjs/utils/SwapApiUtil.js.map +1 -0
- package/lib/commonjs/utils/SwapCalculationUtil.js +24 -0
- package/lib/commonjs/utils/SwapCalculationUtil.js.map +1 -0
- package/lib/commonjs/utils/TypeUtil.js +4 -0
- package/lib/module/controllers/AccountController.js +35 -1
- package/lib/module/controllers/AccountController.js.map +1 -1
- package/lib/module/controllers/ApiController.js +21 -9
- package/lib/module/controllers/ApiController.js.map +1 -1
- package/lib/module/controllers/BlockchainApiController.js +84 -0
- package/lib/module/controllers/BlockchainApiController.js.map +1 -1
- package/lib/module/controllers/ConnectionController.js +33 -7
- package/lib/module/controllers/ConnectionController.js.map +1 -1
- package/lib/module/controllers/ConnectorController.js +9 -1
- package/lib/module/controllers/ConnectorController.js.map +1 -1
- package/lib/module/controllers/EnsController.js +30 -0
- package/lib/module/controllers/EnsController.js.map +1 -0
- package/lib/module/controllers/EventsController.js +1 -15
- package/lib/module/controllers/EventsController.js.map +1 -1
- package/lib/module/controllers/ModalController.js +3 -1
- package/lib/module/controllers/ModalController.js.map +1 -1
- package/lib/module/controllers/NetworkController.js +20 -1
- package/lib/module/controllers/NetworkController.js.map +1 -1
- package/lib/module/controllers/OptionsController.js +14 -2
- package/lib/module/controllers/OptionsController.js.map +1 -1
- package/lib/module/controllers/RouterController.js +22 -1
- package/lib/module/controllers/RouterController.js.map +1 -1
- package/lib/module/controllers/SendController.js +171 -0
- package/lib/module/controllers/SendController.js.map +1 -0
- package/lib/module/controllers/SnackController.js +21 -1
- package/lib/module/controllers/SnackController.js.map +1 -1
- package/lib/module/controllers/SwapController.js +86 -0
- package/lib/module/controllers/SwapController.js.map +1 -0
- package/lib/module/controllers/TransactionsController.js +107 -0
- package/lib/module/controllers/TransactionsController.js.map +1 -0
- package/lib/module/controllers/WebviewController.js +47 -0
- package/lib/module/controllers/WebviewController.js.map +1 -0
- package/lib/module/index.js +7 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/ApiUtil.js +19 -0
- package/lib/module/utils/ApiUtil.js.map +1 -0
- package/lib/module/utils/ConstantsUtil.js +8 -1
- package/lib/module/utils/ConstantsUtil.js.map +1 -1
- package/lib/module/utils/CoreHelperUtil.js +33 -0
- package/lib/module/utils/CoreHelperUtil.js.map +1 -1
- package/lib/module/utils/FetchUtil.js.map +1 -1
- package/lib/module/utils/StorageUtil.js +24 -0
- package/lib/module/utils/StorageUtil.js.map +1 -1
- package/lib/module/utils/SwapApiUtil.js +17 -0
- package/lib/module/utils/SwapApiUtil.js.map +1 -0
- package/lib/module/utils/SwapCalculationUtil.js +19 -0
- package/lib/module/utils/SwapCalculationUtil.js.map +1 -0
- package/lib/module/utils/TypeUtil.js +1 -1
- package/lib/typescript/controllers/AccountController.d.ts +9 -1
- package/lib/typescript/controllers/AccountController.d.ts.map +1 -1
- package/lib/typescript/controllers/ApiController.d.ts +3 -1
- package/lib/typescript/controllers/ApiController.d.ts.map +1 -1
- package/lib/typescript/controllers/BlockchainApiController.d.ts +6 -1
- package/lib/typescript/controllers/BlockchainApiController.d.ts.map +1 -1
- package/lib/typescript/controllers/ConnectionController.d.ts +18 -1
- package/lib/typescript/controllers/ConnectionController.d.ts.map +1 -1
- package/lib/typescript/controllers/ConnectorController.d.ts +1 -1
- package/lib/typescript/controllers/ConnectorController.d.ts.map +1 -1
- package/lib/typescript/controllers/EnsController.d.ts +10 -0
- package/lib/typescript/controllers/EnsController.d.ts.map +1 -0
- package/lib/typescript/controllers/EventsController.d.ts +0 -6
- package/lib/typescript/controllers/EventsController.d.ts.map +1 -1
- package/lib/typescript/controllers/ModalController.d.ts.map +1 -1
- package/lib/typescript/controllers/NetworkController.d.ts +5 -0
- package/lib/typescript/controllers/NetworkController.d.ts.map +1 -1
- package/lib/typescript/controllers/OptionsController.d.ts +6 -2
- package/lib/typescript/controllers/OptionsController.d.ts.map +1 -1
- package/lib/typescript/controllers/RouterController.d.ts +13 -1
- package/lib/typescript/controllers/RouterController.d.ts.map +1 -1
- package/lib/typescript/controllers/SendController.d.ts +41 -0
- package/lib/typescript/controllers/SendController.d.ts.map +1 -0
- package/lib/typescript/controllers/SnackController.d.ts +7 -0
- package/lib/typescript/controllers/SnackController.d.ts.map +1 -1
- package/lib/typescript/controllers/SwapController.d.ts +29 -0
- package/lib/typescript/controllers/SwapController.d.ts.map +1 -0
- package/lib/typescript/controllers/TransactionsController.d.ts +21 -0
- package/lib/typescript/controllers/TransactionsController.d.ts.map +1 -0
- package/lib/typescript/controllers/WebviewController.d.ts +21 -0
- package/lib/typescript/controllers/WebviewController.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +19 -26
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/utils/ApiUtil.d.ts +6 -0
- package/lib/typescript/utils/ApiUtil.d.ts.map +1 -0
- package/lib/typescript/utils/ConstantsUtil.d.ts +3 -0
- package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
- package/lib/typescript/utils/CoreHelperUtil.d.ts +6 -0
- package/lib/typescript/utils/CoreHelperUtil.d.ts.map +1 -1
- package/lib/typescript/utils/FetchUtil.d.ts +3 -0
- package/lib/typescript/utils/FetchUtil.d.ts.map +1 -1
- package/lib/typescript/utils/StorageUtil.d.ts +5 -1
- package/lib/typescript/utils/StorageUtil.d.ts.map +1 -1
- package/lib/typescript/utils/SwapApiUtil.d.ts +4 -0
- package/lib/typescript/utils/SwapApiUtil.d.ts.map +1 -0
- package/lib/typescript/utils/SwapCalculationUtil.d.ts +5 -0
- package/lib/typescript/utils/SwapCalculationUtil.d.ts.map +1 -0
- package/lib/typescript/utils/TypeUtil.d.ts +257 -4
- package/lib/typescript/utils/TypeUtil.d.ts.map +1 -1
- package/package.json +5 -5
- package/readme.md +1 -1
- package/src/controllers/AccountController.ts +50 -2
- package/src/controllers/ApiController.ts +34 -23
- package/src/controllers/BlockchainApiController.ts +88 -1
- package/src/controllers/ConnectionController.ts +57 -8
- package/src/controllers/ConnectorController.ts +13 -1
- package/src/controllers/EnsController.ts +39 -0
- package/src/controllers/EventsController.ts +1 -13
- package/src/controllers/ModalController.ts +3 -1
- package/src/controllers/NetworkController.ts +34 -1
- package/src/controllers/OptionsController.ts +25 -4
- package/src/controllers/RouterController.ts +57 -10
- package/src/controllers/SendController.ts +234 -0
- package/src/controllers/SnackController.ts +28 -1
- package/src/controllers/SwapController.ts +108 -0
- package/src/controllers/TransactionsController.ts +142 -0
- package/src/controllers/WebviewController.ts +63 -0
- package/src/index.ts +43 -30
- package/src/utils/ApiUtil.ts +26 -0
- package/src/utils/ConstantsUtil.ts +13 -1
- package/src/utils/CoreHelperUtil.ts +38 -1
- package/src/utils/FetchUtil.ts +4 -0
- package/src/utils/StorageUtil.ts +31 -1
- package/src/utils/SwapApiUtil.ts +19 -0
- package/src/utils/SwapCalculationUtil.ts +21 -0
- package/src/utils/TypeUtil.ts +290 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const INITIAL_GAS_LIMIT = 150000;
|
|
2
|
+
export declare const TO_AMOUNT_DECIMALS = 6;
|
|
3
|
+
export interface SwapControllerState {
|
|
4
|
+
networkPrice: string;
|
|
5
|
+
networkTokenSymbol: string;
|
|
6
|
+
tokensPriceMap: Record<string, number>;
|
|
7
|
+
gasFee: string;
|
|
8
|
+
gasPriceInUSD?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const SwapController: {
|
|
11
|
+
state: SwapControllerState;
|
|
12
|
+
subscribe(callback: (newState: SwapControllerState) => void): () => void;
|
|
13
|
+
subscribeKey<K extends keyof SwapControllerState>(key: K, callback: (value: SwapControllerState[K]) => void): () => void;
|
|
14
|
+
getParams(): {
|
|
15
|
+
networkAddress: string;
|
|
16
|
+
};
|
|
17
|
+
resetState(): void;
|
|
18
|
+
getNetworkTokenPrice(): Promise<void>;
|
|
19
|
+
getInitialGasPrice(): Promise<{
|
|
20
|
+
gasPrice: null;
|
|
21
|
+
gasPriceInUsd: null;
|
|
22
|
+
gasPriceInUSD?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
gasPrice: bigint;
|
|
25
|
+
gasPriceInUSD: number;
|
|
26
|
+
gasPriceInUsd?: undefined;
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=SwapController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwapController.d.ts","sourceRoot":"","sources":["../../../src/controllers/SwapController.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,iBAAiB,SAAS,CAAC;AACxC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAIpC,MAAM,WAAW,mBAAmB;IAElC,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAG3B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAGvC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAqBD,eAAO,MAAM,cAAc;;mCAGM,mBAAmB,KAAK,IAAI;2GAI2B,IAAI;;;;;;;;;;;;;;;CAoD3F,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Transaction } from '@reown/appkit-common-react-native';
|
|
2
|
+
type TransactionByMonthMap = Record<string, Transaction[]>;
|
|
3
|
+
type TransactionByYearMap = Record<string, TransactionByMonthMap>;
|
|
4
|
+
export interface TransactionsControllerState {
|
|
5
|
+
transactions: Transaction[];
|
|
6
|
+
loading: boolean;
|
|
7
|
+
empty: boolean;
|
|
8
|
+
next: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare const TransactionsController: {
|
|
11
|
+
state: TransactionsControllerState;
|
|
12
|
+
subscribe(callback: (newState: TransactionsControllerState) => void): () => void;
|
|
13
|
+
fetchTransactions(accountAddress?: string, reset?: boolean): Promise<void>;
|
|
14
|
+
getTransactionsByYearAndMonth(transactions: Transaction[]): TransactionByYearMap;
|
|
15
|
+
filterSpamTransactions(transactions: Transaction[]): Transaction[];
|
|
16
|
+
filterByConnectedChain(transactions: Transaction[]): Transaction[];
|
|
17
|
+
clearCursor(): void;
|
|
18
|
+
resetTransactions(): void;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=TransactionsController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransactionsController.d.ts","sourceRoot":"","sources":["../../../src/controllers/TransactionsController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAUrE,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;AAC3D,KAAK,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;AAElE,MAAM,WAAW,2BAA2B;IAC1C,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AAWD,eAAO,MAAM,sBAAsB;;mCAGF,2BAA2B,KAAK,IAAI;uCAI1B,MAAM,UAAU,OAAO;gDAmDpB,WAAW,EAAE;yCAyBpB,WAAW,EAAE;yCAUb,WAAW,EAAE;;;CAmBnD,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
processingAuth?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const WebviewController: {
|
|
11
|
+
state: WebviewControllerState;
|
|
12
|
+
subscribe(callback: (newState: WebviewControllerState) => void): () => void;
|
|
13
|
+
setFrameViewVisible(frameViewVisible: WebviewControllerState['frameViewVisible']): void;
|
|
14
|
+
setWebviewVisible(visible: WebviewControllerState['webviewVisible']): void;
|
|
15
|
+
setWebviewUrl(url: WebviewControllerState['webviewUrl']): void;
|
|
16
|
+
setConnecting(connecting: WebviewControllerState['connecting']): void;
|
|
17
|
+
setConnectingProvider(provider: WebviewControllerState['connectingProvider']): void;
|
|
18
|
+
setProcessingAuth(processingAuth: WebviewControllerState['processingAuth']): void;
|
|
19
|
+
reset(): void;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=WebviewController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;IACpC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAYD,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;sCAI1C,sBAAsB,CAAC,gBAAgB,CAAC;;CAY3E,CAAC"}
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
export { ModalController } from './controllers/ModalController';
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export type
|
|
5
|
-
export {
|
|
6
|
-
export type
|
|
7
|
-
export {
|
|
8
|
-
export
|
|
9
|
-
export {
|
|
10
|
-
export
|
|
11
|
-
export {
|
|
12
|
-
export type
|
|
13
|
-
export { SnackController } from './controllers/SnackController';
|
|
14
|
-
export type { SnackControllerState } from './controllers/SnackController';
|
|
15
|
-
export { ApiController } from './controllers/ApiController';
|
|
16
|
-
export type { ApiControllerState } from './controllers/ApiController';
|
|
17
|
-
export { AssetController } from './controllers/AssetController';
|
|
18
|
-
export type { AssetControllerState } from './controllers/AssetController';
|
|
19
|
-
export { ThemeController } from './controllers/ThemeController';
|
|
20
|
-
export type { ThemeControllerState } from './controllers/ThemeController';
|
|
21
|
-
export { OptionsController } from './controllers/OptionsController';
|
|
22
|
-
export type { OptionsControllerState } from './controllers/OptionsController';
|
|
23
|
-
export { PublicStateController } from './controllers/PublicStateController';
|
|
24
|
-
export type { PublicStateControllerState } from './controllers/PublicStateController';
|
|
1
|
+
export { ModalController, type ModalControllerArguments, type ModalControllerState } from './controllers/ModalController';
|
|
2
|
+
export { RouterController, type RouterControllerState } from './controllers/RouterController';
|
|
3
|
+
export { AccountController, type AccountControllerState } from './controllers/AccountController';
|
|
4
|
+
export { NetworkController, type NetworkControllerClient, type NetworkControllerState } from './controllers/NetworkController';
|
|
5
|
+
export { ConnectionController, type ConnectionControllerClient, type ConnectionControllerState } from './controllers/ConnectionController';
|
|
6
|
+
export { ConnectorController, type ConnectorControllerState } from './controllers/ConnectorController';
|
|
7
|
+
export { SnackController, type SnackControllerState } from './controllers/SnackController';
|
|
8
|
+
export { ApiController, type ApiControllerState } from './controllers/ApiController';
|
|
9
|
+
export { AssetController, type AssetControllerState } from './controllers/AssetController';
|
|
10
|
+
export { ThemeController, type ThemeControllerState } from './controllers/ThemeController';
|
|
11
|
+
export { OptionsController, type OptionsControllerState } from './controllers/OptionsController';
|
|
12
|
+
export { PublicStateController, type PublicStateControllerState } from './controllers/PublicStateController';
|
|
25
13
|
export { BlockchainApiController } from './controllers/BlockchainApiController';
|
|
26
|
-
export {
|
|
27
|
-
export type
|
|
14
|
+
export { SwapController, type SwapControllerState } from './controllers/SwapController';
|
|
15
|
+
export { EventsController, type EventsControllerState } from './controllers/EventsController';
|
|
16
|
+
export { EnsController, type EnsControllerState } from './controllers/EnsController';
|
|
17
|
+
export { TransactionsController, type TransactionsControllerState } from './controllers/TransactionsController';
|
|
18
|
+
export { SendController, type SendControllerState } from './controllers/SendController';
|
|
19
|
+
export { WebviewController, type WebviewControllerState } from './controllers/WebviewController';
|
|
20
|
+
export { ApiUtil } from './utils/ApiUtil';
|
|
28
21
|
export { AssetUtil } from './utils/AssetUtil';
|
|
29
22
|
export { ConstantsUtil } from './utils/ConstantsUtil';
|
|
30
23
|
export { CoreHelperUtil } from './utils/CoreHelperUtil';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,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,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEjG,OAAO,EACL,iBAAiB,EACjB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,oBAAoB,EACpB,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC/B,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,EAC9B,MAAM,mCAAmC,CAAC;AAE3C,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,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAGjG,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;AAEhD,mBAAmB,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/ApiUtil.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;;;;CAsBnB,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type { Features } from './TypeUtil';
|
|
1
2
|
export declare const ConstantsUtil: {
|
|
2
3
|
FOUR_MINUTES_MS: number;
|
|
3
4
|
TEN_SEC_MS: number;
|
|
4
5
|
ONE_SEC_MS: number;
|
|
5
6
|
EMAIL_REGEX: RegExp;
|
|
6
7
|
LINKING_ERROR: string;
|
|
8
|
+
NATIVE_TOKEN_ADDRESS: string;
|
|
9
|
+
DEFAULT_FEATURES: Features;
|
|
7
10
|
};
|
|
8
11
|
//# sourceMappingURL=ConstantsUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConstantsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/ConstantsUtil.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"ConstantsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/ConstantsUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQ3C,eAAO,MAAM,aAAa;;;;;;;;CAczB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Balance } from '@reown/appkit-common-react-native';
|
|
1
2
|
import type { CaipAddress, DataWallet, LinkingRecord } from './TypeUtil';
|
|
2
3
|
export declare const CoreHelperUtil: {
|
|
3
4
|
isPairingExpired(expiry?: number): boolean;
|
|
@@ -13,6 +14,7 @@ export declare const CoreHelperUtil: {
|
|
|
13
14
|
formatUniversalUrl(appUrl: string, wcUri: string): LinkingRecord;
|
|
14
15
|
openLink(url: string): Promise<void>;
|
|
15
16
|
formatBalance(balance: string | undefined, symbol: string | undefined, decimals?: number): string;
|
|
17
|
+
isAddress(address: string, chain?: string): boolean;
|
|
16
18
|
getApiUrl(): string;
|
|
17
19
|
getBlockchainApiUrl(): string;
|
|
18
20
|
getAnalyticsUrl(): string;
|
|
@@ -28,5 +30,9 @@ export declare const CoreHelperUtil: {
|
|
|
28
30
|
status: string;
|
|
29
31
|
reason: any;
|
|
30
32
|
})[]>;
|
|
33
|
+
calculateAndFormatBalance(array?: Balance[]): {
|
|
34
|
+
dollars: string | undefined;
|
|
35
|
+
pennies: string | undefined;
|
|
36
|
+
};
|
|
31
37
|
};
|
|
32
38
|
//# sourceMappingURL=CoreHelperUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreHelperUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/CoreHelperUtil.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CoreHelperUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/CoreHelperUtil.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoC,KAAK,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAGnG,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA0BzE,eAAO,MAAM,cAAc;8BACC,MAAM;8BAIN,MAAM;;8BAQN,WAAW,GAAG,SAAS;iCAIpB,WAAW,GAAG,SAAS;uBAI3B,MAAM;6BAMN,GAAG,EAAE,KAAK,OAAO,+BAGvB,OAAO,EAAE;mBAWb,MAAM;wBAID,MAAM;4BAQF,MAAM,SAAS,MAAM,GAAG,aAAa;+BA2BlC,MAAM,SAAS,MAAM,GAAG,aAAa;kBAuB5C,MAAM;2BAQH,MAAM,GAAG,SAAS,UAAU,MAAM,GAAG,SAAS;uBAgBlD,MAAM,mBAAqB,OAAO;;;;;;sBAoEnC,GAAG,GAAG,MAAM;2BAYD,UAAU,GAAG,QAAQ,OAAO,CAAC;wBAiBtC,MAAM;yBAIL,QAAQ,OAAO,CAAC,EAAE;;;;;;;sCAUL,OAAO,EAAE;;;;CAe5C,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RequestCache } from './TypeUtil';
|
|
1
2
|
interface Options {
|
|
2
3
|
baseUrl: string;
|
|
3
4
|
clientId?: string | null;
|
|
@@ -6,6 +7,8 @@ interface RequestArguments {
|
|
|
6
7
|
path: string;
|
|
7
8
|
headers?: HeadersInit_;
|
|
8
9
|
params?: Record<string, string | undefined>;
|
|
10
|
+
cache?: RequestCache;
|
|
11
|
+
signal?: AbortSignal;
|
|
9
12
|
}
|
|
10
13
|
interface PostArguments extends RequestArguments {
|
|
11
14
|
body?: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FetchUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/FetchUtil.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FetchUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/FetchUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,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,YAAY,CAAC;IACvB,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,GAAG,IAAI,EAAE,EAAE,gBAAgB;IAO7C,IAAI,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa;IAWjD,GAAG,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa;IAWhD,MAAM,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa;IAWnD,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAgBtE,OAAO,CAAC,SAAS;YAiBH,eAAe;CAiB9B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ConnectorType, WcWallet } from './TypeUtil';
|
|
2
|
+
import type { SocialProvider } from '@reown/appkit-common-react-native';
|
|
2
3
|
export declare const StorageUtil: {
|
|
3
4
|
setWalletConnectDeepLink({ href, name }: {
|
|
4
5
|
href: string;
|
|
@@ -10,10 +11,13 @@ export declare const StorageUtil: {
|
|
|
10
11
|
setRecentWallets(wallets: WcWallet[]): Promise<void>;
|
|
11
12
|
getRecentWallets(): Promise<WcWallet[]>;
|
|
12
13
|
setConnectedConnector(connectorType: ConnectorType): Promise<void>;
|
|
13
|
-
getConnectedConnector(): Promise<
|
|
14
|
+
getConnectedConnector(): Promise<ConnectorType | undefined>;
|
|
14
15
|
removeConnectedConnector(): Promise<void>;
|
|
15
16
|
setConnectedWalletImageUrl(url: string): Promise<void>;
|
|
16
17
|
getConnectedWalletImageUrl(): Promise<string | null | undefined>;
|
|
17
18
|
removeConnectedWalletImageUrl(): Promise<void>;
|
|
19
|
+
setConnectedSocialProvider(provider: SocialProvider): Promise<void>;
|
|
20
|
+
getConnectedSocialProvider(): Promise<any>;
|
|
21
|
+
removeConnectedSocialProvider(): Promise<void>;
|
|
18
22
|
};
|
|
19
23
|
//# sourceMappingURL=StorageUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/StorageUtil.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"StorageUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/StorageUtil.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAUxE,eAAO,MAAM,WAAW;;cAC2B,MAAM;cAAQ,MAAM;;;;4BA6BvC,QAAQ;8BAuBN,QAAQ,EAAE;wBAQhB,QAAQ,QAAQ,EAAE,CAAC;yCAYF,aAAa;6BAQzB,QAAQ,aAAa,GAAG,SAAS,CAAC;;oCAoB3B,MAAM;;;yCA0BD,cAAc;;;CA2B1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwapApiUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/SwapApiUtil.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW;;CAcvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwapCalculationUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/SwapCalculationUtil.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB;4BACN,MAAM,YAAY,MAAM;mCAOjB,MAAM,OAAO,MAAM,YAAY,MAAM;CAOrE,CAAC"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
import { type EventEmitter } from 'events';
|
|
4
|
+
import type { Balance, SocialProvider, Transaction } from '@reown/appkit-common-react-native';
|
|
5
|
+
export interface BaseError {
|
|
6
|
+
message?: string;
|
|
7
|
+
}
|
|
1
8
|
export type CaipAddress = `${string}:${string}:${string}`;
|
|
2
9
|
export type CaipNetworkId = `${string}:${string}`;
|
|
3
10
|
export interface CaipNetwork {
|
|
@@ -36,7 +43,26 @@ export type CaipNamespaces = Record<string, {
|
|
|
36
43
|
methods: string[];
|
|
37
44
|
events: string[];
|
|
38
45
|
}>;
|
|
46
|
+
export type SdkType = 'appkit';
|
|
39
47
|
export type SdkVersion = `react-native-wagmi-${string}` | `react-native-ethers5-${string}` | `react-native-ethers-${string}`;
|
|
48
|
+
type EnabledSocials = Exclude<SocialProvider, 'farcaster'>;
|
|
49
|
+
export type Features = {
|
|
50
|
+
/**
|
|
51
|
+
* @description Enable or disable the email feature. Enabled by default.
|
|
52
|
+
* @type {boolean}
|
|
53
|
+
*/
|
|
54
|
+
email?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* @description Show or hide the regular wallet options when email is enabled. Enabled by default.
|
|
57
|
+
* @type {boolean}
|
|
58
|
+
*/
|
|
59
|
+
emailShowWallets?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* @description Enable or disable the socials feature. Enabled by default.
|
|
62
|
+
* @type {EnabledSocials[]}
|
|
63
|
+
*/
|
|
64
|
+
socials?: EnabledSocials[] | false;
|
|
65
|
+
};
|
|
40
66
|
export interface WcWallet {
|
|
41
67
|
id: string;
|
|
42
68
|
name: string;
|
|
@@ -74,6 +100,7 @@ export interface ApiGetDataWalletsResponse {
|
|
|
74
100
|
export interface ApiGetAnalyticsConfigResponse {
|
|
75
101
|
isAnalyticsEnabled: boolean;
|
|
76
102
|
}
|
|
103
|
+
export type RequestCache = 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload';
|
|
77
104
|
export type ThemeMode = 'dark' | 'light';
|
|
78
105
|
export interface ThemeVariables {
|
|
79
106
|
accent?: string;
|
|
@@ -85,6 +112,64 @@ export interface BlockchainApiIdentityResponse {
|
|
|
85
112
|
avatar: string;
|
|
86
113
|
name: string;
|
|
87
114
|
}
|
|
115
|
+
export interface BlockchainApiBalanceResponse {
|
|
116
|
+
balances: Balance[];
|
|
117
|
+
}
|
|
118
|
+
export interface BlockchainApiTransactionsRequest {
|
|
119
|
+
account: string;
|
|
120
|
+
projectId: string;
|
|
121
|
+
cursor?: string;
|
|
122
|
+
onramp?: 'coinbase';
|
|
123
|
+
signal?: AbortSignal;
|
|
124
|
+
cache?: RequestCache;
|
|
125
|
+
}
|
|
126
|
+
export interface BlockchainApiTransactionsResponse {
|
|
127
|
+
data: Transaction[];
|
|
128
|
+
next: string | null;
|
|
129
|
+
}
|
|
130
|
+
export interface BlockchainApiTokenPriceRequest {
|
|
131
|
+
projectId: string;
|
|
132
|
+
currency?: 'usd' | 'eur' | 'gbp' | 'aud' | 'cad' | 'inr' | 'jpy' | 'btc' | 'eth';
|
|
133
|
+
addresses: string[];
|
|
134
|
+
}
|
|
135
|
+
export interface BlockchainApiTokenPriceResponse {
|
|
136
|
+
fungibles: {
|
|
137
|
+
name: string;
|
|
138
|
+
symbol: string;
|
|
139
|
+
iconUrl: string;
|
|
140
|
+
price: number;
|
|
141
|
+
}[];
|
|
142
|
+
}
|
|
143
|
+
export interface BlockchainApiGasPriceRequest {
|
|
144
|
+
projectId: string;
|
|
145
|
+
chainId: string;
|
|
146
|
+
}
|
|
147
|
+
export interface BlockchainApiGasPriceResponse {
|
|
148
|
+
standard: string;
|
|
149
|
+
fast: string;
|
|
150
|
+
instant: string;
|
|
151
|
+
}
|
|
152
|
+
export interface BlockchainApiEnsError extends BaseError {
|
|
153
|
+
status: string;
|
|
154
|
+
reasons: {
|
|
155
|
+
name: string;
|
|
156
|
+
description: string;
|
|
157
|
+
}[];
|
|
158
|
+
}
|
|
159
|
+
export type ReownName = `${string}.reown.id` | `${string}.wcn.id`;
|
|
160
|
+
export interface BlockchainApiLookupEnsName {
|
|
161
|
+
name: ReownName;
|
|
162
|
+
registered: number;
|
|
163
|
+
updated: number;
|
|
164
|
+
addresses: Record<string, {
|
|
165
|
+
address: string;
|
|
166
|
+
created: string;
|
|
167
|
+
}>;
|
|
168
|
+
attributes: {
|
|
169
|
+
avatar?: string;
|
|
170
|
+
bio?: string;
|
|
171
|
+
}[];
|
|
172
|
+
}
|
|
88
173
|
export interface Token {
|
|
89
174
|
address: string;
|
|
90
175
|
image?: string;
|
|
@@ -199,29 +284,159 @@ export type Event = {
|
|
|
199
284
|
} | {
|
|
200
285
|
type: 'track';
|
|
201
286
|
event: 'CLICK_SIGN_SIWE_MESSAGE';
|
|
287
|
+
properties: {
|
|
288
|
+
network: string;
|
|
289
|
+
isSmartAccount: boolean;
|
|
290
|
+
};
|
|
202
291
|
} | {
|
|
203
292
|
type: 'track';
|
|
204
293
|
event: 'CLICK_CANCEL_SIWE';
|
|
294
|
+
properties: {
|
|
295
|
+
network: string;
|
|
296
|
+
isSmartAccount: boolean;
|
|
297
|
+
};
|
|
205
298
|
} | {
|
|
206
299
|
type: 'track';
|
|
207
300
|
event: 'SIWE_AUTH_SUCCESS';
|
|
301
|
+
properties: {
|
|
302
|
+
network: string;
|
|
303
|
+
isSmartAccount: boolean;
|
|
304
|
+
};
|
|
208
305
|
} | {
|
|
209
306
|
type: 'track';
|
|
210
307
|
event: 'SIWE_AUTH_ERROR';
|
|
308
|
+
properties: {
|
|
309
|
+
network: string;
|
|
310
|
+
isSmartAccount: boolean;
|
|
311
|
+
};
|
|
312
|
+
} | {
|
|
313
|
+
type: 'track';
|
|
314
|
+
event: 'CLICK_TRANSACTIONS';
|
|
315
|
+
properties: {
|
|
316
|
+
isSmartAccount: boolean;
|
|
317
|
+
};
|
|
318
|
+
} | {
|
|
319
|
+
type: 'track';
|
|
320
|
+
event: 'ERROR_FETCH_TRANSACTIONS';
|
|
321
|
+
properties: {
|
|
322
|
+
address: string;
|
|
323
|
+
projectId: string;
|
|
324
|
+
cursor: string | undefined;
|
|
325
|
+
isSmartAccount: boolean;
|
|
326
|
+
};
|
|
327
|
+
} | {
|
|
328
|
+
type: 'track';
|
|
329
|
+
event: 'LOAD_MORE_TRANSACTIONS';
|
|
330
|
+
properties: {
|
|
331
|
+
address: string | undefined;
|
|
332
|
+
projectId: string;
|
|
333
|
+
cursor: string | undefined;
|
|
334
|
+
isSmartAccount: boolean;
|
|
335
|
+
};
|
|
336
|
+
} | {
|
|
337
|
+
type: 'track';
|
|
338
|
+
event: 'OPEN_SEND';
|
|
339
|
+
properties: {
|
|
340
|
+
isSmartAccount: boolean;
|
|
341
|
+
network: string;
|
|
342
|
+
};
|
|
343
|
+
} | {
|
|
344
|
+
type: 'track';
|
|
345
|
+
event: 'SEND_INITIATED';
|
|
346
|
+
properties: {
|
|
347
|
+
isSmartAccount: boolean;
|
|
348
|
+
network: string;
|
|
349
|
+
token: string;
|
|
350
|
+
amount: number;
|
|
351
|
+
};
|
|
352
|
+
} | {
|
|
353
|
+
type: 'track';
|
|
354
|
+
event: 'SEND_SUCCESS';
|
|
355
|
+
properties: {
|
|
356
|
+
isSmartAccount: boolean;
|
|
357
|
+
network: string;
|
|
358
|
+
token: string;
|
|
359
|
+
amount: number;
|
|
360
|
+
};
|
|
361
|
+
} | {
|
|
362
|
+
type: 'track';
|
|
363
|
+
event: 'SEND_ERROR';
|
|
364
|
+
properties: {
|
|
365
|
+
isSmartAccount: boolean;
|
|
366
|
+
network: string;
|
|
367
|
+
token: string;
|
|
368
|
+
amount: number;
|
|
369
|
+
};
|
|
370
|
+
} | {
|
|
371
|
+
type: 'track';
|
|
372
|
+
event: 'SOCIAL_LOGIN_STARTED';
|
|
373
|
+
properties: {
|
|
374
|
+
provider: SocialProvider;
|
|
375
|
+
};
|
|
376
|
+
} | {
|
|
377
|
+
type: 'track';
|
|
378
|
+
event: 'SOCIAL_LOGIN_SUCCESS';
|
|
379
|
+
properties: {
|
|
380
|
+
provider: SocialProvider;
|
|
381
|
+
};
|
|
382
|
+
} | {
|
|
383
|
+
type: 'track';
|
|
384
|
+
event: 'SOCIAL_LOGIN_REQUEST_USER_DATA';
|
|
385
|
+
properties: {
|
|
386
|
+
provider: SocialProvider;
|
|
387
|
+
};
|
|
388
|
+
} | {
|
|
389
|
+
type: 'track';
|
|
390
|
+
event: 'SOCIAL_LOGIN_CANCELED';
|
|
391
|
+
properties: {
|
|
392
|
+
provider: SocialProvider;
|
|
393
|
+
};
|
|
394
|
+
} | {
|
|
395
|
+
type: 'track';
|
|
396
|
+
event: 'SOCIAL_LOGIN_ERROR';
|
|
397
|
+
properties: {
|
|
398
|
+
provider: SocialProvider;
|
|
399
|
+
};
|
|
400
|
+
} | {
|
|
401
|
+
type: 'track';
|
|
402
|
+
event: 'SET_PREFERRED_ACCOUNT_TYPE';
|
|
403
|
+
properties: {
|
|
404
|
+
accountType: AppKitFrameAccountType;
|
|
405
|
+
network: string;
|
|
406
|
+
};
|
|
211
407
|
};
|
|
408
|
+
export interface SendTransactionArgs {
|
|
409
|
+
to: `0x${string}`;
|
|
410
|
+
data: `0x${string}`;
|
|
411
|
+
value: bigint;
|
|
412
|
+
gas?: bigint;
|
|
413
|
+
gasPrice: bigint;
|
|
414
|
+
address: `0x${string}`;
|
|
415
|
+
}
|
|
416
|
+
export interface WriteContractArgs {
|
|
417
|
+
receiverAddress: `0x${string}`;
|
|
418
|
+
tokenAmount: bigint;
|
|
419
|
+
tokenAddress: `0x${string}`;
|
|
420
|
+
fromAddress: `0x${string}`;
|
|
421
|
+
method: 'send' | 'transfer' | 'call';
|
|
422
|
+
abi: any;
|
|
423
|
+
}
|
|
212
424
|
/**
|
|
213
|
-
* Matches type defined for packages/
|
|
425
|
+
* Matches type defined for packages/wallet/src/AppKitFrameProvider.ts
|
|
214
426
|
* It's duplicated in order to decouple scaffold from email package
|
|
215
427
|
*/
|
|
428
|
+
export type AppKitFrameAccountType = 'eoa' | 'smartAccount';
|
|
216
429
|
export interface AppKitFrameProvider {
|
|
217
430
|
readonly id: string;
|
|
218
431
|
readonly name: string;
|
|
432
|
+
getEventEmitter(): EventEmitter;
|
|
219
433
|
getSecureSiteURL(): string;
|
|
220
434
|
getSecureSiteDashboardURL(): string;
|
|
221
435
|
getSecureSiteIconURL(): string;
|
|
222
436
|
getSecureSiteHeaders(): Record<string, string>;
|
|
223
|
-
getLoginEmailUsed(): Promise<boolean>;
|
|
224
437
|
getEmail(): string | undefined;
|
|
438
|
+
getUsername(): string | undefined;
|
|
439
|
+
getLastUsedChainId(): Promise<number | undefined>;
|
|
225
440
|
rejectRpcRequest(): void;
|
|
226
441
|
connectEmail(payload: {
|
|
227
442
|
email: string;
|
|
@@ -229,9 +444,30 @@ export interface AppKitFrameProvider {
|
|
|
229
444
|
action: 'VERIFY_DEVICE' | 'VERIFY_OTP';
|
|
230
445
|
}>;
|
|
231
446
|
connectDevice(): Promise<unknown>;
|
|
447
|
+
connectSocial(uri: string): Promise<{
|
|
448
|
+
chainId: string | number;
|
|
449
|
+
email: string;
|
|
450
|
+
address: string;
|
|
451
|
+
accounts?: {
|
|
452
|
+
type: AppKitFrameAccountType;
|
|
453
|
+
address: string;
|
|
454
|
+
}[];
|
|
455
|
+
userName?: string;
|
|
456
|
+
}>;
|
|
457
|
+
getSocialRedirectUri(payload: {
|
|
458
|
+
provider: SocialProvider;
|
|
459
|
+
}): Promise<{
|
|
460
|
+
uri: string;
|
|
461
|
+
}>;
|
|
232
462
|
connectOtp(payload: {
|
|
233
463
|
otp: string;
|
|
234
464
|
}): Promise<unknown>;
|
|
465
|
+
connectFarcaster: () => Promise<{
|
|
466
|
+
userName: string;
|
|
467
|
+
}>;
|
|
468
|
+
getFarcasterUri(): Promise<{
|
|
469
|
+
url: string;
|
|
470
|
+
}>;
|
|
235
471
|
isConnected(): Promise<{
|
|
236
472
|
isConnected: boolean;
|
|
237
473
|
}>;
|
|
@@ -258,20 +494,37 @@ export interface AppKitFrameProvider {
|
|
|
258
494
|
syncDappData(payload: {
|
|
259
495
|
projectId: string;
|
|
260
496
|
sdkVersion: SdkVersion;
|
|
497
|
+
sdkType: SdkType;
|
|
261
498
|
metadata?: Metadata;
|
|
262
499
|
}): Promise<unknown>;
|
|
263
500
|
connect(payload?: {
|
|
264
501
|
chainId: number | undefined;
|
|
265
502
|
}): Promise<{
|
|
266
503
|
chainId: number;
|
|
267
|
-
email
|
|
504
|
+
email?: string | null;
|
|
268
505
|
address: string;
|
|
506
|
+
smartAccountDeployed: boolean;
|
|
507
|
+
preferredAccountType: AppKitFrameAccountType;
|
|
269
508
|
}>;
|
|
270
509
|
switchNetwork(chainId: number): Promise<{
|
|
271
510
|
chainId: number;
|
|
272
511
|
}>;
|
|
512
|
+
setPreferredAccount(type: AppKitFrameAccountType): Promise<{
|
|
513
|
+
type: AppKitFrameAccountType;
|
|
514
|
+
address: string;
|
|
515
|
+
}>;
|
|
516
|
+
setOnTimeout(callback: () => void): void;
|
|
517
|
+
getSmartAccountEnabledNetworks(): Promise<{
|
|
518
|
+
smartAccountEnabledNetworks: number[];
|
|
519
|
+
}>;
|
|
273
520
|
disconnect(): Promise<unknown>;
|
|
274
521
|
request(req: any): Promise<any>;
|
|
275
|
-
AuthView: () => JSX.Element | null;
|
|
522
|
+
AuthView: () => React.JSX.Element | null;
|
|
523
|
+
Webview: () => React.JSX.Element | null;
|
|
524
|
+
onSetPreferredAccount: (callback: (values: {
|
|
525
|
+
type: AppKitFrameAccountType;
|
|
526
|
+
address: string;
|
|
527
|
+
}) => void) => void;
|
|
276
528
|
}
|
|
529
|
+
export {};
|
|
277
530
|
//# sourceMappingURL=TypeUtil.d.ts.map
|