@reown/appkit-core-react-native 0.0.0-develop-20241121145434 → 0.0.0-develop-20250117202414
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 +1 -1
- package/lib/commonjs/controllers/BlockchainApiController.js +107 -21
- package/lib/commonjs/controllers/BlockchainApiController.js.map +1 -1
- package/lib/commonjs/controllers/ConnectionController.js +8 -3
- package/lib/commonjs/controllers/ConnectionController.js.map +1 -1
- package/lib/commonjs/controllers/NetworkController.js +6 -0
- package/lib/commonjs/controllers/NetworkController.js.map +1 -1
- package/lib/commonjs/controllers/RouterController.js.map +1 -1
- package/lib/commonjs/controllers/SnackController.js +5 -0
- package/lib/commonjs/controllers/SnackController.js.map +1 -1
- package/lib/commonjs/controllers/SwapController.js +578 -6
- package/lib/commonjs/controllers/SwapController.js.map +1 -1
- package/lib/commonjs/controllers/ThemeController.js +1 -1
- package/lib/commonjs/controllers/ThemeController.js.map +1 -1
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/ConnectionUtil.js +33 -0
- package/lib/commonjs/utils/ConnectionUtil.js.map +1 -0
- package/lib/commonjs/utils/ConstantsUtil.js +30 -1
- package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
- package/lib/commonjs/utils/CoreHelperUtil.js +12 -12
- package/lib/commonjs/utils/CoreHelperUtil.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +46 -0
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -0
- package/lib/commonjs/utils/RouterUtil.js +1 -1
- package/lib/commonjs/utils/RouterUtil.js.map +1 -1
- package/lib/commonjs/utils/SwapApiUtil.js +58 -0
- package/lib/commonjs/utils/SwapApiUtil.js.map +1 -1
- package/lib/commonjs/utils/SwapCalculationUtil.js +73 -0
- package/lib/commonjs/utils/SwapCalculationUtil.js.map +1 -1
- package/lib/module/controllers/ApiController.js +1 -1
- package/lib/module/controllers/BlockchainApiController.js +107 -21
- package/lib/module/controllers/BlockchainApiController.js.map +1 -1
- package/lib/module/controllers/ConnectionController.js +8 -3
- package/lib/module/controllers/ConnectionController.js.map +1 -1
- package/lib/module/controllers/NetworkController.js +6 -0
- package/lib/module/controllers/NetworkController.js.map +1 -1
- package/lib/module/controllers/RouterController.js.map +1 -1
- package/lib/module/controllers/SnackController.js +5 -0
- package/lib/module/controllers/SnackController.js.map +1 -1
- package/lib/module/controllers/SwapController.js +578 -6
- package/lib/module/controllers/SwapController.js.map +1 -1
- package/lib/module/controllers/ThemeController.js +1 -1
- package/lib/module/controllers/ThemeController.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/ConnectionUtil.js +27 -0
- package/lib/module/utils/ConnectionUtil.js.map +1 -0
- package/lib/module/utils/ConstantsUtil.js +30 -1
- package/lib/module/utils/ConstantsUtil.js.map +1 -1
- package/lib/module/utils/CoreHelperUtil.js +12 -12
- package/lib/module/utils/CoreHelperUtil.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +40 -0
- package/lib/module/utils/NetworkUtil.js.map +1 -0
- package/lib/module/utils/RouterUtil.js +1 -1
- package/lib/module/utils/RouterUtil.js.map +1 -1
- package/lib/module/utils/SwapApiUtil.js +58 -0
- package/lib/module/utils/SwapApiUtil.js.map +1 -1
- package/lib/module/utils/SwapCalculationUtil.js +73 -1
- package/lib/module/utils/SwapCalculationUtil.js.map +1 -1
- package/lib/typescript/controllers/ApiController.d.ts +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 +5 -1
- package/lib/typescript/controllers/ConnectionController.d.ts.map +1 -1
- package/lib/typescript/controllers/NetworkController.d.ts +1 -0
- package/lib/typescript/controllers/NetworkController.d.ts.map +1 -1
- package/lib/typescript/controllers/RouterController.d.ts +3 -4
- package/lib/typescript/controllers/RouterController.d.ts.map +1 -1
- package/lib/typescript/controllers/SnackController.d.ts +2 -1
- package/lib/typescript/controllers/SnackController.d.ts.map +1 -1
- package/lib/typescript/controllers/SwapController.d.ts +87 -0
- package/lib/typescript/controllers/SwapController.d.ts.map +1 -1
- package/lib/typescript/controllers/ThemeController.d.ts +2 -2
- package/lib/typescript/controllers/ThemeController.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/utils/ConnectionUtil.d.ts +4 -0
- package/lib/typescript/utils/ConnectionUtil.d.ts.map +1 -0
- package/lib/typescript/utils/ConstantsUtil.d.ts +4 -0
- 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/NetworkUtil.d.ts +8 -0
- package/lib/typescript/utils/NetworkUtil.d.ts.map +1 -0
- package/lib/typescript/utils/RouterUtil.d.ts.map +1 -1
- package/lib/typescript/utils/SwapApiUtil.d.ts +8 -0
- package/lib/typescript/utils/SwapApiUtil.d.ts.map +1 -1
- package/lib/typescript/utils/SwapCalculationUtil.d.ts +19 -0
- package/lib/typescript/utils/SwapCalculationUtil.d.ts.map +1 -1
- package/lib/typescript/utils/TypeUtil.d.ts +162 -8
- package/lib/typescript/utils/TypeUtil.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/controllers/ApiController.ts +1 -1
- package/src/controllers/BlockchainApiController.ts +114 -17
- package/src/controllers/ConnectionController.ts +12 -3
- package/src/controllers/NetworkController.ts +8 -0
- package/src/controllers/RouterController.ts +6 -3
- package/src/controllers/SnackController.ts +7 -1
- package/src/controllers/SwapController.ts +759 -6
- package/src/controllers/ThemeController.ts +3 -3
- package/src/index.ts +2 -0
- package/src/utils/ConnectionUtil.ts +27 -0
- package/src/utils/ConstantsUtil.ts +121 -1
- package/src/utils/CoreHelperUtil.ts +20 -15
- package/src/utils/NetworkUtil.ts +33 -0
- package/src/utils/RouterUtil.ts +4 -1
- package/src/utils/SwapApiUtil.ts +89 -0
- package/src/utils/SwapCalculationUtil.ts +125 -0
- package/src/utils/TypeUtil.ts +187 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SocialProvider } from '@reown/appkit-common-react-native';
|
|
2
|
-
import type { Connector, SendTransactionArgs, WcWallet, WriteContractArgs } from '../utils/TypeUtil';
|
|
2
|
+
import type { Connector, EstimateGasTransactionArgs, SendTransactionArgs, WcWallet, WriteContractArgs } from '../utils/TypeUtil';
|
|
3
3
|
export interface ConnectExternalOptions {
|
|
4
4
|
id: Connector['id'];
|
|
5
5
|
type: Connector['type'];
|
|
@@ -14,6 +14,7 @@ export interface ConnectionControllerClient {
|
|
|
14
14
|
parseUnits: (value: string, decimals: number) => bigint;
|
|
15
15
|
formatUnits: (value: bigint, decimals: number) => string;
|
|
16
16
|
writeContract: (args: WriteContractArgs) => Promise<`0x${string}` | null>;
|
|
17
|
+
estimateGas: (args: EstimateGasTransactionArgs) => Promise<bigint>;
|
|
17
18
|
disconnect: () => Promise<void>;
|
|
18
19
|
getEnsAddress: (value: string) => Promise<false | string>;
|
|
19
20
|
getEnsAvatar: (value: string) => Promise<false | string>;
|
|
@@ -30,6 +31,7 @@ export interface ConnectionControllerState {
|
|
|
30
31
|
wcError?: boolean;
|
|
31
32
|
pressedWallet?: WcWallet;
|
|
32
33
|
recentWallets?: WcWallet[];
|
|
34
|
+
selectedSocialProvider?: SocialProvider;
|
|
33
35
|
connectedWalletImageUrl?: string;
|
|
34
36
|
connectedSocialProvider?: SocialProvider;
|
|
35
37
|
}
|
|
@@ -47,11 +49,13 @@ export declare const ConnectionController: {
|
|
|
47
49
|
setPressedWallet(wallet: ConnectionControllerState['pressedWallet']): void;
|
|
48
50
|
removePressedWallet(): void;
|
|
49
51
|
setRecentWallets(wallets: ConnectionControllerState['recentWallets']): void;
|
|
52
|
+
setSelectedSocialProvider(provider: ConnectionControllerState['selectedSocialProvider']): void;
|
|
50
53
|
setConnectedWalletImageUrl(url: ConnectionControllerState['connectedWalletImageUrl']): Promise<void>;
|
|
51
54
|
setConnectedSocialProvider(provider: ConnectionControllerState['connectedSocialProvider']): void;
|
|
52
55
|
parseUnits(value: string, decimals: number): bigint;
|
|
53
56
|
formatUnits(value: bigint, decimals: number): string;
|
|
54
57
|
sendTransaction(args: SendTransactionArgs): Promise<`0x${string}` | null>;
|
|
58
|
+
estimateGas(args: EstimateGasTransactionArgs): Promise<bigint>;
|
|
55
59
|
writeContract(args: WriteContractArgs): Promise<`0x${string}` | null>;
|
|
56
60
|
getEnsAddress(value: string): Promise<string | false>;
|
|
57
61
|
getEnsAvatar(value: string): Promise<string | false>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionController.d.ts","sourceRoot":"","sources":["../../../src/controllers/ConnectionController.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAGxE,OAAO,KAAK,EACV,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConnectionController.d.ts","sourceRoot":"","sources":["../../../src/controllers/ConnectionController.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAGxE,OAAO,KAAK,EACV,SAAS,EACT,0BAA0B,EAC1B,mBAAmB,EACnB,QAAQ,EACR,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAA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E,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,QAAQ,CAAC;IACzB,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC3B,sBAAsB,CAAC,EAAE,cAAc,CAAC;IACxC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,uBAAuB,CAAC,EAAE,cAAc,CAAC;CAC1C;AAUD,eAAO,MAAM,oBAAoB;;uHAKsB,IAAI;;sBAavC,0BAA0B;+CAID,MAAM;6BAOlB,sBAAsB;yBAK1B,MAAM;4BAIT,yBAAyB,CAAC,WAAW,CAAC;;wBAQ1C,yBAAyB,CAAC,SAAS,CAAC;6BAI/B,yBAAyB,CAAC,eAAe,CAAC;;8BAQzC,yBAAyB,CAAC,eAAe,CAAC;wCAIhC,yBAAyB,CAAC,wBAAwB,CAAC;oCAIjD,yBAAyB,CAAC,yBAAyB,CAAC;yCAUrD,yBAAyB,CAAC,yBAAyB,CAAC;sBAUvE,MAAM,YAAY,MAAM;uBAIvB,MAAM,YAAY,MAAM;0BAIf,mBAAmB;sBAIvB,0BAA0B;wBAGxB,iBAAiB;yBAIhB,MAAM;wBAIP,MAAM;;;;CA0BjC,CAAC"}
|
|
@@ -27,6 +27,7 @@ export declare const NetworkController: {
|
|
|
27
27
|
getApprovedCaipNetworksData(): Promise<void>;
|
|
28
28
|
getApprovedCaipNetworks(): CaipNetwork[];
|
|
29
29
|
getSmartAccountEnabledNetworks(): CaipNetwork[];
|
|
30
|
+
getActiveNetworkTokenAddress(): string;
|
|
30
31
|
switchActiveNetwork(network: NetworkControllerState['caipNetwork']): Promise<void>;
|
|
31
32
|
resetNetwork(): void;
|
|
32
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkController.d.ts","sourceRoot":"","sources":["../../../src/controllers/NetworkController.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"NetworkController.d.ts","sourceRoot":"","sources":["../../../src/controllers/NetworkController.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMpE,MAAM,WAAW,uBAAuB;IACtC,iBAAiB,EAAE,CAAC,OAAO,EAAE,sBAAsB,CAAC,aAAa,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrF,2BAA2B,EAAE,MAAM,OAAO,CAAC;QACzC,sBAAsB,EAAE,sBAAsB,CAAC,wBAAwB,CAAC,CAAC;QACzE,mBAAmB,EAAE,sBAAsB,CAAC,qBAAqB,CAAC,CAAC;KACpE,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,sBAAsB;IACrC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,uBAAuB,CAAC;IAClC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,qBAAqB,CAAC,EAAE,WAAW,EAAE,CAAC;IACtC,sBAAsB,CAAC,EAAE,aAAa,EAAE,CAAC;IACzC,2BAA2B,EAAE,MAAM,EAAE,CAAC;CACvC;AAUD,eAAO,MAAM,iBAAiB;;;sBAWV,uBAAuB;gCAIb,sBAAsB,CAAC,aAAa,CAAC;uCAK9B,sBAAsB,CAAC,aAAa,CAAC;gDAM5B,sBAAsB,CAAC,uBAAuB,CAAC;gEAK5D,sBAAsB,CAAC,6BAA6B,CAAC;;;;;;iCAyCjD,sBAAsB,CAAC,aAAa,CAAC;;CAczE,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { WcWallet, CaipNetwork, Connector } from '../utils/TypeUtil';
|
|
2
|
-
import type { SocialProvider } from '@reown/appkit-common-react-native';
|
|
1
|
+
import type { WcWallet, CaipNetwork, Connector, SwapInputTarget } from '../utils/TypeUtil';
|
|
3
2
|
type TransactionAction = {
|
|
4
3
|
goBack: boolean;
|
|
5
4
|
view: RouterControllerState['view'] | null;
|
|
@@ -9,7 +8,7 @@ type TransactionAction = {
|
|
|
9
8
|
onCancel?: () => void;
|
|
10
9
|
};
|
|
11
10
|
export interface RouterControllerState {
|
|
12
|
-
view: 'Account' | 'AccountDefault' | 'AllWallets' | 'Connect' | 'ConnectSocials' | 'ConnectingExternal' | 'ConnectingSiwe' | 'ConnectingSocial' | 'ConnectingFarcaster' | 'ConnectingWalletConnect' | 'Create' | 'EmailVerifyDevice' | 'EmailVerifyOtp' | 'GetWallet' | 'Networks' | 'SwitchNetwork' | 'Transactions' | 'UpdateEmailPrimaryOtp' | 'UpdateEmailSecondaryOtp' | 'UpdateEmailWallet' | 'UpgradeEmailWallet' | 'UpgradeToSmartAccount' | 'WalletCompatibleNetworks' | 'WalletReceive' | 'WalletSend' | 'WalletSendPreview' | 'WalletSendSelectToken' | 'WhatIsANetwork' | 'WhatIsAWallet';
|
|
11
|
+
view: 'Account' | 'AccountDefault' | 'AllWallets' | 'Connect' | 'ConnectSocials' | 'ConnectingExternal' | 'ConnectingSiwe' | 'ConnectingSocial' | 'ConnectingFarcaster' | 'ConnectingWalletConnect' | 'Create' | 'EmailVerifyDevice' | 'EmailVerifyOtp' | 'GetWallet' | 'Networks' | 'SwitchNetwork' | 'Swap' | 'SwapSelectToken' | 'SwapPreview' | 'Transactions' | 'UnsupportedChain' | 'UpdateEmailPrimaryOtp' | 'UpdateEmailSecondaryOtp' | 'UpdateEmailWallet' | 'UpgradeEmailWallet' | 'UpgradeToSmartAccount' | 'WalletCompatibleNetworks' | 'WalletReceive' | 'WalletSend' | 'WalletSendPreview' | 'WalletSendSelectToken' | 'WhatIsANetwork' | 'WhatIsAWallet';
|
|
13
12
|
history: RouterControllerState['view'][];
|
|
14
13
|
data?: {
|
|
15
14
|
connector?: Connector;
|
|
@@ -17,7 +16,7 @@ export interface RouterControllerState {
|
|
|
17
16
|
network?: CaipNetwork;
|
|
18
17
|
email?: string;
|
|
19
18
|
newEmail?: string;
|
|
20
|
-
|
|
19
|
+
swapTarget?: SwapInputTarget;
|
|
21
20
|
};
|
|
22
21
|
transactionStack: TransactionAction[];
|
|
23
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouterController.d.ts","sourceRoot":"","sources":["../../../src/controllers/RouterController.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"RouterController.d.ts","sourceRoot":"","sources":["../../../src/controllers/RouterController.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAG3F,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,IAAI,EACA,SAAS,GACT,gBAAgB,GAChB,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,oBAAoB,GACpB,gBAAgB,GAChB,kBAAkB,GAClB,qBAAqB,GACrB,yBAAyB,GACzB,QAAQ,GACR,mBAAmB,GACnB,gBAAgB,GAChB,WAAW,GACX,UAAU,GACV,eAAe,GACf,MAAM,GACN,iBAAiB,GACjB,aAAa,GACb,cAAc,GACd,kBAAkB,GAClB,uBAAuB,GACvB,yBAAyB,GACzB,mBAAmB,GACnB,oBAAoB,GACpB,uBAAuB,GACvB,0BAA0B,GAC1B,eAAe,GACf,YAAY,GACZ,mBAAmB,GACnB,uBAAuB,GACvB,gBAAgB,GAChB,eAAe,CAAC;IACpB,OAAO,EAAE,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC;IACzC,IAAI,CAAC,EAAE;QACL,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,MAAM,CAAC,EAAE,QAAQ,CAAC;QAClB,OAAO,CAAC,EAAE,WAAW,CAAC;QACtB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,eAAe,CAAC;KAC9B,CAAC;IACF,gBAAgB,EAAE,iBAAiB,EAAE,CAAC;CACvC;AAUD,eAAO,MAAM,gBAAgB;;eAGhB,qBAAqB,CAAC,MAAM,CAAC,SAAS,qBAAqB,CAAC,MAAM,CAAC;iCAQjD,iBAAiB;iCAIjB,OAAO;gBAoBxB,qBAAqB,CAAC,MAAM,CAAC;kBAK3B,qBAAqB,CAAC,MAAM,CAAC,SAAS,qBAAqB,CAAC,MAAM,CAAC;;gCAkBrD,MAAM;CASnC,CAAC"}
|
|
@@ -4,7 +4,7 @@ interface Message {
|
|
|
4
4
|
}
|
|
5
5
|
export interface SnackControllerState {
|
|
6
6
|
message: string;
|
|
7
|
-
variant: 'error' | 'success';
|
|
7
|
+
variant: 'error' | 'success' | 'loading';
|
|
8
8
|
open: boolean;
|
|
9
9
|
long: boolean;
|
|
10
10
|
}
|
|
@@ -12,6 +12,7 @@ export declare const SnackController: {
|
|
|
12
12
|
state: SnackControllerState;
|
|
13
13
|
showSuccess(message: SnackControllerState['message']): void;
|
|
14
14
|
showError(message: SnackControllerState['message']): void;
|
|
15
|
+
showLoading(message: SnackControllerState['message']): void;
|
|
15
16
|
showInternalError(error: Message): void;
|
|
16
17
|
hide(): void;
|
|
17
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SnackController.d.ts","sourceRoot":"","sources":["../../../src/controllers/SnackController.ts"],"names":[],"mappings":"AAIA,UAAU,OAAO;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"SnackController.d.ts","sourceRoot":"","sources":["../../../src/controllers/SnackController.ts"],"names":[],"mappings":"AAIA,UAAU,OAAO;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;IACzC,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;CACf;AAWD,eAAO,MAAM,eAAe;;yBAGL,oBAAoB,CAAC,SAAS,CAAC;uBAMjC,oBAAoB,CAAC,SAAS,CAAC;yBAM7B,oBAAoB,CAAC,SAAS,CAAC;6BAM3B,OAAO;;CAsBjC,CAAC"}
|
|
@@ -1,11 +1,48 @@
|
|
|
1
|
+
import type { SwapInputTarget, SwapTokenWithBalance } from '../utils/TypeUtil';
|
|
1
2
|
export declare const INITIAL_GAS_LIMIT = 150000;
|
|
2
3
|
export declare const TO_AMOUNT_DECIMALS = 6;
|
|
4
|
+
type TransactionParams = {
|
|
5
|
+
data: string;
|
|
6
|
+
to: string;
|
|
7
|
+
gas: bigint;
|
|
8
|
+
gasPrice: bigint;
|
|
9
|
+
value: bigint;
|
|
10
|
+
toAmount: string;
|
|
11
|
+
};
|
|
3
12
|
export interface SwapControllerState {
|
|
13
|
+
initializing: boolean;
|
|
14
|
+
initialized: boolean;
|
|
15
|
+
loadingPrices: boolean;
|
|
16
|
+
loadingQuote?: boolean;
|
|
17
|
+
loadingApprovalTransaction?: boolean;
|
|
18
|
+
loadingBuildTransaction?: boolean;
|
|
19
|
+
loadingTransaction?: boolean;
|
|
20
|
+
fetchError: boolean;
|
|
21
|
+
approvalTransaction: TransactionParams | undefined;
|
|
22
|
+
swapTransaction: TransactionParams | undefined;
|
|
23
|
+
transactionError?: string;
|
|
24
|
+
sourceToken?: SwapTokenWithBalance;
|
|
25
|
+
sourceTokenAmount: string;
|
|
26
|
+
sourceTokenPriceInUSD: number;
|
|
27
|
+
toToken?: SwapTokenWithBalance;
|
|
28
|
+
toTokenAmount: string;
|
|
29
|
+
toTokenPriceInUSD: number;
|
|
4
30
|
networkPrice: string;
|
|
31
|
+
networkBalanceInUSD: string;
|
|
5
32
|
networkTokenSymbol: string;
|
|
33
|
+
inputError: string | undefined;
|
|
34
|
+
slippage: number;
|
|
35
|
+
tokens?: SwapTokenWithBalance[];
|
|
36
|
+
suggestedTokens?: SwapTokenWithBalance[];
|
|
37
|
+
popularTokens?: SwapTokenWithBalance[];
|
|
38
|
+
foundTokens?: SwapTokenWithBalance[];
|
|
39
|
+
myTokensWithBalance?: SwapTokenWithBalance[];
|
|
6
40
|
tokensPriceMap: Record<string, number>;
|
|
7
41
|
gasFee: string;
|
|
8
42
|
gasPriceInUSD?: number;
|
|
43
|
+
priceImpact: number | undefined;
|
|
44
|
+
maxSlippage: number | undefined;
|
|
45
|
+
providerFee: string | undefined;
|
|
9
46
|
}
|
|
10
47
|
export declare const SwapController: {
|
|
11
48
|
state: SwapControllerState;
|
|
@@ -13,8 +50,30 @@ export declare const SwapController: {
|
|
|
13
50
|
subscribeKey<K extends keyof SwapControllerState>(key: K, callback: (value: SwapControllerState[K]) => void): () => void;
|
|
14
51
|
getParams(): {
|
|
15
52
|
networkAddress: string;
|
|
53
|
+
fromAddress: string;
|
|
54
|
+
fromCaipAddress: `${string}:${string}:${string}` | undefined;
|
|
55
|
+
sourceTokenAddress: `${string}:${string}:${string}` | undefined;
|
|
56
|
+
toTokenAddress: `${string}:${string}:${string}` | undefined;
|
|
57
|
+
toTokenAmount: string;
|
|
58
|
+
toTokenDecimals: number | undefined;
|
|
59
|
+
sourceTokenAmount: string;
|
|
60
|
+
sourceTokenDecimals: number | undefined;
|
|
61
|
+
invalidToToken: boolean;
|
|
62
|
+
invalidSourceToken: boolean;
|
|
63
|
+
invalidSourceTokenAmount: boolean;
|
|
64
|
+
availableToSwap: boolean | undefined;
|
|
65
|
+
isAuthConnector: boolean;
|
|
16
66
|
};
|
|
67
|
+
switchTokens(): void;
|
|
17
68
|
resetState(): void;
|
|
69
|
+
fetchTokens(): Promise<void>;
|
|
70
|
+
getTokenList(): Promise<void>;
|
|
71
|
+
getMyTokensWithBalance(forceUpdate?: string): Promise<void>;
|
|
72
|
+
getFilteredPopularTokens(): SwapTokenWithBalance[] | undefined;
|
|
73
|
+
setSourceToken(sourceToken: SwapTokenWithBalance | undefined): void;
|
|
74
|
+
setSourceTokenAmount(amount: string): void;
|
|
75
|
+
initializeState(): Promise<void>;
|
|
76
|
+
getAddressPrice(address: string): Promise<number>;
|
|
18
77
|
getNetworkTokenPrice(): Promise<void>;
|
|
19
78
|
getInitialGasPrice(): Promise<{
|
|
20
79
|
gasPrice: null;
|
|
@@ -25,5 +84,33 @@ export declare const SwapController: {
|
|
|
25
84
|
gasPriceInUSD: number;
|
|
26
85
|
gasPriceInUsd?: undefined;
|
|
27
86
|
}>;
|
|
87
|
+
getProviderFeePrice(): number;
|
|
88
|
+
setBalances(balances: SwapTokenWithBalance[]): void;
|
|
89
|
+
setToToken(toToken: SwapTokenWithBalance | undefined): void;
|
|
90
|
+
setToTokenAmount(amount: string): void;
|
|
91
|
+
setTokenPrice(address: string, target: SwapInputTarget): Promise<void>;
|
|
92
|
+
swapTokens(): Promise<void>;
|
|
93
|
+
getTransaction(): Promise<TransactionParams | undefined>;
|
|
94
|
+
createAllowanceTransaction(): Promise<{
|
|
95
|
+
data: `0x${string}`;
|
|
96
|
+
to: `0x${string}`;
|
|
97
|
+
gas: bigint;
|
|
98
|
+
gasPrice: bigint;
|
|
99
|
+
value: bigint;
|
|
100
|
+
toAmount: string;
|
|
101
|
+
} | undefined>;
|
|
102
|
+
createSwapTransaction(): Promise<{
|
|
103
|
+
data: `0x${string}`;
|
|
104
|
+
to: `0x${string}`;
|
|
105
|
+
gas: bigint;
|
|
106
|
+
gasPrice: bigint;
|
|
107
|
+
value: bigint;
|
|
108
|
+
toAmount: string;
|
|
109
|
+
} | undefined>;
|
|
110
|
+
sendTransactionForApproval(data: TransactionParams): Promise<void>;
|
|
111
|
+
sendTransactionForSwap(data: TransactionParams | undefined): Promise<`0x${string}` | null | undefined>;
|
|
112
|
+
hasInsufficientToken(sourceTokenAmount: string, sourceTokenAddress: string): boolean;
|
|
113
|
+
setTransactionDetails(): void;
|
|
28
114
|
};
|
|
115
|
+
export {};
|
|
29
116
|
//# sourceMappingURL=SwapController.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapController.d.ts","sourceRoot":"","sources":["../../../src/controllers/SwapController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwapController.d.ts","sourceRoot":"","sources":["../../../src/controllers/SwapController.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAS/E,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,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,C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,IAAI;;;;;;;;;;;;;;;;;;;;;yCA+H/C,MAAM;;gCAiBrB,oBAAoB,GAAG,SAAS;iCAa/B,MAAM;;6BA2BJ,MAAM;;;;;;;;;;;;0BA8Df,oBAAoB,EAAE;wBAqBxB,oBAAoB,GAAG,SAAS;6BAa3B,MAAM;2BAMF,MAAM,UAAU,eAAe;;;;;;;;;;;;;;;;;;;qCAmPrB,iBAAiB;iCAwCrB,iBAAiB,GAAG,SAAS;4CA6FxB,MAAM,sBAAsB,MAAM;;CA2C3E,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ThemeMode, ThemeVariables } from '
|
|
1
|
+
import type { ThemeMode, ThemeVariables } from '@reown/appkit-common-react-native';
|
|
2
2
|
export interface ThemeControllerState {
|
|
3
|
-
themeMode
|
|
3
|
+
themeMode?: ThemeMode;
|
|
4
4
|
themeVariables: ThemeVariables;
|
|
5
5
|
}
|
|
6
6
|
export declare const ThemeController: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeController.d.ts","sourceRoot":"","sources":["../../../src/controllers/ThemeController.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ThemeController.d.ts","sourceRoot":"","sources":["../../../src/controllers/ThemeController.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAGnF,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,cAAc,EAAE,cAAc,CAAC;CAChC;AASD,eAAO,MAAM,eAAe;;mCAGK,oBAAoB,KAAK,IAAI;4BAIpC,oBAAoB,CAAC,WAAW,CAAC;sCAIvB,oBAAoB,CAAC,gBAAgB,CAAC;CAGzE,CAAC"}
|
|
@@ -19,10 +19,12 @@ export { SendController, type SendControllerState } from './controllers/SendCont
|
|
|
19
19
|
export { WebviewController, type WebviewControllerState } from './controllers/WebviewController';
|
|
20
20
|
export { ApiUtil } from './utils/ApiUtil';
|
|
21
21
|
export { AssetUtil } from './utils/AssetUtil';
|
|
22
|
+
export { ConnectionUtil } from './utils/ConnectionUtil';
|
|
22
23
|
export { ConstantsUtil } from './utils/ConstantsUtil';
|
|
23
24
|
export { CoreHelperUtil } from './utils/CoreHelperUtil';
|
|
24
25
|
export { StorageUtil } from './utils/StorageUtil';
|
|
25
26
|
export { EventUtil } from './utils/EventUtil';
|
|
26
27
|
export { RouterUtil } from './utils/RouterUtil';
|
|
28
|
+
export { NetworkUtil } from './utils/NetworkUtil';
|
|
27
29
|
export type * from './utils/TypeUtil';
|
|
28
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE9F,OAAO,EAAE,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,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AAsC,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,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,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,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,mBAAmB,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/ConnectionUtil.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,cAAc;;CAmB1B,CAAC"}
|
|
@@ -6,6 +6,10 @@ export declare const ConstantsUtil: {
|
|
|
6
6
|
EMAIL_REGEX: RegExp;
|
|
7
7
|
LINKING_ERROR: string;
|
|
8
8
|
NATIVE_TOKEN_ADDRESS: string;
|
|
9
|
+
SWAP_SUGGESTED_TOKENS: string[];
|
|
10
|
+
SWAP_POPULAR_TOKENS: string[];
|
|
11
|
+
SWAP_SUPPORTED_NETWORKS: string[];
|
|
12
|
+
CONVERT_SLIPPAGE_TOLERANCE: number;
|
|
9
13
|
DEFAULT_FEATURES: Features;
|
|
10
14
|
};
|
|
11
15
|
//# sourceMappingURL=ConstantsUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConstantsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/ConstantsUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ConstantsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/ConstantsUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAS3C,eAAO,MAAM,aAAa;;;;;;;;;;;;CAqIzB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Balance } from '@reown/appkit-common-react-native';
|
|
2
|
-
import type { CaipAddress, DataWallet, LinkingRecord } from './TypeUtil';
|
|
2
|
+
import type { CaipAddress, CaipNetwork, DataWallet, LinkingRecord } from './TypeUtil';
|
|
3
3
|
export declare const CoreHelperUtil: {
|
|
4
4
|
isPairingExpired(expiry?: number): boolean;
|
|
5
5
|
isAllowedRetry(lastRetry: number): boolean;
|
|
@@ -7,7 +7,6 @@ export declare const CoreHelperUtil: {
|
|
|
7
7
|
getNetworkId(caipAddress: CaipAddress | undefined): string | undefined;
|
|
8
8
|
getPlainAddress(caipAddress: CaipAddress | undefined): string | undefined;
|
|
9
9
|
wait(milliseconds: number): Promise<unknown>;
|
|
10
|
-
debounce(func: (...args: any[]) => unknown, timeout?: number): (...args: unknown[]) => void;
|
|
11
10
|
isHttpUrl(url: string): boolean;
|
|
12
11
|
isLinkModeURL(url?: string): boolean;
|
|
13
12
|
formatNativeUrl(appUrl: string, wcUri: string): LinkingRecord;
|
|
@@ -34,5 +33,6 @@ export declare const CoreHelperUtil: {
|
|
|
34
33
|
dollars: string | undefined;
|
|
35
34
|
pennies: string | undefined;
|
|
36
35
|
};
|
|
36
|
+
sortNetworks(approvedCaipNetworkIds: `${string}:${string}`[] | undefined, requestedCaipNetworks?: CaipNetwork[]): CaipNetwork[];
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=CoreHelperUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA0BtF,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,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;;;;yCAiBjB,GAAG,MAAM,IAAI,MAAM,EAAE,EAAE,GAAG,SAAS,0BACpC,WAAW,EAAE;CAgBvC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NetworkUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/NetworkUtil.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,WAAW;iCACa,WAAW;;;;CAuB/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouterUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/RouterUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAG/F,eAAO,MAAM,UAAU;8CACoB,qBAAqB,CAAC,MAAM,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"RouterUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/RouterUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAG/F,eAAO,MAAM,UAAU;8CACoB,qBAAqB,CAAC,MAAM,CAAC,EAAE;CAgBzE,CAAC"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
import type { BlockchainApiBalanceResponse, BlockchainApiSwapAllowanceRequest, SwapTokenWithBalance } from './TypeUtil';
|
|
1
2
|
export declare const SwapApiUtil: {
|
|
3
|
+
getTokenList(): Promise<SwapTokenWithBalance[]>;
|
|
4
|
+
fetchSwapAllowance({ tokenAddress, userAddress, sourceTokenAmount, sourceTokenDecimals }: Pick<BlockchainApiSwapAllowanceRequest, "tokenAddress" | "userAddress"> & {
|
|
5
|
+
sourceTokenAmount: string;
|
|
6
|
+
sourceTokenDecimals: number;
|
|
7
|
+
}): Promise<boolean>;
|
|
8
|
+
getMyTokensWithBalance(forceUpdate?: string): Promise<SwapTokenWithBalance[]>;
|
|
9
|
+
mapBalancesToSwapTokens(balances?: BlockchainApiBalanceResponse['balances']): SwapTokenWithBalance[];
|
|
2
10
|
fetchGasPrice(): Promise<import("./TypeUtil").BlockchainApiGasPriceResponse | null | undefined>;
|
|
3
11
|
};
|
|
4
12
|
//# sourceMappingURL=SwapApiUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapApiUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/SwapApiUtil.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwapApiUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/SwapApiUtil.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,4BAA4B,EAC5B,iCAAiC,EACjC,oBAAoB,EACrB,MAAM,YAAY,CAAC;AAIpB,eAAO,MAAM,WAAW;;;2BA8BD,MAAM;6BACJ,MAAM;;yCAqBc,MAAM;uCAgBd,4BAA4B,CAAC,UAAU,CAAC;;CA4B5E,CAAC"}
|
|
@@ -1,5 +1,24 @@
|
|
|
1
|
+
import type { SwapTokenWithBalance } from './TypeUtil';
|
|
1
2
|
export declare const SwapCalculationUtil: {
|
|
2
3
|
getGasPriceInEther(gas: bigint, gasPrice: bigint): number;
|
|
3
4
|
getGasPriceInUSD(networkPrice: string, gas: bigint, gasPrice: bigint): number;
|
|
5
|
+
getPriceImpact({ sourceTokenAmount, sourceTokenPriceInUSD, toTokenPriceInUSD, toTokenAmount }: {
|
|
6
|
+
sourceTokenAmount: string;
|
|
7
|
+
sourceTokenPriceInUSD: number;
|
|
8
|
+
toTokenPriceInUSD: number;
|
|
9
|
+
toTokenAmount: string;
|
|
10
|
+
}): number;
|
|
11
|
+
getMaxSlippage(slippage: number, toTokenAmount: string): number;
|
|
12
|
+
getProviderFee(sourceTokenAmount: string, feePercentage?: number): string;
|
|
13
|
+
getProviderFeePrice(sourceTokenAmount: string, sourceTokenPriceInUSD: number, feePercentage?: number): number;
|
|
14
|
+
isInsufficientNetworkTokenForGas(networkBalanceInUSD: string, gasPriceInUSD: number | undefined): boolean;
|
|
15
|
+
isInsufficientSourceTokenForSwap(sourceTokenAmount: string, sourceTokenAddress: string, balance: SwapTokenWithBalance[] | undefined): boolean;
|
|
16
|
+
getToTokenAmount({ sourceToken, toToken, sourceTokenPrice, toTokenPrice, sourceTokenAmount }: {
|
|
17
|
+
sourceToken: SwapTokenWithBalance | undefined;
|
|
18
|
+
toToken: SwapTokenWithBalance | undefined;
|
|
19
|
+
sourceTokenPrice: number;
|
|
20
|
+
toTokenPrice: number;
|
|
21
|
+
sourceTokenAmount: string;
|
|
22
|
+
}): string;
|
|
4
23
|
};
|
|
5
24
|
//# sourceMappingURL=SwapCalculationUtil.d.ts.map
|
|
@@ -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":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGvD,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"}
|