@orderly.network/wallet-connector-privy 2.1.0 → 2.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/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # wallet connector privy
2
+
3
+ The new wallet connector consists of three parts:
4
+ - Privy: Privy provides social login, featuring an injected wallet, EVM wallets, and Solana wallets.
5
+ - Wagmi: Wagmi offers connectivity for EVM wallets, such as MetaMask and WalletConnect.
6
+ - Solana: Solana provides connectivity for Solana wallets, such as Phantom and Ledger.
7
+
8
+ ``` javascript
9
+ interface WalletConnectorPrivyProps{
10
+ network: Network;
11
+ customChains?: Chains;
12
+ termsOfUse: string;
13
+ privyConfig?: InitPrivy;
14
+ wagmiConfig?: InitWagmi;
15
+ solanaConfig?: InitSolana;
16
+ }
17
+ ```
18
+
19
+ If privyConfig is not configured, the Privy connector will be disabled.
20
+
21
+ If wagmiConfig is not configured, the Wagmi connector will be disabled.
22
+
23
+ If solanaConfig is not configured, the Solana connector will be disabled.
24
+
25
+ At least one of privyConfig, wagmiConfig, or solanaConfig must be provided.
26
+
27
+ If customChains only includes a Solana chain, then Privy will only display the Solana injected wallet, and the Wagmi connector will be disabled.
28
+
29
+ If customChains only includes EVM chains, then Privy will only display the EVM injected wallet, and the Solana connector will be disabled.
30
+
31
+ eg:
32
+ ``` javascript
33
+ <WalletConnectorPrivyProvider
34
+ termsOfUse="https://learn.woo.org/legal/terms-of-use"
35
+ network={Network.testnet}
36
+ // customChains={customChains}
37
+ privyConfig={{
38
+ appid: "cm50h5kjc011111gdn7i8cd2k",
39
+ config: {
40
+ appearance: {
41
+ theme: "dark",
42
+ accentColor: "#181C23",
43
+ logo: "/orderly-logo.svg",
44
+ },
45
+ },
46
+ }}
47
+ wagmiConfig={{
48
+ connectors: [
49
+ wagmiConnectors.injected(),
50
+ wagmiConnectors.walletConnect({
51
+ projectId: "93dba83e8d9915dc6a65ffd3ecfd19fd",
52
+ showQrModal: true,
53
+ storageOptions: {},
54
+ metadata: {
55
+ name: "Orderly Network",
56
+ description: "Orderly Network",
57
+ url: "https://orderly.network",
58
+ icons: ["https://oss.orderly.network/static/sdk/chains.png"],
59
+ },
60
+ }),
61
+ ],
62
+ }}
63
+ solanaConfig={{
64
+ mainnetRpc: "",
65
+ devnetRpc: "https://api.devnet.solana.com",
66
+ wallets: wallets,
67
+ onError: (error: WalletError, adapter?: Adapter) => {
68
+ console.log("-- error", error, adapter);
69
+ },
70
+ }}
71
+ >
72
+ <OrderlyAppProvider
73
+ configStore={configStore}
74
+ appIcons={config.orderlyAppProvider.appIcons}
75
+ restrictedInfo={config.orderlyAppProvider.restrictedInfo}
76
+ // customChains={customChains}
77
+ >
78
+ {props.children}
79
+ </OrderlyAppProvider>
80
+ </WalletConnectorPrivyProvider>
81
+ ```