@orderly.network/wallet-connector-privy 2.1.3 → 2.2.0-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 CHANGED
@@ -1,9 +1,11 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
+ import { WalletState, Chains } from '@orderly.network/hooks';
3
+ import { PrivyClientConfig } from '@privy-io/react-auth';
2
4
  import { Adapter, WalletError, WalletAdapterNetwork, WalletAdapter } from '@solana/wallet-adapter-base';
5
+ import { QueryClient } from '@tanstack/react-query';
3
6
  import * as WagmiExport from 'wagmi';
4
7
  import { CreateConnectorFn, Storage, Connector } from 'wagmi';
5
- import { PrivyClientConfig } from '@privy-io/react-auth';
6
- import { Chains } from '@orderly.network/hooks';
8
+ import { ChainNamespace } from '@orderly.network/types';
7
9
  import * as viemExport from 'viem';
8
10
  import * as WagmiConnectorsExport from 'wagmi/connectors';
9
11
 
@@ -22,10 +24,16 @@ declare enum Network {
22
24
  declare enum WalletType {
23
25
  EVM = "EVM",
24
26
  SOL = "SOL",
25
- PRIVY = "privy"
27
+ ABSTRACT = "Abstract"
28
+ }
29
+ declare enum WalletConnectType {
30
+ EVM = "EVM",
31
+ SOL = "SOL",
32
+ PRIVY = "privy",
33
+ ABSTRACT = "Abstract"
26
34
  }
27
35
  interface ConnectProps {
28
- walletType: WalletType;
36
+ walletType: WalletConnectType;
29
37
  extraType?: string;
30
38
  connector?: Connector;
31
39
  walletAdapter?: WalletAdapter;
@@ -33,8 +41,8 @@ interface ConnectProps {
33
41
  interface InitPrivy {
34
42
  appid: string;
35
43
  config?: {
36
- appearance: Omit<PrivyClientConfig['appearance'], 'walletChainType' | 'walletList'>;
37
- loginMethods?: PrivyClientConfig['loginMethods'];
44
+ appearance: Omit<PrivyClientConfig["appearance"], "walletChainType" | "walletList">;
45
+ loginMethods?: PrivyClientConfig["loginMethods"];
38
46
  };
39
47
  }
40
48
  interface InitWagmi {
@@ -47,12 +55,22 @@ interface InitSolana {
47
55
  wallets: Adapter[];
48
56
  onError: (error: WalletError, adapter?: Adapter) => void;
49
57
  }
58
+ interface InitAbstract {
59
+ queryClient?: QueryClient;
60
+ }
50
61
  declare const SolanaChains: Map<WalletAdapterNetwork, number>;
51
62
  declare const SolanaChainsMap: Map<WalletAdapterNetwork | Network, number>;
63
+ declare const AbstractChainsMap: Map<Network, number>;
52
64
  interface ConnectorWalletType {
53
65
  disableWagmi?: boolean;
54
66
  disablePrivy?: boolean;
55
67
  disableSolana?: boolean;
68
+ disableAGW?: boolean;
69
+ }
70
+ interface WalletChainTypeConfig {
71
+ hasEvm: boolean;
72
+ hasSol: boolean;
73
+ hasAbstract: boolean;
56
74
  }
57
75
  declare enum WalletChainTypeEnum {
58
76
  onlyEVM = "onlyEVM",
@@ -60,14 +78,24 @@ declare enum WalletChainTypeEnum {
60
78
  EVM_SOL = "EVM_SOL"
61
79
  }
62
80
  type WalletChainType = WalletChainTypeEnum;
81
+ type IWalletState = WalletState & {
82
+ chain?: {
83
+ namespace: ChainNamespace;
84
+ id: number;
85
+ };
86
+ };
63
87
 
64
88
  interface WalletConnectorPrivyProps extends PropsWithChildren {
65
89
  privyConfig?: InitPrivy;
66
90
  wagmiConfig?: InitWagmi;
67
91
  solanaConfig?: InitSolana;
92
+ abstractConfig?: InitAbstract;
68
93
  network: Network;
69
94
  customChains?: Chains;
70
- termsOfUse: string;
95
+ termsOfUse?: string;
96
+ headerProps?: {
97
+ mobile: React.ReactNode;
98
+ };
71
99
  }
72
100
  declare function WalletConnectorPrivyProvider(props: WalletConnectorPrivyProps): React.JSX.Element | null;
73
101
 
@@ -80,4 +108,4 @@ declare const wagmiConnectors: typeof WagmiConnectorsExport;
80
108
 
81
109
  declare const wagmi: typeof WagmiExport;
82
110
 
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 };
111
+ export { AbstractChainsMap, type ConnectProps, type ConnectorWalletType, type IWalletState, type InitAbstract, type InitPrivy, type InitSolana, type InitWagmi, MwebUserCenter, Network, SolanaChains, SolanaChainsMap, type SolanaInitialProps, UserCenter, type WalletChainType, type WalletChainTypeConfig, WalletChainTypeEnum, WalletConnectType, WalletConnectorPrivyProvider, WalletType, viem, wagmi, wagmiConnectors };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
+ import { WalletState, Chains } from '@orderly.network/hooks';
3
+ import { PrivyClientConfig } from '@privy-io/react-auth';
2
4
  import { Adapter, WalletError, WalletAdapterNetwork, WalletAdapter } from '@solana/wallet-adapter-base';
5
+ import { QueryClient } from '@tanstack/react-query';
3
6
  import * as WagmiExport from 'wagmi';
4
7
  import { CreateConnectorFn, Storage, Connector } from 'wagmi';
5
- import { PrivyClientConfig } from '@privy-io/react-auth';
6
- import { Chains } from '@orderly.network/hooks';
8
+ import { ChainNamespace } from '@orderly.network/types';
7
9
  import * as viemExport from 'viem';
8
10
  import * as WagmiConnectorsExport from 'wagmi/connectors';
9
11
 
@@ -22,10 +24,16 @@ declare enum Network {
22
24
  declare enum WalletType {
23
25
  EVM = "EVM",
24
26
  SOL = "SOL",
25
- PRIVY = "privy"
27
+ ABSTRACT = "Abstract"
28
+ }
29
+ declare enum WalletConnectType {
30
+ EVM = "EVM",
31
+ SOL = "SOL",
32
+ PRIVY = "privy",
33
+ ABSTRACT = "Abstract"
26
34
  }
27
35
  interface ConnectProps {
28
- walletType: WalletType;
36
+ walletType: WalletConnectType;
29
37
  extraType?: string;
30
38
  connector?: Connector;
31
39
  walletAdapter?: WalletAdapter;
@@ -33,8 +41,8 @@ interface ConnectProps {
33
41
  interface InitPrivy {
34
42
  appid: string;
35
43
  config?: {
36
- appearance: Omit<PrivyClientConfig['appearance'], 'walletChainType' | 'walletList'>;
37
- loginMethods?: PrivyClientConfig['loginMethods'];
44
+ appearance: Omit<PrivyClientConfig["appearance"], "walletChainType" | "walletList">;
45
+ loginMethods?: PrivyClientConfig["loginMethods"];
38
46
  };
39
47
  }
40
48
  interface InitWagmi {
@@ -47,12 +55,22 @@ interface InitSolana {
47
55
  wallets: Adapter[];
48
56
  onError: (error: WalletError, adapter?: Adapter) => void;
49
57
  }
58
+ interface InitAbstract {
59
+ queryClient?: QueryClient;
60
+ }
50
61
  declare const SolanaChains: Map<WalletAdapterNetwork, number>;
51
62
  declare const SolanaChainsMap: Map<WalletAdapterNetwork | Network, number>;
63
+ declare const AbstractChainsMap: Map<Network, number>;
52
64
  interface ConnectorWalletType {
53
65
  disableWagmi?: boolean;
54
66
  disablePrivy?: boolean;
55
67
  disableSolana?: boolean;
68
+ disableAGW?: boolean;
69
+ }
70
+ interface WalletChainTypeConfig {
71
+ hasEvm: boolean;
72
+ hasSol: boolean;
73
+ hasAbstract: boolean;
56
74
  }
57
75
  declare enum WalletChainTypeEnum {
58
76
  onlyEVM = "onlyEVM",
@@ -60,14 +78,24 @@ declare enum WalletChainTypeEnum {
60
78
  EVM_SOL = "EVM_SOL"
61
79
  }
62
80
  type WalletChainType = WalletChainTypeEnum;
81
+ type IWalletState = WalletState & {
82
+ chain?: {
83
+ namespace: ChainNamespace;
84
+ id: number;
85
+ };
86
+ };
63
87
 
64
88
  interface WalletConnectorPrivyProps extends PropsWithChildren {
65
89
  privyConfig?: InitPrivy;
66
90
  wagmiConfig?: InitWagmi;
67
91
  solanaConfig?: InitSolana;
92
+ abstractConfig?: InitAbstract;
68
93
  network: Network;
69
94
  customChains?: Chains;
70
- termsOfUse: string;
95
+ termsOfUse?: string;
96
+ headerProps?: {
97
+ mobile: React.ReactNode;
98
+ };
71
99
  }
72
100
  declare function WalletConnectorPrivyProvider(props: WalletConnectorPrivyProps): React.JSX.Element | null;
73
101
 
@@ -80,4 +108,4 @@ declare const wagmiConnectors: typeof WagmiConnectorsExport;
80
108
 
81
109
  declare const wagmi: typeof WagmiExport;
82
110
 
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 };
111
+ export { AbstractChainsMap, type ConnectProps, type ConnectorWalletType, type IWalletState, type InitAbstract, type InitPrivy, type InitSolana, type InitWagmi, MwebUserCenter, Network, SolanaChains, SolanaChainsMap, type SolanaInitialProps, UserCenter, type WalletChainType, type WalletChainTypeConfig, WalletChainTypeEnum, WalletConnectType, WalletConnectorPrivyProvider, WalletType, viem, wagmi, wagmiConnectors };