@reown/appkit-core 1.6.7-basic-test.8.0 → 1.6.7
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/dist/esm/src/controllers/ApiController.js +7 -7
- package/dist/esm/src/controllers/ApiController.js.map +1 -1
- package/dist/esm/src/controllers/ChainController.js +2 -5
- package/dist/esm/src/controllers/ChainController.js.map +1 -1
- package/dist/esm/src/controllers/ConnectionController.js +1 -25
- package/dist/esm/src/controllers/ConnectionController.js.map +1 -1
- package/dist/esm/src/controllers/ModalController.js +8 -24
- package/dist/esm/src/controllers/ModalController.js.map +1 -1
- package/dist/esm/src/controllers/OptionsController.js +2 -2
- package/dist/esm/src/controllers/OptionsController.js.map +1 -1
- package/dist/esm/src/controllers/SendController.js +1 -1
- package/dist/esm/src/controllers/SendController.js.map +1 -1
- package/dist/esm/src/controllers/SwapController.js +1 -1
- package/dist/esm/src/controllers/SwapController.js.map +1 -1
- package/dist/esm/src/controllers/TransactionsController.js +1 -1
- package/dist/esm/src/controllers/TransactionsController.js.map +1 -1
- package/dist/esm/src/utils/AssetUtil.js +6 -16
- package/dist/esm/src/utils/AssetUtil.js.map +1 -1
- package/dist/esm/src/utils/ConstantsUtil.js +0 -8
- package/dist/esm/src/utils/ConstantsUtil.js.map +1 -1
- package/dist/esm/src/utils/CoreHelperUtil.js +4 -4
- package/dist/esm/src/utils/CoreHelperUtil.js.map +1 -1
- package/dist/esm/src/utils/SIWXUtil.js +1 -1
- package/dist/esm/src/utils/SIWXUtil.js.map +1 -1
- package/dist/esm/tests/controllers/ApiController.test.js +2 -2
- package/dist/esm/tests/controllers/ApiController.test.js.map +1 -1
- package/dist/esm/tests/controllers/ChainController.test.js +0 -1
- package/dist/esm/tests/controllers/ChainController.test.js.map +1 -1
- package/dist/esm/tests/controllers/ModalController.test.js +2 -2
- package/dist/esm/tests/controllers/ModalController.test.js.map +1 -1
- package/dist/esm/tests/utils/AssetUtil.test.js +0 -17
- package/dist/esm/tests/utils/AssetUtil.test.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/controllers/ApiController.d.ts +2 -9
- package/dist/types/src/controllers/ConnectionController.d.ts +1 -5
- package/dist/types/src/controllers/OptionsController.d.ts +4 -9
- package/dist/types/src/controllers/SendController.d.ts +40 -49
- package/dist/types/src/utils/AssetUtil.d.ts +1 -4
- package/dist/types/src/utils/ConstantsUtil.d.ts +0 -8
- package/dist/types/src/utils/CoreHelperUtil.d.ts +2 -2
- package/package.json +3 -4
- package/dist/esm/src/utils/ConnectorUtil.js +0 -26
- package/dist/esm/src/utils/ConnectorUtil.js.map +0 -1
- package/dist/esm/src/utils/DeeplinkUtil.js +0 -2
- package/dist/esm/src/utils/DeeplinkUtil.js.map +0 -1
- package/dist/types/src/utils/ConnectorUtil.d.ts +0 -4
- package/dist/types/src/utils/DeeplinkUtil.d.ts +0 -0
|
@@ -12,12 +12,6 @@ export interface ApiControllerState {
|
|
|
12
12
|
isAnalyticsEnabled: boolean;
|
|
13
13
|
excludedRDNS: string[];
|
|
14
14
|
}
|
|
15
|
-
interface PrefetchParameters {
|
|
16
|
-
fetchConnectorImages?: boolean;
|
|
17
|
-
fetchFeaturedWallets?: boolean;
|
|
18
|
-
fetchRecommendedWallets?: boolean;
|
|
19
|
-
fetchNetworkImages?: boolean;
|
|
20
|
-
}
|
|
21
15
|
export declare const ApiController: {
|
|
22
16
|
state: ApiControllerState;
|
|
23
17
|
subscribeKey<K extends keyof ApiControllerState>(key: K, callback: (value: ApiControllerState[K]) => void): () => void;
|
|
@@ -32,7 +26,7 @@ export declare const ApiController: {
|
|
|
32
26
|
_fetchConnectorImage(imageId: string): Promise<void>;
|
|
33
27
|
_fetchCurrencyImage(countryCode: string): Promise<void>;
|
|
34
28
|
_fetchTokenImage(symbol: string): Promise<void>;
|
|
35
|
-
|
|
29
|
+
prefetchNetworkImages(): Promise<void>;
|
|
36
30
|
fetchConnectorImages(): Promise<void>;
|
|
37
31
|
fetchCurrencyImages(currencies?: string[]): Promise<void>;
|
|
38
32
|
fetchTokenImages(tokens?: string[]): Promise<void>;
|
|
@@ -43,8 +37,7 @@ export declare const ApiController: {
|
|
|
43
37
|
ids: string[];
|
|
44
38
|
}): Promise<void>;
|
|
45
39
|
searchWallet({ search, badge }: Pick<ApiGetWalletsRequest, 'search' | 'badge'>): Promise<void>;
|
|
46
|
-
prefetch(
|
|
40
|
+
prefetch(): Promise<unknown>;
|
|
47
41
|
prefetchAnalyticsConfig(): void;
|
|
48
42
|
fetchAnalyticsConfig(): Promise<void>;
|
|
49
43
|
};
|
|
50
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CaipNetwork, type ChainNamespace } from '@reown/appkit-common';
|
|
2
|
-
import type
|
|
2
|
+
import { type W3mFrameTypes } from '@reown/appkit-wallet';
|
|
3
3
|
import type { Connector, EstimateGasTransactionArgs, SendTransactionArgs, WcWallet, WriteContractArgs } from '../utils/TypeUtil.js';
|
|
4
4
|
export interface ConnectExternalOptions {
|
|
5
5
|
id: Connector['id'];
|
|
@@ -41,7 +41,6 @@ export interface ConnectionControllerState {
|
|
|
41
41
|
href: string;
|
|
42
42
|
name: string;
|
|
43
43
|
};
|
|
44
|
-
wcBasic?: boolean;
|
|
45
44
|
wcError?: boolean;
|
|
46
45
|
recentWallet?: WcWallet;
|
|
47
46
|
buffering: boolean;
|
|
@@ -69,9 +68,6 @@ export declare const ConnectionController: {
|
|
|
69
68
|
getEnsAvatar(value: string): Promise<string | false | undefined>;
|
|
70
69
|
checkInstalled(ids?: string[]): boolean;
|
|
71
70
|
resetWcConnection(): void;
|
|
72
|
-
resetUri(): void;
|
|
73
|
-
finalizeWcConnection(): void;
|
|
74
|
-
setWcBasic(wcBasic: ConnectionControllerState['wcBasic']): void;
|
|
75
71
|
setUri(uri: string): void;
|
|
76
72
|
setWcLinking(wcLinking: ConnectionControllerState['wcLinking']): void;
|
|
77
73
|
setWcError(wcError: ConnectionControllerState['wcError']): void;
|
|
@@ -130,12 +130,6 @@ export interface OptionsControllerStatePublic {
|
|
|
130
130
|
* @default "{ bip122: 'payment', eip155: 'smartAccount', polkadot: 'eoa', solana: 'eoa' }"
|
|
131
131
|
*/
|
|
132
132
|
defaultAccountTypes: DefaultAccountTypes;
|
|
133
|
-
/**
|
|
134
|
-
* Allows users to indicate if they want to handle the WC connection themselves.
|
|
135
|
-
* @default false
|
|
136
|
-
* @see https://docs.reown.com/appkit/react/core/options#manualwccontrol
|
|
137
|
-
*/
|
|
138
|
-
manualWCControl?: boolean;
|
|
139
133
|
}
|
|
140
134
|
export interface OptionsControllerStateInternal {
|
|
141
135
|
sdkType: 'appkit';
|
|
@@ -143,6 +137,7 @@ export interface OptionsControllerStateInternal {
|
|
|
143
137
|
isSiweEnabled?: boolean;
|
|
144
138
|
isUniversalProvider?: boolean;
|
|
145
139
|
hasMultipleAddresses?: boolean;
|
|
140
|
+
useInjectedUniversalProvider?: boolean;
|
|
146
141
|
}
|
|
147
142
|
type StateKey = keyof OptionsControllerStatePublic | keyof OptionsControllerStateInternal;
|
|
148
143
|
type OptionsControllerState = OptionsControllerStatePublic & OptionsControllerStateInternal;
|
|
@@ -179,7 +174,7 @@ export declare const OptionsController: {
|
|
|
179
174
|
setCollapseWallets(collapseWallets: boolean): void;
|
|
180
175
|
setEnableEmbedded(enableEmbedded: OptionsControllerState['enableEmbedded']): void;
|
|
181
176
|
setAllowUnsupportedChain(allowUnsupportedChain: OptionsControllerState['allowUnsupportedChain']): void;
|
|
182
|
-
|
|
177
|
+
setUsingInjectedUniversalProvider(useInjectedUniversalProvider: OptionsControllerState['useInjectedUniversalProvider']): void;
|
|
183
178
|
setDefaultAccountTypes(defaultAccountType?: Partial<OptionsControllerState['defaultAccountTypes']>): void;
|
|
184
179
|
getSnapshot(): {
|
|
185
180
|
readonly allWallets?: "SHOW" | "HIDE" | "ONLY_MOBILE" | undefined;
|
|
@@ -222,8 +217,8 @@ export declare const OptionsController: {
|
|
|
222
217
|
};
|
|
223
218
|
} | undefined;
|
|
224
219
|
readonly customWallets?: readonly {
|
|
225
|
-
readonly id: string;
|
|
226
220
|
readonly name: string;
|
|
221
|
+
readonly id: string;
|
|
227
222
|
readonly homepage?: string | undefined;
|
|
228
223
|
readonly image_url?: string | undefined;
|
|
229
224
|
readonly mobile_link?: string | null | undefined;
|
|
@@ -282,12 +277,12 @@ export declare const OptionsController: {
|
|
|
282
277
|
readonly bip122: "payment" | "ordinal" | "stx";
|
|
283
278
|
readonly polkadot: "eoa";
|
|
284
279
|
};
|
|
285
|
-
readonly manualWCControl?: boolean | undefined;
|
|
286
280
|
readonly sdkType: 'appkit';
|
|
287
281
|
readonly sdkVersion: SdkVersion;
|
|
288
282
|
readonly isSiweEnabled?: boolean | undefined;
|
|
289
283
|
readonly isUniversalProvider?: boolean | undefined;
|
|
290
284
|
readonly hasMultipleAddresses?: boolean | undefined;
|
|
285
|
+
readonly useInjectedUniversalProvider?: boolean | undefined;
|
|
291
286
|
};
|
|
292
287
|
};
|
|
293
288
|
export {};
|
|
@@ -1,56 +1,47 @@
|
|
|
1
|
-
import { type Balance } from '@reown/appkit-common'
|
|
2
|
-
|
|
1
|
+
import { type Balance } from '@reown/appkit-common';
|
|
3
2
|
export interface TxParams {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
receiverAddress: string;
|
|
4
|
+
sendTokenAmount: number;
|
|
5
|
+
gasPrice: bigint;
|
|
6
|
+
decimals: string;
|
|
8
7
|
}
|
|
9
8
|
export interface ContractWriteParams {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
receiverAddress: string;
|
|
10
|
+
tokenAddress: string;
|
|
11
|
+
sendTokenAmount: number;
|
|
12
|
+
decimals: string;
|
|
14
13
|
}
|
|
15
14
|
export interface SendControllerState {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
token?: Balance;
|
|
16
|
+
sendTokenAmount?: number;
|
|
17
|
+
receiverAddress?: string;
|
|
18
|
+
receiverProfileName?: string;
|
|
19
|
+
receiverProfileImageUrl?: string;
|
|
20
|
+
gasPrice?: bigint;
|
|
21
|
+
gasPriceInUSD?: number;
|
|
22
|
+
networkBalanceInUSD?: string;
|
|
23
|
+
loading: boolean;
|
|
25
24
|
}
|
|
26
25
|
export declare const SendController: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
gasPriceInUSD: number | undefined
|
|
50
|
-
): boolean
|
|
51
|
-
hasInsufficientGasFunds(): boolean
|
|
52
|
-
sendNativeToken(params: TxParams): Promise<void>
|
|
53
|
-
sendERC20Token(params: ContractWriteParams): Promise<void>
|
|
54
|
-
sendSolanaToken(): void
|
|
55
|
-
resetSend(): void
|
|
56
|
-
}
|
|
26
|
+
state: SendControllerState;
|
|
27
|
+
subscribe(callback: (newState: SendControllerState) => void): () => void;
|
|
28
|
+
subscribeKey<K extends keyof SendControllerState>(key: K, callback: (value: SendControllerState[K]) => void): () => void;
|
|
29
|
+
setToken(token: SendControllerState['token']): void;
|
|
30
|
+
setTokenAmount(sendTokenAmount: SendControllerState['sendTokenAmount']): void;
|
|
31
|
+
setReceiverAddress(receiverAddress: SendControllerState['receiverAddress']): void;
|
|
32
|
+
setReceiverProfileImageUrl(receiverProfileImageUrl: SendControllerState['receiverProfileImageUrl']): void;
|
|
33
|
+
setReceiverProfileName(receiverProfileName: SendControllerState['receiverProfileName']): void;
|
|
34
|
+
setGasPrice(gasPrice: SendControllerState['gasPrice']): void;
|
|
35
|
+
setGasPriceInUsd(gasPriceInUSD: SendControllerState['gasPriceInUSD']): void;
|
|
36
|
+
setNetworkBalanceInUsd(networkBalanceInUSD: SendControllerState['networkBalanceInUSD']): void;
|
|
37
|
+
setLoading(loading: SendControllerState['loading']): void;
|
|
38
|
+
sendToken(): void;
|
|
39
|
+
sendEvmToken(): void;
|
|
40
|
+
fetchNetworkBalance(): Promise<void>;
|
|
41
|
+
isInsufficientNetworkTokenForGas(networkBalanceInUSD: string, gasPriceInUSD: number | undefined): boolean;
|
|
42
|
+
hasInsufficientGasFunds(): boolean;
|
|
43
|
+
sendNativeToken(params: TxParams): Promise<void>;
|
|
44
|
+
sendERC20Token(params: ContractWriteParams): Promise<void>;
|
|
45
|
+
sendSolanaToken(): void;
|
|
46
|
+
resetSend(): void;
|
|
47
|
+
};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import type { CaipNetwork, ChainNamespace } from '@reown/appkit-common';
|
|
2
2
|
import type { Connector, WcWallet } from './TypeUtil.js';
|
|
3
|
-
export interface AssetUtilState {
|
|
4
|
-
networkImagePromises: Record<string, Promise<void>>;
|
|
5
|
-
}
|
|
6
3
|
export declare const AssetUtil: {
|
|
7
4
|
fetchWalletImage(imageId?: string): Promise<string | undefined>;
|
|
8
|
-
fetchNetworkImage(imageId?: string): Promise<
|
|
5
|
+
fetchNetworkImage(imageId?: string): Promise<string | undefined>;
|
|
9
6
|
getWalletImageById(imageId?: string): string | undefined;
|
|
10
7
|
getWalletImage(wallet?: WcWallet): string | undefined;
|
|
11
8
|
getNetworkImage(network?: CaipNetwork): string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Balance, ChainNamespace
|
|
1
|
+
import type { AppKitSdkVersion, Balance, ChainNamespace } from '@reown/appkit-common';
|
|
2
2
|
import type { CaipAddress, CaipNetwork } from '@reown/appkit-common';
|
|
3
3
|
import type { AccountTypeMap, ChainAdapter, LinkingRecord, NamespaceTypeMap } from './TypeUtil.js';
|
|
4
4
|
type SDKFramework = 'html' | 'react' | 'vue';
|
|
@@ -46,7 +46,7 @@ export declare const CoreHelperUtil: {
|
|
|
46
46
|
};
|
|
47
47
|
isAddress(address: string, chain?: ChainNamespace): boolean;
|
|
48
48
|
uniqueBy<T>(arr: T[], key: keyof T): T[];
|
|
49
|
-
generateSdkVersion(adapters: ChainAdapter[], platform: SDKFramework, version: string):
|
|
49
|
+
generateSdkVersion(adapters: ChainAdapter[], platform: SDKFramework, version: string): AppKitSdkVersion;
|
|
50
50
|
createAccount<N extends ChainNamespace>(namespace: N, address: string, type: NamespaceTypeMap[N], publicKey?: string, path?: string): AccountTypeMap[N];
|
|
51
51
|
isCaipAddress(address?: unknown): address is `eip155:${string}:${string}` | `eip155:${number}:${string}` | `solana:${string}:${string}` | `solana:${number}:${string}` | `polkadot:${string}:${string}` | `polkadot:${number}:${string}` | `bip122:${string}:${string}` | `bip122:${number}:${string}`;
|
|
52
52
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-core",
|
|
3
|
-
"version": "1.6.7
|
|
4
|
-
"sideEffects": false,
|
|
3
|
+
"version": "1.6.7",
|
|
5
4
|
"type": "module",
|
|
6
5
|
"main": "./dist/esm/exports/index.js",
|
|
7
6
|
"types": "./dist/types/exports/index.d.ts",
|
|
@@ -40,8 +39,8 @@
|
|
|
40
39
|
"@walletconnect/universal-provider": "2.18.0",
|
|
41
40
|
"valtio": "1.13.2",
|
|
42
41
|
"viem": "2.x",
|
|
43
|
-
"@reown/appkit-common": "1.6.7
|
|
44
|
-
"@reown/appkit-wallet": "1.6.7
|
|
42
|
+
"@reown/appkit-common": "1.6.7",
|
|
43
|
+
"@reown/appkit-wallet": "1.6.7"
|
|
45
44
|
},
|
|
46
45
|
"peerDependencies": {},
|
|
47
46
|
"devDependencies": {
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export const ConnectorUtil = {
|
|
2
|
-
handleSolanaDeeplinkRedirect: (wallet, connector) => {
|
|
3
|
-
/**
|
|
4
|
-
* Universal Links requires explicit user interaction to open the wallet app.
|
|
5
|
-
* Previously we've been calling this with the life-cycle methods in the Solana clients by listening the SELECT_WALLET event of EventController.
|
|
6
|
-
* But this breaks the UL functionality for some wallets like Phantom.
|
|
7
|
-
*/
|
|
8
|
-
console.log('ConnectorUtil.handleSolanaDeeplinkRedirect', wallet, connector);
|
|
9
|
-
const href = window.location.href;
|
|
10
|
-
const encodedHref = encodeURIComponent(href);
|
|
11
|
-
const name = connector?.name || wallet?.name || '';
|
|
12
|
-
console.log('>> Name:', name, window);
|
|
13
|
-
if (name === 'Phantom' && !('phantom' in window)) {
|
|
14
|
-
console.log('>> Update phantom');
|
|
15
|
-
const protocol = href.startsWith('https') ? 'https' : 'http';
|
|
16
|
-
const host = href.split('/')[2];
|
|
17
|
-
const encodedRef = encodeURIComponent(`${protocol}://${host}`);
|
|
18
|
-
window.location.href = `https://phantom.app/ul/browse/${encodedHref}?ref=${encodedRef}`;
|
|
19
|
-
}
|
|
20
|
-
if (name === 'Coinbase Wallet' && !('coinbaseSolana' in window)) {
|
|
21
|
-
console.log('>> Update coinbaseSolana');
|
|
22
|
-
window.location.href = `https://go.cb-w.com/dapp?cb_url=${encodedHref}`;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=ConnectorUtil.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectorUtil.js","sourceRoot":"","sources":["../../../../src/utils/ConnectorUtil.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,4BAA4B,EAAE,CAAC,MAAgB,EAAE,SAAqB,EAAE,EAAE;QACxE;;;;WAIG;QACH,OAAO,CAAC,GAAG,CAAC,4CAA4C,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;QAC5E,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAA;QACjC,MAAM,WAAW,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC5C,MAAM,IAAI,GAAG,SAAS,EAAE,IAAI,IAAI,MAAM,EAAE,IAAI,IAAI,EAAE,CAAA;QAClD,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;QACrC,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,SAAS,IAAI,MAAM,CAAC,EAAE,CAAC;YACjD,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;YAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAA;YAC5D,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;YAC/B,MAAM,UAAU,GAAG,kBAAkB,CAAC,GAAG,QAAQ,MAAM,IAAI,EAAE,CAAC,CAAA;YAE9D,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,iCAAiC,WAAW,QAAQ,UAAU,EAAE,CAAA;QACzF,CAAC;QAED,IAAI,IAAI,KAAK,iBAAiB,IAAI,CAAC,CAAC,gBAAgB,IAAI,MAAM,CAAC,EAAE,CAAC;YAChE,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;YACvC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,mCAAmC,WAAW,EAAE,CAAA;QACzE,CAAC;IACH,CAAC;CACF,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeeplinkUtil.js","sourceRoot":"","sources":["../../../../src/utils/DeeplinkUtil.ts"],"names":[],"mappings":""}
|
|
File without changes
|