@reown/appkit-wallet 0.0.3

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.
Files changed (34) hide show
  1. package/LICENSE +190 -0
  2. package/dist/esm/index.js +8 -0
  3. package/dist/esm/index.js.map +1 -0
  4. package/dist/esm/src/RegexUtil.js +6 -0
  5. package/dist/esm/src/RegexUtil.js.map +1 -0
  6. package/dist/esm/src/W3mFrame.js +137 -0
  7. package/dist/esm/src/W3mFrame.js.map +1 -0
  8. package/dist/esm/src/W3mFrameConstants.js +150 -0
  9. package/dist/esm/src/W3mFrameConstants.js.map +1 -0
  10. package/dist/esm/src/W3mFrameHelpers.js +44 -0
  11. package/dist/esm/src/W3mFrameHelpers.js.map +1 -0
  12. package/dist/esm/src/W3mFrameLogger.js +27 -0
  13. package/dist/esm/src/W3mFrameLogger.js.map +1 -0
  14. package/dist/esm/src/W3mFrameProvider.js +430 -0
  15. package/dist/esm/src/W3mFrameProvider.js.map +1 -0
  16. package/dist/esm/src/W3mFrameSchema.js +532 -0
  17. package/dist/esm/src/W3mFrameSchema.js.map +1 -0
  18. package/dist/esm/src/W3mFrameStorage.js +26 -0
  19. package/dist/esm/src/W3mFrameStorage.js.map +1 -0
  20. package/dist/esm/src/W3mFrameTypes.js +3 -0
  21. package/dist/esm/src/W3mFrameTypes.js.map +1 -0
  22. package/dist/esm/tsconfig.tsbuildinfo +1 -0
  23. package/dist/types/index.d.ts +9 -0
  24. package/dist/types/src/RegexUtil.d.ts +5 -0
  25. package/dist/types/src/W3mFrame.d.ts +20 -0
  26. package/dist/types/src/W3mFrameConstants.d.ts +98 -0
  27. package/dist/types/src/W3mFrameHelpers.d.ts +9 -0
  28. package/dist/types/src/W3mFrameLogger.d.ts +6 -0
  29. package/dist/types/src/W3mFrameProvider.d.ts +112 -0
  30. package/dist/types/src/W3mFrameSchema.d.ts +3127 -0
  31. package/dist/types/src/W3mFrameStorage.d.ts +5 -0
  32. package/dist/types/src/W3mFrameTypes.d.ts +63 -0
  33. package/package.json +40 -0
  34. package/readme.md +11 -0
@@ -0,0 +1,5 @@
1
+ export declare const W3mFrameStorage: {
2
+ set(key: string, value: string): void;
3
+ get(key: string): string | null;
4
+ delete(key: string, social?: boolean): void;
5
+ };
@@ -0,0 +1,63 @@
1
+ import { z } from 'zod';
2
+ import { W3mFrameSchema, AppConnectEmailRequest, AppConnectOtpRequest, AppSwitchNetworkRequest, FrameConnectEmailResponse, FrameGetChainIdResponse, FrameGetUserResponse, FrameIsConnectedResponse, RpcPersonalSignRequest, RpcResponse, RpcEthSendTransactionRequest, RpcEthSignTypedDataV4, RpcEthAccountsRequest, RpcEthEstimateGas, RpcEthGasPrice, RpcEthBlockNumber, RpcEthGetTransactionByHash, RpcEthGetBlockByNumber, RpcEthCall, RpcEthFeeHistory, RpcEthGetAccount, RpcEthGetBalance, RpcEthGetBlockyByHash, RpcUnistallFilter, RpcEthSyncing, RpcEthSendRawTransaction, RpcEthNewPendingTransactionFilter, RpcEthNewFilter, RpcEthNewBlockFilter, RpcEthMaxPriorityFeePerGas, RpcEthGetUncleCountByBlockNumber, RpcEthGetUncleCountByBlockHash, RpcEthGetTransactionReceipt, RpcEthGetTransactionCount, RpcEthGetTransactionByBlockNumberAndIndex, RpcEthGetTransactionByBlockHashAndIndex, RpcEthGetStorageAt, RpcEthGetProof, RpcEthGetLogs, RpcEthGetFilterLogs, RpcEthGetFilter, RpcEthGetCode, RcpEthGetBlockTransactionCountByNumber, RcpEthGetBlockTransactionCountByHash, RpcEthGetBlockReceipts, WalletSendCallsRequest, WalletGetCallsReceiptRequest, FrameSession, AppGetUserRequest, AppUpdateEmailRequest, FrameUpdateEmailSecondaryOtpResponse, AppUpdateEmailPrimaryOtpRequest, AppUpdateEmailSecondaryOtpRequest, AppSyncThemeRequest, RpcEthChainId, FrameSwitchNetworkResponse, AppSyncDappDataRequest, FrameGetSmartAccountEnabledNetworksResponse, FrameUpdateEmailResponse, AppGetSocialRedirectUriRequest, FrameGetSocialRedirectUriResponse, FrameConnectSocialResponse, FrameConnectFarcasterResponse, FrameGetFarcasterUriResponse, AppConnectSocialRequest, AppSetPreferredAccountRequest, FrameSetPreferredAccountResponse, WalletGetCapabilitiesRequest, WalletGrantPermissionsRequest, RpcSolanaSignMessageRequest, RpcSolanaSignTransactionRequest, RpcSolanaSignAndSendTransactionRequest, RpcSolanaSignAllTransactionsRequest } from './W3mFrameSchema.js';
3
+ import type { W3mFrameRpcConstants } from './W3mFrameConstants.js';
4
+ import type { CaipNetworkId } from '@reown/appkit-common';
5
+ export declare namespace W3mFrameTypes {
6
+ type AppEvent = z.infer<typeof W3mFrameSchema.appEvent>;
7
+ type FrameEvent = z.infer<typeof W3mFrameSchema.frameEvent>;
8
+ interface Requests {
9
+ AppConnectEmailRequest: z.infer<typeof AppConnectEmailRequest>;
10
+ AppConnectOtpRequest: z.infer<typeof AppConnectOtpRequest>;
11
+ AppGetUserRequest: z.infer<typeof AppGetUserRequest>;
12
+ AppSwitchNetworkRequest: z.infer<typeof AppSwitchNetworkRequest>;
13
+ AppSyncThemeRequest: z.infer<typeof AppSyncThemeRequest>;
14
+ AppSyncDappDataRequest: z.infer<typeof AppSyncDappDataRequest>;
15
+ AppUpdateEmailRequest: z.infer<typeof AppUpdateEmailRequest>;
16
+ AppUpdateEmailPrimaryOtpRequest: z.infer<typeof AppUpdateEmailPrimaryOtpRequest>;
17
+ AppUpdateEmailSecondaryOtpRequest: z.infer<typeof AppUpdateEmailSecondaryOtpRequest>;
18
+ AppGetSocialRedirectUriRequest: z.infer<typeof AppGetSocialRedirectUriRequest>;
19
+ AppSetPreferredAccountRequest: z.infer<typeof AppSetPreferredAccountRequest>;
20
+ AppConnectSocialRequest: z.infer<typeof AppConnectSocialRequest>;
21
+ AppGetSmartAccountEnabledNetworksRequest: undefined;
22
+ AppGetChainIdRequest: undefined;
23
+ AppIsConnectedRequest: undefined;
24
+ AppConnectDeviceRequest: undefined;
25
+ AppSignOutRequest: undefined;
26
+ AppRpcRequest: RPCRequest;
27
+ AppGetFarcasterUriRequest: undefined;
28
+ AppConnectFarcasterRequest: undefined;
29
+ }
30
+ interface Responses {
31
+ FrameConnectEmailResponse: z.infer<typeof FrameConnectEmailResponse>;
32
+ FrameConnectOtpResponse: undefined;
33
+ FrameGetUserResponse: z.infer<typeof FrameGetUserResponse>;
34
+ FrameSwitchNetworkResponse: z.infer<typeof FrameSwitchNetworkResponse>;
35
+ FrameGetChainIdResponse: z.infer<typeof FrameGetChainIdResponse>;
36
+ FrameIsConnectedResponse: z.infer<typeof FrameIsConnectedResponse>;
37
+ FrameGetSmartAccountEnabledNetworksResponse: z.infer<typeof FrameGetSmartAccountEnabledNetworksResponse>;
38
+ FrameUpdateEmailResponse: z.infer<typeof FrameUpdateEmailResponse>;
39
+ FrameGetSocialRedirectUriResponse: z.infer<typeof FrameGetSocialRedirectUriResponse>;
40
+ FrameConnectSocialResponse: z.infer<typeof FrameConnectSocialResponse>;
41
+ FrameGetFarcasterUriResponse: z.infer<typeof FrameGetFarcasterUriResponse>;
42
+ FrameConnectFarcasterResponse: z.infer<typeof FrameConnectFarcasterResponse>;
43
+ FrameSyncThemeResponse: undefined;
44
+ FrameSyncDappDataResponse: undefined;
45
+ FrameUpdateEmailPrimaryOtpResponse: undefined;
46
+ FrameUpdateEmailSecondaryOtpResponse: z.infer<typeof FrameUpdateEmailSecondaryOtpResponse>;
47
+ FrameConnectDeviceResponse: undefined;
48
+ FrameSetPreferredAccountResponse: z.infer<typeof FrameSetPreferredAccountResponse>;
49
+ FrameSignOutResponse: undefined;
50
+ FrameRpcResponse: RPCResponse;
51
+ }
52
+ interface Network {
53
+ rpcUrl: string;
54
+ chainId: number | CaipNetworkId;
55
+ }
56
+ type RPCRequest = z.infer<typeof RpcEthAccountsRequest> | z.infer<typeof RpcEthBlockNumber> | z.infer<typeof RpcEthCall> | z.infer<typeof RpcEthChainId> | z.infer<typeof RpcEthEstimateGas> | z.infer<typeof RpcEthFeeHistory> | z.infer<typeof RpcEthGasPrice> | z.infer<typeof RpcEthGetAccount> | z.infer<typeof RpcEthGetBalance> | z.infer<typeof RpcEthGetBlockyByHash> | z.infer<typeof RpcEthGetBlockByNumber> | z.infer<typeof RpcEthGetBlockReceipts> | z.infer<typeof RcpEthGetBlockTransactionCountByHash> | z.infer<typeof RcpEthGetBlockTransactionCountByNumber> | z.infer<typeof RpcEthGetCode> | z.infer<typeof RpcEthGetFilter> | z.infer<typeof RpcEthGetFilterLogs> | z.infer<typeof RpcEthGetLogs> | z.infer<typeof RpcEthGetProof> | z.infer<typeof RpcEthGetStorageAt> | z.infer<typeof RpcEthGetTransactionByBlockHashAndIndex> | z.infer<typeof RpcEthGetTransactionByBlockNumberAndIndex> | z.infer<typeof RpcEthGetTransactionByHash> | z.infer<typeof RpcEthGetTransactionCount> | z.infer<typeof RpcEthGetTransactionReceipt> | z.infer<typeof RpcEthGetUncleCountByBlockHash> | z.infer<typeof RpcEthGetUncleCountByBlockNumber> | z.infer<typeof RpcEthMaxPriorityFeePerGas> | z.infer<typeof RpcEthNewBlockFilter> | z.infer<typeof RpcEthNewFilter> | z.infer<typeof RpcEthNewPendingTransactionFilter> | z.infer<typeof RpcEthSendRawTransaction> | z.infer<typeof RpcEthSyncing> | z.infer<typeof RpcUnistallFilter> | z.infer<typeof RpcPersonalSignRequest> | z.infer<typeof RpcEthSignTypedDataV4> | z.infer<typeof RpcEthSendTransactionRequest> | z.infer<typeof RpcSolanaSignMessageRequest> | z.infer<typeof RpcSolanaSignTransactionRequest> | z.infer<typeof RpcSolanaSignAllTransactionsRequest> | z.infer<typeof RpcSolanaSignAndSendTransactionRequest> | z.infer<typeof WalletSendCallsRequest> | z.infer<typeof WalletGetCallsReceiptRequest> | z.infer<typeof WalletGetCapabilitiesRequest> | z.infer<typeof WalletGrantPermissionsRequest>;
57
+ type RPCResponse = z.infer<typeof RpcResponse>;
58
+ type FrameSessionType = z.infer<typeof FrameSession>;
59
+ type AccountType = (typeof W3mFrameRpcConstants.ACCOUNT_TYPES)[keyof typeof W3mFrameRpcConstants.ACCOUNT_TYPES];
60
+ type SocialProvider = 'google' | 'github' | 'apple' | 'facebook' | 'x' | 'discord';
61
+ type ProviderRequestType = 'GetUser' | 'GetFarcasterUri' | 'ConnectDevice' | 'ConnectEmail' | 'ConnectSocial' | 'ConnectFarcaster' | 'ConnectOtp' | 'GetSocialRedirectUri' | 'SwitchNetwork' | 'UpdateEmail' | 'SyncTheme' | 'SyncDappData' | 'UpdateEmailPrimaryOtp' | 'UpdateEmailSecondaryOtp' | 'GetSmartAccountEnabledNetworks' | 'GetChainId' | 'IsConnected' | 'SetPreferredAccount' | 'SignOut' | 'Rpc';
62
+ type WalletCapabilities = Record<string, any>;
63
+ }
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@reown/appkit-wallet",
3
+ "version": "0.0.3",
4
+ "type": "module",
5
+ "main": "./dist/esm/index.js",
6
+ "types": "./dist/types/index.d.ts",
7
+ "files": [
8
+ "dist",
9
+ "!tsconfig.tsbuildinfo"
10
+ ],
11
+ "dependencies": {
12
+ "@walletconnect/logger": "2.1.2",
13
+ "zod": "3.22.4",
14
+ "@reown/appkit-common": "0.0.3",
15
+ "@reown/appkit-polyfills": "0.0.3"
16
+ },
17
+ "author": "reown <reown.com>",
18
+ "license": "Apache-2.0",
19
+ "homepage": "https://github.com/web3modal/web3modal",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/WalletConnect/shadow-appkit.git"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/web3modal/web3modal/issues"
26
+ },
27
+ "devDependencies": {
28
+ "jsdom": "24.1.0",
29
+ "vitest": "2.0.3",
30
+ "@vitest/coverage-v8": "2.0.5"
31
+ },
32
+ "scripts": {
33
+ "build:clean": "rm -rf dist",
34
+ "build": "tsc --build",
35
+ "watch": "tsc --watch",
36
+ "typecheck": "tsc --noEmit",
37
+ "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
38
+ "test": "vitest run --dir tests"
39
+ }
40
+ }
package/readme.md ADDED
@@ -0,0 +1,11 @@
1
+ #### 📚 [Documentation](https://docs.walletconnect.com/2.0/web3modal/about)
2
+
3
+ #### 🔗 [Website](https://web3modal.com)
4
+
5
+ # Web3Modal
6
+
7
+ Your on-ramp to web3 multichain. Web3Modal is a versatile library that makes it super easy to connect users with your Dapp and start interacting with the blockchain.
8
+
9
+ <p align="center">
10
+ <img src="./.github/assets/header.png" alt="" border="0">
11
+ </p>