@orderly.network/wallet-connector-privy 2.0.8-alpha.0
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/index.d.mts +83 -0
- package/dist/index.d.ts +83 -0
- package/dist/index.js +2350 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2315 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +53 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { Adapter, WalletError, WalletAdapterNetwork, WalletAdapter } from '@solana/wallet-adapter-base';
|
|
3
|
+
import * as WagmiExport from 'wagmi';
|
|
4
|
+
import { CreateConnectorFn, Storage, Connector } from 'wagmi';
|
|
5
|
+
import { PrivyClientConfig } from '@privy-io/react-auth';
|
|
6
|
+
import { Chains } from '@orderly.network/hooks';
|
|
7
|
+
import * as viemExport from 'viem';
|
|
8
|
+
import * as WagmiConnectorsExport from 'wagmi/connectors';
|
|
9
|
+
|
|
10
|
+
type SolanaInitialProps = PropsWithChildren<{
|
|
11
|
+
network?: WalletAdapterNetwork;
|
|
12
|
+
endPoint?: string;
|
|
13
|
+
mainnetRpc?: string;
|
|
14
|
+
devnetRpc?: string;
|
|
15
|
+
wallets?: Adapter[];
|
|
16
|
+
onError?: (error: WalletError, adapter?: Adapter) => void;
|
|
17
|
+
}>;
|
|
18
|
+
declare enum Network {
|
|
19
|
+
mainnet = "mainnet",
|
|
20
|
+
testnet = "testnet"
|
|
21
|
+
}
|
|
22
|
+
declare enum WalletType {
|
|
23
|
+
EVM = "EVM",
|
|
24
|
+
SOL = "SOL",
|
|
25
|
+
PRIVY = "privy"
|
|
26
|
+
}
|
|
27
|
+
interface ConnectProps {
|
|
28
|
+
walletType: WalletType;
|
|
29
|
+
extraType?: string;
|
|
30
|
+
connector?: Connector;
|
|
31
|
+
walletAdapter?: WalletAdapter;
|
|
32
|
+
}
|
|
33
|
+
interface InitPrivy {
|
|
34
|
+
appid: string;
|
|
35
|
+
config?: {
|
|
36
|
+
appearance: Omit<PrivyClientConfig['appearance'], 'walletChainType' | 'walletList'>;
|
|
37
|
+
loginMethods?: PrivyClientConfig['loginMethods'];
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
interface InitWagmi {
|
|
41
|
+
connectors?: CreateConnectorFn[];
|
|
42
|
+
storage?: Storage;
|
|
43
|
+
}
|
|
44
|
+
interface InitSolana {
|
|
45
|
+
mainnetRpc?: string;
|
|
46
|
+
devnetRpc?: string;
|
|
47
|
+
wallets: Adapter[];
|
|
48
|
+
onError: (error: WalletError, adapter?: Adapter) => void;
|
|
49
|
+
}
|
|
50
|
+
declare const SolanaChains: Map<WalletAdapterNetwork, number>;
|
|
51
|
+
declare const SolanaChainsMap: Map<Network | WalletAdapterNetwork, number>;
|
|
52
|
+
interface ConnectorWalletType {
|
|
53
|
+
disableWagmi?: boolean;
|
|
54
|
+
disablePrivy?: boolean;
|
|
55
|
+
disableSolana?: boolean;
|
|
56
|
+
}
|
|
57
|
+
declare enum WalletChainTypeEnum {
|
|
58
|
+
onlyEVM = "onlyEVM",
|
|
59
|
+
onlySOL = "onlySOL",
|
|
60
|
+
EVM_SOL = "EVM_SOL"
|
|
61
|
+
}
|
|
62
|
+
type WalletChainType = WalletChainTypeEnum;
|
|
63
|
+
|
|
64
|
+
interface WalletConnectorPrivyProps extends PropsWithChildren {
|
|
65
|
+
privyConfig?: InitPrivy;
|
|
66
|
+
wagmiConfig?: InitWagmi;
|
|
67
|
+
solanaConfig?: InitSolana;
|
|
68
|
+
network: Network;
|
|
69
|
+
customChains?: Chains;
|
|
70
|
+
termsOfUse: string;
|
|
71
|
+
}
|
|
72
|
+
declare function WalletConnectorPrivyProvider(props: WalletConnectorPrivyProps): React.JSX.Element | null;
|
|
73
|
+
|
|
74
|
+
declare function UserCenter(props: any): React.JSX.Element;
|
|
75
|
+
declare const MwebUserCenter: (props: any) => React.JSX.Element;
|
|
76
|
+
|
|
77
|
+
declare const viem: typeof viemExport;
|
|
78
|
+
|
|
79
|
+
declare const wagmiConnectors: typeof WagmiConnectorsExport;
|
|
80
|
+
|
|
81
|
+
declare const wagmi: typeof WagmiExport;
|
|
82
|
+
|
|
83
|
+
export { type ConnectProps, type ConnectorWalletType, type InitPrivy, type InitSolana, type InitWagmi, MwebUserCenter, Network, SolanaChains, SolanaChainsMap, type SolanaInitialProps, UserCenter, type WalletChainType, WalletChainTypeEnum, WalletConnectorPrivyProvider, WalletType, viem, wagmi, wagmiConnectors };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { Adapter, WalletError, WalletAdapterNetwork, WalletAdapter } from '@solana/wallet-adapter-base';
|
|
3
|
+
import * as WagmiExport from 'wagmi';
|
|
4
|
+
import { CreateConnectorFn, Storage, Connector } from 'wagmi';
|
|
5
|
+
import { PrivyClientConfig } from '@privy-io/react-auth';
|
|
6
|
+
import { Chains } from '@orderly.network/hooks';
|
|
7
|
+
import * as viemExport from 'viem';
|
|
8
|
+
import * as WagmiConnectorsExport from 'wagmi/connectors';
|
|
9
|
+
|
|
10
|
+
type SolanaInitialProps = PropsWithChildren<{
|
|
11
|
+
network?: WalletAdapterNetwork;
|
|
12
|
+
endPoint?: string;
|
|
13
|
+
mainnetRpc?: string;
|
|
14
|
+
devnetRpc?: string;
|
|
15
|
+
wallets?: Adapter[];
|
|
16
|
+
onError?: (error: WalletError, adapter?: Adapter) => void;
|
|
17
|
+
}>;
|
|
18
|
+
declare enum Network {
|
|
19
|
+
mainnet = "mainnet",
|
|
20
|
+
testnet = "testnet"
|
|
21
|
+
}
|
|
22
|
+
declare enum WalletType {
|
|
23
|
+
EVM = "EVM",
|
|
24
|
+
SOL = "SOL",
|
|
25
|
+
PRIVY = "privy"
|
|
26
|
+
}
|
|
27
|
+
interface ConnectProps {
|
|
28
|
+
walletType: WalletType;
|
|
29
|
+
extraType?: string;
|
|
30
|
+
connector?: Connector;
|
|
31
|
+
walletAdapter?: WalletAdapter;
|
|
32
|
+
}
|
|
33
|
+
interface InitPrivy {
|
|
34
|
+
appid: string;
|
|
35
|
+
config?: {
|
|
36
|
+
appearance: Omit<PrivyClientConfig['appearance'], 'walletChainType' | 'walletList'>;
|
|
37
|
+
loginMethods?: PrivyClientConfig['loginMethods'];
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
interface InitWagmi {
|
|
41
|
+
connectors?: CreateConnectorFn[];
|
|
42
|
+
storage?: Storage;
|
|
43
|
+
}
|
|
44
|
+
interface InitSolana {
|
|
45
|
+
mainnetRpc?: string;
|
|
46
|
+
devnetRpc?: string;
|
|
47
|
+
wallets: Adapter[];
|
|
48
|
+
onError: (error: WalletError, adapter?: Adapter) => void;
|
|
49
|
+
}
|
|
50
|
+
declare const SolanaChains: Map<WalletAdapterNetwork, number>;
|
|
51
|
+
declare const SolanaChainsMap: Map<Network | WalletAdapterNetwork, number>;
|
|
52
|
+
interface ConnectorWalletType {
|
|
53
|
+
disableWagmi?: boolean;
|
|
54
|
+
disablePrivy?: boolean;
|
|
55
|
+
disableSolana?: boolean;
|
|
56
|
+
}
|
|
57
|
+
declare enum WalletChainTypeEnum {
|
|
58
|
+
onlyEVM = "onlyEVM",
|
|
59
|
+
onlySOL = "onlySOL",
|
|
60
|
+
EVM_SOL = "EVM_SOL"
|
|
61
|
+
}
|
|
62
|
+
type WalletChainType = WalletChainTypeEnum;
|
|
63
|
+
|
|
64
|
+
interface WalletConnectorPrivyProps extends PropsWithChildren {
|
|
65
|
+
privyConfig?: InitPrivy;
|
|
66
|
+
wagmiConfig?: InitWagmi;
|
|
67
|
+
solanaConfig?: InitSolana;
|
|
68
|
+
network: Network;
|
|
69
|
+
customChains?: Chains;
|
|
70
|
+
termsOfUse: string;
|
|
71
|
+
}
|
|
72
|
+
declare function WalletConnectorPrivyProvider(props: WalletConnectorPrivyProps): React.JSX.Element | null;
|
|
73
|
+
|
|
74
|
+
declare function UserCenter(props: any): React.JSX.Element;
|
|
75
|
+
declare const MwebUserCenter: (props: any) => React.JSX.Element;
|
|
76
|
+
|
|
77
|
+
declare const viem: typeof viemExport;
|
|
78
|
+
|
|
79
|
+
declare const wagmiConnectors: typeof WagmiConnectorsExport;
|
|
80
|
+
|
|
81
|
+
declare const wagmi: typeof WagmiExport;
|
|
82
|
+
|
|
83
|
+
export { type ConnectProps, type ConnectorWalletType, type InitPrivy, type InitSolana, type InitWagmi, MwebUserCenter, Network, SolanaChains, SolanaChainsMap, type SolanaInitialProps, UserCenter, type WalletChainType, WalletChainTypeEnum, WalletConnectorPrivyProvider, WalletType, viem, wagmi, wagmiConnectors };
|