@getpara/evm-wallet-connectors 2.0.0-alpha.29 → 2.0.0-alpha.30
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/providers/EvmExternalWalletContext.d.ts +2 -2
- package/dist/providers/EvmExternalWalletContext.js +18 -3
- package/dist/providers/ParaEvmContext.js +42 -14
- package/dist/providers/createParaWagmiConfig.js +1 -0
- package/dist/types/Wallet.d.ts +3 -0
- package/dist/types/utils.d.ts +1 -1
- package/dist/wallets/connectors/farcaster/farcaster.d.ts +2 -0
- package/dist/wallets/connectors/farcaster/farcaster.js +22 -0
- package/dist/wallets/connectors/farcaster/farcasterIcon.d.ts +1 -0
- package/dist/wallets/connectors/farcaster/farcasterIcon.js +6 -0
- package/dist/wallets/connectors/index.d.ts +2 -1
- package/dist/wallets/connectors/index.js +2 -0
- package/dist/wallets/connectorsForWallets.d.ts +4 -1
- package/dist/wallets/connectorsForWallets.js +13 -2
- package/package.json +11 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { type BalanceManagement, type ChainManagement, type ConnectParaEmbedded, type ExternalWalletContextType, type ExternalWalletProviderConfigBase } from '@getpara/react-common';
|
|
2
|
+
import { FarcasterMiniAppManagement, type BalanceManagement, type ChainManagement, type ConnectParaEmbedded, type ExternalWalletContextType, type ExternalWalletProviderConfigBase } from '@getpara/react-common';
|
|
3
3
|
import { TExternalHooks } from './externalHooks.js';
|
|
4
4
|
export type EvmExternalWalletContextType = ExternalWalletContextType & ChainManagement<number> & BalanceManagement & ConnectParaEmbedded & TExternalHooks & {
|
|
5
5
|
username?: string;
|
|
6
6
|
avatar?: string;
|
|
7
|
-
};
|
|
7
|
+
} & FarcasterMiniAppManagement;
|
|
8
8
|
export declare const EvmExternalWalletContext: import("react").Context<EvmExternalWalletContextType>;
|
|
9
9
|
export type EvmExternalWalletProviderConfig = ExternalWalletProviderConfigBase;
|
|
10
10
|
export declare function EvmExternalWalletProvider({ children, onSwitchWallet, para, walletsWithFullAuth, connectedWallet, includeWalletVerification, connectionOnly, }: EvmExternalWalletProviderConfig & PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
@@ -111,10 +111,10 @@ function EvmExternalWalletProvider({
|
|
|
111
111
|
);
|
|
112
112
|
useEffect(() => {
|
|
113
113
|
const storedExternalWallet = getStoredExternalWallets()[wagmiAddress != null ? wagmiAddress : ""];
|
|
114
|
-
if (!isConnecting && !isReconnecting && !isLocalConnecting && !!wagmiAddress && !storedExternalWallet && (connectedConnector == null ? void 0 : connectedConnector.id) !== "para" && !isLinkingAccount.current) {
|
|
114
|
+
if (!isConnecting && !isReconnecting && !isLocalConnecting && !!wagmiAddress && !storedExternalWallet && (connectedConnector == null ? void 0 : connectedConnector.id) !== "para" && !isLinkingAccount.current && para.isReady && !para.isFarcasterMiniApp) {
|
|
115
115
|
reset();
|
|
116
116
|
}
|
|
117
|
-
}, [isConnected, isLocalConnecting, wagmiAddress, connectedConnector]);
|
|
117
|
+
}, [isConnected, isLocalConnecting, wagmiAddress, connectedConnector, para.isReady, para.isFarcasterMiniApp]);
|
|
118
118
|
useEffect(() => {
|
|
119
119
|
const storedExternalWallet = Object.values(para.externalWallets || {})[0];
|
|
120
120
|
if (!isLocalConnecting && isConnected && (storedExternalWallet == null ? void 0 : storedExternalWallet.type) === "EVM" && (storedExternalWallet == null ? void 0 : storedExternalWallet.address) !== wagmiAddress && (connectedConnector == null ? void 0 : connectedConnector.id) !== "para" && !isLinkingAccount.current) {
|
|
@@ -395,6 +395,20 @@ function EvmExternalWalletProvider({
|
|
|
395
395
|
};
|
|
396
396
|
});
|
|
397
397
|
const username = useMemo(() => ensName != null ? ensName : wagmiAddress, [ensName, wagmiAddress]);
|
|
398
|
+
const farcasterStatus = useMemo(() => {
|
|
399
|
+
var _a;
|
|
400
|
+
const connection = connections.find(
|
|
401
|
+
(c) => {
|
|
402
|
+
var _a2;
|
|
403
|
+
return ((_a2 = c.connector.paraDetails) == null ? void 0 : _a2.internalId) === "FARCASTER";
|
|
404
|
+
}
|
|
405
|
+
);
|
|
406
|
+
if (!connection) {
|
|
407
|
+
return void 0;
|
|
408
|
+
}
|
|
409
|
+
const address = (_a = connection == null ? void 0 : connection.accounts) == null ? void 0 : _a[0];
|
|
410
|
+
return address ? { isConnected: true, address } : { isConnected: false };
|
|
411
|
+
}, [connections]);
|
|
398
412
|
const connectParaEmbedded = useCallback(() => __async(this, null, function* () {
|
|
399
413
|
const paraConnectorInstance = connectors.find((c) => c.id === "para");
|
|
400
414
|
if (!paraConnectorInstance) {
|
|
@@ -430,7 +444,8 @@ function EvmExternalWalletProvider({
|
|
|
430
444
|
signVerificationMessage,
|
|
431
445
|
getWalletBalance,
|
|
432
446
|
requestInfo,
|
|
433
|
-
disconnectBase
|
|
447
|
+
disconnectBase,
|
|
448
|
+
farcasterStatus
|
|
434
449
|
}, externalHooks),
|
|
435
450
|
children
|
|
436
451
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
+
__async,
|
|
3
4
|
__objRest,
|
|
4
5
|
__spreadProps,
|
|
5
6
|
__spreadValues
|
|
6
7
|
} from "../chunk-MMUBH76A.js";
|
|
7
8
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
import { useMemo, useRef } from "react";
|
|
9
|
-
import { createConfig, WagmiProvider } from "wagmi";
|
|
9
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
10
|
+
import { createConfig as createWagmiConfig, WagmiProvider } from "wagmi";
|
|
10
11
|
import { connectorsForWallets } from "../wallets/connectorsForWallets.js";
|
|
11
12
|
import { http } from "viem";
|
|
12
13
|
import { computeWalletConnectMetaData } from "../utils/computeWalletConnectMetaData.js";
|
|
@@ -14,6 +15,7 @@ import { EvmExternalWalletProvider } from "./EvmExternalWalletContext.js";
|
|
|
14
15
|
import { paraConnector } from "@getpara/wagmi-v2-connector";
|
|
15
16
|
import { setWagmiConfig, getWagmiConfig } from "../stores/wagmiConfigStore.js";
|
|
16
17
|
import { resolveWalletList } from "../utils/resolveWalletList.js";
|
|
18
|
+
import { farcasterWallet } from "../wallets/connectors/index.js";
|
|
17
19
|
const createDefaultTransports = (chains) => {
|
|
18
20
|
const transportsObject = chains.reduce((acc, chain) => {
|
|
19
21
|
const key = chain.id;
|
|
@@ -28,7 +30,6 @@ function ParaEvmProvider({
|
|
|
28
30
|
config: _config,
|
|
29
31
|
wagmiProviderProps
|
|
30
32
|
}) {
|
|
31
|
-
const prevWallets = useRef(null);
|
|
32
33
|
const para = internalConfig.para;
|
|
33
34
|
const _a = _config, {
|
|
34
35
|
projectId,
|
|
@@ -36,7 +37,7 @@ function ParaEvmProvider({
|
|
|
36
37
|
appDescription,
|
|
37
38
|
appIcon,
|
|
38
39
|
appUrl,
|
|
39
|
-
wallets,
|
|
40
|
+
wallets: propsWallets,
|
|
40
41
|
chains,
|
|
41
42
|
transports,
|
|
42
43
|
paraConnectorOptions
|
|
@@ -51,6 +52,10 @@ function ParaEvmProvider({
|
|
|
51
52
|
"transports",
|
|
52
53
|
"paraConnectorOptions"
|
|
53
54
|
]);
|
|
55
|
+
const propsWalletList = useMemo(() => {
|
|
56
|
+
return resolveWalletList(propsWallets != null ? propsWallets : []);
|
|
57
|
+
}, [propsWallets]);
|
|
58
|
+
const prevWallets = useRef(propsWalletList);
|
|
54
59
|
const paraConnectorInstance = useMemo(() => {
|
|
55
60
|
return paraConnector({
|
|
56
61
|
para,
|
|
@@ -60,15 +65,16 @@ function ParaEvmProvider({
|
|
|
60
65
|
options: paraConnectorOptions != null ? paraConnectorOptions : {}
|
|
61
66
|
});
|
|
62
67
|
}, [para]);
|
|
63
|
-
const
|
|
64
|
-
if (!prevWallets.current) {
|
|
65
|
-
prevWallets.current = wallets;
|
|
66
|
-
}
|
|
68
|
+
const createConfig = (walletList, createFarcasterConnector) => {
|
|
67
69
|
const existing = getWagmiConfig();
|
|
68
|
-
if (existing && prevWallets.current ===
|
|
70
|
+
if (existing && prevWallets.current === walletList) {
|
|
71
|
+
return existing;
|
|
72
|
+
}
|
|
73
|
+
prevWallets.current = walletList;
|
|
69
74
|
const wcMetadata = computeWalletConnectMetaData({ appName, appDescription, appUrl, appIcon });
|
|
70
|
-
const
|
|
71
|
-
|
|
75
|
+
const baseConnectors = connectorsForWallets(walletList, {
|
|
76
|
+
para,
|
|
77
|
+
createFarcasterConnector,
|
|
72
78
|
projectId,
|
|
73
79
|
appName,
|
|
74
80
|
appDescription,
|
|
@@ -77,7 +83,7 @@ function ParaEvmProvider({
|
|
|
77
83
|
walletConnectParameters: { metadata: wcMetadata }
|
|
78
84
|
});
|
|
79
85
|
const allConnectors = [...baseConnectors, paraConnectorInstance];
|
|
80
|
-
const createdConfig =
|
|
86
|
+
const createdConfig = createWagmiConfig(__spreadProps(__spreadValues({
|
|
81
87
|
ssr: true
|
|
82
88
|
}, wagmiConfigParams), {
|
|
83
89
|
chains,
|
|
@@ -85,9 +91,31 @@ function ParaEvmProvider({
|
|
|
85
91
|
connectors: allConnectors
|
|
86
92
|
}));
|
|
87
93
|
setWagmiConfig(createdConfig);
|
|
88
|
-
prevWallets.current = wallets;
|
|
89
94
|
return createdConfig;
|
|
90
|
-
}
|
|
95
|
+
};
|
|
96
|
+
const [config, setConfig] = useState(null);
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (!para.isReady) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const initializeConfig = () => __async(this, null, function* () {
|
|
102
|
+
var _a2;
|
|
103
|
+
if (para.isFarcasterMiniApp) {
|
|
104
|
+
let createFarcasterConnector = null;
|
|
105
|
+
try {
|
|
106
|
+
createFarcasterConnector = (_a2 = (yield import("@farcaster/miniapp-wagmi-connector")).farcasterMiniApp) != null ? _a2 : void 0;
|
|
107
|
+
} catch (e) {
|
|
108
|
+
}
|
|
109
|
+
setConfig(createConfig([...propsWalletList, farcasterWallet], createFarcasterConnector));
|
|
110
|
+
} else {
|
|
111
|
+
setConfig(createConfig([...propsWalletList]));
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
initializeConfig();
|
|
115
|
+
}, [para.isFarcasterMiniApp, para.isReady, propsWalletList]);
|
|
116
|
+
if (!config) {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
91
119
|
return /* @__PURE__ */ jsx(WagmiProvider, __spreadProps(__spreadValues({ config }, wagmiProviderProps), { children: /* @__PURE__ */ jsx(EvmExternalWalletProvider, __spreadProps(__spreadValues({}, internalConfig), { children })) }));
|
|
92
120
|
}
|
|
93
121
|
export {
|
|
@@ -35,6 +35,7 @@ function createParaWagmiConfig(para, cfg) {
|
|
|
35
35
|
const wcMetadata = computeWalletConnectMetaData({ appName, appDescription, appUrl, appIcon });
|
|
36
36
|
const walletFactories = resolveWalletList(wallets);
|
|
37
37
|
const baseConnectors = connectorsForWallets(walletFactories, {
|
|
38
|
+
para,
|
|
38
39
|
projectId,
|
|
39
40
|
appName,
|
|
40
41
|
appDescription,
|
package/dist/types/Wallet.d.ts
CHANGED
|
@@ -3,12 +3,15 @@ import { WalletConnectParameters } from 'wagmi/connectors';
|
|
|
3
3
|
import { CoinbaseWalletOptions } from '../wallets/connectors/coinbase/coinbase.js';
|
|
4
4
|
import { WalletConnectWalletOptions } from '../wallets/connectors/walletConnect/walletConnect.js';
|
|
5
5
|
import { type WalletMetadata } from '@getpara/react-common';
|
|
6
|
+
import ParaWeb from '@getpara/web-sdk';
|
|
6
7
|
export type Wallet = {
|
|
7
8
|
createConnector?: (walletDetails: WalletDetailsParams) => CreateConnectorFn;
|
|
8
9
|
createMobileConnector?: (walletDetails: WalletDetailsParams) => CreateConnectorFn;
|
|
9
10
|
getUri?: (uri: string) => string;
|
|
10
11
|
} & WalletMetadata;
|
|
11
12
|
export interface DefaultWalletOptions {
|
|
13
|
+
para?: ParaWeb;
|
|
14
|
+
createFarcasterConnector?: () => any;
|
|
12
15
|
projectId: string;
|
|
13
16
|
walletConnectParameters?: ParaWalletConnectParameters;
|
|
14
17
|
}
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type Mutable<type extends object> = {
|
|
|
9
9
|
};
|
|
10
10
|
/** Strict version of built-in Omit type */
|
|
11
11
|
export type Omit<type, keys extends keyof type> = Pick<type, Exclude<keyof type, keys>>;
|
|
12
|
-
export type WalletProviderFlags = 'isApexWallet' | 'isAvalanche' | 'isBackpack' | 'isBifrost' | 'isBitKeep' | 'isBitski' | 'isBlockWallet' | 'isBraveWallet' | 'isCoinbaseWallet' | 'isDawn' | 'isEnkrypt' | 'isExodus' | 'isFrame' | 'isFrontier' | 'isGamestop' | 'isHyperPay' | 'isImToken' | 'isKuCoinWallet' | 'isMathWallet' | 'isMetaMask' | 'isNestWallet' | 'isOkxWallet' | 'isOKExWallet' | 'isOneInchAndroidWallet' | 'isOneInchIOSWallet' | 'isOpera' | 'isPhantom' | 'isPortal' | 'isRabby' | 'isRainbow' | 'isSafe' | 'isStatus' | 'isTally' | 'isTokenPocket' | 'isTokenary' | 'isTrust' | 'isTrustWallet' | 'isXDEFI' | 'isZerion' | 'isTalisman' | 'isZeal' | 'isCoin98' | 'isMEWwallet' | 'isSafeheron' | 'isSafePal' | '__seif';
|
|
12
|
+
export type WalletProviderFlags = 'isApexWallet' | 'isAvalanche' | 'isBackpack' | 'isBifrost' | 'isBitKeep' | 'isBitski' | 'isBlockWallet' | 'isBraveWallet' | 'isCoinbaseWallet' | 'isDawn' | 'isEnkrypt' | 'isExodus' | 'isFarcaster' | 'isFrame' | 'isFrontier' | 'isGamestop' | 'isHyperPay' | 'isImToken' | 'isKuCoinWallet' | 'isMathWallet' | 'isMetaMask' | 'isNestWallet' | 'isOkxWallet' | 'isOKExWallet' | 'isOneInchAndroidWallet' | 'isOneInchIOSWallet' | 'isOpera' | 'isPhantom' | 'isPortal' | 'isRabby' | 'isRainbow' | 'isSafe' | 'isStatus' | 'isTally' | 'isTokenPocket' | 'isTokenary' | 'isTrust' | 'isTrustWallet' | 'isXDEFI' | 'isZerion' | 'isTalisman' | 'isZeal' | 'isCoin98' | 'isMEWwallet' | 'isSafeheron' | 'isSafePal' | '__seif';
|
|
13
13
|
export type WalletProvider = Evaluate<EIP1193Provider & {
|
|
14
14
|
[key in WalletProviderFlags]?: true | undefined;
|
|
15
15
|
} & {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { createConnector } from "wagmi";
|
|
6
|
+
import { icon } from "./farcasterIcon.js";
|
|
7
|
+
const farcasterWallet = ({ para, createFarcasterConnector }) => {
|
|
8
|
+
return {
|
|
9
|
+
id: "farcaster",
|
|
10
|
+
internalId: "FARCASTER",
|
|
11
|
+
name: "Farcaster",
|
|
12
|
+
rdns: "xyz.farcaster.MiniAppWallet",
|
|
13
|
+
iconUrl: icon,
|
|
14
|
+
installed: (para == null ? void 0 : para.isReady) && (para == null ? void 0 : para.isFarcasterMiniApp),
|
|
15
|
+
isExtension: true,
|
|
16
|
+
downloadUrl: "https://warpcast.xyz/",
|
|
17
|
+
createConnector: (walletDetails) => createConnector((config) => __spreadValues(__spreadValues({}, createFarcasterConnector()(config)), walletDetails))
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
farcasterWallet
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const icon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDI1NiAyNTYiIGZpbGw9Im5vbmUiPjxyZWN0IHdpZHRoPSIyNTYiIGhlaWdodD0iMjU2IiByeD0iNTYiIGZpbGw9IiM3QzY1QzEiPjwvcmVjdD48cGF0aCBkPSJNMTgzLjI5NiA3MS42OEgyMTE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MOTQuNTIzOCAxOTEuNDk2Qzk3Ljc3MDIgMTkxLjY2IDEwMC4zNTIgMTk0LjM0NSAxMDAuMzUyIDE5Ny42MzJWMjAyLjc1Mkg0My4wMDc4VjE5Ny42MzJDNDMuMDA3OCAxOTQuMzQ1IDQ1LjU4OTQgMTkxLjY2IDQ4LjgzNTggMTkxLjQ5Nkw0OS4xNTE4IDE5MS40ODhWMTg2LjM2OEM0OS4xNTE4IDE4My4wODEgNTEuNzMzNCAxODAuMzk2IDU0Ljk3OTggMTgwLjIzMkw1NS4yOTU4IDE4MC4yMjRWOTQuMjA4SDQ4LjEyNzhMNDQuMDMxOCA3MS42OEg3Mi43MDM4VjU0LjI3MkgxODMuMjk2VjcxLjY4WiIgZmlsbD0id2hpdGUiPjwvcGF0aD48L3N2Zz4K";
|
|
4
|
+
export {
|
|
5
|
+
icon
|
|
6
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { farcasterWallet } from './farcaster/farcaster.js';
|
|
1
2
|
import { metaMaskWallet } from './metaMask/metaMask.js';
|
|
2
3
|
import { rainbowWallet } from './rainbow/rainbow.js';
|
|
3
4
|
import { walletConnectWallet } from './walletConnect/walletConnect.js';
|
|
@@ -10,5 +11,5 @@ import { backpackWallet } from './backpack/backpack.js';
|
|
|
10
11
|
import { hahaWallet } from './haha/haha.js';
|
|
11
12
|
import { phantomWallet } from './phantom/phantom.js';
|
|
12
13
|
import { valoraWallet } from './valora/valora.js';
|
|
13
|
-
export { metaMaskWallet, rainbowWallet, walletConnectWallet, coinbaseWallet, zerionWallet, rabbyWallet, safeWallet, okxWallet, backpackWallet, hahaWallet, phantomWallet, valoraWallet, };
|
|
14
|
+
export { farcasterWallet, metaMaskWallet, rainbowWallet, walletConnectWallet, coinbaseWallet, zerionWallet, rabbyWallet, safeWallet, okxWallet, backpackWallet, hahaWallet, phantomWallet, valoraWallet, };
|
|
14
15
|
export declare const allWallets: ((({ appName, appIcon }: import("./coinbase/coinbase.js").CoinbaseWalletOptions) => import("../../types/Wallet.js").Wallet) | (({ projectId, options }: import("./walletConnect/walletConnect.js").WalletConnectWalletOptions) => import("../../types/Wallet.js").Wallet) | (({ projectId, walletConnectParameters }: import("./metaMask/metaMask.js").MetaMaskWalletOptions) => import("../../types/Wallet.js").Wallet))[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../../chunk-MMUBH76A.js";
|
|
3
|
+
import { farcasterWallet } from "./farcaster/farcaster.js";
|
|
3
4
|
import { metaMaskWallet } from "./metaMask/metaMask.js";
|
|
4
5
|
import { rainbowWallet } from "./rainbow/rainbow.js";
|
|
5
6
|
import { walletConnectWallet } from "./walletConnect/walletConnect.js";
|
|
@@ -30,6 +31,7 @@ export {
|
|
|
30
31
|
allWallets,
|
|
31
32
|
backpackWallet,
|
|
32
33
|
coinbaseWallet,
|
|
34
|
+
farcasterWallet,
|
|
33
35
|
hahaWallet,
|
|
34
36
|
metaMaskWallet,
|
|
35
37
|
okxWallet,
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { CreateConnectorFn } from 'wagmi';
|
|
2
2
|
import type { WalletList } from '../types/Wallet.js';
|
|
3
3
|
import type { ParaWalletConnectParameters, Wallet } from '../types/Wallet.js';
|
|
4
|
+
import ParaWeb from '@getpara/web-sdk';
|
|
4
5
|
export interface WalletListItem extends Wallet {
|
|
5
6
|
index: number;
|
|
6
7
|
}
|
|
7
8
|
export interface ConnectorsForWalletsParameters {
|
|
9
|
+
para: ParaWeb;
|
|
10
|
+
createFarcasterConnector?: () => any;
|
|
8
11
|
projectId: string;
|
|
9
12
|
appName: string;
|
|
10
13
|
appDescription?: string;
|
|
@@ -12,4 +15,4 @@ export interface ConnectorsForWalletsParameters {
|
|
|
12
15
|
appIcon?: string;
|
|
13
16
|
walletConnectParameters?: ParaWalletConnectParameters;
|
|
14
17
|
}
|
|
15
|
-
export declare const connectorsForWallets: (walletList: WalletList, { projectId, walletConnectParameters, appName, appDescription, appUrl, appIcon }: ConnectorsForWalletsParameters) => CreateConnectorFn[];
|
|
18
|
+
export declare const connectorsForWallets: (walletList: WalletList, { para, projectId, walletConnectParameters, appName, appDescription, appUrl, appIcon, createFarcasterConnector, }: ConnectorsForWalletsParameters) => CreateConnectorFn[];
|
|
@@ -7,7 +7,16 @@ import {
|
|
|
7
7
|
import { uniqueBy } from "../utils/uniqueBy.js";
|
|
8
8
|
import { computeWalletConnectMetaData } from "../utils/computeWalletConnectMetaData.js";
|
|
9
9
|
import { omitUndefinedValues } from "../utils/omitUndefinedValues.js";
|
|
10
|
-
const connectorsForWallets = (walletList, {
|
|
10
|
+
const connectorsForWallets = (walletList, {
|
|
11
|
+
para,
|
|
12
|
+
projectId,
|
|
13
|
+
walletConnectParameters,
|
|
14
|
+
appName,
|
|
15
|
+
appDescription,
|
|
16
|
+
appUrl,
|
|
17
|
+
appIcon,
|
|
18
|
+
createFarcasterConnector
|
|
19
|
+
}) => {
|
|
11
20
|
if (!walletList.length) {
|
|
12
21
|
return [];
|
|
13
22
|
}
|
|
@@ -23,6 +32,7 @@ const connectorsForWallets = (walletList, { projectId, walletConnectParameters,
|
|
|
23
32
|
walletList.forEach((createWallet) => {
|
|
24
33
|
index++;
|
|
25
34
|
const wallet = createWallet({
|
|
35
|
+
para,
|
|
26
36
|
projectId,
|
|
27
37
|
appName,
|
|
28
38
|
appIcon,
|
|
@@ -34,7 +44,8 @@ const connectorsForWallets = (walletList, { projectId, walletConnectParameters,
|
|
|
34
44
|
// `walletConnectWallet` wallet will have `walletConnectParameters` property
|
|
35
45
|
walletConnectParameters: __spreadValues({
|
|
36
46
|
metadata: walletConnectMetaData
|
|
37
|
-
}, walletConnectParameters)
|
|
47
|
+
}, walletConnectParameters),
|
|
48
|
+
createFarcasterConnector
|
|
38
49
|
});
|
|
39
50
|
const walletListItem = __spreadProps(__spreadValues({}, wallet), {
|
|
40
51
|
index
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/evm-wallet-connectors",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.30",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@coinbase/wallet-sdk": "4.3.0",
|
|
6
|
-
"@getpara/wagmi-v2-connector": "2.0.0-alpha.
|
|
7
|
-
"@getpara/web-sdk": "2.0.0-alpha.
|
|
6
|
+
"@getpara/wagmi-v2-connector": "2.0.0-alpha.30",
|
|
7
|
+
"@getpara/web-sdk": "2.0.0-alpha.30",
|
|
8
8
|
"zustand": "^4.5.2",
|
|
9
9
|
"zustand-sync-tabs": "^0.2.2"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@getpara/react-common": "2.0.0-alpha.
|
|
12
|
+
"@getpara/react-common": "2.0.0-alpha.30",
|
|
13
13
|
"@tanstack/react-query": "^5.74.0",
|
|
14
14
|
"@types/react": "^18.0.31",
|
|
15
15
|
"@types/react-dom": "^18.2.7",
|
|
@@ -25,15 +25,21 @@
|
|
|
25
25
|
"dist",
|
|
26
26
|
"package.json"
|
|
27
27
|
],
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "8b06219b9c248a3fbdbd05dc7501e8042c369301",
|
|
29
29
|
"main": "dist/index.js",
|
|
30
30
|
"peerDependencies": {
|
|
31
|
+
"@farcaster/miniapp-wagmi-connector": "^1.0.0",
|
|
31
32
|
"@tanstack/react-query": ">=5.0.0",
|
|
32
33
|
"react": ">=18",
|
|
33
34
|
"react-dom": ">=18",
|
|
34
35
|
"viem": "2.x",
|
|
35
36
|
"wagmi": "^2.9.0"
|
|
36
37
|
},
|
|
38
|
+
"peerDependenciesMeta": {
|
|
39
|
+
"@farcaster/miniapp-wagmi-connector": {
|
|
40
|
+
"optional": true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
37
43
|
"scripts": {
|
|
38
44
|
"build": "rm -rf dist && yarn typegen && node ./scripts/build.mjs",
|
|
39
45
|
"test": "vitest run --coverage",
|